test: добавить площадку интеграционного тестирования

- добавлены consumer fixtures для React и Next.js
- добавлены typecheck, production build и браузерные smoke-тесты
- добавлена интеграционная проверка в CI
This commit is contained in:
2026-07-13 20:08:31 +03:00
parent 7992adc9d3
commit 632b450c8b
130 changed files with 26424 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Solid Vite sprite fixture</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>

View File

@@ -0,0 +1,21 @@
{
"name": "@svg-sprites-fixtures/solid-vite",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"sprites": "svg-sprites --mode legacy .",
"typecheck": "tsc --noEmit",
"build": "npm run sprites && tsc --noEmit && vite build",
"dev": "npm run sprites && vite"
},
"dependencies": {
"solid-js": "1.9.14"
},
"devDependencies": {
"@gromlab/svg-sprites": "file:../../..",
"typescript": "6.0.2",
"vite": "8.1.4",
"vite-plugin-solid": "2.11.12"
}
}

View File

@@ -0,0 +1,21 @@
import { render } from 'solid-js/web'
import './style.css'
function App() {
return (
<main>
<h1>Solid + Vite</h1>
<svg
data-testid="icon"
data-app="solid-vite"
aria-label="Check icon"
viewBox="0 0 24 24"
>
<use href="/sprites/icons.sprite.svg#check" />
</svg>
</main>
)
}
render(() => <App />, document.getElementById('root')!)

View File

@@ -0,0 +1,16 @@
:root {
font-family: system-ui, sans-serif;
color: #172033;
background: #fff;
}
body {
margin: 0;
padding: 40px;
}
[data-testid='icon'] {
width: 64px;
height: 64px;
color: #16a34a;
}

View File

@@ -0,0 +1 @@
/// <reference types="vite/client" />

View File

@@ -0,0 +1,11 @@
export default {
output: 'public/sprites',
preview: false,
sprites: [
{
name: 'icons',
input: '../../fixtures/icons',
format: 'symbol',
},
],
}

View File

@@ -0,0 +1,14 @@
{
"compilerOptions": {
"target": "ES2022",
"module": "ESNext",
"moduleResolution": "Bundler",
"lib": ["ES2022", "DOM", "DOM.Iterable"],
"jsx": "preserve",
"jsxImportSource": "solid-js",
"strict": true,
"noEmit": true,
"skipLibCheck": true
},
"include": ["src"]
}

View File

@@ -0,0 +1,6 @@
import { defineConfig } from 'vite'
import solid from 'vite-plugin-solid'
export default defineConfig({
plugins: [solid()],
})