create-grist-widget 0.3.2 → 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 +2 -2
- package/template/README.md +3 -3
- package/template/package.json +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-grist-widget",
|
|
3
|
-
"version": "0.3.
|
|
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://
|
|
28
|
+
"homepage": "https://gristwidgets.com",
|
|
29
29
|
"keywords": [
|
|
30
30
|
"grist",
|
|
31
31
|
"widget",
|
package/template/README.md
CHANGED
|
@@ -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
|
|
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://
|
|
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
|
|
|
@@ -43,7 +43,7 @@ current source is external: `template-canary.yml` scaffolds it via the
|
|
|
43
43
|
*published* `create-grist-widget` package and pushes to the `dev` and
|
|
44
44
|
`canary/latest` branches of
|
|
45
45
|
[`grist-widget-template`](https://github.com/ArthurBlanchon/grist-widget-template)
|
|
46
|
-
after every release — see
|
|
46
|
+
after every release — see https://gristwidgets.com/docs/contributing/releasing for the full
|
|
47
47
|
mechanism. There is no live preview of *unreleased* changes to this
|
|
48
48
|
template; to try one locally, scaffold from your working tree with
|
|
49
49
|
`pnpm --filter create-grist-widget build` (embeds this template verbatim —
|
package/template/package.json
CHANGED