@cervio/create-plugin 1.1.0 → 1.1.2
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 +1 -1
- package/template/AGENTS.md +8 -2
- package/template/README.md +18 -3
- package/template-policy/README.md +6 -2
package/package.json
CHANGED
package/template/AGENTS.md
CHANGED
|
@@ -93,6 +93,11 @@ npm run validate # cervio validate - same checks the host runs on upload
|
|
|
93
93
|
npm run push # cervio push - uploads + creates/updates the plugin version
|
|
94
94
|
```
|
|
95
95
|
|
|
96
|
+
**First time on a host**, in this order: `cervio push` (no `--dev`: it creates the
|
|
97
|
+
plugin, a dev push before it fails), then `cervio route set` (without a route config
|
|
98
|
+
`/r/<route_slug>` answers "plugin not available"), then
|
|
99
|
+
`cervio route set --dev-channel on` if you will use `push:dev`.
|
|
100
|
+
|
|
96
101
|
While iterating on a shared/dev org, **prefer**:
|
|
97
102
|
|
|
98
103
|
```bash
|
|
@@ -145,8 +150,9 @@ go through `t(key)`.
|
|
|
145
150
|
## 8. Performance & safety
|
|
146
151
|
|
|
147
152
|
- Declare the GET calls the plugin makes at start in `boot_requests`
|
|
148
|
-
(`[{ "path": "/api/v1/views
|
|
149
|
-
covered by a GET `cervio_apis` prefix
|
|
153
|
+
(`[{ "path": "/api/v1/views/{settings.view_id}/records?limit=50" }]`, max 8, each
|
|
154
|
+
covered by a GET `cervio_apis` prefix; `{settings.<key>}` is a manifest setting that
|
|
155
|
+
Cervio fills in per organization): Cervio starts them while the plugin
|
|
150
156
|
loads and your own `fetch` of the same path + query gets that response
|
|
151
157
|
without waiting. `GET /api/v1/me` and `GET /api/v1/entities` are answered at
|
|
152
158
|
boot already when declared in `cervio_apis`.
|
package/template/README.md
CHANGED
|
@@ -13,11 +13,26 @@ npm install
|
|
|
13
13
|
npm run dev # local Vite dev server (CervioUI / __CERVIO_PLUGIN_CONTEXT__ are not injected here)
|
|
14
14
|
npm run build # dist/index.html + dist/surface.html + dist/assets/*
|
|
15
15
|
npm run validate # cervio validate - matches host upload checks
|
|
16
|
-
npm run push # cervio push - prefer "cervio push --dev" while iterating
|
|
17
16
|
```
|
|
18
17
|
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
## First publish
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npx cervio login --host https://your-org.cervio.app # once per host; fills "host" in cervio.json
|
|
22
|
+
npm run push # first push: creates the plugin on the host
|
|
23
|
+
npx cervio route set # makes it reachable at /r/<route_slug>
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Until `cervio route set` runs (or an admin sets the route in Admin → Plugins), the page
|
|
27
|
+
shows "plugin not available". Then iterate on the dev channel:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
npx cervio route set --dev-channel on # once
|
|
31
|
+
npm run push:dev # test at /r/<route_slug>?channel=dev
|
|
32
|
+
npm run push # release when it works
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
The `cervio` CLI is already a devDependency here.
|
|
21
36
|
|
|
22
37
|
## Project layout
|
|
23
38
|
|
|
@@ -18,8 +18,12 @@ npm run pack # build + cervio pack
|
|
|
18
18
|
npm run push # build + cervio push
|
|
19
19
|
```
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
The push binds each entry of `hooks` to its entities: there is nothing to configure in
|
|
22
|
+
the admin. Entities are matched by name when you push, so **create them first**: an
|
|
23
|
+
entity that does not exist yet is skipped, and you push again once it does.
|
|
24
|
+
|
|
25
|
+
To stop the hook, deactivate the plugin in Admin → Plugins (no new upload needed), or
|
|
26
|
+
remove the hook from `manifest.json` and push.
|
|
23
27
|
|
|
24
28
|
## Why build?
|
|
25
29
|
|