@gjsify/fetch 0.4.31 → 0.4.33
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/globals.mjs +17 -0
- package/package.json +20 -10
package/globals.mjs
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// Re-exports native Fetch API globals for use in Node.js / browser builds.
|
|
2
|
+
// On Node 18+ fetch, Request, Response, Headers and FormData are native
|
|
3
|
+
// globals (the undici-backed implementation is enabled by default). On
|
|
4
|
+
// browsers all five have been native for a decade.
|
|
5
|
+
//
|
|
6
|
+
// The dynamic resolver in `@gjsify/resolve-npm/runtime-aliases.mjs` routes
|
|
7
|
+
// `@gjsify/fetch` here when the package's `gjsify.runtimes` triplet
|
|
8
|
+
// declares the non-GJS slot as `"native"`. The hardcoded bare `fetch`
|
|
9
|
+
// specifier in `ALIASES_WEB_FOR_NODE` previously skipped aliasing on
|
|
10
|
+
// Node entirely (consumers read `globalThis.fetch` directly); now both
|
|
11
|
+
// paths converge on this file.
|
|
12
|
+
|
|
13
|
+
export const fetch = globalThis.fetch;
|
|
14
|
+
export const Request = globalThis.Request;
|
|
15
|
+
export const Response = globalThis.Response;
|
|
16
|
+
export const Headers = globalThis.Headers;
|
|
17
|
+
export const FormData = globalThis.FormData;
|
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gjsify/fetch",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.33",
|
|
4
4
|
"description": "Web and Node.js fetch module for Gjs",
|
|
5
5
|
"module": "lib/esm/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
7
7
|
"files": [
|
|
8
|
-
"lib"
|
|
8
|
+
"lib",
|
|
9
|
+
"globals.mjs"
|
|
9
10
|
],
|
|
10
11
|
"type": "module",
|
|
11
12
|
"exports": {
|
|
@@ -22,11 +23,13 @@
|
|
|
22
23
|
},
|
|
23
24
|
"./register/xhr": {
|
|
24
25
|
"default": "./lib/esm/register/xhr.js"
|
|
25
|
-
}
|
|
26
|
+
},
|
|
27
|
+
"./globals": "./globals.mjs"
|
|
26
28
|
},
|
|
27
29
|
"sideEffects": [
|
|
28
30
|
"./lib/esm/register.js",
|
|
29
|
-
"./lib/esm/register/*.js"
|
|
31
|
+
"./lib/esm/register/*.js",
|
|
32
|
+
"./globals.mjs"
|
|
30
33
|
],
|
|
31
34
|
"scripts": {
|
|
32
35
|
"clear": "rm -rf lib tsconfig.tsbuildinfo tsconfig.types.tsbuildinfo test.gjs.mjs test.node.mjs || exit 0",
|
|
@@ -48,8 +51,8 @@
|
|
|
48
51
|
"fetch"
|
|
49
52
|
],
|
|
50
53
|
"devDependencies": {
|
|
51
|
-
"@gjsify/cli": "^0.4.
|
|
52
|
-
"@gjsify/unit": "^0.4.
|
|
54
|
+
"@gjsify/cli": "^0.4.33",
|
|
55
|
+
"@gjsify/unit": "^0.4.33",
|
|
53
56
|
"@types/node": "^25.9.1",
|
|
54
57
|
"typescript": "^6.0.3"
|
|
55
58
|
},
|
|
@@ -58,9 +61,16 @@
|
|
|
58
61
|
"@girs/gjs": "4.0.1",
|
|
59
62
|
"@girs/glib-2.0": "2.88.0-4.0.1",
|
|
60
63
|
"@girs/soup-3.0": "3.6.6-4.0.1",
|
|
61
|
-
"@gjsify/formdata": "^0.4.
|
|
62
|
-
"@gjsify/http": "^0.4.
|
|
63
|
-
"@gjsify/url": "^0.4.
|
|
64
|
-
"@gjsify/utils": "^0.4.
|
|
64
|
+
"@gjsify/formdata": "^0.4.33",
|
|
65
|
+
"@gjsify/http": "^0.4.33",
|
|
66
|
+
"@gjsify/url": "^0.4.33",
|
|
67
|
+
"@gjsify/utils": "^0.4.33"
|
|
68
|
+
},
|
|
69
|
+
"gjsify": {
|
|
70
|
+
"runtimes": {
|
|
71
|
+
"gjs": "polyfill",
|
|
72
|
+
"node": "native",
|
|
73
|
+
"browser": "native"
|
|
74
|
+
}
|
|
65
75
|
}
|
|
66
76
|
}
|