@bitmagic/cli 0.1.10 → 0.1.12
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 +4 -0
- package/dist/commands/dev.js +33 -0
- package/dist/commands/dev.js.map +1 -1
- package/dist/commands/publish.d.ts +12 -0
- package/dist/commands/publish.js +40 -0
- package/dist/commands/publish.js.map +1 -1
- package/dist/project/engine-update.d.ts +28 -0
- package/dist/project/engine-update.js +56 -0
- package/dist/project/engine-update.js.map +1 -0
- package/dist/publish/client.d.ts +6 -0
- package/dist/publish/client.js.map +1 -1
- package/dist/scaffold/project-files.js +13 -1
- package/dist/scaffold/project-files.js.map +1 -1
- package/dist/smoke/harness.d.ts +26 -0
- package/dist/smoke/harness.js +58 -0
- package/dist/smoke/harness.js.map +1 -0
- package/dist/smoke/run.d.ts +33 -0
- package/dist/smoke/run.js +45 -0
- package/dist/smoke/run.js.map +1 -0
- package/dist/verify/browser.d.ts +10 -0
- package/dist/verify/browser.js +7 -1
- package/dist/verify/browser.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -107,9 +107,9 @@ invalidate the verify you just checked.
|
|
|
107
107
|
| 1 | Build failed |
|
|
108
108
|
| 2 | Not logged in |
|
|
109
109
|
| 3 | Verify missing, stale, or failed |
|
|
110
|
-
| 4 | Engine below the publish floor |
|
|
111
110
|
| 5 | Not the game's owner, or the account/game is banned |
|
|
112
111
|
| 6 | Upload or finalize failed — usually transient (network/storage), but also covers permanent failures such as an unknown game or a rejected request. Retry once; if it fails identically, stop and report it. |
|
|
112
|
+
| 7 | The game published, but did not render when loaded the way the portal loads it. The game IS live — fix it and publish again rather than retrying the publish. Artifacts in `.bitmagic/smoke/`. |
|
|
113
113
|
|
|
114
114
|
`bitmagic build` alone exits 1 on a build failure and 0 on success.
|
|
115
115
|
|
package/dist/cli.d.ts
CHANGED
|
@@ -121,6 +121,10 @@ declare const rawCommands: {
|
|
|
121
121
|
readonly type: "boolean";
|
|
122
122
|
readonly description: "Publish despite a stale or failed verify. Does NOT bypass a missing verify record.";
|
|
123
123
|
};
|
|
124
|
+
readonly 'skip-smoke': {
|
|
125
|
+
readonly type: "boolean";
|
|
126
|
+
readonly description: "Skip the post-publish render check. The game still publishes; it is simply not confirmed to render.";
|
|
127
|
+
};
|
|
124
128
|
}>;
|
|
125
129
|
};
|
|
126
130
|
type CommandName = keyof typeof rawCommands;
|
package/dist/commands/dev.js
CHANGED
|
@@ -3,6 +3,37 @@ import { spawn, spawnSync } from 'child_process';
|
|
|
3
3
|
import { CliError } from '../errors.js';
|
|
4
4
|
import { loadProjectContext, projectBin } from '../project/context.js';
|
|
5
5
|
import { waitForServer } from '../verify/wait-for-server.js';
|
|
6
|
+
import { engineUpdateNotice } from '../project/engine-update.js';
|
|
7
|
+
/**
|
|
8
|
+
* Tell the creator, once, if a newer engine exists — the one place where acting on it is cheap.
|
|
9
|
+
*
|
|
10
|
+
* Everything here is best-effort by design. `bitmagic dev` is otherwise fully offline: it needs no
|
|
11
|
+
* login and no network, and it must keep working on a plane, behind a proxy, or while logged out.
|
|
12
|
+
* So every failure path — not logged in, no network, unreadable manifest — produces silence. That
|
|
13
|
+
* is not a swallowed error: there is no operation to fail, only a hint we could not produce, and
|
|
14
|
+
* the caller's behaviour is identical either way.
|
|
15
|
+
*
|
|
16
|
+
* Deliberately not awaited by the caller: a slow manifest must never delay the dev server.
|
|
17
|
+
*/
|
|
18
|
+
async function notifyIfEngineOutdated(projectEngineVersion, log) {
|
|
19
|
+
try {
|
|
20
|
+
const [{ resolveEnvironment, resolveAuth0ClientId }, { getAccessToken }, { readDefaultEnvironment }, { fetchEngineManifest }] = await Promise.all([
|
|
21
|
+
import('../config/environments.js'),
|
|
22
|
+
import('../auth/session.js'),
|
|
23
|
+
import('../config/credentials.js'),
|
|
24
|
+
import('../scaffold/engine-download.js'),
|
|
25
|
+
]);
|
|
26
|
+
const environment = resolveEnvironment({ storedDefault: readDefaultEnvironment() });
|
|
27
|
+
const token = await getAccessToken(environment, resolveAuth0ClientId(environment), { fetch: globalThis.fetch, sleep: (ms) => new Promise((r) => setTimeout(r, ms)) });
|
|
28
|
+
const manifest = await fetchEngineManifest(environment, token, { fetch: globalThis.fetch });
|
|
29
|
+
const notice = engineUpdateNotice(projectEngineVersion, manifest.version);
|
|
30
|
+
if (notice !== null)
|
|
31
|
+
log(notice);
|
|
32
|
+
}
|
|
33
|
+
catch {
|
|
34
|
+
// See above: no login, no network, or no manifest all mean "no hint", never "dev failed".
|
|
35
|
+
}
|
|
36
|
+
}
|
|
6
37
|
const DEFAULT_PORT = 3010;
|
|
7
38
|
export const devCommand = defineCommand({
|
|
8
39
|
meta: { name: 'dev', description: 'Build the game, then serve it with live rebuilds.' },
|
|
@@ -24,6 +55,8 @@ export const devCommand = defineCommand({
|
|
|
24
55
|
if (build.status !== 0) {
|
|
25
56
|
throw new CliError('Build failed. Fix the errors above, then run `bitmagic dev` again.', build.status ?? 1);
|
|
26
57
|
}
|
|
58
|
+
// Fire and forget: the nudge must never gate or delay the server coming up.
|
|
59
|
+
void notifyIfEngineOutdated(context.metadata.engineVersion, (m) => console.log(m));
|
|
27
60
|
const children = [
|
|
28
61
|
{
|
|
29
62
|
name: 'tsc --watch',
|
package/dist/commands/dev.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dev.js","sourceRoot":"","sources":["../../src/commands/dev.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,KAAK,EAAE,SAAS,EAAqB,MAAM,eAAe,CAAC;AACpE,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"dev.js","sourceRo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,EAAE,CAAC;wBAC3C,OAAO,CAAC,SAAS,CAAC,CAAC;oBACrB,CAAC;gBACH,CAAC,CAAC,CAAC;YACL,CAAC;QACH,CAAC,CAAC,CAAC;QAEH,IAAI,OAAO,EAAE,CAAC;YACZ,MAAM,IAAI,QAAQ,CAAC,GAAG,OAAO,CAAC,IAAI,IAAI,OAAO,CAAC,MAAM,6BAA6B,CAAC,CAAC;QACrF,CAAC;IACH,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { VerifyResult } from '../verify/classify.js';
|
|
1
2
|
import { type BuildManifest } from '../publish/bundle.js';
|
|
2
3
|
/** `'public' | 'private'`, defaulting to private — a typo is rejected rather than silently
|
|
3
4
|
* coerced, matching the server's own asymmetric contract (see cli-publish.ts). */
|
|
@@ -13,12 +14,19 @@ export interface PublishRunDeps {
|
|
|
13
14
|
/** Injectable so a test can assert reuse-vs-rebuild without a real tsc/vite toolchain. */
|
|
14
15
|
runBuild: (root: string, engineVersion: string) => BuildManifest;
|
|
15
16
|
readBuildManifest: (root: string) => BuildManifest | null;
|
|
17
|
+
/** Injectable so a test can assert the smoke check's wiring without launching a browser. */
|
|
18
|
+
runSmokeCheck: (options: {
|
|
19
|
+
publishedUrl: string;
|
|
20
|
+
artifactDir: string;
|
|
21
|
+
}) => Promise<VerifyResult>;
|
|
16
22
|
}
|
|
17
23
|
export interface PublishArgs {
|
|
18
24
|
visibility?: string;
|
|
19
25
|
name?: string;
|
|
20
26
|
description?: string;
|
|
21
27
|
force?: boolean;
|
|
28
|
+
/** Hyphenated to match the flag citty parses; there is no camelCase alias. */
|
|
29
|
+
'skip-smoke'?: boolean;
|
|
22
30
|
}
|
|
23
31
|
/**
|
|
24
32
|
* The whole command. See the file header for why the order below cannot be reshuffled.
|
|
@@ -41,4 +49,8 @@ export declare const publishCommand: import("citty").CommandDef<{
|
|
|
41
49
|
readonly type: "boolean";
|
|
42
50
|
readonly description: "Publish despite a stale or failed verify. Does NOT bypass a missing verify record.";
|
|
43
51
|
};
|
|
52
|
+
readonly 'skip-smoke': {
|
|
53
|
+
readonly type: "boolean";
|
|
54
|
+
readonly description: "Skip the post-publish render check. The game still publishes; it is simply not confirmed to render.";
|
|
55
|
+
};
|
|
44
56
|
}>;
|
package/dist/commands/publish.js
CHANGED
|
@@ -31,6 +31,7 @@ import { createHash } from 'crypto';
|
|
|
31
31
|
import * as fs from 'fs';
|
|
32
32
|
import * as path from 'path';
|
|
33
33
|
import { CliError } from '../errors.js';
|
|
34
|
+
import { engineUpdateNotice } from '../project/engine-update.js';
|
|
34
35
|
import { loadProjectContext } from '../project/context.js';
|
|
35
36
|
import { resolveEnvironment, resolveAuth0ClientId } from '../config/environments.js';
|
|
36
37
|
import { readDefaultEnvironment } from '../config/credentials.js';
|
|
@@ -60,6 +61,13 @@ function defaultDeps() {
|
|
|
60
61
|
log: (message) => console.log(message),
|
|
61
62
|
runBuild: runBuildImpl,
|
|
62
63
|
readBuildManifest: readBuildManifestImpl,
|
|
64
|
+
// Imported lazily: ../smoke/run.js reaches playwright-core, which drags a browser driver into
|
|
65
|
+
// the module graph of every `bitmagic` invocation — and, more sharply, into any jest suite
|
|
66
|
+
// that imports this command. Tests inject their own seam and must never load it.
|
|
67
|
+
runSmokeCheck: async (options) => {
|
|
68
|
+
const { runSmokeCheck } = await import('../smoke/run.js');
|
|
69
|
+
return runSmokeCheck(options);
|
|
70
|
+
},
|
|
63
71
|
};
|
|
64
72
|
}
|
|
65
73
|
/**
|
|
@@ -167,10 +175,38 @@ export async function runPublish(args, deps = defaultDeps()) {
|
|
|
167
175
|
engineVersion: context.metadata.engineVersion,
|
|
168
176
|
fingerprint,
|
|
169
177
|
}, apiDeps);
|
|
178
|
+
// Nudge, never a gate — and printed BEFORE the publish result so it does not read as a
|
|
179
|
+
// failure of the publish that just succeeded.
|
|
180
|
+
const upgrade = engineUpdateNotice(context.metadata.engineVersion, begun.currentEngineVersion);
|
|
181
|
+
if (upgrade !== null)
|
|
182
|
+
deps.log(upgrade);
|
|
170
183
|
deps.log(`Published ${done.visibility}: ${done.url}`);
|
|
171
184
|
if (done.visibility === 'private') {
|
|
172
185
|
deps.log('Not listed. Publish with --visibility public when you are ready.');
|
|
173
186
|
}
|
|
187
|
+
// Everything below runs AFTER the game is live. `complete` has written the bytes and the row,
|
|
188
|
+
// so nothing here can un-publish anything — this stage only decides what we tell the creator.
|
|
189
|
+
if (args['skip-smoke'] === true) {
|
|
190
|
+
// Said plainly, because "Published" on its own now carries a claim that the game renders.
|
|
191
|
+
// A skip has to visibly retract that claim, or it becomes the same silent green signal that
|
|
192
|
+
// let four defects reach published games.
|
|
193
|
+
deps.log('Smoke check skipped — this game has NOT been confirmed to render.');
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
const smokeDir = path.join(context.root, '.bitmagic', 'smoke');
|
|
197
|
+
deps.log('Checking the published game renders…');
|
|
198
|
+
const smoke = await deps.runSmokeCheck({ publishedUrl: done.url, artifactDir: smokeDir });
|
|
199
|
+
for (const warning of smoke.warnings)
|
|
200
|
+
deps.log(` warning: ${warning}`);
|
|
201
|
+
if (!smoke.ok) {
|
|
202
|
+
// Exit 7, distinct from 1-6: every one of those means the publish did NOT happen. This means
|
|
203
|
+
// the opposite, and an agent that conflates them would retry a publish that already succeeded.
|
|
204
|
+
throw new CliError(`Your game IS published at ${done.url}, but it did not render when loaded the way the ` +
|
|
205
|
+
`portal loads it:\n${smoke.failures.map((f) => ` ✗ ${f}`).join('\n')}\n` +
|
|
206
|
+
`Artifacts: ${smokeDir}\n` +
|
|
207
|
+
'Fix the game and publish again, or re-check without republishing once it builds.', 7);
|
|
208
|
+
}
|
|
209
|
+
deps.log('Smoke check passed — the published game renders.');
|
|
174
210
|
}
|
|
175
211
|
export const publishCommand = defineCommand({
|
|
176
212
|
meta: {
|
|
@@ -194,6 +230,10 @@ export const publishCommand = defineCommand({
|
|
|
194
230
|
type: 'boolean',
|
|
195
231
|
description: 'Publish despite a stale or failed verify. Does NOT bypass a missing verify record.',
|
|
196
232
|
},
|
|
233
|
+
'skip-smoke': {
|
|
234
|
+
type: 'boolean',
|
|
235
|
+
description: 'Skip the post-publish render check. The game still publishes; it is simply not confirmed to render.',
|
|
236
|
+
},
|
|
197
237
|
},
|
|
198
238
|
async run({ args }) {
|
|
199
239
|
await runPublish(args);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"publish.js","sourceRoot":"","sources":["../../src/commands/publish.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"publish.js","sourceRoot":"","sources":["../../src/commands/publish.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAuB,MAAM,uBAAuB,CAAC;AAChF,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAoB,MAAM,2BAA2B,CAAC;AACvG,OAAO,EAAE,s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C;AAC/D,CAAC;AAED,MAAM,CAAC,MAAM,cAAc,GAAG,aAAa,CAAC;IAC1C,IAAI,EAAE;QACJ,IAAI,EAAE,SAAS;QACf,WAAW,EAAE,gFAAgF;KAC9F;IACD,IAAI,EAAE;QACJ,UAAU,EAAE;YACV,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,4EAA4E;SAC1F;QACD,IAAI,EAAE;YACJ,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,iFAAiF;SAC/F;QACD,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,wFAAwF;SACtG;QACD,KAAK,EAAE;YACL,IAAI,EAAE,SAAS;YACf,WAAW,EAAE,oFAAoF;SAClG;QACD,YAAY,EAAE;YACZ,IAAI,EAAE,SAAS;YACf,WAAW,EACT,qGAAqG;SACxG;KACF;IACD,KAAK,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE;QAChB,MAAM,UAAU,CAAC,IAAI,CAAC,CAAC;IACzB,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The upgrade nudge.
|
|
3
|
+
*
|
|
4
|
+
* Publishing is deliberately never gated on engine age — a floor there could only ever be "the
|
|
5
|
+
* newest engine" (the deploy workflow writes no floor, the manifest parser defaults an absent one
|
|
6
|
+
* to the current version, and that workflow runs nightly), and blocking at publish is the worst
|
|
7
|
+
* moment to ask anyway: the creator is finished and wants to ship.
|
|
8
|
+
*
|
|
9
|
+
* So the prompt lives where acting on it is cheap — during development, before there is anything
|
|
10
|
+
* to lose by rebuilding.
|
|
11
|
+
*/
|
|
12
|
+
/** Nothing to say: either the project is current, or we could not find out. */
|
|
13
|
+
export type EngineUpdateNotice = string | null;
|
|
14
|
+
/**
|
|
15
|
+
* Compare two `3.<build>` engine versions.
|
|
16
|
+
*
|
|
17
|
+
* Returns null when either side is unparseable, which the caller treats as "say nothing" rather
|
|
18
|
+
* than "out of date" — an unrecognised version is not evidence of anything, and a nudge that
|
|
19
|
+
* fires on every run is a nudge people learn to ignore.
|
|
20
|
+
*/
|
|
21
|
+
export declare function isOlderEngine(projectVersion: string, currentVersion: string): boolean | null;
|
|
22
|
+
/**
|
|
23
|
+
* The line to print, or null to stay quiet.
|
|
24
|
+
*
|
|
25
|
+
* Quiet is the default for everything except a confirmed newer engine: unknown versions, equal
|
|
26
|
+
* versions, and a project somehow ahead of the manifest all produce nothing.
|
|
27
|
+
*/
|
|
28
|
+
export declare function engineUpdateNotice(projectVersion: string, currentVersion: string | null | undefined): EngineUpdateNotice;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The upgrade nudge.
|
|
3
|
+
*
|
|
4
|
+
* Publishing is deliberately never gated on engine age — a floor there could only ever be "the
|
|
5
|
+
* newest engine" (the deploy workflow writes no floor, the manifest parser defaults an absent one
|
|
6
|
+
* to the current version, and that workflow runs nightly), and blocking at publish is the worst
|
|
7
|
+
* moment to ask anyway: the creator is finished and wants to ship.
|
|
8
|
+
*
|
|
9
|
+
* So the prompt lives where acting on it is cheap — during development, before there is anything
|
|
10
|
+
* to lose by rebuilding.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Compare two `3.<build>` engine versions.
|
|
14
|
+
*
|
|
15
|
+
* Returns null when either side is unparseable, which the caller treats as "say nothing" rather
|
|
16
|
+
* than "out of date" — an unrecognised version is not evidence of anything, and a nudge that
|
|
17
|
+
* fires on every run is a nudge people learn to ignore.
|
|
18
|
+
*/
|
|
19
|
+
export function isOlderEngine(projectVersion, currentVersion) {
|
|
20
|
+
const parse = (v) => {
|
|
21
|
+
const parts = v.trim().split('.');
|
|
22
|
+
if (parts.length === 0 || parts.some((p) => !/^\d+$/.test(p)))
|
|
23
|
+
return null;
|
|
24
|
+
return parts.map(Number);
|
|
25
|
+
};
|
|
26
|
+
const a = parse(projectVersion);
|
|
27
|
+
const b = parse(currentVersion);
|
|
28
|
+
if (a === null || b === null)
|
|
29
|
+
return null;
|
|
30
|
+
for (let i = 0; i < Math.max(a.length, b.length); i += 1) {
|
|
31
|
+
const left = a[i] ?? 0;
|
|
32
|
+
const right = b[i] ?? 0;
|
|
33
|
+
if (left !== right)
|
|
34
|
+
return left < right;
|
|
35
|
+
}
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* The line to print, or null to stay quiet.
|
|
40
|
+
*
|
|
41
|
+
* Quiet is the default for everything except a confirmed newer engine: unknown versions, equal
|
|
42
|
+
* versions, and a project somehow ahead of the manifest all produce nothing.
|
|
43
|
+
*/
|
|
44
|
+
export function engineUpdateNotice(projectVersion,
|
|
45
|
+
// `undefined` as well as null: a server that omits the field entirely — an older deployment, or
|
|
46
|
+
// a rename — means "unknown", not "crash the CLI after a successful publish".
|
|
47
|
+
currentVersion) {
|
|
48
|
+
if (typeof currentVersion !== 'string' || currentVersion === '')
|
|
49
|
+
return null;
|
|
50
|
+
if (typeof projectVersion !== 'string')
|
|
51
|
+
return null;
|
|
52
|
+
if (isOlderEngine(projectVersion, currentVersion) !== true)
|
|
53
|
+
return null;
|
|
54
|
+
return `A newer engine is available: ${currentVersion} (this project is on ${projectVersion}). Run \`bitmagic upgrade\` to update it.`;
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=engine-update.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"engine-update.js","sourceRoot":"","sources":["../../src/project/engine-update.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAKH;;;;;;GAMG;AACH,MAAM,UAAU,aAAa,CAAC,cAAsB,EAAE,cAAsB;IAC1E,MAAM,KAAK,GAAG,CAAC,CAAS,EAAmB,EAAE;QAC3C,MAAM,KAAK,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAClC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,CAA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{
|
|
|
26
26
|
publishVersion: number;
|
|
27
27
|
metaBlock: string;
|
|
28
28
|
cacheControl: string;
|
|
29
|
+
/**
|
|
30
|
+
* The newest engine the platform has, for the upgrade nudge. Null when the server could not
|
|
31
|
+
* read its manifest — publishing is never gated on this, so an unknown value just means the
|
|
32
|
+
* CLI says nothing rather than guessing.
|
|
33
|
+
*/
|
|
34
|
+
currentEngineVersion: string | null;
|
|
29
35
|
}
|
|
30
36
|
export declare function beginPublish(environment: Environment, accessToken: string, body: BeginPublishRequest, deps: ApiDeps): Promise<BeginPublishResponse>;
|
|
31
37
|
export interface CompletePublishRequest {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/publish/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAYxC,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC;AAED,SAAS,WAAW,CAAC,KAAc;IACjC,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;AACvD,CAAC;AAED,KAAK,UAAU,YAAY,CAAC,QAAuB;IACjD,IAAI,CAAC;QACH,MAAM,MAAM,GAAY,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;QAC9C,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC;IACxC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,eAAe,CAAC,MAAc,EAAE,IAAuB;IACrE,IAAI,MAAM,KAAK,GAAG;QAAE,OAA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AM,CAAC,eAAe;QAAE,OAAO,CAAC,kBAAkB,CAAC,GAAG,MAAM,CAAC,eAAe,CAAC;IACjF,MAAM,YAAY,CAAC,MAAM,CAAC,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;AAC7D,CAAC"}
|
|
@@ -383,9 +383,21 @@ If \`bitmagic publish\` exits non-zero, branch on the exit code rather than pars
|
|
|
383
383
|
| 1 | Build failed | Run \`bitmagic check\` to see the error, fix it. If the message says \`vite.publish.config.js\` is missing, this project predates it — run \`bitmagic upgrade\` |
|
|
384
384
|
| 2 | Not logged in | \`bitmagic login\` |
|
|
385
385
|
| 3 | Verify missing, stale, or failed | \`bitmagic verify\` (then publish again, or add \`--force\` for a stale/failed record) |
|
|
386
|
-
| 4 | Engine below the publish floor | \`bitmagic upgrade\` |
|
|
387
386
|
| 5 | Not this game's owner, or the account/game is banned | Not self-serve — stop and report it |
|
|
388
387
|
| 6 | Upload or finalize failed | Usually transient (network/storage). Retry once; if it fails identically, stop and report it — this code also covers permanent failures such as an unknown game or a rejected request |
|
|
388
|
+
| 7 | Published, but the game did not render | The game IS live. Do NOT retry the publish — fix the game and publish again. Artifacts in \`.bitmagic/smoke/\` |
|
|
389
|
+
|
|
390
|
+
After a successful publish the CLI loads the published game the way the portal does — in an iframe
|
|
391
|
+
that starts at a zero-size viewport — and fails with exit 7 if it does not render. This catches
|
|
392
|
+
failures that leave no other trace: a wrong Content-Type that makes the browser download the page,
|
|
393
|
+
a bundle that cannot find its own world.json, a canvas nothing ever draws into.
|
|
394
|
+
|
|
395
|
+
Pass \`--skip-smoke\` to skip it. The publish still happens; it is simply not confirmed to render,
|
|
396
|
+
and the output says so.
|
|
397
|
+
|
|
398
|
+
Publishing is never refused because the vendored engine is old. When a newer engine exists,
|
|
399
|
+
\`bitmagic dev\` and \`bitmagic publish\` say so and suggest \`bitmagic upgrade\` — upgrade while you
|
|
400
|
+
are developing, when rebuilding is cheap, rather than being blocked at the moment you ship.
|
|
389
401
|
|
|
390
402
|
## Generating assets
|
|
391
403
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-files.js","sourceRoot":"","sources":["../../src/scaffold/project-files.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEjF;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,YAAY,GAA2B;IAClD,2BAA2B,EAAE,SAAS;IACtC,2BAA2B,EAAE,SAAS;IACtC,kBAAkB,EAAE,QAAQ;IAC5B,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,SAAS;IAClB,kCAAkC,EAAE,QAAQ;IAC5C,KAAK,EAAE,SAAS;IAChB,KAAK,EAAE,UAAU;CAClB,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAA2B;IACtD,aAAa,EAAE,UAAU;IACzB,cAAc,EAAE,UAAU;IAC1B,8FAA8F;IAC9F,cAAc,EAAE,QAAQ;IACxB,4FAA4F;IAC5F,mFAAmF;IACnF,eAAe,EAAE,SAAS;IAC1B,UAAU,EAAE,QAAQ;IACpB,IAAI,EAAE,QAAQ;IACd,wBAAwB,EAAE,QAAQ;CACnC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,aAAa,GAAG,SAAS,CAAC;AAEhC;;;;;;;;;GASG;AACH,MAAM,UAAU,GAAG;IACjB,uBAAuB;IACvB,oCAAoC,aAAa,WAAW;IAC5D,kDAAkD,aAAa,2CAA2C;IAC1G,8CAA8C,aAAa,uCAAuC;IAClG,gDAAgD,aAAa,wCAAwC;CACtG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAEX,oGAAoG;AACpG,MAAM,WAAW,GAA2B;IAC1C,2FAA2F;IAC3F,4FAA4F;IAC5F,4FAA4F;IAC5F,KAAK,EAAE,UAAU;IACjB,cAAc,EAAE,wBAAwB,aAAa,SAAS;IAC9D,WAAW,EAAE,wBAAwB,aAAa,MAAM;IAC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AC;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,uBAAuB;IACrC,MAAM,OAAO,GAAG,kBAAkB,EAAE,CAAC;IACrC,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4BP,OAAO;;;;;;;;;;;;;;CAcR,CAAC;AACF,CAAC;AAED,MAAM,UAAU,eAAe;IAC7B,OAAO,CAAC,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,cAAc,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACjF,CAAC;AASD,MAAM,UAAU,kBAAkB,CAAC,QAAyB;IAC1D,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAC;AAC9B,CAAC;AAED,MAAM,UAAU,cAAc;IAC5B,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6KR,CAAC;AACF,CAAC;AAED,MAAM,UAAU,mBAAmB;IACjC,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgDR,CAAC;AACF,CAAC;AAED,MAAM,UAAU,cAAc;IAC5B,OAAO,cAAc,CAAC;AACxB,CAAC;AAED,MAAM,UAAU,kBAAkB;IAChC,OAAO;;;;CAIR,CAAC;AACF,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How long the iframe stays at zero size before it is grown.
|
|
3
|
+
*
|
|
4
|
+
* The window this has to hit: long enough for the game to boot and construct its renderer against
|
|
5
|
+
* the 0-size viewport (which floors it to 1x1), short enough that the grow still lands before the
|
|
6
|
+
* first rendered frame — that ordering is what makes the engine's size self-heal call
|
|
7
|
+
* onWindowResize while the post chain is still uninitialised. Too early and there is no renderer
|
|
8
|
+
* to mis-size; too late and the first frame has already rendered and the hazard is gone.
|
|
9
|
+
*/
|
|
10
|
+
export declare const SMOKE_FRAME_GROW_MS = 400;
|
|
11
|
+
/**
|
|
12
|
+
* A local page that loads the published bundle the way the portal does.
|
|
13
|
+
*
|
|
14
|
+
* The portal embeds a published game in an iframe, and a cold start there begins with a 0-size
|
|
15
|
+
* viewport. Three of the four defects found in Phase 5's manual gate were invisible to a direct
|
|
16
|
+
* navigation:
|
|
17
|
+
*
|
|
18
|
+
* - a wrong Content-Type makes the iframe DOWNLOAD instead of render, so no canvas ever appears
|
|
19
|
+
* and there is no console error at all;
|
|
20
|
+
* - the bloom `invSize` crash needs the renderer to be resized before its first rendered frame,
|
|
21
|
+
* which only happens when the viewport diverges from the renderer's size;
|
|
22
|
+
* - a canvas that is never claimed by a renderer keeps the 300x150 HTML default.
|
|
23
|
+
*
|
|
24
|
+
* Loading the URL directly reproduces none of the first two. This does.
|
|
25
|
+
*/
|
|
26
|
+
export declare function renderSmokeHarness(publishedUrl: string): string;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How long the iframe stays at zero size before it is grown.
|
|
3
|
+
*
|
|
4
|
+
* The window this has to hit: long enough for the game to boot and construct its renderer against
|
|
5
|
+
* the 0-size viewport (which floors it to 1x1), short enough that the grow still lands before the
|
|
6
|
+
* first rendered frame — that ordering is what makes the engine's size self-heal call
|
|
7
|
+
* onWindowResize while the post chain is still uninitialised. Too early and there is no renderer
|
|
8
|
+
* to mis-size; too late and the first frame has already rendered and the hazard is gone.
|
|
9
|
+
*/
|
|
10
|
+
export const SMOKE_FRAME_GROW_MS = 400;
|
|
11
|
+
/** Attribute-safe. The URL is server-supplied, but it lands inside an HTML attribute either way. */
|
|
12
|
+
function escapeAttr(value) {
|
|
13
|
+
return value
|
|
14
|
+
.replace(/&/g, '&')
|
|
15
|
+
.replace(/"/g, '"')
|
|
16
|
+
.replace(/</g, '<')
|
|
17
|
+
.replace(/>/g, '>');
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* A local page that loads the published bundle the way the portal does.
|
|
21
|
+
*
|
|
22
|
+
* The portal embeds a published game in an iframe, and a cold start there begins with a 0-size
|
|
23
|
+
* viewport. Three of the four defects found in Phase 5's manual gate were invisible to a direct
|
|
24
|
+
* navigation:
|
|
25
|
+
*
|
|
26
|
+
* - a wrong Content-Type makes the iframe DOWNLOAD instead of render, so no canvas ever appears
|
|
27
|
+
* and there is no console error at all;
|
|
28
|
+
* - the bloom `invSize` crash needs the renderer to be resized before its first rendered frame,
|
|
29
|
+
* which only happens when the viewport diverges from the renderer's size;
|
|
30
|
+
* - a canvas that is never claimed by a renderer keeps the 300x150 HTML default.
|
|
31
|
+
*
|
|
32
|
+
* Loading the URL directly reproduces none of the first two. This does.
|
|
33
|
+
*/
|
|
34
|
+
export function renderSmokeHarness(publishedUrl) {
|
|
35
|
+
const src = escapeAttr(publishedUrl);
|
|
36
|
+
return `<!doctype html>
|
|
37
|
+
<html>
|
|
38
|
+
<head><meta charset="utf-8"><title>bitmagic smoke</title></head>
|
|
39
|
+
<body style="margin:0;background:#000">
|
|
40
|
+
<iframe
|
|
41
|
+
id="smoke-frame"
|
|
42
|
+
src="${src}"
|
|
43
|
+
style="border:0;display:block;width:0;height:0"
|
|
44
|
+
allow="autoplay; fullscreen; xr-spatial-tracking"
|
|
45
|
+
></iframe>
|
|
46
|
+
<script>
|
|
47
|
+
// Grow after the game has had time to construct its renderer against the 0-size viewport.
|
|
48
|
+
setTimeout(function () {
|
|
49
|
+
var f = document.getElementById('smoke-frame');
|
|
50
|
+
f.style.width = '1280px';
|
|
51
|
+
f.style.height = '720px';
|
|
52
|
+
}, ${SMOKE_FRAME_GROW_MS});
|
|
53
|
+
</script>
|
|
54
|
+
</body>
|
|
55
|
+
</html>
|
|
56
|
+
`;
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=harness.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"harness.js","sourceRoot":"","sources":["../../src/smoke/harness.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,CAAC;AAEvC,oGAAoG;AACpG,SAAS,UAAU,CAAC,KAAa;IAC/B,OAAO,KAAK;SACT,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC;SACtB,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC;SACvB,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC;SACrB,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AAC3B,CAAC;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,kBAAkB,CAAC,YAAoB;IACrD,MAAM,GAAG,GAAG,UAAU,CAAC,YAAY,CAAC,CAAC;IACrC,OAAO;;;;;;aAMI,GAAG;;;;;;;;;;WAUL,mBAAmB;;;;CAI7B,CAAC;AACF,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type VerifyResult } from '../verify/classify.js';
|
|
2
|
+
/**
|
|
3
|
+
* How long to let the published game settle before observing it.
|
|
4
|
+
*
|
|
5
|
+
* Longer than `verify`'s default: the bundle is fetched from the CDN rather than a local dev
|
|
6
|
+
* server, and a forged level pulls its .vwld and GLBs over the network too.
|
|
7
|
+
*/
|
|
8
|
+
export declare const SMOKE_SETTLE_MS = 25000;
|
|
9
|
+
export interface SmokeCheckOptions {
|
|
10
|
+
/** The URL `publish/complete` returned — the versioned key, which is what was just written. */
|
|
11
|
+
publishedUrl: string;
|
|
12
|
+
/** Where console.log / screenshot.png land. */
|
|
13
|
+
artifactDir: string;
|
|
14
|
+
settleMs?: number;
|
|
15
|
+
}
|
|
16
|
+
export interface SmokeCheckPaths {
|
|
17
|
+
harnessPath: string;
|
|
18
|
+
consolePath: string;
|
|
19
|
+
screenshotPath: string;
|
|
20
|
+
}
|
|
21
|
+
export declare function smokeArtifactPaths(artifactDir: string): SmokeCheckPaths;
|
|
22
|
+
/**
|
|
23
|
+
* Load the just-published bundle the way the portal does, and classify what happened.
|
|
24
|
+
*
|
|
25
|
+
* Deliberately reuses `classifyVerifyRun` rather than defining a second notion of "the game
|
|
26
|
+
* works": it already treats an untouched 300x150 canvas, a fatal engine console line, and a
|
|
27
|
+
* blank-looking screenshot as failures — which between them cover every Phase 5 defect that
|
|
28
|
+
* reached a published game. What this adds is the harness, not the verdict.
|
|
29
|
+
*
|
|
30
|
+
* The harness is written to `artifactDir` rather than a temp dir so a failing run leaves the exact
|
|
31
|
+
* page behind: reproducing a smoke failure by hand is otherwise guesswork.
|
|
32
|
+
*/
|
|
33
|
+
export declare function runSmokeCheck(options: SmokeCheckOptions): Promise<VerifyResult>;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import * as fs from 'fs';
|
|
2
|
+
import * as path from 'path';
|
|
3
|
+
import { classifyVerifyRun } from '../verify/classify.js';
|
|
4
|
+
import { runHeadlessCheck } from '../verify/browser.js';
|
|
5
|
+
import { renderSmokeHarness } from './harness.js';
|
|
6
|
+
/**
|
|
7
|
+
* How long to let the published game settle before observing it.
|
|
8
|
+
*
|
|
9
|
+
* Longer than `verify`'s default: the bundle is fetched from the CDN rather than a local dev
|
|
10
|
+
* server, and a forged level pulls its .vwld and GLBs over the network too.
|
|
11
|
+
*/
|
|
12
|
+
export const SMOKE_SETTLE_MS = 25_000;
|
|
13
|
+
export function smokeArtifactPaths(artifactDir) {
|
|
14
|
+
return {
|
|
15
|
+
harnessPath: path.join(artifactDir, 'harness.html'),
|
|
16
|
+
consolePath: path.join(artifactDir, 'console.log'),
|
|
17
|
+
screenshotPath: path.join(artifactDir, 'screenshot.png'),
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Load the just-published bundle the way the portal does, and classify what happened.
|
|
22
|
+
*
|
|
23
|
+
* Deliberately reuses `classifyVerifyRun` rather than defining a second notion of "the game
|
|
24
|
+
* works": it already treats an untouched 300x150 canvas, a fatal engine console line, and a
|
|
25
|
+
* blank-looking screenshot as failures — which between them cover every Phase 5 defect that
|
|
26
|
+
* reached a published game. What this adds is the harness, not the verdict.
|
|
27
|
+
*
|
|
28
|
+
* The harness is written to `artifactDir` rather than a temp dir so a failing run leaves the exact
|
|
29
|
+
* page behind: reproducing a smoke failure by hand is otherwise guesswork.
|
|
30
|
+
*/
|
|
31
|
+
export async function runSmokeCheck(options) {
|
|
32
|
+
const paths = smokeArtifactPaths(options.artifactDir);
|
|
33
|
+
fs.mkdirSync(options.artifactDir, { recursive: true });
|
|
34
|
+
fs.writeFileSync(paths.harnessPath, renderSmokeHarness(options.publishedUrl));
|
|
35
|
+
const observations = await runHeadlessCheck({
|
|
36
|
+
url: `file://${paths.harnessPath}`,
|
|
37
|
+
screenshotPath: paths.screenshotPath,
|
|
38
|
+
consolePath: paths.consolePath,
|
|
39
|
+
settleMs: options.settleMs ?? SMOKE_SETTLE_MS,
|
|
40
|
+
// The canvas lives in the embedded game, not in the harness page.
|
|
41
|
+
probeFrameUrlIncludes: options.publishedUrl,
|
|
42
|
+
});
|
|
43
|
+
return classifyVerifyRun(observations);
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=run.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run.js","sourceRoot":"","sources":["../../src/smoke/run.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,iBAAiB,EAAqB,MAAM,uBAAuB,CAAC;AAC7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAElD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC;AAgBtC,MAAM,UAAU,kBAAkB,CAAC,WAAmB;IACpD,OAAO;QACL,WAAW,EAAE,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,cAAc,CAAC;QACnD,WAAW,EAAE,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,aAAa,CAAC;QAClD,cAAc,EAAE,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,gBAAgB,CAAC;KACzD,CAAC;AACJ,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,OAA0B;IAC5D,MAAM,KAAK,GAAG,kBAAkB,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;IACtD,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC,WAAW,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACvD,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,WAAW,EAAE,kBAAkB,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC;IAE9E,MAAM,YAAY,GAAG,MAAM,gBAAgB,CAAC;QAC1C,GAAG,EAAE,UAAU,KAAK,CAAC,WAAW,EAAE;QAClC,cAAc,EAAE,KAAK,CAAC,cAAc;QACpC,WAAW,EAAE,KAAK,CAAC,WAAW;QAC9B,QAAQ,EAAE,OAAO,CAAC,QAAQ,IAAI,eAAe;QAC7C,kEAAkE;QAClE,qBAAqB,EAAE,OAAO,CAAC,YAAY;KAC5C,CAAC,CAAC;IAEH,OAAO,iBAAiB,CAAC,YAAY,CAAC,CAAC;AACzC,CAAC"}
|
package/dist/verify/browser.d.ts
CHANGED
|
@@ -5,6 +5,16 @@ export interface HeadlessCheckOptions {
|
|
|
5
5
|
consolePath: string;
|
|
6
6
|
/** How long to let the game settle after load before observing. */
|
|
7
7
|
settleMs: number;
|
|
8
|
+
/**
|
|
9
|
+
* Probe for the canvas inside the first child frame whose URL contains this substring, instead
|
|
10
|
+
* of in the top-level document.
|
|
11
|
+
*
|
|
12
|
+
* `bitmagic verify` loads the game directly and leaves this unset. `bitmagic publish`'s smoke
|
|
13
|
+
* check loads a local harness that embeds the published bundle in an iframe (the shape the
|
|
14
|
+
* portal uses), where the canvas lives in the child — a top-level query finds nothing and
|
|
15
|
+
* classifies as "the game did not start" even when it rendered perfectly.
|
|
16
|
+
*/
|
|
17
|
+
probeFrameUrlIncludes?: string;
|
|
8
18
|
}
|
|
9
19
|
/**
|
|
10
20
|
* Drives the creator's installed Chrome. `channel: 'chrome'` deliberately uses the system
|
package/dist/verify/browser.js
CHANGED
|
@@ -42,7 +42,13 @@ export async function runHeadlessCheck(options) {
|
|
|
42
42
|
throw new CliError(`The page never finished loading at ${options.url}: ${detail}`);
|
|
43
43
|
}
|
|
44
44
|
await page.waitForTimeout(options.settleMs);
|
|
45
|
-
|
|
45
|
+
// Same probe either way; only the frame it runs in differs. A missing child frame leaves
|
|
46
|
+
// `target` null, which classifies as "no canvas" — correct, because a harness whose iframe
|
|
47
|
+
// never loaded (a download, a 404) is exactly the failure this mode exists to catch.
|
|
48
|
+
const target = options.probeFrameUrlIncludes === undefined
|
|
49
|
+
? page
|
|
50
|
+
: page.frames().find((frame) => frame.url().includes(options.probeFrameUrlIncludes)) ?? null;
|
|
51
|
+
const canvas = target === null ? null : await target.evaluate(() => {
|
|
46
52
|
// This callback runs inside the browser Playwright drives, not in the CLI's Node process,
|
|
47
53
|
// so `document` is a real global there even though the CLI's eslint config declares no
|
|
48
54
|
// DOM globals for the process it actually lints.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser.js","sourceRoot":"","sources":["../../src/verify/browser.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"browser.js","sourceRoot":"","sources":["../../src/verify/browser.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,EAAE,QAAQ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