@ailuracode/alpine-platform 1.1.0
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/LICENSE +21 -0
- package/README.md +69 -0
- package/dist/global.d.ts +28 -0
- package/dist/index.d.ts +39 -0
- package/dist/index.js +121 -0
- package/dist/index.js.map +1 -0
- package/package.json +61 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) ailuracode
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# @ailuracode/alpine-platform
|
|
2
|
+
|
|
3
|
+
Alpine.js magic for detecting the client's operating system and platform.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @ailuracode/alpine-platform alpinejs
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Setup
|
|
12
|
+
|
|
13
|
+
```js
|
|
14
|
+
import Alpine from "alpinejs";
|
|
15
|
+
import platform from "@ailuracode/alpine-platform";
|
|
16
|
+
|
|
17
|
+
Alpine.plugin(platform);
|
|
18
|
+
Alpine.start();
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Magic API
|
|
22
|
+
|
|
23
|
+
| Property | Type | Description |
|
|
24
|
+
|----------|------|-------------|
|
|
25
|
+
| `name` | `"macos" \| "windows" \| "linux" \| "ios" \| "android" \| "chromeos" \| "unknown"` | Resolved platform |
|
|
26
|
+
| `isMac` | `boolean` | Desktop macOS |
|
|
27
|
+
| `isWindows` | `boolean` | Windows |
|
|
28
|
+
| `isLinux` | `boolean` | Desktop Linux |
|
|
29
|
+
| `isIos` | `boolean` | iOS / iPadOS |
|
|
30
|
+
| `isAndroid` | `boolean` | Android |
|
|
31
|
+
| `isChromeos` | `boolean` | ChromeOS |
|
|
32
|
+
|
|
33
|
+
## HTML examples
|
|
34
|
+
|
|
35
|
+
```html
|
|
36
|
+
<p x-show="$platform.isMac">Use ⌘ shortcuts</p>
|
|
37
|
+
<p x-show="$platform.isWindows">Use Ctrl shortcuts</p>
|
|
38
|
+
<p x-show="$platform.isIos">Open from the Home Screen for full support</p>
|
|
39
|
+
|
|
40
|
+
<p>Platform: <span x-text="$platform.name"></span></p>
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Exported helpers
|
|
44
|
+
|
|
45
|
+
Pure detection functions are exported for use in other packages or tests:
|
|
46
|
+
|
|
47
|
+
```js
|
|
48
|
+
import {
|
|
49
|
+
detectPlatformName,
|
|
50
|
+
isAndroidDevice,
|
|
51
|
+
isIosDevice,
|
|
52
|
+
isLinuxDevice,
|
|
53
|
+
isMacDevice,
|
|
54
|
+
isWindowsDevice,
|
|
55
|
+
readPlatformState,
|
|
56
|
+
} from "@ailuracode/alpine-platform";
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Detection uses `navigator.userAgentData.platform` when available, then falls back to `navigator.userAgent` and `navigator.platform`. iPadOS desktop mode is detected via `MacIntel` + `maxTouchPoints > 1`.
|
|
60
|
+
|
|
61
|
+
## Notes
|
|
62
|
+
|
|
63
|
+
- Read-only magic — no store
|
|
64
|
+
- CSS-framework agnostic
|
|
65
|
+
- For viewport breakpoints use `@ailuracode/alpine-screen`; for touch hardware use `@ailuracode/alpine-touch`
|
|
66
|
+
|
|
67
|
+
## License
|
|
68
|
+
|
|
69
|
+
MIT
|
package/dist/global.d.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/// <reference types="@types/alpinejs" />
|
|
2
|
+
|
|
3
|
+
export type PlatformName =
|
|
4
|
+
| "macos"
|
|
5
|
+
| "windows"
|
|
6
|
+
| "linux"
|
|
7
|
+
| "ios"
|
|
8
|
+
| "android"
|
|
9
|
+
| "chromeos"
|
|
10
|
+
| "unknown";
|
|
11
|
+
|
|
12
|
+
export interface PlatformMagic {
|
|
13
|
+
name: PlatformName;
|
|
14
|
+
isMac: boolean;
|
|
15
|
+
isWindows: boolean;
|
|
16
|
+
isLinux: boolean;
|
|
17
|
+
isIos: boolean;
|
|
18
|
+
isAndroid: boolean;
|
|
19
|
+
isChromeos: boolean;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
declare global {
|
|
23
|
+
namespace Alpine {
|
|
24
|
+
interface Magics<T> {
|
|
25
|
+
$platform: PlatformMagic;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import AlpineType from 'alpinejs';
|
|
2
|
+
|
|
3
|
+
type PlatformName = "macos" | "windows" | "linux" | "ios" | "android" | "chromeos" | "unknown";
|
|
4
|
+
interface PlatformMagic {
|
|
5
|
+
name: PlatformName;
|
|
6
|
+
isMac: boolean;
|
|
7
|
+
isWindows: boolean;
|
|
8
|
+
isLinux: boolean;
|
|
9
|
+
isIos: boolean;
|
|
10
|
+
isAndroid: boolean;
|
|
11
|
+
isChromeos: boolean;
|
|
12
|
+
}
|
|
13
|
+
/** Detects iOS/iPadOS (including iPadOS desktop UA). */
|
|
14
|
+
declare function isIosDevice(): boolean;
|
|
15
|
+
/** Detects Android phones and tablets. */
|
|
16
|
+
declare function isAndroidDevice(): boolean;
|
|
17
|
+
/** Detects ChromeOS devices. */
|
|
18
|
+
declare function isChromeOsDevice(): boolean;
|
|
19
|
+
/** Detects desktop Windows. */
|
|
20
|
+
declare function isWindowsDevice(): boolean;
|
|
21
|
+
/** Detects desktop macOS (excludes iOS/iPadOS). */
|
|
22
|
+
declare function isMacDevice(): boolean;
|
|
23
|
+
/** Detects desktop Linux (excludes Android and ChromeOS). */
|
|
24
|
+
declare function isLinuxDevice(): boolean;
|
|
25
|
+
/** Resolves the primary platform name for the current environment. */
|
|
26
|
+
declare function detectPlatformName(): PlatformName;
|
|
27
|
+
/** Reads the current platform state from the environment. */
|
|
28
|
+
declare function readPlatformState(): PlatformMagic;
|
|
29
|
+
/** Alpine.js platform plugin. Registers reactive magic `$platform`. */
|
|
30
|
+
declare function platformPlugin(Alpine: AlpineType.Alpine): void;
|
|
31
|
+
declare global {
|
|
32
|
+
namespace Alpine {
|
|
33
|
+
interface Magics<T> {
|
|
34
|
+
$platform: PlatformMagic;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export { type PlatformMagic, type PlatformName, platformPlugin as default, detectPlatformName, isAndroidDevice, isChromeOsDevice, isIosDevice, isLinuxDevice, isMacDevice, isWindowsDevice, readPlatformState };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
// src/index.ts
|
|
2
|
+
function getNavigator() {
|
|
3
|
+
return typeof navigator !== "undefined" ? navigator : void 0;
|
|
4
|
+
}
|
|
5
|
+
function getClientHintPlatform() {
|
|
6
|
+
const nav = getNavigator();
|
|
7
|
+
return nav?.userAgentData?.platform?.toLowerCase();
|
|
8
|
+
}
|
|
9
|
+
function isIosDevice() {
|
|
10
|
+
const nav = getNavigator();
|
|
11
|
+
if (!nav) {
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
14
|
+
const ua = nav.userAgent;
|
|
15
|
+
if (/iPad|iPhone|iPod/i.test(ua)) {
|
|
16
|
+
return true;
|
|
17
|
+
}
|
|
18
|
+
return nav.platform === "MacIntel" && nav.maxTouchPoints > 1;
|
|
19
|
+
}
|
|
20
|
+
function isAndroidDevice() {
|
|
21
|
+
const nav = getNavigator();
|
|
22
|
+
if (!nav) {
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
return /Android/i.test(nav.userAgent);
|
|
26
|
+
}
|
|
27
|
+
function isChromeOsDevice() {
|
|
28
|
+
const nav = getNavigator();
|
|
29
|
+
if (!nav) {
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
return /CrOS/i.test(nav.userAgent);
|
|
33
|
+
}
|
|
34
|
+
function isWindowsDevice() {
|
|
35
|
+
const nav = getNavigator();
|
|
36
|
+
if (!nav) {
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
const hint = getClientHintPlatform();
|
|
40
|
+
if (hint === "windows") {
|
|
41
|
+
return true;
|
|
42
|
+
}
|
|
43
|
+
return /Win/i.test(nav.platform) || /Windows/i.test(nav.userAgent);
|
|
44
|
+
}
|
|
45
|
+
function isMacDevice() {
|
|
46
|
+
if (isIosDevice()) {
|
|
47
|
+
return false;
|
|
48
|
+
}
|
|
49
|
+
const nav = getNavigator();
|
|
50
|
+
if (!nav) {
|
|
51
|
+
return false;
|
|
52
|
+
}
|
|
53
|
+
const hint = getClientHintPlatform();
|
|
54
|
+
if (hint === "macos") {
|
|
55
|
+
return true;
|
|
56
|
+
}
|
|
57
|
+
return /Mac/i.test(nav.platform) || /Macintosh/i.test(nav.userAgent);
|
|
58
|
+
}
|
|
59
|
+
function isLinuxDevice() {
|
|
60
|
+
if (isAndroidDevice() || isChromeOsDevice()) {
|
|
61
|
+
return false;
|
|
62
|
+
}
|
|
63
|
+
const nav = getNavigator();
|
|
64
|
+
if (!nav) {
|
|
65
|
+
return false;
|
|
66
|
+
}
|
|
67
|
+
const hint = getClientHintPlatform();
|
|
68
|
+
if (hint === "linux") {
|
|
69
|
+
return true;
|
|
70
|
+
}
|
|
71
|
+
return /Linux/i.test(nav.platform) || /X11/i.test(nav.userAgent);
|
|
72
|
+
}
|
|
73
|
+
function detectPlatformName() {
|
|
74
|
+
if (isIosDevice()) {
|
|
75
|
+
return "ios";
|
|
76
|
+
}
|
|
77
|
+
if (isAndroidDevice()) {
|
|
78
|
+
return "android";
|
|
79
|
+
}
|
|
80
|
+
if (isChromeOsDevice()) {
|
|
81
|
+
return "chromeos";
|
|
82
|
+
}
|
|
83
|
+
if (isWindowsDevice()) {
|
|
84
|
+
return "windows";
|
|
85
|
+
}
|
|
86
|
+
if (isMacDevice()) {
|
|
87
|
+
return "macos";
|
|
88
|
+
}
|
|
89
|
+
if (isLinuxDevice()) {
|
|
90
|
+
return "linux";
|
|
91
|
+
}
|
|
92
|
+
return "unknown";
|
|
93
|
+
}
|
|
94
|
+
function readPlatformState() {
|
|
95
|
+
const name = detectPlatformName();
|
|
96
|
+
return {
|
|
97
|
+
name,
|
|
98
|
+
isMac: name === "macos",
|
|
99
|
+
isWindows: name === "windows",
|
|
100
|
+
isLinux: name === "linux",
|
|
101
|
+
isIos: name === "ios",
|
|
102
|
+
isAndroid: name === "android",
|
|
103
|
+
isChromeos: name === "chromeos"
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
function platformPlugin(Alpine) {
|
|
107
|
+
const state = Alpine.reactive(readPlatformState());
|
|
108
|
+
Alpine.magic("platform", () => state);
|
|
109
|
+
}
|
|
110
|
+
export {
|
|
111
|
+
platformPlugin as default,
|
|
112
|
+
detectPlatformName,
|
|
113
|
+
isAndroidDevice,
|
|
114
|
+
isChromeOsDevice,
|
|
115
|
+
isIosDevice,
|
|
116
|
+
isLinuxDevice,
|
|
117
|
+
isMacDevice,
|
|
118
|
+
isWindowsDevice,
|
|
119
|
+
readPlatformState
|
|
120
|
+
};
|
|
121
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import type AlpineType from \"alpinejs\";\n\nexport type PlatformName =\n | \"macos\"\n | \"windows\"\n | \"linux\"\n | \"ios\"\n | \"android\"\n | \"chromeos\"\n | \"unknown\";\n\nexport interface PlatformMagic {\n name: PlatformName;\n isMac: boolean;\n isWindows: boolean;\n isLinux: boolean;\n isIos: boolean;\n isAndroid: boolean;\n isChromeos: boolean;\n}\n\ntype NavigatorWithUserAgentData = Navigator & {\n userAgentData?: {\n platform?: string;\n };\n};\n\nfunction getNavigator(): Navigator | undefined {\n return typeof navigator !== \"undefined\" ? navigator : undefined;\n}\n\nfunction getClientHintPlatform(): string | undefined {\n const nav = getNavigator() as NavigatorWithUserAgentData | undefined;\n return nav?.userAgentData?.platform?.toLowerCase();\n}\n\n/** Detects iOS/iPadOS (including iPadOS desktop UA). */\nexport function isIosDevice(): boolean {\n const nav = getNavigator();\n if (!nav) {\n return false;\n }\n\n const ua = nav.userAgent;\n if (/iPad|iPhone|iPod/i.test(ua)) {\n return true;\n }\n\n return nav.platform === \"MacIntel\" && nav.maxTouchPoints > 1;\n}\n\n/** Detects Android phones and tablets. */\nexport function isAndroidDevice(): boolean {\n const nav = getNavigator();\n if (!nav) {\n return false;\n }\n\n return /Android/i.test(nav.userAgent);\n}\n\n/** Detects ChromeOS devices. */\nexport function isChromeOsDevice(): boolean {\n const nav = getNavigator();\n if (!nav) {\n return false;\n }\n\n return /CrOS/i.test(nav.userAgent);\n}\n\n/** Detects desktop Windows. */\nexport function isWindowsDevice(): boolean {\n const nav = getNavigator();\n if (!nav) {\n return false;\n }\n\n const hint = getClientHintPlatform();\n if (hint === \"windows\") {\n return true;\n }\n\n return /Win/i.test(nav.platform) || /Windows/i.test(nav.userAgent);\n}\n\n/** Detects desktop macOS (excludes iOS/iPadOS). */\nexport function isMacDevice(): boolean {\n if (isIosDevice()) {\n return false;\n }\n\n const nav = getNavigator();\n if (!nav) {\n return false;\n }\n\n const hint = getClientHintPlatform();\n if (hint === \"macos\") {\n return true;\n }\n\n return /Mac/i.test(nav.platform) || /Macintosh/i.test(nav.userAgent);\n}\n\n/** Detects desktop Linux (excludes Android and ChromeOS). */\nexport function isLinuxDevice(): boolean {\n if (isAndroidDevice() || isChromeOsDevice()) {\n return false;\n }\n\n const nav = getNavigator();\n if (!nav) {\n return false;\n }\n\n const hint = getClientHintPlatform();\n if (hint === \"linux\") {\n return true;\n }\n\n return /Linux/i.test(nav.platform) || /X11/i.test(nav.userAgent);\n}\n\n/** Resolves the primary platform name for the current environment. */\nexport function detectPlatformName(): PlatformName {\n if (isIosDevice()) {\n return \"ios\";\n }\n if (isAndroidDevice()) {\n return \"android\";\n }\n if (isChromeOsDevice()) {\n return \"chromeos\";\n }\n if (isWindowsDevice()) {\n return \"windows\";\n }\n if (isMacDevice()) {\n return \"macos\";\n }\n if (isLinuxDevice()) {\n return \"linux\";\n }\n\n return \"unknown\";\n}\n\n/** Reads the current platform state from the environment. */\nexport function readPlatformState(): PlatformMagic {\n const name = detectPlatformName();\n\n return {\n name,\n isMac: name === \"macos\",\n isWindows: name === \"windows\",\n isLinux: name === \"linux\",\n isIos: name === \"ios\",\n isAndroid: name === \"android\",\n isChromeos: name === \"chromeos\",\n };\n}\n\n/** Alpine.js platform plugin. Registers reactive magic `$platform`. */\nexport default function platformPlugin(Alpine: AlpineType.Alpine): void {\n const state = Alpine.reactive(readPlatformState());\n\n Alpine.magic(\"platform\", () => state);\n}\n\ndeclare global {\n namespace Alpine {\n interface Magics<T> {\n $platform: PlatformMagic;\n }\n }\n}\n"],"mappings":";AA2BA,SAAS,eAAsC;AAC7C,SAAO,OAAO,cAAc,cAAc,YAAY;AACxD;AAEA,SAAS,wBAA4C;AACnD,QAAM,MAAM,aAAa;AACzB,SAAO,KAAK,eAAe,UAAU,YAAY;AACnD;AAGO,SAAS,cAAuB;AACrC,QAAM,MAAM,aAAa;AACzB,MAAI,CAAC,KAAK;AACR,WAAO;AAAA,EACT;AAEA,QAAM,KAAK,IAAI;AACf,MAAI,oBAAoB,KAAK,EAAE,GAAG;AAChC,WAAO;AAAA,EACT;AAEA,SAAO,IAAI,aAAa,cAAc,IAAI,iBAAiB;AAC7D;AAGO,SAAS,kBAA2B;AACzC,QAAM,MAAM,aAAa;AACzB,MAAI,CAAC,KAAK;AACR,WAAO;AAAA,EACT;AAEA,SAAO,WAAW,KAAK,IAAI,SAAS;AACtC;AAGO,SAAS,mBAA4B;AAC1C,QAAM,MAAM,aAAa;AACzB,MAAI,CAAC,KAAK;AACR,WAAO;AAAA,EACT;AAEA,SAAO,QAAQ,KAAK,IAAI,SAAS;AACnC;AAGO,SAAS,kBAA2B;AACzC,QAAM,MAAM,aAAa;AACzB,MAAI,CAAC,KAAK;AACR,WAAO;AAAA,EACT;AAEA,QAAM,OAAO,sBAAsB;AACnC,MAAI,SAAS,WAAW;AACtB,WAAO;AAAA,EACT;AAEA,SAAO,OAAO,KAAK,IAAI,QAAQ,KAAK,WAAW,KAAK,IAAI,SAAS;AACnE;AAGO,SAAS,cAAuB;AACrC,MAAI,YAAY,GAAG;AACjB,WAAO;AAAA,EACT;AAEA,QAAM,MAAM,aAAa;AACzB,MAAI,CAAC,KAAK;AACR,WAAO;AAAA,EACT;AAEA,QAAM,OAAO,sBAAsB;AACnC,MAAI,SAAS,SAAS;AACpB,WAAO;AAAA,EACT;AAEA,SAAO,OAAO,KAAK,IAAI,QAAQ,KAAK,aAAa,KAAK,IAAI,SAAS;AACrE;AAGO,SAAS,gBAAyB;AACvC,MAAI,gBAAgB,KAAK,iBAAiB,GAAG;AAC3C,WAAO;AAAA,EACT;AAEA,QAAM,MAAM,aAAa;AACzB,MAAI,CAAC,KAAK;AACR,WAAO;AAAA,EACT;AAEA,QAAM,OAAO,sBAAsB;AACnC,MAAI,SAAS,SAAS;AACpB,WAAO;AAAA,EACT;AAEA,SAAO,SAAS,KAAK,IAAI,QAAQ,KAAK,OAAO,KAAK,IAAI,SAAS;AACjE;AAGO,SAAS,qBAAmC;AACjD,MAAI,YAAY,GAAG;AACjB,WAAO;AAAA,EACT;AACA,MAAI,gBAAgB,GAAG;AACrB,WAAO;AAAA,EACT;AACA,MAAI,iBAAiB,GAAG;AACtB,WAAO;AAAA,EACT;AACA,MAAI,gBAAgB,GAAG;AACrB,WAAO;AAAA,EACT;AACA,MAAI,YAAY,GAAG;AACjB,WAAO;AAAA,EACT;AACA,MAAI,cAAc,GAAG;AACnB,WAAO;AAAA,EACT;AAEA,SAAO;AACT;AAGO,SAAS,oBAAmC;AACjD,QAAM,OAAO,mBAAmB;AAEhC,SAAO;AAAA,IACL;AAAA,IACA,OAAO,SAAS;AAAA,IAChB,WAAW,SAAS;AAAA,IACpB,SAAS,SAAS;AAAA,IAClB,OAAO,SAAS;AAAA,IAChB,WAAW,SAAS;AAAA,IACpB,YAAY,SAAS;AAAA,EACvB;AACF;AAGe,SAAR,eAAgC,QAAiC;AACtE,QAAM,QAAQ,OAAO,SAAS,kBAAkB,CAAC;AAEjD,SAAO,MAAM,YAAY,MAAM,KAAK;AACtC;","names":[]}
|
package/package.json
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@ailuracode/alpine-platform",
|
|
3
|
+
"version": "1.1.0",
|
|
4
|
+
"description": "Alpine.js client platform and operating system detection magic",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"author": "ailuracode",
|
|
8
|
+
"publishConfig": {
|
|
9
|
+
"access": "public"
|
|
10
|
+
},
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "git+https://github.com/ailuracode/alpine.git",
|
|
14
|
+
"directory": "packages/platform"
|
|
15
|
+
},
|
|
16
|
+
"bugs": {
|
|
17
|
+
"url": "https://github.com/ailuracode/alpine/issues"
|
|
18
|
+
},
|
|
19
|
+
"homepage": "https://github.com/ailuracode/alpine/tree/master/packages/platform#readme",
|
|
20
|
+
"files": [
|
|
21
|
+
"dist",
|
|
22
|
+
"README.md"
|
|
23
|
+
],
|
|
24
|
+
"exports": {
|
|
25
|
+
".": {
|
|
26
|
+
"types": "./dist/index.d.ts",
|
|
27
|
+
"default": "./dist/index.js"
|
|
28
|
+
},
|
|
29
|
+
"./global": {
|
|
30
|
+
"types": "./dist/global.d.ts"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"types": "./dist/global.d.ts",
|
|
34
|
+
"peerDependencies": {
|
|
35
|
+
"alpinejs": "^3.0.0",
|
|
36
|
+
"@types/alpinejs": "^3.13.11"
|
|
37
|
+
},
|
|
38
|
+
"peerDependenciesMeta": {
|
|
39
|
+
"@types/alpinejs": {
|
|
40
|
+
"optional": true
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"keywords": [
|
|
44
|
+
"alpinejs",
|
|
45
|
+
"alpine",
|
|
46
|
+
"plugin",
|
|
47
|
+
"platform",
|
|
48
|
+
"os",
|
|
49
|
+
"operating-system",
|
|
50
|
+
"user-agent",
|
|
51
|
+
"macos",
|
|
52
|
+
"windows",
|
|
53
|
+
"linux",
|
|
54
|
+
"ios",
|
|
55
|
+
"android"
|
|
56
|
+
],
|
|
57
|
+
"scripts": {
|
|
58
|
+
"build": "tsup src/index.ts --format esm --dts --clean --sourcemap --out-dir dist && cp src/global.d.ts dist/global.d.ts",
|
|
59
|
+
"test": "vitest run --config ../../vitest.config.js test"
|
|
60
|
+
}
|
|
61
|
+
}
|