@greatstore/cli 0.0.17 → 0.0.18
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/CHANGELOG.md +7 -0
- package/dist/cli.js +44 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,13 @@
|
|
|
3
3
|
All notable changes to `@greatstore/cli` are recorded here. The format
|
|
4
4
|
follows [Keep a Changelog](https://keepachangelog.com/).
|
|
5
5
|
|
|
6
|
+
## 0.0.18 — 2026-05-28
|
|
7
|
+
|
|
8
|
+
### Changed
|
|
9
|
+
- Push and publish errors now name the specific reason — including
|
|
10
|
+
every failing field in `manifest.json` — instead of the previous
|
|
11
|
+
generic message.
|
|
12
|
+
|
|
6
13
|
## 0.0.17 — 2026-05-28
|
|
7
14
|
|
|
8
15
|
### Added
|
package/dist/cli.js
CHANGED
|
@@ -374,7 +374,48 @@ async function sendOnce(url, options, accessToken) {
|
|
|
374
374
|
parsed = JSON.parse(text);
|
|
375
375
|
} catch {
|
|
376
376
|
}
|
|
377
|
-
|
|
377
|
+
const identifier = parsed.code ?? parsed.error;
|
|
378
|
+
const message = buildErrorMessage(res.status, identifier, parsed.detail);
|
|
379
|
+
throw new HttpError(res.status, message, parsed.code ?? parsed.error);
|
|
380
|
+
}
|
|
381
|
+
var KNOWN_ERROR_MESSAGES = {
|
|
382
|
+
// /api/builder/components/:name — parseName()
|
|
383
|
+
INVALID_NAME: {
|
|
384
|
+
message: "Invalid component name. Use lowercase letters, digits, and underscores, starting with a letter."
|
|
385
|
+
},
|
|
386
|
+
// commitDraft() / promote() / unpublish() — StoreComponentFailure
|
|
387
|
+
not_found: { message: "Component not found on the server." },
|
|
388
|
+
concurrent_write: {
|
|
389
|
+
message: "Another change landed before this one. Run `gs pull` and try again."
|
|
390
|
+
},
|
|
391
|
+
name_mismatch: {
|
|
392
|
+
message: "Manifest `name` does not match the component folder name.",
|
|
393
|
+
includeDetail: true
|
|
394
|
+
},
|
|
395
|
+
manifest_invalid: {
|
|
396
|
+
message: "manifest.json is invalid.",
|
|
397
|
+
includeDetail: true
|
|
398
|
+
},
|
|
399
|
+
bundle_too_large: {
|
|
400
|
+
message: "bundle.js is too large."
|
|
401
|
+
},
|
|
402
|
+
bundle_not_module: {
|
|
403
|
+
message: "bundle.js is not a valid ES module."
|
|
404
|
+
},
|
|
405
|
+
source_too_large: {
|
|
406
|
+
message: "component.tsx is too large."
|
|
407
|
+
}
|
|
408
|
+
};
|
|
409
|
+
function buildErrorMessage(status, identifier, detail) {
|
|
410
|
+
if (identifier && identifier in KNOWN_ERROR_MESSAGES) {
|
|
411
|
+
const entry = KNOWN_ERROR_MESSAGES[identifier];
|
|
412
|
+
if (!entry) return genericMessage(status);
|
|
413
|
+
if (entry.includeDetail && detail) {
|
|
414
|
+
return `${entry.message} (${detail})`;
|
|
415
|
+
}
|
|
416
|
+
return entry.message;
|
|
417
|
+
}
|
|
418
|
+
return genericMessage(status);
|
|
378
419
|
}
|
|
379
420
|
function genericMessage(status) {
|
|
380
421
|
if (status === 401) return "Sign-in needed. Run `gs login`.";
|
|
@@ -1544,8 +1585,8 @@ function parseVer(v) {
|
|
|
1544
1585
|
}
|
|
1545
1586
|
|
|
1546
1587
|
// src/index.ts
|
|
1547
|
-
var VERSION = true ? "0.0.
|
|
1548
|
-
var CHANGELOG = true ? "# Changelog\n\nAll notable changes to `@greatstore/cli` are recorded here. The format\nfollows [Keep a Changelog](https://keepachangelog.com/).\n\n## 0.0.17 \u2014 2026-05-28\n\n### Added\n- Each command now prints a one-line upgrade notice when a newer\n `@greatstore/cli` is available on npm.\n\n## 0.0.16 \u2014 2026-05-28\n\n### Changed\n- Simplified error messages.\n\n## 0.0.15 \u2014 2026-05-24\n\n### Added\n- Scaffolded `component.tsx` now declares the four injected lifecycle\n props (`onSendMessage`, `onCallTool`, `onClose`, `onError`) on\n `Props`. Use `onError(message)` to report expected failures (failed\n fetch, host action rejected, invalid host state) so the AI can\n recover on its next turn. Render-time crashes are reported for you.\n\n## 0.0.14 \u2014 2026-05-24\n\n### Changed\n- `gs build` output is now whitespace-minified \u2014 typically ~50% smaller.\n\n## 0.0.13 \u2014 2026-05-24\n\n### Changed\n- `gs build` prints the next-step hint (`gs push`, then `gs publish`).\n\n## 0.0.12 \u2014 2026-05-24\n\n### Fixed\n- `gs build` failing to load Vite in some setups.\n\n## 0.0.11 \u2014 2026-05-24\n\n### Added\n- Multi-component projects. `gs init` (no args) scaffolds the project\n root; `gs init <name>` adds a component under `components/<name>/`.\n- `gs build [<name>]` \u2014 compiles every `components/<name>/bundle.js`.\n- `gs push` (no args) uploads only the components that changed.\n- `gs pull` (no args, or `*`) downloads every component. Locally\n edited components are skipped; pass `--force` to overwrite.\n- Public `CHANGELOG.md`; `gs --version` prints recent entries.\n\n### Changed\n- A project folder ships to exactly one store. Only `gs init` accepts\n `--store`; every other command reads the slug from `.gsrc`. The old\n single-component layout is rejected with a migration hint.\n- `gs init` requires `--store <slug>` for a fresh root, and rejects\n `--store` on an existing root.\n- `gs init` no longer writes `build.mjs` \u2014 scripts call `gs build`.\n\n## 0.0.10 \u2014 2026-05-23\n\n### Changed\n- The sign-in browser tab auto-closes once `gs login` finishes.\n\n## 0.0.9 \u2014 2026-05-23\n\n### Changed\n- Scaffolded manifests include a `displayName` so the admin UI has a\n friendlier label.\n\n## 0.0.8 \u2014 2026-05-23\n\n### Changed\n- `gs push` and `gs publish` print a link to view the component.\n\n## 0.0.6 \u2014 2026-05-23\n\n### Changed\n- `gs --version` reads from the published package version.\n\n## 0.0.4 \u2014 2026-05-23\n\n### Changed\n- Scaffolded projects produce browser-ready bundles out of the box.\n\n## 0.0.3 \u2014 2026-05-23\n\n### Changed\n- Trimmed public README to the essentials.\n\n## 0.0.2 \u2014 2026-05-23\n\n### Fixed\n- Sign-in callback parameter handling.\n" : "";
|
|
1588
|
+
var VERSION = true ? "0.0.18" : "0.0.0-dev";
|
|
1589
|
+
var CHANGELOG = true ? "# Changelog\n\nAll notable changes to `@greatstore/cli` are recorded here. The format\nfollows [Keep a Changelog](https://keepachangelog.com/).\n\n## 0.0.18 \u2014 2026-05-28\n\n### Changed\n- Push and publish errors now name the specific reason \u2014 including\n every failing field in `manifest.json` \u2014 instead of the previous\n generic message.\n\n## 0.0.17 \u2014 2026-05-28\n\n### Added\n- Each command now prints a one-line upgrade notice when a newer\n `@greatstore/cli` is available on npm.\n\n## 0.0.16 \u2014 2026-05-28\n\n### Changed\n- Simplified error messages.\n\n## 0.0.15 \u2014 2026-05-24\n\n### Added\n- Scaffolded `component.tsx` now declares the four injected lifecycle\n props (`onSendMessage`, `onCallTool`, `onClose`, `onError`) on\n `Props`. Use `onError(message)` to report expected failures (failed\n fetch, host action rejected, invalid host state) so the AI can\n recover on its next turn. Render-time crashes are reported for you.\n\n## 0.0.14 \u2014 2026-05-24\n\n### Changed\n- `gs build` output is now whitespace-minified \u2014 typically ~50% smaller.\n\n## 0.0.13 \u2014 2026-05-24\n\n### Changed\n- `gs build` prints the next-step hint (`gs push`, then `gs publish`).\n\n## 0.0.12 \u2014 2026-05-24\n\n### Fixed\n- `gs build` failing to load Vite in some setups.\n\n## 0.0.11 \u2014 2026-05-24\n\n### Added\n- Multi-component projects. `gs init` (no args) scaffolds the project\n root; `gs init <name>` adds a component under `components/<name>/`.\n- `gs build [<name>]` \u2014 compiles every `components/<name>/bundle.js`.\n- `gs push` (no args) uploads only the components that changed.\n- `gs pull` (no args, or `*`) downloads every component. Locally\n edited components are skipped; pass `--force` to overwrite.\n- Public `CHANGELOG.md`; `gs --version` prints recent entries.\n\n### Changed\n- A project folder ships to exactly one store. Only `gs init` accepts\n `--store`; every other command reads the slug from `.gsrc`. The old\n single-component layout is rejected with a migration hint.\n- `gs init` requires `--store <slug>` for a fresh root, and rejects\n `--store` on an existing root.\n- `gs init` no longer writes `build.mjs` \u2014 scripts call `gs build`.\n\n## 0.0.10 \u2014 2026-05-23\n\n### Changed\n- The sign-in browser tab auto-closes once `gs login` finishes.\n\n## 0.0.9 \u2014 2026-05-23\n\n### Changed\n- Scaffolded manifests include a `displayName` so the admin UI has a\n friendlier label.\n\n## 0.0.8 \u2014 2026-05-23\n\n### Changed\n- `gs push` and `gs publish` print a link to view the component.\n\n## 0.0.6 \u2014 2026-05-23\n\n### Changed\n- `gs --version` reads from the published package version.\n\n## 0.0.4 \u2014 2026-05-23\n\n### Changed\n- Scaffolded projects produce browser-ready bundles out of the box.\n\n## 0.0.3 \u2014 2026-05-23\n\n### Changed\n- Trimmed public README to the essentials.\n\n## 0.0.2 \u2014 2026-05-23\n\n### Fixed\n- Sign-in callback parameter handling.\n" : "";
|
|
1549
1590
|
var HELP = `gs \u2014 GreatStore CLI (v${VERSION})
|
|
1550
1591
|
|
|
1551
1592
|
Usage:
|