@fedify/fedify 1.4.0-dev.618 → 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 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/README.md CHANGED
@@ -98,7 +98,11 @@ financial contributors:[^2]
98
98
 
99
99
  ### Backers
100
100
 
101
- yamanoku, okin, box464
101
+ yamanoku, okin, Andy Piper, box464, Evan Prodromou
102
+
103
+ ### One-time donations
104
+
105
+ Rameez
102
106
 
103
107
  <!-- /DO NOT EDIT -->
104
108
  <!-- cSpell: enable -->
package/esm/deno.js CHANGED
@@ -1,6 +1,6 @@
1
1
  export default {
2
2
  "name": "@fedify/fedify",
3
- "version": "1.4.0-dev.618+6b692652",
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.0",
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;
@@ -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 = "Deno" in dntShim.dntGlobalThis
330
- ? `Deno/${dntShim.Deno.version.deno}`
331
- : "Bun" in dntShim.dntGlobalThis
332
- // @ts-ignore: `Bun` is a global variable in Bun
333
- ? `Bun/${Bun.version}`
334
- : "process" in dntShim.dntGlobalThis
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);