create-grist-widget 0.3.1 → 0.3.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-grist-widget",
3
- "version": "0.3.1",
3
+ "version": "0.3.3",
4
4
  "description": "Scaffold a new Grist custom widget from the grist-widget-sdk Vite template",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -25,7 +25,7 @@
25
25
  "bugs": {
26
26
  "url": "https://github.com/ArthurBlanchon/grist-widget-sdk/issues"
27
27
  },
28
- "homepage": "https://grist-widgets.com",
28
+ "homepage": "https://gristwidgets.com",
29
29
  "keywords": [
30
30
  "grist",
31
31
  "widget",
@@ -6,14 +6,14 @@ Base template to build a Grist widget with `grist-widget-sdk`.
6
6
 
7
7
  Opened outside a Grist iframe, `main.tsx` picks between two components purely by URL shape (`src/lib/showcase-routing.ts`, no router needed): a bare path with no recognized channel suffix renders `TemplateLanding` (its own hero, onboarding, and released-version index); `/latest/`, `/dev/`, or `/v<version>/` renders `ChannelNotice` instead — a distinct hero explaining which build this is, chips to jump to any other version/channel (`src/lib/showcase-versions.ts`), and a copy-this-URL helper for pasting into Grist's custom widget field. Both render `ScaffoldFooter` (`src/components/scaffold-footer.tsx`) at the bottom — a small, purely informational note ("Scaffolded from `create-grist-widget@X.Y.Z`") built from `package.json`'s `createGristWidgetVersion` field, which the CLI stamps on every real scaffold (`vite.config.ts` injects it as `__CREATE_GRIST_WIDGET_VERSION__`). Renders nothing if that field is absent, e.g. this pristine template source itself.
8
8
 
9
- When actually embedded, `GristStatusChip` (`src/components/grist-status-chip.tsx`) shows a small pill with live handshake status — connecting, retrying with a countdown, connected, or unavailable — using `useAmbientGristHandshake()` from `grist-widget-sdk/advanced`. It must be mounted *inside* `GristWidgetProvider` (see `src/main.tsx`): it only observes that provider's own handshake manager and never mounts a second one, so it's purely observational and can never duplicate or race the real handshake (see `apps/docs/api/handshake.md`).
9
+ When actually embedded, `GristStatusChip` (`src/components/grist-status-chip.tsx`) shows a small pill with live handshake status — connecting, retrying with a countdown, connected, or unavailable — using `useAmbientGristHandshake()` from `grist-widget-sdk/advanced`. It must be mounted *inside* `GristWidgetProvider` (see `src/main.tsx`): it only observes that provider's own handshake manager and never mounts a second one, so it's purely observational and can never duplicate or race the real handshake (see the [handshake API reference](https://gristwidgets.com/docs/sdk/api/handshake)).
10
10
 
11
11
  `src/App.tsx` uses `useGrist<TaskRow, TaskMapped>()` for the selected row (`w.record`, `w.mode`) and remounts the UI with `key={rowKey}` when the row changes — same pattern as `widgets/create-email-draft`. See `src/grist-types.example.ts` for typing patterns.
12
12
 
13
13
  - **ESLint** blocks direct `grist` global usage in `src/` — use the SDK only.
14
14
  - Uncomment `GRIST_OPTIONS.columns` in `App.tsx` to enable column mapping; `main.tsx` sets `GristBoundary gate="canRender"` when columns are declared. Mapping alerts use `GristSdkAlerts`.
15
15
 
16
- To add widget tests later, see [Testing](https://github.com/ArthurBlanchon/grist-widget-sdk/blob/main/apps/docs/guide/testing.md) (`renderWithGrist` from `grist-widget-sdk/emulator/testing`).
16
+ To add widget tests later, see [Testing](https://gristwidgets.com/docs/sdk/guide/testing) (`renderWithGrist` from `grist-widget-sdk/emulator/testing`).
17
17
 
18
18
  **Monorepo dev:** this template resolves `grist-widget-sdk` from `packages/core/dist` (like the other widgets), not from SDK source. After changing the SDK, run `pnpm prebuild` or `pnpm --filter grist-widget-sdk build` before `pnpm dev`.
19
19
 
@@ -34,29 +34,21 @@ This is the **source** template. It is consumed two ways:
34
34
  standalone `pnpm install` (pnpm 11) exits cleanly; inside the monorepo it's
35
35
  ignored (the root workspace governs).
36
36
 
37
- ### Live preview inside the monorepo (this template's own showcase)
38
-
39
- This repo also deploys this template's own **unmodified** source to its own
40
- GitHub Pages — a live showcase of exactly what `npm create grist-widget`
41
- scaffolds, at `https://arthurblanchon.github.io/grist-widget-sdk/template/`.
42
- Same workflow every widget already uses:
43
-
44
- - Push template changes to the persistent `dev/template-showcase` branch —
45
- every push auto-deploys a live preview at `.../template/dev/` that
46
- self-reloads a few seconds later, same as a scaffolded widget's own `dev`
47
- channel. Kept around permanently (not deleted after each round), so
48
- `.../template/dev/` is always live to preview whatever's currently being
49
- iterated on here.
50
- - Ready to release? **Bump `packages/create-grist-widget/package.json`'s
51
- version**, open a PR from your feature branch into `main`, and merge —
52
- merging is what actually publishes `.../template/v<version>/` +
53
- `.../template/latest/` (and a real `create-grist-widget` npm release,
54
- since that package embeds this template verbatim — see
55
- `scripts/build-template.mjs`). Merging without a version bump publishes
56
- nothing (same idempotent-skip rule as every other deploy pipeline here).
57
-
58
- See `scripts/deploy/template-showcase.mjs` + `.github/workflows/
59
- deploy-template-showcase.yml` (monorepo root) for the pipeline itself.
37
+ ### Live preview
38
+
39
+ This template has no live-preview deploy of its own inside this monorepo —
40
+ that used to exist (a `/template/` showcase on this repo's own GitHub
41
+ Pages) but has been retired. The only live preview of this template's
42
+ current source is external: `template-canary.yml` scaffolds it via the
43
+ *published* `create-grist-widget` package and pushes to the `dev` and
44
+ `canary/latest` branches of
45
+ [`grist-widget-template`](https://github.com/ArthurBlanchon/grist-widget-template)
46
+ after every release — see https://gristwidgets.com/docs/contributing/releasing for the full
47
+ mechanism. There is no live preview of *unreleased* changes to this
48
+ template; to try one locally, scaffold from your working tree with
49
+ `pnpm --filter create-grist-widget build` (embeds this template verbatim —
50
+ see `scripts/build-template.mjs`) and run the packed CLI against a scratch
51
+ directory, same as `scripts/smoke/create-widget.sh` does.
60
52
 
61
53
  ## Deployment
62
54
 
@@ -13,7 +13,7 @@
13
13
  },
14
14
  "dependencies": {
15
15
  "@fontsource-variable/geist": "^5.2.8",
16
- "grist-widget-sdk": "^0.3.0",
16
+ "grist-widget-sdk": "^0.3.3",
17
17
  "@tailwindcss/vite": "^4.2.1",
18
18
  "class-variance-authority": "^0.7.1",
19
19
  "clsx": "^2.1.1",