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,53 @@
{
"$schema": "../../node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"angular": {
"projectType": "application",
"root": "",
"sourceRoot": "src",
"prefix": "app",
"architect": {
"build": {
"builder": "@angular/build:application",
"options": {
"browser": "src/main.ts",
"index": "src/index.html",
"tsConfig": "tsconfig.app.json",
"assets": [
{
"glob": "**/*",
"input": "public"
}
],
"styles": ["src/styles.css"],
"outputPath": "dist/angular"
},
"configurations": {
"production": {
"outputHashing": "all"
},
"development": {
"optimization": false,
"sourceMap": true
}
},
"defaultConfiguration": "production"
},
"serve": {
"builder": "@angular/build:dev-server",
"configurations": {
"production": {
"buildTarget": "angular:build:production"
},
"development": {
"buildTarget": "angular:build:development"
}
},
"defaultConfiguration": "development"
}
}
}
}
}

View File

@@ -0,0 +1,27 @@
{
"name": "@svg-sprites-fixtures/angular",
"private": true,
"version": "0.0.0",
"scripts": {
"sprites": "svg-sprites --mode legacy .",
"typecheck": "ngc -p tsconfig.app.json --noEmit",
"build": "npm run sprites && ng build --configuration production",
"dev": "npm run sprites && ng serve"
},
"dependencies": {
"@angular/common": "21.2.18",
"@angular/compiler": "21.2.18",
"@angular/core": "21.2.18",
"@angular/platform-browser": "21.2.18",
"rxjs": "7.8.2",
"tslib": "2.8.1",
"zone.js": "0.16.2"
},
"devDependencies": {
"@angular/build": "21.2.18",
"@angular/cli": "21.2.18",
"@angular/compiler-cli": "21.2.18",
"@gromlab/svg-sprites": "file:../../..",
"typescript": "5.9.3"
}
}

View File

@@ -0,0 +1,20 @@
import { Component } from '@angular/core'
@Component({
selector: 'app-root',
standalone: true,
template: `
<main>
<h1>Angular</h1>
<svg
data-testid="icon"
data-app="angular"
aria-label="Check icon"
viewBox="0 0 24 24"
>
<use href="/sprites/icons.sprite.svg#check"></use>
</svg>
</main>
`,
})
export class AppComponent {}

View File

@@ -0,0 +1,11 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Angular sprite fixture</title>
</head>
<body>
<app-root></app-root>
</body>
</html>

View File

@@ -0,0 +1,5 @@
import { bootstrapApplication } from '@angular/platform-browser'
import { AppComponent } from './app.component'
bootstrapApplication(AppComponent).catch((error: unknown) => console.error(error))

View File

@@ -0,0 +1,16 @@
:root {
font-family: system-ui, sans-serif;
color: #172033;
background: #fff;
}
body {
margin: 0;
padding: 40px;
}
[data-testid='icon'] {
width: 64px;
height: 64px;
color: #16a34a;
}

View File

@@ -0,0 +1,11 @@
export default {
output: 'public/sprites',
preview: false,
sprites: [
{
name: 'icons',
input: '../../fixtures/icons',
format: 'symbol',
},
],
}

View File

@@ -0,0 +1,9 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "./out-tsc/app",
"types": []
},
"files": ["src/main.ts"],
"include": ["src/**/*.d.ts"]
}

View File

@@ -0,0 +1,27 @@
{
"compilerOptions": {
"baseUrl": ".",
"outDir": "./dist/out-tsc",
"forceConsistentCasingInFileNames": true,
"strict": true,
"noImplicitOverride": true,
"noPropertyAccessFromIndexSignature": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"sourceMap": true,
"declaration": false,
"downlevelIteration": true,
"experimentalDecorators": true,
"moduleResolution": "bundler",
"importHelpers": true,
"target": "ES2022",
"module": "ES2022",
"lib": ["ES2022", "DOM"]
},
"angularCompilerOptions": {
"enableI18nLegacyMessageIdFormat": false,
"strictInjectionParameters": true,
"strictInputAccessModifiers": true,
"strictTemplates": true
}
}