@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.
Files changed (83) hide show
  1. package/dist/bench/action.js +469 -0
  2. package/dist/bench/actor/documents.js +39 -0
  3. package/dist/bench/actor/fleet.js +39 -0
  4. package/dist/bench/actor/keys.js +35 -0
  5. package/dist/bench/command.js +72 -0
  6. package/dist/bench/compare/schema.js +16 -0
  7. package/dist/bench/compare.js +667 -0
  8. package/dist/bench/discovery/discover.js +67 -0
  9. package/dist/bench/discovery/probe.js +50 -0
  10. package/dist/bench/load/arrival.js +27 -0
  11. package/dist/bench/load/clock.js +33 -0
  12. package/dist/bench/load/generator.js +145 -0
  13. package/dist/bench/metrics/aggregate.js +64 -0
  14. package/dist/bench/metrics/histogram.js +141 -0
  15. package/dist/bench/metrics/stats-client.js +216 -0
  16. package/dist/bench/mod.js +11 -0
  17. package/dist/bench/render/format.js +46 -0
  18. package/dist/bench/render/index.js +20 -0
  19. package/dist/bench/render/json.js +12 -0
  20. package/dist/bench/render/markdown.js +63 -0
  21. package/dist/bench/render/text.js +75 -0
  22. package/dist/bench/result/build.js +252 -0
  23. package/dist/bench/result/expect/assert.js +74 -0
  24. package/dist/bench/result/expect/evaluate.js +128 -0
  25. package/dist/bench/result/expect/metrics.js +34 -0
  26. package/dist/bench/result/schema.js +365 -0
  27. package/dist/bench/safety/gate.js +62 -0
  28. package/dist/bench/safety/tiers.js +97 -0
  29. package/dist/bench/scenario/coerce.js +24 -0
  30. package/dist/bench/scenario/errors.js +36 -0
  31. package/dist/bench/scenario/load.js +69 -0
  32. package/dist/bench/scenario/normalize.js +125 -0
  33. package/dist/bench/scenario/schema.js +399 -0
  34. package/dist/bench/scenario/units.js +56 -0
  35. package/dist/bench/scenario/validate.js +29 -0
  36. package/dist/bench/scenarios/actor.js +38 -0
  37. package/dist/bench/scenarios/failure.js +363 -0
  38. package/dist/bench/scenarios/fanout.js +261 -0
  39. package/dist/bench/scenarios/inbox.js +147 -0
  40. package/dist/bench/scenarios/mixed.js +244 -0
  41. package/dist/bench/scenarios/object-discovery.js +211 -0
  42. package/dist/bench/scenarios/object.js +54 -0
  43. package/dist/bench/scenarios/read.js +108 -0
  44. package/dist/bench/scenarios/registry.js +39 -0
  45. package/dist/bench/scenarios/runner.js +96 -0
  46. package/dist/bench/scenarios/webfinger.js +44 -0
  47. package/dist/bench/server/synthetic.js +118 -0
  48. package/dist/bench/signing/activity-id.js +18 -0
  49. package/dist/bench/signing/pipeline.js +134 -0
  50. package/dist/bench/signing/signer.js +39 -0
  51. package/dist/bench/template/generate.js +90 -0
  52. package/dist/bench/template/helpers.js +19 -0
  53. package/dist/bench/template/template.js +132 -0
  54. package/dist/cache.js +2 -2
  55. package/dist/commands.js +110 -0
  56. package/dist/config.js +15 -3
  57. package/dist/deno.js +1 -1
  58. package/dist/docloader.js +1 -1
  59. package/dist/generate-vocab/action.js +3 -3
  60. package/dist/generate-vocab/command.js +6 -4
  61. package/dist/imagerenderer.js +3 -3
  62. package/dist/inbox/command.js +6 -4
  63. package/dist/inbox/view.js +1 -1
  64. package/dist/inbox.js +4 -4
  65. package/dist/log.js +2 -2
  66. package/dist/lookup/command.js +121 -0
  67. package/dist/lookup.js +27 -138
  68. package/dist/mod.js +2 -20
  69. package/dist/nodeinfo.js +53 -12
  70. package/dist/options.js +1 -1
  71. package/dist/relay/command.js +6 -4
  72. package/dist/relay.js +3 -3
  73. package/dist/runner.js +70 -45
  74. package/dist/tunnel.js +8 -6
  75. package/dist/utils.js +9 -4
  76. package/dist/webfinger/action.js +1 -1
  77. package/dist/webfinger/command.js +6 -4
  78. package/dist/webfinger/error.js +2 -0
  79. package/dist/webfinger/lib.js +1 -1
  80. package/package.json +28 -23
  81. package/dist/generate-vocab/mod.js +0 -4
  82. package/dist/init/mod.js +0 -3
  83. 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 { print, printError } from "@optique/run";
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 tunnelCommand = command("tunnel", merge("Tunnel options", object({ command: constant("tunnel") }), object({
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, tunnelCommand };
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 { flow } from "es-toolkit";
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 };
@@ -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 webFingerCommand = command("webfinger", merge("Network options", object({
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 { webFingerCommand };
31
+ export { webFingerMetadata, webFingerOptions };
@@ -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;
@@ -1,7 +1,7 @@
1
1
  import "@js-temporal/polyfill";
2
2
  import { InvalidHandleError } from "./error.js";
3
- import { toAcctUrl } from "@fedify/vocab";
4
3
  import { getLogger } from "@logtape/logtape";
4
+ import { toAcctUrl } from "@fedify/vocab";
5
5
  getLogger([
6
6
  "fedify",
7
7
  "cli",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fedify/cli",
3
- "version": "2.3.0-dev.994+9071ca0a",
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.2",
62
- "@optique/core": "^1.0.2",
63
- "@optique/run": "^1.0.2",
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.0",
68
- "@jimp/wasm-webp": "^1.6.0",
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.5",
71
- "@logtape/logtape": "^2.0.5",
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.43.0",
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.0",
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.0",
90
+ "smol-toml": "^1.6.1",
88
91
  "srvx": "^0.8.7",
89
- "valibot": "^1.2.0",
90
- "@fedify/fedify": "2.3.0-dev.994+9071ca0a",
91
- "@fedify/sqlite": "2.3.0-dev.994+9071ca0a",
92
- "@fedify/vocab": "2.3.0-dev.994+9071ca0a",
93
- "@fedify/init": "2.3.0-dev.994+9071ca0a",
94
- "@fedify/vocab-runtime": "2.3.0-dev.994+9071ca0a",
95
- "@fedify/relay": "2.3.0-dev.994+9071ca0a",
96
- "@fedify/vocab-tools": "2.3.0-dev.994+9071ca0a",
97
- "@fedify/webfinger": "2.3.0-dev.994+9071ca0a"
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
- "tsdown": "^0.21.6",
103
- "typescript": "^5.9.2"
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",
@@ -1,4 +0,0 @@
1
- import "@js-temporal/polyfill";
2
- import "./action.js";
3
- import "./command.js";
4
- export {};
package/dist/init/mod.js DELETED
@@ -1,3 +0,0 @@
1
- import "@js-temporal/polyfill";
2
- import { initCommand, runInit } from "@fedify/init";
3
- export { initCommand, runInit };
@@ -1,4 +0,0 @@
1
- import "@js-temporal/polyfill";
2
- import "./action.js";
3
- import "./command.js";
4
- export {};