@fedify/cli 2.3.0-dev.994 → 2.3.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/bench/action.js +469 -0
- package/dist/bench/actor/documents.js +39 -0
- package/dist/bench/actor/fleet.js +39 -0
- package/dist/bench/actor/keys.js +35 -0
- package/dist/bench/command.js +72 -0
- package/dist/bench/compare/schema.js +16 -0
- package/dist/bench/compare.js +667 -0
- package/dist/bench/discovery/discover.js +67 -0
- package/dist/bench/discovery/probe.js +50 -0
- package/dist/bench/load/arrival.js +27 -0
- package/dist/bench/load/clock.js +33 -0
- package/dist/bench/load/generator.js +145 -0
- package/dist/bench/metrics/aggregate.js +64 -0
- package/dist/bench/metrics/histogram.js +141 -0
- package/dist/bench/metrics/stats-client.js +216 -0
- package/dist/bench/mod.js +11 -0
- package/dist/bench/render/format.js +46 -0
- package/dist/bench/render/index.js +20 -0
- package/dist/bench/render/json.js +12 -0
- package/dist/bench/render/markdown.js +63 -0
- package/dist/bench/render/text.js +75 -0
- package/dist/bench/result/build.js +252 -0
- package/dist/bench/result/expect/assert.js +74 -0
- package/dist/bench/result/expect/evaluate.js +128 -0
- package/dist/bench/result/expect/metrics.js +34 -0
- package/dist/bench/result/schema.js +365 -0
- package/dist/bench/safety/gate.js +62 -0
- package/dist/bench/safety/tiers.js +97 -0
- package/dist/bench/scenario/coerce.js +24 -0
- package/dist/bench/scenario/errors.js +36 -0
- package/dist/bench/scenario/load.js +69 -0
- package/dist/bench/scenario/normalize.js +125 -0
- package/dist/bench/scenario/schema.js +399 -0
- package/dist/bench/scenario/units.js +56 -0
- package/dist/bench/scenario/validate.js +29 -0
- package/dist/bench/scenarios/actor.js +38 -0
- package/dist/bench/scenarios/failure.js +363 -0
- package/dist/bench/scenarios/fanout.js +261 -0
- package/dist/bench/scenarios/inbox.js +147 -0
- package/dist/bench/scenarios/mixed.js +244 -0
- package/dist/bench/scenarios/object-discovery.js +211 -0
- package/dist/bench/scenarios/object.js +54 -0
- package/dist/bench/scenarios/read.js +108 -0
- package/dist/bench/scenarios/registry.js +39 -0
- package/dist/bench/scenarios/runner.js +96 -0
- package/dist/bench/scenarios/webfinger.js +44 -0
- package/dist/bench/server/synthetic.js +118 -0
- package/dist/bench/signing/activity-id.js +18 -0
- package/dist/bench/signing/pipeline.js +134 -0
- package/dist/bench/signing/signer.js +39 -0
- package/dist/bench/template/generate.js +90 -0
- package/dist/bench/template/helpers.js +19 -0
- package/dist/bench/template/template.js +132 -0
- package/dist/cache.js +2 -2
- package/dist/commands.js +110 -0
- package/dist/config.js +15 -3
- package/dist/deno.js +1 -1
- package/dist/docloader.js +1 -1
- package/dist/generate-vocab/action.js +3 -3
- package/dist/generate-vocab/command.js +6 -4
- package/dist/imagerenderer.js +3 -3
- package/dist/inbox/command.js +6 -4
- package/dist/inbox/view.js +1 -1
- package/dist/inbox.js +4 -4
- package/dist/log.js +2 -2
- package/dist/lookup/command.js +121 -0
- package/dist/lookup.js +27 -138
- package/dist/mod.js +2 -20
- package/dist/nodeinfo.js +53 -12
- package/dist/options.js +1 -1
- package/dist/relay/command.js +6 -4
- package/dist/relay.js +3 -3
- package/dist/runner.js +70 -45
- package/dist/tunnel.js +8 -6
- package/dist/utils.js +9 -4
- package/dist/webfinger/action.js +1 -1
- package/dist/webfinger/command.js +6 -4
- package/dist/webfinger/error.js +2 -0
- package/dist/webfinger/lib.js +1 -1
- package/package.json +28 -23
- package/dist/generate-vocab/mod.js +0 -4
- package/dist/init/mod.js +0 -3
- package/dist/webfinger/mod.js +0 -4
package/dist/tunnel.js
CHANGED
|
@@ -1,25 +1,27 @@
|
|
|
1
1
|
import "@js-temporal/polyfill";
|
|
2
|
-
import { configureLogging } from "./log.js";
|
|
3
2
|
import { createTunnelServiceOption } from "./options.js";
|
|
4
|
-
import {
|
|
3
|
+
import { configureLogging } from "./log.js";
|
|
5
4
|
import process from "node:process";
|
|
6
5
|
import { argument, command, constant, integer, merge, message, object } from "@optique/core";
|
|
6
|
+
import { print, printError } from "@optique/run";
|
|
7
7
|
import ora from "ora";
|
|
8
8
|
import { openTunnel } from "@hongminhee/localtunnel";
|
|
9
9
|
//#region src/tunnel.ts
|
|
10
|
-
const
|
|
10
|
+
const tunnelOptions = merge("Tunnel options", object({ command: constant("tunnel") }), object({
|
|
11
11
|
port: argument(integer({
|
|
12
12
|
metavar: "PORT",
|
|
13
13
|
min: 0,
|
|
14
14
|
max: 65535
|
|
15
15
|
}), { description: message`The local port number to expose.` }),
|
|
16
16
|
service: createTunnelServiceOption(["-s", "--service"])
|
|
17
|
-
}))
|
|
17
|
+
}));
|
|
18
|
+
const tunnelMetadata = {
|
|
18
19
|
brief: message`Expose a local HTTP server to the public internet using a secure tunnel.`,
|
|
19
20
|
description: message`Expose a local HTTP server to the public internet using a secure tunnel.
|
|
20
21
|
|
|
21
22
|
Note that the HTTP requests through the tunnel have X-Forwarded-* headers.`
|
|
22
|
-
}
|
|
23
|
+
};
|
|
24
|
+
command("tunnel", tunnelOptions, tunnelMetadata);
|
|
23
25
|
async function runTunnel(command, deps = {
|
|
24
26
|
openTunnel,
|
|
25
27
|
ora,
|
|
@@ -49,4 +51,4 @@ async function runTunnel(command, deps = {
|
|
|
49
51
|
});
|
|
50
52
|
}
|
|
51
53
|
//#endregion
|
|
52
|
-
export { runTunnel,
|
|
54
|
+
export { runTunnel, tunnelMetadata, tunnelOptions };
|
package/dist/utils.js
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import "@js-temporal/polyfill";
|
|
2
|
-
import { print, printError } from "@optique/run";
|
|
3
2
|
import process from "node:process";
|
|
4
3
|
import { message } from "@optique/core";
|
|
4
|
+
import { print, printError } from "@optique/run";
|
|
5
|
+
import { flow } from "es-toolkit";
|
|
5
6
|
import { getActorHandle } from "@fedify/vocab";
|
|
6
|
-
import util from "node:util";
|
|
7
7
|
import "@fxts/core";
|
|
8
8
|
import { Chalk } from "chalk";
|
|
9
9
|
import { highlight } from "cli-highlight";
|
|
10
|
-
import
|
|
10
|
+
import "node:child_process";
|
|
11
|
+
import "node:fs/promises";
|
|
12
|
+
import util from "node:util";
|
|
11
13
|
//#region src/utils.ts
|
|
12
14
|
const colorEnabled = process.stdout.isTTY && !("NO_COLOR" in process.env && process.env.NO_COLOR !== "");
|
|
13
15
|
const colors = new Chalk(colorEnabled ? {} : { level: 0 });
|
|
@@ -33,7 +35,10 @@ async function matchesActor(actor, actorList) {
|
|
|
33
35
|
}
|
|
34
36
|
return false;
|
|
35
37
|
}
|
|
38
|
+
function describeError(error) {
|
|
39
|
+
return error instanceof Error ? error.message : String(error);
|
|
40
|
+
}
|
|
36
41
|
flow(message, print);
|
|
37
42
|
flow(message, printError);
|
|
38
43
|
//#endregion
|
|
39
|
-
export { colorEnabled, colors, formatObject, matchesActor };
|
|
44
|
+
export { colorEnabled, colors, describeError, formatObject, matchesActor };
|
package/dist/webfinger/action.js
CHANGED
|
@@ -2,9 +2,9 @@ import "@js-temporal/polyfill";
|
|
|
2
2
|
import { formatObject } from "../utils.js";
|
|
3
3
|
import { NotFoundError, getErrorMessage } from "./error.js";
|
|
4
4
|
import { convertUrlIfHandle } from "./lib.js";
|
|
5
|
-
import { formatMessage, message } from "@optique/core/message";
|
|
6
5
|
import { print } from "@optique/run";
|
|
7
6
|
import ora from "ora";
|
|
7
|
+
import { formatMessage, message } from "@optique/core/message";
|
|
8
8
|
import { lookupWebFinger } from "@fedify/webfinger";
|
|
9
9
|
//#region src/webfinger/action.ts
|
|
10
10
|
async function runWebFinger({ command: _, resources, ...options }) {
|
|
@@ -14,16 +14,18 @@ const maxRedirection = bindConfig(option("--max-redirection", integer({ min: 0 }
|
|
|
14
14
|
key: (config) => config.webfinger?.maxRedirection ?? 5,
|
|
15
15
|
default: 5
|
|
16
16
|
});
|
|
17
|
-
const
|
|
17
|
+
const webFingerOptions = merge("Network options", object({
|
|
18
18
|
command: constant("webfinger"),
|
|
19
19
|
resources: group("Arguments", multiple(argument(string({ metavar: "RESOURCE" }), { description: message`WebFinger resource(s) to look up.` }), { min: 1 })),
|
|
20
20
|
allowPrivateAddresses,
|
|
21
21
|
maxRedirection
|
|
22
|
-
}), userAgentOption)
|
|
22
|
+
}), userAgentOption);
|
|
23
|
+
const webFingerMetadata = {
|
|
23
24
|
brief: message`Look up WebFinger resources.`,
|
|
24
25
|
description: message`Look up WebFinger resources.
|
|
25
26
|
|
|
26
27
|
The argument can be multiple.`
|
|
27
|
-
}
|
|
28
|
+
};
|
|
29
|
+
command("webfinger", webFingerOptions, webFingerMetadata);
|
|
28
30
|
//#endregion
|
|
29
|
-
export {
|
|
31
|
+
export { webFingerMetadata, webFingerOptions };
|
package/dist/webfinger/error.js
CHANGED
|
@@ -15,6 +15,7 @@ const getErrorMessage = (resource, error) => error instanceof InvalidHandleError
|
|
|
15
15
|
* @extends {Error}
|
|
16
16
|
*/
|
|
17
17
|
var InvalidHandleError = class extends Error {
|
|
18
|
+
handle;
|
|
18
19
|
constructor(handle) {
|
|
19
20
|
super(`Invalid handle format: ${handle}`);
|
|
20
21
|
this.handle = handle;
|
|
@@ -30,6 +31,7 @@ var InvalidHandleError = class extends Error {
|
|
|
30
31
|
* @extends {Error}
|
|
31
32
|
*/
|
|
32
33
|
var NotFoundError = class extends Error {
|
|
34
|
+
resource;
|
|
33
35
|
constructor(resource) {
|
|
34
36
|
super(`Resource not found: ${resource}`);
|
|
35
37
|
this.resource = resource;
|
package/dist/webfinger/lib.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fedify/cli",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"README.md",
|
|
@@ -57,50 +57,55 @@
|
|
|
57
57
|
}
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
|
+
"@cfworker/json-schema": "^4.1.1",
|
|
60
61
|
"@fxts/core": "^1.20.0",
|
|
61
|
-
"@optique/config": "^1.0
|
|
62
|
-
"@optique/core": "^1.0
|
|
63
|
-
"@optique/
|
|
62
|
+
"@optique/config": "^1.1.0",
|
|
63
|
+
"@optique/core": "^1.1.0",
|
|
64
|
+
"@optique/discover": "^1.1.0",
|
|
65
|
+
"@optique/run": "^1.1.0",
|
|
64
66
|
"@standard-schema/spec": "^1.1.0",
|
|
65
67
|
"@hongminhee/localtunnel": "^0.3.0",
|
|
66
68
|
"@inquirer/prompts": "^7.8.4",
|
|
67
|
-
"@jimp/core": "^1.6.
|
|
68
|
-
"@jimp/wasm-webp": "^1.6.
|
|
69
|
+
"@jimp/core": "^1.6.1",
|
|
70
|
+
"@jimp/wasm-webp": "^1.6.1",
|
|
69
71
|
"@js-temporal/polyfill": "^0.5.1",
|
|
70
|
-
"@logtape/file": "^2.0
|
|
71
|
-
"@logtape/logtape": "^2.0
|
|
72
|
+
"@logtape/file": "^2.2.0",
|
|
73
|
+
"@logtape/logtape": "^2.2.0",
|
|
72
74
|
"@poppanator/http-constants": "^1.1.1",
|
|
73
75
|
"byte-encodings": "^1.0.11",
|
|
74
76
|
"chalk": "^5.6.2",
|
|
75
77
|
"cli-highlight": "^2.1.11",
|
|
76
78
|
"cli-table3": "^0.6.5",
|
|
77
79
|
"enquirer": "^2.4.1",
|
|
78
|
-
"es-toolkit": "1.
|
|
80
|
+
"es-toolkit": "1.46.1",
|
|
79
81
|
"fetch-mock": "^12.5.4",
|
|
80
82
|
"hono": "^4.8.3",
|
|
81
83
|
"icojs": "^0.19.5",
|
|
82
84
|
"inquirer": "^12.9.4",
|
|
83
85
|
"inquirer-toggle": "^1.0.1",
|
|
84
|
-
"jimp": "^1.6.
|
|
86
|
+
"jimp": "^1.6.1",
|
|
85
87
|
"ora": "^8.2.0",
|
|
88
|
+
"pngjs": "^7.0.0",
|
|
86
89
|
"shiki": "^1.6.4",
|
|
87
|
-
"smol-toml": "^1.6.
|
|
90
|
+
"smol-toml": "^1.6.1",
|
|
88
91
|
"srvx": "^0.8.7",
|
|
89
|
-
"valibot": "^1.
|
|
90
|
-
"
|
|
91
|
-
"@fedify/
|
|
92
|
-
"@fedify/
|
|
93
|
-
"@fedify/
|
|
94
|
-
"@fedify/
|
|
95
|
-
"@fedify/
|
|
96
|
-
"@fedify/vocab-
|
|
97
|
-
"@fedify/
|
|
92
|
+
"valibot": "^1.4.0",
|
|
93
|
+
"yaml": "^2.9.0",
|
|
94
|
+
"@fedify/fedify": "2.3.1",
|
|
95
|
+
"@fedify/init": "2.3.1",
|
|
96
|
+
"@fedify/sqlite": "2.3.1",
|
|
97
|
+
"@fedify/relay": "2.3.1",
|
|
98
|
+
"@fedify/vocab": "2.3.1",
|
|
99
|
+
"@fedify/vocab-runtime": "2.3.1",
|
|
100
|
+
"@fedify/vocab-tools": "2.3.1",
|
|
101
|
+
"@fedify/webfinger": "2.3.1"
|
|
98
102
|
},
|
|
99
103
|
"devDependencies": {
|
|
100
104
|
"@types/bun": "^1.2.23",
|
|
101
105
|
"@types/node": "^22.17.0",
|
|
102
|
-
"
|
|
103
|
-
"
|
|
106
|
+
"@types/pngjs": "^6.0.5",
|
|
107
|
+
"tsdown": "^0.22.0",
|
|
108
|
+
"typescript": "^6.0.0"
|
|
104
109
|
},
|
|
105
110
|
"scripts": {
|
|
106
111
|
"build:self": "tsdown",
|
|
@@ -110,7 +115,7 @@
|
|
|
110
115
|
"test": "node --test --experimental-transform-types 'src/**/*.test.ts' '!src/init/test/**'",
|
|
111
116
|
"test-init": "deno task test-init",
|
|
112
117
|
"pretest:bun": "pnpm build",
|
|
113
|
-
"test:bun": "bun test",
|
|
118
|
+
"test:bun": "bun test --timeout 60000",
|
|
114
119
|
"run": "pnpm build && node --disable-warning=ExperimentalWarning dist/mod.js",
|
|
115
120
|
"runi": "tsdown && node --disable-warning=ExperimentalWarning dist/mod.js",
|
|
116
121
|
"run:bun": "pnpm build && bun dist/mod.js",
|
package/dist/init/mod.js
DELETED
package/dist/webfinger/mod.js
DELETED