@bitmagic/cli 0.1.52-dev.10 → 0.1.52-dev.11

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.
Files changed (50) hide show
  1. package/README.md +44 -8
  2. package/dist/cli.d.ts +8 -0
  3. package/dist/commands/judge.d.ts +5 -0
  4. package/dist/commands/judge.js +28 -7
  5. package/dist/commands/judge.js.map +1 -1
  6. package/dist/commands/publish.d.ts +6 -1
  7. package/dist/commands/publish.js +29 -15
  8. package/dist/commands/publish.js.map +1 -1
  9. package/dist/commands/verify.d.ts +4 -0
  10. package/dist/commands/verify.js +94 -51
  11. package/dist/commands/verify.js.map +1 -1
  12. package/dist/judge/record.d.ts +3 -0
  13. package/dist/judge/record.js +3 -0
  14. package/dist/judge/record.js.map +1 -1
  15. package/dist/project/platform-declaration.d.ts +51 -0
  16. package/dist/project/platform-declaration.js +81 -0
  17. package/dist/project/platform-declaration.js.map +1 -0
  18. package/dist/publish/platform.d.ts +4 -8
  19. package/dist/publish/platform.js +19 -53
  20. package/dist/publish/platform.js.map +1 -1
  21. package/dist/scaffold/project-files.js +19 -5
  22. package/dist/scaffold/project-files.js.map +1 -1
  23. package/dist/verify/artifacts.d.ts +19 -0
  24. package/dist/verify/artifacts.js +34 -0
  25. package/dist/verify/artifacts.js.map +1 -0
  26. package/dist/verify/browser.d.ts +10 -0
  27. package/dist/verify/browser.js +79 -9
  28. package/dist/verify/browser.js.map +1 -1
  29. package/dist/verify/classify.d.ts +37 -1
  30. package/dist/verify/classify.js +66 -2
  31. package/dist/verify/classify.js.map +1 -1
  32. package/dist/verify/device.d.ts +43 -0
  33. package/dist/verify/device.js +59 -0
  34. package/dist/verify/device.js.map +1 -0
  35. package/dist/verify/iterate.d.ts +21 -2
  36. package/dist/verify/iterate.js +43 -36
  37. package/dist/verify/iterate.js.map +1 -1
  38. package/dist/verify/mobile-parity.d.ts +42 -0
  39. package/dist/verify/mobile-parity.js +84 -0
  40. package/dist/verify/mobile-parity.js.map +1 -0
  41. package/dist/verify/platform.d.ts +47 -0
  42. package/dist/verify/platform.js +89 -0
  43. package/dist/verify/platform.js.map +1 -0
  44. package/dist/verify/result.d.ts +90 -6
  45. package/dist/verify/result.js +89 -10
  46. package/dist/verify/result.js.map +1 -1
  47. package/dist/verify/url.d.ts +9 -1
  48. package/dist/verify/url.js +10 -2
  49. package/dist/verify/url.js.map +1 -1
  50. package/package.json +4 -4
@@ -10,9 +10,13 @@ import { runHeadlessCheck, DEFAULT_START_INTERACTION } from '../verify/browser.j
10
10
  import { classifyVerifyRun } from '../verify/classify.js';
11
11
  import { waitForServer } from '../verify/wait-for-server.js';
12
12
  import { computeFingerprint } from '../publish/fingerprint.js';
13
- import { writeVerifyRecord, decideVerifyOutcome, recordAndGateVerify } from '../verify/result.js';
13
+ import { writeVerifyRecord, decideVerifyOutcome, mergeVerifyPlatformRuns, recordAndGateVerify, toVerifyPlatformRun, } from '../verify/result.js';
14
14
  import { runVerifyWatch } from '../verify/iterate.js';
15
15
  import { buildVerifyUrl } from '../verify/url.js';
16
+ import { allVerifyScreenshotPaths, verifyArtifactPaths } from '../verify/artifacts.js';
17
+ import { describeMobileDevice, mobileContextOptions } from '../verify/device.js';
18
+ import { parsePlatformArg, resolveVerifyPlatforms } from '../verify/platform.js';
19
+ import { readPlatformDeclaration } from '../project/platform-declaration.js';
16
20
  import { createOutput } from '../output.js';
17
21
  const DEFAULT_SETTLE_MS = 15_000;
18
22
  /**
@@ -130,6 +134,12 @@ export const verifyCommand = defineCommand({
130
134
  type: 'string',
131
135
  description: 'Renderer to boot the game with: webgpu (default, what players run) or webgl.',
132
136
  },
137
+ platform: {
138
+ type: 'string',
139
+ description: 'What to boot the game as: desktop, mobile (a phone viewport with touch input '
140
+ + 'and the engine\'s own mobile branch), or both. Defaults to mobile when '
141
+ + 'src/work/game.json declares primaryPlatform "mobile", desktop otherwise.',
142
+ },
133
143
  fast: {
134
144
  type: 'boolean',
135
145
  description: 'Skip the screenshot pipeline for a faster verdict (default in --watch; '
@@ -148,6 +158,7 @@ export const verifyCommand = defineCommand({
148
158
  async run({ args }) {
149
159
  const settleMs = parseTimeoutArg(args.timeout);
150
160
  const renderer = parseRendererArg(args.renderer);
161
+ const platformRequest = parsePlatformArg(args.platform);
151
162
  const watch = args.watch === true;
152
163
  // Watch mode defaults to fast: its iterations are for the agent's inner loop, where the
153
164
  // screenshot is dead weight; `--no-fast` (or a final one-shot run) restores it.
@@ -167,14 +178,24 @@ export const verifyCommand = defineCommand({
167
178
  throw new CliError('Build failed, so there is nothing to verify.', build.status ?? 1);
168
179
  }
169
180
  }
181
+ const plan = resolveVerifyPlatforms(platformRequest, readPlatformDeclaration(context.root));
182
+ for (const warning of plan.warnings)
183
+ output.info(`warning: ${warning}`);
184
+ output.info(plan.platforms.includes('mobile')
185
+ ? `${plan.note} Emulating ${describeMobileDevice(plan.orientation)}.`
186
+ : plan.note);
170
187
  const artifactDir = path.join(context.root, '.bitmagic', 'verify');
171
188
  fs.mkdirSync(artifactDir, { recursive: true });
172
- const screenshotPath = path.join(artifactDir, 'screenshot.png');
173
- const consolePath = path.join(artifactDir, 'console.log');
174
- if (fast) {
175
- // A fast run captures no screenshot; a stale one lying next to a fresh result.json would
176
- // be worse than none — publish would ship an image of some earlier state of the game.
177
- fs.rmSync(screenshotPath, { force: true });
189
+ // Every screenshot this run is NOT going to write is removed first. A stale one lying next
190
+ // to a fresh result.json would be worse than none — publish would ship an image of some
191
+ // earlier state of the game, and "earlier state" now includes "the other platform, from an
192
+ // older run". `--fast` writes none at all, so it clears them all.
193
+ const keeping = fast
194
+ ? new Set()
195
+ : new Set(plan.platforms.map((p) => verifyArtifactPaths(artifactDir, p).screenshotPath));
196
+ for (const stale of allVerifyScreenshotPaths(artifactDir)) {
197
+ if (!keeping.has(stale))
198
+ fs.rmSync(stale, { force: true });
178
199
  }
179
200
  const port = await freePort();
180
201
  let server;
@@ -196,60 +217,74 @@ export const verifyCommand = defineCommand({
196
217
  root: context.root,
197
218
  tsc,
198
219
  artifactDir,
199
- consolePath,
200
- screenshotPath,
201
220
  port,
202
221
  renderer,
203
222
  settleMs,
204
223
  fast,
224
+ platforms: plan.platforms,
225
+ orientation: plan.orientation,
226
+ mobilePrimary: plan.mobilePrimary,
205
227
  output,
206
228
  describeRunState,
207
229
  });
208
230
  return;
209
231
  }
210
- // No ?autostart=1: verify clicks the engine Play button like a real player would
211
- // (startInteraction), which both proves the menu came up AND that gameplay starts from it.
212
- // Autostart bypassed the menu a game whose Play flow was broken could still pass.
213
- const checkOptions = {
214
- url: buildVerifyUrl(port, renderer),
215
- screenshotPath,
216
- consolePath,
217
- settleMs,
218
- startInteraction: DEFAULT_START_INTERACTION,
219
- requestedRenderer: renderer,
220
- captureScreenshot: !fast,
221
- };
222
- let observations = await runHeadlessCheck({
223
- ...checkOptions,
224
- launch: browserLaunchPlan(process.env, renderer),
225
- });
226
- let result = classifyVerifyRun(observations);
227
- let retriedWithSoftwareGl = false;
228
- if (!result.ok && shouldRetrySoftwareGl(observations, process.env)) {
229
- // A lost context is a machine/driver problem, not a game problem (browser-gl.ts) — one
230
- // automatic software-GL re-run answers "is the game broken or is this GPU stack broken"
231
- // without the creator having to know the env var exists. The retry's console goes to its
232
- // own file so the first run's evidence survives.
233
- output.info('The WebGL context was lost — retrying once with software rendering…');
234
- observations = await runHeadlessCheck({
232
+ const runs = [];
233
+ const artifacts = [];
234
+ // The parity verdict is about the game's CODE, not about the emulated device, so a `both`
235
+ // run reports it once. The lead platform runs first, so its verdict is the one kept.
236
+ let mobileParity;
237
+ for (const platform of plan.platforms) {
238
+ const paths = verifyArtifactPaths(artifactDir, platform);
239
+ // No ?autostart=1: verify presses the engine Play button like a real player would
240
+ // (startInteraction), which both proves the menu came up AND that gameplay starts from
241
+ // it. Autostart bypassed the menu — a game whose Play flow was broken could still pass.
242
+ // It is also suppressed outright on mobile, where the tap supplies the user activation
243
+ // fullscreen-on-start needs.
244
+ const checkOptions = {
245
+ url: buildVerifyUrl(port, renderer, platform),
246
+ screenshotPath: paths.screenshotPath,
247
+ consolePath: paths.consolePath,
248
+ settleMs,
249
+ startInteraction: DEFAULT_START_INTERACTION,
250
+ requestedRenderer: renderer,
251
+ captureScreenshot: !fast,
252
+ ...(platform === 'mobile' ? { device: mobileContextOptions(plan.orientation) } : {}),
253
+ };
254
+ let observations = await runHeadlessCheck({
235
255
  ...checkOptions,
236
- consolePath: path.join(artifactDir, 'console.retry.log'),
237
- launch: softwareGlLaunchPlan(process.env, renderer),
256
+ launch: browserLaunchPlan(process.env, renderer),
238
257
  });
239
- result = classifyVerifyRun(observations);
240
- retriedWithSoftwareGl = true;
258
+ let result = classifyVerifyRun(observations, { platform, mobilePrimary: plan.mobilePrimary });
259
+ let retriedWithSoftwareGl = false;
260
+ if (!result.ok && shouldRetrySoftwareGl(observations, process.env)) {
261
+ // A lost context is a machine/driver problem, not a game problem (browser-gl.ts) — one
262
+ // automatic software-GL re-run answers "is the game broken or is this GPU stack broken"
263
+ // without the creator having to know the env var exists. The retry's console goes to
264
+ // its own file so the first run's evidence survives.
265
+ output.info('The WebGL context was lost — retrying once with software rendering…');
266
+ observations = await runHeadlessCheck({
267
+ ...checkOptions,
268
+ consolePath: paths.retryConsolePath,
269
+ launch: softwareGlLaunchPlan(process.env, renderer),
270
+ });
271
+ result = classifyVerifyRun(observations, { platform, mobilePrimary: plan.mobilePrimary });
272
+ retriedWithSoftwareGl = true;
273
+ }
274
+ const observedBackend = observations.renderer?.backend ?? 'unobserved';
275
+ const label = plan.platforms.length > 1 ? `${platform}: ` : '';
276
+ output.info(`${label}Renderer: ${renderer} requested → ${observedBackend} backend`);
277
+ output.info(`${label}${describeRunState(observations)}`);
278
+ if (mobileParity === undefined)
279
+ mobileParity = observations.mobileParity;
280
+ runs.push(toVerifyPlatformRun(platform, result, observations, retriedWithSoftwareGl, paths, fast));
281
+ artifacts.push(paths.consolePath);
282
+ if (!fast)
283
+ artifacts.push(paths.screenshotPath);
241
284
  }
242
- const observedBackend = observations.renderer?.backend ?? 'unobserved';
243
- output.info(`Renderer: ${renderer} requested ${observedBackend} backend`);
244
- output.info(describeRunState(observations));
245
- const outcome = decideVerifyOutcome(result, computeFingerprint(context.root), new Date().toISOString(), {
246
- renderer: observations.renderer,
247
- settle: observations.settle,
248
- snapshot: observations.snapshot,
249
- events: observations.events,
250
- ...(retriedWithSoftwareGl ? { retriedWithSoftwareGl } : {}),
251
- });
252
- recordAndGateVerify(artifactDir, outcome, { consolePath, ...(fast ? {} : { screenshotPath }) }, {
285
+ const merged = mergeVerifyPlatformRuns(runs, mobileParity);
286
+ const outcome = decideVerifyOutcome(merged.result, computeFingerprint(context.root), new Date().toISOString(), merged.extras);
287
+ recordAndGateVerify(artifactDir, outcome, artifacts, {
253
288
  write: writeVerifyRecord,
254
289
  // Under --json both streams are prose and belong on stderr; the result document below
255
290
  // is the only thing stdout carries.
@@ -258,19 +293,27 @@ export const verifyCommand = defineCommand({
258
293
  });
259
294
  // Only reached when the run PASSED — recordAndGateVerify throws on failure, and the
260
295
  // wrapper then emits the error document. Both paths leave stdout parseable.
296
+ // The result document keeps reporting ABSOLUTE paths, unchanged: it is consumed in the
297
+ // moment by whatever ran the command, unlike `result.json`, which persists and therefore
298
+ // records file names only.
299
+ const leadPaths = verifyArtifactPaths(artifactDir, runs[0].platform);
261
300
  output.result({
262
301
  ok: true,
263
302
  failures: outcome.record.failures,
264
303
  warnings: outcome.record.warnings,
265
304
  fingerprint: outcome.record.fingerprint,
305
+ platform: outcome.record.platform,
306
+ touchControls: outcome.record.touchControls,
307
+ platforms: outcome.record.platforms,
308
+ mobileParity: outcome.record.mobileParity,
266
309
  renderer: outcome.record.renderer,
267
310
  retriedWithSoftwareGl: outcome.record.retriedWithSoftwareGl,
268
311
  settle: outcome.record.settle,
269
312
  snapshot: outcome.record.snapshot,
270
313
  events: outcome.record.events,
271
314
  artifactDir,
272
- consolePath,
273
- screenshotPath: fast ? undefined : screenshotPath,
315
+ consolePath: leadPaths.consolePath,
316
+ screenshotPath: fast ? undefined : leadPaths.screenshotPath,
274
317
  });
275
318
  }
276
319
  finally {
@@ -1 +1 @@
1
- {"version":3,"file":"verify.js","sourceRoot":"","sources":["../../src/commands/verify.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,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,sBAAsB,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AACxG,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,GAErB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,gBAAgB,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AACnF,OAAO,EAAE,iBAAiB,EAA2B,MAAM,uBAAuB,CAAC;AACnF,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAClG,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,MAAM,iBAAiB,GAAG,MAAM,CAAC;AAEjC;;;;;;;;GAQG;AACH,KAAK,UAAU,QAAQ;IACrB,MAAM,IAAI,GAAG,MAAM,sBAAsB,EAAE,CAAC;IAC5C,IAAI,IA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AM,CAAC,QAAQ;gBACjC,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,QAAQ;gBACjC,WAAW,EAAE,OAAO,CAAC,MAAM,CAAC,WAAW;gBACvC,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,QAAQ;gBACjC,aAAa,EAAE,OAAO,CAAC,MAAM,CAAC,aAAa;gBAC3C,SAAS,EAAE,OAAO,CAAC,MAAM,CAAC,SAAS;gBACnC,YAAY,EAAE,OAAO,CAAC,MAAM,CAAC,YAAY;gBACzC,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,QAAQ;gBACjC,qBAAqB,EAAE,OAAO,CAAC,MAAM,CAAC,qBAAqB;gBAC3D,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM;gBAC7B,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,QAAQ;gBACjC,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM;gBAC7B,WAAW;gBACX,WAAW,EAAE,SAAS,CAAC,WAAW;gBAClC,cAAc,EAAE,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,cAAc;aAC5D,CAAC,CAAC;QACL,CAAC;gBAAS,CAAC;YACT,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;QAC1B,CAAC;IACH,CAAC;CACF,CAAC,CAAC"}
@@ -11,6 +11,9 @@ export interface JudgeRecord {
11
11
  /** The frame that was judged, relative to the project root. */
12
12
  screenshotPath: string;
13
13
  genre?: string;
14
+ /** Which platform's frame was graded. Absent on records written before `--platform` existed,
15
+ * which were all desktop. */
16
+ platform?: 'desktop' | 'mobile';
14
17
  }
15
18
  export declare function writeJudgeRecord(root: string, record: JudgeRecord): void;
16
19
  export declare function readJudgeRecord(root: string): JudgeRecord | null;
@@ -50,6 +50,9 @@ export function readJudgeRecord(root) {
50
50
  model: record.model,
51
51
  screenshotPath: record.screenshotPath,
52
52
  ...(typeof record.genre === 'string' ? { genre: record.genre } : {}),
53
+ ...(record.platform === 'desktop' || record.platform === 'mobile'
54
+ ? { platform: record.platform }
55
+ : {}),
53
56
  };
54
57
  }
55
58
  //# sourceMappingURL=record.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"record.js","sourceRoot":"","sources":["../../src/judge/record.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,oBAAoB,EAAuB,MAAM,sBAAsB,CAAC;AAEjF,MAAM,iBAAiB,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,YAAY,CAAC,CAAC;AAE/D,MAAM,UAAU,eAAe,CAAC,IAAY;IAC1C,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,iBAAiB,CAAC,CAAC;AAC5C,CAAC;AAeD,MAAM,UAAU,gBAAgB,CAAC,IAAY,EAAE,MAAmB;IAChE,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACvE,EAAE,CAAC,aAAa,CAAC,eAAe,CAAC,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;AAClF,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,IAAY;IAC1C,IAAI,MAAe,CAAC;IACpB,IAAI,CAAC;QACH,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,eAAe,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC;IACvE,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,KAAK,IAAI;QAAE,O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QACnB,cAAc,EAAE,MAAM,CAAC,cAAc;QACrC,GAAG,CAAC,OAAO,MAAM,CAAC,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACpE,GAAG,CAAC,MAAM,CAAC,QAAQ,KAAK,SAAS,IAAI,MAAM,CAAC,QAAQ,KAAK,QAAQ;YAC/D,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE;YAC/B,CAAC,CAAC,EAAE,CAAC;KACR,CAAC;AACJ,CAAC"}
@@ -0,0 +1,51 @@
1
+ /**
2
+ * What a project's work copy DECLARES about the platform it is for: `primaryPlatform` at the top
3
+ * level of `src/work/game.json`, and `worldProfileData.mobileOrientation`.
4
+ *
5
+ * One reader, because two commands now act on the same two fields and must never disagree about
6
+ * them. `bitmagic publish` syncs them to the catalogue (`publish/platform.ts`), and `bitmagic
7
+ * verify` / `bitmagic judge` use them to decide which platform to BOOT and whether a mobile
8
+ * parity gap is a warning or a failure. A second copy of this parse would drift the day one of
9
+ * those files moves.
10
+ *
11
+ * This module reports what the files SAY and nothing about what to do with it: a value that is
12
+ * present but unusable lands in `rejected` rather than in a sentence, because "leaving the stored
13
+ * platform alone" and "verifying on the desktop viewport instead" are different consequences of
14
+ * the same bad value and only the caller knows which one applies.
15
+ *
16
+ * Best effort throughout: a missing, unreadable or malformed file means "the project declares
17
+ * nothing", never an error. A declaration must not be able to fail a command whose real work
18
+ * succeeded.
19
+ */
20
+ export type PrimaryPlatform = 'desktop' | 'mobile';
21
+ export type MobileOrientation = 'portrait' | 'landscape';
22
+ export interface PlatformDeclaration {
23
+ /**
24
+ * `undefined` means the project declares nothing, which is NOT the same as declaring
25
+ * 'desktop': publish's catalogue columns are sticky, so "says nothing" must leave the stored
26
+ * value alone while "says desktop" must overwrite it. Verify treats both as desktop, but it
27
+ * has to be able to tell them apart to explain WHY it picked a platform.
28
+ */
29
+ primaryPlatform?: PrimaryPlatform;
30
+ mobileOrientation?: MobileOrientation;
31
+ /** Whether either work-copy file could be read at all. */
32
+ workCopyReadable: boolean;
33
+ /** Values that were present but not one of the accepted ones, verbatim, for the caller's message. */
34
+ rejected: {
35
+ primaryPlatform?: unknown;
36
+ mobileOrientation?: unknown;
37
+ };
38
+ }
39
+ /**
40
+ * Parse the platform declaration out of `src/work/`.
41
+ *
42
+ * `mobileOrientation` resolves world.json first, game.json second, matching the web lane's own
43
+ * resolution (`game-storage-backend.ts`'s `getListingFieldsSync`). Note this is the OPPOSITE
44
+ * order to `readFaviconOverride` in publish/favicon.ts, which reads game.json first — the
45
+ * favicon override's home is game.json, the orientation's is world.json, and neither order is a
46
+ * house style.
47
+ *
48
+ * The legacy `mainPlatform` spelling is NOT honoured: it predates the CLI lane entirely, so no
49
+ * project this reads can carry it.
50
+ */
51
+ export declare function readPlatformDeclaration(root: string): PlatformDeclaration;
@@ -0,0 +1,81 @@
1
+ /**
2
+ * What a project's work copy DECLARES about the platform it is for: `primaryPlatform` at the top
3
+ * level of `src/work/game.json`, and `worldProfileData.mobileOrientation`.
4
+ *
5
+ * One reader, because two commands now act on the same two fields and must never disagree about
6
+ * them. `bitmagic publish` syncs them to the catalogue (`publish/platform.ts`), and `bitmagic
7
+ * verify` / `bitmagic judge` use them to decide which platform to BOOT and whether a mobile
8
+ * parity gap is a warning or a failure. A second copy of this parse would drift the day one of
9
+ * those files moves.
10
+ *
11
+ * This module reports what the files SAY and nothing about what to do with it: a value that is
12
+ * present but unusable lands in `rejected` rather than in a sentence, because "leaving the stored
13
+ * platform alone" and "verifying on the desktop viewport instead" are different consequences of
14
+ * the same bad value and only the caller knows which one applies.
15
+ *
16
+ * Best effort throughout: a missing, unreadable or malformed file means "the project declares
17
+ * nothing", never an error. A declaration must not be able to fail a command whose real work
18
+ * succeeded.
19
+ */
20
+ import * as fs from 'node:fs';
21
+ import * as path from 'node:path';
22
+ import { aliasSourceDir } from '../scaffold/aliases.js';
23
+ /**
24
+ * Parse the platform declaration out of `src/work/`.
25
+ *
26
+ * `mobileOrientation` resolves world.json first, game.json second, matching the web lane's own
27
+ * resolution (`game-storage-backend.ts`'s `getListingFieldsSync`). Note this is the OPPOSITE
28
+ * order to `readFaviconOverride` in publish/favicon.ts, which reads game.json first — the
29
+ * favicon override's home is game.json, the orientation's is world.json, and neither order is a
30
+ * house style.
31
+ *
32
+ * The legacy `mainPlatform` spelling is NOT honoured: it predates the CLI lane entirely, so no
33
+ * project this reads can carry it.
34
+ */
35
+ export function readPlatformDeclaration(root) {
36
+ const workDir = path.join(root, aliasSourceDir('work'));
37
+ const game = readJsonObject(path.join(workDir, 'game.json'));
38
+ const world = readJsonObject(path.join(workDir, 'world.json'));
39
+ const declaration = {
40
+ workCopyReadable: game !== null || world !== null,
41
+ rejected: {},
42
+ };
43
+ const declared = game?.primaryPlatform;
44
+ if (declared === 'desktop' || declared === 'mobile') {
45
+ declaration.primaryPlatform = declared;
46
+ }
47
+ else if (declared !== undefined) {
48
+ declaration.rejected.primaryPlatform = declared;
49
+ }
50
+ const orientation = worldProfileValue(world, 'mobileOrientation')
51
+ ?? worldProfileValue(game, 'mobileOrientation');
52
+ if (orientation === 'portrait' || orientation === 'landscape') {
53
+ declaration.mobileOrientation = orientation;
54
+ }
55
+ else if (orientation !== undefined) {
56
+ declaration.rejected.mobileOrientation = orientation;
57
+ }
58
+ return declaration;
59
+ }
60
+ /** Parse one work-copy JSON file, or null when it is missing, unreadable or not an object. */
61
+ function readJsonObject(filePath) {
62
+ let parsed;
63
+ try {
64
+ if (!fs.existsSync(filePath))
65
+ return null;
66
+ parsed = JSON.parse(fs.readFileSync(filePath, 'utf-8'));
67
+ }
68
+ catch {
69
+ return null;
70
+ }
71
+ return typeof parsed === 'object' && parsed !== null && !Array.isArray(parsed)
72
+ ? parsed
73
+ : null;
74
+ }
75
+ function worldProfileValue(source, key) {
76
+ const profile = source?.worldProfileData;
77
+ if (typeof profile !== 'object' || profile === null || Array.isArray(profile))
78
+ return undefined;
79
+ return profile[key];
80
+ }
81
+ //# sourceMappingURL=platform-declaration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"platform-declaration.js","sourceRoot":"","sources":["../../src/project/platform-declaration.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAuBxD;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,uBAAuB,CAAC,IAAY;IAClD,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC;IACxD,MAAM,IAAI,GAAG,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC,CAAC;IAC7D,MAAM,KAAK,GAAG,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC;IAE/D,MAAM,WAAW,GAAwB;QACvC,gBAAgB,EAAE,IAAI,KAAK,IAAI,IAAI,KAAK,KAAK,IAAI;QACjD,QAAQ,EAAE,EAAE;KACb,CAAC;IAEF,MAAM,QAAQ,GAAG,IAAI,EAAE,eAAe,CAAC;IACvC,IAAI,QAAQ,KAAK,SAAS,IAAI,QAAQ,KAAK,QAAQ,EAAE,CAAC;QACpD,WAAW,CAAC,eAAe,GAAG,QAAQ,CAAC;IACzC,CAAC;SAAM,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;QAClC,WAAW,CAAC,QAAQ,CAAC,eAAe,GAAG,QAAQ,CAAC;IAClD,CAAC;IAED,MAAM,WAAW,GAAG,iBAAiB,CAAC,KAAK,EAAE,mBAAmB,CAAC;WAC5D,iBAAiB,CAAC,IAAI,EAAE,mBAAmB,CAAC,CAAC;IAClD,IAAI,WAAW,KAAK,UAAU,IAAI,WAAW,KAAK,WAAW,EAAE,CAAC;QAC9D,WAAW,CAAC,iBAAiB,GAAG,WAAW,CAAC;IAC9C,CAAC;SAAM,IAAI,WAAW,KAAK,SAAS,EAAE,CAAC;QACrC,WAAW,CAAC,QAAQ,CAAC,iBAAiB,GAAG,WAAW,CAAC;IACvD,CAAC;IAED,OAAO,WAAW,CAAC;AACrB,CAAC;AAED,8FAA8F;AAC9F,SAAS,cAAc,CAAC,QAAgB;IACtC,IAAI,MAAe,CAAC;IACpB,IAAI,CAAC;QACH,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC;YAAE,OAAO,IAAI,CAAC;QAC1C,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC;IAC1D,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC;QAC5E,CAAC,CAAE,MAAkC;QACrC,CAAC,CAAC,IAAI,CAAC;AACX,CAAC;AAED,SAAS,iBAAiB,CAAC,MAAsC,EAAE,GAAW;IAC5E,MAAM,OAAO,GAAG,MAAM,EAAE,gBAAgB,CAAC;IACzC,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,KAAK,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC;QAAE,OAAO,SAAS,CAAC;IAChG,OAAQ,OAAmC,CAAC,GAAG,CAAC,CAAC;AACnD,CAAC"}
@@ -15,6 +15,10 @@ export interface PlatformIndicatorsResult {
15
15
  * game is FOR (`primaryPlatform`, top level of game.json) and, for a phone game that only makes
16
16
  * sense one way up, `worldProfileData.mobileOrientation`.
17
17
  *
18
+ * The parse itself lives in `project/platform-declaration.ts`, shared with `bitmagic verify`,
19
+ * which boots the platform the same two fields declare. What stays HERE is the wire semantics,
20
+ * which are publish's alone.
21
+ *
18
22
  * The project files are the source of truth, exactly as they are in the web lane — the columns
19
23
  * are "indicators synced from game.json at publish, like `genre`" (migration 048). So a value
20
24
  * changed anywhere else is reverted by the creator's next publish, and the way to make a game
@@ -31,14 +35,6 @@ export interface PlatformIndicatorsResult {
31
35
  * the key instead would make an orientation impossible to remove from here. Only a work copy
32
36
  * neither of whose files can be read omits the key.
33
37
  *
34
- * world.json wins over game.json for the orientation, matching the web lane's own resolution
35
- * (`game-storage-backend.ts`'s `getListingFieldsSync`). Note this is the OPPOSITE order to
36
- * `readFaviconOverride` in favicon.ts, which reads game.json first — the favicon override's home
37
- * is game.json, the orientation's is world.json, and neither order is a house style.
38
- *
39
- * The legacy `mainPlatform` spelling is NOT honoured: it predates the CLI lane entirely, so no
40
- * project this reads can carry it.
41
- *
42
38
  * Best effort throughout, like `readFaviconOverride`: a missing, unreadable or malformed file
43
39
  * means "the project declares nothing", never an error. A catalog indicator must not be able to
44
40
  * fail a publish whose bundle is already uploaded.
@@ -1,11 +1,13 @@
1
- import * as fs from 'node:fs';
2
- import * as path from 'node:path';
3
- import { aliasSourceDir } from '../scaffold/aliases.js';
1
+ import { readPlatformDeclaration } from '../project/platform-declaration.js';
4
2
  /**
5
3
  * The platform indicators a publish syncs from the project's own work copy: which platform the
6
4
  * game is FOR (`primaryPlatform`, top level of game.json) and, for a phone game that only makes
7
5
  * sense one way up, `worldProfileData.mobileOrientation`.
8
6
  *
7
+ * The parse itself lives in `project/platform-declaration.ts`, shared with `bitmagic verify`,
8
+ * which boots the platform the same two fields declare. What stays HERE is the wire semantics,
9
+ * which are publish's alone.
10
+ *
9
11
  * The project files are the source of truth, exactly as they are in the web lane — the columns
10
12
  * are "indicators synced from game.json at publish, like `genre`" (migration 048). So a value
11
13
  * changed anywhere else is reverted by the creator's next publish, and the way to make a game
@@ -22,44 +24,29 @@ import { aliasSourceDir } from '../scaffold/aliases.js';
22
24
  * the key instead would make an orientation impossible to remove from here. Only a work copy
23
25
  * neither of whose files can be read omits the key.
24
26
  *
25
- * world.json wins over game.json for the orientation, matching the web lane's own resolution
26
- * (`game-storage-backend.ts`'s `getListingFieldsSync`). Note this is the OPPOSITE order to
27
- * `readFaviconOverride` in favicon.ts, which reads game.json first — the favicon override's home
28
- * is game.json, the orientation's is world.json, and neither order is a house style.
29
- *
30
- * The legacy `mainPlatform` spelling is NOT honoured: it predates the CLI lane entirely, so no
31
- * project this reads can carry it.
32
- *
33
27
  * Best effort throughout, like `readFaviconOverride`: a missing, unreadable or malformed file
34
28
  * means "the project declares nothing", never an error. A catalog indicator must not be able to
35
29
  * fail a publish whose bundle is already uploaded.
36
30
  */
37
31
  export function readPlatformIndicators(root) {
38
- const workDir = path.join(root, aliasSourceDir('work'));
39
- const game = readJsonObject(path.join(workDir, 'game.json'));
40
- const world = readJsonObject(path.join(workDir, 'world.json'));
32
+ const declaration = readPlatformDeclaration(root);
41
33
  const fields = {};
42
34
  const notes = [];
43
- const declared = game?.primaryPlatform;
44
- if (declared === 'desktop' || declared === 'mobile') {
45
- fields.primaryPlatform = declared;
35
+ if (declaration.primaryPlatform !== undefined) {
36
+ fields.primaryPlatform = declaration.primaryPlatform;
37
+ }
38
+ if (declaration.workCopyReadable) {
39
+ // Explicit null when the work copy is readable but declares nothing — see the doc comment.
40
+ fields.mobileOrientation = declaration.mobileOrientation ?? null;
46
41
  }
47
- else if (declared !== undefined) {
48
- notes.push(`game.json primaryPlatform ${JSON.stringify(declared)} is not "desktop" or "mobile" — ` +
49
- 'leaving the stored platform alone.');
42
+ const { rejected } = declaration;
43
+ if ('primaryPlatform' in rejected) {
44
+ notes.push(`game.json primaryPlatform ${JSON.stringify(rejected.primaryPlatform)} is not "desktop" `
45
+ + 'or "mobile" — leaving the stored platform alone.');
50
46
  }
51
- if (world !== null || game !== null) {
52
- const orientation = worldProfileValue(world, 'mobileOrientation') ?? worldProfileValue(game, 'mobileOrientation');
53
- if (orientation === 'portrait' || orientation === 'landscape') {
54
- fields.mobileOrientation = orientation;
55
- }
56
- else {
57
- if (orientation !== undefined) {
58
- notes.push(`worldProfileData.mobileOrientation ${JSON.stringify(orientation)} is not "portrait" ` +
59
- 'or "landscape" — publishing with no orientation lock.');
60
- }
61
- fields.mobileOrientation = null;
62
- }
47
+ if ('mobileOrientation' in rejected) {
48
+ notes.push(`worldProfileData.mobileOrientation ${JSON.stringify(rejected.mobileOrientation)} is not `
49
+ + '"portrait" or "landscape" — publishing with no orientation lock.');
63
50
  }
64
51
  if (fields.primaryPlatform === 'mobile') {
65
52
  notes.push(fields.mobileOrientation
@@ -68,25 +55,4 @@ export function readPlatformIndicators(root) {
68
55
  }
69
56
  return { fields, notes };
70
57
  }
71
- /** Parse one work-copy JSON file, or null when it is missing, unreadable or not an object. */
72
- function readJsonObject(filePath) {
73
- let parsed;
74
- try {
75
- if (!fs.existsSync(filePath))
76
- return null;
77
- parsed = JSON.parse(fs.readFileSync(filePath, 'utf-8'));
78
- }
79
- catch {
80
- return null;
81
- }
82
- return typeof parsed === 'object' && parsed !== null && !Array.isArray(parsed)
83
- ? parsed
84
- : null;
85
- }
86
- function worldProfileValue(source, key) {
87
- const profile = source?.worldProfileData;
88
- if (typeof profile !== 'object' || profile === null || Array.isArray(profile))
89
- return undefined;
90
- return profile[key];
91
- }
92
58
  //# sourceMappingURL=platform.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"platform.js","sourceRoot":"","sources":["../../src/publish/platform.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAgBxD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,MAAM,UAAU,sBAAsB,CAAC,IAAY;IACjD,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,IA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