@minnovate/shadow-publisher 0.14.0 → 0.15.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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "git-publisher",
3
3
  "displayName": "Git Publisher",
4
- "version": "0.14.0",
4
+ "version": "0.15.0",
5
5
  "description": "Publish an app folder's Git history to the serverless Git publishing backend and keep it updated (\"publish my app\", \"update my app\", \"fetch the engineered version\").",
6
6
  "author": { "name": "git-publisher project" },
7
7
  "keywords": ["git", "publish", "deploy", "serverless"]
@@ -29,7 +29,7 @@ publisher --version
29
29
  ```
30
30
 
31
31
  If the command is not found, or the version is older than 0.11.0, install it:
32
- `npm install -g @minnovate/shadow-publisher@latest` (it needs Node.js 22). In a Claude Cowork task
32
+ `npm install -g @minnovate/shadow-publisher@latest` (it needs Node.js 22.12 or a later 22). In a Claude Cowork task
33
33
  this is normal: the sandbox starts empty every time, so install it without asking. On the person's
34
34
  own computer, say in one line that you are installing the publisher. If `npm` itself is missing,
35
35
  tell them Node.js 22 must be installed first, and stop.
@@ -142,6 +142,13 @@ in its folder. The checks refuse an app that does not (see "When the checks find
142
142
  Keep it small too: each file at most 4 MB, the whole app at most 10 MB, at most 500 files —
143
143
  a larger app is refused before it is checked, and the refusal names the file or the limit it broke.
144
144
 
145
+ An app is one folder in one of three shapes: static files with `index.html` at the root, a
146
+ standard-library Python `app.py`, or a Node.js `server.mjs` beside a `package.json` of exactly
147
+ `{"type":"module","scripts":{"start":"node server.mjs"}}`. It has no build step and no npm or pip
148
+ dependencies. Only .html .js .mjs .py .css .csv .json .svg .txt files are part of the app: any
149
+ other file, such as an image, an icon or a font, is left out, so draw images as SVG and use system
150
+ font stacks.
151
+
145
152
  ## 4. Telling them how it goes, step by step
146
153
 
147
154
  After a publish, the app goes through four steps: **received**, **checked**, **going live**,
@@ -214,8 +221,8 @@ sentence, and `progress.next.action` is `"fix"`. Then:
214
221
  2. Fix every finding in the app folder, by its `kind`:
215
222
  - `external-resource`: the app loads `url` from another site (a CDN script, Google Fonts, an
216
223
  image). **Apps may not load anything from other sites.** Download the file into the app
217
- folder and point to it with a relative path — only if it is at most 4 MB; a charting
218
- library usually is not (Chart.js is 201 KB). Otherwise replace it with code of your own: a
224
+ folder and point to it with a relative path, if it is at most 4 MB (a charting library
225
+ such as Chart.js, about 200 KB, fits). Otherwise replace it with code of your own: a
219
226
  font falls back to a system font stack, a chart is drawn as inline SVG. Never keep the
220
227
  external address.
221
228
  - `console-error` / `application-error`: fix the code that logs or throws `message`.
@@ -5417,6 +5417,16 @@ function ending(stages) {
5417
5417
  return "stopped";
5418
5418
  }
5419
5419
  var POLL_INTERVAL_MS = 5e3;
5420
+ var MAX_REASON = 1e3;
5421
+ function settled(run2, stages, end) {
5422
+ const runId = isRecord(run2) && typeof run2["runId"] === "string" ? run2["runId"] : null;
5423
+ const failedAt = stages.find((s) => s.state === "failed")?.word ?? null;
5424
+ return { kind: "settled", ending: end, failedAt, stages, runId, reason: reasonOf(run2, end) };
5425
+ }
5426
+ function reasonOf(run2, end) {
5427
+ const summary = isRecord(run2) ? run2["summary"] : null;
5428
+ return end === "failed" && typeof summary === "string" && summary.trim() !== "" ? summary.trim().slice(0, MAX_REASON) : null;
5429
+ }
5420
5430
  var FOLLOW_TIMEOUT_MS = 15 * 6e4;
5421
5431
  async function followRun(input, opts) {
5422
5432
  const portal = new PortalSession(opts);
@@ -5469,8 +5479,7 @@ async function followRun(input, opts) {
5469
5479
  }
5470
5480
  const end = ending(read2.stages);
5471
5481
  if (end !== null) {
5472
- const runId = isRecord(run2.run) && typeof run2.run["runId"] === "string" ? run2.run["runId"] : null;
5473
- return { kind: "settled", ending: end, failedAt: read2.stages.find((s) => s.state === "failed")?.word ?? null, stages: read2.stages, runId };
5482
+ return settled(run2.run, read2.stages, end);
5474
5483
  }
5475
5484
  if (opts.untilChange === true && moved && answered) {
5476
5485
  return { kind: "moving", stages: read2.stages };
@@ -7153,7 +7162,7 @@ function progressHint(r, portal, answerable = false) {
7153
7162
  case "not-deployed":
7154
7163
  return "Published and checked; this organisation does not deploy automatically.";
7155
7164
  case "failed":
7156
- return inPortal(portal, `It stopped at "${r.failedAt ?? "a step"}".`, "See why");
7165
+ return inPortal(portal, `It stopped at "${r.failedAt ?? "a step"}".${r.reason === null ? "" : ` ${r.reason}`}`, r.reason === null ? "See why" : "See it");
7157
7166
  case "stopped":
7158
7167
  return "A newer publication replaced this one before it went live.";
7159
7168
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@minnovate/shadow-publisher",
3
- "version": "0.14.0",
3
+ "version": "0.15.0",
4
4
  "description": "publisher: publish an app's Git history to the serverless Git backend",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",