mirror of
https://github.com/Raghu-Ch/angular-challenges.git
synced 2026-02-10 04:43:03 -05:00
feat(project): delete dependancy to primeng
This commit is contained in:
26
libs/angular/di/.eslintrc.json
Normal file
26
libs/angular/di/.eslintrc.json
Normal file
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"extends": ["../../../.eslintrc.json"],
|
||||
"ignorePatterns": ["!**/*"],
|
||||
"overrides": [
|
||||
{
|
||||
"files": ["*.ts"],
|
||||
"extends": [
|
||||
"plugin:@nx/angular",
|
||||
"plugin:@angular-eslint/template/process-inline-templates"
|
||||
],
|
||||
"rules": {}
|
||||
},
|
||||
{
|
||||
"files": ["*.html"],
|
||||
"extends": ["plugin:@nx/angular-template"],
|
||||
"rules": {}
|
||||
},
|
||||
{
|
||||
"files": ["*.json"],
|
||||
"parser": "jsonc-eslint-parser",
|
||||
"rules": {
|
||||
"@nx/dependency-checks": "error"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
7
libs/angular/di/README.md
Normal file
7
libs/angular/di/README.md
Normal file
@@ -0,0 +1,7 @@
|
||||
# angular/di
|
||||
|
||||
This library was generated with [Nx](https://nx.dev).
|
||||
|
||||
## Running unit tests
|
||||
|
||||
Run `nx test angular/di` to execute the unit tests.
|
||||
22
libs/angular/di/jest.config.ts
Normal file
22
libs/angular/di/jest.config.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
/* eslint-disable */
|
||||
export default {
|
||||
displayName: 'angular/di',
|
||||
preset: '../../../jest.preset.js',
|
||||
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
|
||||
coverageDirectory: '../../../coverage/libs/angular/di',
|
||||
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/angular/di/ng-package.json
Normal file
7
libs/angular/di/ng-package.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"$schema": "../../../node_modules/ng-packagr/ng-package.schema.json",
|
||||
"dest": "../../../dist/libs/angular/di",
|
||||
"lib": {
|
||||
"entryFile": "src/index.ts"
|
||||
}
|
||||
}
|
||||
12
libs/angular/di/package.json
Normal file
12
libs/angular/di/package.json
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"name": "angular/di",
|
||||
"version": "0.0.1",
|
||||
"peerDependencies": {
|
||||
"@angular/common": "^16.2.0",
|
||||
"@angular/core": "^16.2.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"tslib": "^2.3.0"
|
||||
},
|
||||
"sideEffects": false
|
||||
}
|
||||
51
libs/angular/di/project.json
Normal file
51
libs/angular/di/project.json
Normal file
@@ -0,0 +1,51 @@
|
||||
{
|
||||
"name": "angular/di",
|
||||
"$schema": "../../../node_modules/nx/schemas/project-schema.json",
|
||||
"sourceRoot": "libs/angular/di/src",
|
||||
"prefix": "lib",
|
||||
"tags": [],
|
||||
"projectType": "library",
|
||||
"targets": {
|
||||
"build": {
|
||||
"executor": "@nx/angular:ng-packagr-lite",
|
||||
"outputs": ["{workspaceRoot}/dist/{projectRoot}"],
|
||||
"options": {
|
||||
"project": "libs/angular/di/ng-package.json"
|
||||
},
|
||||
"configurations": {
|
||||
"production": {
|
||||
"tsConfig": "libs/angular/di/tsconfig.lib.prod.json"
|
||||
},
|
||||
"development": {
|
||||
"tsConfig": "libs/angular/di/tsconfig.lib.json"
|
||||
}
|
||||
},
|
||||
"defaultConfiguration": "production"
|
||||
},
|
||||
"test": {
|
||||
"executor": "@nx/jest:jest",
|
||||
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
|
||||
"options": {
|
||||
"jestConfig": "libs/angular/di/jest.config.ts",
|
||||
"passWithNoTests": true
|
||||
},
|
||||
"configurations": {
|
||||
"ci": {
|
||||
"ci": true,
|
||||
"codeCoverage": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"lint": {
|
||||
"executor": "@nx/eslint:lint",
|
||||
"outputs": ["{options.outputFile}"],
|
||||
"options": {
|
||||
"lintFilePatterns": [
|
||||
"libs/angular/di/**/*.ts",
|
||||
"libs/angular/di/**/*.html",
|
||||
"libs/angular/di/package.json"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
1
libs/angular/di/src/index.ts
Normal file
1
libs/angular/di/src/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export { TableComponent } from './lib/table.component';
|
||||
29
libs/angular/di/src/lib/table.component.ts
Normal file
29
libs/angular/di/src/lib/table.component.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import { NgFor, NgTemplateOutlet } from '@angular/common';
|
||||
import { Component, ContentChild, Input, TemplateRef } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'table',
|
||||
standalone: true,
|
||||
imports: [NgTemplateOutlet, NgFor],
|
||||
template: `
|
||||
<thead>
|
||||
<ng-container *ngTemplateOutlet="headerTemplate"></ng-container>
|
||||
</thead>
|
||||
<tbody *ngFor="let item of items">
|
||||
<ng-container
|
||||
*ngTemplateOutlet="
|
||||
bodyTemplate;
|
||||
context: { $implicit: item }
|
||||
"></ng-container>
|
||||
</tbody>
|
||||
`,
|
||||
})
|
||||
export class TableComponent<T> {
|
||||
@Input() items!: T[];
|
||||
|
||||
@ContentChild('header', { read: TemplateRef })
|
||||
headerTemplate!: TemplateRef<void>;
|
||||
|
||||
@ContentChild('body', { read: TemplateRef })
|
||||
bodyTemplate!: TemplateRef<{ $implicit: T }>;
|
||||
}
|
||||
8
libs/angular/di/src/test-setup.ts
Normal file
8
libs/angular/di/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/angular/di/tsconfig.json
Normal file
29
libs/angular/di/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/angular/di/tsconfig.lib.json
Normal file
17
libs/angular/di/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/angular/di/tsconfig.lib.prod.json
Normal file
7
libs/angular/di/tsconfig.lib.prod.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"extends": "./tsconfig.lib.json",
|
||||
"compilerOptions": {
|
||||
"declarationMap": false
|
||||
},
|
||||
"angularCompilerOptions": {}
|
||||
}
|
||||
16
libs/angular/di/tsconfig.spec.json
Normal file
16
libs/angular/di/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"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user