Skip to content

Commit c3bbc46

Browse files
committed
feat(core): upgrade nx
1 parent 5a56e6d commit c3bbc46

File tree

6 files changed

+2137
-2831
lines changed

6 files changed

+2137
-2831
lines changed

CHANGELOG.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
1-
2-
31
## [2.0.0-beta.10](https://github.com/angular-threejs/angular-three/compare/2.0.0-beta.9...2.0.0-beta.10) (2023-08-15)
42

5-
63
### Bug Fixes
74

8-
* **core:** make sure renderer work correctly for two DOMs elements that might contain THREE children ([b1987ba](https://github.com/angular-threejs/angular-three/commit/b1987ba9ea58f204e7618767773d1c2980f06b04))
5+
- **core:** make sure renderer work correctly for two DOMs elements that might contain THREE children ([b1987ba](https://github.com/angular-threejs/angular-three/commit/b1987ba9ea58f204e7618767773d1c2980f06b04))
96

107
## [2.0.0-beta.9](https://github.com/angular-threejs/angular-three/compare/2.0.0-beta.8...2.0.0-beta.9) (2023-08-15)
118

129
## 2.0.0-beta.8 (2023-08-14)
1310

1411
### Features
1512

16-
- **core:** generate core ([e1cf6c7](https://github.com/angular-threejs/angular-three/commit/e1cf6c7422668afbbc0f767a444bcc591e1a6903))
13+
- **core:** generate core ([e1cf6c7](https://github.com/angular-threejs/angular-three/commit/e1cf6c7422668afbbc0f767a444bcc591e1a6903))
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
button {
2+
position: absolute;
3+
top: 1rem;
4+
left: 1rem;
5+
}

apps/sandbox/src/app/app.component.ts

Lines changed: 35 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { NgIf } from '@angular/common';
22
import { CUSTOM_ELEMENTS_SCHEMA, Component, Input, computed, signal } from '@angular/core';
33
import { Triplet } from '@pmndrs/cannon-worker-api';
4-
import { NgtArgs, NgtCanvas, extend } from 'angular-three';
4+
import { NgtArgs, NgtCanvas, NgtKey, extend } from 'angular-three';
55
import { NgtcPhysics } from 'angular-three-cannon';
66
import { NgtcDebug } from 'angular-three-cannon/debug';
77
import { injectBox, injectPlane } from 'angular-three-cannon/services';
@@ -28,9 +28,9 @@ extend(THREE);
2828
})
2929
export class Plane {
3030
Math = Math;
31-
@Input() position = [0, 0, 0];
31+
@Input() position: Triplet = [0, 0, 0];
3232

33-
planeApi = injectPlane(() => ({ mass: 0, position: this.position as Triplet, args: [1000, 1000] }));
33+
planeApi = injectPlane(() => ({ mass: 0, position: this.position, args: [1000, 1000] }));
3434
}
3535

3636
@Component({
@@ -46,9 +46,9 @@ export class Plane {
4646
schemas: [CUSTOM_ELEMENTS_SCHEMA],
4747
})
4848
export class Box {
49-
@Input() position = [0, 0, 0];
49+
@Input() position: Triplet = [0, 0, 0];
5050

51-
boxApi = injectBox(() => ({ mass: 10000, position: this.position as Triplet, args: [2, 2, 2] }));
51+
boxApi = injectBox(() => ({ mass: 10000, position: this.position, args: [2, 2, 2] }));
5252
}
5353

5454
@Component({
@@ -93,8 +93,8 @@ export class CannonScene {
9393
@Component({
9494
standalone: true,
9595
template: `
96-
<ngt-ambient-light [intensity]="Math.PI" />
97-
<ngt-point-light [intensity]="Math.PI" />
96+
<ngt-ambient-light />
97+
<ngt-point-light />
9898
<ngt-primitive *args="[bot()]" [ref]="animations.ref" [position]="[0, -1, 0]" />
9999
<ngts-orbit-controls />
100100
<ngts-grid [position]="[0, -1, 0]" [args]="[10, 10]" />
@@ -126,17 +126,40 @@ export class Scene {
126126

127127
@Component({
128128
standalone: true,
129-
imports: [NgtCanvas, NgIf],
129+
imports: [NgtCanvas, NgIf, NgtKey],
130130
selector: 'sandbox-root',
131131
template: `
132132
<ngt-canvas
133-
[sceneGraph]="Scene"
134-
[camera]="{ position: [0, 0, 15] }"
133+
*key="scene"
134+
[sceneGraph]="scenes[scene].scene"
135+
[camera]="scenes[scene].cameraOptions"
135136
[shadows]="true"
136-
[gl]="{ useLegacyLights: true }"
137+
[gl]="scenes[scene].glOptions"
137138
/>
139+
<button (click)="onToggle()">Toggle scene: {{ scene }}</button>
138140
`,
141+
styleUrls: ['./app.component.css'],
139142
})
140143
export class AppComponent {
141-
readonly Scene = CannonScene;
144+
scene: 'cannon' | 'bot' = 'cannon';
145+
scenes = {
146+
bot: {
147+
scene: Scene,
148+
cameraOptions: {},
149+
glOptions: {},
150+
},
151+
cannon: {
152+
scene: CannonScene,
153+
cameraOptions: { position: [0, 0, 15] },
154+
glOptions: { useLegacyLights: true },
155+
},
156+
} as const;
157+
158+
onToggle() {
159+
if (this.scene === 'bot') {
160+
this.scene = 'cannon';
161+
} else {
162+
this.scene = 'bot';
163+
}
164+
}
142165
}

migrations.json

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,14 @@
22
"migrations": [
33
{
44
"cli": "nx",
5-
"version": "16.6.0-beta.6",
6-
"description": "Prefix outputs with {workspaceRoot}/{projectRoot} if needed",
7-
"implementation": "./src/migrations/update-15-0-0/prefix-outputs",
8-
"package": "nx",
9-
"name": "16.6.0-prefix-outputs"
10-
},
11-
{
12-
"cli": "nx",
13-
"version": "16.6.0-beta.0",
14-
"description": "Explicitly set 'updateBuildableProjectDepsInPackageJson' to 'true' in targets that rely on that value as the default.",
15-
"factory": "./src/migrations/update-16-6-0/explicitly-set-projects-to-update-buildable-deps",
16-
"package": "@nx/js",
17-
"name": "explicitly-set-projects-to-update-buildable-deps"
18-
},
19-
{
20-
"cli": "nx",
21-
"version": "16.6.0-beta.0",
22-
"description": "Explicitly set 'updateBuildableProjectDepsInPackageJson' to 'true' in targets that rely on that value as the default.",
23-
"factory": "./src/migrations/update-16-6-0/explicitly-set-projects-to-update-buildable-deps",
5+
"version": "16.7.0-beta.6",
6+
"requires": {
7+
"@angular/core": ">=16.2.0"
8+
},
9+
"description": "Update the @angular/cli package version to ~16.2.0.",
10+
"factory": "./src/migrations/update-16-7-0/update-angular-cli",
2411
"package": "@nx/angular",
25-
"name": "explicitly-set-projects-to-update-buildable-deps"
12+
"name": "update-angular-cli-version-16-2-0"
2613
}
2714
]
2815
}

package.json

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -11,36 +11,36 @@
1111
"devDependencies": {
1212
"@analogjs/platform": "^0.2.0-rc.1",
1313
"@analogjs/vite-plugin-angular": "^0.2.0-rc.1",
14-
"@angular-devkit/build-angular": "16.1.6",
15-
"@angular-devkit/core": "16.1.6",
16-
"@angular-devkit/schematics": "16.1.6",
14+
"@angular-devkit/build-angular": "16.2.0",
15+
"@angular-devkit/core": "16.2.0",
16+
"@angular-devkit/schematics": "16.2.0",
1717
"@angular-eslint/eslint-plugin": "~16.1.0",
1818
"@angular-eslint/eslint-plugin-template": "~16.1.0",
1919
"@angular-eslint/template-parser": "~16.1.0",
20-
"@angular/cli": "~16.1.6",
21-
"@angular/compiler-cli": "16.1.7",
22-
"@angular/language-service": "16.1.7",
23-
"@nx/angular": "16.6.0",
24-
"@nx/devkit": "16.6.0",
25-
"@nx/eslint-plugin": "16.6.0",
26-
"@nx/jest": "16.6.0",
27-
"@nx/js": "16.6.0",
28-
"@nx/linter": "16.6.0",
29-
"@nx/plugin": "16.6.0",
30-
"@nx/storybook": "16.6.0",
31-
"@nx/vite": "16.6.0",
32-
"@nx/web": "16.6.0",
33-
"@nx/workspace": "16.6.0",
20+
"@angular/cli": "~16.2.0",
21+
"@angular/compiler-cli": "16.2.0",
22+
"@angular/language-service": "16.2.0",
23+
"@nx/angular": "16.7.0",
24+
"@nx/devkit": "16.7.0",
25+
"@nx/eslint-plugin": "16.7.0",
26+
"@nx/jest": "16.7.0",
27+
"@nx/js": "16.7.0",
28+
"@nx/linter": "16.7.0",
29+
"@nx/plugin": "16.7.0",
30+
"@nx/storybook": "16.7.0",
31+
"@nx/vite": "16.7.0",
32+
"@nx/web": "16.7.0",
33+
"@nx/workspace": "16.7.0",
3434
"@release-it/bumper": "^5.1.0",
3535
"@release-it/conventional-changelog": "^7.0.0",
36-
"@schematics/angular": "16.1.6",
37-
"@storybook/addon-essentials": "^7.1.0",
38-
"@storybook/addon-interactions": "^7.1.0",
39-
"@storybook/angular": "^7.1.0",
40-
"@storybook/core-server": "^7.1.0",
36+
"@schematics/angular": "16.2.0",
37+
"@storybook/addon-essentials": "7.3.0",
38+
"@storybook/addon-interactions": "7.3.0",
39+
"@storybook/angular": "7.3.0",
40+
"@storybook/core-server": "7.3.0",
4141
"@storybook/jest": "~0.1.0",
4242
"@storybook/manager-api": "^7.2.0",
43-
"@storybook/test-runner": "^0.11.0",
43+
"@storybook/test-runner": "0.13.0",
4444
"@storybook/testing-library": "~0.2.0",
4545
"@storybook/theming": "^7.2.0",
4646
"@swc-node/register": "~1.4.2",
@@ -49,21 +49,21 @@
4949
"@types/jest": "^29.5.3",
5050
"@types/node": "20.4.5",
5151
"@types/three": "^0.154.0",
52-
"@typescript-eslint/eslint-plugin": "6.2.0",
53-
"@typescript-eslint/parser": "6.2.0",
52+
"@typescript-eslint/eslint-plugin": "5.62.0",
53+
"@typescript-eslint/parser": "5.62.0",
5454
"autoprefixer": "^10.4.0",
5555
"dotenv-cli": "^7.2.1",
56-
"eslint": "~8.46.0",
56+
"eslint": "8.46.0",
5757
"eslint-config-prettier": "8.9.0",
5858
"glsl-noise": "^0.0.0",
5959
"glslify-loader": "^2.0.0",
6060
"jest": "^29.6.2",
6161
"jest-environment-jsdom": "^29.6.2",
6262
"jest-preset-angular": "~13.1.1",
6363
"jsdom": "^22.0.0",
64-
"ng-packagr": "16.1.0",
64+
"ng-packagr": "16.2.0",
6565
"ngx-resize": "^2.0.0",
66-
"nx": "16.6.0",
66+
"nx": "16.7.0",
6767
"postcss": "^8.4.27",
6868
"postcss-import": "~15.1.0",
6969
"postcss-preset-env": "~9.1.0",
@@ -86,15 +86,15 @@
8686
"dependencies": {
8787
"@analogjs/content": "^0.2.0-rc.1",
8888
"@analogjs/router": "^0.2.0-rc.1",
89-
"@angular/animations": "16.1.7",
90-
"@angular/common": "16.1.7",
91-
"@angular/compiler": "16.1.7",
92-
"@angular/core": "16.1.7",
93-
"@angular/forms": "16.1.7",
94-
"@angular/platform-browser": "16.1.7",
95-
"@angular/platform-browser-dynamic": "16.1.7",
96-
"@angular/platform-server": "16.1.7",
97-
"@angular/router": "16.1.7",
89+
"@angular/animations": "16.2.0",
90+
"@angular/common": "16.2.0",
91+
"@angular/compiler": "16.2.0",
92+
"@angular/core": "16.2.0",
93+
"@angular/forms": "16.2.0",
94+
"@angular/platform-browser": "16.2.0",
95+
"@angular/platform-browser-dynamic": "16.2.0",
96+
"@angular/platform-server": "16.2.0",
97+
"@angular/router": "16.2.0",
9898
"@pmndrs/cannon-worker-api": "^2.4.0",
9999
"@swc/helpers": "~0.5.0",
100100
"cannon-es": "^0.20.0",

0 commit comments

Comments
 (0)