@greatstore/cli 0.0.17 → 0.0.19

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 CHANGED
@@ -3,6 +3,20 @@
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.19 — 2026-05-28
7
+
8
+ ### Fixed
9
+ - `gs login` on Windows no longer opens a sign-in URL with parameters
10
+ stripped, which surfaced as a "Missing redirect_uri or state
11
+ parameter" page in the browser.
12
+
13
+ ## 0.0.18 — 2026-05-28
14
+
15
+ ### Changed
16
+ - Push and publish errors now name the specific reason — including
17
+ every failing field in `manifest.json` — instead of the previous
18
+ generic message.
19
+
6
20
  ## 0.0.17 — 2026-05-28
7
21
 
8
22
  ### Added
package/dist/cli.js CHANGED
@@ -157,8 +157,17 @@ function openInBrowser(url, overrideCmd) {
157
157
  return;
158
158
  }
159
159
  try {
160
- const args = cmd === "start" ? ["", url] : [url];
161
- const child = spawn(cmd, args, { stdio: "ignore", detached: true, shell: cmd === "start" });
160
+ let child;
161
+ if (cmd === "start") {
162
+ const command = `start "" "${url}"`;
163
+ child = spawn("cmd.exe", ["/d", "/s", "/c", command], {
164
+ stdio: "ignore",
165
+ detached: true,
166
+ windowsVerbatimArguments: true
167
+ });
168
+ } else {
169
+ child = spawn(cmd, [url], { stdio: "ignore", detached: true });
170
+ }
162
171
  child.on("error", () => {
163
172
  });
164
173
  child.unref();
@@ -374,7 +383,48 @@ async function sendOnce(url, options, accessToken) {
374
383
  parsed = JSON.parse(text);
375
384
  } catch {
376
385
  }
377
- throw new HttpError(res.status, genericMessage(res.status), parsed.code);
386
+ const identifier = parsed.code ?? parsed.error;
387
+ const message = buildErrorMessage(res.status, identifier, parsed.detail);
388
+ throw new HttpError(res.status, message, parsed.code ?? parsed.error);
389
+ }
390
+ var KNOWN_ERROR_MESSAGES = {
391
+ // /api/builder/components/:name — parseName()
392
+ INVALID_NAME: {
393
+ message: "Invalid component name. Use lowercase letters, digits, and underscores, starting with a letter."
394
+ },
395
+ // commitDraft() / promote() / unpublish() — StoreComponentFailure
396
+ not_found: { message: "Component not found on the server." },
397
+ concurrent_write: {
398
+ message: "Another change landed before this one. Run `gs pull` and try again."
399
+ },
400
+ name_mismatch: {
401
+ message: "Manifest `name` does not match the component folder name.",
402
+ includeDetail: true
403
+ },
404
+ manifest_invalid: {
405
+ message: "manifest.json is invalid.",
406
+ includeDetail: true
407
+ },
408
+ bundle_too_large: {
409
+ message: "bundle.js is too large."
410
+ },
411
+ bundle_not_module: {
412
+ message: "bundle.js is not a valid ES module."
413
+ },
414
+ source_too_large: {
415
+ message: "component.tsx is too large."
416
+ }
417
+ };
418
+ function buildErrorMessage(status, identifier, detail) {
419
+ if (identifier && identifier in KNOWN_ERROR_MESSAGES) {
420
+ const entry = KNOWN_ERROR_MESSAGES[identifier];
421
+ if (!entry) return genericMessage(status);
422
+ if (entry.includeDetail && detail) {
423
+ return `${entry.message} (${detail})`;
424
+ }
425
+ return entry.message;
426
+ }
427
+ return genericMessage(status);
378
428
  }
379
429
  function genericMessage(status) {
380
430
  if (status === 401) return "Sign-in needed. Run `gs login`.";
@@ -1544,8 +1594,8 @@ function parseVer(v) {
1544
1594
  }
1545
1595
 
1546
1596
  // src/index.ts
1547
- var VERSION = true ? "0.0.17" : "0.0.0-dev";
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" : "";
1597
+ var VERSION = true ? "0.0.19" : "0.0.0-dev";
1598
+ 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.19 \u2014 2026-05-28\n\n### Fixed\n- `gs login` on Windows no longer opens a sign-in URL with parameters\n stripped, which surfaced as a "Missing redirect_uri or state\n parameter" page in the browser.\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
1599
  var HELP = `gs \u2014 GreatStore CLI (v${VERSION})
1550
1600
 
1551
1601
  Usage:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@greatstore/cli",
3
- "version": "0.0.17",
3
+ "version": "0.0.19",
4
4
  "description": "CLI for authoring and shipping GreatStore custom components.",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",