mirror of
https://github.com/Raghu-Ch/angular-challenges.git
synced 2026-02-10 04:43:03 -05:00
feat(challenge33): add new challenge about decoupling
This commit is contained in:
@@ -48,6 +48,7 @@ If you would like to propose a challenge, this project is open source, so feel f
|
||||
<a href="./apps/interop-rxjs-signal/README.md"><img src="https://img.shields.io/badge/30-interop rxjs signal-red" alt="interop signal rxjs"/></a>
|
||||
<a href="./apps/module-to-standalone/README.md"><img src="https://img.shields.io/badge/31-module to standalone-green" alt="module to standalone"/></a>
|
||||
<a href="./apps/bug-cd/README.md"><img src="https://img.shields.io/badge/32-bug CD-orange" alt="bug CD"/></a>
|
||||
<a href="./apps/decoupling/README.md"><img src="https://img.shields.io/badge/33-decoupling-orange" alt="decoupling"/></a>
|
||||
|
||||
</br>
|
||||
<img src="https://img.shields.io/badge/Typescript--gray?logo=typescript" alt="Typescript"/>
|
||||
@@ -95,7 +96,7 @@ If you would like to propose a challenge, this project is open source, so feel f
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://medium.com/@thomas.laforge"><img src="https://avatars.githubusercontent.com/u/30832608?s…00&u=6f0ad9676792f29fd7fe6e113df06213d384a813&v=4" width="100px;" alt="Thomas Laforge"/><br /><sub><b>Thomas Laforge</b></sub></a><br />32 🧩</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://medium.com/@thomas.laforge"><img src="https://avatars.githubusercontent.com/u/30832608?s…00&u=6f0ad9676792f29fd7fe6e113df06213d384a813&v=4" width="100px;" alt="Thomas Laforge"/><br /><sub><b>Thomas Laforge</b></sub></a><br />33 🧩</a></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
@@ -12,14 +12,21 @@ In this small application, we have a navigation menu to route our application to
|
||||
|
||||
The goal of the challenge is to debug this application and make it work.
|
||||
|
||||
#### Hint 1
|
||||
#### Hints
|
||||
|
||||
If you comment out `routerLinkActive="isSelected"` inside `NavigationComponent`: the application loads correctly.
|
||||
<details>
|
||||
<summary>Hint 1</summary>
|
||||
|
||||
If you comment out `routerLinkActive="isSelected"` inside `NavigationComponent`: the application loads correctly.
|
||||
</details>
|
||||
|
||||
#### Hint 2
|
||||
<details>
|
||||
<summary>Hint 2</summary>
|
||||
|
||||
If you open the [`RouterLinkActive` source code](https://github.com/angular/angular/blob/main/packages/router/src/directives/router_link_active.ts) and go to **line 196**, Angular is calling `this.cdr.markForCheck` inside a microTask which triggers a new CD cycle. If you comment out this line, the application loads again, however the bug is not inside the Angular Framework. 😅😯
|
||||
|
||||
</details>
|
||||
|
||||
### Submitting your work
|
||||
|
||||
1. Fork the project
|
||||
|
||||
36
apps/decoupling/.eslintrc.json
Normal file
36
apps/decoupling/.eslintrc.json
Normal file
@@ -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": {}
|
||||
}
|
||||
]
|
||||
}
|
||||
43
apps/decoupling/README.md
Normal file
43
apps/decoupling/README.md
Normal file
@@ -0,0 +1,43 @@
|
||||
<h1>decoupling component with InjectionToken</h1>
|
||||
|
||||
> Author: Thomas Laforge
|
||||
|
||||
> Big thanks to **Robin Goetz** and his [Spartan Project](https://github.com/goetzrobin/spartan).
|
||||
> This challenge was proposed by Robin and is strongly inspired by his project.
|
||||
|
||||
### Information
|
||||
|
||||
The goal of this challenge is to separate the behavior of a component from its style. For the purpose of this challenge, we will be working on a button element. When we click on it, we will toggle a _disabled_ property which will change the style of the element. This is quite useless in real life but the challenge aims to demonstate a useful concept.
|
||||
|
||||
The behavior of the component (referred to as the _brain_ in the Spartan stack) is located in the brain library. The styling part (referred to as the _helmet_) is located inside the helmet library. Both libraries cannot depend on each other because we want to be able to publish them separatly. To help us address the issue, we are using the Nx enforce eslint rule. You can find more details [here](https://nx.dev/core-features/enforce-module-boundaries);
|
||||
|
||||
However the button's helmet needs to access the state of the component to style the button differently based on its state. As mention above, we cannot import the `BtnDisabledDirective` directly into the helmet library as done currently. If you go to [`BtnHelmetDirective`](../../libs/decoupling/helmet/src/lib/btn-style.directive.ts), you will encounter a linting error. **A project tagged with "type:hlm" can only depend on libs tagged with "type:core"**.
|
||||
|
||||
### Statement
|
||||
|
||||
The goal of this challenge is to find a way to decouple both Directives.
|
||||
|
||||
### Hint
|
||||
|
||||
<details>
|
||||
<summary>Hint 1</summary>
|
||||
Carefully read the title of the challenge 😇
|
||||
</details>
|
||||
|
||||
### Submitting your work
|
||||
|
||||
1. Fork the project
|
||||
2. clone it
|
||||
3. npm ci
|
||||
4. `npx nx lint decoupling-helmet` to visualize the error.
|
||||
5. `npx nx serve decoupling`
|
||||
6. _...work on it_
|
||||
7. Commit your work
|
||||
8. Submit a PR with a title beginning with **Answer:33** that I will review and other dev can review.
|
||||
|
||||
<a href="https://github.com/tomalaforge/angular-challenges/pulls?q=label%3A33+label%3Aanswer"><img src="https://img.shields.io/badge/-Solutions-green" alt="decoupling"/></a>
|
||||
<a href='https://github.com/tomalaforge/angular-challenges/pulls?q=label%3A33+label%3A"answer+author"'><img src="https://img.shields.io/badge/-Author solution-important" alt="decoupling solution author"/></a>
|
||||
|
||||
<!-- <a href="{Blog post url}" target="_blank" rel="noopener noreferrer"><img src="https://img.shields.io/badge/-Blog post explanation-blue" alt="decoupling blog article"/></a> -->
|
||||
|
||||
_You can ask any question on_ <a href="https://twitter.com/laforge_toma" target="_blank" rel="noopener noreferrer"><img src="./../../logo/twitter.svg" height=20px alt="twitter"/></a>
|
||||
81
apps/decoupling/project.json
Normal file
81
apps/decoupling/project.json
Normal file
@@ -0,0 +1,81 @@
|
||||
{
|
||||
"name": "decoupling",
|
||||
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
||||
"projectType": "application",
|
||||
"prefix": "app",
|
||||
"sourceRoot": "apps/decoupling/src",
|
||||
"tags": [],
|
||||
"targets": {
|
||||
"build": {
|
||||
"executor": "@angular-devkit/build-angular:browser",
|
||||
"outputs": ["{options.outputPath}"],
|
||||
"options": {
|
||||
"outputPath": "dist/apps/decoupling",
|
||||
"index": "apps/decoupling/src/index.html",
|
||||
"main": "apps/decoupling/src/main.ts",
|
||||
"polyfills": ["zone.js"],
|
||||
"tsConfig": "apps/decoupling/tsconfig.app.json",
|
||||
"assets": [
|
||||
"apps/decoupling/src/favicon.ico",
|
||||
"apps/decoupling/src/assets"
|
||||
],
|
||||
"styles": ["apps/decoupling/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": "decoupling:build:production"
|
||||
},
|
||||
"development": {
|
||||
"browserTarget": "decoupling:build:development"
|
||||
}
|
||||
},
|
||||
"defaultConfiguration": "development"
|
||||
},
|
||||
"extract-i18n": {
|
||||
"executor": "@angular-devkit/build-angular:extract-i18n",
|
||||
"options": {
|
||||
"browserTarget": "decoupling:build"
|
||||
}
|
||||
},
|
||||
"lint": {
|
||||
"executor": "@nx/linter:eslint",
|
||||
"outputs": ["{options.outputFile}"],
|
||||
"options": {
|
||||
"lintFilePatterns": [
|
||||
"apps/decoupling/**/*.ts",
|
||||
"apps/decoupling/**/*.html"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
11
apps/decoupling/src/app/app.component.ts
Normal file
11
apps/decoupling/src/app/app.component.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { BtnDisabledDirective } from '@angular-challenges/decoupling/brain';
|
||||
import { BtnHelmetDirective } from '@angular-challenges/decoupling/helmet';
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
standalone: true,
|
||||
imports: [BtnDisabledDirective, BtnHelmetDirective],
|
||||
selector: 'app-root',
|
||||
template: ` <button btnDisabled hlm>Coucou</button> `,
|
||||
})
|
||||
export class AppComponent {}
|
||||
0
apps/decoupling/src/assets/.gitkeep
Normal file
0
apps/decoupling/src/assets/.gitkeep
Normal file
BIN
apps/decoupling/src/favicon.ico
Normal file
BIN
apps/decoupling/src/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 15 KiB |
13
apps/decoupling/src/index.html
Normal file
13
apps/decoupling/src/index.html
Normal file
@@ -0,0 +1,13 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>decoupling</title>
|
||||
<base href="/" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<link rel="icon" type="image/x-icon" href="favicon.ico" />
|
||||
</head>
|
||||
<body>
|
||||
<app-root></app-root>
|
||||
</body>
|
||||
</html>
|
||||
4
apps/decoupling/src/main.ts
Normal file
4
apps/decoupling/src/main.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
import { bootstrapApplication } from '@angular/platform-browser';
|
||||
import { AppComponent } from './app/app.component';
|
||||
|
||||
bootstrapApplication(AppComponent).catch((err) => console.error(err));
|
||||
5
apps/decoupling/src/styles.scss
Normal file
5
apps/decoupling/src/styles.scss
Normal file
@@ -0,0 +1,5 @@
|
||||
@tailwind base;
|
||||
@tailwind components;
|
||||
@tailwind utilities;
|
||||
|
||||
/* You can add global styles to this file, and also import other style files */
|
||||
14
apps/decoupling/tailwind.config.js
Normal file
14
apps/decoupling/tailwind.config.js
Normal file
@@ -0,0 +1,14 @@
|
||||
const { createGlobPatternsForDependencies } = require('@nx/angular/tailwind');
|
||||
const { join } = require('path');
|
||||
|
||||
/** @type {import('tailwindcss').Config} */
|
||||
module.exports = {
|
||||
content: [
|
||||
join(__dirname, 'src/**/!(*.stories|*.spec).{ts,html}'),
|
||||
...createGlobPatternsForDependencies(__dirname),
|
||||
],
|
||||
theme: {
|
||||
extend: {},
|
||||
},
|
||||
plugins: [],
|
||||
};
|
||||
10
apps/decoupling/tsconfig.app.json
Normal file
10
apps/decoupling/tsconfig.app.json
Normal file
@@ -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"]
|
||||
}
|
||||
11
apps/decoupling/tsconfig.editor.json
Normal file
11
apps/decoupling/tsconfig.editor.json
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"include": [
|
||||
"src/**/*.ts",
|
||||
"../../libs/decoupling/brain/src/lib/button-disabled.directive.ts",
|
||||
"../../libs/decoupling/helmet/src/lib/btn-style.directive.ts"
|
||||
],
|
||||
"compilerOptions": {
|
||||
"types": []
|
||||
}
|
||||
}
|
||||
29
apps/decoupling/tsconfig.json
Normal file
29
apps/decoupling/tsconfig.json
Normal file
@@ -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
|
||||
}
|
||||
}
|
||||
61
libs/decoupling/.eslintrc.json
Normal file
61
libs/decoupling/.eslintrc.json
Normal file
@@ -0,0 +1,61 @@
|
||||
{
|
||||
"root": true,
|
||||
"ignorePatterns": ["**/*"],
|
||||
"plugins": ["@nx"],
|
||||
"overrides": [
|
||||
{
|
||||
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
|
||||
"rules": {
|
||||
"@nx/enforce-module-boundaries": [
|
||||
"error",
|
||||
{
|
||||
"enforceBuildableLibDependency": true,
|
||||
"allow": [],
|
||||
"depConstraints": [
|
||||
{
|
||||
"sourceTag": "*",
|
||||
"onlyDependOnLibsWithTags": ["*"]
|
||||
},
|
||||
{
|
||||
"sourceTag": "type:hlm",
|
||||
"onlyDependOnLibsWithTags": ["type:core"]
|
||||
},
|
||||
{
|
||||
"sourceTag": "type:brain",
|
||||
"onlyDependOnLibsWithTags": ["type:core"]
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"@angular-eslint/no-host-metadata-property": [
|
||||
"error",
|
||||
{
|
||||
"allowStatic": true
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"files": ["*.ts", "*.tsx"],
|
||||
"extends": ["plugin:@nx/typescript"],
|
||||
"rules": {}
|
||||
},
|
||||
{
|
||||
"files": ["*.js", "*.jsx"],
|
||||
"extends": ["plugin:@nx/javascript"],
|
||||
"rules": {}
|
||||
},
|
||||
{
|
||||
"files": ["*.spec.ts", "*.spec.tsx", "*.spec.js", "*.spec.jsx"],
|
||||
"env": {
|
||||
"jest": true
|
||||
},
|
||||
"rules": {}
|
||||
},
|
||||
{
|
||||
"files": "*.json",
|
||||
"parser": "jsonc-eslint-parser",
|
||||
"rules": {}
|
||||
}
|
||||
]
|
||||
}
|
||||
36
libs/decoupling/brain/.eslintrc.json
Normal file
36
libs/decoupling/brain/.eslintrc.json
Normal file
@@ -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": {}
|
||||
}
|
||||
]
|
||||
}
|
||||
7
libs/decoupling/brain/README.md
Normal file
7
libs/decoupling/brain/README.md
Normal file
@@ -0,0 +1,7 @@
|
||||
# decoupling-brain
|
||||
|
||||
This library was generated with [Nx](https://nx.dev).
|
||||
|
||||
## Running unit tests
|
||||
|
||||
Run `nx test decoupling-brain` to execute the unit tests.
|
||||
22
libs/decoupling/brain/jest.config.ts
Normal file
22
libs/decoupling/brain/jest.config.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
/* eslint-disable */
|
||||
export default {
|
||||
displayName: 'decoupling-brain',
|
||||
preset: '../../../jest.preset.js',
|
||||
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
|
||||
coverageDirectory: '../../../coverage/libs/decoupling/brain',
|
||||
transform: {
|
||||
'^.+\\.(ts|mjs|js|html)$': [
|
||||
'jest-preset-angular',
|
||||
{
|
||||
tsconfig: '<rootDir>/tsconfig.spec.json',
|
||||
stringifyContentPathRegex: '\\.(html|svg)$',
|
||||
},
|
||||
],
|
||||
},
|
||||
transformIgnorePatterns: ['node_modules/(?!.*\\.mjs$)'],
|
||||
snapshotSerializers: [
|
||||
'jest-preset-angular/build/serializers/no-ng-attributes',
|
||||
'jest-preset-angular/build/serializers/ng-snapshot',
|
||||
'jest-preset-angular/build/serializers/html-comment',
|
||||
],
|
||||
};
|
||||
7
libs/decoupling/brain/ng-package.json
Normal file
7
libs/decoupling/brain/ng-package.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"$schema": "../../../node_modules/ng-packagr/ng-package.schema.json",
|
||||
"dest": "../../../dist/libs/decoupling/brain",
|
||||
"lib": {
|
||||
"entryFile": "src/index.ts"
|
||||
}
|
||||
}
|
||||
12
libs/decoupling/brain/package.json
Normal file
12
libs/decoupling/brain/package.json
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"name": "@angular-challenges/decoupling/brain",
|
||||
"version": "0.0.1",
|
||||
"peerDependencies": {
|
||||
"@angular/common": "^16.1.0",
|
||||
"@angular/core": "^16.1.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"tslib": "^2.3.0"
|
||||
},
|
||||
"sideEffects": false
|
||||
}
|
||||
50
libs/decoupling/brain/project.json
Normal file
50
libs/decoupling/brain/project.json
Normal file
@@ -0,0 +1,50 @@
|
||||
{
|
||||
"name": "decoupling-brain",
|
||||
"$schema": "../../../node_modules/nx/schemas/project-schema.json",
|
||||
"sourceRoot": "libs/decoupling/brain/src",
|
||||
"prefix": "lib",
|
||||
"tags": ["type:brain"],
|
||||
"projectType": "library",
|
||||
"targets": {
|
||||
"build": {
|
||||
"executor": "@nx/angular:ng-packagr-lite",
|
||||
"outputs": ["{workspaceRoot}/dist/{projectRoot}"],
|
||||
"options": {
|
||||
"project": "libs/decoupling/brain/ng-package.json"
|
||||
},
|
||||
"configurations": {
|
||||
"production": {
|
||||
"tsConfig": "libs/decoupling/brain/tsconfig.lib.prod.json"
|
||||
},
|
||||
"development": {
|
||||
"tsConfig": "libs/decoupling/brain/tsconfig.lib.json"
|
||||
}
|
||||
},
|
||||
"defaultConfiguration": "production"
|
||||
},
|
||||
"test": {
|
||||
"executor": "@nx/jest:jest",
|
||||
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
|
||||
"options": {
|
||||
"jestConfig": "libs/decoupling/brain/jest.config.ts",
|
||||
"passWithNoTests": true
|
||||
},
|
||||
"configurations": {
|
||||
"ci": {
|
||||
"ci": true,
|
||||
"codeCoverage": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"lint": {
|
||||
"executor": "@nx/linter:eslint",
|
||||
"outputs": ["{options.outputFile}"],
|
||||
"options": {
|
||||
"lintFilePatterns": [
|
||||
"libs/decoupling/brain/**/*.ts",
|
||||
"libs/decoupling/brain/**/*.html"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
4
libs/decoupling/brain/src/index.ts
Normal file
4
libs/decoupling/brain/src/index.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
export {
|
||||
BtnDisabledDirective,
|
||||
ButtonState,
|
||||
} from './lib/button-disabled.directive';
|
||||
20
libs/decoupling/brain/src/lib/button-disabled.directive.ts
Normal file
20
libs/decoupling/brain/src/lib/button-disabled.directive.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
/* eslint-disable @angular-eslint/directive-selector */
|
||||
/* eslint-disable @angular-eslint/no-host-metadata-property */
|
||||
import { Directive, WritableSignal, signal } from '@angular/core';
|
||||
|
||||
export type ButtonState = 'enabled' | 'disabled';
|
||||
|
||||
@Directive({
|
||||
selector: 'button[btnDisabled]',
|
||||
standalone: true,
|
||||
host: {
|
||||
'(click)': 'toggleState()',
|
||||
},
|
||||
})
|
||||
export class BtnDisabledDirective {
|
||||
state: WritableSignal<ButtonState> = signal('enabled');
|
||||
|
||||
toggleState() {
|
||||
this.state.set(this.state() === 'enabled' ? 'disabled' : 'enabled');
|
||||
}
|
||||
}
|
||||
8
libs/decoupling/brain/src/test-setup.ts
Normal file
8
libs/decoupling/brain/src/test-setup.ts
Normal file
@@ -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';
|
||||
29
libs/decoupling/brain/tsconfig.json
Normal file
29
libs/decoupling/brain/tsconfig.json
Normal file
@@ -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
|
||||
}
|
||||
}
|
||||
17
libs/decoupling/brain/tsconfig.lib.json
Normal file
17
libs/decoupling/brain/tsconfig.lib.json
Normal file
@@ -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"]
|
||||
}
|
||||
7
libs/decoupling/brain/tsconfig.lib.prod.json
Normal file
7
libs/decoupling/brain/tsconfig.lib.prod.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"extends": "./tsconfig.lib.json",
|
||||
"compilerOptions": {
|
||||
"declarationMap": false
|
||||
},
|
||||
"angularCompilerOptions": {}
|
||||
}
|
||||
16
libs/decoupling/brain/tsconfig.spec.json
Normal file
16
libs/decoupling/brain/tsconfig.spec.json
Normal file
@@ -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"
|
||||
]
|
||||
}
|
||||
36
libs/decoupling/core/.eslintrc.json
Normal file
36
libs/decoupling/core/.eslintrc.json
Normal file
@@ -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": {}
|
||||
}
|
||||
]
|
||||
}
|
||||
7
libs/decoupling/core/README.md
Normal file
7
libs/decoupling/core/README.md
Normal file
@@ -0,0 +1,7 @@
|
||||
# decoupling-core
|
||||
|
||||
This library was generated with [Nx](https://nx.dev).
|
||||
|
||||
## Running unit tests
|
||||
|
||||
Run `nx test decoupling-core` to execute the unit tests.
|
||||
22
libs/decoupling/core/jest.config.ts
Normal file
22
libs/decoupling/core/jest.config.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
/* eslint-disable */
|
||||
export default {
|
||||
displayName: 'decoupling-core',
|
||||
preset: '../../../jest.preset.js',
|
||||
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
|
||||
coverageDirectory: '../../../coverage/libs/decoupling/core',
|
||||
transform: {
|
||||
'^.+\\.(ts|mjs|js|html)$': [
|
||||
'jest-preset-angular',
|
||||
{
|
||||
tsconfig: '<rootDir>/tsconfig.spec.json',
|
||||
stringifyContentPathRegex: '\\.(html|svg)$',
|
||||
},
|
||||
],
|
||||
},
|
||||
transformIgnorePatterns: ['node_modules/(?!.*\\.mjs$)'],
|
||||
snapshotSerializers: [
|
||||
'jest-preset-angular/build/serializers/no-ng-attributes',
|
||||
'jest-preset-angular/build/serializers/ng-snapshot',
|
||||
'jest-preset-angular/build/serializers/html-comment',
|
||||
],
|
||||
};
|
||||
7
libs/decoupling/core/ng-package.json
Normal file
7
libs/decoupling/core/ng-package.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"$schema": "../../../node_modules/ng-packagr/ng-package.schema.json",
|
||||
"dest": "../../../dist/libs/decoupling/core",
|
||||
"lib": {
|
||||
"entryFile": "src/index.ts"
|
||||
}
|
||||
}
|
||||
12
libs/decoupling/core/package.json
Normal file
12
libs/decoupling/core/package.json
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"name": "@angular-challenges/decoupling/core",
|
||||
"version": "0.0.1",
|
||||
"peerDependencies": {
|
||||
"@angular/common": "^16.1.0",
|
||||
"@angular/core": "^16.1.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"tslib": "^2.3.0"
|
||||
},
|
||||
"sideEffects": false
|
||||
}
|
||||
50
libs/decoupling/core/project.json
Normal file
50
libs/decoupling/core/project.json
Normal file
@@ -0,0 +1,50 @@
|
||||
{
|
||||
"name": "decoupling-core",
|
||||
"$schema": "../../../node_modules/nx/schemas/project-schema.json",
|
||||
"sourceRoot": "libs/decoupling/core/src",
|
||||
"prefix": "lib",
|
||||
"tags": ["type:core"],
|
||||
"projectType": "library",
|
||||
"targets": {
|
||||
"build": {
|
||||
"executor": "@nx/angular:ng-packagr-lite",
|
||||
"outputs": ["{workspaceRoot}/dist/{projectRoot}"],
|
||||
"options": {
|
||||
"project": "libs/decoupling/core/ng-package.json"
|
||||
},
|
||||
"configurations": {
|
||||
"production": {
|
||||
"tsConfig": "libs/decoupling/core/tsconfig.lib.prod.json"
|
||||
},
|
||||
"development": {
|
||||
"tsConfig": "libs/decoupling/core/tsconfig.lib.json"
|
||||
}
|
||||
},
|
||||
"defaultConfiguration": "production"
|
||||
},
|
||||
"test": {
|
||||
"executor": "@nx/jest:jest",
|
||||
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
|
||||
"options": {
|
||||
"jestConfig": "libs/decoupling/core/jest.config.ts",
|
||||
"passWithNoTests": true
|
||||
},
|
||||
"configurations": {
|
||||
"ci": {
|
||||
"ci": true,
|
||||
"codeCoverage": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"lint": {
|
||||
"executor": "@nx/linter:eslint",
|
||||
"outputs": ["{options.outputFile}"],
|
||||
"options": {
|
||||
"lintFilePatterns": [
|
||||
"libs/decoupling/core/**/*.ts",
|
||||
"libs/decoupling/core/**/*.html"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
0
libs/decoupling/core/src/index.ts
Normal file
0
libs/decoupling/core/src/index.ts
Normal file
8
libs/decoupling/core/src/test-setup.ts
Normal file
8
libs/decoupling/core/src/test-setup.ts
Normal file
@@ -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';
|
||||
29
libs/decoupling/core/tsconfig.json
Normal file
29
libs/decoupling/core/tsconfig.json
Normal file
@@ -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
|
||||
}
|
||||
}
|
||||
17
libs/decoupling/core/tsconfig.lib.json
Normal file
17
libs/decoupling/core/tsconfig.lib.json
Normal file
@@ -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"]
|
||||
}
|
||||
7
libs/decoupling/core/tsconfig.lib.prod.json
Normal file
7
libs/decoupling/core/tsconfig.lib.prod.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"extends": "./tsconfig.lib.json",
|
||||
"compilerOptions": {
|
||||
"declarationMap": false
|
||||
},
|
||||
"angularCompilerOptions": {}
|
||||
}
|
||||
16
libs/decoupling/core/tsconfig.spec.json
Normal file
16
libs/decoupling/core/tsconfig.spec.json
Normal file
@@ -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"
|
||||
]
|
||||
}
|
||||
36
libs/decoupling/helmet/.eslintrc.json
Normal file
36
libs/decoupling/helmet/.eslintrc.json
Normal file
@@ -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": {}
|
||||
}
|
||||
]
|
||||
}
|
||||
7
libs/decoupling/helmet/README.md
Normal file
7
libs/decoupling/helmet/README.md
Normal file
@@ -0,0 +1,7 @@
|
||||
# decoupling-helmet
|
||||
|
||||
This library was generated with [Nx](https://nx.dev).
|
||||
|
||||
## Running unit tests
|
||||
|
||||
Run `nx test decoupling-helmet` to execute the unit tests.
|
||||
22
libs/decoupling/helmet/jest.config.ts
Normal file
22
libs/decoupling/helmet/jest.config.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
/* eslint-disable */
|
||||
export default {
|
||||
displayName: 'decoupling-helmet',
|
||||
preset: '../../../jest.preset.js',
|
||||
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
|
||||
coverageDirectory: '../../../coverage/libs/decoupling/helmet',
|
||||
transform: {
|
||||
'^.+\\.(ts|mjs|js|html)$': [
|
||||
'jest-preset-angular',
|
||||
{
|
||||
tsconfig: '<rootDir>/tsconfig.spec.json',
|
||||
stringifyContentPathRegex: '\\.(html|svg)$',
|
||||
},
|
||||
],
|
||||
},
|
||||
transformIgnorePatterns: ['node_modules/(?!.*\\.mjs$)'],
|
||||
snapshotSerializers: [
|
||||
'jest-preset-angular/build/serializers/no-ng-attributes',
|
||||
'jest-preset-angular/build/serializers/ng-snapshot',
|
||||
'jest-preset-angular/build/serializers/html-comment',
|
||||
],
|
||||
};
|
||||
7
libs/decoupling/helmet/ng-package.json
Normal file
7
libs/decoupling/helmet/ng-package.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"$schema": "../../../node_modules/ng-packagr/ng-package.schema.json",
|
||||
"dest": "../../../dist/libs/decoupling/helmet",
|
||||
"lib": {
|
||||
"entryFile": "src/index.ts"
|
||||
}
|
||||
}
|
||||
12
libs/decoupling/helmet/package.json
Normal file
12
libs/decoupling/helmet/package.json
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"name": "@angular-challenges/decoupling/helmet",
|
||||
"version": "0.0.1",
|
||||
"peerDependencies": {
|
||||
"@angular/common": "^16.1.0",
|
||||
"@angular/core": "^16.1.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"tslib": "^2.3.0"
|
||||
},
|
||||
"sideEffects": false
|
||||
}
|
||||
50
libs/decoupling/helmet/project.json
Normal file
50
libs/decoupling/helmet/project.json
Normal file
@@ -0,0 +1,50 @@
|
||||
{
|
||||
"name": "decoupling-helmet",
|
||||
"$schema": "../../../node_modules/nx/schemas/project-schema.json",
|
||||
"sourceRoot": "libs/decoupling/helmet/src",
|
||||
"prefix": "lib",
|
||||
"tags": ["type:hlm"],
|
||||
"projectType": "library",
|
||||
"targets": {
|
||||
"build": {
|
||||
"executor": "@nx/angular:ng-packagr-lite",
|
||||
"outputs": ["{workspaceRoot}/dist/{projectRoot}"],
|
||||
"options": {
|
||||
"project": "libs/decoupling/helmet/ng-package.json"
|
||||
},
|
||||
"configurations": {
|
||||
"production": {
|
||||
"tsConfig": "libs/decoupling/helmet/tsconfig.lib.prod.json"
|
||||
},
|
||||
"development": {
|
||||
"tsConfig": "libs/decoupling/helmet/tsconfig.lib.json"
|
||||
}
|
||||
},
|
||||
"defaultConfiguration": "production"
|
||||
},
|
||||
"test": {
|
||||
"executor": "@nx/jest:jest",
|
||||
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
|
||||
"options": {
|
||||
"jestConfig": "libs/decoupling/helmet/jest.config.ts",
|
||||
"passWithNoTests": true
|
||||
},
|
||||
"configurations": {
|
||||
"ci": {
|
||||
"ci": true,
|
||||
"codeCoverage": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"lint": {
|
||||
"executor": "@nx/linter:eslint",
|
||||
"outputs": ["{options.outputFile}"],
|
||||
"options": {
|
||||
"lintFilePatterns": [
|
||||
"libs/decoupling/helmet/**/*.ts",
|
||||
"libs/decoupling/helmet/**/*.html"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
1
libs/decoupling/helmet/src/index.ts
Normal file
1
libs/decoupling/helmet/src/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export { BtnHelmetDirective } from './lib/btn-style.directive';
|
||||
33
libs/decoupling/helmet/src/lib/btn-style.directive.ts
Normal file
33
libs/decoupling/helmet/src/lib/btn-style.directive.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
/* eslint-disable @angular-eslint/directive-selector */
|
||||
import { BtnDisabledDirective } from '@angular-challenges/decoupling/brain';
|
||||
import {
|
||||
Directive,
|
||||
ElementRef,
|
||||
Renderer2,
|
||||
effect,
|
||||
inject,
|
||||
signal,
|
||||
} from '@angular/core';
|
||||
|
||||
@Directive({
|
||||
selector: 'button[hlm]',
|
||||
standalone: true,
|
||||
host: {
|
||||
class:
|
||||
'border border-black p-4 rounded-md bg-white data-[state=disabled]:bg-gray-400 data-[state=disabled]:text-white',
|
||||
},
|
||||
})
|
||||
export class BtnHelmetDirective {
|
||||
btnState = inject(BtnDisabledDirective, { self: true });
|
||||
public state = this.btnState?.state ?? signal('disabled').asReadonly();
|
||||
private renderer = inject(Renderer2);
|
||||
private element = inject(ElementRef);
|
||||
|
||||
private rendererEffect = effect(() => {
|
||||
this.renderer.setAttribute(
|
||||
this.element.nativeElement,
|
||||
'data-state',
|
||||
this.state()
|
||||
);
|
||||
});
|
||||
}
|
||||
8
libs/decoupling/helmet/src/test-setup.ts
Normal file
8
libs/decoupling/helmet/src/test-setup.ts
Normal file
@@ -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';
|
||||
29
libs/decoupling/helmet/tsconfig.json
Normal file
29
libs/decoupling/helmet/tsconfig.json
Normal file
@@ -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
|
||||
}
|
||||
}
|
||||
17
libs/decoupling/helmet/tsconfig.lib.json
Normal file
17
libs/decoupling/helmet/tsconfig.lib.json
Normal file
@@ -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"]
|
||||
}
|
||||
7
libs/decoupling/helmet/tsconfig.lib.prod.json
Normal file
7
libs/decoupling/helmet/tsconfig.lib.prod.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"extends": "./tsconfig.lib.json",
|
||||
"compilerOptions": {
|
||||
"declarationMap": false
|
||||
},
|
||||
"angularCompilerOptions": {}
|
||||
}
|
||||
16
libs/decoupling/helmet/tsconfig.spec.json
Normal file
16
libs/decoupling/helmet/tsconfig.spec.json
Normal file
@@ -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"
|
||||
]
|
||||
}
|
||||
@@ -17,6 +17,15 @@
|
||||
"paths": {
|
||||
"@angular-challenges/cli": ["libs/cli/src/index.ts"],
|
||||
"@angular-challenges/custom-plugin": ["libs/custom-plugin/src/index.ts"],
|
||||
"@angular-challenges/decoupling/brain": [
|
||||
"libs/decoupling/brain/src/index.ts"
|
||||
],
|
||||
"@angular-challenges/decoupling/core": [
|
||||
"libs/decoupling/core/src/index.ts"
|
||||
],
|
||||
"@angular-challenges/decoupling/helmet": [
|
||||
"libs/decoupling/helmet/src/index.ts"
|
||||
],
|
||||
"@angular-challenges/fake-utils": ["libs/fake-utils/src/index.ts"],
|
||||
"@angular-challenges/module-to-standalone/admin/feature": [
|
||||
"libs/module-to-standalone/admin/feature/src/index.ts"
|
||||
|
||||
Reference in New Issue
Block a user