Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f799f22

Browse files
ctranctran
ctran
authored and
ctran
committed
new core
1 parent f83d139 commit f799f22

19 files changed

+229
-4
lines changed

libs/core-new/.eslintrc.json

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

libs/core-new/README.md

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

libs/core-new/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-new',
4+
preset: '../../jest.preset.js',
5+
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
6+
coverageDirectory: '../../coverage/libs/core-new',
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-new/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-new",
4+
"lib": {
5+
"entryFile": "src/index.ts"
6+
}
7+
}

libs/core-new/package.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"name": "angular-three-core-new",
3+
"version": "0.0.1",
4+
"peerDependencies": {
5+
"@angular/common": "^18.0.0",
6+
"@angular/core": "^18.0.0"
7+
},
8+
"sideEffects": false
9+
}

libs/core-new/project.json

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"name": "core-new",
3+
"$schema": "../../node_modules/nx/schemas/project-schema.json",
4+
"sourceRoot": "libs/core-new/src",
5+
"prefix": "lib",
6+
"projectType": "library",
7+
"tags": [],
8+
"targets": {
9+
"build": {
10+
"executor": "@nx/angular:package",
11+
"outputs": ["{workspaceRoot}/dist/{projectRoot}"],
12+
"options": {
13+
"project": "libs/core-new/ng-package.json"
14+
},
15+
"configurations": {
16+
"production": {
17+
"tsConfig": "libs/core-new/tsconfig.lib.prod.json"
18+
},
19+
"development": {
20+
"tsConfig": "libs/core-new/tsconfig.lib.json"
21+
}
22+
},
23+
"defaultConfiguration": "production"
24+
},
25+
"test": {
26+
"executor": "@nx/jest:jest",
27+
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
28+
"options": {
29+
"jestConfig": "libs/core-new/jest.config.ts"
30+
}
31+
},
32+
"lint": {
33+
"executor": "@nx/eslint:lint"
34+
}
35+
}
36+
}

libs/core-new/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './lib/core-new/core-new.component';

libs/core-new/src/lib/core-new/core-new.component.css

Whitespace-only changes.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<p>core-new works!</p>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { ComponentFixture, TestBed } from '@angular/core/testing';
2+
import { CoreNewComponent } from './core-new.component';
3+
4+
describe('CoreNewComponent', () => {
5+
let component: CoreNewComponent;
6+
let fixture: ComponentFixture<CoreNewComponent>;
7+
8+
beforeEach(async () => {
9+
await TestBed.configureTestingModule({
10+
imports: [CoreNewComponent],
11+
}).compileComponents();
12+
13+
fixture = TestBed.createComponent(CoreNewComponent);
14+
component = fixture.componentInstance;
15+
fixture.detectChanges();
16+
});
17+
18+
it('should create', () => {
19+
expect(component).toBeTruthy();
20+
});
21+
});
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { CommonModule } from '@angular/common';
2+
import { Component } from '@angular/core';
3+
4+
@Component({
5+
selector: 'lib-core-new',
6+
standalone: true,
7+
imports: [CommonModule],
8+
templateUrl: './core-new.component.html',
9+
styleUrl: './core-new.component.css',
10+
})
11+
export class CoreNewComponent {}

libs/core-new/src/test-setup.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// @ts-expect-error https://thymikee.github.io/jest-preset-angular/docs/getting-started/test-environment
2+
globalThis.ngJest = {
3+
testEnvironmentOptions: {
4+
errorOnUnknownElements: true,
5+
errorOnUnknownProperties: true,
6+
},
7+
};
8+
import 'jest-preset-angular/setup-jest';

libs/core-new/tsconfig.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"compilerOptions": {
3+
"target": "es2022",
4+
"useDefineForClassFields": false,
5+
"forceConsistentCasingInFileNames": true,
6+
"strict": true,
7+
"noImplicitOverride": true,
8+
"noPropertyAccessFromIndexSignature": true,
9+
"noImplicitReturns": true,
10+
"noFallthroughCasesInSwitch": true
11+
},
12+
"files": [],
13+
"include": [],
14+
"references": [
15+
{
16+
"path": "./tsconfig.lib.json"
17+
},
18+
{
19+
"path": "./tsconfig.spec.json"
20+
}
21+
],
22+
"extends": "../../tsconfig.base.json",
23+
"angularCompilerOptions": {
24+
"enableI18nLegacyMessageIdFormat": false,
25+
"strictInjectionParameters": true,
26+
"strictInputAccessModifiers": true,
27+
"strictTemplates": true
28+
}
29+
}

libs/core-new/tsconfig.lib.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
"outDir": "../../dist/out-tsc",
5+
"declaration": true,
6+
"declarationMap": true,
7+
"inlineSources": true,
8+
"types": []
9+
},
10+
"exclude": ["src/**/*.spec.ts", "src/test-setup.ts", "jest.config.ts", "src/**/*.test.ts"],
11+
"include": ["src/**/*.ts"]
12+
}

libs/core-new/tsconfig.lib.prod.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"extends": "./tsconfig.lib.json",
3+
"compilerOptions": {
4+
"declarationMap": false
5+
},
6+
"angularCompilerOptions": {
7+
"compilationMode": "partial"
8+
}
9+
}

libs/core-new/tsconfig.spec.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
"outDir": "../../dist/out-tsc",
5+
"module": "commonjs",
6+
"target": "es2016",
7+
"types": ["jest", "node"]
8+
},
9+
"files": ["src/test-setup.ts"],
10+
"include": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts", "src/**/*.d.ts"]
11+
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
"@types/three": "^0.165.0",
5858
"@typescript-eslint/eslint-plugin": "7.13.1",
5959
"@typescript-eslint/parser": "7.13.1",
60-
"@typescript-eslint/utils": "8.0.0-alpha.30",
60+
"@typescript-eslint/utils": "^8.0.0-alpha.28",
6161
"autoprefixer": "^10.4.19",
6262
"dotenv-cli": "^7.4.2",
6363
"enquirer": "^2.4.1",

pnpm-lock.yaml

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tsconfig.base.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"angular-three-cannon/body": ["libs/cannon/body/src/index.ts"],
2525
"angular-three-cannon/constraint": ["libs/cannon/constraint/src/index.ts"],
2626
"angular-three-cannon/debug": ["libs/cannon/debug/src/index.ts"],
27+
"angular-three-core-new": ["libs/core-new/src/index.ts"],
2728
"angular-three-old": ["libs/old/core-old/src/index.ts"],
2829
"angular-three-postprocessing": ["libs/postprocessing/src/index.ts"],
2930
"angular-three-postprocessing-old": ["libs/old/postprocessing-old/src/index.ts"],

0 commit comments

Comments
 (0)