Skip to content

Commit 6f34c1c

Browse files
authored
feat(schematics): add part-main schematics for generating client/server main files (#29)
* refactor(schematics): rename base-part to part-base * feat(schematics): add `.nanoforge` folder structure with base JSON templates for client and server * feat(schematics): add part-main schematics for generating client/server main files
1 parent f4c8aa3 commit 6f34c1c

36 files changed

+676
-37
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
"build": "tsc --noEmit && tsup",
5050
"postbuild": "pnpm run copy:collection && pnpm run copy:lib",
5151
"copy:collection": "cpx src/collection.json dist && cpx 'src/libs/**/schema.json' dist/libs",
52-
"copy:lib": "cpx 'src/libs/**/files/**/*' dist/libs ",
52+
"copy:lib": "cpx 'src/libs/**/files/**/*' dist/libs",
5353
"lint": "prettier --check . && eslint --format=pretty src",
5454
"format": "prettier --write . && eslint --fix --format=pretty src",
5555
"prepack": "pnpm run build && pnpm run lint",

src/collection.json

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,15 @@
1111
"description": "Create a NanoForge Configuration.",
1212
"schema": "./libs/configuration/schema.json"
1313
},
14-
"base-part": {
15-
"factory": "./libs/base-part/base-part.factory#main",
16-
"description": "Create a NanoForge Base part.",
17-
"schema": "./libs/base-part/schema.json"
14+
"part-base": {
15+
"factory": "./libs/part-base/part-base.factory#main",
16+
"description": "Create a NanoForge Base for client or server.",
17+
"schema": "./libs/part-base/schema.json"
18+
},
19+
"part-main": {
20+
"factory": "./libs/part-main/part-main.factory#main",
21+
"description": "Create a Main file for client or server.",
22+
"schema": "./libs/part-main/schema.json"
1823
}
1924
}
2025
}
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
{
2+
"libraries": [
3+
{
4+
"id": "assetManagerLibrary",
5+
"type": "asset-manager",
6+
"name": "AssetManagerLibrary",
7+
"path": "@nanoforge-dev/asset-manager",
8+
"params": []
9+
},
10+
{
11+
"id": "ecsLibrary",
12+
"type": "component-system",
13+
"name": "ECSLibrary",
14+
"path": "@nanoforge-dev/ecs",
15+
"params": ["\"client\""]
16+
},
17+
{
18+
"id": "graphicsLibrary",
19+
"type": "graphics",
20+
"name": "Graphics2DLibrary",
21+
"path": "@nanoforge-dev/graphics-2d",
22+
"params": []
23+
},
24+
{
25+
"id": "inputLibrary",
26+
"type": "input",
27+
"name": "InputLibrary",
28+
"path": "@nanoforge-dev/input",
29+
"params": []
30+
},
31+
{
32+
"id": "musicLibrary",
33+
"type": "music",
34+
"name": "MusicLibrary",
35+
"path": "@nanoforge-dev/music",
36+
"params": []
37+
},
38+
{
39+
"id": "soundLibrary",
40+
"type": "sound",
41+
"name": "SoundLibrary",
42+
"path": "@nanoforge-dev/sound",
43+
"params": []
44+
}
45+
],
46+
"components": [
47+
{
48+
"name": "ExampleComponent",
49+
"path": "./components/example.component"
50+
}
51+
],
52+
"systems": [
53+
{
54+
"name": "exampleSystem",
55+
"path": "./systems/example.system"
56+
}
57+
],
58+
"entities": [
59+
{
60+
"id": "exampleEntity",
61+
"components": [
62+
{
63+
"name": "ExampleComponent",
64+
"params": ["\"example\"", "10"]
65+
}
66+
]
67+
}
68+
]
69+
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
"libraries": [
3+
{
4+
"id": "assetManagerLibrary",
5+
"type": "asset-manager",
6+
"name": "AssetManagerLibrary",
7+
"path": "@nanoforge-dev/asset-manager",
8+
"params": []
9+
},
10+
{
11+
"id": "ecsLibrary",
12+
"type": "component-system",
13+
"name": "ECSLibrary",
14+
"path": "@nanoforge-dev/ecs",
15+
"params": ["\"server\""]
16+
}
17+
],
18+
"components": [
19+
{
20+
"name": "ExampleComponent",
21+
"path": "./components/example.component"
22+
}
23+
],
24+
"systems": [
25+
{
26+
"name": "exampleSystem",
27+
"path": "./systems/example.system"
28+
}
29+
],
30+
"entities": [
31+
{
32+
"id": "exampleEntity",
33+
"components": [
34+
{
35+
"name": "ExampleComponent",
36+
"params": ["\"example\"", "10"]
37+
}
38+
]
39+
}
40+
]
41+
}

src/libs/base-part/files/js/__part__/components/example.component.js renamed to src/libs/part-base/files/js/__part__/components/example.component.js

File renamed without changes.

src/libs/base-part/files/js/__part__/init/after-init.js renamed to src/libs/part-base/files/js/__part__/init/after-init.js

File renamed without changes.

src/libs/base-part/files/js/__part__/init/after-registry-init.js renamed to src/libs/part-base/files/js/__part__/init/after-registry-init.js

File renamed without changes.

src/libs/base-part/files/js/__part__/init/after-run.js renamed to src/libs/part-base/files/js/__part__/init/after-run.js

File renamed without changes.

src/libs/base-part/files/js/__part__/init/before-init.js renamed to src/libs/part-base/files/js/__part__/init/before-init.js

File renamed without changes.

src/libs/base-part/files/js/__part__/init/before-registry-init.js renamed to src/libs/part-base/files/js/__part__/init/before-registry-init.js

File renamed without changes.

0 commit comments

Comments
 (0)