f7c3ba24d7
Per ADR-0020 §"Shared-libs graduation": the three primitives that
both `portal-shell` (today) and `portal-admin` (next) will share
move out of `apps/portal-shell/src/` and into the workspace libs.
Mechanical move — no behaviour change.
Graduated:
- `Icon` component → `libs/shared/ui/src/lib/icon/`. Selector
renamed `app-icon` → `lib-icon` (consumed via `<lib-icon>`),
`IconName` re-exported from `shared-ui`.
- `LayoutStateService` (+ `ThemeMode` type) →
`libs/shared/state/src/lib/`. New library generated via
`nx g @nx/angular:library` to match the existing
`feature-auth` / `shared-ui` shape.
- Brand-palette `@theme` block →
`libs/shared/tokens/src/brand-tokens.css`. `portal-shell`'s
`styles.css` imports it by relative path.
Lib tags updated so the module-boundary lint rule lets both apps
consume them:
- `shared-state`: new lib → `scope:shared, type:shared`.
- `shared-ui`: was `scope:portal-shell` (stopgap from the initial
scaffold) → `scope:shared, type:shared`.
Side-edits:
- `tsconfig.base.json` gains the `shared-state` path alias
(generator-applied).
- `shared-tokens` is now CSS-only — its placeholder TS function is
removed and its vitest config flips `passWithNoTests: true` since
there is nothing to test there yet.
- Placeholder `shared-ui/shared-ui.{ts,html,css,spec.ts}` files
removed.
Verification:
- Lint / test / build run-many across the four projects — green.
- portal-shell: 28 tests, shared-state: 9, shared-ui: 3 (= the same
40 specs as before, redistributed across the new libs).
- Production build: 128.7 KB gzip initial per locale (was 128.5 KB
on main — noise-level delta).
- Brand tokens still inlined in the produced `styles-*.css`.
- Both `dist/.../browser/{en,fr}/` emitted as expected.
No public-API breakage. The migration to `portal-admin` is now a
clean `import { Icon } from 'shared-ui'` + `LayoutStateService`
inject + `@import` of `brand-tokens.css` on admin's `styles.css` —
no duplication.
35 lines
1.0 KiB
JSON
35 lines
1.0 KiB
JSON
{
|
|
"compilerOptions": {
|
|
"rootDir": ".",
|
|
"baseUrl": ".",
|
|
"paths": {
|
|
"shared-tokens": ["./libs/shared/tokens/src/index.ts"],
|
|
"shared-util": ["./libs/shared/util/src/index.ts"],
|
|
"shared-ui": ["./libs/shared/ui/src/index.ts"],
|
|
"feature-auth": ["./libs/feature/auth/src/index.ts"],
|
|
"shared-state": ["./libs/shared/state/src/index.ts"]
|
|
},
|
|
"sourceMap": true,
|
|
"declaration": false,
|
|
"importHelpers": true,
|
|
"isolatedModules": true,
|
|
"lib": ["es2022", "dom"],
|
|
"module": "esnext",
|
|
"moduleResolution": "bundler",
|
|
"target": "es2022",
|
|
"experimentalDecorators": true,
|
|
"emitDecoratorMetadata": true,
|
|
"useDefineForClassFields": false,
|
|
"noFallthroughCasesInSwitch": true,
|
|
"noImplicitOverride": true,
|
|
"noImplicitReturns": true,
|
|
"noUnusedLocals": true,
|
|
"skipLibCheck": true,
|
|
"skipDefaultLibCheck": true,
|
|
"strict": true,
|
|
"noUncheckedIndexedAccess": true,
|
|
"exactOptionalPropertyTypes": true,
|
|
"noPropertyAccessFromIndexSignature": true
|
|
}
|
|
}
|