Skip to content

Commit 5627996

Browse files
committed
feat: add plugin
1 parent 0b4e587 commit 5627996

22 files changed

+1318
-114
lines changed

.eslintrc.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@
3737
"jest": true
3838
},
3939
"rules": {}
40+
},
41+
{
42+
"files": "*.json",
43+
"parser": "jsonc-eslint-parser",
44+
"rules": {}
4045
}
4146
]
4247
}

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"eslint.validate": ["json"]
3+
}

libs/angular-three-cannon/ng-package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@
33
"dest": "../../dist/libs/angular-three-cannon",
44
"lib": {
55
"entryFile": "src/index.ts"
6-
}
6+
},
7+
"allowedNonPeerDependencies": ["@nrwl/devkit"]
78
}

libs/angular-three-cannon/package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@
1010
"cannon-es-debugger": "^1.0.0"
1111
},
1212
"dependencies": {
13+
"@nrwl/devkit": "^15.0.0",
1314
"tslib": "^2.3.0"
1415
},
15-
"sideEffects": false
16+
"sideEffects": false,
17+
"generators": "./plugin/generators.json",
18+
"schematics": "./plugin/generators.json"
1619
}

libs/angular-three-cannon/project.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@
2121
},
2222
"defaultConfiguration": "production"
2323
},
24+
"package": {
25+
"executor": "nx:run-commands",
26+
"options": {
27+
"commands": ["npx nx build angular-three-cannon", "npx nx build angular-three-cannon-plugin"],
28+
"parallel": false
29+
}
30+
},
2431
"test": {
2532
"executor": "@nrwl/jest:jest",
2633
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],

libs/plugin/.eslintrc.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"extends": ["../../.eslintrc.json"],
3+
"ignorePatterns": ["!**/*"],
4+
"overrides": [
5+
{
6+
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
7+
"rules": {}
8+
},
9+
{
10+
"files": ["*.ts", "*.tsx"],
11+
"rules": {}
12+
},
13+
{
14+
"files": ["*.js", "*.jsx"],
15+
"rules": {}
16+
},
17+
{
18+
"files": ["./package.json", "./generators.json", "./executors.json"],
19+
"parser": "jsonc-eslint-parser",
20+
"rules": {
21+
"@nrwl/nx/nx-plugin-checks": "error"
22+
}
23+
}
24+
]
25+
}

libs/plugin/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# plugin
2+
3+
This library was generated with [Nx](https://nx.dev).
4+
5+
## Building
6+
7+
Run `nx build plugin` to build the library.
8+
9+
## Running unit tests
10+
11+
Run `nx test plugin` to execute the unit tests via [Jest](https://jestjs.io).

libs/plugin/generators.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"$schema": "http://json-schema.org/schema",
3+
"name": "angular-three-cannon-plugin",
4+
"version": "0.0.1",
5+
"generators": {
6+
"init": {
7+
"factory": "./src/generators/init/init",
8+
"schema": "./src/generators/init/schema.json",
9+
"description": "Init Angular Three Cannon"
10+
}
11+
},
12+
"schematics": {
13+
"ng-add": {
14+
"factory": "./src/generators/init/compat",
15+
"schema": "./src/generators/init/schema.json",
16+
"description": "Add Angular Three Cannon"
17+
}
18+
}
19+
}

libs/plugin/jest.config.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/* eslint-disable */
2+
export default {
3+
displayName: 'plugin',
4+
preset: '../../jest.preset.js',
5+
globals: {
6+
'ts-jest': {
7+
tsconfig: '<rootDir>/tsconfig.spec.json',
8+
},
9+
},
10+
transform: {
11+
'^.+\\.[tj]s$': 'ts-jest',
12+
},
13+
moduleFileExtensions: ['ts', 'js', 'html'],
14+
coverageDirectory: '../../coverage/libs/plugin',
15+
};

libs/plugin/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"type": "commonjs"
3+
}

0 commit comments

Comments
 (0)