@bitmagic/cli 0.1.46-dev.6 → 0.1.46
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 +58 -5
- package/dist/commands/init.js +27 -13
- package/dist/commands/init.js.map +1 -1
- package/dist/project/package-manager.d.ts +25 -2
- package/dist/project/package-manager.js +30 -2
- package/dist/project/package-manager.js.map +1 -1
- package/dist/scaffold/project-files.js +9 -0
- package/dist/scaffold/project-files.js.map +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -61,9 +61,62 @@ installs the unreleased build the Bitmagic team and external testers run — a p
|
|
|
61
61
|
production, so a CLI that uses them has to be installable before it is released. Pair it with
|
|
62
62
|
`bitmagic login --env dev`.
|
|
63
63
|
|
|
64
|
-
`npm install -g @bitmagic/cli` puts you back on the release at any time.
|
|
65
|
-
|
|
66
|
-
|
|
64
|
+
`npm install -g @bitmagic/cli` puts you back on the release at any time. One global install is a
|
|
65
|
+
single `bitmagic` on your PATH, so `bitmagic --version` is how you tell which line you are on: a
|
|
66
|
+
`-dev.N` suffix means the dev line. To have both at once, see below.
|
|
67
|
+
|
|
68
|
+
### Running both lines side by side
|
|
69
|
+
|
|
70
|
+
Install each line into its own root, and let the directory you are standing in decide which one
|
|
71
|
+
`bitmagic` resolves to. Nothing here is Bitmagic-specific — it is two ordinary
|
|
72
|
+
[direnv](https://direnv.net) files over two ordinary pnpm installs.
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
pnpm add -g --global-dir ~/.bitmagic-cli/prod --global-bin-dir ~/.bitmagic-cli/prod/bin @bitmagic/cli
|
|
76
|
+
pnpm add -g --global-dir ~/.bitmagic-cli/dev --global-bin-dir ~/.bitmagic-cli/dev/bin @bitmagic/cli@dev
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
pnpm refuses a global bin directory that is not already on your `PATH`, so add both to your shell
|
|
80
|
+
profile once (they are only ever *prepended* per-directory below, so the order here does not
|
|
81
|
+
matter). Then sort your projects into two folders and give each one an `.envrc`:
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
# prod-games/.envrc
|
|
85
|
+
PATH_add "$HOME/.bitmagic-cli/prod/bin"
|
|
86
|
+
|
|
87
|
+
# dev-games/.envrc
|
|
88
|
+
PATH_add "$HOME/.bitmagic-cli/dev/bin"
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
`direnv allow` each, and `bitmagic` is the right build in each tree:
|
|
92
|
+
|
|
93
|
+
```
|
|
94
|
+
$ cd prod-games && bitmagic --version → 0.1.45
|
|
95
|
+
$ cd dev-games/my-game && bitmagic --version → 0.1.46-dev.5
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
direnv loads the nearest `.envrc` walking **up**, so every project beneath a folder inherits its
|
|
99
|
+
line — you do not need a file per game. `bitmagic init --env dev` is what puts a project on the dev
|
|
100
|
+
side, so the folder split follows the pin the project already carries.
|
|
101
|
+
|
|
102
|
+
The command keeps its name in both trees, which matters: `bitmagic init` writes bare `bitmagic dev`
|
|
103
|
+
and `bitmagic reload` into the project's `AGENTS.md`, so a `bitmagic-dev` alias would leave your
|
|
104
|
+
coding agent running the wrong build.
|
|
105
|
+
|
|
106
|
+
Four things worth knowing:
|
|
107
|
+
|
|
108
|
+
- **Your logins already coexist.** Credentials live in one `~/.bitmagic/credentials.json` keyed per
|
|
109
|
+
environment, so a `bitmagic login --env dev` and a prod login sit side by side. The split above is
|
|
110
|
+
only about which binary runs.
|
|
111
|
+
- **The CLI catches a failed switch.** Run a dev build inside a project pinned to `prod` and it says
|
|
112
|
+
so before the command, naming the right line. It suggests `npm i -g` because that is the fix for a
|
|
113
|
+
single-install machine — with this setup, read it instead as "direnv did not fire, or you are in
|
|
114
|
+
the wrong folder".
|
|
115
|
+
- **The update nudge goes quiet for one run after you switch.** Both installs share one
|
|
116
|
+
`~/.bitmagic/update-check.json`, which records a single line's answer, so the first run after
|
|
117
|
+
crossing over refetches in the background and says nothing. It is back the run after.
|
|
118
|
+
- **Each root is its own ~28 MB.** Installs are still fast — pnpm serves both from your shared store
|
|
119
|
+
rather than re-downloading — but the two roots do not share files with each other.
|
|
67
120
|
|
|
68
121
|
## Quick start
|
|
69
122
|
|
|
@@ -94,7 +147,7 @@ browser reloads itself on every change and the assets panel shows each generatio
|
|
|
94
147
|
| `bitmagic logout [--env <env>]` | Remove stored credentials for an environment. |
|
|
95
148
|
| `bitmagic reset-account [--env <env>] [--yes] [--keep-cli]` | **Deletes your account** on `dev` or `local` so the first-run experience can be tested again — games, sparks, profile, terms acceptance and Bitmagic Pro (cancelled in Stripe first). Then clears that environment's stored credentials **and uninstalls this CLI**, so the next run starts where a new creator starts: `npm install -g @bitmagic/cli`. `--keep-cli` skips that last step. Refuses `prod`, where the endpoint is not deployed at all. Asks you to type the environment name; `--yes` skips that and is required in a shell with no terminal. Your project directory is left alone — its `gameId` no longer exists, so start the fresh run in a new one. |
|
|
96
149
|
| `bitmagic whoami [--env <env>]` | Show the identity the CLI is authenticated as — the account's email address alongside its user id — and which environment answered, including where that environment was chosen from. |
|
|
97
|
-
| `bitmagic init [dir] [--template <id>] [--name <name>] [--idea "<pitch>"] [--env <env>] [--force]` | Scaffold a new project: mints a game, downloads the vendored engine, writes `AGENTS.md`, `GAME-DESIGN.md` and templates. Starts from `empty-3d` unless told otherwise. `--idea` seeds the design doc's pitch **and** picks the template whose camera and controls fit it — "a doom-like corridor shooter" scaffolds `first-person`, "jump between floating islands" scaffolds `sidescroller`. `--template` overrides both; a suggestion that fails for any reason falls back to `empty-3d` rather than failing the scaffold. |
|
|
150
|
+
| `bitmagic init [dir] [--template <id>] [--name <name>] [--idea "<pitch>"] [--env <env>] [--force]` | Scaffold a new project: mints a game, downloads the vendored engine, writes `AGENTS.md`, `GAME-DESIGN.md` and templates. Starts from `empty-3d` unless told otherwise. `--idea` seeds the design doc's pitch **and** picks the template whose camera and controls fit it — "a doom-like corridor shooter" scaffolds `first-person`, "jump between floating islands" scaffolds `sidescroller`. `--template` overrides both; a suggestion that fails for any reason falls back to `empty-3d` rather than failing the scaffold. Dependencies are installed with **pnpm** when your machine has it and npm otherwise — the lockfile that produces is what every later command reads, so it never tells you to run the wrong one. |
|
|
98
151
|
| `bitmagic check` | Typecheck (`tsc --noEmit`) against the vendored engine. Fast; does not prove the game runs. |
|
|
99
152
|
| `bitmagic dev [--port <port>] [--editor-port <port>] [--no-open]` | Build, then serve everything and keep it running: `tsc --watch`, `vite` on 3010, and a **Game / Editor** view on 3011 that reloads itself when the project changes. Opens the view in your browser; `--no-open` (or `BITMAGIC_NO_OPEN=1`) skips that. The one command to leave open. See **The dev view** below. |
|
|
100
153
|
| `bitmagic reload [--port <port>]` | Tell a running `bitmagic dev` to reload the browser now. For agents: run it when you finish a round of edits. Exits 0 and does nothing when no dev server is running. |
|
|
@@ -545,7 +598,7 @@ parses one stream whether the command succeeded or not. The exit code remains au
|
|
|
545
598
|
Without `--json` nothing changes: prose goes to stdout as before and no JSON is emitted.
|
|
546
599
|
|
|
547
600
|
The result shape is per-command — `publish` reports `url`/`visibility`/`publishVersion`, `init`
|
|
548
|
-
reports `gameId`/`root`/`dependenciesInstalled`, `upgrade` reports `replaced` and any
|
|
601
|
+
reports `gameId`/`root`/`dependenciesInstalled`/`packageManager`, `upgrade` reports `replaced` and any
|
|
549
602
|
`missingDependencies` as structured entries rather than only as a printed install command, plus
|
|
550
603
|
`cliUpdate` (`{ current, latest, updateAvailable }`, or `null` when the engine did not move and so
|
|
551
604
|
no check was made — which is not the same as "no update").
|
package/dist/commands/init.js
CHANGED
|
@@ -5,6 +5,7 @@ import * as os from 'os';
|
|
|
5
5
|
import * as path from 'path';
|
|
6
6
|
import { spawnSync } from 'child_process';
|
|
7
7
|
import { CliError } from '../errors.js';
|
|
8
|
+
import { installAllCommand, preferredInstallManager, } from '../project/package-manager.js';
|
|
8
9
|
import { resolveEnvironmentForCommand, resolveAuth0ClientId } from '../config/environments.js';
|
|
9
10
|
import { getAccessToken } from '../auth/session.js';
|
|
10
11
|
import { apiPost } from '../http/client.js';
|
|
@@ -36,17 +37,24 @@ function assertScaffoldable(dir, force) {
|
|
|
36
37
|
}
|
|
37
38
|
}
|
|
38
39
|
/**
|
|
39
|
-
*
|
|
40
|
-
* common and have nothing to do with whether the scaffold itself is
|
|
41
|
-
* not be reported as a scaffold failure — the project on disk is
|
|
42
|
-
* only its dependencies are missing. Returns whether it succeeded so
|
|
43
|
-
* they tell the creator to do next — `bitmagic check` cannot run without
|
|
40
|
+
* Installing dependencies is the least reliable step: network flakiness or a broken local
|
|
41
|
+
* package-manager config are common and have nothing to do with whether the scaffold itself is
|
|
42
|
+
* correct. Its failure must not be reported as a scaffold failure — the project on disk is
|
|
43
|
+
* already complete and valid, only its dependencies are missing. Returns whether it succeeded so
|
|
44
|
+
* callers can adjust what they tell the creator to do next — `bitmagic check` cannot run without
|
|
45
|
+
* node_modules.
|
|
46
|
+
*
|
|
47
|
+
* The manager is chosen per machine rather than fixed (`preferredInstallManager`), and named out
|
|
48
|
+
* loud on the way past: which one ran decides the lockfile, and the lockfile decides what every
|
|
49
|
+
* later command tells this creator to type.
|
|
44
50
|
*/
|
|
45
|
-
function installDependencies(dir) {
|
|
46
|
-
|
|
51
|
+
function installDependencies(output, dir, manager) {
|
|
52
|
+
output.info(`Installing dependencies with ${manager}.`);
|
|
53
|
+
const result = spawnSync(manager, ['install'], { cwd: dir, stdio: 'inherit' });
|
|
47
54
|
if (result.error || result.status !== 0) {
|
|
48
|
-
|
|
49
|
-
|
|
55
|
+
const command = installAllCommand(manager);
|
|
56
|
+
console.warn(`Warning: \`${command}\` failed. The project was scaffolded successfully — only its ` +
|
|
57
|
+
`dependencies are missing. cd into ${dir} and run \`${command}\` yourself.`);
|
|
50
58
|
return false;
|
|
51
59
|
}
|
|
52
60
|
return true;
|
|
@@ -66,7 +74,7 @@ function installDependencies(dir) {
|
|
|
66
74
|
* arriving after it. Generating one afterwards works identically — it is simply no longer something
|
|
67
75
|
* to look at during the wait.
|
|
68
76
|
*/
|
|
69
|
-
function printNextSteps(output, dir, gameId, installSucceeded, hasIdea) {
|
|
77
|
+
function printNextSteps(output, dir, gameId, installSucceeded, manager, hasIdea) {
|
|
70
78
|
output.info('');
|
|
71
79
|
output.info(`Created ${dir} (game ${gameId}).`);
|
|
72
80
|
// Notice at the moment the engine actually lands on their disk, which is the strongest place
|
|
@@ -79,7 +87,9 @@ function printNextSteps(output, dir, gameId, installSucceeded, hasIdea) {
|
|
|
79
87
|
output.info('Next steps:');
|
|
80
88
|
output.info(` cd ${dir}`);
|
|
81
89
|
if (!installSucceeded) {
|
|
82
|
-
|
|
90
|
+
// The manager that just failed, not a fixed one: a retry under a different manager than the
|
|
91
|
+
// half-written tree expects is how you turn a missing node_modules into a broken one.
|
|
92
|
+
output.info(` ${installAllCommand(manager)}`);
|
|
83
93
|
}
|
|
84
94
|
output.info(' bitmagic dev # IN THE BACKGROUND — it never exits. Opens a browser on the URL');
|
|
85
95
|
output.info(' # it prints (http://localhost:3011/ by default).');
|
|
@@ -199,8 +209,9 @@ export const initCommand = defineCommand({
|
|
|
199
209
|
projectName,
|
|
200
210
|
...(args.idea !== undefined ? { idea: args.idea } : {}),
|
|
201
211
|
});
|
|
202
|
-
const
|
|
203
|
-
|
|
212
|
+
const manager = preferredInstallManager();
|
|
213
|
+
const installSucceeded = installDependencies(output, targetDir, manager);
|
|
214
|
+
printNextSteps(output, targetDir, created.gameId, installSucceeded, manager, args.idea !== undefined);
|
|
204
215
|
output.result({
|
|
205
216
|
ok: true,
|
|
206
217
|
gameId: created.gameId,
|
|
@@ -215,6 +226,9 @@ export const initCommand = defineCommand({
|
|
|
215
226
|
environment: environment.name,
|
|
216
227
|
// An agent needs to know whether to run the install itself before anything else works.
|
|
217
228
|
dependenciesInstalled: installSucceeded,
|
|
229
|
+
// And which manager to run it WITH — the machine decides that, so an agent cannot assume
|
|
230
|
+
// npm. Reported even on success, because it is also what the project's lockfile now is.
|
|
231
|
+
packageManager: manager,
|
|
218
232
|
// Whether the design doc still needs writing before `bitmagic cover` has anything to read.
|
|
219
233
|
designDocSeeded: args.idea !== undefined,
|
|
220
234
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,YAAY,EAAe,MAAM,cAAc,CAAC;AACzD,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,4BAA4B,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAC/F,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AACvG,OAAO,EACL,mBAAmB,EACnB,gCAAgC,EAChC,iBAAiB,EACjB,eAAe,EACf,eAAe,GAEhB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAGlE,MAAM,IAAI,GAAG;IACX,KAAK,EAAE,UAAU,CAAC,KAAK;IACvB,KAAK,EAAE,CAAC,EAAU,EAAE,EAAE,CAAC,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;CAC/E,CAAC;AAMF,oGAAoG;AACpG,SAAS,kBAAkB,CAAC,GAAW,EAAE,KAAc;IACrD,IAAI,KAAK;QAAE,OAAO;IAClB,IAAI,OAAiB,CAA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aACxD,CAAC,CAAC;YAEH,MAAM,OAAO,GAAG,uBAAuB,EAAE,CAAC;YAC1C,MAAM,gBAAgB,GAAG,mBAAmB,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;YACzE,cAAc,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC,MAAM,EAAE,gBAAgB,EAAE,OAAO,EAAE,IAAI,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC;YACtG,MAAM,CAAC,MAAM,CAAC;gBACZ,EAAE,EAAE,IAAI;gBACR,MAAM,EAAE,OAAO,CAAC,MAAM;gBACtB,IAAI,EAAE,SAAS;gBACf,QAAQ,EAAE,QAAQ,CAAC,EAAE;gBACrB,uFAAuF;gBACvF,iFAAiF;gBACjF,cAAc;gBACd,KAAK,EAAE,QAAQ,CAAC,KAAK;gBACrB,aAAa,EAAE,QAAQ,CAAC,OAAO;gBAC/B,0FAA0F;gBAC1F,WAAW,EAAE,WAAW,CAAC,IAAI;gBAC7B,uFAAuF;gBACvF,qBAAqB,EAAE,gBAAgB;gBACvC,yFAAyF;gBACzF,wFAAwF;gBACxF,cAAc,EAAE,OAAO;gBACvB,2FAA2F;gBAC3F,eAAe,EAAE,IAAI,CAAC,IAAI,KAAK,SAAS;aACzC,CAAC,CAAC;QACL,CAAC;gBAAS,CAAC;YACT,EAAE,CAAC,MAAM,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;QACvD,CAAC;IACH,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
export type PackageManager = 'pnpm' | 'yarn' | 'npm';
|
|
2
2
|
/**
|
|
3
|
-
* Decide from the project's lockfile. npm is the fallback: it is what
|
|
4
|
-
*
|
|
3
|
+
* Decide from the project's lockfile. npm is the fallback: it is what ships with Node, so it is
|
|
4
|
+
* the right guess for a tree with no lockfile at all — one assembled by hand, or one whose
|
|
5
|
+
* `bitmagic init` install never got to write one.
|
|
5
6
|
*
|
|
6
7
|
* Checked most-specific-first — a repo can carry both a `pnpm-lock.yaml` and a leftover
|
|
7
8
|
* `package-lock.json`, and pnpm is the one actually in use there.
|
|
9
|
+
*
|
|
10
|
+
* Note this reads a fact about an EXISTING project, which is why `bitmagic init` preferring pnpm
|
|
11
|
+
* (`preferredInstallManager`) changes nothing here: the install writes a lockfile, and from then
|
|
12
|
+
* on the lockfile is the answer. A project scaffolded before that change keeps its
|
|
13
|
+
* `package-lock.json` and keeps being told about npm, which is what its tree actually wants.
|
|
8
14
|
*/
|
|
9
15
|
export declare function detectPackageManager(root: string): PackageManager;
|
|
10
16
|
/**
|
|
@@ -15,3 +21,20 @@ export declare function detectPackageManager(root: string): PackageManager;
|
|
|
15
21
|
export declare function addCommand(manager: PackageManager, dev: boolean, specs: string[]): string;
|
|
16
22
|
/** The command that installs everything already declared in package.json. */
|
|
17
23
|
export declare function installAllCommand(manager: PackageManager): string;
|
|
24
|
+
/** Whether a command answers `--version`, i.e. is on this machine's PATH and runnable. */
|
|
25
|
+
export type CommandProbe = (command: string) => boolean;
|
|
26
|
+
/**
|
|
27
|
+
* The manager a BRAND-NEW project should be installed with: pnpm when the machine has it, npm
|
|
28
|
+
* otherwise.
|
|
29
|
+
*
|
|
30
|
+
* pnpm is preferred because it is what this project's own tooling is built and tested against,
|
|
31
|
+
* and because its stricter linking surfaces a dependency the project uses but never declared —
|
|
32
|
+
* npm's hoisting hides exactly that until a published bundle is missing a module.
|
|
33
|
+
*
|
|
34
|
+
* It is a preference rather than a requirement because npm ships with Node and pnpm does not.
|
|
35
|
+
* Scaffolding is the creator's first command; failing it over a package manager, when the very
|
|
36
|
+
* next thing the CLI does is write a complete and valid project to disk, would be the wrong
|
|
37
|
+
* trade. The lockfile the install writes is what every later message reads
|
|
38
|
+
* (`detectPackageManager`), so a project is self-consistent whichever branch it took.
|
|
39
|
+
*/
|
|
40
|
+
export declare function preferredInstallManager(probe?: CommandProbe): PackageManager;
|
|
@@ -12,14 +12,21 @@
|
|
|
12
12
|
* Kept in `project/` rather than inside a command, because both `commands/upgrade.ts` and
|
|
13
13
|
* `project/context.ts` need it and a command module must not be imported from `project/`.
|
|
14
14
|
*/
|
|
15
|
+
import { spawnSync } from 'child_process';
|
|
15
16
|
import * as fs from 'fs';
|
|
16
17
|
import * as path from 'path';
|
|
17
18
|
/**
|
|
18
|
-
* Decide from the project's lockfile. npm is the fallback: it is what
|
|
19
|
-
*
|
|
19
|
+
* Decide from the project's lockfile. npm is the fallback: it is what ships with Node, so it is
|
|
20
|
+
* the right guess for a tree with no lockfile at all — one assembled by hand, or one whose
|
|
21
|
+
* `bitmagic init` install never got to write one.
|
|
20
22
|
*
|
|
21
23
|
* Checked most-specific-first — a repo can carry both a `pnpm-lock.yaml` and a leftover
|
|
22
24
|
* `package-lock.json`, and pnpm is the one actually in use there.
|
|
25
|
+
*
|
|
26
|
+
* Note this reads a fact about an EXISTING project, which is why `bitmagic init` preferring pnpm
|
|
27
|
+
* (`preferredInstallManager`) changes nothing here: the install writes a lockfile, and from then
|
|
28
|
+
* on the lockfile is the answer. A project scaffolded before that change keeps its
|
|
29
|
+
* `package-lock.json` and keeps being told about npm, which is what its tree actually wants.
|
|
23
30
|
*/
|
|
24
31
|
export function detectPackageManager(root) {
|
|
25
32
|
if (fs.existsSync(path.join(root, 'pnpm-lock.yaml')))
|
|
@@ -45,4 +52,25 @@ export function addCommand(manager, dev, specs) {
|
|
|
45
52
|
export function installAllCommand(manager) {
|
|
46
53
|
return `${manager} install`;
|
|
47
54
|
}
|
|
55
|
+
function respondsToVersion(command) {
|
|
56
|
+
const result = spawnSync(command, ['--version'], { stdio: 'ignore' });
|
|
57
|
+
return result.error === undefined && result.status === 0;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* The manager a BRAND-NEW project should be installed with: pnpm when the machine has it, npm
|
|
61
|
+
* otherwise.
|
|
62
|
+
*
|
|
63
|
+
* pnpm is preferred because it is what this project's own tooling is built and tested against,
|
|
64
|
+
* and because its stricter linking surfaces a dependency the project uses but never declared —
|
|
65
|
+
* npm's hoisting hides exactly that until a published bundle is missing a module.
|
|
66
|
+
*
|
|
67
|
+
* It is a preference rather than a requirement because npm ships with Node and pnpm does not.
|
|
68
|
+
* Scaffolding is the creator's first command; failing it over a package manager, when the very
|
|
69
|
+
* next thing the CLI does is write a complete and valid project to disk, would be the wrong
|
|
70
|
+
* trade. The lockfile the install writes is what every later message reads
|
|
71
|
+
* (`detectPackageManager`), so a project is self-consistent whichever branch it took.
|
|
72
|
+
*/
|
|
73
|
+
export function preferredInstallManager(probe = respondsToVersion) {
|
|
74
|
+
return probe('pnpm') ? 'pnpm' : 'npm';
|
|
75
|
+
}
|
|
48
76
|
//# sourceMappingURL=package-manager.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package-manager.js","sourceRoot":"","sources":["../../src/project/package-manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAI7B
|
|
1
|
+
{"version":3,"file":"package-manager.js","sourceRoot":"","sources":["../../src/project/package-manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAI7B;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,oBAAoB,CAAC,IAAY;IAC/C,IAAI,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAC;QAAE,OAAO,MAAM,CAAC;IACpE,IAAI,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;QAAE,O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magic init` installs with pnpm when the machine has it, and pnpm 10 refuses to run a
|
|
156
|
+
// dependency's install script until it is approved. esbuild (under vite) is the only one that
|
|
157
|
+
// asks here, and it does not need its script: modern esbuild ships its platform binary as an
|
|
158
|
+
// optional dependency, and `vite build` is verified to work with the script skipped.
|
|
159
|
+
//
|
|
160
|
+
// Naming it here is what stops pnpm printing a box telling the creator to run
|
|
161
|
+
// `pnpm approve-builds` on their very first command — a prompt that is INTERACTIVE, and so
|
|
162
|
+
// hangs an agent driving the CLI rather than failing it. npm and yarn ignore this field.
|
|
163
|
+
pnpm: { ignoredBuiltDependencies: ['esbuild'] },
|
|
155
164
|
});
|
|
156
165
|
}
|
|
157
166
|
export function renderTsconfig() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-files.js","sourceRoot":"","sources":["../../src/scaffold/project-files.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAE/D,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAKjF;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG;;;;;;;;;;;;;;;;;;IAkBnC,CAAC;AAEL;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,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;IACjB,4FAA4F;IAC5F,6FAA6F;IAC7F,4CAA4C;CACZ,CAAC;AAEnC,MAAM,CAAC,MAAM,gBAAgB,GAA2B;IACtD,aAAa,EAAE,UAAU;IACzB,cAAc,EAAE,UAAU;IAC1B,8FAA8F;IAC9F,cAAc,EAAE,QAAQ;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AAC;AACF,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,oBAAoB;IAClC,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwIR,CAAC;AACF,CAAC;AAED,MAAM,UAAU,mBAAmB;IACjC,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqFR,CAAC;AACF,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,gBAAgB;IAC9B,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8DR,CAAC;AACF,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,kBAAkB,CAAC,IAAa;IAC9C,MAAM,KAAK,GAAG,IAAI,EAAE,IAAI,EAAE,CAAC;IAC3B,OAAO;;EAEP,KAAK;QACH,CAAC,CAAC,8GAA8G;QAChH,CAAC,CAAC,0KAA0K;;;;EAI9K,KAAK,IAAI,iEAAiE;;;;;;;;;;;;;;CAc3E,CAAC;AACF,CAAC;AAED,MAAM,UAAU,cAAc;IAC5B,OAAO,cAAc,CAAC;AACxB,CAAC;AAED,MAAM,UAAU,kBAAkB;IAChC,OAAO;;;;;;;;;;;;;;;;;;;;;;CAsBR,CAAC;AACF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bitmagic/cli",
|
|
3
|
-
"version": "0.1.46
|
|
3
|
+
"version": "0.1.46",
|
|
4
4
|
"description": "Build Bitmagic games from your own agent tool",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"author": "Bitmagic Oy",
|
|
@@ -23,9 +23,9 @@
|
|
|
23
23
|
"fflate": "^0.8.2",
|
|
24
24
|
"playwright-core": "^1.59.1",
|
|
25
25
|
"tar": "^7.4.3",
|
|
26
|
-
"@bitmagic/animation-forger": "0.1.1
|
|
27
|
-
"@bitmagic/
|
|
28
|
-
"@bitmagic/
|
|
26
|
+
"@bitmagic/animation-forger": "0.1.1",
|
|
27
|
+
"@bitmagic/world-forger": "0.1.6",
|
|
28
|
+
"@bitmagic/asset-core": "0.2.1"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@eslint/js": "^9.38.0",
|