@minnovate/shadow-publisher 0.13.0 → 0.14.1
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.
|
|
4
|
+
"version": "0.14.1",
|
|
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
|
|
218
|
-
|
|
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`.
|
|
@@ -53,6 +53,8 @@ publisher suggestions --json # what colleagues asked for, still ope
|
|
|
53
53
|
publisher suggestion decline <id> --json # when the person does not want one
|
|
54
54
|
publisher share invited --add ann@example.com --json # who can open it
|
|
55
55
|
publisher columns <id> --json # the column names of connected data, before code reads it
|
|
56
|
+
publisher data add <sheet link> --app <app> --name "<name>" --json # a Google sheet the app reads
|
|
57
|
+
publisher data remove <id> --app <app> --json # the app stops reading that data
|
|
56
58
|
```
|
|
57
59
|
|
|
58
60
|
The portal writes `next` for an assistant in the chat, so it can name a connector tool. At a
|
|
@@ -68,6 +70,8 @@ terminal, do what it says with the command that does the same thing:
|
|
|
68
70
|
| `share_app` | `publisher share <access> --json` |
|
|
69
71
|
| `list_apps` | `publisher list --json` |
|
|
70
72
|
| `data_columns` | `publisher columns <id> --json` |
|
|
73
|
+
| `connect_data_source` | `publisher data add <sheet link> --app <app> --name "<name>" --json` |
|
|
74
|
+
| `remove_data_source` | `publisher data remove <id> --app <app> --json` |
|
|
71
75
|
|
|
72
76
|
`<publication>` is the `publication` that `go-back` or `start` answered.
|
|
73
77
|
|
package/dist/publisher.cjs
CHANGED
|
@@ -324,8 +324,8 @@ function mergeDefs(...defs) {
|
|
|
324
324
|
}
|
|
325
325
|
var captureStackTrace = "captureStackTrace" in Error ? Error.captureStackTrace : (..._args) => {
|
|
326
326
|
};
|
|
327
|
-
function isObject(
|
|
328
|
-
return typeof
|
|
327
|
+
function isObject(data2) {
|
|
328
|
+
return typeof data2 === "object" && data2 !== null && !Array.isArray(data2);
|
|
329
329
|
}
|
|
330
330
|
function isPlainObject(o) {
|
|
331
331
|
if (isObject(o) === false)
|
|
@@ -503,20 +503,20 @@ function getLengthableOrigin(input) {
|
|
|
503
503
|
return "string";
|
|
504
504
|
return "unknown";
|
|
505
505
|
}
|
|
506
|
-
function parsedType(
|
|
507
|
-
const t = typeof
|
|
506
|
+
function parsedType(data2) {
|
|
507
|
+
const t = typeof data2;
|
|
508
508
|
switch (t) {
|
|
509
509
|
case "number": {
|
|
510
|
-
return Number.isNaN(
|
|
510
|
+
return Number.isNaN(data2) ? "nan" : "number";
|
|
511
511
|
}
|
|
512
512
|
case "object": {
|
|
513
|
-
if (
|
|
513
|
+
if (data2 === null) {
|
|
514
514
|
return "null";
|
|
515
515
|
}
|
|
516
|
-
if (Array.isArray(
|
|
516
|
+
if (Array.isArray(data2)) {
|
|
517
517
|
return "array";
|
|
518
518
|
}
|
|
519
|
-
const obj =
|
|
519
|
+
const obj = data2;
|
|
520
520
|
if (obj && Object.getPrototypeOf(obj) !== Object.prototype && "constructor" in obj && obj.constructor) {
|
|
521
521
|
return obj.constructor.name;
|
|
522
522
|
}
|
|
@@ -2375,17 +2375,17 @@ var ZodMiniType = /* @__PURE__ */ $constructor("ZodMiniType", (inst, def) => {
|
|
|
2375
2375
|
set with(value) {
|
|
2376
2376
|
own(this, "with", value);
|
|
2377
2377
|
},
|
|
2378
|
-
parse(
|
|
2379
|
-
return parse(this,
|
|
2378
|
+
parse(data2, params) {
|
|
2379
|
+
return parse(this, data2, params, { callee: this.parse });
|
|
2380
2380
|
},
|
|
2381
|
-
parseAsync(
|
|
2382
|
-
return parseAsync(this,
|
|
2381
|
+
parseAsync(data2, params) {
|
|
2382
|
+
return parseAsync(this, data2, params, { callee: this.parseAsync });
|
|
2383
2383
|
},
|
|
2384
|
-
safeParse(
|
|
2385
|
-
return safeParse(this,
|
|
2384
|
+
safeParse(data2, params) {
|
|
2385
|
+
return safeParse(this, data2, params);
|
|
2386
2386
|
},
|
|
2387
|
-
safeParseAsync(
|
|
2388
|
-
return safeParseAsync(this,
|
|
2387
|
+
safeParseAsync(data2, params) {
|
|
2388
|
+
return safeParseAsync(this, data2, params);
|
|
2389
2389
|
},
|
|
2390
2390
|
check(...checks) {
|
|
2391
2391
|
const def = this.def;
|
|
@@ -6852,6 +6852,7 @@ var OPTIONS = {
|
|
|
6852
6852
|
token: { type: "string" },
|
|
6853
6853
|
portal: { type: "string" },
|
|
6854
6854
|
name: { type: "string" },
|
|
6855
|
+
app: { type: "string" },
|
|
6855
6856
|
repo: { type: "string" },
|
|
6856
6857
|
message: { type: "string" },
|
|
6857
6858
|
publication: { type: "string" },
|
|
@@ -8074,6 +8075,24 @@ var share = {
|
|
|
8074
8075
|
return run(inv, dir, "share_app", { app, access: access2, add: listFlag(inv, "add"), remove: listFlag(inv, "remove") });
|
|
8075
8076
|
}
|
|
8076
8077
|
};
|
|
8078
|
+
function dataCall(cmd, app, name) {
|
|
8079
|
+
const [, verb, subject] = cmd;
|
|
8080
|
+
const on = app === void 0 ? {} : { app };
|
|
8081
|
+
if (verb === "add" && subject !== void 0) {
|
|
8082
|
+
return { tool: "connect_data_source", args: { source: "google-sheet", describes: name ?? "", fields: { link: subject }, ...on } };
|
|
8083
|
+
}
|
|
8084
|
+
if (verb === "remove" && subject !== void 0) {
|
|
8085
|
+
return { tool: "remove_data_source", args: { id: subject, ...on } };
|
|
8086
|
+
}
|
|
8087
|
+
throw new PublisherError("INVALID_REQUEST", "data takes add <sheet link>, or remove <id> with an id from publisher columns");
|
|
8088
|
+
}
|
|
8089
|
+
var data = {
|
|
8090
|
+
git: false,
|
|
8091
|
+
async run(inv) {
|
|
8092
|
+
const { tool, args } = dataCall(inv.cmd, inv.str("app"), inv.str("name"));
|
|
8093
|
+
return run(inv, void 0, tool, args);
|
|
8094
|
+
}
|
|
8095
|
+
};
|
|
8077
8096
|
|
|
8078
8097
|
// src/commands/sync.ts
|
|
8079
8098
|
var sync = {
|
|
@@ -8433,6 +8452,10 @@ Usage:
|
|
|
8433
8452
|
who can open this folder's app; new invitees get the link by mail
|
|
8434
8453
|
publisher columns [<id>] the column names of connected data, for the code that reads it;
|
|
8435
8454
|
its first rows only to an owner or admin who allowed that
|
|
8455
|
+
publisher data add <sheet link> [--app <app>] [--name <name>]
|
|
8456
|
+
connect a Google sheet anyone with the link can view, and
|
|
8457
|
+
turn it on for that app (an app you made, or any as owner or admin)
|
|
8458
|
+
publisher data remove <id> --app <app> that app stops using that data; the organisation keeps it
|
|
8436
8459
|
publisher merge-check [dir] --ours <ref> --theirs <ref> [--apply]
|
|
8437
8460
|
publisher info [dir] repository state as seen by the server
|
|
8438
8461
|
publisher doctor environment check (node, git, credentials, association)
|
|
@@ -8484,7 +8507,8 @@ var COMMANDS = /* @__PURE__ */ new Map([
|
|
|
8484
8507
|
["suggestions", suggestions],
|
|
8485
8508
|
["suggestion", suggestion],
|
|
8486
8509
|
["share", share],
|
|
8487
|
-
["columns", columns]
|
|
8510
|
+
["columns", columns],
|
|
8511
|
+
["data", data]
|
|
8488
8512
|
]);
|
|
8489
8513
|
async function main(argv) {
|
|
8490
8514
|
const inv = new Invocation(parseArgs(argv));
|