@bitmagic/cli 0.1.83-dev.7 → 0.1.83
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 +24 -7
- package/dist/bug-report/dev-view.d.ts +10 -0
- package/dist/bug-report/dev-view.js +35 -0
- package/dist/bug-report/dev-view.js.map +1 -0
- package/dist/bug-report/send.d.ts +54 -0
- package/dist/bug-report/send.js +143 -0
- package/dist/bug-report/send.js.map +1 -0
- package/dist/cli.d.ts +24 -0
- package/dist/cli.js +2 -0
- package/dist/cli.js.map +1 -1
- package/dist/commands/pages.js +6 -14
- package/dist/commands/pages.js.map +1 -1
- package/dist/commands/report-bug.d.ts +42 -0
- package/dist/commands/report-bug.js +98 -0
- package/dist/commands/report-bug.js.map +1 -0
- package/dist/commands/upgrade.d.ts +9 -2
- package/dist/commands/upgrade.js +27 -6
- package/dist/commands/upgrade.js.map +1 -1
- package/dist/editor/bug-report-panel.d.ts +23 -0
- package/dist/editor/bug-report-panel.js +191 -0
- package/dist/editor/bug-report-panel.js.map +1 -0
- package/dist/editor/hud-replay-page.d.ts +9 -0
- package/dist/editor/hud-replay-page.js +11 -1
- package/dist/editor/hud-replay-page.js.map +1 -1
- package/dist/editor/server.js +54 -1
- package/dist/editor/server.js.map +1 -1
- package/dist/editor/shell-page.js +11 -0
- package/dist/editor/shell-page.js.map +1 -1
- package/dist/publish/bundle.js +3 -5
- package/dist/publish/bundle.js.map +1 -1
- package/dist/publish/source-zip.d.ts +6 -0
- package/dist/publish/source-zip.js +1 -1
- package/dist/publish/source-zip.js.map +1 -1
- package/dist/scaffold/game-migration.d.ts +25 -63
- package/dist/scaffold/game-migration.js +30 -439
- package/dist/scaffold/game-migration.js.map +1 -1
- package/dist/scaffold/import-codemod.d.ts +4 -3
- package/dist/scaffold/import-codemod.js +16 -34
- package/dist/scaffold/import-codemod.js.map +1 -1
- package/dist/scaffold/project-files.js +19 -13
- package/dist/scaffold/project-files.js.map +1 -1
- package/dist/scaffold/skill-files.js +16 -2
- package/dist/scaffold/skill-files.js.map +1 -1
- package/dist/vendor/hud-theme/engine/hud/fonts.js +6 -4
- package/package.json +4 -4
- package/dist/scaffold/legacy-game-baselines.d.ts +0 -14
- package/dist/scaffold/legacy-game-baselines.js +0 -218
- package/dist/scaffold/legacy-game-baselines.js.map +0 -1
package/README.md
CHANGED
|
@@ -232,6 +232,7 @@ browser reloads itself on every change and the assets panel shows each generatio
|
|
|
232
232
|
| `bitmagic levels <list\|add\|rename\|set-start\|remove> ...` | Manage the levels `forge` creates: which one boots, their names, registering a bake you already have, deleting one. Local, no network, no sparks. See **Managing levels** below. |
|
|
233
233
|
| `bitmagic ios <build\|submit\|storekit> ...` | Ship the game as a native iOS app (Mac with Xcode). `build` packages every asset into the app, proves it boots offline on WebGPU and WebGL, and builds a Simulator app (`--run` launches it) or, with `--ipa --team <TEAMID>`, a signed store build; `submit` uploads that to App Store Connect / TestFlight. The game can sell App Store consumables through `engine.getInAppStore()` (the engine credits each purchase to its wallet exactly once); `storekit <id...>` writes `ios/StoreKit.storekit`, the local catalogue a run from Xcode buys from with no Apple account — run from `.bitmagic/ios/App/App.xcodeproj`, not `--run`. Everything under `.bitmagic/ios/` is regenerated each build; native code of your own goes in `ios/Sources/*.swift` and is compiled in every time. The Apple Developer account, agreements, banking and the products in App Store Connect are yours to set up. |
|
|
234
234
|
| `bitmagic steam <init\|art\|screenshots\|trailer\|check\|build\|play\|login\|upload\|portal> ...` | Put the game on Steam. `init`, `art`, `screenshots`, `trailer` and `check` make the store page kit — every capsule, library image and icon at Steam's exact size from AI key art and a keyed logo, 1920x1080 gameplay screenshots, a 1080p trailer ending on the logo, and the store copy, held to Valve's rules. `build` makes the Windows depot and a signed, notarized universal macOS app (a Mac is needed for it), each proven to reach gameplay with no network; `play` opens it. `login` (the creator, once, in a terminal) and `upload` ship it with SteamPipe. `portal` drives the Steamworks website in a Chrome window the creator logs in to. See **Steam** below. |
|
|
235
|
+
| `bitmagic report-bug --message "..." [--screenshot <png>] [--no-source] [--env <env>]` | Report a bug in Bitmagic itself — the engine, the CLI or the dev view — to the Bitmagic team. Attaches a ZIP of the project source (the same archive `publish` leaves, so no `engine/`, binary assets or credential-shaped files; `--no-source` leaves it out), the errors the last `bitmagic verify` saw, and the CLI, engine and template versions. Needs a login, not Bitmagic Pro. Never prompts. The dev view's **⋯ → Report bug…** sends the same report with a screenshot. |
|
|
235
236
|
|
|
236
237
|
Every command exits non-zero on failure with a single-line message (no stack trace) and, where a
|
|
237
238
|
distinction is useful to an automated caller, a specific exit code — see **Exit codes** below.
|
|
@@ -843,6 +844,12 @@ clip, and drops the result into the project's assets, ready to play on a charact
|
|
|
843
844
|
off for you — the note when it finishes says how much came off each end, and opening the clip shows
|
|
844
845
|
you exactly where.
|
|
845
846
|
|
|
847
|
+
**Report bug…** in the same menu tells the Bitmagic team something in Bitmagic itself is broken —
|
|
848
|
+
the engine, the CLI or this view, not your game's own code. Describe what happened; the dialog
|
|
849
|
+
attaches a screenshot of the game, the runtime errors the game has thrown since the page opened,
|
|
850
|
+
and the project source (each can be switched off). It is the same report as `bitmagic report-bug`,
|
|
851
|
+
and lands where the Creator's **Report Bug** button does.
|
|
852
|
+
|
|
846
853
|
### The top bar
|
|
847
854
|
|
|
848
855
|
The bar starts by saying **whose** view this is, because with two games open — and often two
|
|
@@ -866,7 +873,7 @@ never re-hosted, because that URL — the one every later generation inherits
|
|
|
866
873
|
|
|
867
874
|
What you reach for all session sits in the bar: the **Game / Editor** tabs, **Auto-reload**, the
|
|
868
875
|
status light, **Assets** (which shows whether the panel is open), **Screenshot** and **Reload**.
|
|
869
|
-
Everything that opens a dialog and is wanted once a week — Published,
|
|
876
|
+
Everything that opens a dialog and is wanted once a week — Published, the two recorders and Report bug — lives
|
|
870
877
|
behind **⋯**, so the bar stops growing a button every time the CLI grows a feature.
|
|
871
878
|
|
|
872
879
|
3010 still serves the game on its own, for a second window or a bookmark.
|
|
@@ -1987,15 +1994,25 @@ levels), and `upgrade` repoints those nine known URLs at their VXL3 versions and
|
|
|
1987
1994
|
player loader itself has a `src/work/Game.ts` that builds them and hands them over with
|
|
1988
1995
|
`engine.setSpawner()` and friends: it keeps working (the engine adopts what it is handed, with a
|
|
1989
1996
|
deprecation warning), and this flag rewrites it to today's
|
|
1990
|
-
`class VoxelGame extends VoxelGameBase`.
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
`
|
|
1994
|
-
|
|
1995
|
-
|
|
1997
|
+
`class VoxelGame extends VoxelGameBase`. A project started from a template is compared with that
|
|
1998
|
+
template's old `Game.ts` and rebuilt on its current one. Every member identical to a released
|
|
1999
|
+
version is dropped; your own fields, methods and helpers are kept, and so is a method of yours
|
|
2000
|
+
`VoxelGameBase` also has (as an override); statements you added to `constructor`, `load`, `update`
|
|
2001
|
+
or `dispose` move into the hook that runs at the same point (`onWorldLoaded`, `onCameraReady`,
|
|
2002
|
+
`onPlayerReady` — async when your code awaits —, `loadPlayer`, an override of a method called just
|
|
2003
|
+
there, `updatePlayer`, `updateWorld`, `updateCamera`, `disposeGameplay`); and `VoxelGameBase.ts` is
|
|
2004
|
+
added beside it. Two rules are looser than "the same point": code added mid-`update()` moves on to
|
|
2005
|
+
the next hook point of the same frame, and anything added to `dispose()` goes to
|
|
2006
|
+
`disposeGameplay()`. When it cannot prove the rest — a default statement edited or removed — it
|
|
2007
|
+
leaves the file unchanged and says why. The result must type-check with the
|
|
1996
2008
|
project's own compiler or both files are put back, so run it with dependencies installed and a
|
|
1997
2009
|
project that type-checks.
|
|
1998
2010
|
|
|
2011
|
+
An upgrade that finds the old `Game.ts` says so even without the flag, and whenever the file is left
|
|
2012
|
+
old it points at `engine/agent-docs/migrating-game-to-voxelgamebase.md`: the same rewrite as steps
|
|
2013
|
+
the project's agent can follow by hand, including where the automatic one gave up (`--json` carries
|
|
2014
|
+
`legacyGameFile` and `gameMigrationGuide`).
|
|
2015
|
+
|
|
1999
2016
|
`.claude/settings.json` is merged rather than rewritten — it is where your permissions and your own
|
|
2000
2017
|
hooks live. An upgrade adds the `bitmagic reload` Stop hook if it is missing and changes nothing
|
|
2001
2018
|
else; if it cannot parse the file it leaves it entirely alone and says so.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** A 4K PNG is a few MB, and base64 adds a third; the description and errors are a few KB. */
|
|
2
|
+
export declare const DEV_VIEW_BUG_REPORT_BODY_LIMIT_BYTES: number;
|
|
3
|
+
export interface DevViewBugReportRequest {
|
|
4
|
+
description: string;
|
|
5
|
+
includeSource: boolean;
|
|
6
|
+
screenshotPng?: Uint8Array;
|
|
7
|
+
runtimeErrors: string[];
|
|
8
|
+
}
|
|
9
|
+
/** The parsed request, or the reason it is refused, worded for the dialog. */
|
|
10
|
+
export declare function parseDevViewBugReport(body: unknown): DevViewBugReportRequest | string;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The body the dev view's "Report bug…" dialog posts to the sidecar's `POST /api/bug-report`
|
|
3
|
+
* (`editor/bug-report-panel.ts`), parsed before anything is zipped or uploaded.
|
|
4
|
+
*/
|
|
5
|
+
import { MAX_DESCRIPTION_CHARS, MAX_RUNTIME_ERRORS, isPng } from './send.js';
|
|
6
|
+
/** A 4K PNG is a few MB, and base64 adds a third; the description and errors are a few KB. */
|
|
7
|
+
export const DEV_VIEW_BUG_REPORT_BODY_LIMIT_BYTES = 24 * 1024 * 1024;
|
|
8
|
+
/** The parsed request, or the reason it is refused, worded for the dialog. */
|
|
9
|
+
export function parseDevViewBugReport(body) {
|
|
10
|
+
if (typeof body !== 'object' || body === null || Array.isArray(body))
|
|
11
|
+
return 'Expected a JSON object.';
|
|
12
|
+
const raw = body;
|
|
13
|
+
const description = typeof raw.description === 'string' ? raw.description.trim() : '';
|
|
14
|
+
if (description === '')
|
|
15
|
+
return 'Describe the bug first.';
|
|
16
|
+
if (description.length > MAX_DESCRIPTION_CHARS)
|
|
17
|
+
return `Keep the description under ${MAX_DESCRIPTION_CHARS} characters.`;
|
|
18
|
+
let screenshotPng;
|
|
19
|
+
if (typeof raw.screenshotPngBase64 === 'string' && raw.screenshotPngBase64 !== '') {
|
|
20
|
+
const bytes = Buffer.from(raw.screenshotPngBase64, 'base64');
|
|
21
|
+
if (!isPng(bytes))
|
|
22
|
+
return 'The screenshot is not a PNG.';
|
|
23
|
+
screenshotPng = new Uint8Array(bytes);
|
|
24
|
+
}
|
|
25
|
+
const runtimeErrors = Array.isArray(raw.runtimeErrors)
|
|
26
|
+
? raw.runtimeErrors.filter((e) => typeof e === 'string' && e.trim() !== '').slice(-MAX_RUNTIME_ERRORS)
|
|
27
|
+
: [];
|
|
28
|
+
return {
|
|
29
|
+
description,
|
|
30
|
+
includeSource: raw.includeSource !== false,
|
|
31
|
+
...(screenshotPng ? { screenshotPng } : {}),
|
|
32
|
+
runtimeErrors,
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=dev-view.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dev-view.js","sourceRoot":"","sources":["../../src/bug-report/dev-view.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAE7E,8FAA8F;AAC9F,MAAM,CAAC,MAAM,oCAAoC,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC;AASrE,8EAA8E;AAC9E,MAAM,UAAU,qBAAqB,CAAC,IAAa;IACjD,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC;QAAE,OAAO,yBAAyB,CAAC;IACvG,MAAM,GAAG,GAAG,IAA+B,CAAC;IAE5C,MAAM,WAAW,GAAG,OAAO,GAAG,CAAC,WAAW,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IACtF,IAAI,WAAW,KAAK,EAAE;QAAE,OAAO,yBAAyB,CAAC;IACzD,IAAI,WAAW,CAAC,MAAM,GAAG,qBAAqB;QAAE,OAAO,8BAA8B,qBAAqB,cAAc,CAAC;IAEzH,IAAI,aAAqC,CAAC;IAC1C,IAAI,OAAO,GAAG,CAAC,mBAAmB,KAAK,QAAQ,IAAI,GAAG,CAAC,mBAAmB,KAAK,EAAE,EAAE,CAAC;QAClF,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,mBAAmB,EAAE,QAAQ,CAAC,CAAC;QAC7D,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC;YAAE,OAAO,8BAA8B,CAAC;QACzD,aAAa,GAAG,IAAI,UAAU,CAAC,KAAK,CAAC,CAAC;IACxC,CAAC;IAED,MAAM,aAAa,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC;QACpD,CAAC,CAAC,GAAG,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC,EAAe,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,kBAAkB,CAAC;QACnH,CAAC,CAAC,EAAE,CAAC;IAEP,OAAO;QACL,WAAW;QACX,aAAa,EAAE,GAAG,CAAC,aAAa,KAAK,KAAK;QAC1C,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,aAAa,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC3C,aAAa;KACd,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { Environment } from '../config/environments.js';
|
|
2
|
+
import { type ApiDeps } from '../http/client.js';
|
|
3
|
+
import type { ProjectMetadata } from '../project/context.js';
|
|
4
|
+
export declare const BUG_REPORT_BEGIN_PATH = "/api/cli/v1/bug-reports/begin";
|
|
5
|
+
export declare const BUG_REPORT_SUBMIT_PATH = "/api/cli/v1/bug-reports";
|
|
6
|
+
/** api-server's limits, mirrored so the CLI refuses before uploading anything. */
|
|
7
|
+
export declare const MAX_DESCRIPTION_CHARS = 2000;
|
|
8
|
+
export declare const MAX_RUNTIME_ERRORS = 20;
|
|
9
|
+
export type BugReportSurface = 'cli' | 'dev-view';
|
|
10
|
+
/**
|
|
11
|
+
* Whether `bytes` start with PNG's eight-byte signature. The upload is signed as image/png, and
|
|
12
|
+
* Slack shows nothing for an image block whose bytes are something else.
|
|
13
|
+
*/
|
|
14
|
+
export declare function isPng(bytes: Uint8Array): boolean;
|
|
15
|
+
export interface BugReportContext {
|
|
16
|
+
gameName: string;
|
|
17
|
+
template: string;
|
|
18
|
+
engineVersion: string;
|
|
19
|
+
cliVersion: string;
|
|
20
|
+
platform: string;
|
|
21
|
+
environment: string;
|
|
22
|
+
lastPublishUrl?: string;
|
|
23
|
+
}
|
|
24
|
+
/** Where the report's archive goes — beside publish's, never on top of it. */
|
|
25
|
+
export declare function bugReportArchivePath(root: string): string;
|
|
26
|
+
export declare function collectBugReportContext(root: string, metadata: ProjectMetadata, environment: Environment): BugReportContext;
|
|
27
|
+
/**
|
|
28
|
+
* The errors the last `bitmagic verify` saw in the browser console, newest last. The CLI has no
|
|
29
|
+
* live game to ask, so this is the closest thing it has to "what went wrong at runtime".
|
|
30
|
+
*/
|
|
31
|
+
export declare function readVerifyConsoleErrors(root: string): string[];
|
|
32
|
+
export interface SendBugReportInput {
|
|
33
|
+
root: string;
|
|
34
|
+
metadata: ProjectMetadata;
|
|
35
|
+
environment: Environment;
|
|
36
|
+
token: string;
|
|
37
|
+
description: string;
|
|
38
|
+
surface: BugReportSurface;
|
|
39
|
+
includeSource: boolean;
|
|
40
|
+
screenshotPng?: Uint8Array;
|
|
41
|
+
runtimeErrors?: string[];
|
|
42
|
+
}
|
|
43
|
+
export interface SendBugReportResult {
|
|
44
|
+
reportId: string;
|
|
45
|
+
sourceUploaded: boolean;
|
|
46
|
+
screenshotUploaded: boolean;
|
|
47
|
+
/** Credential-shaped files the archive left out, so the creator knows they were there. */
|
|
48
|
+
secretsOmitted: string[];
|
|
49
|
+
/** What went wrong without stopping the report — a failed upload, an undelivered Slack post. */
|
|
50
|
+
warnings: string[];
|
|
51
|
+
}
|
|
52
|
+
/** Throws a `CliError` the caller can show as-is; nothing is uploaded before this passes. */
|
|
53
|
+
export declare function validateBugReportDescription(description: string): string;
|
|
54
|
+
export declare function sendBugReport(input: SendBugReportInput, deps: ApiDeps, log?: (message: string) => void): Promise<SendBugReportResult>;
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Filing a GDK bug report: the one path behind both `bitmagic report-bug` and the dev view's
|
|
3
|
+
* "Report bug…" dialog, so the two cannot drift on what a report carries.
|
|
4
|
+
*
|
|
5
|
+
* What a report sends, in this order:
|
|
6
|
+
*
|
|
7
|
+
* 1. `POST /api/cli/v1/bug-reports/begin` — signed upload URLs for whichever files there are.
|
|
8
|
+
* 2. The source ZIP and the screenshot, PUT straight to storage. The ZIP is the publish lane's
|
|
9
|
+
* source archive (`buildSourceArchive`), so it already leaves out the vendored engine,
|
|
10
|
+
* credential-shaped files and binary assets; it is written to its own path so the archive the
|
|
11
|
+
* last publish left behind stays put.
|
|
12
|
+
* 3. `POST /api/cli/v1/bug-reports` — the description and a little context, which api-server posts
|
|
13
|
+
* to the same Slack channel the Creator's "Report Bug" button uses.
|
|
14
|
+
*
|
|
15
|
+
* An upload that fails does not cost the report: the description is the part that matters, and
|
|
16
|
+
* api-server links only the files that actually arrived.
|
|
17
|
+
*/
|
|
18
|
+
import * as fs from 'fs';
|
|
19
|
+
import * as path from 'path';
|
|
20
|
+
import { apiPost } from '../http/client.js';
|
|
21
|
+
import { putSignedUrl } from '../http/signed-upload.js';
|
|
22
|
+
import { buildSourceIndex } from '../publish/fingerprint.js';
|
|
23
|
+
import { buildSourceArchive } from '../publish/source-zip.js';
|
|
24
|
+
import { readPublishRecord } from '../publish/record.js';
|
|
25
|
+
import { readGameName } from '../project/game-name.js';
|
|
26
|
+
import { currentCliVersion } from '../update/cli-version.js';
|
|
27
|
+
import { CliError } from '../errors.js';
|
|
28
|
+
export const BUG_REPORT_BEGIN_PATH = '/api/cli/v1/bug-reports/begin';
|
|
29
|
+
export const BUG_REPORT_SUBMIT_PATH = '/api/cli/v1/bug-reports';
|
|
30
|
+
/** api-server's limits, mirrored so the CLI refuses before uploading anything. */
|
|
31
|
+
export const MAX_DESCRIPTION_CHARS = 2000;
|
|
32
|
+
export const MAX_RUNTIME_ERRORS = 20;
|
|
33
|
+
const PNG_SIGNATURE = [0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a];
|
|
34
|
+
/**
|
|
35
|
+
* Whether `bytes` start with PNG's eight-byte signature. The upload is signed as image/png, and
|
|
36
|
+
* Slack shows nothing for an image block whose bytes are something else.
|
|
37
|
+
*/
|
|
38
|
+
export function isPng(bytes) {
|
|
39
|
+
return PNG_SIGNATURE.every((byte, i) => bytes[i] === byte);
|
|
40
|
+
}
|
|
41
|
+
/** Where the report's archive goes — beside publish's, never on top of it. */
|
|
42
|
+
export function bugReportArchivePath(root) {
|
|
43
|
+
return path.join(root, '.bitmagic', 'bug-report', 'source.zip');
|
|
44
|
+
}
|
|
45
|
+
export function collectBugReportContext(root, metadata, environment) {
|
|
46
|
+
const publish = readPublishRecord(root);
|
|
47
|
+
return {
|
|
48
|
+
gameName: readGameName(root),
|
|
49
|
+
template: metadata.template,
|
|
50
|
+
engineVersion: metadata.engineVersion,
|
|
51
|
+
cliVersion: currentCliVersion(),
|
|
52
|
+
platform: `${process.platform} ${process.arch}, Node ${process.versions.node}`,
|
|
53
|
+
environment: environment.name,
|
|
54
|
+
...(publish ? { lastPublishUrl: publish.latestUrl ?? publish.url } : {}),
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* The errors the last `bitmagic verify` saw in the browser console, newest last. The CLI has no
|
|
59
|
+
* live game to ask, so this is the closest thing it has to "what went wrong at runtime".
|
|
60
|
+
*/
|
|
61
|
+
export function readVerifyConsoleErrors(root) {
|
|
62
|
+
let text;
|
|
63
|
+
try {
|
|
64
|
+
text = fs.readFileSync(path.join(root, '.bitmagic', 'verify', 'console.log'), 'utf-8');
|
|
65
|
+
}
|
|
66
|
+
catch {
|
|
67
|
+
return [];
|
|
68
|
+
}
|
|
69
|
+
return text
|
|
70
|
+
.split('\n')
|
|
71
|
+
.filter((line) => line.startsWith('error:') || line.startsWith('pageerror:'))
|
|
72
|
+
.slice(-MAX_RUNTIME_ERRORS);
|
|
73
|
+
}
|
|
74
|
+
/** Throws a `CliError` the caller can show as-is; nothing is uploaded before this passes. */
|
|
75
|
+
export function validateBugReportDescription(description) {
|
|
76
|
+
const trimmed = description.trim();
|
|
77
|
+
if (trimmed === '') {
|
|
78
|
+
throw new CliError('Describe the bug: what you did, what you expected, and what happened instead.', 1, 'invalid_arguments');
|
|
79
|
+
}
|
|
80
|
+
if (trimmed.length > MAX_DESCRIPTION_CHARS) {
|
|
81
|
+
throw new CliError(`The description is ${trimmed.length} characters; the limit is ${MAX_DESCRIPTION_CHARS}.`, 1, 'invalid_arguments');
|
|
82
|
+
}
|
|
83
|
+
return trimmed;
|
|
84
|
+
}
|
|
85
|
+
export async function sendBugReport(input, deps, log = () => { }) {
|
|
86
|
+
const description = validateBugReportDescription(input.description);
|
|
87
|
+
const warnings = [];
|
|
88
|
+
let archive = null;
|
|
89
|
+
if (input.includeSource) {
|
|
90
|
+
try {
|
|
91
|
+
archive = await buildSourceArchive({
|
|
92
|
+
root: input.root,
|
|
93
|
+
index: buildSourceIndex(input.root),
|
|
94
|
+
gameId: input.metadata.gameId,
|
|
95
|
+
engineVersion: input.metadata.engineVersion,
|
|
96
|
+
filePath: bugReportArchivePath(input.root),
|
|
97
|
+
});
|
|
98
|
+
log(`Source ZIP: ${(archive.bytes / 1024).toFixed(0)} KB (engine/, binary assets and credential-shaped files left out).`);
|
|
99
|
+
}
|
|
100
|
+
catch (error) {
|
|
101
|
+
warnings.push(`Could not build the source ZIP: ${error instanceof Error ? error.message : String(error)}`);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
const screenshot = input.screenshotPng && input.screenshotPng.byteLength > 0 ? input.screenshotPng : null;
|
|
105
|
+
const begun = await apiPost(input.environment, BUG_REPORT_BEGIN_PATH, input.token, { hasSource: archive !== null, hasScreenshot: screenshot !== null }, deps);
|
|
106
|
+
const upload = async (what, signed, bytes, maxBytes) => {
|
|
107
|
+
if (!signed || bytes === null)
|
|
108
|
+
return false;
|
|
109
|
+
if (bytes.byteLength > maxBytes) {
|
|
110
|
+
warnings.push(`The ${what} is ${(bytes.byteLength / 1024 / 1024).toFixed(1)} MB, over the ${(maxBytes / 1024 / 1024).toFixed(0)} MB limit — sent without it.`);
|
|
111
|
+
return false;
|
|
112
|
+
}
|
|
113
|
+
try {
|
|
114
|
+
await putSignedUrl(signed.url, bytes, signed.headers, deps);
|
|
115
|
+
return true;
|
|
116
|
+
}
|
|
117
|
+
catch (error) {
|
|
118
|
+
warnings.push(`The ${what} did not upload (${error instanceof Error ? error.message : String(error)}) — sent without it.`);
|
|
119
|
+
return false;
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
const sourceUploaded = await upload('source ZIP', begun.sourceUpload, archive ? new Uint8Array(fs.readFileSync(archive.filePath)) : null, begun.maxSourceBytes);
|
|
123
|
+
const screenshotUploaded = await upload('screenshot', begun.screenshotUpload, screenshot, begun.maxScreenshotBytes);
|
|
124
|
+
const gameId = input.metadata.gameId;
|
|
125
|
+
const submitted = await apiPost(input.environment, BUG_REPORT_SUBMIT_PATH, input.token, {
|
|
126
|
+
reportId: begun.reportId,
|
|
127
|
+
...(gameId ? { gameId } : {}),
|
|
128
|
+
description,
|
|
129
|
+
surface: input.surface,
|
|
130
|
+
context: collectBugReportContext(input.root, input.metadata, input.environment),
|
|
131
|
+
runtimeErrors: (input.runtimeErrors ?? []).slice(-MAX_RUNTIME_ERRORS),
|
|
132
|
+
}, deps);
|
|
133
|
+
if (submitted.warning)
|
|
134
|
+
warnings.push(submitted.warning);
|
|
135
|
+
return {
|
|
136
|
+
reportId: submitted.reportId,
|
|
137
|
+
sourceUploaded,
|
|
138
|
+
screenshotUploaded,
|
|
139
|
+
secretsOmitted: archive?.secretsOmitted ?? [],
|
|
140
|
+
warnings,
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
//# sourceMappingURL=send.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"send.js","sourceRoot":"","sources":["../../src/bug-report/send.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAE7B,OAAO,EAAE,OAAO,EAAgB,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,MAAM,CAAC,MAAM,qBAAqB,GAAG,+BAA+B,CAAC;AACrE,MAAM,CAAC,MAAM,sBAAsB,GAAG,yBAAyB,CAAC;AAEhE,kFAAkF;AAClF,MAAM,CAAC,MAAM,qBAAqB,GAAG,IAAI,CAAC;AAC1C,MAAM,CAAC,MAAM,kBAAkB,GAAG,EAAE,CAAC;AAIrC,MAAM,aAAa,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAA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OAAO;QACtB,OAAO,EAAE,uBAAuB,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,WAAW,CAAC;QAC/E,aAAa,EAAE,CAAC,KAAK,CAAC,aAAa,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,kBAAkB,CAAC;KACtE,EACD,IAAI,CACL,CAAC;IACF,IAAI,SAAS,CAAC,OAAO;QAAE,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IAExD,OAAO;QACL,QAAQ,EAAE,SAAS,CAAC,QAAQ;QAC5B,cAAc;QACd,kBAAkB;QAClB,cAAc,EAAE,OAAO,EAAE,cAAc,IAAI,EAAE;QAC7C,QAAQ;KACT,CAAC;AACJ,CAAC"}
|
package/dist/cli.d.ts
CHANGED
|
@@ -575,6 +575,30 @@ declare const rawCommands: {
|
|
|
575
575
|
ios: CommandDef<ArgsDef>;
|
|
576
576
|
steam: CommandDef<ArgsDef>;
|
|
577
577
|
tools: CommandDef<ArgsDef>;
|
|
578
|
+
'report-bug': CommandDef<{
|
|
579
|
+
readonly message: {
|
|
580
|
+
readonly type: "string";
|
|
581
|
+
readonly description: "What you did, what you expected, and what happened instead (up to 2000 characters). Required.";
|
|
582
|
+
};
|
|
583
|
+
readonly screenshot: {
|
|
584
|
+
readonly type: "string";
|
|
585
|
+
readonly description: "A PNG screenshot to attach.";
|
|
586
|
+
};
|
|
587
|
+
readonly source: {
|
|
588
|
+
readonly type: "boolean";
|
|
589
|
+
readonly default: true;
|
|
590
|
+
readonly description: "Attach a ZIP of the project source (without engine/, binary assets or credential-shaped files).";
|
|
591
|
+
readonly negativeDescription: "Send the report without the project source.";
|
|
592
|
+
};
|
|
593
|
+
readonly env: {
|
|
594
|
+
readonly type: "string";
|
|
595
|
+
readonly description: "Environment to report to (dev, prod, local).";
|
|
596
|
+
};
|
|
597
|
+
readonly json: {
|
|
598
|
+
readonly type: "boolean";
|
|
599
|
+
readonly description: "Print the result as JSON on stdout; all progress goes to stderr.";
|
|
600
|
+
};
|
|
601
|
+
}>;
|
|
578
602
|
};
|
|
579
603
|
type CommandName = keyof typeof rawCommands;
|
|
580
604
|
export declare const subCommands: Record<CommandName, CommandDef<ArgsDef>>;
|
package/dist/cli.js
CHANGED
|
@@ -28,6 +28,7 @@ import { assetsCommand } from './commands/assets.js';
|
|
|
28
28
|
import { levelsCommand } from './commands/levels.js';
|
|
29
29
|
import { themeCommand } from './commands/theme.js';
|
|
30
30
|
import { coverCommand } from './commands/cover.js';
|
|
31
|
+
import { reportBugCommand } from './commands/report-bug.js';
|
|
31
32
|
import { trailerCommand } from './commands/trailer.js';
|
|
32
33
|
import { adsCommand } from './commands/ads.js';
|
|
33
34
|
import { exchangeCommand } from './commands/exchange.js';
|
|
@@ -238,6 +239,7 @@ const rawCommands = {
|
|
|
238
239
|
ios: iosCommand,
|
|
239
240
|
steam: steamCommand,
|
|
240
241
|
tools: toolsCommand,
|
|
242
|
+
'report-bug': reportBugCommand,
|
|
241
243
|
};
|
|
242
244
|
export const subCommands = Object.fromEntries(Object.entries(rawCommands).map(([name, command]) => [name, withCleanErrors(command, name)]));
|
|
243
245
|
// This module only builds `main` and exports it (along with `subCommands` and `withCleanErrors`)
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEtC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,YAAY,EAA0B,MAAM,gCAAgC,CAAC;AACtF,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAsB,MAAM,uBAAuB,CAAC;AAC9F,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE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AAC;QACR,MAAM,IAAI,GAAG,aAAa,CAAC,OAAO,CAAC,CAAC;QACpC,IAAI,IAAI,KAAK,SAAS,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,IAAI,CAAC;QAEtE,MAAM,KAAK,GAAG,eAAe,CAAC,SAAS,EAAE,CAAC,OAAO,CAAC,IAAI,IAAI,EAAE,CAAY,CAAC,CAAC;QAC1E,IAAI,KAAK,KAAK,CAAC,CAAC;YAAE,OAAO,IAAI,CAAC;QAE9B,MAAM,IAAI,GAAG,SAAS,CAAC,KAAK,CAAW,CAAC;QACxC,MAAM,KAAK,GAAG,cAAc,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QACzC,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACxB,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YAC9B,OAAO,CACL,oBAAoB,IAAI,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,UAAU,MAAM,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI;gBAC3E,cAAc,aAAa,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK;gBACjD,qBAAqB,MAAM,IAAI,IAAI,2CAA2C;gBAC9E,4DAA4D,CAC7D,CAAC;QACJ,CAAC;QAED,OAAO,GAAG,KAAK,CAAC;QAChB,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAChB,SAAS,GAAG,SAAS,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;IACzC,CAAC;AACH,CAAC"}
|
package/dist/commands/pages.js
CHANGED
|
@@ -24,18 +24,9 @@ export function initPagesWorkflow(root, options) {
|
|
|
24
24
|
const branch = options.branch ?? detectDefaultBranch(root);
|
|
25
25
|
const rendered = renderGithubPagesWorkflow({ cliVersion: options.cliVersion, packageManager, branch });
|
|
26
26
|
const file = path.join(root, PAGES_WORKFLOW_PATH);
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}
|
|
31
|
-
catch {
|
|
32
|
-
existing = null;
|
|
33
|
-
}
|
|
34
|
-
let status = 'written';
|
|
35
|
-
if (existing === rendered) {
|
|
36
|
-
status = 'unchanged';
|
|
37
|
-
}
|
|
38
|
-
else {
|
|
27
|
+
const existing = fs.existsSync(file) ? fs.readFileSync(file, 'utf-8') : null;
|
|
28
|
+
const status = existing === rendered ? 'unchanged' : 'written';
|
|
29
|
+
if (status === 'written') {
|
|
39
30
|
if (existing !== null && options.force !== true) {
|
|
40
31
|
throw new CliError(`${PAGES_WORKFLOW_PATH} already exists and differs from what this CLI writes `
|
|
41
32
|
+ '(edited by hand, or written by another CLI version). Run `bitmagic pages init --force` '
|
|
@@ -75,9 +66,10 @@ const initCommand = defineCommand({
|
|
|
75
66
|
force: args.force === true,
|
|
76
67
|
pagesHosting: context.metadata.pagesHosting,
|
|
77
68
|
});
|
|
69
|
+
const deploys = `deploys ${result.branch} with bitmagic ${result.cliVersion}, ${result.packageManager}`;
|
|
78
70
|
output.info(result.status === 'unchanged'
|
|
79
|
-
? `${PAGES_WORKFLOW_PATH} is already up to date (
|
|
80
|
-
: `Wrote ${PAGES_WORKFLOW_PATH} (
|
|
71
|
+
? `${PAGES_WORKFLOW_PATH} is already up to date (${deploys}).`
|
|
72
|
+
: `Wrote ${PAGES_WORKFLOW_PATH} (${deploys}). Commit it.`);
|
|
81
73
|
for (const note of result.notes)
|
|
82
74
|
output.info(`\n${note}`);
|
|
83
75
|
output.result({ ok: true, ...result });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pages.js","sourceRoot":"","sources":["../../src/commands/pages.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC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face ReportBugArgs {
|
|
3
|
+
message?: string;
|
|
4
|
+
screenshot?: string;
|
|
5
|
+
source?: boolean;
|
|
6
|
+
env?: string;
|
|
7
|
+
json?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface ReportBugDeps {
|
|
10
|
+
fetch: typeof globalThis.fetch;
|
|
11
|
+
sleep: (ms: number) => Promise<void>;
|
|
12
|
+
/** Test-only override; production omits it and loadProjectContext walks up from process.cwd(). */
|
|
13
|
+
startDir?: string;
|
|
14
|
+
/** Test-only override; production omits it and the credential helpers read ~/.bitmagic. */
|
|
15
|
+
baseDir?: string;
|
|
16
|
+
log?: (message: string) => void;
|
|
17
|
+
}
|
|
18
|
+
export declare function runReportBug(args: ReportBugArgs, deps?: ReportBugDeps): Promise<SendBugReportResult>;
|
|
19
|
+
export declare const reportBugCommand: import("citty").CommandDef<{
|
|
20
|
+
readonly message: {
|
|
21
|
+
readonly type: "string";
|
|
22
|
+
readonly description: "What you did, what you expected, and what happened instead (up to 2000 characters). Required.";
|
|
23
|
+
};
|
|
24
|
+
readonly screenshot: {
|
|
25
|
+
readonly type: "string";
|
|
26
|
+
readonly description: "A PNG screenshot to attach.";
|
|
27
|
+
};
|
|
28
|
+
readonly source: {
|
|
29
|
+
readonly type: "boolean";
|
|
30
|
+
readonly default: true;
|
|
31
|
+
readonly description: "Attach a ZIP of the project source (without engine/, binary assets or credential-shaped files).";
|
|
32
|
+
readonly negativeDescription: "Send the report without the project source.";
|
|
33
|
+
};
|
|
34
|
+
readonly env: {
|
|
35
|
+
readonly type: "string";
|
|
36
|
+
readonly description: "Environment to report to (dev, prod, local).";
|
|
37
|
+
};
|
|
38
|
+
readonly json: {
|
|
39
|
+
readonly type: "boolean";
|
|
40
|
+
readonly description: "Print the result as JSON on stdout; all progress goes to stderr.";
|
|
41
|
+
};
|
|
42
|
+
}>;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `bitmagic report-bug` — tell the Bitmagic team something in the engine, the CLI or the dev view
|
|
3
|
+
* is broken. The GDK's counterpart of the Creator's "Report Bug" button, posting to the same
|
|
4
|
+
* channel; the dev view's ⋯ → "Report bug…" runs the same path (`bug-report/send.ts`).
|
|
5
|
+
*
|
|
6
|
+
* Never prompts: an agent runs this when the creator asks it to, and a prompt would hang its turn.
|
|
7
|
+
* It needs a login but not Bitmagic Pro — a creator whose subscription lapsed can still report.
|
|
8
|
+
*/
|
|
9
|
+
import * as fs from 'fs';
|
|
10
|
+
import * as path from 'path';
|
|
11
|
+
import { defineCommand } from 'citty';
|
|
12
|
+
import { CliError } from '../errors.js';
|
|
13
|
+
import { createOutput } from '../output.js';
|
|
14
|
+
import { loadProjectContext } from '../project/context.js';
|
|
15
|
+
import { resolveEnvironmentForCommand, resolveAuth0ClientId } from '../config/environments.js';
|
|
16
|
+
import { getAccessToken } from '../auth/session.js';
|
|
17
|
+
import { isPng, readVerifyConsoleErrors, sendBugReport, validateBugReportDescription } from '../bug-report/send.js';
|
|
18
|
+
function defaultDeps() {
|
|
19
|
+
return {
|
|
20
|
+
fetch: globalThis.fetch,
|
|
21
|
+
sleep: (ms) => new Promise((resolve) => setTimeout(resolve, ms)),
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
function readScreenshot(file) {
|
|
25
|
+
const resolved = path.resolve(file);
|
|
26
|
+
let bytes;
|
|
27
|
+
try {
|
|
28
|
+
bytes = fs.readFileSync(resolved);
|
|
29
|
+
}
|
|
30
|
+
catch (error) {
|
|
31
|
+
throw new CliError(`Could not read the screenshot at ${resolved}: ${error instanceof Error ? error.message : String(error)}`, 1, 'invalid_arguments');
|
|
32
|
+
}
|
|
33
|
+
if (!isPng(bytes)) {
|
|
34
|
+
throw new CliError(`${resolved} is not a PNG. Pass a .png screenshot, or leave --screenshot out.`, 1, 'invalid_arguments');
|
|
35
|
+
}
|
|
36
|
+
return new Uint8Array(bytes);
|
|
37
|
+
}
|
|
38
|
+
export async function runReportBug(args, deps = defaultDeps()) {
|
|
39
|
+
const output = createOutput(args.json === true);
|
|
40
|
+
const log = deps.log ?? output.info;
|
|
41
|
+
// Everything the creator controls is checked before logging in or zipping anything.
|
|
42
|
+
if (args.message === undefined) {
|
|
43
|
+
throw new CliError('Pass --message "<what happened>": what you did, what you expected, and what happened instead.', 1, 'invalid_arguments');
|
|
44
|
+
}
|
|
45
|
+
const description = validateBugReportDescription(args.message);
|
|
46
|
+
const screenshotPng = args.screenshot !== undefined ? readScreenshot(args.screenshot) : undefined;
|
|
47
|
+
const { root, metadata } = loadProjectContext(deps.startDir);
|
|
48
|
+
const environment = resolveEnvironmentForCommand({ cwd: root, explicit: args.env, baseDir: deps.baseDir });
|
|
49
|
+
const token = await getAccessToken(environment, resolveAuth0ClientId(environment), { fetch: deps.fetch, sleep: deps.sleep }, deps.baseDir);
|
|
50
|
+
const result = await sendBugReport({
|
|
51
|
+
root,
|
|
52
|
+
metadata,
|
|
53
|
+
environment,
|
|
54
|
+
token,
|
|
55
|
+
description,
|
|
56
|
+
surface: 'cli',
|
|
57
|
+
includeSource: args.source !== false,
|
|
58
|
+
...(screenshotPng ? { screenshotPng } : {}),
|
|
59
|
+
runtimeErrors: readVerifyConsoleErrors(root),
|
|
60
|
+
}, { fetch: deps.fetch }, log);
|
|
61
|
+
if (result.secretsOmitted.length > 0) {
|
|
62
|
+
log(`Left out ${result.secretsOmitted.length} credential-shaped file(s): ${result.secretsOmitted.join(', ')}`);
|
|
63
|
+
}
|
|
64
|
+
for (const warning of result.warnings)
|
|
65
|
+
log(`Note: ${warning}`);
|
|
66
|
+
const attached = [result.sourceUploaded && 'source ZIP', result.screenshotUploaded && 'screenshot'].filter(Boolean);
|
|
67
|
+
log(`Bug report sent (id ${result.reportId})${attached.length > 0 ? ` with the ${attached.join(' and ')}` : ''}. Thank you!`);
|
|
68
|
+
output.result({ ok: true, ...result });
|
|
69
|
+
return result;
|
|
70
|
+
}
|
|
71
|
+
export const reportBugCommand = defineCommand({
|
|
72
|
+
meta: {
|
|
73
|
+
name: 'report-bug',
|
|
74
|
+
description: 'Report a bug in Bitmagic (engine, CLI or dev view) to the Bitmagic team, with this project\'s source attached.',
|
|
75
|
+
},
|
|
76
|
+
args: {
|
|
77
|
+
message: {
|
|
78
|
+
type: 'string',
|
|
79
|
+
description: 'What you did, what you expected, and what happened instead (up to 2000 characters). Required.',
|
|
80
|
+
},
|
|
81
|
+
screenshot: { type: 'string', description: 'A PNG screenshot to attach.' },
|
|
82
|
+
source: {
|
|
83
|
+
type: 'boolean',
|
|
84
|
+
default: true,
|
|
85
|
+
description: 'Attach a ZIP of the project source (without engine/, binary assets or credential-shaped files).',
|
|
86
|
+
negativeDescription: 'Send the report without the project source.',
|
|
87
|
+
},
|
|
88
|
+
env: { type: 'string', description: 'Environment to report to (dev, prod, local).' },
|
|
89
|
+
json: {
|
|
90
|
+
type: 'boolean',
|
|
91
|
+
description: 'Print the result as JSON on stdout; all progress goes to stderr.',
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
async run({ args }) {
|
|
95
|
+
await runReportBug(args);
|
|
96
|
+
},
|
|
97
|
+
});
|
|
98
|
+
//# sourceMappingURL=report-bug.js.map
|