mirror of
https://github.com/gromlab-ru/svg-sprites.git
synced 2026-07-22 04:40:17 +03:00
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:
16
integration/apps/alpine-webpack/index.html
Normal file
16
integration/apps/alpine-webpack/index.html
Normal file
@@ -0,0 +1,16 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Alpine Webpack sprite fixture</title>
|
||||
<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>
|
||||
</head>
|
||||
<body>
|
||||
<main id="app"></main>
|
||||
</body>
|
||||
</html>
|
||||
23
integration/apps/alpine-webpack/package.json
Normal file
23
integration/apps/alpine-webpack/package.json
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"name": "@svg-sprites-fixtures/alpine-webpack",
|
||||
"private": true,
|
||||
"version": "0.0.0",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"sprites": "svg-sprites src/sprite/svg-sprite.config.json",
|
||||
"typecheck": "tsc --noEmit",
|
||||
"build": "npm run sprites && npm run typecheck && webpack --mode production",
|
||||
"dev": "npm run sprites && webpack serve --mode development"
|
||||
},
|
||||
"dependencies": {
|
||||
"alpinejs": "3.15.12"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@gromlab/svg-sprites": "file:../../..",
|
||||
"html-webpack-plugin": "5.6.7",
|
||||
"typescript": "6.0.2",
|
||||
"webpack": "5.108.4",
|
||||
"webpack-cli": "7.2.1",
|
||||
"webpack-dev-server": "5.2.2"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
import {
|
||||
iconsAlpinePlugin,
|
||||
iconsIconDirective,
|
||||
iconsIconMagic,
|
||||
iconsIconNames,
|
||||
type IconsIconName,
|
||||
} from './sprite/index.js'
|
||||
|
||||
declare const Alpine: { plugin(plugin: typeof iconsAlpinePlugin): void }
|
||||
|
||||
const iconName: IconsIconName = iconsIconNames[0]
|
||||
const directive: 'icons-icon' = iconsIconDirective
|
||||
const magic: 'iconsIconHref' = iconsIconMagic
|
||||
|
||||
Alpine.plugin(iconsAlpinePlugin)
|
||||
void iconName
|
||||
void directive
|
||||
void magic
|
||||
|
||||
// @ts-expect-error Generated icon names form a literal union.
|
||||
const missingIcon: IconsIconName = 'missing'
|
||||
void missingIcon
|
||||
25
integration/apps/alpine-webpack/src/main.js
Normal file
25
integration/apps/alpine-webpack/src/main.js
Normal file
@@ -0,0 +1,25 @@
|
||||
import '@gromlab/svg-sprites/viewer/element'
|
||||
import Alpine from 'alpinejs'
|
||||
import spriteManifest from './sprite/.svg-sprite/svg-sprite.manifest.js'
|
||||
import { iconsAlpinePlugin } from './sprite/index.js'
|
||||
|
||||
Alpine.plugin(iconsAlpinePlugin)
|
||||
window.Alpine = Alpine
|
||||
|
||||
document.querySelector('#app').innerHTML = `
|
||||
<main x-data>
|
||||
<h1>Alpine + Webpack</h1>
|
||||
<svg
|
||||
data-testid="icon"
|
||||
data-app="alpine-webpack"
|
||||
x-icons-icon="'check'"
|
||||
role="img"
|
||||
aria-label="Check icon"
|
||||
style="width:64px;height:64px;color:#16a34a;--icon-color-1:#16a34a"
|
||||
></svg>
|
||||
<gromlab-sprite-viewer viewer-title="Alpine Webpack Viewer"></gromlab-sprite-viewer>
|
||||
</main>
|
||||
`
|
||||
|
||||
document.querySelector('gromlab-sprite-viewer').sources = [spriteManifest]
|
||||
Alpine.start()
|
||||
2
integration/apps/alpine-webpack/src/sprite/.gitignore
vendored
Normal file
2
integration/apps/alpine-webpack/src/sprite/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
# @generated by @gromlab/svg-sprites. Do not edit.
|
||||
/.svg-sprite/
|
||||
1
integration/apps/alpine-webpack/src/sprite/index.d.ts
vendored
Normal file
1
integration/apps/alpine-webpack/src/sprite/index.d.ts
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export * from './.svg-sprite/index.js'
|
||||
1
integration/apps/alpine-webpack/src/sprite/index.js
Normal file
1
integration/apps/alpine-webpack/src/sprite/index.js
Normal file
@@ -0,0 +1 @@
|
||||
export * from './.svg-sprite/index.js'
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"mode": "alpine@webpack",
|
||||
"name": "icons",
|
||||
"input": "../../../../fixtures/icons/check.svg",
|
||||
"generatedNotice": false
|
||||
}
|
||||
12
integration/apps/alpine-webpack/tsconfig.json
Normal file
12
integration/apps/alpine-webpack/tsconfig.json
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES2022",
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "Bundler",
|
||||
"lib": ["ES2022", "DOM"],
|
||||
"strict": true,
|
||||
"noEmit": true,
|
||||
"skipLibCheck": true
|
||||
},
|
||||
"include": ["src/generated-contract.typecheck.ts"]
|
||||
}
|
||||
26
integration/apps/alpine-webpack/webpack.config.js
Normal file
26
integration/apps/alpine-webpack/webpack.config.js
Normal file
@@ -0,0 +1,26 @@
|
||||
import path from 'node:path'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
|
||||
import HtmlWebpackPlugin from 'html-webpack-plugin'
|
||||
|
||||
const root = path.dirname(fileURLToPath(import.meta.url))
|
||||
|
||||
export default {
|
||||
entry: './src/main.js',
|
||||
output: {
|
||||
path: path.join(root, 'dist'),
|
||||
filename: 'assets/app.[contenthash].js',
|
||||
assetModuleFilename: 'assets/[name].[contenthash][ext]',
|
||||
clean: true,
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.css$/,
|
||||
resourceQuery: /inline/,
|
||||
type: 'asset/source',
|
||||
},
|
||||
],
|
||||
},
|
||||
plugins: [new HtmlWebpackPlugin({ template: './index.html' })],
|
||||
}
|
||||
Reference in New Issue
Block a user