@gjsify/gamepad 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 Gamepad API globals for browser builds.
|
|
3
|
+
*
|
|
4
|
+
* Universal in modern browsers (Chrome 35+, Firefox 29+, Safari 10.1+);
|
|
5
|
+
* the libmanette GJS backend stays GJS-only.
|
|
6
|
+
*
|
|
7
|
+
* The dynamic resolver in `@gjsify/resolve-npm/runtime-aliases.mjs` routes
|
|
8
|
+
* `@gjsify/gamepad` here when `package.json#gjsify.runtimes.browser === "native"`.
|
|
9
|
+
*
|
|
10
|
+
* NOT used on Node — Node has no Gamepad global.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
export const Gamepad = globalThis.Gamepad;
|
|
14
|
+
export const GamepadButton = globalThis.GamepadButton;
|
|
15
|
+
export const GamepadEvent = globalThis.GamepadEvent;
|
|
16
|
+
export const GamepadHapticActuator = globalThis.GamepadHapticActuator;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gjsify/gamepad",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.37",
|
|
4
4
|
"description": "Gamepad Web API for GJS using libmanette as backend",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "lib/esm/index.js",
|
|
@@ -13,13 +13,16 @@
|
|
|
13
13
|
"./register": {
|
|
14
14
|
"types": "./lib/types/register.d.ts",
|
|
15
15
|
"default": "./lib/esm/register.js"
|
|
16
|
-
}
|
|
16
|
+
},
|
|
17
|
+
"./globals": "./globals.mjs"
|
|
17
18
|
},
|
|
18
19
|
"files": [
|
|
19
|
-
"lib"
|
|
20
|
+
"lib",
|
|
21
|
+
"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 test.gjs.mjs || exit 0",
|
|
@@ -29,6 +32,7 @@
|
|
|
29
32
|
"build:types": "tsc",
|
|
30
33
|
"build:test": "gjsify run build:test:gjs",
|
|
31
34
|
"build:test:gjs": "gjsify build src/test.mts --app gjs --outfile test.gjs.mjs",
|
|
35
|
+
"build:test:browser": "gjsify build src/test.browser.mts --app browser --outfile dist/test.browser.mjs",
|
|
32
36
|
"test": "gjsify run build:gjsify && gjsify run build:test && gjsify run test:gjs",
|
|
33
37
|
"test:gjs": "gjsify run test.gjs.mjs"
|
|
34
38
|
},
|
|
@@ -39,22 +43,33 @@
|
|
|
39
43
|
"controller"
|
|
40
44
|
],
|
|
41
45
|
"dependencies": {
|
|
42
|
-
"@gjsify/dom-events": "^0.4.
|
|
46
|
+
"@gjsify/dom-events": "^0.4.37"
|
|
43
47
|
},
|
|
44
48
|
"devDependencies": {
|
|
45
|
-
"@girs/gjs": "4.0.
|
|
46
|
-
"@girs/glib-2.0": "2.88.0-4.0.
|
|
47
|
-
"@girs/manette-0.2": "0.2.13-4.0.
|
|
48
|
-
"@gjsify/cli": "^0.4.
|
|
49
|
-
"@gjsify/unit": "^0.4.
|
|
49
|
+
"@girs/gjs": "4.0.4",
|
|
50
|
+
"@girs/glib-2.0": "2.88.0-4.0.4",
|
|
51
|
+
"@girs/manette-0.2": "0.2.13-4.0.4",
|
|
52
|
+
"@gjsify/cli": "^0.4.37",
|
|
53
|
+
"@gjsify/unit": "^0.4.37",
|
|
50
54
|
"@types/node": "^25.9.1",
|
|
51
|
-
"typescript": "^
|
|
55
|
+
"typescript": "^5.9.3"
|
|
52
56
|
},
|
|
53
57
|
"gjsify": {
|
|
54
58
|
"runtimes": {
|
|
55
59
|
"gjs": "polyfill",
|
|
56
60
|
"node": "partial",
|
|
57
|
-
"browser": "
|
|
61
|
+
"browser": "native",
|
|
62
|
+
"nativescript": "native"
|
|
58
63
|
}
|
|
59
|
-
}
|
|
64
|
+
},
|
|
65
|
+
"license": "MIT",
|
|
66
|
+
"repository": {
|
|
67
|
+
"type": "git",
|
|
68
|
+
"url": "git+https://github.com/gjsify/gjsify.git",
|
|
69
|
+
"directory": "packages/web/gamepad"
|
|
70
|
+
},
|
|
71
|
+
"bugs": {
|
|
72
|
+
"url": "https://github.com/gjsify/gjsify/issues"
|
|
73
|
+
},
|
|
74
|
+
"homepage": "https://github.com/gjsify/gjsify/tree/main/packages/web/gamepad#readme"
|
|
60
75
|
}
|