@gjsify/url 0.4.35 → 0.4.36

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.
Files changed (2) hide show
  1. package/globals.mjs +15 -0
  2. package/package.json +25 -10
package/globals.mjs ADDED
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Re-exports native `URL` and `URLSearchParams` globals for Node.js / browser builds.
3
+ *
4
+ * On Node, `URL` and `URLSearchParams` have been stable globals since v10.0 (2018).
5
+ * On browsers they have been native for over a decade (WHATWG URL standard).
6
+ *
7
+ * The dynamic resolver in `@gjsify/resolve-npm/runtime-aliases.mjs` routes
8
+ * `@gjsify/url` here when `package.json#gjsify.runtimes` declares the
9
+ * non-GJS slot as `"native"`. On GJS, consumers fall through to the polyfill
10
+ * at `lib/esm/index.js` (which wraps `GLib.Uri`).
11
+ */
12
+
13
+ export const URL = globalThis.URL;
14
+ export const URLSearchParams = globalThis.URLSearchParams;
15
+ export default { URL, URLSearchParams };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gjsify/url",
3
- "version": "0.4.35",
3
+ "version": "0.4.36",
4
4
  "description": "Node.js url module for Gjs",
5
5
  "type": "module",
6
6
  "module": "lib/esm/index.js",
@@ -9,10 +9,15 @@
9
9
  ".": {
10
10
  "types": "./lib/types/index.d.ts",
11
11
  "default": "./lib/esm/index.js"
12
- }
12
+ },
13
+ "./globals": "./globals.mjs"
13
14
  },
14
15
  "files": [
15
- "lib"
16
+ "lib",
17
+ "globals.mjs"
18
+ ],
19
+ "sideEffects": [
20
+ "./globals.mjs"
16
21
  ],
17
22
  "scripts": {
18
23
  "clear": "rm -rf lib tsconfig.tsbuildinfo tsconfig.types.tsbuildinfo test.gjs.mjs test.node.mjs || exit 0",
@@ -33,19 +38,29 @@
33
38
  "fs"
34
39
  ],
35
40
  "dependencies": {
36
- "@girs/glib-2.0": "2.88.0-4.0.1"
41
+ "@girs/glib-2.0": "2.88.0-4.0.4"
37
42
  },
38
43
  "devDependencies": {
39
- "@gjsify/cli": "^0.4.35",
40
- "@gjsify/unit": "^0.4.35",
44
+ "@gjsify/cli": "^0.4.36",
45
+ "@gjsify/unit": "^0.4.36",
41
46
  "@types/node": "^25.9.1",
42
- "typescript": "^6.0.3"
47
+ "typescript": "^5.9.3"
43
48
  },
44
49
  "gjsify": {
45
50
  "runtimes": {
46
51
  "gjs": "polyfill",
47
- "node": "none",
48
- "browser": "none"
52
+ "node": "native",
53
+ "browser": "native"
49
54
  }
50
- }
55
+ },
56
+ "license": "MIT",
57
+ "repository": {
58
+ "type": "git",
59
+ "url": "git+https://github.com/gjsify/gjsify.git",
60
+ "directory": "packages/node/url"
61
+ },
62
+ "bugs": {
63
+ "url": "https://github.com/gjsify/gjsify/issues"
64
+ },
65
+ "homepage": "https://github.com/gjsify/gjsify/tree/main/packages/node/url#readme"
51
66
  }