@maka/maka-cli 5.55.0 → 5.57.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/bundle/typescript/package.json +8 -6
- package/bundle/typescript/src/commands/create.js +2 -4
- package/bundle/typescript/src/commands/create.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/note.js +9 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/note.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/factories/scene-chunks.d.ts +40 -1
- package/bundle/typescript/src/commands/game/sideQuest/factories/scene-chunks.js +395 -2
- package/bundle/typescript/src/commands/game/sideQuest/factories/scene-chunks.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/factories/scene-seed-generator.js +25 -4
- package/bundle/typescript/src/commands/game/sideQuest/factories/scene-seed-generator.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/game.d.ts +4 -0
- package/bundle/typescript/src/commands/game/sideQuest/game.js +20 -1
- package/bundle/typescript/src/commands/game/sideQuest/game.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/models/npc.js +38 -1
- package/bundle/typescript/src/commands/game/sideQuest/models/npc.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/ui.d.ts +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/ui.js +22 -14
- package/bundle/typescript/src/commands/game/sideQuest/ui.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/utilities/generation-capture.d.ts +69 -0
- package/bundle/typescript/src/commands/game/sideQuest/utilities/generation-capture.js +64 -0
- package/bundle/typescript/src/commands/game/sideQuest/utilities/generation-capture.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/utilities/shared-run.js +32 -11
- package/bundle/typescript/src/commands/game/sideQuest/utilities/shared-run.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest.sub.cmd.js +11 -6
- package/bundle/typescript/src/commands/game/sideQuest.sub.cmd.js.map +1 -1
- package/bundle/typescript/src/commands/version/version.js +2 -4
- package/bundle/typescript/src/commands/version/version.js.map +1 -1
- package/bundle/typescript/src/maka.js +48 -7
- package/bundle/typescript/src/maka.js.map +1 -1
- package/bundle/typescript/src/templates/meteor/config/deploy.sh.template +31 -3
- package/bundle/typescript/src/tools/fsi/fsi.class.js +2 -2
- package/bundle/typescript/src/tools/fsi/fsi.class.js.map +1 -1
- package/bundle/typescript/src/tools/mpi/mpi.class.js +12 -12
- package/bundle/typescript/src/tools/mpi/mpi.class.js.map +1 -1
- package/bundle/typescript/src/tools/mpi/sdk-runtime.d.ts +1 -1
- package/bundle/typescript/src/tools/mpi/sdk-runtime.js +37 -1
- package/bundle/typescript/src/tools/mpi/sdk-runtime.js.map +1 -1
- package/bundle/typescript/src/tools/sdk-loader/runtime-fetch.d.ts +13 -0
- package/bundle/typescript/src/tools/sdk-loader/runtime-fetch.js +194 -0
- package/bundle/typescript/src/tools/sdk-loader/runtime-fetch.js.map +1 -0
- package/bundle/typescript/src/tools/sdk-loader/sdk-loader.class.d.ts +33 -0
- package/bundle/typescript/src/tools/sdk-loader/sdk-loader.class.js +217 -0
- package/bundle/typescript/src/tools/sdk-loader/sdk-loader.class.js.map +1 -0
- package/bundle/typescript/src/tools/version/cli-version.d.ts +10 -0
- package/bundle/typescript/src/tools/version/cli-version.js +49 -0
- package/bundle/typescript/src/tools/version/cli-version.js.map +1 -0
- package/package.json +8 -6
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
// Finds @maka/meteor-sdk, wherever this copy of maka is running from.
|
|
2
|
+
//
|
|
3
|
+
// Two layouts exist and both have to work:
|
|
4
|
+
//
|
|
5
|
+
// npm install -- the SDK is an ordinary dependency in node_modules next
|
|
6
|
+
// to this module. Nothing here does any work; resolution
|
|
7
|
+
// succeeds on the first try and no download ever happens.
|
|
8
|
+
// executable -- there is no node_modules. The SDK (and a Node runtime
|
|
9
|
+
// for it to spawn) live under ~/.meteor/.maka/runtime/,
|
|
10
|
+
// fetched on first use by runtime-fetch.ts.
|
|
11
|
+
//
|
|
12
|
+
// Everything funnels through ensureSdkAvailable(), which tools/mpi/
|
|
13
|
+
// sdk-runtime.ts calls before the SDK's first use.
|
|
14
|
+
import fs from 'fs';
|
|
15
|
+
import path from 'path';
|
|
16
|
+
import Module, { createRequire } from 'module';
|
|
17
|
+
import { fileURLToPath } from 'url';
|
|
18
|
+
import { Log } from '../log/log.class.js';
|
|
19
|
+
import { Actions } from '../actions/actions.class.js';
|
|
20
|
+
import { sdkRange } from '../version/cli-version.js';
|
|
21
|
+
import { ensureSdkInstalled, fetchedNodeBinary, ensureNode, sdkPrefixFor } from './runtime-fetch.js';
|
|
22
|
+
// Split into parts on purpose. The packager statically scans for literal
|
|
23
|
+
// specifiers inside require()/require.resolve() calls, and a single
|
|
24
|
+
// '@maka/meteor-sdk' string in such a position makes it decide the entire
|
|
25
|
+
// toolchain is a build-time dependency and bake it into the snapshot
|
|
26
|
+
// -- observed once as a 247MB executable containing a read-only copy of a
|
|
27
|
+
// tree that Meteor's build has to WRITE to. Everything below resolves the
|
|
28
|
+
// SDK by walking the filesystem instead of asking Node's resolver, so no
|
|
29
|
+
// traceable specifier exists anywhere in this module.
|
|
30
|
+
const SDK_SCOPE = '@maka';
|
|
31
|
+
const SDK_PACKAGE = 'meteor-sdk';
|
|
32
|
+
/** True when running from an executable produced by the packager rather than
|
|
33
|
+
* from an npm install. */
|
|
34
|
+
export function isPackaged() {
|
|
35
|
+
return Boolean(process.pkg);
|
|
36
|
+
}
|
|
37
|
+
let resolvedRoot;
|
|
38
|
+
/** The directory of the installed @maka/meteor-sdk package, or undefined if
|
|
39
|
+
* it isn't anywhere yet. Never downloads -- see ensureSdkAvailable(). */
|
|
40
|
+
export function findSdkRoot() {
|
|
41
|
+
if (resolvedRoot) {
|
|
42
|
+
return resolvedRoot;
|
|
43
|
+
}
|
|
44
|
+
// The npm layout: walk up from this module looking for the package inside
|
|
45
|
+
// a node_modules. Inside an executable the walk starts in the snapshot and
|
|
46
|
+
// finds nothing, which is exactly the signal to look in the runtime
|
|
47
|
+
// directory instead.
|
|
48
|
+
let dir = path.dirname(fileURLToPath(import.meta.url));
|
|
49
|
+
for (;;) {
|
|
50
|
+
const candidate = path.join(dir, 'node_modules', SDK_SCOPE, SDK_PACKAGE);
|
|
51
|
+
if (fs.existsSync(path.join(candidate, 'package.json'))) {
|
|
52
|
+
resolvedRoot = candidate;
|
|
53
|
+
return resolvedRoot;
|
|
54
|
+
}
|
|
55
|
+
const parent = path.dirname(dir);
|
|
56
|
+
if (parent === dir) {
|
|
57
|
+
break;
|
|
58
|
+
}
|
|
59
|
+
dir = parent;
|
|
60
|
+
}
|
|
61
|
+
const fetched = path.join(sdkPrefixFor(sdkRange()), 'node_modules', SDK_SCOPE, SDK_PACKAGE);
|
|
62
|
+
if (fs.existsSync(path.join(fetched, 'package.json'))) {
|
|
63
|
+
resolvedRoot = fetched;
|
|
64
|
+
return resolvedRoot;
|
|
65
|
+
}
|
|
66
|
+
return undefined;
|
|
67
|
+
}
|
|
68
|
+
function sdkRequire() {
|
|
69
|
+
const root = findSdkRoot();
|
|
70
|
+
if (!root) {
|
|
71
|
+
throw new Error(`The Meteor toolchain (${SDK_SCOPE}/${SDK_PACKAGE}) is not installed. ` +
|
|
72
|
+
'Run any Meteor command (e.g. `maka create`) to fetch it.');
|
|
73
|
+
}
|
|
74
|
+
// Anchored inside the SDK's own directory so its internal dependencies
|
|
75
|
+
// resolve through its node_modules rather than this CLI's.
|
|
76
|
+
return createRequire(path.join(root, 'index.js'));
|
|
77
|
+
}
|
|
78
|
+
/** require() a file out of the resolved SDK, by a path RELATIVE TO THE SDK
|
|
79
|
+
* ROOT (e.g. 'tools/runners/run-mongo.js').
|
|
80
|
+
*
|
|
81
|
+
* Relative-to-root rather than a package specifier so no traceable literal
|
|
82
|
+
* exists at the call sites either -- see the note on SDK_SCOPE above.
|
|
83
|
+
* Resolving to an absolute path still runs the file through the SDK's own
|
|
84
|
+
* Babel/.ts require hook, which is the part that matters; see the comment
|
|
85
|
+
* in tools/mpi/mpi.class.ts. */
|
|
86
|
+
export function requireFromSdk(relativePath) {
|
|
87
|
+
const root = findSdkRoot();
|
|
88
|
+
return sdkRequire()(path.join(root, relativePath));
|
|
89
|
+
}
|
|
90
|
+
/** The SDK's own entry point -- required as a directory, so Node reads the
|
|
91
|
+
* `main` out of its package.json rather than this code hardcoding it. */
|
|
92
|
+
export function requireSdk() {
|
|
93
|
+
const root = findSdkRoot();
|
|
94
|
+
const mod = sdkRequire()(root);
|
|
95
|
+
return mod?.default ?? mod;
|
|
96
|
+
}
|
|
97
|
+
let fetchDeclined = false;
|
|
98
|
+
/** Makes sure the SDK is on disk, downloading it if this is a packaged build
|
|
99
|
+
* and it isn't there yet. Also points process.execPath at a real Node for
|
|
100
|
+
* packaged builds -- see applyExecPathOverride(). */
|
|
101
|
+
export async function ensureSdkAvailable() {
|
|
102
|
+
installInspectorShim();
|
|
103
|
+
const existing = findSdkRoot();
|
|
104
|
+
if (existing) {
|
|
105
|
+
await applyExecPathOverride();
|
|
106
|
+
return existing;
|
|
107
|
+
}
|
|
108
|
+
if (!isPackaged()) {
|
|
109
|
+
// An npm install with a missing dependency is a broken install, not
|
|
110
|
+
// something to paper over with a download.
|
|
111
|
+
throw new Error('@maka/meteor-sdk could not be resolved. Try reinstalling maka ' +
|
|
112
|
+
'(`npm i -g @maka/maka-cli`).');
|
|
113
|
+
}
|
|
114
|
+
if (fetchDeclined) {
|
|
115
|
+
throw new Error('The Meteor toolchain is required for this command.');
|
|
116
|
+
}
|
|
117
|
+
Log.notice('This command needs the Meteor toolchain, which is not bundled into the ' +
|
|
118
|
+
'maka executable -- it is a large tree that Meteor builds read and write ' +
|
|
119
|
+
'directly, so it has to live on disk.');
|
|
120
|
+
const proceed = await Actions.confirm('Download the Meteor toolchain now (~265MB, one time)?', true);
|
|
121
|
+
if (!proceed) {
|
|
122
|
+
fetchDeclined = true;
|
|
123
|
+
throw new Error('The Meteor toolchain is required for this command.');
|
|
124
|
+
}
|
|
125
|
+
await ensureSdkInstalled(sdkRange());
|
|
126
|
+
resolvedRoot = undefined; // force a re-resolve now that it exists
|
|
127
|
+
const root = findSdkRoot();
|
|
128
|
+
if (!root) {
|
|
129
|
+
throw new Error('The Meteor toolchain was installed but still cannot be resolved.');
|
|
130
|
+
}
|
|
131
|
+
await applyExecPathOverride();
|
|
132
|
+
return root;
|
|
133
|
+
}
|
|
134
|
+
let inspectorShimmed = false;
|
|
135
|
+
/** Satisfies `import * as inspector from 'inspector'` inside a packaged
|
|
136
|
+
* executable, where that module does not exist.
|
|
137
|
+
*
|
|
138
|
+
* The packager's Node is built without the V8 inspector, so requiring it
|
|
139
|
+
* throws ERR_INSPECTOR_NOT_AVAILABLE. The SDK's tools/tool-env/profile.ts
|
|
140
|
+
* imports it at module scope (line 184) and profile.ts is loaded by the
|
|
141
|
+
* tool's core, so EVERY SDK-backed command died on import -- `maka build`
|
|
142
|
+
* printed nothing but "Inspector is not available".
|
|
143
|
+
*
|
|
144
|
+
* Nothing actually calls into it unless the developer opts into CPU
|
|
145
|
+
* profiling with METEOR_PROFILE; the whole failure was the import itself.
|
|
146
|
+
* So the stub lets the import succeed and throws only if profiling is
|
|
147
|
+
* genuinely attempted, where a clear message beats a silently dead
|
|
148
|
+
* profiler. The three members below are the entire surface profile.ts
|
|
149
|
+
* touches: inspector.open(), inspector.close(), new inspector.Session().
|
|
150
|
+
*
|
|
151
|
+
* `inspector` is the ONLY builtin the packaged runtime is missing -- all 38
|
|
152
|
+
* others the CLI or the SDK could plausibly reach for (worker_threads, vm,
|
|
153
|
+
* v8, perf_hooks, async_hooks, http2, diagnostics_channel, trace_events,
|
|
154
|
+
* crypto, cluster, tls, dgram, ...) load fine inside the executable. So this
|
|
155
|
+
* shim closes the whole gap rather than the first of many.
|
|
156
|
+
*
|
|
157
|
+
* No-op under an npm install, where the real module is present. */
|
|
158
|
+
function installInspectorShim() {
|
|
159
|
+
if (!isPackaged() || inspectorShimmed) {
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
const localRequire = createRequire(import.meta.url);
|
|
163
|
+
try {
|
|
164
|
+
localRequire('inspector');
|
|
165
|
+
return; // a real inspector exists; leave well alone
|
|
166
|
+
}
|
|
167
|
+
catch { /* build it a stand-in */ }
|
|
168
|
+
const unavailable = () => {
|
|
169
|
+
throw new Error('CPU profiling is not available in the packaged maka executable ' +
|
|
170
|
+
'(it is built without the V8 inspector). Use the npm install of maka ' +
|
|
171
|
+
'to profile: npm i -g @maka/maka-cli');
|
|
172
|
+
};
|
|
173
|
+
const stub = {
|
|
174
|
+
open: unavailable,
|
|
175
|
+
close: () => undefined, // called on cleanup paths; must stay harmless
|
|
176
|
+
url: () => undefined,
|
|
177
|
+
Session: class {
|
|
178
|
+
connect() { unavailable(); }
|
|
179
|
+
disconnect() { }
|
|
180
|
+
post() { unavailable(); }
|
|
181
|
+
on() { }
|
|
182
|
+
},
|
|
183
|
+
};
|
|
184
|
+
const moduleAny = Module;
|
|
185
|
+
const originalLoad = moduleAny._load;
|
|
186
|
+
moduleAny._load = function (request, parent, isMain) {
|
|
187
|
+
if (request === 'inspector' || request === 'node:inspector') {
|
|
188
|
+
return stub;
|
|
189
|
+
}
|
|
190
|
+
return originalLoad.call(this, request, parent, isMain);
|
|
191
|
+
};
|
|
192
|
+
inspectorShimmed = true;
|
|
193
|
+
}
|
|
194
|
+
let execPathOverridden = false;
|
|
195
|
+
/** Points process.execPath at a real Node executable when running packaged.
|
|
196
|
+
*
|
|
197
|
+
* The SDK reads process.execPath in four places and assumes it is node:
|
|
198
|
+
* it spawns the app server with it (tools/runners/run-app.js), derives the
|
|
199
|
+
* dev-bundle bin directory from it (tools/fs/files.ts getCurrentNodeBinDir,
|
|
200
|
+
* tools/utils/dev-bundle-env.js) and rebuilds native npm packages against it
|
|
201
|
+
* (tools/static-assets/server/npm-rebuild.js). Inside an executable it is
|
|
202
|
+
* the maka binary, which would re-enter the CLI instead of running a script.
|
|
203
|
+
*
|
|
204
|
+
* No-op under an npm install, where execPath already IS node. */
|
|
205
|
+
export async function applyExecPathOverride() {
|
|
206
|
+
if (!isPackaged() || execPathOverridden) {
|
|
207
|
+
return;
|
|
208
|
+
}
|
|
209
|
+
const node = fetchedNodeBinary() ?? await ensureNode();
|
|
210
|
+
Object.defineProperty(process, 'execPath', {
|
|
211
|
+
value: node,
|
|
212
|
+
configurable: true,
|
|
213
|
+
writable: true,
|
|
214
|
+
});
|
|
215
|
+
execPathOverridden = true;
|
|
216
|
+
}
|
|
217
|
+
//# sourceMappingURL=sdk-loader.class.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sdk-loader.class.js","sourceRoot":"","sources":["../../../../../src/tools/sdk-loader/sdk-loader.class.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,EAAE;AACF,2CAA2C;AAC3C,EAAE;AACF,2EAA2E;AAC3E,2EAA2E;AAC3E,4EAA4E;AAC5E,0EAA0E;AAC1E,0EAA0E;AAC1E,8DAA8D;AAC9D,EAAE;AACF,oEAAoE;AACpE,mDAAmD;AACnD,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,MAAM,EAAE,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAEpC,OAAO,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAErG,yEAAyE;AACzE,oEAAoE;AACpE,0EAA0E;AAC1E,qEAAqE;AACrE,0EAA0E;AAC1E,0EAA0E;AAC1E,yEAAyE;AACzE,sDAAsD;AACt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SAAS,EAAE,8CAA8C;QACtE,GAAG,EAAE,GAAG,EAAE,CAAC,SAAS;QACpB,OAAO,EAAE;YACP,OAAO,KAAK,WAAW,EAAE,CAAC,CAAC,CAAC;YAC5B,UAAU,KAAwB,CAAC;YACnC,IAAI,KAAK,WAAW,EAAE,CAAC,CAAC,CAAC;YACzB,EAAE,KAAwB,CAAC;SAC5B;KACF,CAAC;IAEF,MAAM,SAAS,GAAG,MAEjB,CAAC;IACF,MAAM,YAAY,GAAG,SAAS,CAAC,KAAK,CAAC;IACrC,SAAS,CAAC,KAAK,GAAG,UAAU,OAAO,EAAE,MAAM,EAAE,MAAM;QACjD,IAAI,OAAO,KAAK,WAAW,IAAI,OAAO,KAAK,gBAAgB,EAAE,CAAC;YAC5D,OAAO,IAAI,CAAC;QACd,CAAC;QACD,OAAO,YAAY,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IAC1D,CAAC,CAAC;IACF,gBAAgB,GAAG,IAAI,CAAC;AAC1B,CAAC;AAED,IAAI,kBAAkB,GAAG,KAAK,CAAC;AAE/B;;;;;;;;;kEASkE;AAClE,MAAM,CAAC,KAAK,UAAU,qBAAqB;IACzC,IAAI,CAAC,UAAU,EAAE,IAAI,kBAAkB,EAAE,CAAC;QACxC,OAAO;IACT,CAAC;IACD,MAAM,IAAI,GAAG,iBAAiB,EAAE,IAAI,MAAM,UAAU,EAAE,CAAC;IACvD,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,UAAU,EAAE;QACzC,KAAK,EAAE,IAAI;QACX,YAAY,EAAE,IAAI;QAClB,QAAQ,EAAE,IAAI;KACf,CAAC,CAAC;IACH,kBAAkB,GAAG,IAAI,CAAC;AAC5B,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** The version of the @maka/maka-cli package this process is running from. */
|
|
2
|
+
export declare function cliVersion(): string;
|
|
3
|
+
/** The semver range this CLI declares for @maka/meteor-sdk.
|
|
4
|
+
*
|
|
5
|
+
* A packaged executable has no node_modules to read the SDK out of, so it
|
|
6
|
+
* installs one on demand (tools/sdk-loader/) and needs to know which
|
|
7
|
+
* version this build expects. Kept here because it comes from the same
|
|
8
|
+
* package.json, through the same build-time substitution, as the version
|
|
9
|
+
* above. */
|
|
10
|
+
export declare function sdkRange(): string;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { createRequire } from 'module';
|
|
2
|
+
// Deliberately NOT named `require`: scripts/build-bundle.mjs rewrites
|
|
3
|
+
// createRequire aliases into real bundler requires, and this file is on
|
|
4
|
+
// its exclusion list precisely because the lookup below is dynamic.
|
|
5
|
+
const requireFromHere = createRequire(import.meta.url);
|
|
6
|
+
function readPackageJson() {
|
|
7
|
+
// Two depths: this file sits at src/tools/version/ in the source tree and
|
|
8
|
+
// at bundle/typescript/src/tools/version/ once compiled, with package.json
|
|
9
|
+
// copied alongside by the `prep` script. Both land on the same relative
|
|
10
|
+
// path, but the second candidate keeps an unusual layout from silently
|
|
11
|
+
// reporting 0.0.0-unknown.
|
|
12
|
+
for (const rel of ['../../../package.json', '../../../../package.json']) {
|
|
13
|
+
try {
|
|
14
|
+
const pkg = requireFromHere(rel);
|
|
15
|
+
if (pkg?.name === '@maka/maka-cli') {
|
|
16
|
+
return pkg;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
catch { /* try the next depth */ }
|
|
20
|
+
}
|
|
21
|
+
return undefined;
|
|
22
|
+
}
|
|
23
|
+
let cachedVersion;
|
|
24
|
+
let cachedSdkRange;
|
|
25
|
+
/** The version of the @maka/maka-cli package this process is running from. */
|
|
26
|
+
export function cliVersion() {
|
|
27
|
+
if (cachedVersion === undefined) {
|
|
28
|
+
cachedVersion = typeof __MAKA_PKG_VERSION__ === 'string'
|
|
29
|
+
? __MAKA_PKG_VERSION__
|
|
30
|
+
: readPackageJson()?.version ?? '0.0.0-unknown';
|
|
31
|
+
}
|
|
32
|
+
return cachedVersion;
|
|
33
|
+
}
|
|
34
|
+
/** The semver range this CLI declares for @maka/meteor-sdk.
|
|
35
|
+
*
|
|
36
|
+
* A packaged executable has no node_modules to read the SDK out of, so it
|
|
37
|
+
* installs one on demand (tools/sdk-loader/) and needs to know which
|
|
38
|
+
* version this build expects. Kept here because it comes from the same
|
|
39
|
+
* package.json, through the same build-time substitution, as the version
|
|
40
|
+
* above. */
|
|
41
|
+
export function sdkRange() {
|
|
42
|
+
if (cachedSdkRange === undefined) {
|
|
43
|
+
cachedSdkRange = typeof __MAKA_SDK_RANGE__ === 'string'
|
|
44
|
+
? __MAKA_SDK_RANGE__
|
|
45
|
+
: readPackageJson()?.dependencies?.['@maka/meteor-sdk'] ?? 'latest';
|
|
46
|
+
}
|
|
47
|
+
return cachedSdkRange;
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=cli-version.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-version.js","sourceRoot":"","sources":["../../../../../src/tools/version/cli-version.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAsBvC,sEAAsE;AACtE,wEAAwE;AACxE,oEAAoE;AACpE,MAAM,eAAe,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAEvD,SAAS,eAAe;IACtB,0EAA0E;IAC1E,2EAA2E;IAC3E,wEAAwE;IACxE,uEAAuE;IACvE,2BAA2B;IAC3B,KAAK,MAAM,GAAG,IAAI,CAAC,uBAAuB,EAAE,0BAA0B,CAAC,EAAE,CAAC;QACxE,IAAI,CAAC;YACH,MAAM,GAAG,GAAG,eAAe,CAAC,GAAG,CAAC,CAAC;YACjC,IAAI,GAAG,EAAE,IAAI,KAAK,gBAAgB,EAAE,CAAC;gBACnC,OAAO,GAAG,CAAC;YACb,CAAC;QACH,CAAC;QAAC,MAAM,CAAC,CAAC,wBAAwB,CAAC,CAAC;IACtC,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,IAAI,aAAiC,CAAC;AACtC,IAAI,cAAkC,CAAC;AAEvC,8EAA8E;AAC9E,MAAM,UAAU,UAAU;IACxB,IAAI,aAAa,KAAK,SAAS,EAAE,CAAC;QAChC,aAAa,GAAG,OAAO,oBAAoB,KAAK,QAAQ;YACtD,CAAC,CAAC,oBAAoB;YACtB,CAAC,CAAE,eAAe,EAAE,EAAE,OAAkB,IAAI,eAAe,CAAC;IAChE,CAAC;IACD,OAAO,aAAa,CAAC;AACvB,CAAC;AAED;;;;;;aAMa;AACb,MAAM,UAAU,QAAQ;IACtB,IAAI,cAAc,KAAK,SAAS,EAAE,CAAC;QACjC,cAAc,GAAG,OAAO,kBAAkB,KAAK,QAAQ;YACrD,CAAC,CAAC,kBAAkB;YACpB,CAAC,CAAE,eAAe,EAAE,EAAE,YAAY,EAAE,CAAC,kBAAkB,CAAY,IAAI,QAAQ,CAAC;IACpF,CAAC;IACD,OAAO,cAAc,CAAC;AACxB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maka/maka-cli",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.57.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"summary": "A command line tool for scaffolding Meteor 2.x applications using either React.",
|
|
6
6
|
"description": "A command line tool for scaffolding Meteor 2.x applications using React.",
|
|
@@ -25,12 +25,13 @@
|
|
|
25
25
|
"maka": "./typescript/src/maka.js",
|
|
26
26
|
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js",
|
|
27
27
|
"develop": "npm run build && concurrently \"tsc -w\" \"wait-on -d 10 ./src/exec.js && chmod +x ./src/exec.js\"",
|
|
28
|
-
"build": "rm -rf ./bundle && tsc && npm run prep && node scripts/check-command-registry.mjs",
|
|
28
|
+
"build": "node scripts/check-deps.mjs && rm -rf ./bundle && tsc && npm run prep && node scripts/check-command-registry.mjs",
|
|
29
|
+
"check:deps": "node scripts/check-deps.mjs",
|
|
29
30
|
"prep": " cp -R ./src/templates ./bundle/typescript/src/ && cp ./README.md ./bundle/typescript/src/ && cp ./package.json ./bundle/typescript/ && cp ./src/commands/game/sideQuest/scenes/*.json ./bundle/typescript/src/commands/game/sideQuest/scenes/ && chmod +x ./bundle/typescript/src/exec.js",
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"package": "pkg
|
|
33
|
-
"distribute": "
|
|
31
|
+
"build:bundle": "node scripts/build-bundle.mjs",
|
|
32
|
+
"test:parity": "node scripts/check-bundle-parity.mjs",
|
|
33
|
+
"package": "npm run build:bundle && pkg bundle/maka.cjs --config pkg.config.json --compress GZip --no-bytecode --public --public-packages \"*\"",
|
|
34
|
+
"distribute": "node scripts/distribute.mjs",
|
|
34
35
|
"prepare": "husky install"
|
|
35
36
|
},
|
|
36
37
|
"author": "Maka <maka@maka-cli.com>",
|
|
@@ -89,6 +90,7 @@
|
|
|
89
90
|
"@types/node": "^22.8.5",
|
|
90
91
|
"@types/uuid": "^10.0.0",
|
|
91
92
|
"@types/ws": "^8.18.1",
|
|
93
|
+
"@yao-pkg/pkg": "^6.22.0",
|
|
92
94
|
"concurrently": "^10.0.5",
|
|
93
95
|
"esbuild": "^0.28.2",
|
|
94
96
|
"eslint": "^9.13.0",
|