Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions apps/nx/42-static-vs-dynamic-import/src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
User,
UserComponent,
type User,
} from '@angular-challenges/static-dynamic-import/users';
} from '@angular-challenges/static-dynamic-import/static-users';
import { Component } from '@angular/core';
import { RouterOutlet } from '@angular/router';

Expand Down
43 changes: 43 additions & 0 deletions libs/static-dynamic-import/static-users/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"extends": ["../../../.eslintrc.json"],
"ignorePatterns": ["!**/*"],
"overrides": [
{
"files": ["*.ts"],
"extends": [
"plugin:@nx/angular",
"plugin:@angular-eslint/template/process-inline-templates"
],
"rules": {
"@angular-eslint/directive-selector": [
"error",
{
"type": "attribute",
"prefix": "lib",
"style": "camelCase"
}
],
"@angular-eslint/component-selector": [
"error",
{
"type": "element",
"prefix": "lib",
"style": "kebab-case"
}
]
}
},
{
"files": ["*.html"],
"extends": ["plugin:@nx/angular-template"],
"rules": {}
},
{
"files": ["*.json"],
"parser": "jsonc-eslint-parser",
"rules": {
"@nx/dependency-checks": "error"
}
}
]
}
7 changes: 7 additions & 0 deletions libs/static-dynamic-import/static-users/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# static-users

This library was generated with [Nx](https://nx.dev).

## Running unit tests

Run `nx test static-users` to execute the unit tests.
36 changes: 36 additions & 0 deletions libs/static-dynamic-import/static-users/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"name": "static-users",
"$schema": "../../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "libs/static-dynamic-import/static-users/src",
"prefix": "lib",
"projectType": "library",
"tags": [],
"targets": {
"build": {
"executor": "@nx/angular:ng-packagr-lite",
"outputs": ["{workspaceRoot}/dist/{projectRoot}"],
"options": {
"project": "libs/static-dynamic-import/static-users/ng-package.json"
},
"configurations": {
"production": {
"tsConfig": "libs/static-dynamic-import/static-users/tsconfig.lib.prod.json"
},
"development": {
"tsConfig": "libs/static-dynamic-import/static-users/tsconfig.lib.json"
}
},
"defaultConfiguration": "production"
},
"test": {
"executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
"options": {
"jestConfig": "libs/static-dynamic-import/static-users/jest.config.ts"
}
},
"lint": {
"executor": "@nx/eslint:lint"
}
}
}
2 changes: 2 additions & 0 deletions libs/static-dynamic-import/static-users/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export { UserComponent } from './lib/user.component';
export { User } from './lib/user.model';
26 changes: 26 additions & 0 deletions libs/static-dynamic-import/static-users/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"compilerOptions": {
"target": "es2022",
"useDefineForClassFields": false,
"forceConsistentCasingInFileNames": true,
"strict": true,
"noImplicitOverride": true,
"noPropertyAccessFromIndexSignature": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true
},
"files": [],
"include": [],
"references": [
{
"path": "./tsconfig.lib.json"
}
],
"extends": "../../../tsconfig.base.json",
"angularCompilerOptions": {
"enableI18nLegacyMessageIdFormat": false,
"strictInjectionParameters": true,
"strictInputAccessModifiers": true,
"strictTemplates": true
}
}
17 changes: 17 additions & 0 deletions libs/static-dynamic-import/static-users/tsconfig.lib.json
Original file line number Diff line number Diff line change
@@ -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"]
}
2 changes: 0 additions & 2 deletions libs/static-dynamic-import/users/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
export { UserComponent } from './lib/user.component';
export type { User } from './lib/user.model';
export { default } from './lib/users.component';
4 changes: 2 additions & 2 deletions libs/static-dynamic-import/users/src/lib/users.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { Component } from '@angular/core';

import { MatTableModule } from '@angular/material/table';
import { randCountry, randFirstName, randLastName } from '@ngneat/falso';
import { UserComponent } from './user.component';
import type { User } from './user.model';
import { UserComponent } from '../../../static-users/src/lib/user.component';
import type { User } from '../../../static-users/src/lib/user.model';

export const randUser = (): User => ({
name: randFirstName(),
Expand Down
6 changes: 5 additions & 1 deletion libs/static-dynamic-import/users/tsconfig.lib.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,9 @@
"types": []
},
"exclude": ["src/**/*.spec.ts", "jest.config.ts", "src/**/*.test.ts"],
"include": ["src/**/*.ts"]
"include": [
"src/**/*.ts",
"../static-users/src/lib/user.component.ts",
"../static-users/src/lib/user.model.ts"
]
}
3 changes: 3 additions & 0 deletions tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@
],
"angular-master-dependency-injection": [
"apps/angular/16-master-dependency-injection/src/index.ts"
],
"@angular-challenges/static-dynamic-import/static-users": [
"libs/static-dynamic-import/static-users/src/index.ts"
]
}
},
Expand Down