@fedify/fedify 1.4.0-dev.620 → 1.4.0-dev.623
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/CHANGES.md +11 -0
- package/esm/deno.js +2 -2
- package/esm/deps/jsr.io/@david/which-runtime/0.2.1/mod.js +10 -0
- package/esm/runtime/docloader.js +7 -8
- package/esm/vocab/vocab.js +176 -176
- package/package.json +1 -1
- package/types/deps/jsr.io/@david/which-runtime/0.2.1/mod.d.ts +3 -0
- package/types/deps/jsr.io/@david/which-runtime/0.2.1/mod.d.ts.map +1 -0
- package/types/runtime/docloader.d.ts.map +1 -1
package/CHANGES.md
CHANGED
@@ -50,6 +50,17 @@ To be released.
|
|
50
50
|
[#195]: https://github.com/fedify-dev/fedify/issues/195
|
51
51
|
|
52
52
|
|
53
|
+
Version 1.3.6
|
54
|
+
-------------
|
55
|
+
|
56
|
+
Released on January 31, 2025.
|
57
|
+
|
58
|
+
- Fixed a bug where `getUserAgent()` function had returned a `User-Agent`
|
59
|
+
string with a wrong JavaScript runtime name on Node.js. [[#203]]
|
60
|
+
|
61
|
+
[#203]: https://github.com/fedify-dev/fedify/issues/203
|
62
|
+
|
63
|
+
|
53
64
|
Version 1.3.5
|
54
65
|
-------------
|
55
66
|
|
package/esm/deno.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
export default {
|
2
2
|
"name": "@fedify/fedify",
|
3
|
-
"version": "1.4.0-dev.
|
3
|
+
"version": "1.4.0-dev.623+74652529",
|
4
4
|
"license": "MIT",
|
5
5
|
"exports": {
|
6
6
|
".": "./mod.ts",
|
@@ -17,7 +17,7 @@ export default {
|
|
17
17
|
},
|
18
18
|
"imports": {
|
19
19
|
"@cfworker/json-schema": "npm:@cfworker/json-schema@^2.0.1",
|
20
|
-
"@david/which-runtime": "jsr:@david/which-runtime@^0.2.
|
20
|
+
"@david/which-runtime": "jsr:@david/which-runtime@^0.2.1",
|
21
21
|
"@deno/dnt": "jsr:@deno/dnt@0.41.2",
|
22
22
|
"@fedify/fedify": "./mod.ts",
|
23
23
|
"@fedify/fedify/federation": "./federation/mod.ts",
|
@@ -0,0 +1,10 @@
|
|
1
|
+
const inner = {
|
2
|
+
// dnt-shim-ignore
|
3
|
+
// deno-lint-ignore no-explicit-any
|
4
|
+
isMaybeNode: globalThis.process?.versions?.node != null,
|
5
|
+
// dnt-shim-ignore
|
6
|
+
// deno-lint-ignore no-explicit-any
|
7
|
+
isDeno: globalThis.Deno?.version?.deno != null,
|
8
|
+
};
|
9
|
+
export const isNode = inner.isMaybeNode && !inner.isDeno;
|
10
|
+
export const isDeno = inner.isDeno;
|
package/esm/runtime/docloader.js
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
import * as dntShim from "../_dnt.shims.js";
|
2
|
+
import { isDeno, isNode } from "../deps/jsr.io/@david/which-runtime/0.2.1/mod.js";
|
2
3
|
import { HTTPHeaderLink } from "@hugoalh/http-header-link";
|
3
4
|
import { getLogger } from "@logtape/logtape";
|
4
5
|
import process from "node:process";
|
@@ -326,14 +327,12 @@ export function kvCache({ loader, kv, prefix, rules }) {
|
|
326
327
|
*/
|
327
328
|
export function getUserAgent({ software, url } = {}) {
|
328
329
|
const fedify = `Fedify/${metadata.version}`;
|
329
|
-
const runtime =
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
? `
|
334
|
-
:
|
335
|
-
? `Node.js/${process.version}`
|
336
|
-
: null;
|
330
|
+
const runtime = isDeno ? `Deno/${dntShim.Deno.version.deno}` : "Bun" in dntShim.dntGlobalThis
|
331
|
+
// @ts-ignore: `Bun` is a global variable in Bun
|
332
|
+
? `Bun/${Bun.version}`
|
333
|
+
: isNode
|
334
|
+
? `Node.js/${process.version}`
|
335
|
+
: null;
|
337
336
|
const userAgent = software == null ? [fedify] : [software, fedify];
|
338
337
|
if (runtime != null)
|
339
338
|
userAgent.push(runtime);
|