create-eigen-game 0.13.0 → 0.14.0
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/README.md +1 -1
- package/dist/cli.d.ts +1 -2
- package/dist/cli.js +466 -378
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +119 -108
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -27
- package/dist/src-B8zHulnO.js +836 -0
- package/dist/src-B8zHulnO.js.map +1 -0
- package/package.json +8 -8
- package/src/cli.ts +437 -0
- package/{dist/engine-range.d.ts → src/engine-range.ts} +23 -2
- package/src/index.ts +974 -0
- package/src/link-firebase.ts +70 -0
- package/src/prompt.ts +182 -0
- package/src/summary.ts +86 -0
- package/templates/app-overlay/lib/game/README.md +1 -1
- package/templates/app-overlay/lib/main.dart.template +12 -6
- package/templates/project/README.md +2 -2
- package/templates/project/package.json +3 -3
- package/templates/worker/.dev.vars.example +1 -0
- package/templates/worker/README.md +5 -2
- package/templates/worker/src/module/v1.ts +1 -0
- package/dist/chunk-L7EVXO3Y.js +0 -439
- package/dist/chunk-L7EVXO3Y.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/link-firebase.d.ts +0 -28
- package/dist/prompt.d.ts +0 -79
- package/dist/summary.d.ts +0 -26
|
@@ -7,8 +7,10 @@
|
|
|
7
7
|
* is not tested. `src/index.ts` uses it; the package `exports` map does not
|
|
8
8
|
* expose it, so it is internal despite being importable by the tests.
|
|
9
9
|
*/
|
|
10
|
+
|
|
10
11
|
/** The dependency whose version the scaffolder emits into the generated server. */
|
|
11
|
-
export
|
|
12
|
+
export const ENGINE_PACKAGE = "@eigeninteractive/server";
|
|
13
|
+
|
|
12
14
|
/**
|
|
13
15
|
* The engine range for a scaffolded project, from this package's own
|
|
14
16
|
* `@eigeninteractive/server` devDependency.
|
|
@@ -36,4 +38,23 @@ export declare const ENGINE_PACKAGE = "@eigeninteractive/server";
|
|
|
36
38
|
* @param declared the raw `@eigeninteractive/server` devDependency value
|
|
37
39
|
* @param readSiblingVersion consulted only for the `workspace:` protocol
|
|
38
40
|
*/
|
|
39
|
-
export
|
|
41
|
+
export function engineRange(declared: string | undefined, readSiblingVersion: () => string | undefined): string {
|
|
42
|
+
if (!declared) {
|
|
43
|
+
throw new Error(`create-eigen-game has no ${ENGINE_PACKAGE} devDependency, which is where the engine range it emits comes from`);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const version = declared.startsWith("workspace:") ? readSiblingVersion() : declared;
|
|
47
|
+
|
|
48
|
+
if (!version) {
|
|
49
|
+
throw new Error(`create-eigen-game declares ${ENGINE_PACKAGE} as "${declared}" but the workspace package could not be read, so there is no engine version to emit`);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// pnpm packs `workspace:*` as a bare version, which is what makes the caret
|
|
53
|
+
// below correct. Asserting it means a change in that behaviour fails here
|
|
54
|
+
// rather than emitting something like `^^0.3.0` into a real project.
|
|
55
|
+
if (!/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/.test(version)) {
|
|
56
|
+
throw new Error(`expected an exact ${ENGINE_PACKAGE} version to build a range from, got "${version}"`);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return `^${version}`;
|
|
60
|
+
}
|