From 8f6716979e45beaad0b6aa794a88b6ee0593a0ed Mon Sep 17 00:00:00 2001 From: ThomasL Date: Mon, 19 Jun 2023 18:06:50 +0200 Subject: [PATCH] feat(challengestandalone): challenge standalone --- apps/module-to-standalone/.eslintrc.json | 36 ++++++++ apps/module-to-standalone/README.md | 32 +++++++ apps/module-to-standalone/project.json | 81 ++++++++++++++++++ .../src/app/app.component.ts | 27 ++++++ .../src/app/app.module.ts | 11 +++ apps/module-to-standalone/src/assets/.gitkeep | 0 apps/module-to-standalone/src/favicon.ico | Bin 0 -> 15086 bytes apps/module-to-standalone/src/index.html | 13 +++ apps/module-to-standalone/src/main.ts | 6 ++ apps/module-to-standalone/src/styles.scss | 5 ++ apps/module-to-standalone/tailwind.config.js | 14 +++ apps/module-to-standalone/tsconfig.app.json | 10 +++ .../module-to-standalone/tsconfig.editor.json | 11 +++ apps/module-to-standalone/tsconfig.json | 29 +++++++ apps/projection/project.json | 2 +- .../app/src/app/app.component.ts__tmpl__ | 2 +- .../app/files/readme/README.md__tmpl__ | 1 - .../admin/feature/.eslintrc.json | 36 ++++++++ .../admin/feature/README.md | 7 ++ .../admin/feature/jest.config.ts | 23 +++++ .../admin/feature/project.json | 34 ++++++++ .../admin/feature/src/index.ts | 1 + .../feature/src/lib/admin-feature.module.ts | 34 ++++++++ .../lib/create-user/create-user.component.ts | 22 +++++ .../src/lib/dashboard/dashboard.component.ts | 22 +++++ .../admin/feature/src/test-setup.ts | 8 ++ .../admin/feature/tsconfig.json | 29 +++++++ .../admin/feature/tsconfig.lib.json | 17 ++++ .../admin/feature/tsconfig.spec.json | 16 ++++ .../admin/shared/.eslintrc.json | 36 ++++++++ .../admin/shared/README.md | 7 ++ .../admin/shared/jest.config.ts | 23 +++++ .../admin/shared/project.json | 34 ++++++++ .../admin/shared/src/index.ts | 1 + .../admin/shared/src/lib/authorized.guard.ts | 23 +++++ .../admin/shared/src/test-setup.ts | 8 ++ .../admin/shared/tsconfig.json | 29 +++++++ .../admin/shared/tsconfig.lib.json | 17 ++++ .../admin/shared/tsconfig.spec.json | 16 ++++ .../core/providers/.eslintrc.json | 36 ++++++++ .../core/providers/README.md | 7 ++ .../core/providers/jest.config.ts | 23 +++++ .../core/providers/ng-package.json | 7 ++ .../core/providers/package.json | 12 +++ .../core/providers/project.json | 50 +++++++++++ .../core/providers/src/index.ts | 1 + .../core/providers/src/lib/token.provider.ts | 16 ++++ .../core/providers/src/test-setup.ts | 8 ++ .../core/providers/tsconfig.json | 29 +++++++ .../core/providers/tsconfig.lib.json | 17 ++++ .../core/providers/tsconfig.lib.prod.json | 7 ++ .../core/providers/tsconfig.spec.json | 16 ++++ .../core/service/.eslintrc.json | 36 ++++++++ .../core/service/README.md | 7 ++ .../core/service/jest.config.ts | 23 +++++ .../core/service/project.json | 34 ++++++++ .../core/service/src/index.ts | 1 + .../service/src/lib/authorization.service.ts | 16 ++++ .../core/service/src/test-setup.ts | 8 ++ .../core/service/tsconfig.json | 29 +++++++ .../core/service/tsconfig.lib.json | 17 ++++ .../core/service/tsconfig.spec.json | 16 ++++ .../forbidden/.eslintrc.json | 36 ++++++++ libs/module-to-standalone/forbidden/README.md | 7 ++ .../forbidden/jest.config.ts | 22 +++++ .../forbidden/project.json | 34 ++++++++ .../forbidden/src/index.ts | 1 + .../forbidden/src/lib/forbidden.component.ts | 7 ++ .../forbidden/src/lib/forbidden.module.ts | 13 +++ .../forbidden/src/test-setup.ts | 8 ++ .../forbidden/tsconfig.json | 29 +++++++ .../forbidden/tsconfig.lib.json | 17 ++++ .../forbidden/tsconfig.spec.json | 16 ++++ libs/module-to-standalone/home/.eslintrc.json | 36 ++++++++ libs/module-to-standalone/home/README.md | 7 ++ libs/module-to-standalone/home/jest.config.ts | 22 +++++ libs/module-to-standalone/home/project.json | 34 ++++++++ libs/module-to-standalone/home/src/index.ts | 1 + .../home/src/lib/home.component.ts | 27 ++++++ .../home/src/lib/home.module.ts | 13 +++ .../home/src/test-setup.ts | 8 ++ libs/module-to-standalone/home/tsconfig.json | 29 +++++++ .../home/tsconfig.lib.json | 17 ++++ .../home/tsconfig.spec.json | 16 ++++ .../module-to-standalone/shell/.eslintrc.json | 36 ++++++++ libs/module-to-standalone/shell/README.md | 7 ++ .../module-to-standalone/shell/jest.config.ts | 22 +++++ libs/module-to-standalone/shell/project.json | 34 ++++++++ libs/module-to-standalone/shell/src/index.ts | 1 + .../shell/src/lib/main-shell.module.ts | 11 +++ .../shell/src/lib/main-shell.routes.ts | 34 ++++++++ .../shell/src/test-setup.ts | 8 ++ libs/module-to-standalone/shell/tsconfig.json | 29 +++++++ .../shell/tsconfig.lib.json | 17 ++++ .../shell/tsconfig.spec.json | 16 ++++ .../user/contact/.eslintrc.json | 36 ++++++++ .../user/contact/README.md | 7 ++ .../user/contact/jest.config.ts | 23 +++++ .../user/contact/ng-package.json | 7 ++ .../user/contact/package.json | 12 +++ .../user/contact/project.json | 50 +++++++++++ .../user/contact/src/index.ts | 1 + .../contact/src/lib/contact-feature.module.ts | 27 ++++++ .../create-contact.component.ts | 22 +++++ .../src/lib/dashboard/dashboard.component.ts | 22 +++++ .../user/contact/src/test-setup.ts | 8 ++ .../user/contact/tsconfig.json | 29 +++++++ .../user/contact/tsconfig.lib.json | 17 ++++ .../user/contact/tsconfig.lib.prod.json | 7 ++ .../user/contact/tsconfig.spec.json | 16 ++++ .../user/feature/.eslintrc.json | 36 ++++++++ .../user/feature/README.md | 7 ++ .../user/feature/jest.config.ts | 23 +++++ .../user/feature/ng-package.json | 7 ++ .../user/feature/package.json | 12 +++ .../user/feature/project.json | 50 +++++++++++ .../user/feature/src/index.ts | 4 + .../user/feature/src/lib/lib.routes.ts | 3 + ...odule-to-standalone-user-feature.module.ts | 13 +++ .../user/feature/src/test-setup.ts | 8 ++ .../user/feature/tsconfig.json | 29 +++++++ .../user/feature/tsconfig.lib.json | 17 ++++ .../user/feature/tsconfig.lib.prod.json | 7 ++ .../user/feature/tsconfig.spec.json | 16 ++++ .../user/home/.eslintrc.json | 36 ++++++++ libs/module-to-standalone/user/home/README.md | 7 ++ .../user/home/jest.config.ts | 22 +++++ .../user/home/project.json | 34 ++++++++ .../user/home/src/index.ts | 1 + .../user/home/src/lib/home.component.ts | 7 ++ .../user/home/src/lib/home.module.ts | 11 +++ .../user/home/src/test-setup.ts | 8 ++ .../user/home/tsconfig.json | 29 +++++++ .../user/home/tsconfig.lib.json | 17 ++++ .../user/home/tsconfig.spec.json | 16 ++++ .../user/shell/.eslintrc.json | 36 ++++++++ .../module-to-standalone/user/shell/README.md | 7 ++ .../user/shell/jest.config.ts | 23 +++++ .../user/shell/ng-package.json | 7 ++ .../user/shell/package.json | 12 +++ .../user/shell/project.json | 50 +++++++++++ .../user/shell/src/index.ts | 1 + .../shell/src/lib/user-shell.component.ts | 33 +++++++ .../user/shell/src/lib/user-shell.module.ts | 13 +++ .../user/shell/src/lib/user-shell.routes.ts | 26 ++++++ .../user/shell/src/test-setup.ts | 8 ++ .../user/shell/tsconfig.json | 29 +++++++ .../user/shell/tsconfig.lib.json | 17 ++++ .../user/shell/tsconfig.lib.prod.json | 7 ++ .../user/shell/tsconfig.spec.json | 16 ++++ libs/ngrx-notification/backend/.eslintrc.json | 4 +- libs/ngrx-notification/backend/project.json | 2 +- libs/ngrx-notification/model/.eslintrc.json | 4 +- libs/ngrx-notification/model/project.json | 2 +- .../ngrx-callstate-store/.eslintrc.json | 4 +- libs/shared/ngrx-callstate-store/project.json | 2 +- libs/shared/utils/.eslintrc.json | 4 +- libs/shared/utils/project.json | 2 +- libs/testing-table/backend/.eslintrc.json | 4 +- libs/testing-table/backend/project.json | 2 +- libs/testing-table/model/project.json | 2 +- nx.json | 4 +- package-lock.json | 2 +- package.json | 2 +- tsconfig.base.json | 33 +++++++ 165 files changed, 2794 insertions(+), 22 deletions(-) create mode 100644 apps/module-to-standalone/.eslintrc.json create mode 100644 apps/module-to-standalone/README.md create mode 100644 apps/module-to-standalone/project.json create mode 100644 apps/module-to-standalone/src/app/app.component.ts create mode 100644 apps/module-to-standalone/src/app/app.module.ts create mode 100644 apps/module-to-standalone/src/assets/.gitkeep create mode 100644 apps/module-to-standalone/src/favicon.ico create mode 100644 apps/module-to-standalone/src/index.html create mode 100644 apps/module-to-standalone/src/main.ts create mode 100644 apps/module-to-standalone/src/styles.scss create mode 100644 apps/module-to-standalone/tailwind.config.js create mode 100644 apps/module-to-standalone/tsconfig.app.json create mode 100644 apps/module-to-standalone/tsconfig.editor.json create mode 100644 apps/module-to-standalone/tsconfig.json create mode 100644 libs/module-to-standalone/admin/feature/.eslintrc.json create mode 100644 libs/module-to-standalone/admin/feature/README.md create mode 100644 libs/module-to-standalone/admin/feature/jest.config.ts create mode 100644 libs/module-to-standalone/admin/feature/project.json create mode 100644 libs/module-to-standalone/admin/feature/src/index.ts create mode 100644 libs/module-to-standalone/admin/feature/src/lib/admin-feature.module.ts create mode 100644 libs/module-to-standalone/admin/feature/src/lib/create-user/create-user.component.ts create mode 100644 libs/module-to-standalone/admin/feature/src/lib/dashboard/dashboard.component.ts create mode 100644 libs/module-to-standalone/admin/feature/src/test-setup.ts create mode 100644 libs/module-to-standalone/admin/feature/tsconfig.json create mode 100644 libs/module-to-standalone/admin/feature/tsconfig.lib.json create mode 100644 libs/module-to-standalone/admin/feature/tsconfig.spec.json create mode 100644 libs/module-to-standalone/admin/shared/.eslintrc.json create mode 100644 libs/module-to-standalone/admin/shared/README.md create mode 100644 libs/module-to-standalone/admin/shared/jest.config.ts create mode 100644 libs/module-to-standalone/admin/shared/project.json create mode 100644 libs/module-to-standalone/admin/shared/src/index.ts create mode 100644 libs/module-to-standalone/admin/shared/src/lib/authorized.guard.ts create mode 100644 libs/module-to-standalone/admin/shared/src/test-setup.ts create mode 100644 libs/module-to-standalone/admin/shared/tsconfig.json create mode 100644 libs/module-to-standalone/admin/shared/tsconfig.lib.json create mode 100644 libs/module-to-standalone/admin/shared/tsconfig.spec.json create mode 100644 libs/module-to-standalone/core/providers/.eslintrc.json create mode 100644 libs/module-to-standalone/core/providers/README.md create mode 100644 libs/module-to-standalone/core/providers/jest.config.ts create mode 100644 libs/module-to-standalone/core/providers/ng-package.json create mode 100644 libs/module-to-standalone/core/providers/package.json create mode 100644 libs/module-to-standalone/core/providers/project.json create mode 100644 libs/module-to-standalone/core/providers/src/index.ts create mode 100644 libs/module-to-standalone/core/providers/src/lib/token.provider.ts create mode 100644 libs/module-to-standalone/core/providers/src/test-setup.ts create mode 100644 libs/module-to-standalone/core/providers/tsconfig.json create mode 100644 libs/module-to-standalone/core/providers/tsconfig.lib.json create mode 100644 libs/module-to-standalone/core/providers/tsconfig.lib.prod.json create mode 100644 libs/module-to-standalone/core/providers/tsconfig.spec.json create mode 100644 libs/module-to-standalone/core/service/.eslintrc.json create mode 100644 libs/module-to-standalone/core/service/README.md create mode 100644 libs/module-to-standalone/core/service/jest.config.ts create mode 100644 libs/module-to-standalone/core/service/project.json create mode 100644 libs/module-to-standalone/core/service/src/index.ts create mode 100644 libs/module-to-standalone/core/service/src/lib/authorization.service.ts create mode 100644 libs/module-to-standalone/core/service/src/test-setup.ts create mode 100644 libs/module-to-standalone/core/service/tsconfig.json create mode 100644 libs/module-to-standalone/core/service/tsconfig.lib.json create mode 100644 libs/module-to-standalone/core/service/tsconfig.spec.json create mode 100644 libs/module-to-standalone/forbidden/.eslintrc.json create mode 100644 libs/module-to-standalone/forbidden/README.md create mode 100644 libs/module-to-standalone/forbidden/jest.config.ts create mode 100644 libs/module-to-standalone/forbidden/project.json create mode 100644 libs/module-to-standalone/forbidden/src/index.ts create mode 100644 libs/module-to-standalone/forbidden/src/lib/forbidden.component.ts create mode 100644 libs/module-to-standalone/forbidden/src/lib/forbidden.module.ts create mode 100644 libs/module-to-standalone/forbidden/src/test-setup.ts create mode 100644 libs/module-to-standalone/forbidden/tsconfig.json create mode 100644 libs/module-to-standalone/forbidden/tsconfig.lib.json create mode 100644 libs/module-to-standalone/forbidden/tsconfig.spec.json create mode 100644 libs/module-to-standalone/home/.eslintrc.json create mode 100644 libs/module-to-standalone/home/README.md create mode 100644 libs/module-to-standalone/home/jest.config.ts create mode 100644 libs/module-to-standalone/home/project.json create mode 100644 libs/module-to-standalone/home/src/index.ts create mode 100644 libs/module-to-standalone/home/src/lib/home.component.ts create mode 100644 libs/module-to-standalone/home/src/lib/home.module.ts create mode 100644 libs/module-to-standalone/home/src/test-setup.ts create mode 100644 libs/module-to-standalone/home/tsconfig.json create mode 100644 libs/module-to-standalone/home/tsconfig.lib.json create mode 100644 libs/module-to-standalone/home/tsconfig.spec.json create mode 100644 libs/module-to-standalone/shell/.eslintrc.json create mode 100644 libs/module-to-standalone/shell/README.md create mode 100644 libs/module-to-standalone/shell/jest.config.ts create mode 100644 libs/module-to-standalone/shell/project.json create mode 100644 libs/module-to-standalone/shell/src/index.ts create mode 100644 libs/module-to-standalone/shell/src/lib/main-shell.module.ts create mode 100644 libs/module-to-standalone/shell/src/lib/main-shell.routes.ts create mode 100644 libs/module-to-standalone/shell/src/test-setup.ts create mode 100644 libs/module-to-standalone/shell/tsconfig.json create mode 100644 libs/module-to-standalone/shell/tsconfig.lib.json create mode 100644 libs/module-to-standalone/shell/tsconfig.spec.json create mode 100644 libs/module-to-standalone/user/contact/.eslintrc.json create mode 100644 libs/module-to-standalone/user/contact/README.md create mode 100644 libs/module-to-standalone/user/contact/jest.config.ts create mode 100644 libs/module-to-standalone/user/contact/ng-package.json create mode 100644 libs/module-to-standalone/user/contact/package.json create mode 100644 libs/module-to-standalone/user/contact/project.json create mode 100644 libs/module-to-standalone/user/contact/src/index.ts create mode 100644 libs/module-to-standalone/user/contact/src/lib/contact-feature.module.ts create mode 100644 libs/module-to-standalone/user/contact/src/lib/create-contact/create-contact.component.ts create mode 100644 libs/module-to-standalone/user/contact/src/lib/dashboard/dashboard.component.ts create mode 100644 libs/module-to-standalone/user/contact/src/test-setup.ts create mode 100644 libs/module-to-standalone/user/contact/tsconfig.json create mode 100644 libs/module-to-standalone/user/contact/tsconfig.lib.json create mode 100644 libs/module-to-standalone/user/contact/tsconfig.lib.prod.json create mode 100644 libs/module-to-standalone/user/contact/tsconfig.spec.json create mode 100644 libs/module-to-standalone/user/feature/.eslintrc.json create mode 100644 libs/module-to-standalone/user/feature/README.md create mode 100644 libs/module-to-standalone/user/feature/jest.config.ts create mode 100644 libs/module-to-standalone/user/feature/ng-package.json create mode 100644 libs/module-to-standalone/user/feature/package.json create mode 100644 libs/module-to-standalone/user/feature/project.json create mode 100644 libs/module-to-standalone/user/feature/src/index.ts create mode 100644 libs/module-to-standalone/user/feature/src/lib/lib.routes.ts create mode 100644 libs/module-to-standalone/user/feature/src/lib/module-to-standalone-user-feature.module.ts create mode 100644 libs/module-to-standalone/user/feature/src/test-setup.ts create mode 100644 libs/module-to-standalone/user/feature/tsconfig.json create mode 100644 libs/module-to-standalone/user/feature/tsconfig.lib.json create mode 100644 libs/module-to-standalone/user/feature/tsconfig.lib.prod.json create mode 100644 libs/module-to-standalone/user/feature/tsconfig.spec.json create mode 100644 libs/module-to-standalone/user/home/.eslintrc.json create mode 100644 libs/module-to-standalone/user/home/README.md create mode 100644 libs/module-to-standalone/user/home/jest.config.ts create mode 100644 libs/module-to-standalone/user/home/project.json create mode 100644 libs/module-to-standalone/user/home/src/index.ts create mode 100644 libs/module-to-standalone/user/home/src/lib/home.component.ts create mode 100644 libs/module-to-standalone/user/home/src/lib/home.module.ts create mode 100644 libs/module-to-standalone/user/home/src/test-setup.ts create mode 100644 libs/module-to-standalone/user/home/tsconfig.json create mode 100644 libs/module-to-standalone/user/home/tsconfig.lib.json create mode 100644 libs/module-to-standalone/user/home/tsconfig.spec.json create mode 100644 libs/module-to-standalone/user/shell/.eslintrc.json create mode 100644 libs/module-to-standalone/user/shell/README.md create mode 100644 libs/module-to-standalone/user/shell/jest.config.ts create mode 100644 libs/module-to-standalone/user/shell/ng-package.json create mode 100644 libs/module-to-standalone/user/shell/package.json create mode 100644 libs/module-to-standalone/user/shell/project.json create mode 100644 libs/module-to-standalone/user/shell/src/index.ts create mode 100644 libs/module-to-standalone/user/shell/src/lib/user-shell.component.ts create mode 100644 libs/module-to-standalone/user/shell/src/lib/user-shell.module.ts create mode 100644 libs/module-to-standalone/user/shell/src/lib/user-shell.routes.ts create mode 100644 libs/module-to-standalone/user/shell/src/test-setup.ts create mode 100644 libs/module-to-standalone/user/shell/tsconfig.json create mode 100644 libs/module-to-standalone/user/shell/tsconfig.lib.json create mode 100644 libs/module-to-standalone/user/shell/tsconfig.lib.prod.json create mode 100644 libs/module-to-standalone/user/shell/tsconfig.spec.json diff --git a/apps/module-to-standalone/.eslintrc.json b/apps/module-to-standalone/.eslintrc.json new file mode 100644 index 0000000..b428c22 --- /dev/null +++ b/apps/module-to-standalone/.eslintrc.json @@ -0,0 +1,36 @@ +{ + "extends": ["../../.eslintrc.json"], + "ignorePatterns": ["!**/*"], + "overrides": [ + { + "files": ["*.ts"], + "rules": { + "@angular-eslint/directive-selector": [ + "error", + { + "type": "attribute", + "prefix": "app", + "style": "camelCase" + } + ], + "@angular-eslint/component-selector": [ + "error", + { + "type": "element", + "prefix": "app", + "style": "kebab-case" + } + ] + }, + "extends": [ + "plugin:@nx/angular", + "plugin:@angular-eslint/template/process-inline-templates" + ] + }, + { + "files": ["*.html"], + "extends": ["plugin:@nx/angular-template"], + "rules": {} + } + ] +} diff --git a/apps/module-to-standalone/README.md b/apps/module-to-standalone/README.md new file mode 100644 index 0000000..f7def58 --- /dev/null +++ b/apps/module-to-standalone/README.md @@ -0,0 +1,32 @@ +

refactor module to standalone

+ +> Author: Thomas Laforge + + + +### Information + +### Statement + +### Step 1 + +### Step 2 + +### Constraints: + +### Submitting your work + +1. Fork the project +2. clone it +3. npm install +4. `npx nx serve module-to-standalone` +5. _...work on it_ +6. Commit your work +7. Submit a PR with a title beginning with **Answer:26** that I will review and other dev can review. + +module-to-standalone +module-to-standalone solution author + + + +_You can ask any question on_ twitter diff --git a/apps/module-to-standalone/project.json b/apps/module-to-standalone/project.json new file mode 100644 index 0000000..5827132 --- /dev/null +++ b/apps/module-to-standalone/project.json @@ -0,0 +1,81 @@ +{ + "name": "module-to-standalone", + "$schema": "../../node_modules/nx/schemas/project-schema.json", + "projectType": "application", + "prefix": "app", + "sourceRoot": "apps/module-to-standalone/src", + "tags": [], + "targets": { + "build": { + "executor": "@angular-devkit/build-angular:browser", + "outputs": ["{options.outputPath}"], + "options": { + "outputPath": "dist/apps/module-to-standalone", + "index": "apps/module-to-standalone/src/index.html", + "main": "apps/module-to-standalone/src/main.ts", + "polyfills": ["zone.js"], + "tsConfig": "apps/module-to-standalone/tsconfig.app.json", + "assets": [ + "apps/module-to-standalone/src/favicon.ico", + "apps/module-to-standalone/src/assets" + ], + "styles": ["apps/module-to-standalone/src/styles.scss"], + "scripts": [] + }, + "configurations": { + "production": { + "budgets": [ + { + "type": "initial", + "maximumWarning": "500kb", + "maximumError": "1mb" + }, + { + "type": "anyComponentStyle", + "maximumWarning": "2kb", + "maximumError": "4kb" + } + ], + "outputHashing": "all" + }, + "development": { + "buildOptimizer": false, + "optimization": false, + "vendorChunk": true, + "extractLicenses": false, + "sourceMap": true, + "namedChunks": true + } + }, + "defaultConfiguration": "production" + }, + "serve": { + "executor": "@angular-devkit/build-angular:dev-server", + "configurations": { + "production": { + "browserTarget": "module-to-standalone:build:production" + }, + "development": { + "browserTarget": "module-to-standalone:build:development" + } + }, + "defaultConfiguration": "development" + }, + "extract-i18n": { + "executor": "@angular-devkit/build-angular:extract-i18n", + "options": { + "browserTarget": "module-to-standalone:build" + } + }, + "lint": { + "executor": "@nx/linter:eslint", + "outputs": ["{options.outputFile}"], + "options": { + "lintFilePatterns": [ + "apps/module-to-standalone/**/*.ts", + "apps/module-to-standalone/**/*.html" + ] + } + } + } +} diff --git a/apps/module-to-standalone/src/app/app.component.ts b/apps/module-to-standalone/src/app/app.component.ts new file mode 100644 index 0000000..91a72fa --- /dev/null +++ b/apps/module-to-standalone/src/app/app.component.ts @@ -0,0 +1,27 @@ +import { Component } from '@angular/core'; + +@Component({ + selector: 'app-root', + template: `
+ + + +
+ `, + host: { + class: 'flex flex-col p-4 gap-3', + }, +}) +export class AppComponent {} diff --git a/apps/module-to-standalone/src/app/app.module.ts b/apps/module-to-standalone/src/app/app.module.ts new file mode 100644 index 0000000..c795a11 --- /dev/null +++ b/apps/module-to-standalone/src/app/app.module.ts @@ -0,0 +1,11 @@ +import { MainShellModule } from '@angular-challenges/module-to-standalone/shell'; +import { NgModule } from '@angular/core'; +import { BrowserModule } from '@angular/platform-browser'; +import { AppComponent } from './app.component'; + +@NgModule({ + declarations: [AppComponent], + imports: [BrowserModule, MainShellModule], + bootstrap: [AppComponent], +}) +export class AppModule {} diff --git a/apps/module-to-standalone/src/assets/.gitkeep b/apps/module-to-standalone/src/assets/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/apps/module-to-standalone/src/favicon.ico b/apps/module-to-standalone/src/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..317ebcb2336e0833a22dddf0ab287849f26fda57 GIT binary patch literal 15086 zcmeI332;U^%p|z7g|#(P)qFEA@4f!_@qOK2 z_lJl}!lhL!VT_U|uN7%8B2iKH??xhDa;*`g{yjTFWHvXn;2s{4R7kH|pKGdy(7z!K zgftM+Ku7~24TLlh(!g)gz|foI94G^t2^IO$uvX$3(OR0<_5L2sB)lMAMy|+`xodJ{ z_Uh_1m)~h?a;2W{dmhM;u!YGo=)OdmId_B<%^V^{ovI@y`7^g1_V9G}*f# zNzAtvou}I!W1#{M^@ROc(BZ! z+F!!_aR&Px3_reO(EW+TwlW~tv*2zr?iP7(d~a~yA|@*a89IUke+c472NXM0wiX{- zl`UrZC^1XYyf%1u)-Y)jj9;MZ!SLfd2Hl?o|80Su%Z?To_=^g_Jt0oa#CT*tjx>BI z16wec&AOWNK<#i0Qd=1O$fymLRoUR*%;h@*@v7}wApDl^w*h}!sYq%kw+DKDY)@&A z@9$ULEB3qkR#85`lb8#WZw=@})#kQig9oqy^I$dj&k4jU&^2(M3q{n1AKeGUKPFbr z1^<)aH;VsG@J|B&l>UtU#Ejv3GIqERzYgL@UOAWtW<{p#zy`WyJgpCy8$c_e%wYJL zyGHRRx38)HyjU3y{-4z6)pzb>&Q1pR)B&u01F-|&Gx4EZWK$nkUkOI|(D4UHOXg_- zw{OBf!oWQUn)Pe(=f=nt=zkmdjpO^o8ZZ9o_|4tW1ni+Un9iCW47*-ut$KQOww!;u z`0q)$s6IZO!~9$e_P9X!hqLxu`fpcL|2f^I5d4*a@Dq28;@2271v_N+5HqYZ>x;&O z05*7JT)mUe&%S0@UD)@&8SmQrMtsDfZT;fkdA!r(S=}Oz>iP)w=W508=Rc#nNn7ym z1;42c|8($ALY8#a({%1#IXbWn9-Y|0eDY$_L&j{63?{?AH{);EzcqfydD$@-B`Y3<%IIj7S7rK_N}je^=dEk%JQ4c z!tBdTPE3Tse;oYF>cnrapWq*o)m47X1`~6@(!Y29#>-#8zm&LXrXa(3=7Z)ElaQqj z-#0JJy3Fi(C#Rx(`=VXtJ63E2_bZGCz+QRa{W0e2(m3sI?LOcUBx)~^YCqZ{XEPX)C>G>U4tfqeH8L(3|pQR*zbL1 zT9e~4Tb5p9_G}$y4t`i*4t_Mr9QYvL9C&Ah*}t`q*}S+VYh0M6GxTTSXI)hMpMpIq zD1ImYqJLzbj0}~EpE-aH#VCH_udYEW#`P2zYmi&xSPs_{n6tBj=MY|-XrA;SGA_>y zGtU$?HXm$gYj*!N)_nQ59%lQdXtQZS3*#PC-{iB_sm+ytD*7j`D*k(P&IH2GHT}Eh z5697eQECVIGQAUe#eU2I!yI&%0CP#>%6MWV z@zS!p@+Y1i1b^QuuEF*13CuB zu69dve5k7&Wgb+^s|UB08Dr3u`h@yM0NTj4h7MnHo-4@xmyr7(*4$rpPwsCDZ@2be zRz9V^GnV;;?^Lk%ynzq&K(Aix`mWmW`^152Hoy$CTYVehpD-S1-W^#k#{0^L`V6CN+E z!w+xte;2vu4AmVNEFUOBmrBL>6MK@!O2*N|2=d|Y;oN&A&qv=qKn73lDD zI(+oJAdgv>Yr}8(&@ZuAZE%XUXmX(U!N+Z_sjL<1vjy1R+1IeHt`79fnYdOL{$ci7 z%3f0A*;Zt@ED&Gjm|OFTYBDe%bbo*xXAQsFz+Q`fVBH!N2)kaxN8P$c>sp~QXnv>b zwq=W3&Mtmih7xkR$YA)1Yi?avHNR6C99!u6fh=cL|KQ&PwF!n@ud^n(HNIImHD!h87!i*t?G|p0o+eelJ?B@A64_9%SBhNaJ64EvKgD&%LjLCYnNfc; znj?%*p@*?dq#NqcQFmmX($wms@CSAr9#>hUR^=I+=0B)vvGX%T&#h$kmX*s=^M2E!@N9#m?LhMvz}YB+kd zG~mbP|D(;{s_#;hsKK9lbVK&Lo734x7SIFJ9V_}2$@q?zm^7?*XH94w5Qae{7zOMUF z^?%F%)c1Y)Q?Iy?I>knw*8gYW#ok|2gdS=YYZLiD=CW|Nj;n^x!=S#iJ#`~Ld79+xXpVmUK^B(xO_vO!btA9y7w3L3-0j-y4 z?M-V{%z;JI`bk7yFDcP}OcCd*{Q9S5$iGA7*E1@tfkyjAi!;wP^O71cZ^Ep)qrQ)N z#wqw0_HS;T7x3y|`P==i3hEwK%|>fZ)c&@kgKO1~5<5xBSk?iZV?KI6&i72H6S9A* z=U(*e)EqEs?Oc04)V-~K5AUmh|62H4*`UAtItO$O(q5?6jj+K^oD!04r=6#dsxp?~}{`?&sXn#q2 zGuY~7>O2=!u@@Kfu7q=W*4egu@qPMRM>(eyYyaIE<|j%d=iWNdGsx%c!902v#ngNg z@#U-O_4xN$s_9?(`{>{>7~-6FgWpBpqXb`Ydc3OFL#&I}Irse9F_8R@4zSS*Y*o*B zXL?6*Aw!AfkNCgcr#*yj&p3ZDe2y>v$>FUdKIy_2N~}6AbHc7gA3`6$g@1o|dE>vz z4pl(j9;kyMsjaw}lO?(?Xg%4k!5%^t#@5n=WVc&JRa+XT$~#@rldvN3S1rEpU$;XgxVny7mki3 z-Hh|jUCHrUXuLr!)`w>wgO0N%KTB-1di>cj(x3Bav`7v z3G7EIbU$z>`Nad7Rk_&OT-W{;qg)-GXV-aJT#(ozdmnA~Rq3GQ_3mby(>q6Ocb-RgTUhTN)))x>m&eD;$J5Bg zo&DhY36Yg=J=$Z>t}RJ>o|@hAcwWzN#r(WJ52^g$lh^!63@hh+dR$&_dEGu&^CR*< z!oFqSqO@>xZ*nC2oiOd0eS*F^IL~W-rsrO`J`ej{=ou_q^_(<$&-3f^J z&L^MSYWIe{&pYq&9eGaArA~*kA + + + + module-to-standalone + + + + + + + + diff --git a/apps/module-to-standalone/src/main.ts b/apps/module-to-standalone/src/main.ts new file mode 100644 index 0000000..16de236 --- /dev/null +++ b/apps/module-to-standalone/src/main.ts @@ -0,0 +1,6 @@ +import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; +import { AppModule } from './app/app.module'; + +platformBrowserDynamic() + .bootstrapModule(AppModule) + .catch((err) => console.error(err)); diff --git a/apps/module-to-standalone/src/styles.scss b/apps/module-to-standalone/src/styles.scss new file mode 100644 index 0000000..77e408a --- /dev/null +++ b/apps/module-to-standalone/src/styles.scss @@ -0,0 +1,5 @@ +@tailwind base; +@tailwind components; +@tailwind utilities; + +/* You can add global styles to this file, and also import other style files */ diff --git a/apps/module-to-standalone/tailwind.config.js b/apps/module-to-standalone/tailwind.config.js new file mode 100644 index 0000000..99d683d --- /dev/null +++ b/apps/module-to-standalone/tailwind.config.js @@ -0,0 +1,14 @@ +const { createGlobPatternsForDependencies } = require('@nx/angular/tailwind'); +const { join } = require('path'); + +/** @type {import('tailwindcss').Config} */ +module.exports = { + content: [ + 'apps/module-to-standalone/**/*.{ts,html}', + 'libs/module-to-standalone/**/*.{ts,html}', + ], + theme: { + extend: {}, + }, + plugins: [], +}; diff --git a/apps/module-to-standalone/tsconfig.app.json b/apps/module-to-standalone/tsconfig.app.json new file mode 100644 index 0000000..fff4a41 --- /dev/null +++ b/apps/module-to-standalone/tsconfig.app.json @@ -0,0 +1,10 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../dist/out-tsc", + "types": [] + }, + "files": ["src/main.ts"], + "include": ["src/**/*.d.ts"], + "exclude": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts"] +} diff --git a/apps/module-to-standalone/tsconfig.editor.json b/apps/module-to-standalone/tsconfig.editor.json new file mode 100644 index 0000000..5c283ab --- /dev/null +++ b/apps/module-to-standalone/tsconfig.editor.json @@ -0,0 +1,11 @@ +{ + "extends": "./tsconfig.json", + "include": [ + "src/**/*.ts", + "../../libs/module-to-standalone/shell/src/lib/main-shell.routes.ts", + "../../libs/module-to-standalone/shell/src/lib/main-shell.component.ts" + ], + "compilerOptions": { + "types": [] + } +} diff --git a/apps/module-to-standalone/tsconfig.json b/apps/module-to-standalone/tsconfig.json new file mode 100644 index 0000000..0731542 --- /dev/null +++ b/apps/module-to-standalone/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.app.json" + }, + { + "path": "./tsconfig.editor.json" + } + ], + "extends": "../../tsconfig.base.json", + "angularCompilerOptions": { + "enableI18nLegacyMessageIdFormat": false, + "strictInjectionParameters": true, + "strictInputAccessModifiers": true, + "strictTemplates": true + } +} diff --git a/apps/projection/project.json b/apps/projection/project.json index 181f0d2..646f8ab 100644 --- a/apps/projection/project.json +++ b/apps/projection/project.json @@ -3,7 +3,7 @@ "$schema": "../../node_modules/nx/schemas/project-schema.json", "projectType": "application", "sourceRoot": "apps/projection/src", - "prefix": "angular-challenges", + "prefix": "app", "targets": { "build": { "executor": "@angular-devkit/build-angular:browser", diff --git a/libs/cli/src/generators/app/files/app/src/app/app.component.ts__tmpl__ b/libs/cli/src/generators/app/files/app/src/app/app.component.ts__tmpl__ index d977f09..937cefb 100644 --- a/libs/cli/src/generators/app/files/app/src/app/app.component.ts__tmpl__ +++ b/libs/cli/src/generators/app/files/app/src/app/app.component.ts__tmpl__ @@ -3,7 +3,7 @@ import { Component } from '@angular/core'; @Component({ standalone: true, imports: [], - selector: 'app-root', + selector: 'lib-root', template: ``, styles: [''], }) diff --git a/libs/cli/src/generators/app/files/readme/README.md__tmpl__ b/libs/cli/src/generators/app/files/readme/README.md__tmpl__ index e0dfb5c..0797278 100644 --- a/libs/cli/src/generators/app/files/readme/README.md__tmpl__ +++ b/libs/cli/src/generators/app/files/readme/README.md__tmpl__ @@ -25,7 +25,6 @@ 7. Submit a PR with a title beginning with **Answer:<%= challengeNumber %>** that I will review and other dev can review. <%= projectName %> - <%= projectName %> solution author diff --git a/libs/module-to-standalone/admin/feature/.eslintrc.json b/libs/module-to-standalone/admin/feature/.eslintrc.json new file mode 100644 index 0000000..b597630 --- /dev/null +++ b/libs/module-to-standalone/admin/feature/.eslintrc.json @@ -0,0 +1,36 @@ +{ + "extends": ["../../../../.eslintrc.json"], + "ignorePatterns": ["!**/*"], + "overrides": [ + { + "files": ["*.ts"], + "rules": { + "@angular-eslint/directive-selector": [ + "error", + { + "type": "attribute", + "prefix": "lib", + "style": "camelCase" + } + ], + "@angular-eslint/component-selector": [ + "error", + { + "type": "element", + "prefix": "lib", + "style": "kebab-case" + } + ] + }, + "extends": [ + "plugin:@nx/angular", + "plugin:@angular-eslint/template/process-inline-templates" + ] + }, + { + "files": ["*.html"], + "extends": ["plugin:@nx/angular-template"], + "rules": {} + } + ] +} diff --git a/libs/module-to-standalone/admin/feature/README.md b/libs/module-to-standalone/admin/feature/README.md new file mode 100644 index 0000000..77de8a8 --- /dev/null +++ b/libs/module-to-standalone/admin/feature/README.md @@ -0,0 +1,7 @@ +# module-to-standalone-admin-feature + +This library was generated with [Nx](https://nx.dev). + +## Running unit tests + +Run `nx test module-to-standalone-admin-feature` to execute the unit tests. diff --git a/libs/module-to-standalone/admin/feature/jest.config.ts b/libs/module-to-standalone/admin/feature/jest.config.ts new file mode 100644 index 0000000..547252e --- /dev/null +++ b/libs/module-to-standalone/admin/feature/jest.config.ts @@ -0,0 +1,23 @@ +/* eslint-disable */ +export default { + displayName: 'module-to-standalone-admin-feature', + preset: '../../../../jest.preset.js', + setupFilesAfterEnv: ['/src/test-setup.ts'], + coverageDirectory: + '../../../../coverage/libs/module-to-standalone/admin/feature', + transform: { + '^.+\\.(ts|mjs|js|html)$': [ + 'jest-preset-angular', + { + tsconfig: '/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/libs/module-to-standalone/admin/feature/project.json b/libs/module-to-standalone/admin/feature/project.json new file mode 100644 index 0000000..b63f6ca --- /dev/null +++ b/libs/module-to-standalone/admin/feature/project.json @@ -0,0 +1,34 @@ +{ + "name": "module-to-standalone-admin-feature", + "$schema": "../../../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "libs/module-to-standalone/admin/feature/src", + "prefix": "lib", + "tags": [], + "projectType": "library", + "targets": { + "test": { + "executor": "@nx/jest:jest", + "outputs": ["{workspaceRoot}/coverage/{projectRoot}"], + "options": { + "jestConfig": "libs/module-to-standalone/admin/feature/jest.config.ts", + "passWithNoTests": true + }, + "configurations": { + "ci": { + "ci": true, + "codeCoverage": true + } + } + }, + "lint": { + "executor": "@nx/linter:eslint", + "outputs": ["{options.outputFile}"], + "options": { + "lintFilePatterns": [ + "libs/module-to-standalone/admin/feature/**/*.ts", + "libs/module-to-standalone/admin/feature/**/*.html" + ] + } + } + } +} diff --git a/libs/module-to-standalone/admin/feature/src/index.ts b/libs/module-to-standalone/admin/feature/src/index.ts new file mode 100644 index 0000000..76c8330 --- /dev/null +++ b/libs/module-to-standalone/admin/feature/src/index.ts @@ -0,0 +1 @@ +export * from './lib/admin-feature.module'; diff --git a/libs/module-to-standalone/admin/feature/src/lib/admin-feature.module.ts b/libs/module-to-standalone/admin/feature/src/lib/admin-feature.module.ts new file mode 100644 index 0000000..6bdda1d --- /dev/null +++ b/libs/module-to-standalone/admin/feature/src/lib/admin-feature.module.ts @@ -0,0 +1,34 @@ +import { IsAuthorizedGuard } from '@angular-challenges/module-to-standalone/admin/shared'; +import { CommonModule } from '@angular/common'; +import { NgModule } from '@angular/core'; +import { RouterModule } from '@angular/router'; + +@NgModule({ + declarations: [], + imports: [ + CommonModule, + RouterModule.forChild([ + { + path: '', + canActivate: [IsAuthorizedGuard], + children: [ + { + path: '', + loadChildren: () => + import('./dashboard/dashboard.component').then( + (m) => m.DashboardModule + ), + }, + { + path: 'create-user', + loadChildren: () => + import('./create-user/create-user.component').then( + (m) => m.CreateUserModule + ), + }, + ], + }, + ]), + ], +}) +export class AdminFeatureModule {} diff --git a/libs/module-to-standalone/admin/feature/src/lib/create-user/create-user.component.ts b/libs/module-to-standalone/admin/feature/src/lib/create-user/create-user.component.ts new file mode 100644 index 0000000..3f8076e --- /dev/null +++ b/libs/module-to-standalone/admin/feature/src/lib/create-user/create-user.component.ts @@ -0,0 +1,22 @@ +import { Component, NgModule } from '@angular/core'; +import { RouterModule } from '@angular/router'; + +@Component({ + selector: 'lib-create-user', + template: `Create User Form + + `, +}) +export class CreateUserComponent {} + +@NgModule({ + imports: [ + RouterModule.forChild([{ path: '', component: CreateUserComponent }]), + ], + declarations: [CreateUserComponent], +}) +export class CreateUserModule {} diff --git a/libs/module-to-standalone/admin/feature/src/lib/dashboard/dashboard.component.ts b/libs/module-to-standalone/admin/feature/src/lib/dashboard/dashboard.component.ts new file mode 100644 index 0000000..dbb2412 --- /dev/null +++ b/libs/module-to-standalone/admin/feature/src/lib/dashboard/dashboard.component.ts @@ -0,0 +1,22 @@ +import { Component, NgModule } from '@angular/core'; +import { RouterModule } from '@angular/router'; + +@Component({ + selector: 'lib-dashboard', + template: `Dashboard + + `, +}) +export class DashboardComponent {} + +@NgModule({ + imports: [ + RouterModule.forChild([{ path: '', component: DashboardComponent }]), + ], + declarations: [DashboardComponent], +}) +export class DashboardModule {} diff --git a/libs/module-to-standalone/admin/feature/src/test-setup.ts b/libs/module-to-standalone/admin/feature/src/test-setup.ts new file mode 100644 index 0000000..ab1eeeb --- /dev/null +++ b/libs/module-to-standalone/admin/feature/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/libs/module-to-standalone/admin/feature/tsconfig.json b/libs/module-to-standalone/admin/feature/tsconfig.json new file mode 100644 index 0000000..b9e5be0 --- /dev/null +++ b/libs/module-to-standalone/admin/feature/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/libs/module-to-standalone/admin/feature/tsconfig.lib.json b/libs/module-to-standalone/admin/feature/tsconfig.lib.json new file mode 100644 index 0000000..9127387 --- /dev/null +++ b/libs/module-to-standalone/admin/feature/tsconfig.lib.json @@ -0,0 +1,17 @@ +{ + "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/libs/module-to-standalone/admin/feature/tsconfig.spec.json b/libs/module-to-standalone/admin/feature/tsconfig.spec.json new file mode 100644 index 0000000..6e5925e --- /dev/null +++ b/libs/module-to-standalone/admin/feature/tsconfig.spec.json @@ -0,0 +1,16 @@ +{ + "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/libs/module-to-standalone/admin/shared/.eslintrc.json b/libs/module-to-standalone/admin/shared/.eslintrc.json new file mode 100644 index 0000000..b597630 --- /dev/null +++ b/libs/module-to-standalone/admin/shared/.eslintrc.json @@ -0,0 +1,36 @@ +{ + "extends": ["../../../../.eslintrc.json"], + "ignorePatterns": ["!**/*"], + "overrides": [ + { + "files": ["*.ts"], + "rules": { + "@angular-eslint/directive-selector": [ + "error", + { + "type": "attribute", + "prefix": "lib", + "style": "camelCase" + } + ], + "@angular-eslint/component-selector": [ + "error", + { + "type": "element", + "prefix": "lib", + "style": "kebab-case" + } + ] + }, + "extends": [ + "plugin:@nx/angular", + "plugin:@angular-eslint/template/process-inline-templates" + ] + }, + { + "files": ["*.html"], + "extends": ["plugin:@nx/angular-template"], + "rules": {} + } + ] +} diff --git a/libs/module-to-standalone/admin/shared/README.md b/libs/module-to-standalone/admin/shared/README.md new file mode 100644 index 0000000..7de0927 --- /dev/null +++ b/libs/module-to-standalone/admin/shared/README.md @@ -0,0 +1,7 @@ +# module-to-standalone-admin-shared + +This library was generated with [Nx](https://nx.dev). + +## Running unit tests + +Run `nx test module-to-standalone-admin-shared` to execute the unit tests. diff --git a/libs/module-to-standalone/admin/shared/jest.config.ts b/libs/module-to-standalone/admin/shared/jest.config.ts new file mode 100644 index 0000000..41e6691 --- /dev/null +++ b/libs/module-to-standalone/admin/shared/jest.config.ts @@ -0,0 +1,23 @@ +/* eslint-disable */ +export default { + displayName: 'module-to-standalone-admin-shared', + preset: '../../../../jest.preset.js', + setupFilesAfterEnv: ['/src/test-setup.ts'], + coverageDirectory: + '../../../../coverage/libs/module-to-standalone/admin/shared', + transform: { + '^.+\\.(ts|mjs|js|html)$': [ + 'jest-preset-angular', + { + tsconfig: '/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/libs/module-to-standalone/admin/shared/project.json b/libs/module-to-standalone/admin/shared/project.json new file mode 100644 index 0000000..fa81f8e --- /dev/null +++ b/libs/module-to-standalone/admin/shared/project.json @@ -0,0 +1,34 @@ +{ + "name": "module-to-standalone-admin-shared", + "$schema": "../../../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "libs/module-to-standalone/admin/shared/src", + "prefix": "lib", + "tags": [], + "projectType": "library", + "targets": { + "test": { + "executor": "@nx/jest:jest", + "outputs": ["{workspaceRoot}/coverage/{projectRoot}"], + "options": { + "jestConfig": "libs/module-to-standalone/admin/shared/jest.config.ts", + "passWithNoTests": true + }, + "configurations": { + "ci": { + "ci": true, + "codeCoverage": true + } + } + }, + "lint": { + "executor": "@nx/linter:eslint", + "outputs": ["{options.outputFile}"], + "options": { + "lintFilePatterns": [ + "libs/module-to-standalone/admin/shared/**/*.ts", + "libs/module-to-standalone/admin/shared/**/*.html" + ] + } + } + } +} diff --git a/libs/module-to-standalone/admin/shared/src/index.ts b/libs/module-to-standalone/admin/shared/src/index.ts new file mode 100644 index 0000000..21a285c --- /dev/null +++ b/libs/module-to-standalone/admin/shared/src/index.ts @@ -0,0 +1 @@ +export * from './lib/authorized.guard'; diff --git a/libs/module-to-standalone/admin/shared/src/lib/authorized.guard.ts b/libs/module-to-standalone/admin/shared/src/lib/authorized.guard.ts new file mode 100644 index 0000000..42b59ee --- /dev/null +++ b/libs/module-to-standalone/admin/shared/src/lib/authorized.guard.ts @@ -0,0 +1,23 @@ +import { CanActivate, Router, UrlTree } from '@angular/router'; + +import { AuthorizationService } from '@angular-challenges/module-to-standalone/core/service'; +import { Injectable } from '@angular/core'; +import { Observable, map } from 'rxjs'; + +@Injectable({ + providedIn: 'root', +}) +export class IsAuthorizedGuard implements CanActivate { + constructor( + private authorizationService: AuthorizationService, + private router: Router + ) {} + + canActivate(): Observable { + return this.authorizationService.isAuthorized$.pipe( + map((isAuthorized) => + isAuthorized ? true : this.router.createUrlTree(['forbidden']) + ) + ); + } +} diff --git a/libs/module-to-standalone/admin/shared/src/test-setup.ts b/libs/module-to-standalone/admin/shared/src/test-setup.ts new file mode 100644 index 0000000..ab1eeeb --- /dev/null +++ b/libs/module-to-standalone/admin/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/libs/module-to-standalone/admin/shared/tsconfig.json b/libs/module-to-standalone/admin/shared/tsconfig.json new file mode 100644 index 0000000..b9e5be0 --- /dev/null +++ b/libs/module-to-standalone/admin/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/libs/module-to-standalone/admin/shared/tsconfig.lib.json b/libs/module-to-standalone/admin/shared/tsconfig.lib.json new file mode 100644 index 0000000..9127387 --- /dev/null +++ b/libs/module-to-standalone/admin/shared/tsconfig.lib.json @@ -0,0 +1,17 @@ +{ + "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/libs/module-to-standalone/admin/shared/tsconfig.spec.json b/libs/module-to-standalone/admin/shared/tsconfig.spec.json new file mode 100644 index 0000000..6e5925e --- /dev/null +++ b/libs/module-to-standalone/admin/shared/tsconfig.spec.json @@ -0,0 +1,16 @@ +{ + "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/libs/module-to-standalone/core/providers/.eslintrc.json b/libs/module-to-standalone/core/providers/.eslintrc.json new file mode 100644 index 0000000..b597630 --- /dev/null +++ b/libs/module-to-standalone/core/providers/.eslintrc.json @@ -0,0 +1,36 @@ +{ + "extends": ["../../../../.eslintrc.json"], + "ignorePatterns": ["!**/*"], + "overrides": [ + { + "files": ["*.ts"], + "rules": { + "@angular-eslint/directive-selector": [ + "error", + { + "type": "attribute", + "prefix": "lib", + "style": "camelCase" + } + ], + "@angular-eslint/component-selector": [ + "error", + { + "type": "element", + "prefix": "lib", + "style": "kebab-case" + } + ] + }, + "extends": [ + "plugin:@nx/angular", + "plugin:@angular-eslint/template/process-inline-templates" + ] + }, + { + "files": ["*.html"], + "extends": ["plugin:@nx/angular-template"], + "rules": {} + } + ] +} diff --git a/libs/module-to-standalone/core/providers/README.md b/libs/module-to-standalone/core/providers/README.md new file mode 100644 index 0000000..e418186 --- /dev/null +++ b/libs/module-to-standalone/core/providers/README.md @@ -0,0 +1,7 @@ +# module-to-standalone-core-providers + +This library was generated with [Nx](https://nx.dev). + +## Running unit tests + +Run `nx test module-to-standalone-core-providers` to execute the unit tests. diff --git a/libs/module-to-standalone/core/providers/jest.config.ts b/libs/module-to-standalone/core/providers/jest.config.ts new file mode 100644 index 0000000..d7c3486 --- /dev/null +++ b/libs/module-to-standalone/core/providers/jest.config.ts @@ -0,0 +1,23 @@ +/* eslint-disable */ +export default { + displayName: 'module-to-standalone-core-providers', + preset: '../../../../jest.preset.js', + setupFilesAfterEnv: ['/src/test-setup.ts'], + coverageDirectory: + '../../../../coverage/libs/module-to-standalone/core/providers', + transform: { + '^.+\\.(ts|mjs|js|html)$': [ + 'jest-preset-angular', + { + tsconfig: '/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/libs/module-to-standalone/core/providers/ng-package.json b/libs/module-to-standalone/core/providers/ng-package.json new file mode 100644 index 0000000..d19cc55 --- /dev/null +++ b/libs/module-to-standalone/core/providers/ng-package.json @@ -0,0 +1,7 @@ +{ + "$schema": "../../../../node_modules/ng-packagr/ng-package.schema.json", + "dest": "../../../../dist/libs/module-to-standalone/core/providers", + "lib": { + "entryFile": "src/index.ts" + } +} diff --git a/libs/module-to-standalone/core/providers/package.json b/libs/module-to-standalone/core/providers/package.json new file mode 100644 index 0000000..82aac03 --- /dev/null +++ b/libs/module-to-standalone/core/providers/package.json @@ -0,0 +1,12 @@ +{ + "name": "@angular-challenges/module-to-standalone/core/providers", + "version": "0.0.1", + "peerDependencies": { + "@angular/common": "^16.0.0", + "@angular/core": "^16.0.0" + }, + "dependencies": { + "tslib": "^2.3.0" + }, + "sideEffects": false +} diff --git a/libs/module-to-standalone/core/providers/project.json b/libs/module-to-standalone/core/providers/project.json new file mode 100644 index 0000000..75f41e8 --- /dev/null +++ b/libs/module-to-standalone/core/providers/project.json @@ -0,0 +1,50 @@ +{ + "name": "module-to-standalone-core-providers", + "$schema": "../../../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "libs/module-to-standalone/core/providers/src", + "prefix": "lib", + "tags": [], + "projectType": "library", + "targets": { + "build": { + "executor": "@nx/angular:ng-packagr-lite", + "outputs": ["{workspaceRoot}/dist/{projectRoot}"], + "options": { + "project": "libs/module-to-standalone/core/providers/ng-package.json" + }, + "configurations": { + "production": { + "tsConfig": "libs/module-to-standalone/core/providers/tsconfig.lib.prod.json" + }, + "development": { + "tsConfig": "libs/module-to-standalone/core/providers/tsconfig.lib.json" + } + }, + "defaultConfiguration": "production" + }, + "test": { + "executor": "@nx/jest:jest", + "outputs": ["{workspaceRoot}/coverage/{projectRoot}"], + "options": { + "jestConfig": "libs/module-to-standalone/core/providers/jest.config.ts", + "passWithNoTests": true + }, + "configurations": { + "ci": { + "ci": true, + "codeCoverage": true + } + } + }, + "lint": { + "executor": "@nx/linter:eslint", + "outputs": ["{options.outputFile}"], + "options": { + "lintFilePatterns": [ + "libs/module-to-standalone/core/providers/**/*.ts", + "libs/module-to-standalone/core/providers/**/*.html" + ] + } + } + } +} diff --git a/libs/module-to-standalone/core/providers/src/index.ts b/libs/module-to-standalone/core/providers/src/index.ts new file mode 100644 index 0000000..cf9fbaf --- /dev/null +++ b/libs/module-to-standalone/core/providers/src/index.ts @@ -0,0 +1 @@ +export * from './lib/token.provider'; diff --git a/libs/module-to-standalone/core/providers/src/lib/token.provider.ts b/libs/module-to-standalone/core/providers/src/lib/token.provider.ts new file mode 100644 index 0000000..3f498ee --- /dev/null +++ b/libs/module-to-standalone/core/providers/src/lib/token.provider.ts @@ -0,0 +1,16 @@ +import { + EnvironmentProviders, + InjectionToken, + makeEnvironmentProviders, +} from '@angular/core'; + +export const TOKEN = new InjectionToken('token'); + +export const provideToken = (token: string): EnvironmentProviders => { + return makeEnvironmentProviders([ + { + provide: TOKEN, + useValue: token, + }, + ]); +}; diff --git a/libs/module-to-standalone/core/providers/src/test-setup.ts b/libs/module-to-standalone/core/providers/src/test-setup.ts new file mode 100644 index 0000000..ab1eeeb --- /dev/null +++ b/libs/module-to-standalone/core/providers/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/libs/module-to-standalone/core/providers/tsconfig.json b/libs/module-to-standalone/core/providers/tsconfig.json new file mode 100644 index 0000000..b9e5be0 --- /dev/null +++ b/libs/module-to-standalone/core/providers/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/libs/module-to-standalone/core/providers/tsconfig.lib.json b/libs/module-to-standalone/core/providers/tsconfig.lib.json new file mode 100644 index 0000000..9127387 --- /dev/null +++ b/libs/module-to-standalone/core/providers/tsconfig.lib.json @@ -0,0 +1,17 @@ +{ + "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/libs/module-to-standalone/core/providers/tsconfig.lib.prod.json b/libs/module-to-standalone/core/providers/tsconfig.lib.prod.json new file mode 100644 index 0000000..61b5237 --- /dev/null +++ b/libs/module-to-standalone/core/providers/tsconfig.lib.prod.json @@ -0,0 +1,7 @@ +{ + "extends": "./tsconfig.lib.json", + "compilerOptions": { + "declarationMap": false + }, + "angularCompilerOptions": {} +} diff --git a/libs/module-to-standalone/core/providers/tsconfig.spec.json b/libs/module-to-standalone/core/providers/tsconfig.spec.json new file mode 100644 index 0000000..6e5925e --- /dev/null +++ b/libs/module-to-standalone/core/providers/tsconfig.spec.json @@ -0,0 +1,16 @@ +{ + "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/libs/module-to-standalone/core/service/.eslintrc.json b/libs/module-to-standalone/core/service/.eslintrc.json new file mode 100644 index 0000000..b597630 --- /dev/null +++ b/libs/module-to-standalone/core/service/.eslintrc.json @@ -0,0 +1,36 @@ +{ + "extends": ["../../../../.eslintrc.json"], + "ignorePatterns": ["!**/*"], + "overrides": [ + { + "files": ["*.ts"], + "rules": { + "@angular-eslint/directive-selector": [ + "error", + { + "type": "attribute", + "prefix": "lib", + "style": "camelCase" + } + ], + "@angular-eslint/component-selector": [ + "error", + { + "type": "element", + "prefix": "lib", + "style": "kebab-case" + } + ] + }, + "extends": [ + "plugin:@nx/angular", + "plugin:@angular-eslint/template/process-inline-templates" + ] + }, + { + "files": ["*.html"], + "extends": ["plugin:@nx/angular-template"], + "rules": {} + } + ] +} diff --git a/libs/module-to-standalone/core/service/README.md b/libs/module-to-standalone/core/service/README.md new file mode 100644 index 0000000..9f33e41 --- /dev/null +++ b/libs/module-to-standalone/core/service/README.md @@ -0,0 +1,7 @@ +# module-to-standalone-core-service + +This library was generated with [Nx](https://nx.dev). + +## Running unit tests + +Run `nx test module-to-standalone-core-service` to execute the unit tests. diff --git a/libs/module-to-standalone/core/service/jest.config.ts b/libs/module-to-standalone/core/service/jest.config.ts new file mode 100644 index 0000000..82808fc --- /dev/null +++ b/libs/module-to-standalone/core/service/jest.config.ts @@ -0,0 +1,23 @@ +/* eslint-disable */ +export default { + displayName: 'module-to-standalone-core-service', + preset: '../../../../jest.preset.js', + setupFilesAfterEnv: ['/src/test-setup.ts'], + coverageDirectory: + '../../../../coverage/libs/module-to-standalone/core/service', + transform: { + '^.+\\.(ts|mjs|js|html)$': [ + 'jest-preset-angular', + { + tsconfig: '/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/libs/module-to-standalone/core/service/project.json b/libs/module-to-standalone/core/service/project.json new file mode 100644 index 0000000..b12404e --- /dev/null +++ b/libs/module-to-standalone/core/service/project.json @@ -0,0 +1,34 @@ +{ + "name": "module-to-standalone-core-service", + "$schema": "../../../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "libs/module-to-standalone/core/service/src", + "prefix": "lib", + "tags": [], + "projectType": "library", + "targets": { + "test": { + "executor": "@nx/jest:jest", + "outputs": ["{workspaceRoot}/coverage/{projectRoot}"], + "options": { + "jestConfig": "libs/module-to-standalone/core/service/jest.config.ts", + "passWithNoTests": true + }, + "configurations": { + "ci": { + "ci": true, + "codeCoverage": true + } + } + }, + "lint": { + "executor": "@nx/linter:eslint", + "outputs": ["{options.outputFile}"], + "options": { + "lintFilePatterns": [ + "libs/module-to-standalone/core/service/**/*.ts", + "libs/module-to-standalone/core/service/**/*.html" + ] + } + } + } +} diff --git a/libs/module-to-standalone/core/service/src/index.ts b/libs/module-to-standalone/core/service/src/index.ts new file mode 100644 index 0000000..c964214 --- /dev/null +++ b/libs/module-to-standalone/core/service/src/index.ts @@ -0,0 +1 @@ +export * from './lib/authorization.service'; diff --git a/libs/module-to-standalone/core/service/src/lib/authorization.service.ts b/libs/module-to-standalone/core/service/src/lib/authorization.service.ts new file mode 100644 index 0000000..d991109 --- /dev/null +++ b/libs/module-to-standalone/core/service/src/lib/authorization.service.ts @@ -0,0 +1,16 @@ +import { Injectable } from '@angular/core'; +import { BehaviorSubject } from 'rxjs'; + +@Injectable({ providedIn: 'root' }) +export class AuthorizationService { + private isAuthorized = new BehaviorSubject(true); + isAuthorized$ = this.isAuthorized.asObservable(); + + authorize() { + this.isAuthorized.next(true); + } + + forbid() { + this.isAuthorized.next(false); + } +} diff --git a/libs/module-to-standalone/core/service/src/test-setup.ts b/libs/module-to-standalone/core/service/src/test-setup.ts new file mode 100644 index 0000000..ab1eeeb --- /dev/null +++ b/libs/module-to-standalone/core/service/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/libs/module-to-standalone/core/service/tsconfig.json b/libs/module-to-standalone/core/service/tsconfig.json new file mode 100644 index 0000000..b9e5be0 --- /dev/null +++ b/libs/module-to-standalone/core/service/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/libs/module-to-standalone/core/service/tsconfig.lib.json b/libs/module-to-standalone/core/service/tsconfig.lib.json new file mode 100644 index 0000000..9127387 --- /dev/null +++ b/libs/module-to-standalone/core/service/tsconfig.lib.json @@ -0,0 +1,17 @@ +{ + "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/libs/module-to-standalone/core/service/tsconfig.spec.json b/libs/module-to-standalone/core/service/tsconfig.spec.json new file mode 100644 index 0000000..6e5925e --- /dev/null +++ b/libs/module-to-standalone/core/service/tsconfig.spec.json @@ -0,0 +1,16 @@ +{ + "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/libs/module-to-standalone/forbidden/.eslintrc.json b/libs/module-to-standalone/forbidden/.eslintrc.json new file mode 100644 index 0000000..56c12ac --- /dev/null +++ b/libs/module-to-standalone/forbidden/.eslintrc.json @@ -0,0 +1,36 @@ +{ + "extends": ["../../../.eslintrc.json"], + "ignorePatterns": ["!**/*"], + "overrides": [ + { + "files": ["*.ts"], + "rules": { + "@angular-eslint/directive-selector": [ + "error", + { + "type": "attribute", + "prefix": "lib", + "style": "camelCase" + } + ], + "@angular-eslint/component-selector": [ + "error", + { + "type": "element", + "prefix": "lib", + "style": "kebab-case" + } + ] + }, + "extends": [ + "plugin:@nx/angular", + "plugin:@angular-eslint/template/process-inline-templates" + ] + }, + { + "files": ["*.html"], + "extends": ["plugin:@nx/angular-template"], + "rules": {} + } + ] +} diff --git a/libs/module-to-standalone/forbidden/README.md b/libs/module-to-standalone/forbidden/README.md new file mode 100644 index 0000000..0e06177 --- /dev/null +++ b/libs/module-to-standalone/forbidden/README.md @@ -0,0 +1,7 @@ +# module-to-standalone-forbidden + +This library was generated with [Nx](https://nx.dev). + +## Running unit tests + +Run `nx test module-to-standalone-forbidden` to execute the unit tests. diff --git a/libs/module-to-standalone/forbidden/jest.config.ts b/libs/module-to-standalone/forbidden/jest.config.ts new file mode 100644 index 0000000..7470436 --- /dev/null +++ b/libs/module-to-standalone/forbidden/jest.config.ts @@ -0,0 +1,22 @@ +/* eslint-disable */ +export default { + displayName: 'module-to-standalone-forbidden', + preset: '../../../jest.preset.js', + setupFilesAfterEnv: ['/src/test-setup.ts'], + coverageDirectory: '../../../coverage/libs/module-to-standalone/forbidden', + transform: { + '^.+\\.(ts|mjs|js|html)$': [ + 'jest-preset-angular', + { + tsconfig: '/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/libs/module-to-standalone/forbidden/project.json b/libs/module-to-standalone/forbidden/project.json new file mode 100644 index 0000000..3ac94e9 --- /dev/null +++ b/libs/module-to-standalone/forbidden/project.json @@ -0,0 +1,34 @@ +{ + "name": "module-to-standalone-forbidden", + "$schema": "../../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "libs/module-to-standalone/forbidden/src", + "prefix": "lib", + "tags": [], + "projectType": "library", + "targets": { + "test": { + "executor": "@nx/jest:jest", + "outputs": ["{workspaceRoot}/coverage/{projectRoot}"], + "options": { + "jestConfig": "libs/module-to-standalone/forbidden/jest.config.ts", + "passWithNoTests": true + }, + "configurations": { + "ci": { + "ci": true, + "codeCoverage": true + } + } + }, + "lint": { + "executor": "@nx/linter:eslint", + "outputs": ["{options.outputFile}"], + "options": { + "lintFilePatterns": [ + "libs/module-to-standalone/forbidden/**/*.ts", + "libs/module-to-standalone/forbidden/**/*.html" + ] + } + } + } +} diff --git a/libs/module-to-standalone/forbidden/src/index.ts b/libs/module-to-standalone/forbidden/src/index.ts new file mode 100644 index 0000000..672622f --- /dev/null +++ b/libs/module-to-standalone/forbidden/src/index.ts @@ -0,0 +1 @@ +export * from './lib/forbidden.module'; diff --git a/libs/module-to-standalone/forbidden/src/lib/forbidden.component.ts b/libs/module-to-standalone/forbidden/src/lib/forbidden.component.ts new file mode 100644 index 0000000..18d6c2d --- /dev/null +++ b/libs/module-to-standalone/forbidden/src/lib/forbidden.component.ts @@ -0,0 +1,7 @@ +import { Component } from '@angular/core'; + +@Component({ + selector: 'lib-home', + template: `Forbidden component`, +}) +export class ForbiddenComponent {} diff --git a/libs/module-to-standalone/forbidden/src/lib/forbidden.module.ts b/libs/module-to-standalone/forbidden/src/lib/forbidden.module.ts new file mode 100644 index 0000000..0b363bf --- /dev/null +++ b/libs/module-to-standalone/forbidden/src/lib/forbidden.module.ts @@ -0,0 +1,13 @@ +import { CommonModule } from '@angular/common'; +import { NgModule } from '@angular/core'; +import { RouterModule } from '@angular/router'; +import { ForbiddenComponent } from './forbidden.component'; + +@NgModule({ + declarations: [ForbiddenComponent], + imports: [ + CommonModule, + RouterModule.forChild([{ path: '', component: ForbiddenComponent }]), + ], +}) +export class ForbiddenModule {} diff --git a/libs/module-to-standalone/forbidden/src/test-setup.ts b/libs/module-to-standalone/forbidden/src/test-setup.ts new file mode 100644 index 0000000..ab1eeeb --- /dev/null +++ b/libs/module-to-standalone/forbidden/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/libs/module-to-standalone/forbidden/tsconfig.json b/libs/module-to-standalone/forbidden/tsconfig.json new file mode 100644 index 0000000..5cf0a16 --- /dev/null +++ b/libs/module-to-standalone/forbidden/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/libs/module-to-standalone/forbidden/tsconfig.lib.json b/libs/module-to-standalone/forbidden/tsconfig.lib.json new file mode 100644 index 0000000..9b49be7 --- /dev/null +++ b/libs/module-to-standalone/forbidden/tsconfig.lib.json @@ -0,0 +1,17 @@ +{ + "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/libs/module-to-standalone/forbidden/tsconfig.spec.json b/libs/module-to-standalone/forbidden/tsconfig.spec.json new file mode 100644 index 0000000..f858ef7 --- /dev/null +++ b/libs/module-to-standalone/forbidden/tsconfig.spec.json @@ -0,0 +1,16 @@ +{ + "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/libs/module-to-standalone/home/.eslintrc.json b/libs/module-to-standalone/home/.eslintrc.json new file mode 100644 index 0000000..56c12ac --- /dev/null +++ b/libs/module-to-standalone/home/.eslintrc.json @@ -0,0 +1,36 @@ +{ + "extends": ["../../../.eslintrc.json"], + "ignorePatterns": ["!**/*"], + "overrides": [ + { + "files": ["*.ts"], + "rules": { + "@angular-eslint/directive-selector": [ + "error", + { + "type": "attribute", + "prefix": "lib", + "style": "camelCase" + } + ], + "@angular-eslint/component-selector": [ + "error", + { + "type": "element", + "prefix": "lib", + "style": "kebab-case" + } + ] + }, + "extends": [ + "plugin:@nx/angular", + "plugin:@angular-eslint/template/process-inline-templates" + ] + }, + { + "files": ["*.html"], + "extends": ["plugin:@nx/angular-template"], + "rules": {} + } + ] +} diff --git a/libs/module-to-standalone/home/README.md b/libs/module-to-standalone/home/README.md new file mode 100644 index 0000000..de075cc --- /dev/null +++ b/libs/module-to-standalone/home/README.md @@ -0,0 +1,7 @@ +# module-to-standalone-home + +This library was generated with [Nx](https://nx.dev). + +## Running unit tests + +Run `nx test module-to-standalone-home` to execute the unit tests. diff --git a/libs/module-to-standalone/home/jest.config.ts b/libs/module-to-standalone/home/jest.config.ts new file mode 100644 index 0000000..b4d6a04 --- /dev/null +++ b/libs/module-to-standalone/home/jest.config.ts @@ -0,0 +1,22 @@ +/* eslint-disable */ +export default { + displayName: 'module-to-standalone-home', + preset: '../../../jest.preset.js', + setupFilesAfterEnv: ['/src/test-setup.ts'], + coverageDirectory: '../../../coverage/libs/module-to-standalone/home', + transform: { + '^.+\\.(ts|mjs|js|html)$': [ + 'jest-preset-angular', + { + tsconfig: '/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/libs/module-to-standalone/home/project.json b/libs/module-to-standalone/home/project.json new file mode 100644 index 0000000..cec9d5b --- /dev/null +++ b/libs/module-to-standalone/home/project.json @@ -0,0 +1,34 @@ +{ + "name": "module-to-standalone-home", + "$schema": "../../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "libs/module-to-standalone/home/src", + "prefix": "lib", + "tags": [], + "projectType": "library", + "targets": { + "test": { + "executor": "@nx/jest:jest", + "outputs": ["{workspaceRoot}/coverage/{projectRoot}"], + "options": { + "jestConfig": "libs/module-to-standalone/home/jest.config.ts", + "passWithNoTests": true + }, + "configurations": { + "ci": { + "ci": true, + "codeCoverage": true + } + } + }, + "lint": { + "executor": "@nx/linter:eslint", + "outputs": ["{options.outputFile}"], + "options": { + "lintFilePatterns": [ + "libs/module-to-standalone/home/**/*.ts", + "libs/module-to-standalone/home/**/*.html" + ] + } + } + } +} diff --git a/libs/module-to-standalone/home/src/index.ts b/libs/module-to-standalone/home/src/index.ts new file mode 100644 index 0000000..fe97ad5 --- /dev/null +++ b/libs/module-to-standalone/home/src/index.ts @@ -0,0 +1 @@ +export * from './lib/home.module'; diff --git a/libs/module-to-standalone/home/src/lib/home.component.ts b/libs/module-to-standalone/home/src/lib/home.component.ts new file mode 100644 index 0000000..7e5c6f3 --- /dev/null +++ b/libs/module-to-standalone/home/src/lib/home.component.ts @@ -0,0 +1,27 @@ +import { TOKEN } from '@angular-challenges/module-to-standalone/core/providers'; +import { AuthorizationService } from '@angular-challenges/module-to-standalone/core/service'; +import { Component, Inject } from '@angular/core'; + +@Component({ + selector: 'lib-home', + template: `Home component + +
+ Authorization : + + + (isAuthorized: {{ authorizeService.isAuthorized$ | async }}) +
+ +
LoadedToken {{ token }}
`, +}) +export class HomeComponent { + constructor( + public authorizeService: AuthorizationService, + @Inject(TOKEN) public token: string + ) {} +} diff --git a/libs/module-to-standalone/home/src/lib/home.module.ts b/libs/module-to-standalone/home/src/lib/home.module.ts new file mode 100644 index 0000000..30ae1ea --- /dev/null +++ b/libs/module-to-standalone/home/src/lib/home.module.ts @@ -0,0 +1,13 @@ +import { CommonModule } from '@angular/common'; +import { NgModule } from '@angular/core'; +import { RouterModule } from '@angular/router'; +import { HomeComponent } from './home.component'; + +@NgModule({ + declarations: [HomeComponent], + imports: [ + RouterModule.forChild([{ path: '', component: HomeComponent }]), + CommonModule, + ], +}) +export class ModuleToStandaloneHomeModule {} diff --git a/libs/module-to-standalone/home/src/test-setup.ts b/libs/module-to-standalone/home/src/test-setup.ts new file mode 100644 index 0000000..ab1eeeb --- /dev/null +++ b/libs/module-to-standalone/home/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/libs/module-to-standalone/home/tsconfig.json b/libs/module-to-standalone/home/tsconfig.json new file mode 100644 index 0000000..5cf0a16 --- /dev/null +++ b/libs/module-to-standalone/home/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/libs/module-to-standalone/home/tsconfig.lib.json b/libs/module-to-standalone/home/tsconfig.lib.json new file mode 100644 index 0000000..9b49be7 --- /dev/null +++ b/libs/module-to-standalone/home/tsconfig.lib.json @@ -0,0 +1,17 @@ +{ + "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/libs/module-to-standalone/home/tsconfig.spec.json b/libs/module-to-standalone/home/tsconfig.spec.json new file mode 100644 index 0000000..f858ef7 --- /dev/null +++ b/libs/module-to-standalone/home/tsconfig.spec.json @@ -0,0 +1,16 @@ +{ + "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/libs/module-to-standalone/shell/.eslintrc.json b/libs/module-to-standalone/shell/.eslintrc.json new file mode 100644 index 0000000..56c12ac --- /dev/null +++ b/libs/module-to-standalone/shell/.eslintrc.json @@ -0,0 +1,36 @@ +{ + "extends": ["../../../.eslintrc.json"], + "ignorePatterns": ["!**/*"], + "overrides": [ + { + "files": ["*.ts"], + "rules": { + "@angular-eslint/directive-selector": [ + "error", + { + "type": "attribute", + "prefix": "lib", + "style": "camelCase" + } + ], + "@angular-eslint/component-selector": [ + "error", + { + "type": "element", + "prefix": "lib", + "style": "kebab-case" + } + ] + }, + "extends": [ + "plugin:@nx/angular", + "plugin:@angular-eslint/template/process-inline-templates" + ] + }, + { + "files": ["*.html"], + "extends": ["plugin:@nx/angular-template"], + "rules": {} + } + ] +} diff --git a/libs/module-to-standalone/shell/README.md b/libs/module-to-standalone/shell/README.md new file mode 100644 index 0000000..0fbe7e1 --- /dev/null +++ b/libs/module-to-standalone/shell/README.md @@ -0,0 +1,7 @@ +# module-to-standalone-shell + +This library was generated with [Nx](https://nx.dev). + +## Running unit tests + +Run `nx test module-to-standalone-shell` to execute the unit tests. diff --git a/libs/module-to-standalone/shell/jest.config.ts b/libs/module-to-standalone/shell/jest.config.ts new file mode 100644 index 0000000..ff53f23 --- /dev/null +++ b/libs/module-to-standalone/shell/jest.config.ts @@ -0,0 +1,22 @@ +/* eslint-disable */ +export default { + displayName: 'module-to-standalone-shell', + preset: '../../../jest.preset.js', + setupFilesAfterEnv: ['/src/test-setup.ts'], + coverageDirectory: '../../../coverage/libs/module-to-standalone/shell', + transform: { + '^.+\\.(ts|mjs|js|html)$': [ + 'jest-preset-angular', + { + tsconfig: '/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/libs/module-to-standalone/shell/project.json b/libs/module-to-standalone/shell/project.json new file mode 100644 index 0000000..75f9e5b --- /dev/null +++ b/libs/module-to-standalone/shell/project.json @@ -0,0 +1,34 @@ +{ + "name": "module-to-standalone-shell", + "$schema": "../../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "libs/module-to-standalone/shell/src", + "prefix": "lib", + "tags": [], + "projectType": "library", + "targets": { + "test": { + "executor": "@nx/jest:jest", + "outputs": ["{workspaceRoot}/coverage/{projectRoot}"], + "options": { + "jestConfig": "libs/module-to-standalone/shell/jest.config.ts", + "passWithNoTests": true + }, + "configurations": { + "ci": { + "ci": true, + "codeCoverage": true + } + } + }, + "lint": { + "executor": "@nx/linter:eslint", + "outputs": ["{options.outputFile}"], + "options": { + "lintFilePatterns": [ + "libs/module-to-standalone/shell/**/*.ts", + "libs/module-to-standalone/shell/**/*.html" + ] + } + } + } +} diff --git a/libs/module-to-standalone/shell/src/index.ts b/libs/module-to-standalone/shell/src/index.ts new file mode 100644 index 0000000..494d409 --- /dev/null +++ b/libs/module-to-standalone/shell/src/index.ts @@ -0,0 +1 @@ +export * from './lib/main-shell.module'; diff --git a/libs/module-to-standalone/shell/src/lib/main-shell.module.ts b/libs/module-to-standalone/shell/src/lib/main-shell.module.ts new file mode 100644 index 0000000..e886da9 --- /dev/null +++ b/libs/module-to-standalone/shell/src/lib/main-shell.module.ts @@ -0,0 +1,11 @@ +import { provideToken } from '@angular-challenges/module-to-standalone/core/providers'; +import { NgModule } from '@angular/core'; +import { RouterModule } from '@angular/router'; +import { appRoutes } from './main-shell.routes'; + +@NgModule({ + imports: [RouterModule.forRoot(appRoutes)], + exports: [RouterModule], + providers: [provideToken('main-shell-token')], +}) +export class MainShellModule {} diff --git a/libs/module-to-standalone/shell/src/lib/main-shell.routes.ts b/libs/module-to-standalone/shell/src/lib/main-shell.routes.ts new file mode 100644 index 0000000..8578fe8 --- /dev/null +++ b/libs/module-to-standalone/shell/src/lib/main-shell.routes.ts @@ -0,0 +1,34 @@ +import { Route } from '@angular/router'; + +export const appRoutes: Route[] = [ + { path: '', redirectTo: 'home', pathMatch: 'full' }, + { + path: 'home', + loadChildren: () => + import('@angular-challenges/module-to-standalone/home').then( + (m) => m.ModuleToStandaloneHomeModule + ), + }, + { + path: 'admin', + loadChildren: () => + import('@angular-challenges/module-to-standalone/admin/feature').then( + (m) => m.AdminFeatureModule + ), + }, + { + path: 'user', + loadChildren: () => + import('@angular-challenges/module-to-standalone/user/shell').then( + (m) => m.UserShellModule + ), + }, + + { + path: 'forbidden', + loadChildren: () => + import('@angular-challenges/module-to-standalone/forbidden').then( + (m) => m.ForbiddenModule + ), + }, +]; diff --git a/libs/module-to-standalone/shell/src/test-setup.ts b/libs/module-to-standalone/shell/src/test-setup.ts new file mode 100644 index 0000000..ab1eeeb --- /dev/null +++ b/libs/module-to-standalone/shell/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/libs/module-to-standalone/shell/tsconfig.json b/libs/module-to-standalone/shell/tsconfig.json new file mode 100644 index 0000000..5cf0a16 --- /dev/null +++ b/libs/module-to-standalone/shell/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/libs/module-to-standalone/shell/tsconfig.lib.json b/libs/module-to-standalone/shell/tsconfig.lib.json new file mode 100644 index 0000000..9b49be7 --- /dev/null +++ b/libs/module-to-standalone/shell/tsconfig.lib.json @@ -0,0 +1,17 @@ +{ + "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/libs/module-to-standalone/shell/tsconfig.spec.json b/libs/module-to-standalone/shell/tsconfig.spec.json new file mode 100644 index 0000000..f858ef7 --- /dev/null +++ b/libs/module-to-standalone/shell/tsconfig.spec.json @@ -0,0 +1,16 @@ +{ + "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/libs/module-to-standalone/user/contact/.eslintrc.json b/libs/module-to-standalone/user/contact/.eslintrc.json new file mode 100644 index 0000000..b597630 --- /dev/null +++ b/libs/module-to-standalone/user/contact/.eslintrc.json @@ -0,0 +1,36 @@ +{ + "extends": ["../../../../.eslintrc.json"], + "ignorePatterns": ["!**/*"], + "overrides": [ + { + "files": ["*.ts"], + "rules": { + "@angular-eslint/directive-selector": [ + "error", + { + "type": "attribute", + "prefix": "lib", + "style": "camelCase" + } + ], + "@angular-eslint/component-selector": [ + "error", + { + "type": "element", + "prefix": "lib", + "style": "kebab-case" + } + ] + }, + "extends": [ + "plugin:@nx/angular", + "plugin:@angular-eslint/template/process-inline-templates" + ] + }, + { + "files": ["*.html"], + "extends": ["plugin:@nx/angular-template"], + "rules": {} + } + ] +} diff --git a/libs/module-to-standalone/user/contact/README.md b/libs/module-to-standalone/user/contact/README.md new file mode 100644 index 0000000..bf29f85 --- /dev/null +++ b/libs/module-to-standalone/user/contact/README.md @@ -0,0 +1,7 @@ +# module-to-standalone-user-contact + +This library was generated with [Nx](https://nx.dev). + +## Running unit tests + +Run `nx test module-to-standalone-user-contact` to execute the unit tests. diff --git a/libs/module-to-standalone/user/contact/jest.config.ts b/libs/module-to-standalone/user/contact/jest.config.ts new file mode 100644 index 0000000..c6402b9 --- /dev/null +++ b/libs/module-to-standalone/user/contact/jest.config.ts @@ -0,0 +1,23 @@ +/* eslint-disable */ +export default { + displayName: 'module-to-standalone-user-contact', + preset: '../../../../jest.preset.js', + setupFilesAfterEnv: ['/src/test-setup.ts'], + coverageDirectory: + '../../../../coverage/libs/module-to-standalone/user/contact', + transform: { + '^.+\\.(ts|mjs|js|html)$': [ + 'jest-preset-angular', + { + tsconfig: '/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/libs/module-to-standalone/user/contact/ng-package.json b/libs/module-to-standalone/user/contact/ng-package.json new file mode 100644 index 0000000..e24aaa0 --- /dev/null +++ b/libs/module-to-standalone/user/contact/ng-package.json @@ -0,0 +1,7 @@ +{ + "$schema": "../../../../node_modules/ng-packagr/ng-package.schema.json", + "dest": "../../../../dist/libs/module-to-standalone/user/contact", + "lib": { + "entryFile": "src/index.ts" + } +} diff --git a/libs/module-to-standalone/user/contact/package.json b/libs/module-to-standalone/user/contact/package.json new file mode 100644 index 0000000..c69df7c --- /dev/null +++ b/libs/module-to-standalone/user/contact/package.json @@ -0,0 +1,12 @@ +{ + "name": "@angular-challenges/module-to-standalone/user/contact", + "version": "0.0.1", + "peerDependencies": { + "@angular/common": "^16.0.0", + "@angular/core": "^16.0.0" + }, + "dependencies": { + "tslib": "^2.3.0" + }, + "sideEffects": false +} diff --git a/libs/module-to-standalone/user/contact/project.json b/libs/module-to-standalone/user/contact/project.json new file mode 100644 index 0000000..eb6e5e7 --- /dev/null +++ b/libs/module-to-standalone/user/contact/project.json @@ -0,0 +1,50 @@ +{ + "name": "module-to-standalone-user-contact", + "$schema": "../../../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "libs/module-to-standalone/user/contact/src", + "prefix": "lib", + "tags": [], + "projectType": "library", + "targets": { + "build": { + "executor": "@nx/angular:ng-packagr-lite", + "outputs": ["{workspaceRoot}/dist/{projectRoot}"], + "options": { + "project": "libs/module-to-standalone/user/contact/ng-package.json" + }, + "configurations": { + "production": { + "tsConfig": "libs/module-to-standalone/user/contact/tsconfig.lib.prod.json" + }, + "development": { + "tsConfig": "libs/module-to-standalone/user/contact/tsconfig.lib.json" + } + }, + "defaultConfiguration": "production" + }, + "test": { + "executor": "@nx/jest:jest", + "outputs": ["{workspaceRoot}/coverage/{projectRoot}"], + "options": { + "jestConfig": "libs/module-to-standalone/user/contact/jest.config.ts", + "passWithNoTests": true + }, + "configurations": { + "ci": { + "ci": true, + "codeCoverage": true + } + } + }, + "lint": { + "executor": "@nx/linter:eslint", + "outputs": ["{options.outputFile}"], + "options": { + "lintFilePatterns": [ + "libs/module-to-standalone/user/contact/**/*.ts", + "libs/module-to-standalone/user/contact/**/*.html" + ] + } + } + } +} diff --git a/libs/module-to-standalone/user/contact/src/index.ts b/libs/module-to-standalone/user/contact/src/index.ts new file mode 100644 index 0000000..8561ea5 --- /dev/null +++ b/libs/module-to-standalone/user/contact/src/index.ts @@ -0,0 +1 @@ +export * from './lib/contact-feature.module'; diff --git a/libs/module-to-standalone/user/contact/src/lib/contact-feature.module.ts b/libs/module-to-standalone/user/contact/src/lib/contact-feature.module.ts new file mode 100644 index 0000000..70a4726 --- /dev/null +++ b/libs/module-to-standalone/user/contact/src/lib/contact-feature.module.ts @@ -0,0 +1,27 @@ +import { CommonModule } from '@angular/common'; +import { NgModule } from '@angular/core'; +import { RouterModule } from '@angular/router'; + +@NgModule({ + declarations: [], + imports: [ + CommonModule, + RouterModule.forChild([ + { + path: '', + loadChildren: () => + import('./dashboard/dashboard.component').then( + (m) => m.ContactDashboardModule + ), + }, + { + path: 'create-contact', + loadChildren: () => + import('./create-contact/create-contact.component').then( + (m) => m.CreateContactModule + ), + }, + ]), + ], +}) +export class ContactFeatureModule {} diff --git a/libs/module-to-standalone/user/contact/src/lib/create-contact/create-contact.component.ts b/libs/module-to-standalone/user/contact/src/lib/create-contact/create-contact.component.ts new file mode 100644 index 0000000..ffd2389 --- /dev/null +++ b/libs/module-to-standalone/user/contact/src/lib/create-contact/create-contact.component.ts @@ -0,0 +1,22 @@ +import { Component, NgModule } from '@angular/core'; +import { RouterModule } from '@angular/router'; + +@Component({ + selector: 'lib-create-contact', + template: `Create Contact Form + + `, +}) +export class CreateContactComponent {} + +@NgModule({ + imports: [ + RouterModule.forChild([{ path: '', component: CreateContactComponent }]), + ], + declarations: [CreateContactComponent], +}) +export class CreateContactModule {} diff --git a/libs/module-to-standalone/user/contact/src/lib/dashboard/dashboard.component.ts b/libs/module-to-standalone/user/contact/src/lib/dashboard/dashboard.component.ts new file mode 100644 index 0000000..3d6a81b --- /dev/null +++ b/libs/module-to-standalone/user/contact/src/lib/dashboard/dashboard.component.ts @@ -0,0 +1,22 @@ +import { Component, NgModule } from '@angular/core'; +import { RouterModule } from '@angular/router'; + +@Component({ + selector: 'lib-contact-dashboard', + template: `Contact Dashboard + + `, +}) +export class ContactDashboardComponent {} + +@NgModule({ + imports: [ + RouterModule.forChild([{ path: '', component: ContactDashboardComponent }]), + ], + declarations: [ContactDashboardComponent], +}) +export class ContactDashboardModule {} diff --git a/libs/module-to-standalone/user/contact/src/test-setup.ts b/libs/module-to-standalone/user/contact/src/test-setup.ts new file mode 100644 index 0000000..ab1eeeb --- /dev/null +++ b/libs/module-to-standalone/user/contact/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/libs/module-to-standalone/user/contact/tsconfig.json b/libs/module-to-standalone/user/contact/tsconfig.json new file mode 100644 index 0000000..b9e5be0 --- /dev/null +++ b/libs/module-to-standalone/user/contact/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/libs/module-to-standalone/user/contact/tsconfig.lib.json b/libs/module-to-standalone/user/contact/tsconfig.lib.json new file mode 100644 index 0000000..9127387 --- /dev/null +++ b/libs/module-to-standalone/user/contact/tsconfig.lib.json @@ -0,0 +1,17 @@ +{ + "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/libs/module-to-standalone/user/contact/tsconfig.lib.prod.json b/libs/module-to-standalone/user/contact/tsconfig.lib.prod.json new file mode 100644 index 0000000..61b5237 --- /dev/null +++ b/libs/module-to-standalone/user/contact/tsconfig.lib.prod.json @@ -0,0 +1,7 @@ +{ + "extends": "./tsconfig.lib.json", + "compilerOptions": { + "declarationMap": false + }, + "angularCompilerOptions": {} +} diff --git a/libs/module-to-standalone/user/contact/tsconfig.spec.json b/libs/module-to-standalone/user/contact/tsconfig.spec.json new file mode 100644 index 0000000..6e5925e --- /dev/null +++ b/libs/module-to-standalone/user/contact/tsconfig.spec.json @@ -0,0 +1,16 @@ +{ + "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/libs/module-to-standalone/user/feature/.eslintrc.json b/libs/module-to-standalone/user/feature/.eslintrc.json new file mode 100644 index 0000000..b597630 --- /dev/null +++ b/libs/module-to-standalone/user/feature/.eslintrc.json @@ -0,0 +1,36 @@ +{ + "extends": ["../../../../.eslintrc.json"], + "ignorePatterns": ["!**/*"], + "overrides": [ + { + "files": ["*.ts"], + "rules": { + "@angular-eslint/directive-selector": [ + "error", + { + "type": "attribute", + "prefix": "lib", + "style": "camelCase" + } + ], + "@angular-eslint/component-selector": [ + "error", + { + "type": "element", + "prefix": "lib", + "style": "kebab-case" + } + ] + }, + "extends": [ + "plugin:@nx/angular", + "plugin:@angular-eslint/template/process-inline-templates" + ] + }, + { + "files": ["*.html"], + "extends": ["plugin:@nx/angular-template"], + "rules": {} + } + ] +} diff --git a/libs/module-to-standalone/user/feature/README.md b/libs/module-to-standalone/user/feature/README.md new file mode 100644 index 0000000..c4cb490 --- /dev/null +++ b/libs/module-to-standalone/user/feature/README.md @@ -0,0 +1,7 @@ +# module-to-standalone-user-feature + +This library was generated with [Nx](https://nx.dev). + +## Running unit tests + +Run `nx test module-to-standalone-user-feature` to execute the unit tests. diff --git a/libs/module-to-standalone/user/feature/jest.config.ts b/libs/module-to-standalone/user/feature/jest.config.ts new file mode 100644 index 0000000..1103896 --- /dev/null +++ b/libs/module-to-standalone/user/feature/jest.config.ts @@ -0,0 +1,23 @@ +/* eslint-disable */ +export default { + displayName: 'module-to-standalone-user-feature', + preset: '../../../../jest.preset.js', + setupFilesAfterEnv: ['/src/test-setup.ts'], + coverageDirectory: + '../../../../coverage/libs/module-to-standalone/user/feature', + transform: { + '^.+\\.(ts|mjs|js|html)$': [ + 'jest-preset-angular', + { + tsconfig: '/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/libs/module-to-standalone/user/feature/ng-package.json b/libs/module-to-standalone/user/feature/ng-package.json new file mode 100644 index 0000000..6d7af66 --- /dev/null +++ b/libs/module-to-standalone/user/feature/ng-package.json @@ -0,0 +1,7 @@ +{ + "$schema": "../../../../node_modules/ng-packagr/ng-package.schema.json", + "dest": "../../../../dist/libs/module-to-standalone/user/feature", + "lib": { + "entryFile": "src/index.ts" + } +} diff --git a/libs/module-to-standalone/user/feature/package.json b/libs/module-to-standalone/user/feature/package.json new file mode 100644 index 0000000..342ede2 --- /dev/null +++ b/libs/module-to-standalone/user/feature/package.json @@ -0,0 +1,12 @@ +{ + "name": "@angular-challenges/module-to-standalone/user/feature", + "version": "0.0.1", + "peerDependencies": { + "@angular/common": "^16.0.0", + "@angular/core": "^16.0.0" + }, + "dependencies": { + "tslib": "^2.3.0" + }, + "sideEffects": false +} diff --git a/libs/module-to-standalone/user/feature/project.json b/libs/module-to-standalone/user/feature/project.json new file mode 100644 index 0000000..2f1f3f7 --- /dev/null +++ b/libs/module-to-standalone/user/feature/project.json @@ -0,0 +1,50 @@ +{ + "name": "module-to-standalone-user-feature", + "$schema": "../../../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "libs/module-to-standalone/user/feature/src", + "prefix": "lib", + "tags": [], + "projectType": "library", + "targets": { + "build": { + "executor": "@nx/angular:ng-packagr-lite", + "outputs": ["{workspaceRoot}/dist/{projectRoot}"], + "options": { + "project": "libs/module-to-standalone/user/feature/ng-package.json" + }, + "configurations": { + "production": { + "tsConfig": "libs/module-to-standalone/user/feature/tsconfig.lib.prod.json" + }, + "development": { + "tsConfig": "libs/module-to-standalone/user/feature/tsconfig.lib.json" + } + }, + "defaultConfiguration": "production" + }, + "test": { + "executor": "@nx/jest:jest", + "outputs": ["{workspaceRoot}/coverage/{projectRoot}"], + "options": { + "jestConfig": "libs/module-to-standalone/user/feature/jest.config.ts", + "passWithNoTests": true + }, + "configurations": { + "ci": { + "ci": true, + "codeCoverage": true + } + } + }, + "lint": { + "executor": "@nx/linter:eslint", + "outputs": ["{options.outputFile}"], + "options": { + "lintFilePatterns": [ + "libs/module-to-standalone/user/feature/**/*.ts", + "libs/module-to-standalone/user/feature/**/*.html" + ] + } + } + } +} diff --git a/libs/module-to-standalone/user/feature/src/index.ts b/libs/module-to-standalone/user/feature/src/index.ts new file mode 100644 index 0000000..9efe9ca --- /dev/null +++ b/libs/module-to-standalone/user/feature/src/index.ts @@ -0,0 +1,4 @@ +export * from './lib/module-to-standalone-user-feature.module'; +export * from './lib/lib.routes'; + +export * from './lib/lib.routes'; diff --git a/libs/module-to-standalone/user/feature/src/lib/lib.routes.ts b/libs/module-to-standalone/user/feature/src/lib/lib.routes.ts new file mode 100644 index 0000000..5652435 --- /dev/null +++ b/libs/module-to-standalone/user/feature/src/lib/lib.routes.ts @@ -0,0 +1,3 @@ +import { Route } from '@angular/router'; + +export const moduleToStandaloneUserFeatureRoutes: Route[] = []; diff --git a/libs/module-to-standalone/user/feature/src/lib/module-to-standalone-user-feature.module.ts b/libs/module-to-standalone/user/feature/src/lib/module-to-standalone-user-feature.module.ts new file mode 100644 index 0000000..9dc3f4c --- /dev/null +++ b/libs/module-to-standalone/user/feature/src/lib/module-to-standalone-user-feature.module.ts @@ -0,0 +1,13 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { RouterModule, RouterModule, Route } from '@angular/router'; +import { moduleToStandaloneUserFeatureRoutes } from './lib.routes'; + +@NgModule({ + imports: [ + CommonModule, + RouterModule.forChild(moduleToStandaloneUserFeatureRoutes), + RouterModule, + ], +}) +export class ModuleToStandaloneUserFeatureModule {} diff --git a/libs/module-to-standalone/user/feature/src/test-setup.ts b/libs/module-to-standalone/user/feature/src/test-setup.ts new file mode 100644 index 0000000..ab1eeeb --- /dev/null +++ b/libs/module-to-standalone/user/feature/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/libs/module-to-standalone/user/feature/tsconfig.json b/libs/module-to-standalone/user/feature/tsconfig.json new file mode 100644 index 0000000..b9e5be0 --- /dev/null +++ b/libs/module-to-standalone/user/feature/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/libs/module-to-standalone/user/feature/tsconfig.lib.json b/libs/module-to-standalone/user/feature/tsconfig.lib.json new file mode 100644 index 0000000..9127387 --- /dev/null +++ b/libs/module-to-standalone/user/feature/tsconfig.lib.json @@ -0,0 +1,17 @@ +{ + "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/libs/module-to-standalone/user/feature/tsconfig.lib.prod.json b/libs/module-to-standalone/user/feature/tsconfig.lib.prod.json new file mode 100644 index 0000000..61b5237 --- /dev/null +++ b/libs/module-to-standalone/user/feature/tsconfig.lib.prod.json @@ -0,0 +1,7 @@ +{ + "extends": "./tsconfig.lib.json", + "compilerOptions": { + "declarationMap": false + }, + "angularCompilerOptions": {} +} diff --git a/libs/module-to-standalone/user/feature/tsconfig.spec.json b/libs/module-to-standalone/user/feature/tsconfig.spec.json new file mode 100644 index 0000000..6e5925e --- /dev/null +++ b/libs/module-to-standalone/user/feature/tsconfig.spec.json @@ -0,0 +1,16 @@ +{ + "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/libs/module-to-standalone/user/home/.eslintrc.json b/libs/module-to-standalone/user/home/.eslintrc.json new file mode 100644 index 0000000..b597630 --- /dev/null +++ b/libs/module-to-standalone/user/home/.eslintrc.json @@ -0,0 +1,36 @@ +{ + "extends": ["../../../../.eslintrc.json"], + "ignorePatterns": ["!**/*"], + "overrides": [ + { + "files": ["*.ts"], + "rules": { + "@angular-eslint/directive-selector": [ + "error", + { + "type": "attribute", + "prefix": "lib", + "style": "camelCase" + } + ], + "@angular-eslint/component-selector": [ + "error", + { + "type": "element", + "prefix": "lib", + "style": "kebab-case" + } + ] + }, + "extends": [ + "plugin:@nx/angular", + "plugin:@angular-eslint/template/process-inline-templates" + ] + }, + { + "files": ["*.html"], + "extends": ["plugin:@nx/angular-template"], + "rules": {} + } + ] +} diff --git a/libs/module-to-standalone/user/home/README.md b/libs/module-to-standalone/user/home/README.md new file mode 100644 index 0000000..8c06694 --- /dev/null +++ b/libs/module-to-standalone/user/home/README.md @@ -0,0 +1,7 @@ +# module-to-standalone-user-home + +This library was generated with [Nx](https://nx.dev). + +## Running unit tests + +Run `nx test module-to-standalone-user-home` to execute the unit tests. diff --git a/libs/module-to-standalone/user/home/jest.config.ts b/libs/module-to-standalone/user/home/jest.config.ts new file mode 100644 index 0000000..90ae704 --- /dev/null +++ b/libs/module-to-standalone/user/home/jest.config.ts @@ -0,0 +1,22 @@ +/* eslint-disable */ +export default { + displayName: 'module-to-standalone-user-home', + preset: '../../../../jest.preset.js', + setupFilesAfterEnv: ['/src/test-setup.ts'], + coverageDirectory: '../../../../coverage/libs/module-to-standalone/user/home', + transform: { + '^.+\\.(ts|mjs|js|html)$': [ + 'jest-preset-angular', + { + tsconfig: '/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/libs/module-to-standalone/user/home/project.json b/libs/module-to-standalone/user/home/project.json new file mode 100644 index 0000000..503e50a --- /dev/null +++ b/libs/module-to-standalone/user/home/project.json @@ -0,0 +1,34 @@ +{ + "name": "module-to-standalone-user-home", + "$schema": "../../../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "libs/module-to-standalone/user/home/src", + "prefix": "angular-challenges", + "tags": [], + "projectType": "library", + "targets": { + "test": { + "executor": "@nx/jest:jest", + "outputs": ["{workspaceRoot}/coverage/{projectRoot}"], + "options": { + "jestConfig": "libs/module-to-standalone/user/home/jest.config.ts", + "passWithNoTests": true + }, + "configurations": { + "ci": { + "ci": true, + "codeCoverage": true + } + } + }, + "lint": { + "executor": "@nx/linter:eslint", + "outputs": ["{options.outputFile}"], + "options": { + "lintFilePatterns": [ + "libs/module-to-standalone/user/home/**/*.ts", + "libs/module-to-standalone/user/home/**/*.html" + ] + } + } + } +} diff --git a/libs/module-to-standalone/user/home/src/index.ts b/libs/module-to-standalone/user/home/src/index.ts new file mode 100644 index 0000000..fe97ad5 --- /dev/null +++ b/libs/module-to-standalone/user/home/src/index.ts @@ -0,0 +1 @@ +export * from './lib/home.module'; diff --git a/libs/module-to-standalone/user/home/src/lib/home.component.ts b/libs/module-to-standalone/user/home/src/lib/home.component.ts new file mode 100644 index 0000000..8e2bf7b --- /dev/null +++ b/libs/module-to-standalone/user/home/src/lib/home.component.ts @@ -0,0 +1,7 @@ +import { Component } from '@angular/core'; + +@Component({ + selector: 'lib-user-home', + template: `User Home component`, +}) +export class UserHomeComponent {} diff --git a/libs/module-to-standalone/user/home/src/lib/home.module.ts b/libs/module-to-standalone/user/home/src/lib/home.module.ts new file mode 100644 index 0000000..ceeb495 --- /dev/null +++ b/libs/module-to-standalone/user/home/src/lib/home.module.ts @@ -0,0 +1,11 @@ +import { NgModule } from '@angular/core'; +import { RouterModule } from '@angular/router'; +import { UserHomeComponent } from './home.component'; + +@NgModule({ + declarations: [UserHomeComponent], + imports: [ + RouterModule.forChild([{ path: '', component: UserHomeComponent }]), + ], +}) +export class UserHomeModule {} diff --git a/libs/module-to-standalone/user/home/src/test-setup.ts b/libs/module-to-standalone/user/home/src/test-setup.ts new file mode 100644 index 0000000..ab1eeeb --- /dev/null +++ b/libs/module-to-standalone/user/home/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/libs/module-to-standalone/user/home/tsconfig.json b/libs/module-to-standalone/user/home/tsconfig.json new file mode 100644 index 0000000..b9e5be0 --- /dev/null +++ b/libs/module-to-standalone/user/home/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/libs/module-to-standalone/user/home/tsconfig.lib.json b/libs/module-to-standalone/user/home/tsconfig.lib.json new file mode 100644 index 0000000..9127387 --- /dev/null +++ b/libs/module-to-standalone/user/home/tsconfig.lib.json @@ -0,0 +1,17 @@ +{ + "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/libs/module-to-standalone/user/home/tsconfig.spec.json b/libs/module-to-standalone/user/home/tsconfig.spec.json new file mode 100644 index 0000000..6e5925e --- /dev/null +++ b/libs/module-to-standalone/user/home/tsconfig.spec.json @@ -0,0 +1,16 @@ +{ + "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/libs/module-to-standalone/user/shell/.eslintrc.json b/libs/module-to-standalone/user/shell/.eslintrc.json new file mode 100644 index 0000000..b597630 --- /dev/null +++ b/libs/module-to-standalone/user/shell/.eslintrc.json @@ -0,0 +1,36 @@ +{ + "extends": ["../../../../.eslintrc.json"], + "ignorePatterns": ["!**/*"], + "overrides": [ + { + "files": ["*.ts"], + "rules": { + "@angular-eslint/directive-selector": [ + "error", + { + "type": "attribute", + "prefix": "lib", + "style": "camelCase" + } + ], + "@angular-eslint/component-selector": [ + "error", + { + "type": "element", + "prefix": "lib", + "style": "kebab-case" + } + ] + }, + "extends": [ + "plugin:@nx/angular", + "plugin:@angular-eslint/template/process-inline-templates" + ] + }, + { + "files": ["*.html"], + "extends": ["plugin:@nx/angular-template"], + "rules": {} + } + ] +} diff --git a/libs/module-to-standalone/user/shell/README.md b/libs/module-to-standalone/user/shell/README.md new file mode 100644 index 0000000..21158e3 --- /dev/null +++ b/libs/module-to-standalone/user/shell/README.md @@ -0,0 +1,7 @@ +# module-to-standalone-user-shell + +This library was generated with [Nx](https://nx.dev). + +## Running unit tests + +Run `nx test module-to-standalone-user-shell` to execute the unit tests. diff --git a/libs/module-to-standalone/user/shell/jest.config.ts b/libs/module-to-standalone/user/shell/jest.config.ts new file mode 100644 index 0000000..74a019b --- /dev/null +++ b/libs/module-to-standalone/user/shell/jest.config.ts @@ -0,0 +1,23 @@ +/* eslint-disable */ +export default { + displayName: 'module-to-standalone-user-shell', + preset: '../../../../jest.preset.js', + setupFilesAfterEnv: ['/src/test-setup.ts'], + coverageDirectory: + '../../../../coverage/libs/module-to-standalone/user/shell', + transform: { + '^.+\\.(ts|mjs|js|html)$': [ + 'jest-preset-angular', + { + tsconfig: '/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/libs/module-to-standalone/user/shell/ng-package.json b/libs/module-to-standalone/user/shell/ng-package.json new file mode 100644 index 0000000..04ce729 --- /dev/null +++ b/libs/module-to-standalone/user/shell/ng-package.json @@ -0,0 +1,7 @@ +{ + "$schema": "../../../../node_modules/ng-packagr/ng-package.schema.json", + "dest": "../../../../dist/libs/module-to-standalone/user/shell", + "lib": { + "entryFile": "src/index.ts" + } +} diff --git a/libs/module-to-standalone/user/shell/package.json b/libs/module-to-standalone/user/shell/package.json new file mode 100644 index 0000000..a6e33c6 --- /dev/null +++ b/libs/module-to-standalone/user/shell/package.json @@ -0,0 +1,12 @@ +{ + "name": "@angular-challenges/module-to-standalone/user/shell", + "version": "0.0.1", + "peerDependencies": { + "@angular/common": "^16.0.0", + "@angular/core": "^16.0.0" + }, + "dependencies": { + "tslib": "^2.3.0" + }, + "sideEffects": false +} diff --git a/libs/module-to-standalone/user/shell/project.json b/libs/module-to-standalone/user/shell/project.json new file mode 100644 index 0000000..a1a5bd2 --- /dev/null +++ b/libs/module-to-standalone/user/shell/project.json @@ -0,0 +1,50 @@ +{ + "name": "module-to-standalone-user-shell", + "$schema": "../../../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "libs/module-to-standalone/user/shell/src", + "prefix": "lib", + "tags": [], + "projectType": "library", + "targets": { + "build": { + "executor": "@nx/angular:ng-packagr-lite", + "outputs": ["{workspaceRoot}/dist/{projectRoot}"], + "options": { + "project": "libs/module-to-standalone/user/shell/ng-package.json" + }, + "configurations": { + "production": { + "tsConfig": "libs/module-to-standalone/user/shell/tsconfig.lib.prod.json" + }, + "development": { + "tsConfig": "libs/module-to-standalone/user/shell/tsconfig.lib.json" + } + }, + "defaultConfiguration": "production" + }, + "test": { + "executor": "@nx/jest:jest", + "outputs": ["{workspaceRoot}/coverage/{projectRoot}"], + "options": { + "jestConfig": "libs/module-to-standalone/user/shell/jest.config.ts", + "passWithNoTests": true + }, + "configurations": { + "ci": { + "ci": true, + "codeCoverage": true + } + } + }, + "lint": { + "executor": "@nx/linter:eslint", + "outputs": ["{options.outputFile}"], + "options": { + "lintFilePatterns": [ + "libs/module-to-standalone/user/shell/**/*.ts", + "libs/module-to-standalone/user/shell/**/*.html" + ] + } + } + } +} diff --git a/libs/module-to-standalone/user/shell/src/index.ts b/libs/module-to-standalone/user/shell/src/index.ts new file mode 100644 index 0000000..641fd68 --- /dev/null +++ b/libs/module-to-standalone/user/shell/src/index.ts @@ -0,0 +1 @@ +export * from './lib/user-shell.module'; diff --git a/libs/module-to-standalone/user/shell/src/lib/user-shell.component.ts b/libs/module-to-standalone/user/shell/src/lib/user-shell.component.ts new file mode 100644 index 0000000..2c106ba --- /dev/null +++ b/libs/module-to-standalone/user/shell/src/lib/user-shell.component.ts @@ -0,0 +1,33 @@ +import { TOKEN } from '@angular-challenges/module-to-standalone/core/providers'; +import { Component, Inject } from '@angular/core'; + +@Component({ + selector: 'lib-user-shell', + template: ` + -- User Panel -- +
+ + + More buttons ... +
+ +
+ LoadedToken + {{ token }} +
+ `, + host: { + class: 'flex flex-col p-4 gap-3 border border-blue', + }, +}) +export class UserShellComponent { + constructor(@Inject(TOKEN) public token: string) {} +} diff --git a/libs/module-to-standalone/user/shell/src/lib/user-shell.module.ts b/libs/module-to-standalone/user/shell/src/lib/user-shell.module.ts new file mode 100644 index 0000000..433d6f7 --- /dev/null +++ b/libs/module-to-standalone/user/shell/src/lib/user-shell.module.ts @@ -0,0 +1,13 @@ +import { provideToken } from '@angular-challenges/module-to-standalone/core/providers'; +import { CommonModule } from '@angular/common'; +import { NgModule } from '@angular/core'; +import { RouterModule } from '@angular/router'; +import { UserShellComponent } from './user-shell.component'; +import { userShellRoutes } from './user-shell.routes'; + +@NgModule({ + imports: [CommonModule, RouterModule.forChild(userShellRoutes), RouterModule], + declarations: [UserShellComponent], + providers: [provideToken('user-token')], +}) +export class UserShellModule {} diff --git a/libs/module-to-standalone/user/shell/src/lib/user-shell.routes.ts b/libs/module-to-standalone/user/shell/src/lib/user-shell.routes.ts new file mode 100644 index 0000000..4363686 --- /dev/null +++ b/libs/module-to-standalone/user/shell/src/lib/user-shell.routes.ts @@ -0,0 +1,26 @@ +import { Route } from '@angular/router'; +import { UserShellComponent } from './user-shell.component'; + +export const userShellRoutes: Route[] = [ + { + path: '', + component: UserShellComponent, + children: [ + { path: '', redirectTo: 'home', pathMatch: 'full' }, + { + path: 'home', + loadChildren: () => + import('@angular-challenges/module-to-standalone/user/home').then( + (m) => m.UserHomeModule + ), + }, + { + path: 'contact', + loadChildren: () => + import('@angular-challenges/module-to-standalone/user/contact').then( + (m) => m.ContactFeatureModule + ), + }, + ], + }, +]; diff --git a/libs/module-to-standalone/user/shell/src/test-setup.ts b/libs/module-to-standalone/user/shell/src/test-setup.ts new file mode 100644 index 0000000..ab1eeeb --- /dev/null +++ b/libs/module-to-standalone/user/shell/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/libs/module-to-standalone/user/shell/tsconfig.json b/libs/module-to-standalone/user/shell/tsconfig.json new file mode 100644 index 0000000..b9e5be0 --- /dev/null +++ b/libs/module-to-standalone/user/shell/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/libs/module-to-standalone/user/shell/tsconfig.lib.json b/libs/module-to-standalone/user/shell/tsconfig.lib.json new file mode 100644 index 0000000..9127387 --- /dev/null +++ b/libs/module-to-standalone/user/shell/tsconfig.lib.json @@ -0,0 +1,17 @@ +{ + "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/libs/module-to-standalone/user/shell/tsconfig.lib.prod.json b/libs/module-to-standalone/user/shell/tsconfig.lib.prod.json new file mode 100644 index 0000000..61b5237 --- /dev/null +++ b/libs/module-to-standalone/user/shell/tsconfig.lib.prod.json @@ -0,0 +1,7 @@ +{ + "extends": "./tsconfig.lib.json", + "compilerOptions": { + "declarationMap": false + }, + "angularCompilerOptions": {} +} diff --git a/libs/module-to-standalone/user/shell/tsconfig.spec.json b/libs/module-to-standalone/user/shell/tsconfig.spec.json new file mode 100644 index 0000000..6e5925e --- /dev/null +++ b/libs/module-to-standalone/user/shell/tsconfig.spec.json @@ -0,0 +1,16 @@ +{ + "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/libs/ngrx-notification/backend/.eslintrc.json b/libs/ngrx-notification/backend/.eslintrc.json index 81d0f0e..9247a6e 100644 --- a/libs/ngrx-notification/backend/.eslintrc.json +++ b/libs/ngrx-notification/backend/.eslintrc.json @@ -13,7 +13,7 @@ "error", { "type": "attribute", - "prefix": "angularChallenges", + "prefix": "lib", "style": "camelCase" } ], @@ -21,7 +21,7 @@ "error", { "type": "element", - "prefix": "angular-challenges", + "prefix": "lib", "style": "kebab-case" } ] diff --git a/libs/ngrx-notification/backend/project.json b/libs/ngrx-notification/backend/project.json index cc0546f..f2da523 100644 --- a/libs/ngrx-notification/backend/project.json +++ b/libs/ngrx-notification/backend/project.json @@ -3,7 +3,7 @@ "$schema": "../../../node_modules/nx/schemas/project-schema.json", "projectType": "library", "sourceRoot": "libs/ngrx-notification/backend/src", - "prefix": "angular-challenges", + "prefix": "lib", "targets": { "test": { "executor": "@nx/jest:jest", diff --git a/libs/ngrx-notification/model/.eslintrc.json b/libs/ngrx-notification/model/.eslintrc.json index 81d0f0e..9247a6e 100644 --- a/libs/ngrx-notification/model/.eslintrc.json +++ b/libs/ngrx-notification/model/.eslintrc.json @@ -13,7 +13,7 @@ "error", { "type": "attribute", - "prefix": "angularChallenges", + "prefix": "lib", "style": "camelCase" } ], @@ -21,7 +21,7 @@ "error", { "type": "element", - "prefix": "angular-challenges", + "prefix": "lib", "style": "kebab-case" } ] diff --git a/libs/ngrx-notification/model/project.json b/libs/ngrx-notification/model/project.json index 9fa6ae2..21ac400 100644 --- a/libs/ngrx-notification/model/project.json +++ b/libs/ngrx-notification/model/project.json @@ -3,7 +3,7 @@ "$schema": "../../../node_modules/nx/schemas/project-schema.json", "projectType": "library", "sourceRoot": "libs/ngrx-notification/model/src", - "prefix": "angular-challenges", + "prefix": "lib", "targets": { "test": { "executor": "@nx/jest:jest", diff --git a/libs/shared/ngrx-callstate-store/.eslintrc.json b/libs/shared/ngrx-callstate-store/.eslintrc.json index 81d0f0e..9247a6e 100644 --- a/libs/shared/ngrx-callstate-store/.eslintrc.json +++ b/libs/shared/ngrx-callstate-store/.eslintrc.json @@ -13,7 +13,7 @@ "error", { "type": "attribute", - "prefix": "angularChallenges", + "prefix": "lib", "style": "camelCase" } ], @@ -21,7 +21,7 @@ "error", { "type": "element", - "prefix": "angular-challenges", + "prefix": "lib", "style": "kebab-case" } ] diff --git a/libs/shared/ngrx-callstate-store/project.json b/libs/shared/ngrx-callstate-store/project.json index a5e31f0..b9fc884 100644 --- a/libs/shared/ngrx-callstate-store/project.json +++ b/libs/shared/ngrx-callstate-store/project.json @@ -3,7 +3,7 @@ "$schema": "../../../node_modules/nx/schemas/project-schema.json", "projectType": "library", "sourceRoot": "libs/shared/ngrx-callstate-store/src", - "prefix": "angular-challenges", + "prefix": "lib", "targets": { "build": { "executor": "@nx/angular:package", diff --git a/libs/shared/utils/.eslintrc.json b/libs/shared/utils/.eslintrc.json index 817727b..56c12ac 100644 --- a/libs/shared/utils/.eslintrc.json +++ b/libs/shared/utils/.eslintrc.json @@ -9,7 +9,7 @@ "error", { "type": "attribute", - "prefix": "angularChallenges", + "prefix": "lib", "style": "camelCase" } ], @@ -17,7 +17,7 @@ "error", { "type": "element", - "prefix": "angular-challenges", + "prefix": "lib", "style": "kebab-case" } ] diff --git a/libs/shared/utils/project.json b/libs/shared/utils/project.json index dc069e1..760636f 100644 --- a/libs/shared/utils/project.json +++ b/libs/shared/utils/project.json @@ -3,7 +3,7 @@ "$schema": "../../../node_modules/nx/schemas/project-schema.json", "projectType": "library", "sourceRoot": "libs/shared/utils/src", - "prefix": "angular-challenges", + "prefix": "lib", "targets": { "test": { "executor": "@nx/jest:jest", diff --git a/libs/testing-table/backend/.eslintrc.json b/libs/testing-table/backend/.eslintrc.json index 817727b..56c12ac 100644 --- a/libs/testing-table/backend/.eslintrc.json +++ b/libs/testing-table/backend/.eslintrc.json @@ -9,7 +9,7 @@ "error", { "type": "attribute", - "prefix": "angularChallenges", + "prefix": "lib", "style": "camelCase" } ], @@ -17,7 +17,7 @@ "error", { "type": "element", - "prefix": "angular-challenges", + "prefix": "lib", "style": "kebab-case" } ] diff --git a/libs/testing-table/backend/project.json b/libs/testing-table/backend/project.json index d35d0dc..3bc8250 100644 --- a/libs/testing-table/backend/project.json +++ b/libs/testing-table/backend/project.json @@ -2,7 +2,7 @@ "name": "testing-table-backend", "$schema": "../../../node_modules/nx/schemas/project-schema.json", "sourceRoot": "libs/testing-table/backend/src", - "prefix": "angular-challenges", + "prefix": "lib", "tags": [], "projectType": "library", "targets": { diff --git a/libs/testing-table/model/project.json b/libs/testing-table/model/project.json index 621922c..3097ca0 100644 --- a/libs/testing-table/model/project.json +++ b/libs/testing-table/model/project.json @@ -2,7 +2,7 @@ "name": "testing-table-model", "$schema": "../../../node_modules/nx/schemas/project-schema.json", "sourceRoot": "libs/testing-table/model/src", - "prefix": "angular-challenges", + "prefix": "lib", "tags": [], "projectType": "library", "targets": {} diff --git a/nx.json b/nx.json index 50d7377..3a2294b 100644 --- a/nx.json +++ b/nx.json @@ -64,7 +64,9 @@ }, "@nx/angular:library": { "linter": "eslint", - "unitTestRunner": "jest" + "unitTestRunner": "jest", + "prefix": "lib", + "buildable": "true" }, "@nx/angular:component": { "style": "scss", diff --git a/package-lock.json b/package-lock.json index eb9d13f..ffb2232 100644 --- a/package-lock.json +++ b/package-lock.json @@ -85,7 +85,7 @@ "jest-preset-angular": "13.1.1", "jsonc-eslint-parser": "^2.1.0", "lint-staged": "^13.0.3", - "ng-packagr": "16.0.1", + "ng-packagr": "~16.0.0", "nx": "16.2.1", "postcss": "^8.4.5", "postcss-import": "~14.1.0", diff --git a/package.json b/package.json index 3b00e06..78852f5 100644 --- a/package.json +++ b/package.json @@ -87,7 +87,7 @@ "jest-preset-angular": "13.1.1", "jsonc-eslint-parser": "^2.1.0", "lint-staged": "^13.0.3", - "ng-packagr": "16.0.1", + "ng-packagr": "~16.0.0", "nx": "16.2.1", "postcss": "^8.4.5", "postcss-import": "~14.1.0", diff --git a/tsconfig.base.json b/tsconfig.base.json index 17b5ccd..5bbf124 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -16,6 +16,39 @@ "baseUrl": ".", "paths": { "@angular-challenges/cli": ["libs/cli/src/index.ts"], + "@angular-challenges/module-to-standalone/admin/feature": [ + "libs/module-to-standalone/admin/feature/src/index.ts" + ], + "@angular-challenges/module-to-standalone/admin/shared": [ + "libs/module-to-standalone/admin/shared/src/index.ts" + ], + "@angular-challenges/module-to-standalone/core/providers": [ + "libs/module-to-standalone/core/providers/src/index.ts" + ], + "@angular-challenges/module-to-standalone/core/service": [ + "libs/module-to-standalone/core/service/src/index.ts" + ], + "@angular-challenges/module-to-standalone/forbidden": [ + "libs/module-to-standalone/forbidden/src/index.ts" + ], + "@angular-challenges/module-to-standalone/home": [ + "libs/module-to-standalone/home/src/index.ts" + ], + "@angular-challenges/module-to-standalone/shell": [ + "libs/module-to-standalone/shell/src/index.ts" + ], + "@angular-challenges/module-to-standalone/user/contact": [ + "libs/module-to-standalone/user/contact/src/index.ts" + ], + "@angular-challenges/module-to-standalone/user/feature": [ + "libs/module-to-standalone/user/feature/src/index.ts" + ], + "@angular-challenges/module-to-standalone/user/home": [ + "libs/module-to-standalone/user/home/src/index.ts" + ], + "@angular-challenges/module-to-standalone/user/shell": [ + "libs/module-to-standalone/user/shell/src/index.ts" + ], "@angular-challenges/ngrx-notification/backend": [ "libs/ngrx-notification/backend/src/index.ts" ],