Skip to content

Commit 3673dd7

Browse files
Chau Trannartc
Chau Tran
authored andcommitted
wip
1 parent 8337da6 commit 3673dd7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+10201
-6265
lines changed

.eslintrc.json

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,42 @@
11
{
2-
"root": true,
3-
"ignorePatterns": ["**/*"],
4-
"plugins": ["@nx"],
5-
"overrides": [
6-
{
7-
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
8-
"rules": {
9-
"@nx/enforce-module-boundaries": [
10-
"error",
11-
{
12-
"enforceBuildableLibDependency": true,
13-
"allow": [],
14-
"depConstraints": [
15-
{
16-
"sourceTag": "*",
17-
"onlyDependOnLibsWithTags": ["*"]
18-
}
19-
]
20-
}
21-
]
22-
}
23-
},
24-
{
25-
"files": ["*.ts", "*.tsx"],
26-
"extends": ["plugin:@nx/typescript"],
27-
"rules": {}
28-
},
29-
{
30-
"files": ["*.js", "*.jsx"],
31-
"extends": ["plugin:@nx/javascript"],
32-
"rules": {}
33-
},
34-
{
35-
"files": ["*.spec.ts", "*.spec.tsx", "*.spec.js", "*.spec.jsx"],
36-
"env": {
37-
"jest": true
38-
},
39-
"rules": {}
40-
}
41-
]
2+
"root": true,
3+
"ignorePatterns": ["**/*"],
4+
"plugins": ["@nx"],
5+
"overrides": [
6+
{
7+
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
8+
"rules": {
9+
"@nx/enforce-module-boundaries": [
10+
"error",
11+
{
12+
"enforceBuildableLibDependency": true,
13+
"allow": [],
14+
"depConstraints": [
15+
{
16+
"sourceTag": "*",
17+
"onlyDependOnLibsWithTags": ["*"]
18+
}
19+
]
20+
}
21+
]
22+
}
23+
},
24+
{
25+
"files": ["*.ts", "*.tsx"],
26+
"extends": ["plugin:@nx/typescript"],
27+
"rules": {}
28+
},
29+
{
30+
"files": ["*.js", "*.jsx"],
31+
"extends": ["plugin:@nx/javascript"],
32+
"rules": {}
33+
},
34+
{
35+
"files": ["*.spec.ts", "*.spec.tsx", "*.spec.js", "*.spec.jsx"],
36+
"env": {
37+
"jest": true
38+
},
39+
"rules": {}
40+
}
41+
]
4242
}

.prettierrc

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
2-
"singleQuote": true,
3-
"tabWidth": 4,
4-
"printWidth": 120,
5-
"plugins": ["prettier-plugin-organize-imports"]
2+
"singleQuote": true,
3+
"useTabs": true,
4+
"tabWidth": 4,
5+
"printWidth": 120,
6+
"plugins": ["prettier-plugin-organize-imports"]
67
}

.release-it.json

Lines changed: 44 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,46 @@
11
{
2-
"plugins": {
3-
"@release-it/conventional-changelog": {
4-
"preset": {
5-
"name": "conventionalcommits",
6-
"types": [
7-
{
8-
"type": "feat",
9-
"section": "Features"
10-
},
11-
{
12-
"type": "fix",
13-
"section": "Bug Fixes"
14-
},
15-
{
16-
"type": "cleanup",
17-
"section": "Cleanup"
18-
},
19-
{
20-
"type": "docs",
21-
"section": "Documentations"
22-
}
23-
]
24-
},
25-
"infile": "CHANGELOG.md"
26-
},
27-
"@release-it/bumper": {
28-
"in": "libs/core/version.json",
29-
"out": ["libs/core/version.json", "dist/libs/**/package.json"]
30-
}
31-
},
32-
"git": {
33-
"commitMessage": "chore: release ${version}"
34-
},
35-
"npm": {
36-
"publish": false
37-
},
38-
"github": {
39-
"release": true,
40-
"releaseName": "Release ${version}"
41-
},
42-
"hooks": {
43-
"before:bump": "pnpm exec nx run-many --target=package --projects=core,soba,postprocessing,cannon --parallel=false",
44-
"after:bump": ["git checkout -- package.json"]
45-
}
2+
"plugins": {
3+
"@release-it/conventional-changelog": {
4+
"preset": {
5+
"name": "conventionalcommits",
6+
"types": [
7+
{
8+
"type": "feat",
9+
"section": "Features"
10+
},
11+
{
12+
"type": "fix",
13+
"section": "Bug Fixes"
14+
},
15+
{
16+
"type": "cleanup",
17+
"section": "Cleanup"
18+
},
19+
{
20+
"type": "docs",
21+
"section": "Documentations"
22+
}
23+
]
24+
},
25+
"infile": "CHANGELOG.md"
26+
},
27+
"@release-it/bumper": {
28+
"in": "libs/core/version.json",
29+
"out": ["libs/core/version.json", "dist/libs/**/package.json"]
30+
}
31+
},
32+
"git": {
33+
"commitMessage": "chore: release ${version}"
34+
},
35+
"npm": {
36+
"publish": false
37+
},
38+
"github": {
39+
"release": true,
40+
"releaseName": "Release ${version}"
41+
},
42+
"hooks": {
43+
"before:bump": "pnpm exec nx run-many --target=package --projects=core,soba,postprocessing,cannon --parallel=false",
44+
"after:bump": ["git checkout -- package.json"]
45+
}
4646
}

.vscode/extensions.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"recommendations": [
3-
"nrwl.angular-console",
4-
"esbenp.prettier-vscode",
5-
"firsttris.vscode-jest-runner",
6-
"dbaeumer.vscode-eslint"
7-
]
2+
"recommendations": [
3+
"nrwl.angular-console",
4+
"esbenp.prettier-vscode",
5+
"firsttris.vscode-jest-runner",
6+
"dbaeumer.vscode-eslint"
7+
]
88
}

jest.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { getJestProjects } from '@nx/jest';
22

33
export default {
4-
projects: getJestProjects(),
4+
projects: getJestProjects(),
55
};

libs/core-temp-two/.eslintrc.json

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{
2+
"extends": [
3+
"../../.eslintrc.json"
4+
],
5+
"ignorePatterns": [
6+
"!**/*"
7+
],
8+
"overrides": [
9+
{
10+
"files": [
11+
"*.ts"
12+
],
13+
"rules": {
14+
"@angular-eslint/directive-selector": [
15+
"error",
16+
{
17+
"type": "attribute",
18+
"prefix": "platform",
19+
"style": "camelCase"
20+
}
21+
],
22+
"@angular-eslint/component-selector": [
23+
"error",
24+
{
25+
"type": "element",
26+
"prefix": "platform",
27+
"style": "kebab-case"
28+
}
29+
]
30+
},
31+
"extends": [
32+
"plugin:@nx/angular",
33+
"plugin:@angular-eslint/template/process-inline-templates"
34+
]
35+
},
36+
{
37+
"files": [
38+
"*.html"
39+
],
40+
"extends": [
41+
"plugin:@nx/angular-template"
42+
],
43+
"rules": {}
44+
}
45+
]
46+
}

libs/core-temp-two/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# core-temp-two
2+
3+
This library was generated with [Nx](https://nx.dev).
4+
5+
## Running unit tests
6+
7+
Run `nx test core-temp-two` to execute the unit tests.

libs/core-temp-two/jest.config.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/* eslint-disable */
2+
export default {
3+
displayName: 'core-temp-two',
4+
preset: '../../jest.preset.js',
5+
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
6+
coverageDirectory: '../../coverage/libs/core-temp-two',
7+
transform: {
8+
'^.+\\.(ts|mjs|js|html)$': [
9+
'jest-preset-angular',
10+
{
11+
tsconfig: '<rootDir>/tsconfig.spec.json',
12+
stringifyContentPathRegex: '\\.(html|svg)$',
13+
},
14+
],
15+
},
16+
transformIgnorePatterns: ['node_modules/(?!.*\\.mjs$)'],
17+
snapshotSerializers: [
18+
'jest-preset-angular/build/serializers/no-ng-attributes',
19+
'jest-preset-angular/build/serializers/ng-snapshot',
20+
'jest-preset-angular/build/serializers/html-comment',
21+
],
22+
};

libs/core-temp-two/ng-package.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
3+
"dest": "../../dist/libs/core",
4+
"lib": {
5+
"entryFile": "src/index.ts"
6+
}
7+
}

libs/core-temp-two/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"name":"@platform/core-temp-two","version":"0.0.1","peerDependencies":{"@angular/common":"^16.1.0","@angular/core":"^16.1.0"},"dependencies":{"tslib":"^2.3.0"},"sideEffects":false}

libs/core-temp-two/project.json

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
{
2+
"name": "core-temp-two",
3+
"$schema": "../../node_modules/nx/schemas/project-schema.json",
4+
"sourceRoot": "libs/core-temp-two/src",
5+
"prefix": "platform",
6+
"tags": [],
7+
"projectType": "library",
8+
"targets": {
9+
"build": {
10+
"executor": "@nx/angular:package",
11+
"outputs": [
12+
"{workspaceRoot}/dist/{projectRoot}"
13+
],
14+
"options": {
15+
"project": "libs/core-temp-two/ng-package.json"
16+
},
17+
"configurations": {
18+
"production": {
19+
"tsConfig": "libs/core-temp-two/tsconfig.lib.prod.json"
20+
},
21+
"development": {
22+
"tsConfig": "libs/core-temp-two/tsconfig.lib.json"
23+
}
24+
},
25+
"defaultConfiguration": "production"
26+
},
27+
"test": {
28+
"executor": "@nx/jest:jest",
29+
"outputs": [
30+
"{workspaceRoot}/coverage/{projectRoot}"
31+
],
32+
"options": {
33+
"jestConfig": "libs/core-temp-two/jest.config.ts",
34+
"passWithNoTests": true
35+
},
36+
"configurations": {
37+
"ci": {
38+
"ci": true,
39+
"codeCoverage": true
40+
}
41+
}
42+
},
43+
"lint": {
44+
"executor": "@nx/linter:eslint",
45+
"outputs": [
46+
"{options.outputFile}"
47+
],
48+
"options": {
49+
"lintFilePatterns": [
50+
"libs/core-temp-two/**/*.ts",
51+
"libs/core-temp-two/**/*.html"
52+
]
53+
}
54+
}
55+
}
56+
}
File renamed without changes.

libs/core-temp-two/src/lib/args.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import { Directive, Input } from '@angular/core';
2+
import { NgtCommonDirective } from './common';
3+
4+
@Directive({ selector: '[args]', standalone: true })
5+
export class NgtArgs<TArgs extends any[] = any[]> extends NgtCommonDirective {
6+
private injectedArgs: TArgs = [] as unknown as TArgs;
7+
8+
@Input() set args(args: TArgs | null) {
9+
if (args == null || !Array.isArray(args) || args.length === 0 || (args.length === 1 && args[0] === null))
10+
return;
11+
this.injected = false;
12+
this.injectedArgs = args;
13+
this.createView();
14+
}
15+
16+
get args() {
17+
if (this.validate()) {
18+
this.injected = true;
19+
return this.injectedArgs;
20+
}
21+
return null;
22+
}
23+
24+
validate() {
25+
return !this.injected && !!this.injectedArgs.length;
26+
}
27+
}

0 commit comments

Comments
 (0)