@proj-airi/cap-vite 0.9.0-alpha.4
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 +43 -0
- package/dist/bin/run.d.mts +1 -0
- package/dist/bin/run.mjs +23 -0
- package/dist/bin/run.mjs.map +1 -0
- package/dist/index.d.mts +10 -0
- package/dist/index.mjs +160 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +44 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024-PRESENT Neko Ayaka
|
|
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,43 @@
|
|
|
1
|
+
# @proj-airi/cap-vite
|
|
2
|
+
|
|
3
|
+
CLI for [Capacitor](https://capacitorjs.com/) live-reload development using Vite.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pnpm cap-vite ios <DEVICE_ID_OR_SIMULATOR_NAME>
|
|
9
|
+
pnpm cap-vite android <DEVICE_ID_OR_SIMULATOR_NAME>
|
|
10
|
+
# Or
|
|
11
|
+
CAPACITOR_DEVICE_ID=<DEVICE_ID_OR_SIMULATOR_NAME> pnpm cap-vite ios
|
|
12
|
+
CAPACITOR_DEVICE_ID=<DEVICE_ID_OR_SIMULATOR_NAME> pnpm cap-vite android
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
You can see the list of available devices and simulators by running `pnpm exec cap run ios --list` or `pnpm exec cap run android --list`.
|
|
16
|
+
|
|
17
|
+
## Capacitor Configuration
|
|
18
|
+
|
|
19
|
+
You need to set `server.url` in `capacitor.config.ts` to the env variable `CAPACITOR_DEV_SERVER_URL`.
|
|
20
|
+
|
|
21
|
+
```ts
|
|
22
|
+
const serverURL = env.CAPACITOR_DEV_SERVER_URL
|
|
23
|
+
|
|
24
|
+
const config: CapacitorConfig = {
|
|
25
|
+
appId: 'com.example.app',
|
|
26
|
+
appName: 'Example App',
|
|
27
|
+
webDir: 'dist',
|
|
28
|
+
server: serverURL
|
|
29
|
+
? {
|
|
30
|
+
url: serverURL,
|
|
31
|
+
cleartext: false,
|
|
32
|
+
}
|
|
33
|
+
: undefined,
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export default config
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## What It Does
|
|
40
|
+
|
|
41
|
+
- Starts the project's own Vite config through the Vite API.
|
|
42
|
+
- Executes the local `cap` binary via `tinyexec`.
|
|
43
|
+
- Watches native files under `ios/` or `android/` and re-runs `cap run` after a small debounce.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
package/dist/bin/run.mjs
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { runCapVite } from "../index.mjs";
|
|
3
|
+
import process from "node:process";
|
|
4
|
+
|
|
5
|
+
//#region src/bin/run.ts
|
|
6
|
+
async function main() {
|
|
7
|
+
const platform = process.argv[2];
|
|
8
|
+
const deviceId = process.env.CAPACITOR_DEVICE_ID || process.argv[3];
|
|
9
|
+
if (!deviceId) throw new Error("Usage: cap-vite <ios|android> <DEVICE_ID_OR_SIMULATOR_NAME>");
|
|
10
|
+
if (platform !== "android" && platform !== "ios") {
|
|
11
|
+
process.stderr.write("Usage: cap-vite <ios|android> <DEVICE_ID_OR_SIMULATOR_NAME>\n");
|
|
12
|
+
process.exit(1);
|
|
13
|
+
}
|
|
14
|
+
await runCapVite(platform, deviceId);
|
|
15
|
+
}
|
|
16
|
+
main().catch((error) => {
|
|
17
|
+
process.stderr.write(`${error instanceof Error ? error.message : String(error)}\n`);
|
|
18
|
+
process.exit(1);
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
//#endregion
|
|
22
|
+
export { };
|
|
23
|
+
//# sourceMappingURL=run.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run.mjs","names":[],"sources":["../../src/bin/run.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport process from 'node:process'\n\nimport { runCapVite } from '..'\n\nasync function main() {\n const platform = process.argv[2]\n const deviceId = process.env.CAPACITOR_DEVICE_ID || process.argv[3]\n if (!deviceId) {\n throw new Error('Usage: cap-vite <ios|android> <DEVICE_ID_OR_SIMULATOR_NAME>')\n }\n\n if (platform !== 'android' && platform !== 'ios') {\n process.stderr.write('Usage: cap-vite <ios|android> <DEVICE_ID_OR_SIMULATOR_NAME>\\n')\n process.exit(1)\n }\n\n await runCapVite(platform, deviceId)\n}\n\nvoid main().catch((error) => {\n process.stderr.write(`${error instanceof Error ? error.message : String(error)}\\n`)\n process.exit(1)\n})\n"],"mappings":";;;;;AAMA,eAAe,OAAO;CACpB,MAAM,WAAW,QAAQ,KAAK;CAC9B,MAAM,WAAW,QAAQ,IAAI,uBAAuB,QAAQ,KAAK;AACjE,KAAI,CAAC,SACH,OAAM,IAAI,MAAM,8DAA8D;AAGhF,KAAI,aAAa,aAAa,aAAa,OAAO;AAChD,UAAQ,OAAO,MAAM,gEAAgE;AACrF,UAAQ,KAAK,EAAE;;AAGjB,OAAM,WAAW,UAAU,SAAS;;AAGjC,MAAM,CAAC,OAAO,UAAU;AAC3B,SAAQ,OAAO,MAAM,GAAG,iBAAiB,QAAQ,MAAM,UAAU,OAAO,MAAM,CAAC,IAAI;AACnF,SAAQ,KAAK,EAAE;EACf"}
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
//#region src/index.d.ts
|
|
2
|
+
type CapacitorPlatform = 'android' | 'ios';
|
|
3
|
+
interface RunCapViteOptions {
|
|
4
|
+
cwd?: string;
|
|
5
|
+
debounceMs?: number;
|
|
6
|
+
}
|
|
7
|
+
declare function runCapVite(platform: CapacitorPlatform, deviceId: string, options?: RunCapViteOptions): Promise<void>;
|
|
8
|
+
//#endregion
|
|
9
|
+
export { CapacitorPlatform, RunCapViteOptions, runCapVite };
|
|
10
|
+
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import process from "node:process";
|
|
2
|
+
import { basename, extname, relative, resolve, sep } from "node:path";
|
|
3
|
+
import { x } from "tinyexec";
|
|
4
|
+
import { createServer } from "vite";
|
|
5
|
+
|
|
6
|
+
//#region src/index.ts
|
|
7
|
+
const nativeExtensionsByPlatform = {
|
|
8
|
+
ios: new Set([
|
|
9
|
+
".entitlements",
|
|
10
|
+
".h",
|
|
11
|
+
".hpp",
|
|
12
|
+
".m",
|
|
13
|
+
".mm",
|
|
14
|
+
".pbxproj",
|
|
15
|
+
".plist",
|
|
16
|
+
".storyboard",
|
|
17
|
+
".strings",
|
|
18
|
+
".swift",
|
|
19
|
+
".xcodeproj",
|
|
20
|
+
".xcconfig",
|
|
21
|
+
".xcscheme",
|
|
22
|
+
".xib"
|
|
23
|
+
]),
|
|
24
|
+
android: new Set([
|
|
25
|
+
".gradle",
|
|
26
|
+
".java",
|
|
27
|
+
".json",
|
|
28
|
+
".kts",
|
|
29
|
+
".kt",
|
|
30
|
+
".properties",
|
|
31
|
+
".xml"
|
|
32
|
+
])
|
|
33
|
+
};
|
|
34
|
+
const nativeNamesByPlatform = {
|
|
35
|
+
ios: new Set([
|
|
36
|
+
"Podfile",
|
|
37
|
+
"Podfile.lock",
|
|
38
|
+
"project.pbxproj"
|
|
39
|
+
]),
|
|
40
|
+
android: new Set([
|
|
41
|
+
"AndroidManifest.xml",
|
|
42
|
+
"build.gradle",
|
|
43
|
+
"build.gradle.kts",
|
|
44
|
+
"gradle.properties",
|
|
45
|
+
"settings.gradle",
|
|
46
|
+
"settings.gradle.kts"
|
|
47
|
+
])
|
|
48
|
+
};
|
|
49
|
+
const ignoredNames = new Set(["capacitor.config.json"]);
|
|
50
|
+
const ignoredPathSegments = new Set([
|
|
51
|
+
".gradle",
|
|
52
|
+
"DerivedData",
|
|
53
|
+
"Pods",
|
|
54
|
+
"build",
|
|
55
|
+
"xcuserdata"
|
|
56
|
+
]);
|
|
57
|
+
const ignoredPathPrefixesByPlatform = {
|
|
58
|
+
ios: [["App", "CapApp-SPM"]],
|
|
59
|
+
android: []
|
|
60
|
+
};
|
|
61
|
+
function pickServerUrl(server) {
|
|
62
|
+
const url = server.resolvedUrls?.network?.[0] ?? server.resolvedUrls?.local?.[0];
|
|
63
|
+
if (!url) throw new Error("Vite did not expose a reachable dev server URL.");
|
|
64
|
+
return new URL(url);
|
|
65
|
+
}
|
|
66
|
+
function shouldRestartForNativeChange(file, platform, cwd) {
|
|
67
|
+
const absoluteFile = resolve(cwd, file);
|
|
68
|
+
const platformRoot = resolve(cwd, platform);
|
|
69
|
+
if (!absoluteFile.startsWith(`${platformRoot}${sep}`) && absoluteFile !== platformRoot) return false;
|
|
70
|
+
const fileName = basename(absoluteFile);
|
|
71
|
+
if (ignoredNames.has(fileName)) return false;
|
|
72
|
+
if (absoluteFile.split(sep).some((segment) => ignoredPathSegments.has(segment))) return false;
|
|
73
|
+
const relativeSegments = relative(platformRoot, absoluteFile).split(sep).filter(Boolean);
|
|
74
|
+
if (ignoredPathPrefixesByPlatform[platform].some((prefix) => prefix.every((segment, index) => relativeSegments[index] === segment))) return false;
|
|
75
|
+
if (nativeNamesByPlatform[platform].has(fileName)) return true;
|
|
76
|
+
return nativeExtensionsByPlatform[platform].has(extname(fileName).toLowerCase());
|
|
77
|
+
}
|
|
78
|
+
async function stopCapProcess(current) {
|
|
79
|
+
if (!current) return;
|
|
80
|
+
current.kill("SIGINT");
|
|
81
|
+
try {
|
|
82
|
+
await current;
|
|
83
|
+
} catch {}
|
|
84
|
+
}
|
|
85
|
+
function startCapProcess(cwd, platform, deviceId) {
|
|
86
|
+
return x("cap", [
|
|
87
|
+
"run",
|
|
88
|
+
platform,
|
|
89
|
+
"--target",
|
|
90
|
+
deviceId
|
|
91
|
+
], {
|
|
92
|
+
persist: true,
|
|
93
|
+
throwOnError: false,
|
|
94
|
+
nodeOptions: {
|
|
95
|
+
cwd,
|
|
96
|
+
stdio: "inherit"
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
async function runCapVite(platform, deviceId, options = {}) {
|
|
101
|
+
const cwd = resolve(options.cwd ?? process.cwd());
|
|
102
|
+
const debounceMs = options.debounceMs ?? 300;
|
|
103
|
+
const server = await createServer({
|
|
104
|
+
clearScreen: false,
|
|
105
|
+
root: cwd
|
|
106
|
+
});
|
|
107
|
+
await server.listen();
|
|
108
|
+
server.printUrls();
|
|
109
|
+
const url = pickServerUrl(server);
|
|
110
|
+
const logger = server.config.logger;
|
|
111
|
+
await x("cap", ["sync", platform], {
|
|
112
|
+
persist: true,
|
|
113
|
+
throwOnError: false,
|
|
114
|
+
nodeOptions: {
|
|
115
|
+
cwd,
|
|
116
|
+
env: { CAPACITOR_DEV_SERVER_URL: url.toString() },
|
|
117
|
+
stdio: "inherit"
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
let currentCapProcess = startCapProcess(cwd, platform, deviceId);
|
|
121
|
+
let restartTimer;
|
|
122
|
+
let shuttingDown = false;
|
|
123
|
+
async function restartCapProcess(reason) {
|
|
124
|
+
if (shuttingDown) return;
|
|
125
|
+
logger.info(`[cap-vite] ${reason}. Re-running cap run ${platform}.`);
|
|
126
|
+
const previous = currentCapProcess;
|
|
127
|
+
currentCapProcess = void 0;
|
|
128
|
+
await stopCapProcess(previous);
|
|
129
|
+
currentCapProcess = startCapProcess(cwd, platform, deviceId);
|
|
130
|
+
}
|
|
131
|
+
const onWatcherEvent = (_event, file) => {
|
|
132
|
+
if (!shouldRestartForNativeChange(file, platform, cwd)) return;
|
|
133
|
+
clearTimeout(restartTimer);
|
|
134
|
+
restartTimer = setTimeout(() => {
|
|
135
|
+
restartCapProcess(`native file changed: ${resolve(cwd, file)}`);
|
|
136
|
+
}, debounceMs);
|
|
137
|
+
};
|
|
138
|
+
const shutdown = async (exitCode) => {
|
|
139
|
+
if (shuttingDown) return;
|
|
140
|
+
shuttingDown = true;
|
|
141
|
+
clearTimeout(restartTimer);
|
|
142
|
+
server.watcher.off("all", onWatcherEvent);
|
|
143
|
+
await server.watcher.unwatch(platform);
|
|
144
|
+
await server.close();
|
|
145
|
+
await stopCapProcess(currentCapProcess);
|
|
146
|
+
process.exit(exitCode);
|
|
147
|
+
};
|
|
148
|
+
server.watcher.add(platform);
|
|
149
|
+
server.watcher.on("all", onWatcherEvent);
|
|
150
|
+
process.once("SIGINT", () => {
|
|
151
|
+
shutdown(0);
|
|
152
|
+
});
|
|
153
|
+
process.once("SIGTERM", () => {
|
|
154
|
+
shutdown(0);
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
//#endregion
|
|
159
|
+
export { runCapVite };
|
|
160
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["import type { Result } from 'tinyexec'\nimport type { ViteDevServer } from 'vite'\n\nimport process from 'node:process'\n\nimport { basename, extname, relative, resolve, sep } from 'node:path'\n\nimport { x } from 'tinyexec'\nimport { createServer } from 'vite'\n\nexport type CapacitorPlatform = 'android' | 'ios'\n\nexport interface RunCapViteOptions {\n cwd?: string\n debounceMs?: number\n}\n\nconst nativeExtensionsByPlatform: Record<CapacitorPlatform, Set<string>> = {\n ios: new Set([\n '.entitlements',\n '.h',\n '.hpp',\n '.m',\n '.mm',\n '.pbxproj',\n '.plist',\n '.storyboard',\n '.strings',\n '.swift',\n '.xcodeproj',\n '.xcconfig',\n '.xcscheme',\n '.xib',\n ]),\n android: new Set([\n '.gradle',\n '.java',\n '.json',\n '.kts',\n '.kt',\n '.properties',\n '.xml',\n ]),\n}\n\nconst nativeNamesByPlatform: Record<CapacitorPlatform, Set<string>> = {\n ios: new Set([\n 'Podfile',\n 'Podfile.lock',\n 'project.pbxproj',\n ]),\n android: new Set([\n 'AndroidManifest.xml',\n 'build.gradle',\n 'build.gradle.kts',\n 'gradle.properties',\n 'settings.gradle',\n 'settings.gradle.kts',\n ]),\n}\n\nconst ignoredNames = new Set([\n 'capacitor.config.json',\n])\n\nconst ignoredPathSegments = new Set([\n '.gradle',\n 'DerivedData',\n 'Pods',\n 'build',\n 'xcuserdata',\n])\n\nconst ignoredPathPrefixesByPlatform: Record<CapacitorPlatform, string[][]> = {\n ios: [\n ['App', 'CapApp-SPM'],\n ],\n android: [],\n}\n\nfunction pickServerUrl(server: ViteDevServer): URL {\n const url = server.resolvedUrls?.network?.[0] ?? server.resolvedUrls?.local?.[0]\n\n if (!url) {\n throw new Error('Vite did not expose a reachable dev server URL.')\n }\n\n const resolved = new URL(url)\n\n return resolved\n}\n\nfunction shouldRestartForNativeChange(file: string, platform: CapacitorPlatform, cwd: string): boolean {\n const absoluteFile = resolve(cwd, file)\n const platformRoot = resolve(cwd, platform)\n\n if (!absoluteFile.startsWith(`${platformRoot}${sep}`) && absoluteFile !== platformRoot) {\n return false\n }\n\n const fileName = basename(absoluteFile)\n\n if (ignoredNames.has(fileName)) {\n return false\n }\n\n const segments = absoluteFile.split(sep)\n if (segments.some(segment => ignoredPathSegments.has(segment))) {\n return false\n }\n\n const relativeFile = relative(platformRoot, absoluteFile)\n const relativeSegments = relativeFile.split(sep).filter(Boolean)\n\n if (ignoredPathPrefixesByPlatform[platform].some(prefix =>\n prefix.every((segment, index) => relativeSegments[index] === segment),\n )) {\n // NOTICE: Capacitor regenerates ios/App/CapApp-SPM/Package.swift during `cap run`.\n // Treating that generated tree as a native source change causes an infinite restart loop.\n return false\n }\n\n if (nativeNamesByPlatform[platform].has(fileName)) {\n return true\n }\n\n return nativeExtensionsByPlatform[platform].has(extname(fileName).toLowerCase())\n}\n\nasync function stopCapProcess(current: Result | undefined) {\n if (!current) {\n return\n }\n\n current.kill('SIGINT')\n\n try {\n await current\n }\n catch {\n // tinyexec rejects on interrupted exits when the child was stopped for a restart.\n }\n}\n\nfunction startCapProcess(cwd: string, platform: CapacitorPlatform, deviceId: string) {\n return x('cap', ['run', platform, '--target', deviceId], { persist: true, throwOnError: false, nodeOptions: { cwd, stdio: 'inherit' } })\n}\n\nexport async function runCapVite(\n platform: CapacitorPlatform,\n deviceId: string,\n options: RunCapViteOptions = {},\n): Promise<void> {\n const cwd = resolve(options.cwd ?? process.cwd())\n const debounceMs = options.debounceMs ?? 300\n const server = await createServer({\n clearScreen: false,\n root: cwd,\n })\n\n await server.listen()\n server.printUrls()\n\n const url = pickServerUrl(server)\n const logger = server.config.logger\n\n await x('cap', ['sync', platform], { persist: true, throwOnError: false, nodeOptions: { cwd, env: { CAPACITOR_DEV_SERVER_URL: url.toString() }, stdio: 'inherit' } })\n\n let currentCapProcess: Result | undefined = startCapProcess(cwd, platform, deviceId)\n let restartTimer: NodeJS.Timeout | undefined\n let shuttingDown = false\n\n async function restartCapProcess(reason: string) {\n if (shuttingDown) {\n return\n }\n\n logger.info(`[cap-vite] ${reason}. Re-running cap run ${platform}.`)\n const previous = currentCapProcess\n currentCapProcess = undefined\n await stopCapProcess(previous)\n currentCapProcess = startCapProcess(cwd, platform, deviceId)\n }\n\n const onWatcherEvent = (_event: string, file: string) => {\n if (!shouldRestartForNativeChange(file, platform, cwd)) {\n return\n }\n\n clearTimeout(restartTimer)\n restartTimer = setTimeout(() => {\n void restartCapProcess(`native file changed: ${resolve(cwd, file)}`)\n }, debounceMs)\n }\n\n const shutdown = async (exitCode: number) => {\n if (shuttingDown) {\n return\n }\n\n shuttingDown = true\n clearTimeout(restartTimer)\n server.watcher.off('all', onWatcherEvent)\n await server.watcher.unwatch(platform)\n await server.close()\n await stopCapProcess(currentCapProcess)\n process.exit(exitCode)\n }\n\n server.watcher.add(platform)\n server.watcher.on('all', onWatcherEvent)\n\n process.once('SIGINT', () => {\n void shutdown(0)\n })\n process.once('SIGTERM', () => {\n void shutdown(0)\n })\n}\n"],"mappings":";;;;;;AAiBA,MAAM,6BAAqE;CACzE,KAAK,IAAI,IAAI;EACX;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CAAC;CACF,SAAS,IAAI,IAAI;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CAAC;CACH;AAED,MAAM,wBAAgE;CACpE,KAAK,IAAI,IAAI;EACX;EACA;EACA;EACD,CAAC;CACF,SAAS,IAAI,IAAI;EACf;EACA;EACA;EACA;EACA;EACA;EACD,CAAC;CACH;AAED,MAAM,eAAe,IAAI,IAAI,CAC3B,wBACD,CAAC;AAEF,MAAM,sBAAsB,IAAI,IAAI;CAClC;CACA;CACA;CACA;CACA;CACD,CAAC;AAEF,MAAM,gCAAuE;CAC3E,KAA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ACF,SAAQ,KAAK,iBAAiB;AAC5B,EAAK,SAAS,EAAE;GAChB"}
|
package/package.json
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@proj-airi/cap-vite",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "0.9.0-alpha.4",
|
|
5
|
+
"description": "CLI that starts a Vite dev server and runs Capacitor live reload",
|
|
6
|
+
"author": {
|
|
7
|
+
"name": "Moeru AI Project AIRI Team",
|
|
8
|
+
"email": "airi@moeru.ai",
|
|
9
|
+
"url": "https://github.com/moeru-ai"
|
|
10
|
+
},
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "https://github.com/moeru-ai/airi.git",
|
|
15
|
+
"directory": "packages/cap-vite"
|
|
16
|
+
},
|
|
17
|
+
"exports": {
|
|
18
|
+
".": {
|
|
19
|
+
"types": "./dist/index.d.mts",
|
|
20
|
+
"default": "./dist/index.mjs"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"main": "./dist/index.mjs",
|
|
24
|
+
"types": "./dist/index.d.mts",
|
|
25
|
+
"bin": {
|
|
26
|
+
"cap-vite": "./dist/bin/run.mjs"
|
|
27
|
+
},
|
|
28
|
+
"files": [
|
|
29
|
+
"README.md",
|
|
30
|
+
"dist",
|
|
31
|
+
"package.json"
|
|
32
|
+
],
|
|
33
|
+
"peerDependencies": {
|
|
34
|
+
"@capacitor/cli": "^8.0.0",
|
|
35
|
+
"vite": "^7.0.0 || ^8.0.0-beta.0"
|
|
36
|
+
},
|
|
37
|
+
"dependencies": {
|
|
38
|
+
"tinyexec": "^1.0.2"
|
|
39
|
+
},
|
|
40
|
+
"scripts": {
|
|
41
|
+
"build": "tsdown",
|
|
42
|
+
"typecheck": "tsc --noEmit"
|
|
43
|
+
}
|
|
44
|
+
}
|