mirror of
https://github.com/gromlab-ru/svg-sprites.git
synced 2026-07-22 04:40:17 +03:00
test: добавить площадку интеграционного тестирования
- добавлены consumer fixtures для React и Next.js - добавлены typecheck, production build и браузерные smoke-тесты - добавлена интеграционная проверка в CI
This commit is contained in:
6
integration/apps/next-pages-webpack/next-env.d.ts
vendored
Normal file
6
integration/apps/next-pages-webpack/next-env.d.ts
vendored
Normal 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.
|
||||
10
integration/apps/next-pages-webpack/next.config.mjs
Normal file
10
integration/apps/next-pages-webpack/next.config.mjs
Normal file
@@ -0,0 +1,10 @@
|
||||
import path from 'node:path'
|
||||
|
||||
const integrationRoot = path.resolve(import.meta.dirname, '../..')
|
||||
|
||||
export default {
|
||||
outputFileTracingRoot: integrationRoot,
|
||||
turbopack: {
|
||||
root: integrationRoot,
|
||||
},
|
||||
}
|
||||
24
integration/apps/next-pages-webpack/package.json
Normal file
24
integration/apps/next-pages-webpack/package.json
Normal file
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"name": "@svg-sprites-fixtures/next-pages-webpack",
|
||||
"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 --webpack",
|
||||
"dev": "npm run sprites && next dev --webpack",
|
||||
"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"
|
||||
}
|
||||
}
|
||||
7
integration/apps/next-pages-webpack/pages/_app.tsx
Normal file
7
integration/apps/next-pages-webpack/pages/_app.tsx
Normal file
@@ -0,0 +1,7 @@
|
||||
import type { AppProps } from 'next/app'
|
||||
|
||||
import './style.css'
|
||||
|
||||
export default function App({ Component, pageProps }: AppProps) {
|
||||
return <Component {...pageProps} />
|
||||
}
|
||||
18
integration/apps/next-pages-webpack/pages/index.tsx
Normal file
18
integration/apps/next-pages-webpack/pages/index.tsx
Normal file
@@ -0,0 +1,18 @@
|
||||
import { IconsIcon } from '../src/sprite'
|
||||
|
||||
export default function Page() {
|
||||
return (
|
||||
<main>
|
||||
<h1>Next.js Pages Router + Webpack</h1>
|
||||
<IconsIcon
|
||||
data-testid="icon"
|
||||
data-app="next-pages-webpack"
|
||||
icon="check"
|
||||
aria-label="Check icon"
|
||||
width={64}
|
||||
height={64}
|
||||
style={{ '--icon-color-1': '#16a34a' }}
|
||||
/>
|
||||
</main>
|
||||
)
|
||||
}
|
||||
10
integration/apps/next-pages-webpack/pages/style.css
Normal file
10
integration/apps/next-pages-webpack/pages/style.css
Normal file
@@ -0,0 +1,10 @@
|
||||
:root {
|
||||
font-family: system-ui, sans-serif;
|
||||
color: #172033;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 40px;
|
||||
}
|
||||
2
integration/apps/next-pages-webpack/src/sprite/.gitignore
vendored
Normal file
2
integration/apps/next-pages-webpack/src/sprite/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
# @generated by @gromlab/svg-sprites. Do not edit.
|
||||
/.svg-sprite/
|
||||
1
integration/apps/next-pages-webpack/src/sprite/index.ts
Normal file
1
integration/apps/next-pages-webpack/src/sprite/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export * from './.svg-sprite'
|
||||
@@ -0,0 +1,8 @@
|
||||
import { defineSpriteConfig } from '@gromlab/svg-sprites'
|
||||
|
||||
export default defineSpriteConfig({
|
||||
mode: 'next@pages/webpack',
|
||||
name: 'icons',
|
||||
inputFiles: ['../../../../fixtures/icons/check.svg'],
|
||||
generatedNotice: false,
|
||||
})
|
||||
35
integration/apps/next-pages-webpack/tsconfig.json
Normal file
35
integration/apps/next-pages-webpack/tsconfig.json
Normal 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"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user