Files
marketplaces/angular.json

155 lines
4.4 KiB
JSON
Raw Permalink Normal View History

2026-01-18 18:57:06 +04:00
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"Dexarmarket": {
"projectType": "application",
"schematics": {
"@schematics/angular:component": {
"style": "scss"
}
},
"root": "",
"sourceRoot": "src",
"prefix": "app",
"architect": {
"build": {
"builder": "@angular/build:application",
"options": {
"outputPath": "dist/dexarmarket",
"browser": "src/main.ts",
"polyfills": [
"zone.js"
],
"tsConfig": "tsconfig.app.json",
"inlineStyleLanguage": "scss",
"assets": [
{
"glob": "**/*",
"input": "public"
},
{
"glob": "**/*",
"input": "src/assets",
"output": "assets"
2026-01-18 18:57:06 +04:00
}
],
"styles": [
"src/styles.scss"
]
},
"configurations": {
"production": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.production.ts"
2026-06-21 23:42:39 +04:00
},
{
"replace": "src/app/interceptors/mock-data.interceptor.ts",
"with": "src/app/interceptors/mock-data.interceptor.production.ts"
refactor(di): keep mock gateways out of production builds (FH-E.6) 21 DI tokens selected their implementation like this: factory: () => (environment.useMockData ? inject(XLocal) : inject(XApi)) That reads as a toggle and is not one. Naming both classes in the factory keeps both reachable, so every mock shipped regardless of the flag - and `useMockData` is false in both environment files, so none of them were ever the selected implementation in the first place. Verified: a fixture string from partner-hierarchy-local.gateway.ts was present in a production bundle. Token factories now inject the API gateway unconditionally. Mock overrides move to src/app/mock-gateway.providers.ts, swapped for a production copy that imports nothing, via the same fileReplacements mechanism mock-data.interceptor.production.ts already uses. Dev behaviour is unchanged - flip useMockData in environment.ts exactly as before. useExisting rather than useClass: the local gateways are already providedIn: 'root' singletons, and an app-level provider for the token wins over its tree-shakable default. scan-bundle.sh gains two patterns so this cannot come back: any *LocalGateway class name, and known fixture literals. Verified in both directions - clean against the real dist, exit 1 against a planted OfferLocalGateway. Result: zero LocalGateway classes and zero fixtures in the production bundle, down from 21 classes and 75 kB of source. Initial bundle is unchanged at 1.55 MB because these all sat in lazy chunks; the win is that production can no longer serve seeded fixtures as real data, not bytes off the critical path. Not addressed here: MediaRepository is still bound to MockMediaRepository unconditionally in app.config.ts. That one cannot be deleted - no real implementation exists yet - so it is a missing API gateway, not dead weight. Tracked separately. 256 tests pass. Build green, boundaries and cycles green. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-21 15:59:11 +04:00
},
{
"replace": "src/app/mock-gateway.providers.ts",
"with": "src/app/mock-gateway.providers.production.ts"
2026-01-18 18:57:06 +04:00
}
],
"styles": [
"src/styles.scss",
"src/styles/themes/dexar.theme.scss"
],
"budgets": [
{
"type": "initial",
"maximumWarning": "700kB",
perf(build): drop the JIT compiler from production, 1.55 MB -> 1.04 MB (FH-3.4) Built with --stats-json and read the esbuild metafile instead of guessing. @angular/compiler was 495,831 bytes of a 1.5 MB main chunk - the JIT compiler, in an AOT production build, 33% of everything an anonymous visitor downloads. src/main.ts imported it deliberately, with a comment explaining that @marketplaces/auth shipped plain tsc output carrying no Ivy metadata, so Angular JIT-compiled its classes at runtime and bootstrap threw without it. That comment was stale. The package is 0.2.0, built with ng-packagr, module: dist/fesm2022/marketplaces-auth.mjs - proper Angular Package Format, partial-compiled (ɵɵngDeclareInjectable), linked at consumer build time. Nothing needs JIT. Verified against the production bundle served statically, not just a green build: the failure mode this guarded was a runtime throw, so a successful compile proves nothing. Angular 22.0.8 bootstrapped, the router resolved /ru, and the app rendered its own "server unavailable" screen - meaning DI, HttpClient and the full interceptor chain ran. That chain injects AuthService from @marketplaces/auth, the exact class the old comment named. Zero JIT or compiler errors; the only console output was the expected 404s from having no backend behind a static server. Initial bundle 1.55 MB -> 1.04 MB raw, 323.58 kB -> 215.45 kB transfer. Budget ratchet lowered 1.6MB -> 1.1MB, which is now also what stops the import being re-added. Next lever, deliberately not taken here: i18n/ru.ts is 290 kB, eager, while en/hy are already lazy. TranslateService has the loader plumbing and languageGuard already awaits a preload, so it is mechanically small - but it adds a round-trip before first paint for the majority language, which is a product tradeoff, not a cleanup. Roughly a 750 kB bundle once someone decides. 256 tests pass. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-21 16:10:34 +04:00
"maximumError": "1.1MB"
2026-01-18 18:57:06 +04:00
},
{
"type": "anyComponentStyle",
2026-05-19 02:07:39 +04:00
"maximumWarning": "40kB",
"maximumError": "50kB"
2026-01-18 18:57:06 +04:00
}
],
"outputHashing": "all",
"optimization": {
"scripts": true,
"styles": {
"minify": true,
"inlineCritical": true
},
"fonts": {
"inline": true
}
},
"sourceMap": false,
"namedChunks": false,
"extractLicenses": true,
"serviceWorker": "ngsw-config.json"
},
"development": {
"styles": [
"src/styles.scss",
"src/styles/themes/dexar.theme.scss"
],
"optimization": false,
"extractLicenses": false,
"sourceMap": true
}
},
"defaultConfiguration": "production"
},
"serve": {
"options": {
2026-05-19 02:01:36 +04:00
"allowedHosts": [
"dexarmarket.ru",
"dexar.market",
2026-07-05 00:38:21 +04:00
"localhost"
2026-07-05 01:36:21 +04:00
]
2026-01-18 18:57:06 +04:00
},
"builder": "@angular/build:dev-server",
"configurations": {
"production": {
"buildTarget": "Dexarmarket:build:production"
},
"development": {
"proxyConfig": "proxy.conf.json",
2026-01-18 18:57:06 +04:00
"buildTarget": "Dexarmarket:build:development"
}
},
"defaultConfiguration": "development"
},
"extract-i18n": {
"builder": "@angular/build:extract-i18n"
},
"test": {
"builder": "@angular/build:karma",
"options": {
"polyfills": [
"zone.js",
"zone.js/testing"
],
"tsConfig": "tsconfig.spec.json",
"karmaConfig": "karma.conf.js",
"inlineStyleLanguage": "scss",
"assets": [
{
"glob": "**/*",
"input": "public"
},
{
"glob": "**/*",
"input": "src/assets",
"output": "assets"
}
],
"styles": [
"src/styles.scss"
]
}
2026-01-18 18:57:06 +04:00
}
}
}
}
2026-05-19 02:07:39 +04:00
}