Skip to content

Commit f91595c

Browse files
committed
feat(repo): migrate nx and angular
1 parent e3d904c commit f91595c

File tree

194 files changed

+6455
-4642
lines changed

Some content is hidden

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

194 files changed

+6455
-4642
lines changed

Diff for: .gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,5 @@ Thumbs.db
4444
.nx/cache
4545
.nx/workspace-data
4646

47-
vite.config.*.timestamp*
47+
vite.config.*.timestamp*
48+
vitest.config.*.timestamp*

Diff for: apps/ionic-app/eslint.config.js

+6
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,10 @@ module.exports = [
5555
...config.rules,
5656
},
5757
})),
58+
{
59+
files: ['**/*.ts'],
60+
rules: {
61+
'@angular-eslint/prefer-standalone': 'off',
62+
},
63+
},
5864
];

Diff for: apps/ionic-app/src/app/app.component.ts

+4-5
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,13 @@ import { Component } from '@angular/core';
33
import { IonicModule } from '@ionic/angular';
44

55
@Component({
6-
selector: 'platform-root',
7-
standalone: true,
8-
imports: [CommonModule, IonicModule],
9-
template: `
6+
selector: 'platform-root',
7+
imports: [CommonModule, IonicModule],
8+
template: `
109
<ion-app>
1110
<ion-router-outlet></ion-router-outlet>
1211
</ion-app>
1312
`,
14-
styles: ``,
13+
styles: ``
1514
})
1615
export class AppComponent {}

Diff for: apps/ionic-app/src/app/home/experience.ts

+20-24
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,16 @@ const niceColors = ['#99b898', '#fecea8', '#ff847c', '#e84a5f', '#2a363b'] as co
2020
extend(THREE);
2121

2222
@Component({
23-
selector: 'app-plane',
24-
standalone: true,
25-
template: `
23+
selector: 'app-plane',
24+
template: `
2625
<ngt-mesh #mesh [receiveShadow]="true">
2726
<ngt-plane-geometry *args="[1000, 1000]" />
2827
<ngt-mesh-phong-material [color]="color()" />
2928
</ngt-mesh>
3029
`,
31-
schemas: [CUSTOM_ELEMENTS_SCHEMA],
32-
changeDetection: ChangeDetectionStrategy.OnPush,
33-
imports: [NgtArgs],
30+
schemas: [CUSTOM_ELEMENTS_SCHEMA],
31+
changeDetection: ChangeDetectionStrategy.OnPush,
32+
imports: [NgtArgs]
3433
})
3534
export class Plane {
3635
color = input.required<string>();
@@ -48,17 +47,16 @@ export class Plane {
4847
}
4948

5049
@Component({
51-
selector: 'app-box',
52-
standalone: true,
53-
template: `
50+
selector: 'app-box',
51+
template: `
5452
<ngt-mesh #mesh [castShadow]="true" [receiveShadow]="true">
5553
<ngt-box-geometry *args="args" />
5654
<ngt-mesh-lambert-material color="white" />
5755
</ngt-mesh>
5856
`,
59-
schemas: [CUSTOM_ELEMENTS_SCHEMA],
60-
changeDetection: ChangeDetectionStrategy.OnPush,
61-
imports: [NgtArgs],
57+
schemas: [CUSTOM_ELEMENTS_SCHEMA],
58+
changeDetection: ChangeDetectionStrategy.OnPush,
59+
imports: [NgtArgs]
6260
})
6361
export class Box {
6462
args: Triplet = [4, 4, 4];
@@ -77,9 +75,8 @@ export class Box {
7775
}
7876

7977
@Component({
80-
selector: 'app-instanced-spheres',
81-
standalone: true,
82-
template: `
78+
selector: 'app-instanced-spheres',
79+
template: `
8380
<ngt-instanced-mesh
8481
#instancedMesh
8582
[castShadow]="true"
@@ -92,9 +89,9 @@ export class Box {
9289
<ngt-mesh-phong-material [vertexColors]="true" />
9390
</ngt-instanced-mesh>
9491
`,
95-
imports: [NgtArgs],
96-
schemas: [CUSTOM_ELEMENTS_SCHEMA],
97-
changeDetection: ChangeDetectionStrategy.OnPush,
92+
imports: [NgtArgs],
93+
schemas: [CUSTOM_ELEMENTS_SCHEMA],
94+
changeDetection: ChangeDetectionStrategy.OnPush
9895
})
9996
export class InstancedSpheres {
10097
count = input(100);
@@ -123,8 +120,7 @@ export class InstancedSpheres {
123120
}
124121

125122
@Component({
126-
standalone: true,
127-
template: `
123+
template: `
128124
<ngt-hemisphere-light [intensity]="0.35 * Math.PI" />
129125
<ngt-spot-light
130126
[angle]="0.3"
@@ -147,10 +143,10 @@ export class InstancedSpheres {
147143
<app-instanced-spheres />
148144
</ngtc-physics>
149145
`,
150-
imports: [InstancedSpheres, Box, Plane, NgtcPhysics, NgtArgs, NgtcDebug],
151-
schemas: [CUSTOM_ELEMENTS_SCHEMA],
152-
changeDetection: ChangeDetectionStrategy.OnPush,
153-
host: { class: 'kimenatic-experience' },
146+
imports: [InstancedSpheres, Box, Plane, NgtcPhysics, NgtArgs, NgtcDebug],
147+
schemas: [CUSTOM_ELEMENTS_SCHEMA],
148+
changeDetection: ChangeDetectionStrategy.OnPush,
149+
host: { class: 'kimenatic-experience' }
154150
})
155151
export class Experience {
156152
Math = Math;

Diff for: apps/ionic-app/src/app/home/home.page.ts

+5-6
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,16 @@ import { Experience } from './experience';
77
extend(THREE);
88

99
@Component({
10-
selector: 'platform-home',
11-
standalone: true,
12-
imports: [IonicModule, NgtCanvas],
13-
template: `
10+
selector: 'platform-home',
11+
imports: [IonicModule, NgtCanvas],
12+
template: `
1413
<ion-content [fullscreen]="true">
1514
<div id="container">
1615
<ngt-canvas [sceneGraph]="scene" [camera]="{ position: [0, -12, 16] }" [shadows]="true" />
1716
</div>
1817
</ion-content>
1918
`,
20-
styles: `
19+
styles: `
2120
#container {
2221
text-align: center;
2322
position: absolute;
@@ -27,7 +26,7 @@ extend(THREE);
2726
height: 100%;
2827
transform: translateY(-50%);
2928
}
30-
`,
29+
`
3130
})
3231
export class HomePage {
3332
scene = Experience;

Diff for: apps/kitchen-sink/eslint.config.js

+6
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,10 @@ module.exports = [
4747
...config.rules,
4848
},
4949
})),
50+
{
51+
files: ['**/*.ts'],
52+
rules: {
53+
'@angular-eslint/prefer-standalone': 'off',
54+
},
55+
},
5056
];

Diff for: apps/kitchen-sink/src/app/app.component.ts

+3-4
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@ import { ActivatedRoute, ActivationEnd, NavigationEnd, Router, RouterOutlet } fr
44
import { filter } from 'rxjs';
55

66
@Component({
7-
selector: 'app-root',
8-
standalone: true,
9-
template: `
7+
selector: 'app-root',
8+
template: `
109
<router-outlet />
1110
1211
<div class="absolute bottom-4 right-4 flex gap-4 items-center">
@@ -45,7 +44,7 @@ import { filter } from 'rxjs';
4544
</div>
4645
}
4746
`,
48-
imports: [RouterOutlet],
47+
imports: [RouterOutlet]
4948
})
5049
export class AppComponent {
5150
private router = inject(Router);

Diff for: apps/kitchen-sink/src/app/cannon/basic/basic.ts

+5-6
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,18 @@ import { Experience } from './experience';
44
import { State } from './state';
55

66
@Component({
7-
standalone: true,
8-
template: `
7+
template: `
98
<ngt-canvas [sceneGraph]="scene" [shadows]="true" [camera]="{ position: [0, 0, 15] }" />
109
<div class="font-mono absolute top-0 right-0 flex gap-4 text-white">
1110
<button (click)="state.toggleDebugging()">Toggle debugging: {{ state.isDebugging() }}</button>
1211
<span>|</span>
1312
<button (click)="state.changeGravity()">Change gravity: {{ state.gravity() }}</button>
1413
</div>
1514
`,
16-
imports: [NgtCanvas],
17-
changeDetection: ChangeDetectionStrategy.OnPush,
18-
host: { class: 'basic-cannon ' },
19-
providers: [State],
15+
imports: [NgtCanvas],
16+
changeDetection: ChangeDetectionStrategy.OnPush,
17+
host: { class: 'basic-cannon ' },
18+
providers: [State]
2019
})
2120
export default class Basic {
2221
protected scene = Experience;

Diff for: apps/kitchen-sink/src/app/cannon/basic/experience.ts

+15-18
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,16 @@ import { Mesh } from 'three';
1818
import { State } from './state';
1919

2020
@Component({
21-
selector: 'app-plane',
22-
standalone: true,
23-
template: `
21+
selector: 'app-plane',
22+
template: `
2423
<ngt-mesh #mesh [receiveShadow]="true">
2524
<ngt-plane-geometry *args="args" />
2625
<ngt-mesh-standard-material color="#171717" />
2726
</ngt-mesh>
2827
`,
29-
imports: [NgtArgs],
30-
schemas: [CUSTOM_ELEMENTS_SCHEMA],
31-
changeDetection: ChangeDetectionStrategy.OnPush,
28+
imports: [NgtArgs],
29+
schemas: [CUSTOM_ELEMENTS_SCHEMA],
30+
changeDetection: ChangeDetectionStrategy.OnPush
3231
})
3332
export class Plane {
3433
position = input<Triplet>([0, 0, 0]);
@@ -41,17 +40,16 @@ export class Plane {
4140
}
4241

4342
@Component({
44-
selector: 'app-box',
45-
standalone: true,
46-
template: `
43+
selector: 'app-box',
44+
template: `
4745
<ngt-mesh #mesh [receiveShadow]="true" [castShadow]="true">
4846
<ngt-box-geometry *args="args" />
4947
<ngt-mesh-standard-material [roughness]="0.5" color="#575757" />
5048
</ngt-mesh>
5149
`,
52-
imports: [NgtArgs],
53-
schemas: [CUSTOM_ELEMENTS_SCHEMA],
54-
changeDetection: ChangeDetectionStrategy.OnPush,
50+
imports: [NgtArgs],
51+
schemas: [CUSTOM_ELEMENTS_SCHEMA],
52+
changeDetection: ChangeDetectionStrategy.OnPush
5553
})
5654
export class Box {
5755
position = input<Triplet>([0, 0, 0]);
@@ -64,8 +62,7 @@ export class Box {
6462
}
6563

6664
@Component({
67-
standalone: true,
68-
template: `
65+
template: `
6966
<ngt-point-light [position]="[-10, -10, 30]" [intensity]="0.25 * Math.PI" [decay]="0" />
7067
<ngt-spot-light
7168
[intensity]="0.3 * Math.PI"
@@ -97,10 +94,10 @@ export class Box {
9794
}
9895
</ngtc-physics>
9996
`,
100-
imports: [Box, Plane, NgtcPhysics, NgtcDebug],
101-
changeDetection: ChangeDetectionStrategy.OnPush,
102-
schemas: [CUSTOM_ELEMENTS_SCHEMA],
103-
host: { class: 'basic-experience' },
97+
imports: [Box, Plane, NgtcPhysics, NgtcDebug],
98+
changeDetection: ChangeDetectionStrategy.OnPush,
99+
schemas: [CUSTOM_ELEMENTS_SCHEMA],
100+
host: { class: 'basic-experience' }
104101
})
105102
export class Experience {
106103
protected Math = Math;

Diff for: apps/kitchen-sink/src/app/cannon/cannon.ts

+4-5
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ import routes from './cannon.routes';
77
extend(THREE);
88

99
@Component({
10-
standalone: true,
11-
template: `
10+
template: `
1211
<div class="h-svh">
1312
<router-outlet />
1413
</div>
@@ -29,9 +28,9 @@ extend(THREE);
2928
}
3029
</ul>
3130
`,
32-
imports: [RouterOutlet, RouterLink, RouterLinkActive],
33-
changeDetection: ChangeDetectionStrategy.OnPush,
34-
host: { class: 'cannon' },
31+
imports: [RouterOutlet, RouterLink, RouterLinkActive],
32+
changeDetection: ChangeDetectionStrategy.OnPush,
33+
host: { class: 'cannon' }
3534
})
3635
export default class Cannon {
3736
protected examples = routes.filter((route) => !!route.path).map((route) => route.path);

Diff for: apps/kitchen-sink/src/app/cannon/chain/chain.ts

+4-5
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,13 @@ import { NgtCanvas } from 'angular-three';
33
import { Experience } from './experience';
44

55
@Component({
6-
standalone: true,
7-
template: `
6+
template: `
87
<ngt-canvas [sceneGraph]="scene" [shadows]="true" [camera]="{ fov: 50, position: [0, 5, 20] }" />
98
<div class="absolute bottom-4 right-4 font-mono text-white">* Click to reset</div>
109
`,
11-
imports: [NgtCanvas],
12-
changeDetection: ChangeDetectionStrategy.OnPush,
13-
host: { class: 'chain-cannon' },
10+
imports: [NgtCanvas],
11+
changeDetection: ChangeDetectionStrategy.OnPush,
12+
host: { class: 'chain-cannon' }
1413
})
1514
export default class Chain {
1615
protected scene = Experience;

0 commit comments

Comments
 (0)