@gjsify/webstorage 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 +12 -0
- package/package.json +17 -5
package/globals.mjs
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Re-exports native Web Storage globals for use in browser builds.
|
|
3
|
+
* On any modern browser, `Storage` / `localStorage` / `sessionStorage` are
|
|
4
|
+
* native globals.
|
|
5
|
+
*
|
|
6
|
+
* Node has no Storage native (no `localStorage`) — `@gjsify/webstorage`'s
|
|
7
|
+
* `runtimes.node` is "polyfill", so the bundler routes Node-target imports
|
|
8
|
+
* to the package's own polyfill and never reaches this file.
|
|
9
|
+
*/
|
|
10
|
+
export const Storage = globalThis.Storage;
|
|
11
|
+
export const localStorage = globalThis.localStorage;
|
|
12
|
+
export const sessionStorage = globalThis.sessionStorage;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gjsify/webstorage",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.33",
|
|
4
4
|
"description": "W3C Web Storage API (localStorage, sessionStorage) 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",
|
|
@@ -35,9 +40,16 @@
|
|
|
35
40
|
"localstorage"
|
|
36
41
|
],
|
|
37
42
|
"devDependencies": {
|
|
38
|
-
"@gjsify/cli": "^0.4.
|
|
39
|
-
"@gjsify/unit": "^0.4.
|
|
43
|
+
"@gjsify/cli": "^0.4.33",
|
|
44
|
+
"@gjsify/unit": "^0.4.33",
|
|
40
45
|
"@types/node": "^25.9.1",
|
|
41
46
|
"typescript": "^6.0.3"
|
|
47
|
+
},
|
|
48
|
+
"gjsify": {
|
|
49
|
+
"runtimes": {
|
|
50
|
+
"gjs": "polyfill",
|
|
51
|
+
"node": "polyfill",
|
|
52
|
+
"browser": "native"
|
|
53
|
+
}
|
|
42
54
|
}
|
|
43
55
|
}
|