8de19320c5
Generate the four phase-4 libraries: - libs/shared/tokens (project name shared-tokens) - plain TS lib via @nx/js:library; will host the a11y design tokens (palette, contrast tiers, spacing, motion) once Tailwind lands in phase 5; consumable by both apps; tagged scope:shared, type:shared. - libs/shared/util (shared-util) - plain TS lib for cross-cutting utility code; tagged scope:shared, type:shared. - libs/shared/ui (shared-ui) - Angular standalone library that will host the spartan-ng components copy-pasted in phase 5; Angular-only so tagged scope:portal-shell, type:shared. unitTestRunner= vitest-analog because vitest-angular requires a buildable lib. - libs/feature/auth (feature-auth) - placeholder Angular standalone feature lib to demonstrate the type:feature pattern; tagged scope:portal-shell, type:feature. @nx/enforce-module-boundaries depConstraints replaced (root eslint.config.mjs) with the rules from ADR-0003: scope:portal-shell -> scope:portal-shell, scope:shared scope:portal-bff -> scope:portal-bff, scope:shared scope:shared -> scope:shared type:app -> type:feature, type:shared type:feature -> type:feature, type:shared type:shared -> type:shared This forbids portal-shell from importing portal-bff code (and vice versa) and prevents shared libs from depending on feature libs. Project names follow the convention of ADR-0003 (feature-<name> / shared-<scope>) by passing --name explicitly to the generator; the Nx 22 default takes only the last directory segment. Sanity check: pnpm nx run-many -t lint and -t test pass for the 8 projects (4 apps/e2e + 4 libs). Side effects from the generators: tsconfig.base.json paths populated with the lib import aliases; nx.json gains vite/playwright plugin entries; .gitignore picks up vitest.config.*.timestamp* (Vitest temp files); package.json gains @analogjs/vitest-angular and related devDeps; pnpm-lock.yaml regenerated. Two eslint-disable comments in portal-bff-e2e support files were trimmed by lint --fix - those files already lint clean without the directive.
115 lines
2.7 KiB
JSON
115 lines
2.7 KiB
JSON
{
|
|
"$schema": "./node_modules/nx/schemas/nx-schema.json",
|
|
"namedInputs": {
|
|
"default": ["{projectRoot}/**/*", "sharedGlobals"],
|
|
"production": [
|
|
"default",
|
|
"!{projectRoot}/.eslintrc.json",
|
|
"!{projectRoot}/eslint.config.mjs",
|
|
"!{projectRoot}/**/?(*.)+(spec|test).[jt]s?(x)?(.snap)",
|
|
"!{projectRoot}/tsconfig.spec.json",
|
|
"!{projectRoot}/jest.config.[jt]s",
|
|
"!{projectRoot}/src/test-setup.[jt]s",
|
|
"!{projectRoot}/test-setup.[jt]s"
|
|
],
|
|
"sharedGlobals": []
|
|
},
|
|
"plugins": [
|
|
{
|
|
"plugin": "@nx/js/typescript",
|
|
"options": {
|
|
"typecheck": {
|
|
"targetName": "typecheck"
|
|
},
|
|
"build": {
|
|
"targetName": "build",
|
|
"configName": "tsconfig.lib.json",
|
|
"buildDepsName": "build-deps",
|
|
"watchDepsName": "watch-deps"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"plugin": "@nx/playwright/plugin",
|
|
"options": {
|
|
"targetName": "e2e"
|
|
}
|
|
},
|
|
{
|
|
"plugin": "@nx/eslint/plugin",
|
|
"options": {
|
|
"targetName": "lint"
|
|
}
|
|
},
|
|
{
|
|
"plugin": "@nx/webpack/plugin",
|
|
"options": {
|
|
"buildTargetName": "build",
|
|
"serveTargetName": "serve",
|
|
"previewTargetName": "preview",
|
|
"buildDepsTargetName": "build-deps",
|
|
"watchDepsTargetName": "watch-deps",
|
|
"serveStaticTargetName": "serve-static"
|
|
}
|
|
},
|
|
{
|
|
"plugin": "@nx/jest/plugin",
|
|
"options": {
|
|
"targetName": "test"
|
|
},
|
|
"exclude": ["apps/portal-bff-e2e/**/*"]
|
|
},
|
|
{
|
|
"plugin": "@nx/vitest",
|
|
"options": {
|
|
"testTargetName": "test",
|
|
"ciTargetName": "test-ci",
|
|
"testMode": "watch"
|
|
}
|
|
}
|
|
],
|
|
"analytics": false,
|
|
"targetDefaults": {
|
|
"@angular/build:application": {
|
|
"cache": true,
|
|
"dependsOn": ["^build"],
|
|
"inputs": ["production", "^production"]
|
|
},
|
|
"@nx/eslint:lint": {
|
|
"cache": true,
|
|
"inputs": [
|
|
"default",
|
|
"^default",
|
|
"{workspaceRoot}/.eslintrc.json",
|
|
"{workspaceRoot}/.eslintignore",
|
|
"{workspaceRoot}/eslint.config.mjs",
|
|
"{workspaceRoot}/tools/eslint-rules/**/*"
|
|
]
|
|
},
|
|
"@angular/build:unit-test": {
|
|
"cache": true,
|
|
"inputs": ["default", "^production"]
|
|
},
|
|
"@nx/js:tsc": {
|
|
"cache": true,
|
|
"dependsOn": ["^build"],
|
|
"inputs": ["production", "^production"]
|
|
}
|
|
},
|
|
"generators": {
|
|
"@nx/angular:application": {
|
|
"e2eTestRunner": "playwright",
|
|
"linter": "eslint",
|
|
"style": "scss",
|
|
"unitTestRunner": "vitest-angular"
|
|
},
|
|
"@nx/angular:library": {
|
|
"linter": "eslint",
|
|
"unitTestRunner": "vitest-analog"
|
|
},
|
|
"@nx/angular:component": {
|
|
"style": "css"
|
|
}
|
|
}
|
|
}
|