Skip to content

Commit a9db86d

Browse files
committed
feat: add core lib
1 parent 4d19164 commit a9db86d

22 files changed

+22447
-7258
lines changed

.eslintrc.json

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
"root": true,
3+
"ignorePatterns": ["**/*"],
4+
"plugins": ["@nrwl/nx"],
5+
"overrides": [
6+
{
7+
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
8+
"rules": {
9+
"@nrwl/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:@nrwl/nx/typescript"],
27+
"rules": {}
28+
},
29+
{
30+
"files": ["*.js", "*.jsx"],
31+
"extends": ["plugin:@nrwl/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+
]
42+
}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,5 @@ testem.log
3737
# System Files
3838
.DS_Store
3939
Thumbs.db
40+
41+
.angular

.vscode/extensions.json

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

jest.config.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { getJestProjects } from '@nrwl/jest';
2+
3+
export default {
4+
projects: getJestProjects(),
5+
};

jest.preset.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
const nxPreset = require('@nrwl/jest/preset').default;
2+
3+
module.exports = { ...nxPreset };

libs/angular-three/.eslintrc.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"extends": ["../../.eslintrc.json"],
3+
"ignorePatterns": ["!**/*"],
4+
"overrides": [
5+
{
6+
"files": ["*.ts"],
7+
"rules": {
8+
"@angular-eslint/directive-selector": "off",
9+
"@angular-eslint/directive-class-suffix": "off",
10+
"@angular-eslint/component-selector": "off",
11+
"@angular-eslint/component-class-suffix": "off",
12+
"@typescript-eslint/no-empty-function": "off",
13+
"@typescript-eslint/ban-ts-comment": "off",
14+
"@typescript-eslint/no-explicit-any": "off",
15+
"@typescript-eslint/ban-types": "off",
16+
"@typescript-eslint/member-ordering": "off",
17+
"@typescript-eslint/no-non-null-assertion": "off"
18+
},
19+
"extends": ["plugin:@nrwl/nx/angular", "plugin:@angular-eslint/template/process-inline-templates"]
20+
},
21+
{
22+
"files": ["*.html"],
23+
"extends": ["plugin:@nrwl/nx/angular-template"],
24+
"rules": {}
25+
}
26+
]
27+
}

libs/angular-three/README.md

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

libs/angular-three/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: 'angular-three',
4+
preset: '../../jest.preset.js',
5+
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
6+
globals: {
7+
'ts-jest': {
8+
tsconfig: '<rootDir>/tsconfig.spec.json',
9+
stringifyContentPathRegex: '\\.(html|svg)$',
10+
},
11+
},
12+
coverageDirectory: '../../coverage/libs/angular-three',
13+
transform: {
14+
'^.+\\.(ts|mjs|js|html)$': 'jest-preset-angular',
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/angular-three/ng-package.json

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

libs/angular-three/package.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"name": "angular-three",
3+
"version": "0.0.1",
4+
"peerDependencies": {
5+
"@angular/common": "^15.1.0",
6+
"@angular/core": "^15.1.0",
7+
"three": "0.148.0"
8+
},
9+
"dependencies": {
10+
"ngx-resize": "^1.0.0",
11+
"tslib": "^2.3.0"
12+
},
13+
"sideEffects": false
14+
}

libs/angular-three/project.json

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

libs/angular-three/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './lib/angular-three.module';
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { NgModule } from '@angular/core';
2+
import { CommonModule } from '@angular/common';
3+
4+
@NgModule({
5+
imports: [CommonModule],
6+
})
7+
export class AngularThreeModule {
8+
}

libs/angular-three/src/test-setup.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import 'jest-preset-angular/setup-jest';

libs/angular-three/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/angular-three/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/test-setup.ts", "src/**/*.spec.ts", "jest.config.ts", "src/**/*.test.ts"],
11+
"include": ["src/**/*.ts"]
12+
}
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/angular-three/tsconfig.spec.json

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

nx.json

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,38 @@
1313
"build": {
1414
"dependsOn": ["^build"],
1515
"inputs": ["production", "^production"]
16+
},
17+
"test": {
18+
"inputs": ["default", "^production", "{workspaceRoot}/jest.preset.js"]
19+
},
20+
"lint": {
21+
"inputs": ["default", "{workspaceRoot}/.eslintrc.json"]
1622
}
1723
},
1824
"namedInputs": {
1925
"default": ["{projectRoot}/**/*", "sharedGlobals"],
20-
"production": ["default"],
26+
"production": [
27+
"default",
28+
"!{projectRoot}/**/?(*.)+(spec|test).[jt]s?(x)?(.snap)",
29+
"!{projectRoot}/tsconfig.spec.json",
30+
"!{projectRoot}/jest.config.[jt]s",
31+
"!{projectRoot}/.eslintrc.json"
32+
],
2133
"sharedGlobals": []
34+
},
35+
"generators": {
36+
"@nrwl/angular:application": {
37+
"style": "css",
38+
"linter": "eslint",
39+
"unitTestRunner": "jest",
40+
"e2eTestRunner": "none"
41+
},
42+
"@nrwl/angular:library": {
43+
"linter": "eslint",
44+
"unitTestRunner": "jest"
45+
},
46+
"@nrwl/angular:component": {
47+
"style": "css"
48+
}
2249
}
2350
}

0 commit comments

Comments
 (0)