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,37 @@
<script setup>
import { IconsIcon } from '../src/sprite/index.js'
</script>
<template>
<main>
<h1>Nuxt + Webpack</h1>
<IconsIcon
data-testid="icon"
data-app="nuxt-webpack"
icon="check"
aria-label="Check icon"
width="64"
height="64"
style="--icon-color-1: #16a34a"
/>
<SpriteViewer />
</main>
</template>
<style>
:root {
font-family: system-ui, sans-serif;
color: #172033;
background: #fff;
}
body {
margin: 0;
padding: 40px;
}
gromlab-sprite-viewer {
display: block;
margin-top: 32px;
}
</style>

View File

@@ -0,0 +1,16 @@
<script setup>
import { defineSpriteViewerElement } from '@gromlab/svg-sprites/viewer'
defineSpriteViewerElement()
const viewerSources = [
() => import('../../src/sprite/.svg-sprite/svg-sprite.manifest.js'),
]
</script>
<template>
<gromlab-sprite-viewer
:sources="viewerSources"
viewer-title="Nuxt Webpack Viewer"
/>
</template>

View File

@@ -0,0 +1,15 @@
import { IconsIcon } from '../src/sprite/.svg-sprite/index.js'
import type { IconsIconName, IconsIconProps } from '../src/sprite/.svg-sprite/index.js'
const iconName: IconsIconName = 'check'
const iconProps: IconsIconProps = {
icon: iconName,
width: 64,
style: { '--icon-color-1': '#16a34a' },
}
void [IconsIcon, iconProps]
// @ts-expect-error Generated icon names form a literal union.
const missingIcon: IconsIconName = 'missing'
void missingIcon

View File

@@ -0,0 +1,28 @@
export default defineNuxtConfig({
compatibilityDate: '2026-07-01',
devtools: { enabled: false },
builder: 'webpack',
nitro: {
externals: {
inline: ['entities'],
},
},
hooks: {
'webpack:config'(configs) {
for (const config of configs) {
const rules = config.module?.rules ?? []
for (const rule of rules) {
if (rule && typeof rule === 'object' && rule.test instanceof RegExp && rule.test.test('icon.svg')) {
rule.exclude = rule.exclude ? [rule.exclude, /\.svg$/i] : /\.svg$/i
}
}
rules.unshift({ test: /\.svg$/i, type: 'asset/resource' })
}
},
},
vue: {
compilerOptions: {
isCustomElement: (tag) => tag === 'gromlab-sprite-viewer',
},
},
})

View File

@@ -0,0 +1,25 @@
{
"name": "@svg-sprites-fixtures/nuxt-webpack",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"sprites": "svg-sprites src/sprite/svg-sprite.config.ts",
"typecheck": "nuxt typecheck",
"build": "npm run sprites && nuxt build",
"dev": "npm run sprites && nuxt dev",
"start": "node .output/server/index.mjs"
},
"dependencies": {
"entities": "7.0.1",
"nuxt": "4.3.1",
"vue": "3.5.39"
},
"devDependencies": {
"@gromlab/svg-sprites": "file:../../..",
"@nuxt/webpack-builder": "4.3.1",
"postcss-loader": "8.2.1",
"typescript": "6.0.2",
"vue-tsc": "3.3.7"
}
}

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: 'nuxt@webpack',
name: 'icons',
input: '../../../../fixtures/icons/check.svg',
generatedNotice: false,
})