@cervio/cli 1.1.0 → 1.3.0

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.
Files changed (3) hide show
  1. package/README.md +10 -0
  2. package/dist/cli.js +9 -0
  3. package/package.json +3 -3
package/README.md CHANGED
@@ -166,6 +166,16 @@ Runs `pnpm run build` (or `npm run build` if no `pnpm-lock.yaml` is present) in
166
166
  Runs `validatePluginDir` from `@cervio/plugin-core` against the current directory (expects
167
167
  `manifest.json` + `dist/index.html` + `dist/assets/*`). Exits non-zero on failure.
168
168
 
169
+ It also prints non-blocking start-up warnings (`hints` in `--json`), exit code 0:
170
+
171
+ | Code | When |
172
+ |---|---|
173
+ | `boot_requests_missing` | route plugin that reads data (a GET `cervio_apis` other than `/api/v1/me` and `/api/v1/entities`) with no `boot_requests` |
174
+ | `mark_ready_missing` | the built bundle never calls `markReady()` |
175
+ | `boot_request_hardcoded_view` | a `boot_requests` path with a fixed view id instead of `{settings.<key>}` |
176
+
177
+ `cervio doctor` reports the same codes under `fast_startup`.
178
+
169
179
  ### `cervio pack [--json]`
170
180
 
171
181
  Packs the plugin (via `packPlugin`) and writes `./.cervio/out/<plugin_key>.zip`.
package/dist/cli.js CHANGED
@@ -707,6 +707,14 @@ async function doctorCommand(opts) {
707
707
  checks.push(
708
708
  packResult.ok ? { name: "build_valid", ok: true, detail: `content_sha256=${packResult.value.contentSha256}` } : { name: "build_valid", ok: false, detail: packResult.error }
709
709
  );
710
+ if (packResult.ok) {
711
+ const hints = packResult.value.hints;
712
+ checks.push({
713
+ name: "fast_startup",
714
+ ok: true,
715
+ detail: hints.length ? hints.map((h) => h.code).join(", ") + " (see cervio validate)" : "boot_requests and markReady() in place"
716
+ });
717
+ }
710
718
  if (declaredEntities.length) {
711
719
  const known = new Set(entities.map((e) => e.name));
712
720
  const missing = declaredEntities.filter((name) => !known.has(name));
@@ -1330,6 +1338,7 @@ async function validateCommand(opts) {
1330
1338
  log.success("Plugin is valid.");
1331
1339
  log.info(` plugin_key: ${data.pluginKey}`);
1332
1340
  log.info(` content_sha256: ${data.contentSha256}`);
1341
+ for (const h of data.hints) log.warn(`${h.message} [${h.code}]`);
1333
1342
  });
1334
1343
  }
1335
1344
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cervio/cli",
3
- "version": "1.1.0",
3
+ "version": "1.3.0",
4
4
  "description": "Developer CLI for Cervio plugins: login, validate, pack, push and manage releases.",
5
5
  "keywords": [
6
6
  "cervio",
@@ -30,8 +30,8 @@
30
30
  "dependencies": {
31
31
  "commander": "^15.0.0",
32
32
  "prompts": "^2.4.2",
33
- "@cervio/create-plugin": "^1.1.1",
34
- "@cervio/plugin-core": "^1.0.1"
33
+ "@cervio/create-plugin": "^1.1.2",
34
+ "@cervio/plugin-core": "^1.3.0"
35
35
  },
36
36
  "optionalDependencies": {
37
37
  "@napi-rs/keyring": "2.1.2"