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,6 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />
import "./.next/types/routes.d.ts";
// NOTE: This file should not be edited
// see https://nextjs.org/docs/pages/api-reference/config/typescript for more information.

View File

@@ -0,0 +1,10 @@
import path from 'node:path'
const integrationRoot = path.resolve(import.meta.dirname, '../..')
export default {
outputFileTracingRoot: integrationRoot,
turbopack: {
root: integrationRoot,
},
}

View File

@@ -0,0 +1,24 @@
{
"name": "@svg-sprites-fixtures/next-pages-turbopack",
"private": true,
"version": "0.0.0",
"scripts": {
"sprites": "svg-sprites src/sprite/svg-sprite.config.ts",
"typecheck": "tsc --noEmit",
"build": "npm run sprites && next build --turbopack",
"dev": "npm run sprites && next dev --turbopack",
"start": "next start"
},
"dependencies": {
"next": "16.2.10",
"react": "19.2.5",
"react-dom": "19.2.5"
},
"devDependencies": {
"@gromlab/svg-sprites": "file:../../..",
"@types/node": "24.12.0",
"@types/react": "19.2.17",
"@types/react-dom": "19.2.3",
"typescript": "6.0.2"
}
}

View File

@@ -0,0 +1,7 @@
import type { AppProps } from 'next/app'
import './style.css'
export default function App({ Component, pageProps }: AppProps) {
return <Component {...pageProps} />
}

View File

@@ -0,0 +1,18 @@
import { IconsIcon } from '../src/sprite'
export default function Page() {
return (
<main>
<h1>Next.js Pages Router + Turbopack</h1>
<IconsIcon
data-testid="icon"
data-app="next-pages-turbopack"
icon="check"
aria-label="Check icon"
width={64}
height={64}
style={{ '--icon-color-1': '#16a34a' }}
/>
</main>
)
}

View File

@@ -0,0 +1,10 @@
:root {
font-family: system-ui, sans-serif;
color: #172033;
background: #fff;
}
body {
margin: 0;
padding: 40px;
}

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'

View File

@@ -0,0 +1,8 @@
import { defineSpriteConfig } from '@gromlab/svg-sprites'
export default defineSpriteConfig({
mode: 'next@pages/turbopack',
name: 'icons',
inputFiles: ['../../../../fixtures/icons/check.svg'],
generatedNotice: false,
})

View File

@@ -0,0 +1,35 @@
{
"compilerOptions": {
"target": "ES2022",
"lib": [
"DOM",
"DOM.Iterable",
"ES2022"
],
"allowJs": false,
"skipLibCheck": true,
"strict": true,
"noEmit": true,
"esModuleInterop": true,
"module": "ESNext",
"moduleResolution": "Bundler",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "react-jsx",
"plugins": [
{
"name": "next"
}
],
"incremental": true
},
"include": [
"next-env.d.ts",
".next/types/**/*.ts",
"**/*.ts",
"**/*.tsx"
],
"exclude": [
"node_modules"
]
}