@greatstore/cli 0.0.14 → 0.0.15

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,11 @@
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.15 — 2026-05-24
7
+
8
+ ### Added
9
+ - `gs init <name>` scaffold now declares the four GreatStore-injected lifecycle props (`onSendMessage`, `onCallTool`, `onClose`, and the new `onError(message)`) on the `Props` interface with inline comments. `onError` lets a component surface in-flight failures (failed fetch, host-page action rejected, invalid host state) back to the in-store AI so it can apologize or self-correct on its next turn. Render-time crashes are reported automatically by the GreatStore error boundary — `onError` is for *expected* failures the boundary can't catch.
10
+
6
11
  ## 0.0.14 — 2026-05-24
7
12
 
8
13
  ### Changed
package/dist/cli.js CHANGED
@@ -1118,7 +1118,25 @@ function component(name) {
1118
1118
  return `import React from "react";
1119
1119
 
1120
1120
  interface Props {
1121
+ // ---- Your tool args ----
1121
1122
  // Add fields here matching manifest.json#inputSchema.properties.
1123
+
1124
+ // ---- GreatStore-injected lifecycle props (always present) ----
1125
+ // Send text into the chat as if the shopper typed it.
1126
+ onSendMessage: (text: string) => void;
1127
+ // Chain into another remote-component tool by name.
1128
+ onCallTool: (name: string, args: Record<string, unknown>) => void;
1129
+ // Dismiss the host slot (over-input clears the overlay, fullscreen
1130
+ // reverts the pane, inline is a no-op).
1131
+ onClose: () => void;
1132
+ // Tell the in-store AI something went wrong so it can apologize or
1133
+ // self-correct on its next turn. Use for *expected* failures inside
1134
+ // async handlers (failed fetch, host-page action rejected, invalid
1135
+ // host state). Render-time crashes are reported automatically by
1136
+ // the GreatStore error boundary \u2014 you don't need a try/catch just
1137
+ // to forward exceptions. The message is read by the AI, not the
1138
+ // shopper, so write it like a short engineering note.
1139
+ onError: (message: string) => void;
1122
1140
  }
1123
1141
 
1124
1142
  export default function ${pascal(name)}(_props: Props): React.ReactElement {
@@ -1431,8 +1449,8 @@ function recentChangelog(text, minItems = 15) {
1431
1449
  }
1432
1450
 
1433
1451
  // src/index.ts
1434
- var VERSION = true ? "0.0.14" : "0.0.0-dev";
1435
- 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.14 \u2014 2026-05-24\n\n### Changed\n- `gs build` output is now whitespace-minified. Vite's lib mode in `es` format only minifies identifiers / syntax and preserves all whitespace + `/* @__PURE__ */` annotations for downstream tree-shaking. Since the bundles are loaded directly by the browser at runtime (no downstream bundler), the CLI now post-processes each `bundle.js` with `esbuild.transform` to collapse whitespace and strip legal comments \u2014 typically ~50% smaller files, cheaper to host and faster to ship.\n\n## 0.0.13 \u2014 2026-05-24\n\n### Changed\n- `gs build` now prints a closing hint naming the next steps (`gs push`, then `gs publish <name>`) so AI assistants driving the CLI don't stop at \"built\" and leave the change unshipped.\n\n## 0.0.12 \u2014 2026-05-24\n\n### Fixed\n- `gs build` failed with `Error: build is not a function` because `require.resolve(\"vite\")` lands on Vite 5's deprecated CJS entry. The CLI now walks `vite/package.json#exports.import` to load the ESM build, and falls back to the CJS-default shape if a host package ships only CJS.\n\n## 0.0.11 \u2014 2026-05-24\n\n### Added\n- Multi-component projects: scaffold one root, then add N components under `components/<name>/`. `gs init` (no args) writes the project root; `gs init <name>` adds a component (auto-scaffolds the root if missing).\n- `gs build [<name>]` \u2014 compiles every `components/<name>/bundle.js` via the project's local Vite. Externals + runtime shim paths now live in the CLI, so future versions can adjust them without a re-scaffold.\n- `gs push` (no args) hashes each component against `.gssync.json` and uploads only the changed ones.\n- `gs pull` (no args, or `*`) batch-pulls every remote component. Components with uncommitted local edits are skipped with a warning; `--force` overwrites.\n- Public `CHANGELOG.md`. `gs --version` now prints the most recent entries.\n\n### Changed\n- A project folder ships to exactly one store. Only `gs init` accepts `--store`; every other command reads the slug from `.gsrc`. The legacy single-component layout is rejected with a migration hint.\n- `gs init` errors on a fresh root without `--store <slug>` (no placeholder slug is written). On an existing root, passing `--store` errors.\n- `gs init` no longer writes `build.mjs`. Scaffolded `package.json` scripts run `gs build`.\n\n## 0.0.10 \u2014 2026-05-23\n\n### Changed\n- The OAuth callback tab opened by `gs login` auto-closes once credentials are persisted.\n\n## 0.0.9 \u2014 2026-05-23\n\n### Changed\n- `gs init` scaffold writes a `displayName` into the generated manifest so the admin Builder UI has a friendlier label.\n\n## 0.0.8 \u2014 2026-05-23\n\n### Changed\n- `gs push` and `gs publish` print a permalink to the component's card in the admin Builder panel.\n\n## 0.0.6 \u2014 2026-05-23\n\n### Changed\n- `gs --version` reads the version from `cli/package.json` at build time so it can't drift from the published release.\n\n## 0.0.4 \u2014 2026-05-23\n\n### Changed\n- Scaffolded projects produce browser-ready bundles (React + runtime shim wired up).\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- Read the nav OAuth callback parameter as `code` instead of `token`.\n" : "";
1452
+ var VERSION = true ? "0.0.15" : "0.0.0-dev";
1453
+ 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.15 \u2014 2026-05-24\n\n### Added\n- `gs init <name>` scaffold now declares the four GreatStore-injected lifecycle props (`onSendMessage`, `onCallTool`, `onClose`, and the new `onError(message)`) on the `Props` interface with inline comments. `onError` lets a component surface in-flight failures (failed fetch, host-page action rejected, invalid host state) back to the in-store AI so it can apologize or self-correct on its next turn. Render-time crashes are reported automatically by the GreatStore error boundary \u2014 `onError` is for *expected* failures the boundary can't catch.\n\n## 0.0.14 \u2014 2026-05-24\n\n### Changed\n- `gs build` output is now whitespace-minified. Vite's lib mode in `es` format only minifies identifiers / syntax and preserves all whitespace + `/* @__PURE__ */` annotations for downstream tree-shaking. Since the bundles are loaded directly by the browser at runtime (no downstream bundler), the CLI now post-processes each `bundle.js` with `esbuild.transform` to collapse whitespace and strip legal comments \u2014 typically ~50% smaller files, cheaper to host and faster to ship.\n\n## 0.0.13 \u2014 2026-05-24\n\n### Changed\n- `gs build` now prints a closing hint naming the next steps (`gs push`, then `gs publish <name>`) so AI assistants driving the CLI don't stop at \"built\" and leave the change unshipped.\n\n## 0.0.12 \u2014 2026-05-24\n\n### Fixed\n- `gs build` failed with `Error: build is not a function` because `require.resolve(\"vite\")` lands on Vite 5's deprecated CJS entry. The CLI now walks `vite/package.json#exports.import` to load the ESM build, and falls back to the CJS-default shape if a host package ships only CJS.\n\n## 0.0.11 \u2014 2026-05-24\n\n### Added\n- Multi-component projects: scaffold one root, then add N components under `components/<name>/`. `gs init` (no args) writes the project root; `gs init <name>` adds a component (auto-scaffolds the root if missing).\n- `gs build [<name>]` \u2014 compiles every `components/<name>/bundle.js` via the project's local Vite. Externals + runtime shim paths now live in the CLI, so future versions can adjust them without a re-scaffold.\n- `gs push` (no args) hashes each component against `.gssync.json` and uploads only the changed ones.\n- `gs pull` (no args, or `*`) batch-pulls every remote component. Components with uncommitted local edits are skipped with a warning; `--force` overwrites.\n- Public `CHANGELOG.md`. `gs --version` now prints the most recent entries.\n\n### Changed\n- A project folder ships to exactly one store. Only `gs init` accepts `--store`; every other command reads the slug from `.gsrc`. The legacy single-component layout is rejected with a migration hint.\n- `gs init` errors on a fresh root without `--store <slug>` (no placeholder slug is written). On an existing root, passing `--store` errors.\n- `gs init` no longer writes `build.mjs`. Scaffolded `package.json` scripts run `gs build`.\n\n## 0.0.10 \u2014 2026-05-23\n\n### Changed\n- The OAuth callback tab opened by `gs login` auto-closes once credentials are persisted.\n\n## 0.0.9 \u2014 2026-05-23\n\n### Changed\n- `gs init` scaffold writes a `displayName` into the generated manifest so the admin Builder UI has a friendlier label.\n\n## 0.0.8 \u2014 2026-05-23\n\n### Changed\n- `gs push` and `gs publish` print a permalink to the component's card in the admin Builder panel.\n\n## 0.0.6 \u2014 2026-05-23\n\n### Changed\n- `gs --version` reads the version from `cli/package.json` at build time so it can't drift from the published release.\n\n## 0.0.4 \u2014 2026-05-23\n\n### Changed\n- Scaffolded projects produce browser-ready bundles (React + runtime shim wired up).\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- Read the nav OAuth callback parameter as `code` instead of `token`.\n" : "";
1436
1454
  var HELP = `gs \u2014 GreatStore CLI (v${VERSION})
1437
1455
 
1438
1456
  Usage:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@greatstore/cli",
3
- "version": "0.0.14",
3
+ "version": "0.0.15",
4
4
  "description": "CLI for authoring and shipping GreatStore custom components.",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",