sceneshard 0.0.0-stage → 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE-APACHE +196 -0
- package/LICENSE-MIT +21 -0
- package/README.md +94 -2
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +233 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/doctor.d.ts +40 -0
- package/dist/commands/doctor.d.ts.map +1 -0
- package/dist/commands/doctor.js +441 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/init.d.ts +39 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +156 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/preview.d.ts +32 -0
- package/dist/commands/preview.d.ts.map +1 -0
- package/dist/commands/preview.js +89 -0
- package/dist/commands/preview.js.map +1 -0
- package/dist/config/loader.d.ts +24 -0
- package/dist/config/loader.d.ts.map +1 -0
- package/dist/config/loader.js +124 -0
- package/dist/config/loader.js.map +1 -0
- package/dist/config/schema.d.ts +74 -0
- package/dist/config/schema.d.ts.map +1 -0
- package/dist/config/schema.js +230 -0
- package/dist/config/schema.js.map +1 -0
- package/dist/godot/export-presets.d.ts +63 -0
- package/dist/godot/export-presets.d.ts.map +1 -0
- package/dist/godot/export-presets.js +126 -0
- package/dist/godot/export-presets.js.map +1 -0
- package/dist/godot/ini.d.ts +17 -0
- package/dist/godot/ini.d.ts.map +1 -0
- package/dist/godot/ini.js +187 -0
- package/dist/godot/ini.js.map +1 -0
- package/dist/godot/project.d.ts +32 -0
- package/dist/godot/project.d.ts.map +1 -0
- package/dist/godot/project.js +55 -0
- package/dist/godot/project.js.map +1 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +13 -0
- package/dist/index.js.map +1 -0
- package/dist/preview/mime.d.ts +6 -0
- package/dist/preview/mime.d.ts.map +1 -0
- package/dist/preview/mime.js +55 -0
- package/dist/preview/mime.js.map +1 -0
- package/dist/preview/server.d.ts +95 -0
- package/dist/preview/server.d.ts.map +1 -0
- package/dist/preview/server.js +302 -0
- package/dist/preview/server.js.map +1 -0
- package/dist/toolchain/probe.d.ts +41 -0
- package/dist/toolchain/probe.d.ts.map +1 -0
- package/dist/toolchain/probe.js +135 -0
- package/dist/toolchain/probe.js.map +1 -0
- package/dist/version.d.ts +5 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +19 -0
- package/dist/version.js.map +1 -0
- package/package.json +54 -4
package/LICENSE-APACHE
ADDED
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the Licensor as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated into the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works thereof a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright notices, patent notices,
|
|
102
|
+
trademark notices, and attribution notices from the Source
|
|
103
|
+
form of the Work, excluding those notices that do not
|
|
104
|
+
pertain to any part of the Work; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "Notice" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the Notice file within such
|
|
109
|
+
Derivative Works, in at least one of the following places: within
|
|
110
|
+
a Notice file distributed as part of the Derivative Works; within
|
|
111
|
+
the Source form or documentation files; or, within a display
|
|
112
|
+
generated by the Derivative Works, if and wherever such
|
|
113
|
+
third-party notices belong. The contents of the Notice file
|
|
114
|
+
are for informational purposes only and do not modify the
|
|
115
|
+
License. You may add Your own Notice files within Derivative
|
|
116
|
+
Works, provided that such additional Notice files cannot be
|
|
117
|
+
construed as modifying the License.
|
|
118
|
+
|
|
119
|
+
You may add Your own copyright notice to Your own modifications and
|
|
120
|
+
may provide additional or different licensing terms and conditions
|
|
121
|
+
for use, reproduction, or distribution of Your own modifications, or
|
|
122
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
123
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
124
|
+
the conditions stated in this License.
|
|
125
|
+
|
|
126
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
127
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
128
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
129
|
+
this License, without any additional terms or conditions.
|
|
130
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
131
|
+
the terms of any separate legal agreement you may have executed
|
|
132
|
+
with Licensor regarding such Contributions.
|
|
133
|
+
|
|
134
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
135
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
136
|
+
except as required for reasonable and customary use in describing the
|
|
137
|
+
origin of the Work and reproducing the content of the Notice file.
|
|
138
|
+
|
|
139
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
140
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
141
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
142
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
143
|
+
implied, including, without limitation, any warranties or conditions
|
|
144
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A
|
|
145
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
146
|
+
judgment of the appropriateness of using or redistributing the Work
|
|
147
|
+
and assume any risks associated with Your exercise of the permissions
|
|
148
|
+
under this License.
|
|
149
|
+
|
|
150
|
+
8. Limitation of Liability. In no event and under no theory of
|
|
151
|
+
liability, whether in contract, tort, or otherwise, unless required
|
|
152
|
+
by applicable law (such as deliberate and gross negligent acts) or
|
|
153
|
+
agreed to in writing, shall any Contributor be liable to You for
|
|
154
|
+
damages, including any direct, indirect, or consequential damages of
|
|
155
|
+
any kind, including but not limited to damages for loss of data,
|
|
156
|
+
lost profits, or business interruption, arising out of the use or
|
|
157
|
+
replacement of the Work, even if applicable law or agreed to in
|
|
158
|
+
writing has been advised of the possibility of such damages.
|
|
159
|
+
|
|
160
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
161
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
162
|
+
and accept a reasonable fee for, intellectual property conditions
|
|
163
|
+
or additional warranty obligations, including indemnity or
|
|
164
|
+
liability obligations and/or rights consistent with this License.
|
|
165
|
+
However, in accepting such obligations, You may act only on Your
|
|
166
|
+
own behalf and on Your sole responsibility, and not on behalf of
|
|
167
|
+
any other Contributor, and only if You agree to indemnify, defend,
|
|
168
|
+
and hold each Contributor harmless for any liability incurred by,
|
|
169
|
+
or claims asserted against, any Contributor by reason of your
|
|
170
|
+
accepting any such warranty or additional liability.
|
|
171
|
+
|
|
172
|
+
END OF TERMS AND CONDITIONS
|
|
173
|
+
|
|
174
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
175
|
+
|
|
176
|
+
To apply the Apache License to your work, attach the following
|
|
177
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
178
|
+
replaced with your own information. (Don't include the brackets!)
|
|
179
|
+
The text should be enclosed in the appropriate comment syntax for
|
|
180
|
+
the file format. We also recommend that you include a file named
|
|
181
|
+
"LICENSE" or "LICENSE-APACHE" in the same directory as the file
|
|
182
|
+
you are applying the License to.
|
|
183
|
+
|
|
184
|
+
Copyright 2026 Andrew Parker
|
|
185
|
+
|
|
186
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
187
|
+
you may not use this file except in compliance with the License.
|
|
188
|
+
You may obtain a copy of the License at
|
|
189
|
+
|
|
190
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
191
|
+
|
|
192
|
+
Unless required by applicable law or agreed to in writing, software
|
|
193
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
194
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
195
|
+
See the License for the specific language governing permissions and
|
|
196
|
+
limitations under the License.
|
package/LICENSE-MIT
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Andrew Parker
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,95 @@
|
|
|
1
|
-
#
|
|
1
|
+
# `sceneshard`
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](#license)
|
|
4
|
+
|
|
5
|
+
Zero-dependency CLI, config SDK, and local COOP/COEP preview server for **Godot 4 Web** exports — part of [SceneShard](https://sceneshard.dev).
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
Run directly with `npx` (requires **Node.js >= 22.15.0**):
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npx sceneshard --help
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Or install as a dev dependency:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
pnpm add -D sceneshard
|
|
19
|
+
# or
|
|
20
|
+
npm install --save-dev sceneshard
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Commands
|
|
24
|
+
|
|
25
|
+
### `sceneshard init`
|
|
26
|
+
|
|
27
|
+
Detects and parses `project.godot` and `export_presets.cfg` in your Godot 4 project and scaffolds a typed `sceneshard.config.ts`.
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
sceneshard init
|
|
31
|
+
sceneshard init --dir ./my-game --hosting byoc --force
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### `sceneshard doctor`
|
|
35
|
+
|
|
36
|
+
Validates your Godot 4 project and Web export readiness:
|
|
37
|
+
|
|
38
|
+
- Parses and validates `project.godot` (Godot 4 `config_version=5`, project name, features) and `sceneshard.config.ts`.
|
|
39
|
+
- Inspects `export_presets.cfg` for real Godot 4 Web misconfigurations (missing Web preset, unconfigured `export_path`, `variant/thread_support` and `variant/extensions_support` cross-origin isolation requirements).
|
|
40
|
+
- Checks local toolchain availability (`godot`/`godot4` binary & Web export templates, `node`, and `cf`/`wrangler`) with actionable remediation hints.
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
sceneshard doctor
|
|
44
|
+
sceneshard doctor --json
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### `sceneshard preview [dir]`
|
|
48
|
+
|
|
49
|
+
Zero-dependency local HTTP preview server for exported Godot 4 Web builds—replacing Godot's manual `platform/web/serve.py` script.
|
|
50
|
+
|
|
51
|
+
- Resolves directory from `[dir]`, `sceneshard.config.ts` (`web.exportDir`), or `export_presets.cfg` (`export_path`).
|
|
52
|
+
- Sends `Cross-Origin-Opener-Policy: same-origin` and `Cross-Origin-Embedder-Policy: require-corp` by default so threaded and GDExtension (`SharedArrayBuffer`) Web builds work out of the box.
|
|
53
|
+
- Pass `--no-coop-coep` to test non-isolated hosts.
|
|
54
|
+
- Serves accurate MIME types (`application/wasm`, `.pck`, `.js`, `.json`, `.svg`, etc.), `Cache-Control: no-store`, and strict path-traversal protection.
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
sceneshard preview
|
|
58
|
+
sceneshard preview ./build/web --port 8080 --host 127.0.0.1 --open
|
|
59
|
+
sceneshard preview ./build/web --no-coop-coep
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Config SDK (`defineConfig`)
|
|
63
|
+
|
|
64
|
+
```ts
|
|
65
|
+
import { defineConfig } from "sceneshard";
|
|
66
|
+
|
|
67
|
+
export default defineConfig({
|
|
68
|
+
project: {
|
|
69
|
+
name: "Starlight Drift",
|
|
70
|
+
slug: "starlight-drift",
|
|
71
|
+
},
|
|
72
|
+
web: {
|
|
73
|
+
preset: "Web",
|
|
74
|
+
exportDir: "build/web",
|
|
75
|
+
godotVersion: "4.4",
|
|
76
|
+
},
|
|
77
|
+
hosting: {
|
|
78
|
+
mode: "hosted",
|
|
79
|
+
},
|
|
80
|
+
preview: {
|
|
81
|
+
host: "127.0.0.1",
|
|
82
|
+
port: 8080,
|
|
83
|
+
coopCoep: true,
|
|
84
|
+
},
|
|
85
|
+
});
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## License
|
|
89
|
+
|
|
90
|
+
Dual-licensed under either of:
|
|
91
|
+
|
|
92
|
+
- **MIT License** ([`LICENSE-MIT`](./LICENSE-MIT))
|
|
93
|
+
- **Apache License, Version 2.0** ([`LICENSE-APACHE`](./LICENSE-APACHE))
|
|
94
|
+
|
|
95
|
+
at your option.
|
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAmFA,wBAAsB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CA4J5D"}
|
package/dist/cli.js
ADDED
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { realpathSync } from "node:fs";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
import { parseArgs } from "node:util";
|
|
5
|
+
import { formatDoctorReport, runDoctor } from "./commands/doctor.js";
|
|
6
|
+
import { formatInitReport, runInit } from "./commands/init.js";
|
|
7
|
+
import { startPreviewCommand } from "./commands/preview.js";
|
|
8
|
+
import { getCliVersion } from "./version.js";
|
|
9
|
+
const ROOT_HELP = `sceneshard v${getCliVersion()} — Edge hosting, streamed assets, and serverless multiplayer for Godot.
|
|
10
|
+
|
|
11
|
+
Usage:
|
|
12
|
+
sceneshard <command> [options]
|
|
13
|
+
|
|
14
|
+
Commands:
|
|
15
|
+
init Detect project.godot & export_presets.cfg and scaffold sceneshard.config.ts
|
|
16
|
+
doctor Validate project.godot, sceneshard.config.ts, Web export presets & toolchain
|
|
17
|
+
preview [dir] Start a local COOP/COEP HTTP preview server for exported Godot 4 Web builds
|
|
18
|
+
|
|
19
|
+
Global options:
|
|
20
|
+
-h, --help Show help
|
|
21
|
+
-v, --version Show CLI version
|
|
22
|
+
|
|
23
|
+
Run \`sceneshard <command> --help\` for command-specific options.`;
|
|
24
|
+
const INIT_HELP = `Usage: sceneshard init [options]
|
|
25
|
+
|
|
26
|
+
Detect project.godot and export_presets.cfg and scaffold a typed sceneshard.config.ts.
|
|
27
|
+
|
|
28
|
+
Options:
|
|
29
|
+
--dir <path> Godot project root directory (default: current directory)
|
|
30
|
+
--preset <name> Web export preset name override
|
|
31
|
+
--export-dir <path> Web export output directory override
|
|
32
|
+
--hosting <mode> Hosting mode: "hosted" (default) or "byoc"
|
|
33
|
+
--force Overwrite an existing sceneshard.config.ts
|
|
34
|
+
-h, --help Show this help`;
|
|
35
|
+
const DOCTOR_HELP = `Usage: sceneshard doctor [options]
|
|
36
|
+
|
|
37
|
+
Validate project.godot, sceneshard.config.ts, Godot 4 Web export presets, and local toolchain.
|
|
38
|
+
|
|
39
|
+
Options:
|
|
40
|
+
--dir <path> Godot project root directory (default: current directory)
|
|
41
|
+
--config <path> Explicit path to sceneshard.config.ts
|
|
42
|
+
--json Output machine-readable JSON diagnostics
|
|
43
|
+
-h, --help Show this help`;
|
|
44
|
+
const PREVIEW_HELP = `Usage: sceneshard preview [dir] [options]
|
|
45
|
+
|
|
46
|
+
Serve an exported Godot 4 Web build locally with COOP/COEP headers for SharedArrayBuffer support.
|
|
47
|
+
|
|
48
|
+
Arguments:
|
|
49
|
+
[dir] Optional directory to serve (falls back to sceneshard.config.ts or export_presets.cfg)
|
|
50
|
+
|
|
51
|
+
Options:
|
|
52
|
+
--dir <path> Project directory used to resolve config/presets (default: current directory)
|
|
53
|
+
--config <path> Explicit path to sceneshard.config.ts
|
|
54
|
+
--port <number> Port to listen on (default: 8080; 0 picks an ephemeral port)
|
|
55
|
+
--host <host> Host interface to bind (default: 127.0.0.1)
|
|
56
|
+
--no-coop-coep Disable Cross-Origin-Opener-Policy and Cross-Origin-Embedder-Policy headers
|
|
57
|
+
--coop-coep Explicitly enable COOP/COEP headers (overrides config)
|
|
58
|
+
--open Open the preview URL in the default browser
|
|
59
|
+
-h, --help Show this help`;
|
|
60
|
+
function parsePortOption(raw) {
|
|
61
|
+
if (!/^\d+$/.test(raw)) {
|
|
62
|
+
throw new Error(`Invalid --port value "${raw}". Expected an integer between 0 and 65535.`);
|
|
63
|
+
}
|
|
64
|
+
const port = Number(raw);
|
|
65
|
+
if (!Number.isInteger(port) || port < 0 || port > 65535) {
|
|
66
|
+
throw new Error(`Invalid --port value "${raw}". Expected an integer between 0 and 65535.`);
|
|
67
|
+
}
|
|
68
|
+
return port;
|
|
69
|
+
}
|
|
70
|
+
function parseHostingOption(raw) {
|
|
71
|
+
if (raw !== "hosted" && raw !== "byoc") {
|
|
72
|
+
throw new Error(`Invalid --hosting value "${raw}". Expected "hosted" or "byoc".`);
|
|
73
|
+
}
|
|
74
|
+
return raw;
|
|
75
|
+
}
|
|
76
|
+
export async function runCli(argv) {
|
|
77
|
+
const first = argv[0];
|
|
78
|
+
if (!first || first === "-h" || first === "--help" || first === "help") {
|
|
79
|
+
console.log(ROOT_HELP);
|
|
80
|
+
return 0;
|
|
81
|
+
}
|
|
82
|
+
if (first === "-v" || first === "--version") {
|
|
83
|
+
console.log(getCliVersion());
|
|
84
|
+
return 0;
|
|
85
|
+
}
|
|
86
|
+
const subArgs = argv.slice(1);
|
|
87
|
+
switch (first) {
|
|
88
|
+
case "init": {
|
|
89
|
+
const parsed = parseArgs({
|
|
90
|
+
args: subArgs,
|
|
91
|
+
strict: true,
|
|
92
|
+
allowPositionals: false,
|
|
93
|
+
options: {
|
|
94
|
+
dir: { type: "string" },
|
|
95
|
+
preset: { type: "string" },
|
|
96
|
+
"export-dir": { type: "string" },
|
|
97
|
+
hosting: { type: "string" },
|
|
98
|
+
force: { type: "boolean", default: false },
|
|
99
|
+
help: { type: "boolean", short: "h", default: false },
|
|
100
|
+
},
|
|
101
|
+
});
|
|
102
|
+
if (parsed.values.help) {
|
|
103
|
+
console.log(INIT_HELP);
|
|
104
|
+
return 0;
|
|
105
|
+
}
|
|
106
|
+
const hosting = parsed.values.hosting ? parseHostingOption(parsed.values.hosting) : undefined;
|
|
107
|
+
const result = runInit({
|
|
108
|
+
...(parsed.values.dir ? { cwd: parsed.values.dir } : {}),
|
|
109
|
+
...(parsed.values.preset ? { preset: parsed.values.preset } : {}),
|
|
110
|
+
...(parsed.values["export-dir"] ? { exportDir: parsed.values["export-dir"] } : {}),
|
|
111
|
+
...(hosting ? { hosting } : {}),
|
|
112
|
+
force: parsed.values.force,
|
|
113
|
+
});
|
|
114
|
+
console.log(formatInitReport(result));
|
|
115
|
+
return 0;
|
|
116
|
+
}
|
|
117
|
+
case "doctor": {
|
|
118
|
+
const parsed = parseArgs({
|
|
119
|
+
args: subArgs,
|
|
120
|
+
strict: true,
|
|
121
|
+
allowPositionals: false,
|
|
122
|
+
options: {
|
|
123
|
+
dir: { type: "string" },
|
|
124
|
+
config: { type: "string" },
|
|
125
|
+
json: { type: "boolean", default: false },
|
|
126
|
+
help: { type: "boolean", short: "h", default: false },
|
|
127
|
+
},
|
|
128
|
+
});
|
|
129
|
+
if (parsed.values.help) {
|
|
130
|
+
console.log(DOCTOR_HELP);
|
|
131
|
+
return 0;
|
|
132
|
+
}
|
|
133
|
+
const report = await runDoctor({
|
|
134
|
+
...(parsed.values.dir ? { cwd: parsed.values.dir } : {}),
|
|
135
|
+
...(parsed.values.config ? { configFile: parsed.values.config } : {}),
|
|
136
|
+
});
|
|
137
|
+
if (parsed.values.json) {
|
|
138
|
+
console.log(JSON.stringify(report, null, 2));
|
|
139
|
+
}
|
|
140
|
+
else {
|
|
141
|
+
console.log(formatDoctorReport(report));
|
|
142
|
+
}
|
|
143
|
+
return report.ok ? 0 : 1;
|
|
144
|
+
}
|
|
145
|
+
case "preview": {
|
|
146
|
+
const parsed = parseArgs({
|
|
147
|
+
args: subArgs,
|
|
148
|
+
strict: true,
|
|
149
|
+
allowPositionals: true,
|
|
150
|
+
options: {
|
|
151
|
+
dir: { type: "string" },
|
|
152
|
+
config: { type: "string" },
|
|
153
|
+
port: { type: "string", short: "p" },
|
|
154
|
+
host: { type: "string" },
|
|
155
|
+
"no-coop-coep": { type: "boolean", default: false },
|
|
156
|
+
"coop-coep": { type: "boolean", default: false },
|
|
157
|
+
open: { type: "boolean", short: "o", default: false },
|
|
158
|
+
help: { type: "boolean", short: "h", default: false },
|
|
159
|
+
},
|
|
160
|
+
});
|
|
161
|
+
if (parsed.values.help) {
|
|
162
|
+
console.log(PREVIEW_HELP);
|
|
163
|
+
return 0;
|
|
164
|
+
}
|
|
165
|
+
if (parsed.positionals.length > 1) {
|
|
166
|
+
throw new Error(`Expected at most one directory argument, received ${parsed.positionals.length}.`);
|
|
167
|
+
}
|
|
168
|
+
if (parsed.values["no-coop-coep"] && parsed.values["coop-coep"]) {
|
|
169
|
+
throw new Error("Cannot pass both --coop-coep and --no-coop-coep.");
|
|
170
|
+
}
|
|
171
|
+
const coopCoep = parsed.values["no-coop-coep"]
|
|
172
|
+
? false
|
|
173
|
+
: parsed.values["coop-coep"]
|
|
174
|
+
? true
|
|
175
|
+
: undefined;
|
|
176
|
+
const port = parsed.values.port ? parsePortOption(parsed.values.port) : undefined;
|
|
177
|
+
const targetDir = parsed.positionals[0];
|
|
178
|
+
const started = await startPreviewCommand({
|
|
179
|
+
...(targetDir ? { targetDir } : {}),
|
|
180
|
+
...(parsed.values.dir ? { cwd: parsed.values.dir } : {}),
|
|
181
|
+
...(parsed.values.config ? { configFile: parsed.values.config } : {}),
|
|
182
|
+
...(port !== undefined ? { port } : {}),
|
|
183
|
+
...(parsed.values.host ? { host: parsed.values.host } : {}),
|
|
184
|
+
...(coopCoep !== undefined ? { coopCoep } : {}),
|
|
185
|
+
open: parsed.values.open,
|
|
186
|
+
});
|
|
187
|
+
await new Promise((resolveShutdown) => {
|
|
188
|
+
let closing = false;
|
|
189
|
+
const shutdown = () => {
|
|
190
|
+
if (closing) {
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
closing = true;
|
|
194
|
+
process.off("SIGINT", shutdown);
|
|
195
|
+
process.off("SIGTERM", shutdown);
|
|
196
|
+
void started.server.close().finally(() => resolveShutdown());
|
|
197
|
+
};
|
|
198
|
+
process.on("SIGINT", shutdown);
|
|
199
|
+
process.on("SIGTERM", shutdown);
|
|
200
|
+
});
|
|
201
|
+
return 0;
|
|
202
|
+
}
|
|
203
|
+
default: {
|
|
204
|
+
console.error(`Unknown command: "${first}"\n`);
|
|
205
|
+
console.error(ROOT_HELP);
|
|
206
|
+
return 1;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
function isDirectExecution() {
|
|
211
|
+
const entry = process.argv[1];
|
|
212
|
+
if (!entry) {
|
|
213
|
+
return false;
|
|
214
|
+
}
|
|
215
|
+
try {
|
|
216
|
+
return realpathSync(entry) === realpathSync(fileURLToPath(import.meta.url));
|
|
217
|
+
}
|
|
218
|
+
catch {
|
|
219
|
+
return false;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
if (isDirectExecution()) {
|
|
223
|
+
runCli(process.argv.slice(2))
|
|
224
|
+
.then((code) => {
|
|
225
|
+
process.exitCode = code;
|
|
226
|
+
})
|
|
227
|
+
.catch((error) => {
|
|
228
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
229
|
+
console.error(`Error: ${message}`);
|
|
230
|
+
process.exitCode = 1;
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,kBAAkB,EAAE,SAAS,EAAE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C,MAAM,CAAC,KAAK,CAAC,CAAC;QACvE,OAAO,CAAC,KAAK,CAAC,UAAU,OAAO,EAAE,CAAC,CAAC;QACnC,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;IACvB,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { type ToolchainProber } from "../toolchain/probe.js";
|
|
2
|
+
export type CheckStatus = "pass" | "warn" | "fail" | "info";
|
|
3
|
+
export type CheckCategory = "project" | "config" | "web-export" | "toolchain";
|
|
4
|
+
export interface DoctorCheck {
|
|
5
|
+
id: string;
|
|
6
|
+
category: CheckCategory;
|
|
7
|
+
status: CheckStatus;
|
|
8
|
+
title: string;
|
|
9
|
+
message: string;
|
|
10
|
+
remediation?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface DoctorSummary {
|
|
13
|
+
pass: number;
|
|
14
|
+
warn: number;
|
|
15
|
+
fail: number;
|
|
16
|
+
info: number;
|
|
17
|
+
}
|
|
18
|
+
export interface DoctorReport {
|
|
19
|
+
ok: boolean;
|
|
20
|
+
cwd: string;
|
|
21
|
+
checks: DoctorCheck[];
|
|
22
|
+
summary: DoctorSummary;
|
|
23
|
+
}
|
|
24
|
+
export interface DoctorOptions {
|
|
25
|
+
/** Project directory to inspect (defaults to `process.cwd()`). */
|
|
26
|
+
cwd?: string;
|
|
27
|
+
/** Optional explicit path to `sceneshard.config.ts`. */
|
|
28
|
+
configFile?: string;
|
|
29
|
+
/** Injectable local toolchain prober (defaults to `probeLocalToolchain`). */
|
|
30
|
+
probeToolchain?: ToolchainProber;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Runs SceneShard project, Web export preset, and local toolchain diagnostics.
|
|
34
|
+
*/
|
|
35
|
+
export declare function runDoctor(options?: DoctorOptions): Promise<DoctorReport>;
|
|
36
|
+
/**
|
|
37
|
+
* Formats a `DoctorReport` for human-readable terminal display.
|
|
38
|
+
*/
|
|
39
|
+
export declare function formatDoctorReport(report: DoctorReport): string;
|
|
40
|
+
//# sourceMappingURL=doctor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../src/commands/doctor.ts"],"names":[],"mappings":"AAWA,OAAO,EAAuB,KAAK,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAElF,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;AAE5D,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,QAAQ,GAAG,YAAY,GAAG,WAAW,CAAC;AAE9E,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,aAAa,CAAC;IACxB,MAAM,EAAE,WAAW,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,OAAO,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,WAAW,EAAE,CAAC;IACtB,OAAO,EAAE,aAAa,CAAC;CACxB;AAED,MAAM,WAAW,aAAa;IAC5B,kEAAkE;IAClE,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,wDAAwD;IACxD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,6EAA6E;IAC7E,cAAc,CAAC,EAAE,eAAe,CAAC;CAClC;AA6BD;;GAEG;AACH,wBAAsB,SAAS,CAAC,OAAO,GAAE,aAAkB,GAAG,OAAO,CAAC,YAAY,CAAC,CAiZlF;AAgBD;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAA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