feat: добавить поддержку 20 framework exact modes

Добавлены exact modes:
- vue@vite и vue@webpack
- nuxt@vite и nuxt@webpack
- svelte@vite, svelte@webpack и sveltekit@vite
- angular@application и angular@webpack
- astro@vite
- solid@vite, solid@webpack и solid-start@vite
- preact@vite и preact@webpack
- qwik@vite
- lit@vite и lit@webpack
- alpine@vite и alpine@webpack

Для каждого mode реализованы изолированный adapter, нативный
framework-компонент, declarations, manifest, CSS и внешний asset URL.

Добавлены production integration-стенды с генерацией, typecheck,
сборкой и Playwright-проверкой рендера спрайта и Viewer.

Обновлены Viewer, RU/EN-гайды, README, technical reference и AI skills.
Итоговая матрица включает 29 exact modes.

Проверки:
- 48 unit-тестов
- 29 integration E2E-тестов
This commit is contained in:
2026-07-15 16:56:44 +03:00
parent e54ab4991c
commit 8b3365f957
378 changed files with 21188 additions and 650 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>Preact Vite sprite fixture</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.js"></script>
</body>
</html>

View File

@@ -0,0 +1,20 @@
{
"name": "@svg-sprites-fixtures/preact-vite",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"sprites": "svg-sprites src/sprite/svg-sprite.config.ts",
"typecheck": "tsc --noEmit",
"build": "npm run sprites && npm run typecheck && vite build",
"dev": "npm run sprites && vite"
},
"dependencies": {
"preact": "10.27.2"
},
"devDependencies": {
"@gromlab/svg-sprites": "file:../../..",
"typescript": "6.0.2",
"vite": "8.1.4"
}
}

View File

@@ -0,0 +1,13 @@
import { IconsIcon, iconsIconNames } from './sprite/index.js'
import type { IconsIconName, IconsIconProps } from './sprite/index.js'
const iconName: IconsIconName = 'check'
const props: IconsIconProps = { icon: iconName, width: 24 }
void IconsIcon
void iconsIconNames
void props
// @ts-expect-error Generated icon names form a literal union.
const missingIcon: IconsIconName = 'missing'
void missingIcon

View File

@@ -0,0 +1,34 @@
import { h, render } from 'preact'
import '@gromlab/svg-sprites/viewer/element'
import { IconsIcon } from './sprite/index.js'
import './style.css'
const viewerSources = [
() => import('./sprite/.svg-sprite/svg-sprite.manifest.js'),
]
function App() {
const connectViewer = (viewer) => {
if (viewer) viewer.sources = viewerSources
}
return h('main', null,
h('h1', null, 'Preact + Vite'),
h(IconsIcon, {
'data-testid': 'icon',
'data-app': 'preact-vite',
icon: 'check',
'aria-label': 'Check icon',
width: 64,
height: 64,
style: { '--icon-color-1': '#16a34a' },
}),
h('gromlab-sprite-viewer', {
ref: connectViewer,
'viewer-title': 'Preact Vite Viewer',
}),
)
}
render(h(App), document.getElementById('root'))

View File

@@ -0,0 +1,2 @@
# @generated by @gromlab/svg-sprites. Do not edit.
/.svg-sprite/

View File

@@ -0,0 +1 @@
export * from './.svg-sprite/index.js'

View File

@@ -0,0 +1 @@
export * from './.svg-sprite/index.js'

View File

@@ -0,0 +1,8 @@
import { defineSpriteConfig } from '@gromlab/svg-sprites'
export default defineSpriteConfig({
mode: 'preact@vite',
name: 'icons',
input: '../../../../fixtures/icons/check.svg',
generatedNotice: false,
})

View File

@@ -0,0 +1,15 @@
:root {
font-family: system-ui, sans-serif;
color: #172033;
background: #fff;
}
body {
margin: 0;
padding: 40px;
}
gromlab-sprite-viewer {
display: block;
margin-top: 32px;
}

View File

@@ -0,0 +1,12 @@
{
"compilerOptions": {
"target": "ES2022",
"module": "ESNext",
"moduleResolution": "Bundler",
"lib": ["ES2022", "DOM", "DOM.Iterable"],
"strict": true,
"noEmit": true,
"skipLibCheck": true
},
"include": ["src/**/*.ts"]
}

View File

@@ -0,0 +1,3 @@
import { defineConfig } from 'vite'
export default defineConfig({})