@fedify/fedify 1.6.0-experiment.0 → 1.6.0
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/codegen/type.js +0 -2
- package/dist/deno.js +20 -6
- package/dist/federation/mq.test.js +46 -42
- package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/_common/from_file_url.js +1 -1
- package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/_common/normalize.js +1 -1
- package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/posix/from_file_url.js +1 -1
- package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/posix/normalize.js +1 -1
- package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/windows/from_file_url.js +1 -1
- package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/windows/normalize.js +1 -1
- package/dist/testing/mod.js +50 -1
- package/dist/vocab/vocab.js +176 -176
- package/package.json +8 -8
package/dist/codegen/type.js
CHANGED
@@ -289,7 +289,6 @@ const scalarTypes = {
|
|
289
289
|
typeGuard(v) {
|
290
290
|
return `
|
291
291
|
// @ts-ignore: CryptoKey exists in the global scope.
|
292
|
-
// dnt-shim-ignore
|
293
292
|
${v} instanceof CryptoKey
|
294
293
|
`;
|
295
294
|
},
|
@@ -312,7 +311,6 @@ const scalarTypes = {
|
|
312
311
|
typeGuard(v) {
|
313
312
|
return `
|
314
313
|
// @ts-ignore: CryptoKey exists in the global scope.
|
315
|
-
// dnt-shim-ignore
|
316
314
|
${v} instanceof CryptoKey
|
317
315
|
`;
|
318
316
|
},
|
package/dist/deno.js
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
//#region deno.json
|
6
6
|
var name = "@fedify/fedify";
|
7
|
-
var version = "1.6.0";
|
7
|
+
var version = "1.6.0-dev.825+cc3d14fd";
|
8
8
|
var license = "MIT";
|
9
9
|
var exports = {
|
10
10
|
".": "./mod.ts",
|
@@ -22,7 +22,6 @@ var exports = {
|
|
22
22
|
};
|
23
23
|
var imports = {
|
24
24
|
"@cfworker/json-schema": "npm:@cfworker/json-schema@^4.1.1",
|
25
|
-
"@deno/dnt": "jsr:@deno/dnt@0.41.3",
|
26
25
|
"@es-toolkit/es-toolkit": "jsr:@es-toolkit/es-toolkit@^1.38.0",
|
27
26
|
"@hongminhee/deno-mock-fetch": "jsr:@hongminhee/deno-mock-fetch@^0.3.2",
|
28
27
|
"@hugoalh/http-header-link": "jsr:@hugoalh/http-header-link@^1.0.2",
|
@@ -48,7 +47,6 @@ var imports = {
|
|
48
47
|
};
|
49
48
|
var include = ["vocab/vocab.ts"];
|
50
49
|
var exclude = [
|
51
|
-
".dnt-import-map.json",
|
52
50
|
"apidoc/",
|
53
51
|
"codegen/schema.yaml",
|
54
52
|
"dist/",
|
@@ -86,12 +84,28 @@ var tasks = {
|
|
86
84
|
"command": "deno publish",
|
87
85
|
"dependencies": ["codegen"]
|
88
86
|
},
|
89
|
-
"
|
90
|
-
"
|
87
|
+
"pnpm:install": "pnpm install",
|
88
|
+
"pnpm:build": {
|
89
|
+
"command": "pnpm exec tsdown",
|
90
|
+
"dependencies": ["codegen", "pnpm:install"]
|
91
|
+
},
|
92
|
+
"npm": {
|
93
|
+
"command": "pnpm pack",
|
94
|
+
"dependencies": ["pnpm:install"]
|
95
|
+
},
|
96
|
+
"test:node": {
|
97
|
+
"command": "cd dist/ && node --test",
|
98
|
+
"dependencies": ["pnpm:build"]
|
99
|
+
},
|
100
|
+
"test:bun": {
|
101
|
+
"command": "cd dist/ && bun test --timeout 60000",
|
102
|
+
"dependencies": ["pnpm:build"]
|
103
|
+
},
|
91
104
|
"test-all": { "dependencies": [
|
92
105
|
"check",
|
93
106
|
"test",
|
94
|
-
"test:node"
|
107
|
+
"test:node",
|
108
|
+
"test:bun"
|
95
109
|
] }
|
96
110
|
};
|
97
111
|
var deno_default = {
|
@@ -67,50 +67,54 @@ if ("Deno" in globalThis && "openKv" in globalThis.Deno && typeof globalThis.Den
|
|
67
67
|
const { DenoKvMessageQueue } = await import("../x/denokv.js");
|
68
68
|
queues.DenoKvMessageQueue = async () => new DenoKvMessageQueue(await globalThis.Deno.openKv(":memory:"));
|
69
69
|
}
|
70
|
-
for (const mqName in queues) test(
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
70
|
+
for (const mqName in queues) test({
|
71
|
+
name: `ParallelMessageQueue [${mqName}]`,
|
72
|
+
ignore: "Bun" in globalThis,
|
73
|
+
async fn(t) {
|
74
|
+
const mq = await queues[mqName]();
|
75
|
+
const workers = new ParallelMessageQueue(mq, 5);
|
76
|
+
const messages = [];
|
77
|
+
const controller = new AbortController();
|
78
|
+
const listening = workers.listen(async (message) => {
|
79
|
+
for (let i = 0, cnt = 5 + Math.random() * 5; i < cnt; i++) await delay(250);
|
80
|
+
messages.push(message);
|
81
|
+
}, controller);
|
82
|
+
await t.step("enqueue() [single]", async () => {
|
83
|
+
await workers.enqueue("Hello, world!");
|
84
|
+
});
|
85
|
+
await waitFor(() => messages.length > 0, 15e3);
|
86
|
+
await t.step("listen() [single]", () => {
|
87
|
+
assertEquals(messages, ["Hello, world!"]);
|
88
|
+
});
|
89
|
+
messages.pop();
|
90
|
+
await t.step("enqueue() [multiple]", async () => {
|
91
|
+
for (let i = 0; i < 20; i++) await workers.enqueue(`Hello, ${i}!`);
|
92
|
+
});
|
93
|
+
await t.step("listen() [multiple]", async () => {
|
94
|
+
await delay(3e3);
|
95
|
+
assertGreaterOrEqual(messages.length, 5);
|
96
|
+
await waitFor(() => messages.length >= 20, 15e3);
|
97
|
+
assertEquals(messages.length, 20);
|
98
|
+
});
|
93
99
|
await waitFor(() => messages.length >= 20, 15e3);
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
100
|
+
while (messages.length > 0) messages.pop();
|
101
|
+
await t.step("enqueueMany()", async () => {
|
102
|
+
const messages$1 = Array.from({ length: 20 }, (_, i) => `Hello, ${i}!`);
|
103
|
+
await workers.enqueueMany(messages$1);
|
104
|
+
});
|
105
|
+
await t.step("listen() [multiple]", async () => {
|
106
|
+
await delay(3e3);
|
107
|
+
assertGreaterOrEqual(messages.length, 5);
|
108
|
+
await waitFor(() => messages.length >= 20, 15e3);
|
109
|
+
assertEquals(messages.length, 20);
|
110
|
+
});
|
105
111
|
await waitFor(() => messages.length >= 20, 15e3);
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
const dispose = mq[Symbol.dispose];
|
113
|
-
if (typeof dispose === "function") dispose.call(mq);
|
112
|
+
controller.abort();
|
113
|
+
await listening;
|
114
|
+
if (Symbol.dispose in mq) {
|
115
|
+
const dispose = mq[Symbol.dispose];
|
116
|
+
if (typeof dispose === "function") dispose.call(mq);
|
117
|
+
}
|
114
118
|
}
|
115
119
|
});
|
116
120
|
async function waitFor(predicate, timeoutMs) {
|
@@ -2,7 +2,7 @@
|
|
2
2
|
import { Temporal } from "@js-temporal/polyfill";
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
4
4
|
|
5
|
-
import { assertArg
|
5
|
+
import { assertArg } from "../_common/from_file_url.js";
|
6
6
|
|
7
7
|
//#region node_modules/.pnpm/@jsr+std__path@1.0.9/node_modules/@jsr/std__path/posix/from_file_url.js
|
8
8
|
/**
|
package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/posix/normalize.js
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
4
4
|
|
5
5
|
import { isPosixPathSeparator$1 as isPosixPathSeparator } from "./_util.js";
|
6
|
-
import { assertArg } from "../_common/normalize.js";
|
6
|
+
import { assertArg$2 as assertArg } from "../_common/normalize.js";
|
7
7
|
import { normalizeString } from "../_common/normalize_string.js";
|
8
8
|
|
9
9
|
//#region node_modules/.pnpm/@jsr+std__path@1.0.9/node_modules/@jsr/std__path/posix/normalize.js
|
@@ -2,7 +2,7 @@
|
|
2
2
|
import { Temporal } from "@js-temporal/polyfill";
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
4
4
|
|
5
|
-
import { assertArg
|
5
|
+
import { assertArg } from "../_common/from_file_url.js";
|
6
6
|
|
7
7
|
//#region node_modules/.pnpm/@jsr+std__path@1.0.9/node_modules/@jsr/std__path/windows/from_file_url.js
|
8
8
|
/**
|
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
import { CHAR_COLON } from "../_common/constants.js";
|
6
6
|
import { isPathSeparator, isWindowsDeviceRoot } from "./_util.js";
|
7
|
-
import { assertArg } from "../_common/normalize.js";
|
7
|
+
import { assertArg$2 as assertArg } from "../_common/normalize.js";
|
8
8
|
import { normalizeString } from "../_common/normalize_string.js";
|
9
9
|
|
10
10
|
//#region node_modules/.pnpm/@jsr+std__path@1.0.9/node_modules/@jsr/std__path/windows/normalize.js
|
package/dist/testing/mod.js
CHANGED
@@ -45,7 +45,46 @@ function test$1(name, options, fn) {
|
|
45
45
|
}
|
46
46
|
}
|
47
47
|
});
|
48
|
-
else
|
48
|
+
else if ("Bun" in globalThis) {
|
49
|
+
let failed = void 0;
|
50
|
+
async function step(defOrNameOrFn, fn$2) {
|
51
|
+
let def$1;
|
52
|
+
if (typeof defOrNameOrFn === "string") def$1 = {
|
53
|
+
name: defOrNameOrFn,
|
54
|
+
fn: fn$2
|
55
|
+
};
|
56
|
+
else if (typeof defOrNameOrFn === "function") def$1 = {
|
57
|
+
name: defOrNameOrFn.name,
|
58
|
+
fn: defOrNameOrFn
|
59
|
+
};
|
60
|
+
else def$1 = defOrNameOrFn;
|
61
|
+
if (def$1.ignore) return true;
|
62
|
+
try {
|
63
|
+
await def$1.fn({
|
64
|
+
name: def$1.name,
|
65
|
+
origin: "",
|
66
|
+
step
|
67
|
+
});
|
68
|
+
} catch (e) {
|
69
|
+
failed ??= e;
|
70
|
+
return false;
|
71
|
+
}
|
72
|
+
return true;
|
73
|
+
}
|
74
|
+
const ctx = {
|
75
|
+
name: def.name,
|
76
|
+
origin: "",
|
77
|
+
step
|
78
|
+
};
|
79
|
+
async function fn$1() {
|
80
|
+
await def.fn(ctx);
|
81
|
+
if (failed) throw failed;
|
82
|
+
}
|
83
|
+
const bunTest = Bun.jest(caller()).test;
|
84
|
+
if (def.ignore) bunTest.skip(def.name, fn$1);
|
85
|
+
else if (def.only) bunTest.only(def.name, fn$1);
|
86
|
+
else bunTest(def.name, fn$1);
|
87
|
+
} else test(def.name, {
|
49
88
|
only: def.only,
|
50
89
|
skip: def.ignore
|
51
90
|
}, async (t) => {
|
@@ -82,6 +121,16 @@ function intoDenoTestContext(name, ctx) {
|
|
82
121
|
};
|
83
122
|
return denoCtx;
|
84
123
|
}
|
124
|
+
/** Retrieve caller test file. */
|
125
|
+
function caller() {
|
126
|
+
const Trace = Error;
|
127
|
+
const _ = Trace.prepareStackTrace;
|
128
|
+
Trace.prepareStackTrace = (_$1, stack$1) => stack$1;
|
129
|
+
const { stack } = new Error();
|
130
|
+
Trace.prepareStackTrace = _;
|
131
|
+
const caller$1 = stack[2];
|
132
|
+
return caller$1.getFileName().replaceAll("\\", "/");
|
133
|
+
}
|
85
134
|
|
86
135
|
//#endregion
|
87
136
|
export { test$1 as test };
|