@gjsify/xmlhttprequest 0.4.35 → 0.4.37
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 +16 -0
- package/package.json +28 -13
package/globals.mjs
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Re-exports native XMLHttpRequest globals for browser builds.
|
|
3
|
+
*
|
|
4
|
+
* XHR is universal in every browser (legacy but always-on).
|
|
5
|
+
*
|
|
6
|
+
* The dynamic resolver in `@gjsify/resolve-npm/runtime-aliases.mjs` routes
|
|
7
|
+
* `@gjsify/xmlhttprequest` here when `package.json#gjsify.runtimes.browser === "native"`.
|
|
8
|
+
*
|
|
9
|
+
* NOT used on Node — Node has no XHR global. `URL.createObjectURL` /
|
|
10
|
+
* `revokeObjectURL` are exposed via `@gjsify/url`'s `globals.mjs`.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
export const XMLHttpRequest = globalThis.XMLHttpRequest;
|
|
14
|
+
export const XMLHttpRequestUpload = globalThis.XMLHttpRequestUpload;
|
|
15
|
+
export const XMLHttpRequestEventTarget = globalThis.XMLHttpRequestEventTarget;
|
|
16
|
+
export const FormData = globalThis.FormData;
|
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gjsify/xmlhttprequest",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.37",
|
|
4
4
|
"description": "XMLHttpRequest and URL.createObjectURL/revokeObjectURL for GJS — backed by @gjsify/fetch and GLib",
|
|
5
5
|
"module": "lib/esm/index.js",
|
|
6
6
|
"types": "lib/types/index.d.ts",
|
|
7
7
|
"files": [
|
|
8
|
-
"lib"
|
|
8
|
+
"lib",
|
|
9
|
+
"globals.mjs"
|
|
9
10
|
],
|
|
10
11
|
"type": "module",
|
|
11
12
|
"exports": {
|
|
@@ -16,17 +17,20 @@
|
|
|
16
17
|
"./register": {
|
|
17
18
|
"types": "./lib/types/register.d.ts",
|
|
18
19
|
"default": "./lib/esm/register.js"
|
|
19
|
-
}
|
|
20
|
+
},
|
|
21
|
+
"./globals": "./globals.mjs"
|
|
20
22
|
},
|
|
21
23
|
"sideEffects": [
|
|
22
|
-
"./lib/esm/register.js"
|
|
24
|
+
"./lib/esm/register.js",
|
|
25
|
+
"./globals.mjs"
|
|
23
26
|
],
|
|
24
27
|
"scripts": {
|
|
25
28
|
"clear": "rm -rf lib tsconfig.tsbuildinfo tsconfig.types.tsbuildinfo || exit 0",
|
|
26
29
|
"check": "tsc --noEmit",
|
|
27
30
|
"build": "gjsify run build:gjsify && gjsify run build:types",
|
|
28
31
|
"build:gjsify": "gjsify build --library 'src/**/*.{ts,js}' --exclude 'src/**/*.spec.{mts,ts}' 'src/test.{mts,ts}'",
|
|
29
|
-
"build:types": "tsc"
|
|
32
|
+
"build:types": "tsc",
|
|
33
|
+
"build:test:browser": "gjsify build src/test.browser.mts --app browser --outfile dist/test.browser.mjs"
|
|
30
34
|
},
|
|
31
35
|
"keywords": [
|
|
32
36
|
"gjs",
|
|
@@ -35,21 +39,32 @@
|
|
|
35
39
|
"web-api"
|
|
36
40
|
],
|
|
37
41
|
"dependencies": {
|
|
38
|
-
"@girs/gio-2.0": "2.88.0-4.0.
|
|
39
|
-
"@girs/gjs": "4.0.
|
|
40
|
-
"@girs/glib-2.0": "2.88.0-4.0.
|
|
41
|
-
"@gjsify/fetch": "^0.4.
|
|
42
|
+
"@girs/gio-2.0": "2.88.0-4.0.4",
|
|
43
|
+
"@girs/gjs": "4.0.4",
|
|
44
|
+
"@girs/glib-2.0": "2.88.0-4.0.4",
|
|
45
|
+
"@gjsify/fetch": "^0.4.37"
|
|
42
46
|
},
|
|
43
47
|
"devDependencies": {
|
|
44
|
-
"@gjsify/cli": "^0.4.
|
|
48
|
+
"@gjsify/cli": "^0.4.37",
|
|
45
49
|
"@types/node": "^25.9.1",
|
|
46
|
-
"typescript": "^
|
|
50
|
+
"typescript": "^5.9.3"
|
|
47
51
|
},
|
|
48
52
|
"gjsify": {
|
|
49
53
|
"runtimes": {
|
|
50
54
|
"gjs": "polyfill",
|
|
51
55
|
"node": "none",
|
|
52
|
-
"browser": "
|
|
56
|
+
"browser": "native",
|
|
57
|
+
"nativescript": "none"
|
|
53
58
|
}
|
|
54
|
-
}
|
|
59
|
+
},
|
|
60
|
+
"license": "MIT",
|
|
61
|
+
"repository": {
|
|
62
|
+
"type": "git",
|
|
63
|
+
"url": "git+https://github.com/gjsify/gjsify.git",
|
|
64
|
+
"directory": "packages/web/xmlhttprequest"
|
|
65
|
+
},
|
|
66
|
+
"bugs": {
|
|
67
|
+
"url": "https://github.com/gjsify/gjsify/issues"
|
|
68
|
+
},
|
|
69
|
+
"homepage": "https://github.com/gjsify/gjsify/tree/main/packages/web/xmlhttprequest#readme"
|
|
55
70
|
}
|