@vercel/board 0.42.1 → 0.43.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.
- package/dist/backend-local.mjs +1 -1
- package/dist/cli-commands.mjs +1 -1
- package/dist/cli-embedded.d.mts +0 -16
- package/dist/cli-embedded.mjs +5 -23
- package/dist/cli.mjs +62 -44
- package/dist/{commands-DeEJJw3i.mjs → commands-C4fR0md0.mjs} +0 -11
- package/dist/{exports-kDMIgZVu.mjs → exports-BVgUNVsP.mjs} +8 -11
- package/dist/index.mjs +1 -1
- package/dist/index.node.mjs +1 -1
- package/dist/inspect/app.js +106 -106
- package/dist/inspect-DRPRCOaV.mjs +2 -0
- package/dist/{inspect-CqCXjtPI.mjs → inspect-ZGkTJl3f.mjs} +7 -16
- package/dist/{local-DsJ14yqg.mjs → local-yB2DFcRi.mjs} +1 -1
- package/dist/{main-C4HVA8cc.mjs → main-DjEJPCgo.mjs} +5 -7
- package/dist/{origin-Cuu8lW8n.mjs → origin-9Ch-Zonv.mjs} +2 -2
- package/dist/page-D-OzDOAX.mjs +14 -0
- package/dist/page-Dr9Aqlej.mjs +2 -0
- package/dist/{serve-BmabgHV-.mjs → serve-Cnb4TpaJ.mjs} +2 -2
- package/dist/{server-CKbE7eMT.mjs → server-BHpUqip5.mjs} +2 -2
- package/docs/03-guides/02-inspector.md +3 -0
- package/docs/04-reference/01-cli.md +5 -26
- package/docs/04-reference/03-http.md +3 -3
- package/docs/04-reference/05-conformance.md +1 -2
- package/package.json +1 -2
- package/dist/digest-dm54M2k8.mjs +0 -4
- package/dist/inspect-CNW1rLWB.mjs +0 -2
- package/dist/page-BPTzCBeW.mjs +0 -2
- package/dist/page-CnjVt5w2.mjs +0 -30
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { h as ATTACHMENT_BYTES_MAX } from "./errors-DUzpDSrJ.mjs";
|
|
2
2
|
import "./schemas-DAzSsgWk.mjs";
|
|
3
|
-
import { t as Failed, u as who } from "./main-
|
|
4
|
-
import { t as page } from "./page-
|
|
3
|
+
import { t as Failed, u as who } from "./main-DjEJPCgo.mjs";
|
|
4
|
+
import { t as page } from "./page-D-OzDOAX.mjs";
|
|
5
5
|
import { randomBytes, timingSafeEqual } from "node:crypto";
|
|
6
6
|
import { createServer } from "node:http";
|
|
7
7
|
//#region src/inspect/style.ts
|
|
@@ -420,7 +420,7 @@ button.file:hover { background: var(--shade-hover); color: var(--bright); }
|
|
|
420
420
|
.toast { max-width: 420px; padding: 8px 12px; border: 1px solid var(--dim); background: var(--bg); color: var(--bright); }
|
|
421
421
|
`;
|
|
422
422
|
/** The prebuilt UI where board is installed, read only when an inspector starts without one. */
|
|
423
|
-
const bundle = async () => (await import("./page-
|
|
423
|
+
const bundle = async () => (await import("./page-Dr9Aqlej.mjs")).page();
|
|
424
424
|
const shell = (token) => `<!doctype html>
|
|
425
425
|
<html lang="en">
|
|
426
426
|
<head>
|
|
@@ -605,17 +605,8 @@ const stopped = () => new Promise((resolve) => {
|
|
|
605
605
|
process.once("SIGINT", done);
|
|
606
606
|
process.once("SIGTERM", done);
|
|
607
607
|
});
|
|
608
|
-
/** The page to serve, before anything starts:
|
|
609
|
-
async function pageOf(
|
|
610
|
-
if (provided) try {
|
|
611
|
-
return await provided();
|
|
612
|
-
} catch (error) {
|
|
613
|
-
throw new Failed({
|
|
614
|
-
class: "unknown",
|
|
615
|
-
reason: "inspector_page_unavailable",
|
|
616
|
-
message: `Couldn't get the inspector's page: ${error.message}`
|
|
617
|
-
});
|
|
618
|
-
}
|
|
608
|
+
/** The page to serve, before anything starts: an install without one says so, and serves nothing. */
|
|
609
|
+
async function pageOf() {
|
|
619
610
|
const found = await page();
|
|
620
611
|
if (found === null) throw new Failed({
|
|
621
612
|
class: "unknown",
|
|
@@ -625,9 +616,9 @@ async function pageOf(provided) {
|
|
|
625
616
|
});
|
|
626
617
|
return found;
|
|
627
618
|
}
|
|
628
|
-
async function inspect({ flags, out, portFlag, client, openBrowser
|
|
619
|
+
async function inspect({ flags, out, portFlag, client, openBrowser }) {
|
|
629
620
|
const port = portFlag();
|
|
630
|
-
const page = await pageOf(
|
|
621
|
+
const page = await pageOf();
|
|
631
622
|
const inspector = await startInspector({
|
|
632
623
|
client: client(),
|
|
633
624
|
page,
|
|
@@ -2,7 +2,7 @@ import { _ as IMPORT_BYTES_MAX, a as forbidden$1, b as mediaType, c as toErrorRe
|
|
|
2
2
|
import { _ as actorKind, a as CAN_MAX, b as storable, c as Handle, d as Labels, g as SeenActorKind, h as RemoteWatcherId, i as Author, l as LabelKey, m as MessageText, n as Attachment, o as ChannelPath, p as MessageId, s as Emoji, t as ActorId, v as authorView, y as platformAvatar } from "./schemas-DAzSsgWk.mjs";
|
|
3
3
|
import { a as Link, i as ExternalTarget, n as ExternalEvent, o as Origin } from "./external-DymyhUzl.mjs";
|
|
4
4
|
import { a as SCHEMA_DESCRIPTION_MAX, c as canonical, d as parseSchemaId, f as schemaId, i as BUILT_IN_SCHEMAS, l as checkDefinition, n as blocksIn, o as SCHEMA_NAME, s as SCHEMA_VERSION_MAX, u as isBuiltInName } from "./blocks-CVoBC7ur.mjs";
|
|
5
|
-
import { a as compileWatcher, c as METHODS, h as VERSION, i as runMatch, m as SYNC, n as syncTarget, o as hasCriteria, r as canonicalWatchers, t as SYNC_ACTOR } from "./origin-
|
|
5
|
+
import { a as compileWatcher, c as METHODS, h as VERSION, i as runMatch, m as SYNC, n as syncTarget, o as hasCriteria, r as canonicalWatchers, t as SYNC_ACTOR } from "./origin-9Ch-Zonv.mjs";
|
|
6
6
|
import { a as waitUntil, c as platformProfile, d as userIdOf, h as isKeyIdOf, l as shownName, m as derivedId, n as MIDDLEWARE_ACTOR, o as actorParts, s as importedHandle, t as DroppedError } from "./middleware-0DUFrav-.mjs";
|
|
7
7
|
import { c as compileAccess, i as authorize, o as checkGrantChange, t as FULL_ACCESS, u as parseCan } from "./access-BgBiaCyx.mjs";
|
|
8
8
|
import { S as wroteAs, _ as removes, a as authenticates, c as checkPrincipal, d as grantIssuers, m as joined, n as GITHUB_ISSUER, o as checkCan, p as issuerName, s as checkGrant, x as workflowPath } from "./auth-Ft4AJptx.mjs";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { g as DIRECT_UPLOAD_BYTES_MAX, u as BoardError, y as fileSize } from "./errors-DUzpDSrJ.mjs";
|
|
2
2
|
import { f as MESSAGE_TEXT_MAX, r as AttachmentId } from "./schemas-DAzSsgWk.mjs";
|
|
3
3
|
import { d as parseSchemaId, r as findBlocks, t as block } from "./blocks-CVoBC7ur.mjs";
|
|
4
|
-
import { h as VERSION, s as withMentions } from "./origin-
|
|
4
|
+
import { h as VERSION, s as withMentions } from "./origin-9Ch-Zonv.mjs";
|
|
5
5
|
import { n as displayEmoji, r as normalizeEmoji } from "./emoji-CTLpvH-A.mjs";
|
|
6
6
|
import { l as shownName } from "./middleware-0DUFrav-.mjs";
|
|
7
7
|
import { r as PERMISSIONS } from "./access-BgBiaCyx.mjs";
|
|
8
|
-
import { a as isApiMessageId, n as isBoardName } from "./exports-
|
|
9
|
-
import { i as groups, n as filters$1, o as options, r as globalOptions, s as usage$1, t as commands } from "./commands-
|
|
10
|
-
import { a as vercel, c as connect, i as handTeam, l as handFetch, n as credentialSource, o as http, p as vercelProjectFile, r as credentialed, s as boardUrl, t as board, u as handLogin } from "./server-
|
|
8
|
+
import { a as isApiMessageId, n as isBoardName } from "./exports-BVgUNVsP.mjs";
|
|
9
|
+
import { i as groups, n as filters$1, o as options, r as globalOptions, s as usage$1, t as commands } from "./commands-C4fR0md0.mjs";
|
|
10
|
+
import { a as vercel, c as connect, i as handTeam, l as handFetch, n as credentialSource, o as http, p as vercelProjectFile, r as credentialed, s as boardUrl, t as board, u as handLogin } from "./server-BHpUqip5.mjs";
|
|
11
11
|
import { t as conformance } from "./conformance-BORt5nky.mjs";
|
|
12
12
|
import { t as displayText } from "./bots-CGkO76qH.mjs";
|
|
13
13
|
import { spawn } from "node:child_process";
|
|
@@ -2565,7 +2565,6 @@ async function run(command, args) {
|
|
|
2565
2565
|
}
|
|
2566
2566
|
return 0;
|
|
2567
2567
|
}
|
|
2568
|
-
case "inspect": return (await import("./inspect-CNW1rLWB.mjs")).inspect(context());
|
|
2569
2568
|
default: {
|
|
2570
2569
|
const own = app.commands[command];
|
|
2571
2570
|
if (own) return own.run(args, context());
|
|
@@ -2861,8 +2860,7 @@ const context = () => ({
|
|
|
2861
2860
|
portFlag,
|
|
2862
2861
|
connection,
|
|
2863
2862
|
client,
|
|
2864
|
-
openBrowser
|
|
2865
|
-
...app.inspectorPage ? { inspectorPage: app.inspectorPage } : {}
|
|
2863
|
+
openBrowser
|
|
2866
2864
|
});
|
|
2867
2865
|
/**
|
|
2868
2866
|
* Runs board's CLI on `argv` (what follows the command name) as `app`, and answers its exit
|
|
@@ -3,7 +3,7 @@ import { b as storable, d as Labels, f as MESSAGE_TEXT_MAX, l as LabelKey, m as
|
|
|
3
3
|
import { a as Link, i as ExternalTarget, l as isThreadTarget, n as ExternalEvent, o as Origin, t as ExternalAuthor } from "./external-DymyhUzl.mjs";
|
|
4
4
|
import { a as SCHEMA_DESCRIPTION_MAX, o as SCHEMA_NAME, s as SCHEMA_VERSION_MAX } from "./blocks-CVoBC7ur.mjs";
|
|
5
5
|
import { i as afterRetry } from "./middleware-0DUFrav-.mjs";
|
|
6
|
-
import { o as options } from "./commands-
|
|
6
|
+
import { o as options } from "./commands-C4fR0md0.mjs";
|
|
7
7
|
import { z } from "zod";
|
|
8
8
|
//#region src/api/routes.ts
|
|
9
9
|
/**
|
|
@@ -757,7 +757,7 @@ const routes = {
|
|
|
757
757
|
};
|
|
758
758
|
//#endregion
|
|
759
759
|
//#region src/version.ts
|
|
760
|
-
const VERSION = "0.
|
|
760
|
+
const VERSION = "0.43.1";
|
|
761
761
|
//#endregion
|
|
762
762
|
//#region src/server/backend.ts
|
|
763
763
|
/** The subscription sync's outbound runs on, in `BoardBinding.subscriptions`. No watcher's ID starts with `@`. */
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { readFile } from "node:fs/promises";
|
|
2
|
+
//#region src/inspect/page.ts
|
|
3
|
+
/** Next to the CLI in `dist`, or in `dist` when running from source. */
|
|
4
|
+
const FILES = [new URL("./inspect/app.js", import.meta.url), new URL("../../dist/inspect/app.js", import.meta.url)];
|
|
5
|
+
/** The page's script where board is installed, or null when there's none beside it. */
|
|
6
|
+
async function page() {
|
|
7
|
+
for (const file of FILES) {
|
|
8
|
+
const script = await readFile(file, "utf8").catch(() => null);
|
|
9
|
+
if (script !== null) return script;
|
|
10
|
+
}
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
//#endregion
|
|
14
|
+
export { page as t };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { u as BoardError } from "./errors-DUzpDSrJ.mjs";
|
|
2
|
-
import { d as localTokenFile, t as board } from "./server-
|
|
2
|
+
import { d as localTokenFile, t as board } from "./server-BHpUqip5.mjs";
|
|
3
3
|
import { t as oidcTokens } from "./tokens-BSMpTPEe.mjs";
|
|
4
|
-
import { t as local } from "./local-
|
|
4
|
+
import { t as local } from "./local-yB2DFcRi.mjs";
|
|
5
5
|
import { mkdir, rename, rm, stat, writeFile } from "node:fs/promises";
|
|
6
6
|
import { userInfo } from "node:os";
|
|
7
7
|
import { dirname, join, resolve } from "node:path";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { d as createBoardClient, p as formatProfileHeader, t as HttpError, u as BoardError } from "./errors-DUzpDSrJ.mjs";
|
|
2
2
|
import "./schemas-DAzSsgWk.mjs";
|
|
3
|
-
import { Y as routes, a as compileWatcher, c as METHODS } from "./origin-
|
|
3
|
+
import { Y as routes, a as compileWatcher, c as METHODS } from "./origin-9Ch-Zonv.mjs";
|
|
4
4
|
import { g as keyId, p as DERIVED_ID } from "./middleware-0DUFrav-.mjs";
|
|
5
|
-
import { c as tailWatchers, i as createVercel, l as deployedOnVercel, o as PROTOCOL_ROUTES, s as withoutToken, t as createBoard } from "./exports-
|
|
5
|
+
import { c as tailWatchers, i as createVercel, l as deployedOnVercel, o as PROTOCOL_ROUTES, s as withoutToken, t as createBoard } from "./exports-BVgUNVsP.mjs";
|
|
6
6
|
import { execFile } from "node:child_process";
|
|
7
7
|
import { createHash } from "node:crypto";
|
|
8
8
|
import { mkdir, readFile, readdir, stat, unlink, writeFile } from "node:fs/promises";
|
|
@@ -25,8 +25,9 @@ The CLI makes no HTTP calls of its own: every command goes through
|
|
|
25
25
|
|
|
26
26
|
`@vercel/board/cli` runs the same CLI inside another one, as `vercel board`
|
|
27
27
|
does. Help, usage, and errors use the name it's given. It has every command but
|
|
28
|
-
[`
|
|
29
|
-
|
|
28
|
+
[`inspect`](#inspect) and [`serve`](#serve), which run something on this
|
|
29
|
+
machine, so an app that bundles it brings neither the inspector nor a local
|
|
30
|
+
board.
|
|
30
31
|
|
|
31
32
|
```ts
|
|
32
33
|
import { createApp } from '@vercel/board/cli'
|
|
@@ -35,29 +36,6 @@ import { createApp } from '@vercel/board/cli'
|
|
|
35
36
|
const code = await createApp({ appName: 'vercel board' }).run(process.argv.slice(3))
|
|
36
37
|
```
|
|
37
38
|
|
|
38
|
-
The inspector's page isn't in that chunk. It's one file in board's npm
|
|
39
|
-
package, `dist/inspect/app.js`, which `inspect` reads beside board's files. An
|
|
40
|
-
app that bundles board's CLI has none beside it, so it fetches this version's
|
|
41
|
-
page and hands it over. `INSPECTOR_PAGE` names the file and its SHA-256, so
|
|
42
|
-
the app checks it before the page runs as you:
|
|
43
|
-
|
|
44
|
-
```ts
|
|
45
|
-
import { createApp, INSPECTOR_PAGE } from '@vercel/board/cli'
|
|
46
|
-
|
|
47
|
-
// { name: '@vercel/board', version: '0.37.0', path: 'dist/inspect/app.js', sha256: '…' }
|
|
48
|
-
const { name, version, path, sha256 } = INSPECTOR_PAGE
|
|
49
|
-
|
|
50
|
-
const code = await createApp({
|
|
51
|
-
appName: 'vercel board',
|
|
52
|
-
// Asked for only when `inspect` runs. What it throws fails the run, and nothing is served.
|
|
53
|
-
// inspectorPage: () => yourCachedPage({ name, version, path, sha256 }), // from npm, checked
|
|
54
|
-
}).run(process.argv.slice(3))
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
Without `inspectorPage`, an app with no file of board's beside it fails
|
|
58
|
-
`inspect` with `no_inspector_page`, and one whose `inspectorPage` throws fails
|
|
59
|
-
with `inspector_page_unavailable`.
|
|
60
|
-
|
|
61
39
|
`run` answers the exit code, and never exits the process itself. A failure is
|
|
62
40
|
data too, for the CLI that runs board to show as it shows its own:
|
|
63
41
|
|
|
@@ -1051,7 +1029,8 @@ vb inspect [--port N] [--no-open]
|
|
|
1051
1029
|
```
|
|
1052
1030
|
|
|
1053
1031
|
Serves the board's web UI on 127.0.0.1, as you, and opens it. The port is 4747,
|
|
1054
|
-
or any free port when that's taken.
|
|
1032
|
+
or any free port when that's taken. Only board's own CLI has it, so without
|
|
1033
|
+
`vb` installed, `npx @vercel/board@latest inspect` runs it. See
|
|
1055
1034
|
[Inspector](../03-guides/02-inspector.md).
|
|
1056
1035
|
|
|
1057
1036
|
## Filters
|
|
@@ -464,9 +464,9 @@ const problem = found.problem ?? checkValue(definition, found.data) // 'id mus
|
|
|
464
464
|
|
|
465
465
|
Anyone the board lets in reads the schemas, whatever channels they read.
|
|
466
466
|
Registering needs `manage` at `*`. On Vercel's board, schemas are the team's:
|
|
467
|
-
every board on the team shares one registry, people and apps whose team
|
|
468
|
-
is owner, member, or developer register
|
|
469
|
-
|
|
467
|
+
every board on the team shares one registry, and people and apps whose team
|
|
468
|
+
role is owner, member, or developer register. A deployment's own credentials
|
|
469
|
+
read them and register none. It checks a
|
|
470
470
|
definition more strictly: it also refuses a `required` name the schema's
|
|
471
471
|
`properties` don't declare, and a keyword for one type, such as `minLength`,
|
|
472
472
|
with no `type` that says it.
|
|
@@ -151,8 +151,7 @@ Every board answers all of them: see
|
|
|
151
151
|
schedules, grants, schemas, or files, and say so: one that answers
|
|
152
152
|
one of those groups' checks with a 501 has it skipped, `not kept here`, with
|
|
153
153
|
what the board said. A board that's meant to keep them and doesn't yet answers
|
|
154
|
-
otherwise, and fails
|
|
155
|
-
on Vercel's boards until its API lets a project read its team's schemas.
|
|
154
|
+
otherwise, and fails.
|
|
156
155
|
Vercel's API reads who writes as boards did before, so a run there fails two
|
|
157
156
|
core checks until it reads `x-board-profile` as a structured header and its
|
|
158
157
|
avatar from there alone: the profile it shows is the whole header, and the
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vercel/board",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.43.1",
|
|
4
4
|
"description": "A message board you mount in one route: one durable log, verified authors, live tail, and two-way sync.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -94,7 +94,6 @@
|
|
|
94
94
|
"@vercel/connect": "^2.3.4",
|
|
95
95
|
"ai": "^7.0.130",
|
|
96
96
|
"chat": "^4.41.1",
|
|
97
|
-
"esbuild": "0.28.1",
|
|
98
97
|
"experimental-a2": "0.24.0",
|
|
99
98
|
"github-slugger": "^2.0.0",
|
|
100
99
|
"lucide-react": "^1.49.0",
|
package/dist/digest-dm54M2k8.mjs
DELETED
package/dist/page-BPTzCBeW.mjs
DELETED
package/dist/page-CnjVt5w2.mjs
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import "./digest-dm54M2k8.mjs";
|
|
2
|
-
import { createHash } from "node:crypto";
|
|
3
|
-
import { readFile } from "node:fs/promises";
|
|
4
|
-
//#region src/inspect/page.ts
|
|
5
|
-
/**
|
|
6
|
-
* Next to the CLI in `dist`, or in `dist` when running from source. Resolved only when asked
|
|
7
|
-
* for: an app that bundles board's CLI as CommonJS may have no `import.meta.url`, and then has
|
|
8
|
-
* none of board's files either.
|
|
9
|
-
*/
|
|
10
|
-
function files() {
|
|
11
|
-
try {
|
|
12
|
-
return [new URL("./inspect/app.js", import.meta.url), new URL("../../dist/inspect/app.js", import.meta.url)];
|
|
13
|
-
} catch {
|
|
14
|
-
return [];
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* The page's script where board is installed, or null when there's none beside it. A build takes
|
|
19
|
-
* only the page it made: in an app that bundles board's CLI, these paths are the app's, and a file
|
|
20
|
-
* that happens to be there isn't board's.
|
|
21
|
-
*/
|
|
22
|
-
async function page() {
|
|
23
|
-
for (const file of files()) {
|
|
24
|
-
const script = await readFile(file, "utf8").catch(() => null);
|
|
25
|
-
if (script !== null && createHash("sha256").update(script).digest("hex") === "c19aa15fdf63e3d1220b585c1594163ecca1702039ea5be31a8fe092fd9d5a0b") return script;
|
|
26
|
-
}
|
|
27
|
-
return null;
|
|
28
|
-
}
|
|
29
|
-
//#endregion
|
|
30
|
-
export { page as t };
|