@fedify/cli 2.3.0-dev.1219 → 2.3.0-dev.1273

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 (63) hide show
  1. package/dist/bench/action.js +309 -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 +42 -0
  6. package/dist/bench/discovery/discover.js +67 -0
  7. package/dist/bench/discovery/probe.js +50 -0
  8. package/dist/bench/load/arrival.js +27 -0
  9. package/dist/bench/load/clock.js +15 -0
  10. package/dist/bench/load/generator.js +112 -0
  11. package/dist/bench/metrics/aggregate.js +64 -0
  12. package/dist/bench/metrics/histogram.js +141 -0
  13. package/dist/bench/metrics/stats-client.js +154 -0
  14. package/dist/bench/mod.js +4 -0
  15. package/dist/bench/render/format.js +46 -0
  16. package/dist/bench/render/index.js +20 -0
  17. package/dist/bench/render/json.js +12 -0
  18. package/dist/bench/render/markdown.js +62 -0
  19. package/dist/bench/render/text.js +74 -0
  20. package/dist/bench/result/build.js +129 -0
  21. package/dist/bench/result/expect/assert.js +74 -0
  22. package/dist/bench/result/expect/evaluate.js +128 -0
  23. package/dist/bench/result/expect/metrics.js +34 -0
  24. package/dist/bench/result/schema.js +15 -0
  25. package/dist/bench/safety/gate.js +60 -0
  26. package/dist/bench/safety/tiers.js +97 -0
  27. package/dist/bench/scenario/coerce.js +24 -0
  28. package/dist/bench/scenario/errors.js +36 -0
  29. package/dist/bench/scenario/load.js +69 -0
  30. package/dist/bench/scenario/normalize.js +126 -0
  31. package/dist/bench/scenario/schema.js +358 -0
  32. package/dist/bench/scenario/units.js +56 -0
  33. package/dist/bench/scenario/validate.js +29 -0
  34. package/dist/bench/scenarios/inbox.js +155 -0
  35. package/dist/bench/scenarios/registry.js +21 -0
  36. package/dist/bench/scenarios/runner.js +76 -0
  37. package/dist/bench/scenarios/webfinger.js +44 -0
  38. package/dist/bench/server/synthetic.js +118 -0
  39. package/dist/bench/signing/activity-id.js +18 -0
  40. package/dist/bench/signing/pipeline.js +134 -0
  41. package/dist/bench/signing/signer.js +39 -0
  42. package/dist/bench/template/generate.js +90 -0
  43. package/dist/bench/template/helpers.js +19 -0
  44. package/dist/bench/template/template.js +132 -0
  45. package/dist/cache.js +1 -1
  46. package/dist/config.js +14 -2
  47. package/dist/deno.js +1 -1
  48. package/dist/generate-vocab/action.js +3 -3
  49. package/dist/generate-vocab/command.js +1 -1
  50. package/dist/imagerenderer.js +1 -1
  51. package/dist/inbox/view.js +1 -1
  52. package/dist/inbox.js +2 -2
  53. package/dist/lookup.js +37 -37
  54. package/dist/mod.js +3 -0
  55. package/dist/nodeinfo.js +5 -5
  56. package/dist/options.js +1 -1
  57. package/dist/relay.js +1 -1
  58. package/dist/runner.js +10 -8
  59. package/dist/tempserver.js +1 -1
  60. package/dist/tunnel.js +2 -2
  61. package/dist/utils.js +8 -4
  62. package/dist/webfinger/action.js +1 -1
  63. package/package.json +12 -10
package/dist/relay.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import "@js-temporal/polyfill";
2
+ import { colors, matchesActor } from "./utils.js";
2
3
  import { configureLogging } from "./log.js";
3
4
  import { tableStyle } from "./table.js";
4
5
  import { spawnTemporaryServer } from "./tempserver.js";
5
- import { colors, matchesActor } from "./utils.js";
6
6
  import process from "node:process";
7
7
  import { MemoryKvStore } from "@fedify/fedify";
8
8
  import { getLogger } from "@logtape/logtape";
package/dist/runner.js CHANGED
@@ -1,10 +1,12 @@
1
1
  import "@js-temporal/polyfill";
2
- import generateVocabCommand from "./generate-vocab/command.js";
3
- import "./generate-vocab/mod.js";
2
+ import { describeError } from "./utils.js";
4
3
  import { version } from "./deno.js";
5
- import { initCommand } from "./init/mod.js";
6
4
  import { configContext, tryLoadToml } from "./config.js";
7
5
  import { globalOptions } from "./options.js";
6
+ import { benchCommand } from "./bench/command.js";
7
+ import generateVocabCommand from "./generate-vocab/command.js";
8
+ import "./generate-vocab/mod.js";
9
+ import { initCommand } from "./init/mod.js";
8
10
  import { nodeInfoCommand } from "./nodeinfo.js";
9
11
  import { lookupCommand } from "./lookup.js";
10
12
  import { inboxCommand } from "./inbox/command.js";
@@ -12,14 +14,14 @@ import { relayCommand } from "./relay/command.js";
12
14
  import { tunnelCommand } from "./tunnel.js";
13
15
  import { webFingerCommand } from "./webfinger/command.js";
14
16
  import "./webfinger/mod.js";
15
- import { printError, run } from "@optique/run";
16
17
  import process from "node:process";
17
18
  import { group, merge, message, or } from "@optique/core";
18
- import { join } from "node:path";
19
+ import { printError, run } from "@optique/run";
19
20
  import { merge as merge$1 } from "es-toolkit";
21
+ import { homedir } from "node:os";
20
22
  import { readFileSync } from "node:fs";
21
23
  import { parse } from "smol-toml";
22
- import { homedir } from "node:os";
24
+ import { join } from "node:path";
23
25
  //#region src/runner.ts
24
26
  /**
25
27
  * Returns the system-wide configuration file paths.
@@ -39,7 +41,7 @@ function getUserConfigPath() {
39
41
  if (process.platform === "win32") return join(process.env.APPDATA || join(homedir(), "AppData", "Roaming"), "fedify", "config.toml");
40
42
  return join(process.env.XDG_CONFIG_HOME || join(homedir(), ".config"), "fedify", "config.toml");
41
43
  }
42
- const command$1 = merge(or(group("Generating code", or(initCommand, generateVocabCommand)), group("ActivityPub tools", or(webFingerCommand, lookupCommand, inboxCommand, nodeInfoCommand, relayCommand)), group("Network tools", tunnelCommand)), globalOptions);
44
+ const command$1 = merge(or(group("Generating code", or(initCommand, generateVocabCommand)), group("ActivityPub tools", or(webFingerCommand, lookupCommand, inboxCommand, nodeInfoCommand, relayCommand, benchCommand)), group("Network tools", tunnelCommand)), globalOptions);
43
45
  function loadConfig(parsed) {
44
46
  if (parsed.ignoreConfig) return void 0;
45
47
  const system = getSystemConfigPaths().map(tryLoadToml).reduce((acc, config) => merge$1(acc, config), {});
@@ -49,7 +51,7 @@ function loadConfig(parsed) {
49
51
  if (parsed.configPath) try {
50
52
  custom = parse(readFileSync(parsed.configPath, "utf-8"));
51
53
  } catch (error) {
52
- printError(message`Could not load config file at ${parsed.configPath}: ${error instanceof Error ? error.message : String(error)}`);
54
+ printError(message`Could not load config file at ${parsed.configPath}: ${describeError(error)}`);
53
55
  process.exit(1);
54
56
  }
55
57
  return {
@@ -1,7 +1,7 @@
1
1
  import "@js-temporal/polyfill";
2
2
  import { getLogger } from "@logtape/logtape";
3
- import { openTunnel } from "@hongminhee/localtunnel";
4
3
  import { serve } from "srvx";
4
+ import { openTunnel } from "@hongminhee/localtunnel";
5
5
  //#region src/tempserver.ts
6
6
  const logger = getLogger([
7
7
  "fedify",
package/dist/tunnel.js CHANGED
@@ -1,9 +1,9 @@
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
package/dist/utils.js CHANGED
@@ -1,13 +1,14 @@
1
1
  import "@js-temporal/polyfill";
2
- import { print, printError } from "@optique/run";
2
+ import "node:fs/promises";
3
3
  import process from "node:process";
4
- import { message } from "@optique/core";
5
4
  import { getActorHandle } from "@fedify/vocab";
6
- import util from "node:util";
7
5
  import "@fxts/core";
6
+ import { message } from "@optique/core";
7
+ import { print, printError } from "@optique/run";
8
8
  import { Chalk } from "chalk";
9
9
  import { highlight } from "cli-highlight";
10
10
  import { flow } from "es-toolkit";
11
+ import util from "node:util";
11
12
  //#region src/utils.ts
12
13
  const colorEnabled = process.stdout.isTTY && !("NO_COLOR" in process.env && process.env.NO_COLOR !== "");
13
14
  const colors = new Chalk(colorEnabled ? {} : { level: 0 });
@@ -33,7 +34,10 @@ async function matchesActor(actor, actorList) {
33
34
  }
34
35
  return false;
35
36
  }
37
+ function describeError(error) {
38
+ return error instanceof Error ? error.message : String(error);
39
+ }
36
40
  flow(message, print);
37
41
  flow(message, printError);
38
42
  //#endregion
39
- export { colorEnabled, colors, formatObject, matchesActor };
43
+ export { colorEnabled, colors, describeError, formatObject, matchesActor };
@@ -2,8 +2,8 @@ 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";
6
+ import { formatMessage, message } from "@optique/core/message";
7
7
  import ora from "ora";
8
8
  import { lookupWebFinger } from "@fedify/webfinger";
9
9
  //#region src/webfinger/action.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fedify/cli",
3
- "version": "2.3.0-dev.1219+e9ad1fa3",
3
+ "version": "2.3.0-dev.1273+6b46a8b5",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "README.md",
@@ -57,6 +57,7 @@
57
57
  }
58
58
  },
59
59
  "dependencies": {
60
+ "@cfworker/json-schema": "^4.1.1",
60
61
  "@fxts/core": "^1.20.0",
61
62
  "@optique/config": "^1.0.2",
62
63
  "@optique/core": "^1.0.2",
@@ -87,14 +88,15 @@
87
88
  "smol-toml": "^1.6.1",
88
89
  "srvx": "^0.8.7",
89
90
  "valibot": "^1.4.0",
90
- "@fedify/fedify": "2.3.0-dev.1219+e9ad1fa3",
91
- "@fedify/init": "2.3.0-dev.1219+e9ad1fa3",
92
- "@fedify/relay": "2.3.0-dev.1219+e9ad1fa3",
93
- "@fedify/sqlite": "2.3.0-dev.1219+e9ad1fa3",
94
- "@fedify/vocab": "2.3.0-dev.1219+e9ad1fa3",
95
- "@fedify/webfinger": "2.3.0-dev.1219+e9ad1fa3",
96
- "@fedify/vocab-runtime": "2.3.0-dev.1219+e9ad1fa3",
97
- "@fedify/vocab-tools": "2.3.0-dev.1219+e9ad1fa3"
91
+ "yaml": "^2.9.0",
92
+ "@fedify/fedify": "2.3.0-dev.1273+6b46a8b5",
93
+ "@fedify/init": "2.3.0-dev.1273+6b46a8b5",
94
+ "@fedify/vocab": "2.3.0-dev.1273+6b46a8b5",
95
+ "@fedify/sqlite": "2.3.0-dev.1273+6b46a8b5",
96
+ "@fedify/relay": "2.3.0-dev.1273+6b46a8b5",
97
+ "@fedify/webfinger": "2.3.0-dev.1273+6b46a8b5",
98
+ "@fedify/vocab-runtime": "2.3.0-dev.1273+6b46a8b5",
99
+ "@fedify/vocab-tools": "2.3.0-dev.1273+6b46a8b5"
98
100
  },
99
101
  "devDependencies": {
100
102
  "@types/bun": "^1.2.23",
@@ -110,7 +112,7 @@
110
112
  "test": "node --test --experimental-transform-types 'src/**/*.test.ts' '!src/init/test/**'",
111
113
  "test-init": "deno task test-init",
112
114
  "pretest:bun": "pnpm build",
113
- "test:bun": "bun test",
115
+ "test:bun": "bun test --timeout 60000",
114
116
  "run": "pnpm build && node --disable-warning=ExperimentalWarning dist/mod.js",
115
117
  "runi": "tsdown && node --disable-warning=ExperimentalWarning dist/mod.js",
116
118
  "run:bun": "pnpm build && bun dist/mod.js",