From e5dd1e312d7a9a7ec5d20e295d15acc1cc9e9e22 Mon Sep 17 00:00:00 2001 From: Lorenz Hilpert Date: Tue, 2 Dec 2025 16:14:35 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat(shell):=20scaffold=20shell-lay?= =?UTF-8?q?out,=20shell-header,=20and=20shell-navigation=20libraries?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add new shell domain with three feature libraries: - shell-layout: Main application layout container - shell-header: Application header component - shell-navigation: Navigation component All libraries configured with: - Standalone Angular components - Vitest with JUnit and Cobertura reporters - Architectural tags (scope:shell, type:feature) --- libs/shell/header/README.md | 7 ++++ libs/shell/header/eslint.config.cjs | 34 +++++++++++++++++++ libs/shell/header/project.json | 20 +++++++++++ libs/shell/header/src/index.ts | 1 + .../shell-header/shell-header.component.css | 0 .../shell-header/shell-header.component.html | 1 + .../shell-header.component.spec.ts | 21 ++++++++++++ .../shell-header/shell-header.component.ts | 10 ++++++ libs/shell/header/src/test-setup.ts | 13 +++++++ libs/shell/header/tsconfig.json | 30 ++++++++++++++++ libs/shell/header/tsconfig.lib.json | 27 +++++++++++++++ libs/shell/header/tsconfig.spec.json | 29 ++++++++++++++++ libs/shell/header/vite.config.mts | 31 +++++++++++++++++ libs/shell/layout/README.md | 7 ++++ libs/shell/layout/eslint.config.cjs | 34 +++++++++++++++++++ libs/shell/layout/project.json | 20 +++++++++++ libs/shell/layout/src/index.ts | 1 + .../shell-layout/shell-layout.component.css | 0 .../shell-layout/shell-layout.component.html | 1 + .../shell-layout.component.spec.ts | 21 ++++++++++++ .../shell-layout/shell-layout.component.ts | 10 ++++++ libs/shell/layout/src/test-setup.ts | 13 +++++++ libs/shell/layout/tsconfig.json | 30 ++++++++++++++++ libs/shell/layout/tsconfig.lib.json | 27 +++++++++++++++ libs/shell/layout/tsconfig.spec.json | 29 ++++++++++++++++ libs/shell/layout/vite.config.mts | 31 +++++++++++++++++ libs/shell/navigation/README.md | 7 ++++ libs/shell/navigation/eslint.config.cjs | 34 +++++++++++++++++++ libs/shell/navigation/project.json | 20 +++++++++++ libs/shell/navigation/src/index.ts | 1 + .../shell-navigation.component.css | 0 .../shell-navigation.component.html | 1 + .../shell-navigation.component.spec.ts | 21 ++++++++++++ .../shell-navigation.component.ts | 10 ++++++ libs/shell/navigation/src/test-setup.ts | 13 +++++++ libs/shell/navigation/tsconfig.json | 30 ++++++++++++++++ libs/shell/navigation/tsconfig.lib.json | 27 +++++++++++++++ libs/shell/navigation/tsconfig.spec.json | 29 ++++++++++++++++ libs/shell/navigation/vite.config.mts | 31 +++++++++++++++++ tsconfig.base.json | 3 ++ 40 files changed, 675 insertions(+) create mode 100644 libs/shell/header/README.md create mode 100644 libs/shell/header/eslint.config.cjs create mode 100644 libs/shell/header/project.json create mode 100644 libs/shell/header/src/index.ts create mode 100644 libs/shell/header/src/lib/shell-header/shell-header.component.css create mode 100644 libs/shell/header/src/lib/shell-header/shell-header.component.html create mode 100644 libs/shell/header/src/lib/shell-header/shell-header.component.spec.ts create mode 100644 libs/shell/header/src/lib/shell-header/shell-header.component.ts create mode 100644 libs/shell/header/src/test-setup.ts create mode 100644 libs/shell/header/tsconfig.json create mode 100644 libs/shell/header/tsconfig.lib.json create mode 100644 libs/shell/header/tsconfig.spec.json create mode 100644 libs/shell/header/vite.config.mts create mode 100644 libs/shell/layout/README.md create mode 100644 libs/shell/layout/eslint.config.cjs create mode 100644 libs/shell/layout/project.json create mode 100644 libs/shell/layout/src/index.ts create mode 100644 libs/shell/layout/src/lib/shell-layout/shell-layout.component.css create mode 100644 libs/shell/layout/src/lib/shell-layout/shell-layout.component.html create mode 100644 libs/shell/layout/src/lib/shell-layout/shell-layout.component.spec.ts create mode 100644 libs/shell/layout/src/lib/shell-layout/shell-layout.component.ts create mode 100644 libs/shell/layout/src/test-setup.ts create mode 100644 libs/shell/layout/tsconfig.json create mode 100644 libs/shell/layout/tsconfig.lib.json create mode 100644 libs/shell/layout/tsconfig.spec.json create mode 100644 libs/shell/layout/vite.config.mts create mode 100644 libs/shell/navigation/README.md create mode 100644 libs/shell/navigation/eslint.config.cjs create mode 100644 libs/shell/navigation/project.json create mode 100644 libs/shell/navigation/src/index.ts create mode 100644 libs/shell/navigation/src/lib/shell-navigation/shell-navigation.component.css create mode 100644 libs/shell/navigation/src/lib/shell-navigation/shell-navigation.component.html create mode 100644 libs/shell/navigation/src/lib/shell-navigation/shell-navigation.component.spec.ts create mode 100644 libs/shell/navigation/src/lib/shell-navigation/shell-navigation.component.ts create mode 100644 libs/shell/navigation/src/test-setup.ts create mode 100644 libs/shell/navigation/tsconfig.json create mode 100644 libs/shell/navigation/tsconfig.lib.json create mode 100644 libs/shell/navigation/tsconfig.spec.json create mode 100644 libs/shell/navigation/vite.config.mts diff --git a/libs/shell/header/README.md b/libs/shell/header/README.md new file mode 100644 index 000000000..ddfcad660 --- /dev/null +++ b/libs/shell/header/README.md @@ -0,0 +1,7 @@ +# shell-header + +This library was generated with [Nx](https://nx.dev). + +## Running unit tests + +Run `nx test shell-header` to execute the unit tests. diff --git a/libs/shell/header/eslint.config.cjs b/libs/shell/header/eslint.config.cjs new file mode 100644 index 000000000..0d748b70d --- /dev/null +++ b/libs/shell/header/eslint.config.cjs @@ -0,0 +1,34 @@ +const nx = require('@nx/eslint-plugin'); +const baseConfig = require('../../../eslint.config.js'); + +module.exports = [ + ...baseConfig, + ...nx.configs['flat/angular'], + ...nx.configs['flat/angular-template'], + { + files: ['**/*.ts'], + rules: { + '@angular-eslint/directive-selector': [ + 'error', + { + type: 'attribute', + prefix: 'shell', + style: 'camelCase', + }, + ], + '@angular-eslint/component-selector': [ + 'error', + { + type: 'element', + prefix: 'shell', + style: 'kebab-case', + }, + ], + }, + }, + { + files: ['**/*.html'], + // Override or add rules here + rules: {}, + }, +]; diff --git a/libs/shell/header/project.json b/libs/shell/header/project.json new file mode 100644 index 000000000..4879a6688 --- /dev/null +++ b/libs/shell/header/project.json @@ -0,0 +1,20 @@ +{ + "name": "shell-header", + "$schema": "../../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "libs/shell/header/src", + "prefix": "shell", + "projectType": "library", + "tags": ["scope:shell", "type:feature"], + "targets": { + "test": { + "executor": "@nx/vite:test", + "outputs": ["{options.reportsDirectory}"], + "options": { + "reportsDirectory": "../../../coverage/libs/shell/header" + } + }, + "lint": { + "executor": "@nx/eslint:lint" + } + } +} diff --git a/libs/shell/header/src/index.ts b/libs/shell/header/src/index.ts new file mode 100644 index 000000000..7278cb2cc --- /dev/null +++ b/libs/shell/header/src/index.ts @@ -0,0 +1 @@ +export * from './lib/shell-header/shell-header.component'; diff --git a/libs/shell/header/src/lib/shell-header/shell-header.component.css b/libs/shell/header/src/lib/shell-header/shell-header.component.css new file mode 100644 index 000000000..e69de29bb diff --git a/libs/shell/header/src/lib/shell-header/shell-header.component.html b/libs/shell/header/src/lib/shell-header/shell-header.component.html new file mode 100644 index 000000000..b1709d9f4 --- /dev/null +++ b/libs/shell/header/src/lib/shell-header/shell-header.component.html @@ -0,0 +1 @@ +

ShellHeader works!

diff --git a/libs/shell/header/src/lib/shell-header/shell-header.component.spec.ts b/libs/shell/header/src/lib/shell-header/shell-header.component.spec.ts new file mode 100644 index 000000000..9c67c3779 --- /dev/null +++ b/libs/shell/header/src/lib/shell-header/shell-header.component.spec.ts @@ -0,0 +1,21 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; +import { ShellHeaderComponent } from './shell-header.component'; + +describe('ShellHeaderComponent', () => { + let component: ShellHeaderComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + imports: [ShellHeaderComponent], + }).compileComponents(); + + fixture = TestBed.createComponent(ShellHeaderComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/libs/shell/header/src/lib/shell-header/shell-header.component.ts b/libs/shell/header/src/lib/shell-header/shell-header.component.ts new file mode 100644 index 000000000..b77b03d1e --- /dev/null +++ b/libs/shell/header/src/lib/shell-header/shell-header.component.ts @@ -0,0 +1,10 @@ +import { Component } from '@angular/core'; +import { CommonModule } from '@angular/common'; + +@Component({ + selector: 'shell-shell-header', + imports: [CommonModule], + templateUrl: './shell-header.component.html', + styleUrl: './shell-header.component.css', +}) +export class ShellHeaderComponent {} diff --git a/libs/shell/header/src/test-setup.ts b/libs/shell/header/src/test-setup.ts new file mode 100644 index 000000000..cebf5ae72 --- /dev/null +++ b/libs/shell/header/src/test-setup.ts @@ -0,0 +1,13 @@ +import '@angular/compiler'; +import '@analogjs/vitest-angular/setup-zone'; + +import { + BrowserTestingModule, + platformBrowserTesting, +} from '@angular/platform-browser/testing'; +import { getTestBed } from '@angular/core/testing'; + +getTestBed().initTestEnvironment( + BrowserTestingModule, + platformBrowserTesting(), +); diff --git a/libs/shell/header/tsconfig.json b/libs/shell/header/tsconfig.json new file mode 100644 index 000000000..3268ed4dc --- /dev/null +++ b/libs/shell/header/tsconfig.json @@ -0,0 +1,30 @@ +{ + "extends": "../../../tsconfig.base.json", + "compilerOptions": { + "importHelpers": true, + "moduleResolution": "bundler", + "strict": true, + "noImplicitOverride": true, + "noPropertyAccessFromIndexSignature": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true, + "module": "preserve" + }, + "angularCompilerOptions": { + "enableI18nLegacyMessageIdFormat": false, + "strictInjectionParameters": true, + "strictInputAccessModifiers": true, + "typeCheckHostBindings": true, + "strictTemplates": true + }, + "files": [], + "include": [], + "references": [ + { + "path": "./tsconfig.lib.json" + }, + { + "path": "./tsconfig.spec.json" + } + ] +} diff --git a/libs/shell/header/tsconfig.lib.json b/libs/shell/header/tsconfig.lib.json new file mode 100644 index 000000000..312ee86bb --- /dev/null +++ b/libs/shell/header/tsconfig.lib.json @@ -0,0 +1,27 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../../dist/out-tsc", + "declaration": true, + "declarationMap": true, + "inlineSources": true, + "types": [] + }, + "exclude": [ + "src/**/*.spec.ts", + "src/test-setup.ts", + "jest.config.ts", + "src/**/*.test.ts", + "vite.config.ts", + "vite.config.mts", + "vitest.config.ts", + "vitest.config.mts", + "src/**/*.test.tsx", + "src/**/*.spec.tsx", + "src/**/*.test.js", + "src/**/*.spec.js", + "src/**/*.test.jsx", + "src/**/*.spec.jsx" + ], + "include": ["src/**/*.ts"] +} diff --git a/libs/shell/header/tsconfig.spec.json b/libs/shell/header/tsconfig.spec.json new file mode 100644 index 000000000..5785a8a5f --- /dev/null +++ b/libs/shell/header/tsconfig.spec.json @@ -0,0 +1,29 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../../dist/out-tsc", + "types": [ + "vitest/globals", + "vitest/importMeta", + "vite/client", + "node", + "vitest" + ] + }, + "include": [ + "vite.config.ts", + "vite.config.mts", + "vitest.config.ts", + "vitest.config.mts", + "src/**/*.test.ts", + "src/**/*.spec.ts", + "src/**/*.test.tsx", + "src/**/*.spec.tsx", + "src/**/*.test.js", + "src/**/*.spec.js", + "src/**/*.test.jsx", + "src/**/*.spec.jsx", + "src/**/*.d.ts" + ], + "files": ["src/test-setup.ts"] +} diff --git a/libs/shell/header/vite.config.mts b/libs/shell/header/vite.config.mts new file mode 100644 index 000000000..95536886e --- /dev/null +++ b/libs/shell/header/vite.config.mts @@ -0,0 +1,31 @@ +/// +import { defineConfig } from 'vite'; +import angular from '@analogjs/vite-plugin-angular'; +import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin'; +import { nxCopyAssetsPlugin } from '@nx/vite/plugins/nx-copy-assets.plugin'; + +export default defineConfig(() => ({ + root: __dirname, + cacheDir: '../../../node_modules/.vite/libs/shell/header', + plugins: [angular(), nxViteTsPaths(), nxCopyAssetsPlugin(['*.md'])], + // Uncomment this if you are using workers. + // worker: { + // plugins: [ nxViteTsPaths() ], + // }, + test: { + watch: false, + globals: true, + environment: 'jsdom', + include: ['{src,tests}/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'], + setupFiles: ['src/test-setup.ts'], + reporters: [ + 'default', + ['junit', { outputFile: '../../../testresults/junit-shell-header.xml' }], + ], + coverage: { + reportsDirectory: '../../../coverage/libs/shell/header', + provider: 'v8' as const, + reporter: ['text', 'cobertura'], + }, + }, +})); diff --git a/libs/shell/layout/README.md b/libs/shell/layout/README.md new file mode 100644 index 000000000..4647e384e --- /dev/null +++ b/libs/shell/layout/README.md @@ -0,0 +1,7 @@ +# shell-layout + +This library was generated with [Nx](https://nx.dev). + +## Running unit tests + +Run `nx test shell-layout` to execute the unit tests. diff --git a/libs/shell/layout/eslint.config.cjs b/libs/shell/layout/eslint.config.cjs new file mode 100644 index 000000000..0d748b70d --- /dev/null +++ b/libs/shell/layout/eslint.config.cjs @@ -0,0 +1,34 @@ +const nx = require('@nx/eslint-plugin'); +const baseConfig = require('../../../eslint.config.js'); + +module.exports = [ + ...baseConfig, + ...nx.configs['flat/angular'], + ...nx.configs['flat/angular-template'], + { + files: ['**/*.ts'], + rules: { + '@angular-eslint/directive-selector': [ + 'error', + { + type: 'attribute', + prefix: 'shell', + style: 'camelCase', + }, + ], + '@angular-eslint/component-selector': [ + 'error', + { + type: 'element', + prefix: 'shell', + style: 'kebab-case', + }, + ], + }, + }, + { + files: ['**/*.html'], + // Override or add rules here + rules: {}, + }, +]; diff --git a/libs/shell/layout/project.json b/libs/shell/layout/project.json new file mode 100644 index 000000000..40d9ddd1c --- /dev/null +++ b/libs/shell/layout/project.json @@ -0,0 +1,20 @@ +{ + "name": "shell-layout", + "$schema": "../../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "libs/shell/layout/src", + "prefix": "shell", + "projectType": "library", + "tags": ["scope:shell", "type:feature"], + "targets": { + "test": { + "executor": "@nx/vite:test", + "outputs": ["{options.reportsDirectory}"], + "options": { + "reportsDirectory": "../../../coverage/libs/shell/layout" + } + }, + "lint": { + "executor": "@nx/eslint:lint" + } + } +} diff --git a/libs/shell/layout/src/index.ts b/libs/shell/layout/src/index.ts new file mode 100644 index 000000000..fb2a8704b --- /dev/null +++ b/libs/shell/layout/src/index.ts @@ -0,0 +1 @@ +export * from './lib/shell-layout/shell-layout.component'; diff --git a/libs/shell/layout/src/lib/shell-layout/shell-layout.component.css b/libs/shell/layout/src/lib/shell-layout/shell-layout.component.css new file mode 100644 index 000000000..e69de29bb diff --git a/libs/shell/layout/src/lib/shell-layout/shell-layout.component.html b/libs/shell/layout/src/lib/shell-layout/shell-layout.component.html new file mode 100644 index 000000000..8ee25be96 --- /dev/null +++ b/libs/shell/layout/src/lib/shell-layout/shell-layout.component.html @@ -0,0 +1 @@ +

ShellLayout works!

diff --git a/libs/shell/layout/src/lib/shell-layout/shell-layout.component.spec.ts b/libs/shell/layout/src/lib/shell-layout/shell-layout.component.spec.ts new file mode 100644 index 000000000..a938b6d81 --- /dev/null +++ b/libs/shell/layout/src/lib/shell-layout/shell-layout.component.spec.ts @@ -0,0 +1,21 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; +import { ShellLayoutComponent } from './shell-layout.component'; + +describe('ShellLayoutComponent', () => { + let component: ShellLayoutComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + imports: [ShellLayoutComponent], + }).compileComponents(); + + fixture = TestBed.createComponent(ShellLayoutComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/libs/shell/layout/src/lib/shell-layout/shell-layout.component.ts b/libs/shell/layout/src/lib/shell-layout/shell-layout.component.ts new file mode 100644 index 000000000..1986f4db2 --- /dev/null +++ b/libs/shell/layout/src/lib/shell-layout/shell-layout.component.ts @@ -0,0 +1,10 @@ +import { Component } from '@angular/core'; +import { CommonModule } from '@angular/common'; + +@Component({ + selector: 'shell-shell-layout', + imports: [CommonModule], + templateUrl: './shell-layout.component.html', + styleUrl: './shell-layout.component.css', +}) +export class ShellLayoutComponent {} diff --git a/libs/shell/layout/src/test-setup.ts b/libs/shell/layout/src/test-setup.ts new file mode 100644 index 000000000..cebf5ae72 --- /dev/null +++ b/libs/shell/layout/src/test-setup.ts @@ -0,0 +1,13 @@ +import '@angular/compiler'; +import '@analogjs/vitest-angular/setup-zone'; + +import { + BrowserTestingModule, + platformBrowserTesting, +} from '@angular/platform-browser/testing'; +import { getTestBed } from '@angular/core/testing'; + +getTestBed().initTestEnvironment( + BrowserTestingModule, + platformBrowserTesting(), +); diff --git a/libs/shell/layout/tsconfig.json b/libs/shell/layout/tsconfig.json new file mode 100644 index 000000000..3268ed4dc --- /dev/null +++ b/libs/shell/layout/tsconfig.json @@ -0,0 +1,30 @@ +{ + "extends": "../../../tsconfig.base.json", + "compilerOptions": { + "importHelpers": true, + "moduleResolution": "bundler", + "strict": true, + "noImplicitOverride": true, + "noPropertyAccessFromIndexSignature": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true, + "module": "preserve" + }, + "angularCompilerOptions": { + "enableI18nLegacyMessageIdFormat": false, + "strictInjectionParameters": true, + "strictInputAccessModifiers": true, + "typeCheckHostBindings": true, + "strictTemplates": true + }, + "files": [], + "include": [], + "references": [ + { + "path": "./tsconfig.lib.json" + }, + { + "path": "./tsconfig.spec.json" + } + ] +} diff --git a/libs/shell/layout/tsconfig.lib.json b/libs/shell/layout/tsconfig.lib.json new file mode 100644 index 000000000..312ee86bb --- /dev/null +++ b/libs/shell/layout/tsconfig.lib.json @@ -0,0 +1,27 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../../dist/out-tsc", + "declaration": true, + "declarationMap": true, + "inlineSources": true, + "types": [] + }, + "exclude": [ + "src/**/*.spec.ts", + "src/test-setup.ts", + "jest.config.ts", + "src/**/*.test.ts", + "vite.config.ts", + "vite.config.mts", + "vitest.config.ts", + "vitest.config.mts", + "src/**/*.test.tsx", + "src/**/*.spec.tsx", + "src/**/*.test.js", + "src/**/*.spec.js", + "src/**/*.test.jsx", + "src/**/*.spec.jsx" + ], + "include": ["src/**/*.ts"] +} diff --git a/libs/shell/layout/tsconfig.spec.json b/libs/shell/layout/tsconfig.spec.json new file mode 100644 index 000000000..5785a8a5f --- /dev/null +++ b/libs/shell/layout/tsconfig.spec.json @@ -0,0 +1,29 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../../dist/out-tsc", + "types": [ + "vitest/globals", + "vitest/importMeta", + "vite/client", + "node", + "vitest" + ] + }, + "include": [ + "vite.config.ts", + "vite.config.mts", + "vitest.config.ts", + "vitest.config.mts", + "src/**/*.test.ts", + "src/**/*.spec.ts", + "src/**/*.test.tsx", + "src/**/*.spec.tsx", + "src/**/*.test.js", + "src/**/*.spec.js", + "src/**/*.test.jsx", + "src/**/*.spec.jsx", + "src/**/*.d.ts" + ], + "files": ["src/test-setup.ts"] +} diff --git a/libs/shell/layout/vite.config.mts b/libs/shell/layout/vite.config.mts new file mode 100644 index 000000000..6c18826a2 --- /dev/null +++ b/libs/shell/layout/vite.config.mts @@ -0,0 +1,31 @@ +/// +import { defineConfig } from 'vite'; +import angular from '@analogjs/vite-plugin-angular'; +import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin'; +import { nxCopyAssetsPlugin } from '@nx/vite/plugins/nx-copy-assets.plugin'; + +export default defineConfig(() => ({ + root: __dirname, + cacheDir: '../../../node_modules/.vite/libs/shell/layout', + plugins: [angular(), nxViteTsPaths(), nxCopyAssetsPlugin(['*.md'])], + // Uncomment this if you are using workers. + // worker: { + // plugins: [ nxViteTsPaths() ], + // }, + test: { + watch: false, + globals: true, + environment: 'jsdom', + include: ['{src,tests}/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'], + setupFiles: ['src/test-setup.ts'], + reporters: [ + 'default', + ['junit', { outputFile: '../../../testresults/junit-shell-layout.xml' }], + ], + coverage: { + reportsDirectory: '../../../coverage/libs/shell/layout', + provider: 'v8' as const, + reporter: ['text', 'cobertura'], + }, + }, +})); diff --git a/libs/shell/navigation/README.md b/libs/shell/navigation/README.md new file mode 100644 index 000000000..bee3e2a4e --- /dev/null +++ b/libs/shell/navigation/README.md @@ -0,0 +1,7 @@ +# shell-navigation + +This library was generated with [Nx](https://nx.dev). + +## Running unit tests + +Run `nx test shell-navigation` to execute the unit tests. diff --git a/libs/shell/navigation/eslint.config.cjs b/libs/shell/navigation/eslint.config.cjs new file mode 100644 index 000000000..0d748b70d --- /dev/null +++ b/libs/shell/navigation/eslint.config.cjs @@ -0,0 +1,34 @@ +const nx = require('@nx/eslint-plugin'); +const baseConfig = require('../../../eslint.config.js'); + +module.exports = [ + ...baseConfig, + ...nx.configs['flat/angular'], + ...nx.configs['flat/angular-template'], + { + files: ['**/*.ts'], + rules: { + '@angular-eslint/directive-selector': [ + 'error', + { + type: 'attribute', + prefix: 'shell', + style: 'camelCase', + }, + ], + '@angular-eslint/component-selector': [ + 'error', + { + type: 'element', + prefix: 'shell', + style: 'kebab-case', + }, + ], + }, + }, + { + files: ['**/*.html'], + // Override or add rules here + rules: {}, + }, +]; diff --git a/libs/shell/navigation/project.json b/libs/shell/navigation/project.json new file mode 100644 index 000000000..8397bf7e7 --- /dev/null +++ b/libs/shell/navigation/project.json @@ -0,0 +1,20 @@ +{ + "name": "shell-navigation", + "$schema": "../../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "libs/shell/navigation/src", + "prefix": "shell", + "projectType": "library", + "tags": ["scope:shell", "type:feature"], + "targets": { + "test": { + "executor": "@nx/vite:test", + "outputs": ["{options.reportsDirectory}"], + "options": { + "reportsDirectory": "../../../coverage/libs/shell/navigation" + } + }, + "lint": { + "executor": "@nx/eslint:lint" + } + } +} diff --git a/libs/shell/navigation/src/index.ts b/libs/shell/navigation/src/index.ts new file mode 100644 index 000000000..4a52e42c5 --- /dev/null +++ b/libs/shell/navigation/src/index.ts @@ -0,0 +1 @@ +export * from './lib/shell-navigation/shell-navigation.component'; diff --git a/libs/shell/navigation/src/lib/shell-navigation/shell-navigation.component.css b/libs/shell/navigation/src/lib/shell-navigation/shell-navigation.component.css new file mode 100644 index 000000000..e69de29bb diff --git a/libs/shell/navigation/src/lib/shell-navigation/shell-navigation.component.html b/libs/shell/navigation/src/lib/shell-navigation/shell-navigation.component.html new file mode 100644 index 000000000..32dca0864 --- /dev/null +++ b/libs/shell/navigation/src/lib/shell-navigation/shell-navigation.component.html @@ -0,0 +1 @@ +

ShellNavigation works!

diff --git a/libs/shell/navigation/src/lib/shell-navigation/shell-navigation.component.spec.ts b/libs/shell/navigation/src/lib/shell-navigation/shell-navigation.component.spec.ts new file mode 100644 index 000000000..dc4824af6 --- /dev/null +++ b/libs/shell/navigation/src/lib/shell-navigation/shell-navigation.component.spec.ts @@ -0,0 +1,21 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; +import { ShellNavigationComponent } from './shell-navigation.component'; + +describe('ShellNavigationComponent', () => { + let component: ShellNavigationComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + imports: [ShellNavigationComponent], + }).compileComponents(); + + fixture = TestBed.createComponent(ShellNavigationComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/libs/shell/navigation/src/lib/shell-navigation/shell-navigation.component.ts b/libs/shell/navigation/src/lib/shell-navigation/shell-navigation.component.ts new file mode 100644 index 000000000..f17b10e38 --- /dev/null +++ b/libs/shell/navigation/src/lib/shell-navigation/shell-navigation.component.ts @@ -0,0 +1,10 @@ +import { Component } from '@angular/core'; +import { CommonModule } from '@angular/common'; + +@Component({ + selector: 'shell-shell-navigation', + imports: [CommonModule], + templateUrl: './shell-navigation.component.html', + styleUrl: './shell-navigation.component.css', +}) +export class ShellNavigationComponent {} diff --git a/libs/shell/navigation/src/test-setup.ts b/libs/shell/navigation/src/test-setup.ts new file mode 100644 index 000000000..cebf5ae72 --- /dev/null +++ b/libs/shell/navigation/src/test-setup.ts @@ -0,0 +1,13 @@ +import '@angular/compiler'; +import '@analogjs/vitest-angular/setup-zone'; + +import { + BrowserTestingModule, + platformBrowserTesting, +} from '@angular/platform-browser/testing'; +import { getTestBed } from '@angular/core/testing'; + +getTestBed().initTestEnvironment( + BrowserTestingModule, + platformBrowserTesting(), +); diff --git a/libs/shell/navigation/tsconfig.json b/libs/shell/navigation/tsconfig.json new file mode 100644 index 000000000..3268ed4dc --- /dev/null +++ b/libs/shell/navigation/tsconfig.json @@ -0,0 +1,30 @@ +{ + "extends": "../../../tsconfig.base.json", + "compilerOptions": { + "importHelpers": true, + "moduleResolution": "bundler", + "strict": true, + "noImplicitOverride": true, + "noPropertyAccessFromIndexSignature": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true, + "module": "preserve" + }, + "angularCompilerOptions": { + "enableI18nLegacyMessageIdFormat": false, + "strictInjectionParameters": true, + "strictInputAccessModifiers": true, + "typeCheckHostBindings": true, + "strictTemplates": true + }, + "files": [], + "include": [], + "references": [ + { + "path": "./tsconfig.lib.json" + }, + { + "path": "./tsconfig.spec.json" + } + ] +} diff --git a/libs/shell/navigation/tsconfig.lib.json b/libs/shell/navigation/tsconfig.lib.json new file mode 100644 index 000000000..312ee86bb --- /dev/null +++ b/libs/shell/navigation/tsconfig.lib.json @@ -0,0 +1,27 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../../dist/out-tsc", + "declaration": true, + "declarationMap": true, + "inlineSources": true, + "types": [] + }, + "exclude": [ + "src/**/*.spec.ts", + "src/test-setup.ts", + "jest.config.ts", + "src/**/*.test.ts", + "vite.config.ts", + "vite.config.mts", + "vitest.config.ts", + "vitest.config.mts", + "src/**/*.test.tsx", + "src/**/*.spec.tsx", + "src/**/*.test.js", + "src/**/*.spec.js", + "src/**/*.test.jsx", + "src/**/*.spec.jsx" + ], + "include": ["src/**/*.ts"] +} diff --git a/libs/shell/navigation/tsconfig.spec.json b/libs/shell/navigation/tsconfig.spec.json new file mode 100644 index 000000000..5785a8a5f --- /dev/null +++ b/libs/shell/navigation/tsconfig.spec.json @@ -0,0 +1,29 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../../dist/out-tsc", + "types": [ + "vitest/globals", + "vitest/importMeta", + "vite/client", + "node", + "vitest" + ] + }, + "include": [ + "vite.config.ts", + "vite.config.mts", + "vitest.config.ts", + "vitest.config.mts", + "src/**/*.test.ts", + "src/**/*.spec.ts", + "src/**/*.test.tsx", + "src/**/*.spec.tsx", + "src/**/*.test.js", + "src/**/*.spec.js", + "src/**/*.test.jsx", + "src/**/*.spec.jsx", + "src/**/*.d.ts" + ], + "files": ["src/test-setup.ts"] +} diff --git a/libs/shell/navigation/vite.config.mts b/libs/shell/navigation/vite.config.mts new file mode 100644 index 000000000..344e65ff6 --- /dev/null +++ b/libs/shell/navigation/vite.config.mts @@ -0,0 +1,31 @@ +/// +import { defineConfig } from 'vite'; +import angular from '@analogjs/vite-plugin-angular'; +import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin'; +import { nxCopyAssetsPlugin } from '@nx/vite/plugins/nx-copy-assets.plugin'; + +export default defineConfig(() => ({ + root: __dirname, + cacheDir: '../../../node_modules/.vite/libs/shell/navigation', + plugins: [angular(), nxViteTsPaths(), nxCopyAssetsPlugin(['*.md'])], + // Uncomment this if you are using workers. + // worker: { + // plugins: [ nxViteTsPaths() ], + // }, + test: { + watch: false, + globals: true, + environment: 'jsdom', + include: ['{src,tests}/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'], + setupFiles: ['src/test-setup.ts'], + reporters: [ + 'default', + ['junit', { outputFile: '../../../testresults/junit-shell-navigation.xml' }], + ], + coverage: { + reportsDirectory: '../../../coverage/libs/shell/navigation', + provider: 'v8' as const, + reporter: ['text', 'cobertura'], + }, + }, +})); diff --git a/tsconfig.base.json b/tsconfig.base.json index 0f5b3d3db..355f55852 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -144,6 +144,9 @@ "libs/shared/quantity-control/src/index.ts" ], "@isa/shared/scanner": ["libs/shared/scanner/src/index.ts"], + "@isa/shell/header": ["libs/shell/header/src/index.ts"], + "@isa/shell/layout": ["libs/shell/layout/src/index.ts"], + "@isa/shell/navigation": ["libs/shell/navigation/src/index.ts"], "@isa/ui/bullet-list": ["libs/ui/bullet-list/src/index.ts"], "@isa/ui/buttons": ["libs/ui/buttons/src/index.ts"], "@isa/ui/carousel": ["libs/ui/carousel/src/index.ts"],