From 7848feae042e912e4d7501c52f49b64be0240839 Mon Sep 17 00:00:00 2001 From: OZGCloud <ozgcloud@mgm-tp.com> Date: Wed, 16 Oct 2024 10:18:26 +0200 Subject: [PATCH] OZG-6676 OZG-6954 libraries zustaendige stelle erstellen --- .../zustaendige-stelle-shared/.eslintrc.json | 33 +++++++++++++++++++ .../libs/zustaendige-stelle-shared/README.md | 7 ++++ .../zustaendige-stelle-shared/jest.config.ts | 22 +++++++++++++ .../zustaendige-stelle-shared/project.json | 20 +++++++++++ .../zustaendige-stelle-shared/src/index.ts | 0 .../src/test-setup.ts | 8 +++++ .../zustaendige-stelle-shared/tsconfig.json | 29 ++++++++++++++++ .../tsconfig.lib.json | 12 +++++++ .../tsconfig.spec.json | 11 +++++++ .../libs/zustaendige-stelle/.eslintrc.json | 33 +++++++++++++++++++ alfa-client/libs/zustaendige-stelle/README.md | 7 ++++ .../libs/zustaendige-stelle/jest.config.ts | 22 +++++++++++++ .../libs/zustaendige-stelle/project.json | 20 +++++++++++ .../libs/zustaendige-stelle/src/index.ts | 0 .../libs/zustaendige-stelle/src/test-setup.ts | 8 +++++ .../libs/zustaendige-stelle/tsconfig.json | 29 ++++++++++++++++ .../libs/zustaendige-stelle/tsconfig.lib.json | 12 +++++++ .../zustaendige-stelle/tsconfig.spec.json | 11 +++++++ alfa-client/nx.json | 7 +--- alfa-client/package.json | 3 +- alfa-client/tsconfig.base.json | 8 +++-- 21 files changed, 292 insertions(+), 10 deletions(-) create mode 100644 alfa-client/libs/zustaendige-stelle-shared/.eslintrc.json create mode 100644 alfa-client/libs/zustaendige-stelle-shared/README.md create mode 100644 alfa-client/libs/zustaendige-stelle-shared/jest.config.ts create mode 100644 alfa-client/libs/zustaendige-stelle-shared/project.json create mode 100644 alfa-client/libs/zustaendige-stelle-shared/src/index.ts create mode 100644 alfa-client/libs/zustaendige-stelle-shared/src/test-setup.ts create mode 100644 alfa-client/libs/zustaendige-stelle-shared/tsconfig.json create mode 100644 alfa-client/libs/zustaendige-stelle-shared/tsconfig.lib.json create mode 100644 alfa-client/libs/zustaendige-stelle-shared/tsconfig.spec.json create mode 100644 alfa-client/libs/zustaendige-stelle/.eslintrc.json create mode 100644 alfa-client/libs/zustaendige-stelle/README.md create mode 100644 alfa-client/libs/zustaendige-stelle/jest.config.ts create mode 100644 alfa-client/libs/zustaendige-stelle/project.json create mode 100644 alfa-client/libs/zustaendige-stelle/src/index.ts create mode 100644 alfa-client/libs/zustaendige-stelle/src/test-setup.ts create mode 100644 alfa-client/libs/zustaendige-stelle/tsconfig.json create mode 100644 alfa-client/libs/zustaendige-stelle/tsconfig.lib.json create mode 100644 alfa-client/libs/zustaendige-stelle/tsconfig.spec.json diff --git a/alfa-client/libs/zustaendige-stelle-shared/.eslintrc.json b/alfa-client/libs/zustaendige-stelle-shared/.eslintrc.json new file mode 100644 index 0000000000..b953e5d37d --- /dev/null +++ b/alfa-client/libs/zustaendige-stelle-shared/.eslintrc.json @@ -0,0 +1,33 @@ +{ + "extends": ["../../.eslintrc.json"], + "ignorePatterns": ["!**/*"], + "overrides": [ + { + "files": ["*.ts"], + "extends": ["plugin:@nx/angular", "plugin:@angular-eslint/template/process-inline-templates"], + "rules": { + "@angular-eslint/directive-selector": [ + "error", + { + "type": "attribute", + "prefix": "lib", + "style": "camelCase" + } + ], + "@angular-eslint/component-selector": [ + "error", + { + "type": "element", + "prefix": "lib", + "style": "kebab-case" + } + ] + } + }, + { + "files": ["*.html"], + "extends": ["plugin:@nx/angular-template"], + "rules": {} + } + ] +} diff --git a/alfa-client/libs/zustaendige-stelle-shared/README.md b/alfa-client/libs/zustaendige-stelle-shared/README.md new file mode 100644 index 0000000000..746271b009 --- /dev/null +++ b/alfa-client/libs/zustaendige-stelle-shared/README.md @@ -0,0 +1,7 @@ +# zustaendige-stelle-shared + +This library was generated with [Nx](https://nx.dev). + +## Running unit tests + +Run `nx test zustaendige-stelle-shared` to execute the unit tests. diff --git a/alfa-client/libs/zustaendige-stelle-shared/jest.config.ts b/alfa-client/libs/zustaendige-stelle-shared/jest.config.ts new file mode 100644 index 0000000000..97f146082b --- /dev/null +++ b/alfa-client/libs/zustaendige-stelle-shared/jest.config.ts @@ -0,0 +1,22 @@ +/* eslint-disable */ +export default { + displayName: 'zustaendige-stelle-shared', + preset: '../../jest.preset.js', + setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'], + coverageDirectory: '../../coverage/libs/zustaendige-stelle-shared', + transform: { + '^.+\\.(ts|mjs|js|html)$': [ + 'jest-preset-angular', + { + tsconfig: '<rootDir>/tsconfig.spec.json', + stringifyContentPathRegex: '\\.(html|svg)$', + }, + ], + }, + transformIgnorePatterns: ['node_modules/(?!.*\\.mjs$)'], + snapshotSerializers: [ + 'jest-preset-angular/build/serializers/no-ng-attributes', + 'jest-preset-angular/build/serializers/ng-snapshot', + 'jest-preset-angular/build/serializers/html-comment', + ], +}; diff --git a/alfa-client/libs/zustaendige-stelle-shared/project.json b/alfa-client/libs/zustaendige-stelle-shared/project.json new file mode 100644 index 0000000000..16d8b42f87 --- /dev/null +++ b/alfa-client/libs/zustaendige-stelle-shared/project.json @@ -0,0 +1,20 @@ +{ + "name": "zustaendige-stelle-shared", + "$schema": "../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "libs/zustaendige-stelle-shared/src", + "prefix": "lib", + "projectType": "library", + "tags": [], + "targets": { + "test": { + "executor": "@nx/jest:jest", + "outputs": ["{workspaceRoot}/coverage/{projectRoot}"], + "options": { + "jestConfig": "libs/zustaendige-stelle-shared/jest.config.ts" + } + }, + "lint": { + "executor": "@nx/eslint:lint" + } + } +} diff --git a/alfa-client/libs/zustaendige-stelle-shared/src/index.ts b/alfa-client/libs/zustaendige-stelle-shared/src/index.ts new file mode 100644 index 0000000000..e69de29bb2 diff --git a/alfa-client/libs/zustaendige-stelle-shared/src/test-setup.ts b/alfa-client/libs/zustaendige-stelle-shared/src/test-setup.ts new file mode 100644 index 0000000000..ab1eeeb335 --- /dev/null +++ b/alfa-client/libs/zustaendige-stelle-shared/src/test-setup.ts @@ -0,0 +1,8 @@ +// @ts-expect-error https://thymikee.github.io/jest-preset-angular/docs/getting-started/test-environment +globalThis.ngJest = { + testEnvironmentOptions: { + errorOnUnknownElements: true, + errorOnUnknownProperties: true, + }, +}; +import 'jest-preset-angular/setup-jest'; diff --git a/alfa-client/libs/zustaendige-stelle-shared/tsconfig.json b/alfa-client/libs/zustaendige-stelle-shared/tsconfig.json new file mode 100644 index 0000000000..92049739f6 --- /dev/null +++ b/alfa-client/libs/zustaendige-stelle-shared/tsconfig.json @@ -0,0 +1,29 @@ +{ + "compilerOptions": { + "target": "es2022", + "useDefineForClassFields": false, + "forceConsistentCasingInFileNames": true, + "strict": true, + "noImplicitOverride": true, + "noPropertyAccessFromIndexSignature": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true + }, + "files": [], + "include": [], + "references": [ + { + "path": "./tsconfig.lib.json" + }, + { + "path": "./tsconfig.spec.json" + } + ], + "extends": "../../tsconfig.base.json", + "angularCompilerOptions": { + "enableI18nLegacyMessageIdFormat": false, + "strictInjectionParameters": true, + "strictInputAccessModifiers": true, + "strictTemplates": true + } +} diff --git a/alfa-client/libs/zustaendige-stelle-shared/tsconfig.lib.json b/alfa-client/libs/zustaendige-stelle-shared/tsconfig.lib.json new file mode 100644 index 0000000000..4cab05d463 --- /dev/null +++ b/alfa-client/libs/zustaendige-stelle-shared/tsconfig.lib.json @@ -0,0 +1,12 @@ +{ + "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"], + "include": ["src/**/*.ts"] +} diff --git a/alfa-client/libs/zustaendige-stelle-shared/tsconfig.spec.json b/alfa-client/libs/zustaendige-stelle-shared/tsconfig.spec.json new file mode 100644 index 0000000000..7870b7c011 --- /dev/null +++ b/alfa-client/libs/zustaendige-stelle-shared/tsconfig.spec.json @@ -0,0 +1,11 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../dist/out-tsc", + "module": "commonjs", + "target": "es2016", + "types": ["jest", "node"] + }, + "files": ["src/test-setup.ts"], + "include": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts", "src/**/*.d.ts"] +} diff --git a/alfa-client/libs/zustaendige-stelle/.eslintrc.json b/alfa-client/libs/zustaendige-stelle/.eslintrc.json new file mode 100644 index 0000000000..b953e5d37d --- /dev/null +++ b/alfa-client/libs/zustaendige-stelle/.eslintrc.json @@ -0,0 +1,33 @@ +{ + "extends": ["../../.eslintrc.json"], + "ignorePatterns": ["!**/*"], + "overrides": [ + { + "files": ["*.ts"], + "extends": ["plugin:@nx/angular", "plugin:@angular-eslint/template/process-inline-templates"], + "rules": { + "@angular-eslint/directive-selector": [ + "error", + { + "type": "attribute", + "prefix": "lib", + "style": "camelCase" + } + ], + "@angular-eslint/component-selector": [ + "error", + { + "type": "element", + "prefix": "lib", + "style": "kebab-case" + } + ] + } + }, + { + "files": ["*.html"], + "extends": ["plugin:@nx/angular-template"], + "rules": {} + } + ] +} diff --git a/alfa-client/libs/zustaendige-stelle/README.md b/alfa-client/libs/zustaendige-stelle/README.md new file mode 100644 index 0000000000..79cdd47f94 --- /dev/null +++ b/alfa-client/libs/zustaendige-stelle/README.md @@ -0,0 +1,7 @@ +# zustaendige-stelle + +This library was generated with [Nx](https://nx.dev). + +## Running unit tests + +Run `nx test zustaendige-stelle` to execute the unit tests. diff --git a/alfa-client/libs/zustaendige-stelle/jest.config.ts b/alfa-client/libs/zustaendige-stelle/jest.config.ts new file mode 100644 index 0000000000..ab3acdae1b --- /dev/null +++ b/alfa-client/libs/zustaendige-stelle/jest.config.ts @@ -0,0 +1,22 @@ +/* eslint-disable */ +export default { + displayName: 'zustaendige-stelle', + preset: '../../jest.preset.js', + setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'], + coverageDirectory: '../../coverage/libs/zustaendige-stelle', + transform: { + '^.+\\.(ts|mjs|js|html)$': [ + 'jest-preset-angular', + { + tsconfig: '<rootDir>/tsconfig.spec.json', + stringifyContentPathRegex: '\\.(html|svg)$', + }, + ], + }, + transformIgnorePatterns: ['node_modules/(?!.*\\.mjs$)'], + snapshotSerializers: [ + 'jest-preset-angular/build/serializers/no-ng-attributes', + 'jest-preset-angular/build/serializers/ng-snapshot', + 'jest-preset-angular/build/serializers/html-comment', + ], +}; diff --git a/alfa-client/libs/zustaendige-stelle/project.json b/alfa-client/libs/zustaendige-stelle/project.json new file mode 100644 index 0000000000..867f306a90 --- /dev/null +++ b/alfa-client/libs/zustaendige-stelle/project.json @@ -0,0 +1,20 @@ +{ + "name": "zustaendige-stelle", + "$schema": "../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "libs/zustaendige-stelle/src", + "prefix": "lib", + "projectType": "library", + "tags": [], + "targets": { + "test": { + "executor": "@nx/jest:jest", + "outputs": ["{workspaceRoot}/coverage/{projectRoot}"], + "options": { + "jestConfig": "libs/zustaendige-stelle/jest.config.ts" + } + }, + "lint": { + "executor": "@nx/eslint:lint" + } + } +} diff --git a/alfa-client/libs/zustaendige-stelle/src/index.ts b/alfa-client/libs/zustaendige-stelle/src/index.ts new file mode 100644 index 0000000000..e69de29bb2 diff --git a/alfa-client/libs/zustaendige-stelle/src/test-setup.ts b/alfa-client/libs/zustaendige-stelle/src/test-setup.ts new file mode 100644 index 0000000000..ab1eeeb335 --- /dev/null +++ b/alfa-client/libs/zustaendige-stelle/src/test-setup.ts @@ -0,0 +1,8 @@ +// @ts-expect-error https://thymikee.github.io/jest-preset-angular/docs/getting-started/test-environment +globalThis.ngJest = { + testEnvironmentOptions: { + errorOnUnknownElements: true, + errorOnUnknownProperties: true, + }, +}; +import 'jest-preset-angular/setup-jest'; diff --git a/alfa-client/libs/zustaendige-stelle/tsconfig.json b/alfa-client/libs/zustaendige-stelle/tsconfig.json new file mode 100644 index 0000000000..92049739f6 --- /dev/null +++ b/alfa-client/libs/zustaendige-stelle/tsconfig.json @@ -0,0 +1,29 @@ +{ + "compilerOptions": { + "target": "es2022", + "useDefineForClassFields": false, + "forceConsistentCasingInFileNames": true, + "strict": true, + "noImplicitOverride": true, + "noPropertyAccessFromIndexSignature": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true + }, + "files": [], + "include": [], + "references": [ + { + "path": "./tsconfig.lib.json" + }, + { + "path": "./tsconfig.spec.json" + } + ], + "extends": "../../tsconfig.base.json", + "angularCompilerOptions": { + "enableI18nLegacyMessageIdFormat": false, + "strictInjectionParameters": true, + "strictInputAccessModifiers": true, + "strictTemplates": true + } +} diff --git a/alfa-client/libs/zustaendige-stelle/tsconfig.lib.json b/alfa-client/libs/zustaendige-stelle/tsconfig.lib.json new file mode 100644 index 0000000000..4cab05d463 --- /dev/null +++ b/alfa-client/libs/zustaendige-stelle/tsconfig.lib.json @@ -0,0 +1,12 @@ +{ + "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"], + "include": ["src/**/*.ts"] +} diff --git a/alfa-client/libs/zustaendige-stelle/tsconfig.spec.json b/alfa-client/libs/zustaendige-stelle/tsconfig.spec.json new file mode 100644 index 0000000000..7870b7c011 --- /dev/null +++ b/alfa-client/libs/zustaendige-stelle/tsconfig.spec.json @@ -0,0 +1,11 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../dist/out-tsc", + "module": "commonjs", + "target": "es2016", + "types": ["jest", "node"] + }, + "files": ["src/test-setup.ts"], + "include": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts", "src/**/*.d.ts"] +} diff --git a/alfa-client/nx.json b/alfa-client/nx.json index ef541a7eb5..d5846d9ce5 100644 --- a/alfa-client/nx.json +++ b/alfa-client/nx.json @@ -49,12 +49,7 @@ }, "build-storybook": { "cache": true, - "inputs": [ - "default", - "^production", - "{projectRoot}/.storybook/**/*", - "{projectRoot}/tsconfig.storybook.json" - ] + "inputs": ["default", "^production", "{projectRoot}/.storybook/**/*", "{projectRoot}/tsconfig.storybook.json"] }, "@nx/jest:jest": { "inputs": ["default", "^production", "{workspaceRoot}/jest.preset.js"], diff --git a/alfa-client/package.json b/alfa-client/package.json index 58ecf36fa5..b081dded54 100644 --- a/alfa-client/package.json +++ b/alfa-client/package.json @@ -120,6 +120,7 @@ "@storybook/core-server": "^8.1.4", "@swc-node/register": "1.9.1", "@swc/core": "~1.5.7", + "@swc/helpers": "~0.5.2", "@testing-library/jest-dom": "6.4.5", "@types/file-saver": "2.0.7", "@types/jest": "29.4.4", @@ -163,4 +164,4 @@ "ts-node": "10.9.1", "typescript": "5.4.5" } -} \ No newline at end of file +} diff --git a/alfa-client/tsconfig.base.json b/alfa-client/tsconfig.base.json index 040e181ce1..0e55f9ba29 100644 --- a/alfa-client/tsconfig.base.json +++ b/alfa-client/tsconfig.base.json @@ -41,6 +41,8 @@ "@alfa-client/navigation-shared": ["libs/navigation-shared/src/index.ts"], "@alfa-client/postfach": ["libs/postfach/src/index.ts"], "@alfa-client/postfach-shared": ["libs/postfach-shared/src/index.ts"], + "@alfa-client/resource-redirect": ["libs/resource-redirect/src/index.ts"], + "@alfa-client/resource-redirect-shared": ["libs/resource-redirect-shared/src/index.ts"], "@alfa-client/tech-shared": ["libs/tech-shared/src/index.ts"], "@alfa-client/test-utils": ["libs/test-utils/src/index.ts"], "@alfa-client/ui": ["libs/ui/src/index.ts"], @@ -55,11 +57,11 @@ "@alfa-client/vorgang-shared-ui": ["libs/vorgang-shared-ui/src/index.ts"], "@alfa-client/wiedervorlage": ["libs/wiedervorlage/src/index.ts"], "@alfa-client/wiedervorlage-shared": ["libs/wiedervorlage-shared/src/index.ts"], - "@alfa-client/resource-redirect": ["libs/resource-redirect/src/index.ts"], - "@alfa-client/resource-redirect-shared": ["libs/resource-redirect-shared/src/index.ts"], "@ods/component": ["libs/design-component/src/index.ts"], "@ods/system": ["libs/design-system/src/index.ts"], - "authentication": ["libs/authentication/src/index.ts"] + "authentication": ["libs/authentication/src/index.ts"], + "zustaendige-stelle": ["libs/zustaendige-stelle/src/index.ts"], + "zustaendige-stelle-shared": ["libs/zustaendige-stelle-shared/src/index.ts"] } }, "exclude": ["node_modules", "tmp"] -- GitLab