vxrn 2.0.0-beta.46.1 → 2.0.0-beta.50.1
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/dist/cli.mjs +23 -6
- package/dist/cli.mjs.map +1 -1
- package/dist/cli.native.js +23 -6
- package/dist/cli.native.js.map +1 -1
- package/dist/constants/defaults.mjs +1 -0
- package/dist/constants/defaults.mjs.map +1 -1
- package/dist/constants/defaults.native.js +1 -0
- package/dist/constants/defaults.native.js.map +1 -1
- package/dist/exports/prebuild.mjs +41 -169
- package/dist/exports/prebuild.mjs.map +1 -1
- package/dist/exports/prebuild.native.js +43 -188
- package/dist/exports/prebuild.native.js.map +1 -1
- package/dist/exports/prebuildWithoutExpo.mjs +233 -35
- package/dist/exports/prebuildWithoutExpo.mjs.map +1 -1
- package/dist/exports/prebuildWithoutExpo.native.js +321 -43
- package/dist/exports/prebuildWithoutExpo.native.js.map +1 -1
- package/dist/exports/runAndroid.mjs +2 -2
- package/dist/exports/runAndroid.mjs.map +1 -1
- package/dist/exports/runAndroid.native.js +2 -2
- package/dist/exports/runAndroid.native.js.map +1 -1
- package/dist/exports/runIos.mjs +2 -2
- package/dist/exports/runIos.mjs.map +1 -1
- package/dist/exports/runIos.native.js +2 -2
- package/dist/exports/runIos.native.js.map +1 -1
- package/dist/patches/builtInDepPatches.mjs +13 -0
- package/dist/patches/builtInDepPatches.mjs.map +1 -1
- package/dist/patches/builtInDepPatches.native.js +13 -0
- package/dist/patches/builtInDepPatches.native.js.map +1 -1
- package/dist/runtime/native-prelude.mjs +1 -1
- package/dist/runtime/native-prelude.mjs.map +1 -1
- package/dist/runtime/native-prelude.native.js +1 -1
- package/dist/runtime/native-prelude.native.js.map +1 -1
- package/dist/utils/createNativeDevEngine.mjs +12 -6
- package/dist/utils/createNativeDevEngine.mjs.map +1 -1
- package/dist/utils/createNativeDevEngine.native.js +32 -11
- package/dist/utils/createNativeDevEngine.native.js.map +1 -1
- package/dist/utils/nativeRun.mjs +61 -0
- package/dist/utils/nativeRun.mjs.map +1 -0
- package/dist/utils/nativeRun.native.js +62 -0
- package/dist/utils/nativeRun.native.js.map +1 -0
- package/expo-plugin.cjs +51 -6
- package/package.json +14 -11
- package/src/cli.ts +29 -6
- package/src/constants/defaults.ts +1 -0
- package/src/exports/prebuild.ts +63 -283
- package/src/exports/prebuildWithoutExpo.test.ts +282 -0
- package/src/exports/prebuildWithoutExpo.ts +383 -34
- package/src/exports/runAndroid.ts +2 -2
- package/src/exports/runIos.ts +2 -2
- package/src/patches/builtInDepPatches.ts +21 -0
- package/src/runtime/native-prelude.ts +1 -1
- package/src/utils/createNativeDevEngine.test.ts +67 -3
- package/src/utils/createNativeDevEngine.ts +43 -13
- package/src/utils/nativeRun.test.ts +85 -0
- package/src/utils/nativeRun.ts +92 -0
- package/types/constants/defaults.d.ts.map +1 -1
- package/types/exports/prebuild.d.ts +3 -2
- package/types/exports/prebuild.d.ts.map +1 -1
- package/types/exports/prebuildWithoutExpo.d.ts +35 -1
- package/types/exports/prebuildWithoutExpo.d.ts.map +1 -1
- package/types/patches/builtInDepPatches.d.ts.map +1 -1
- package/types/utils/createNativeDevEngine.d.ts.map +1 -1
- package/types/utils/nativeRun.d.ts +20 -0
- package/types/utils/nativeRun.d.ts.map +1 -0
- package/dist/utils/expoRun.mjs +0 -40
- package/dist/utils/expoRun.mjs.map +0 -1
- package/dist/utils/expoRun.native.js +0 -41
- package/dist/utils/expoRun.native.js.map +0 -1
- package/src/utils/expoRun.ts +0 -71
- package/types/utils/expoRun.d.ts +0 -6
- package/types/utils/expoRun.d.ts.map +0 -1
package/dist/cli.mjs
CHANGED
|
@@ -146,10 +146,21 @@ const prebuild = defineCommand({
|
|
|
146
146
|
type: "string",
|
|
147
147
|
description: "ios or android"
|
|
148
148
|
},
|
|
149
|
-
|
|
150
|
-
type: "
|
|
151
|
-
description: "
|
|
152
|
-
|
|
149
|
+
"app-name": {
|
|
150
|
+
type: "string",
|
|
151
|
+
description: "native target and AppRegistry key"
|
|
152
|
+
},
|
|
153
|
+
"display-name": {
|
|
154
|
+
type: "string",
|
|
155
|
+
description: "user-visible app name"
|
|
156
|
+
},
|
|
157
|
+
"bundle-id": {
|
|
158
|
+
type: "string",
|
|
159
|
+
description: "ios bundle id (reverse-dns)"
|
|
160
|
+
},
|
|
161
|
+
"application-id": {
|
|
162
|
+
type: "string",
|
|
163
|
+
description: "android application id (reverse-dns)"
|
|
153
164
|
},
|
|
154
165
|
"no-install": {
|
|
155
166
|
type: "boolean",
|
|
@@ -161,11 +172,17 @@ const prebuild = defineCommand({
|
|
|
161
172
|
if (args.install === false) args["no-install"] = true;
|
|
162
173
|
const { prebuild: prebuild2 } = await importCLIEndpoint("./exports/prebuild.mjs");
|
|
163
174
|
const root = process.cwd();
|
|
164
|
-
const { platform
|
|
175
|
+
const { platform } = args;
|
|
165
176
|
await prebuild2({
|
|
166
177
|
root,
|
|
167
178
|
platform,
|
|
168
|
-
|
|
179
|
+
"no-install": args["no-install"],
|
|
180
|
+
app: {
|
|
181
|
+
name: args["app-name"],
|
|
182
|
+
displayName: args["display-name"],
|
|
183
|
+
ios: args["bundle-id"] ? { bundleId: args["bundle-id"] } : void 0,
|
|
184
|
+
android: args["application-id"] ? { applicationId: args["application-id"] } : void 0
|
|
185
|
+
}
|
|
169
186
|
});
|
|
170
187
|
}
|
|
171
188
|
});
|
package/dist/cli.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","names":[],"sources":["cli.js"],"sourcesContent":["import { defineCommand, runMain } from \"citty\";\nasync function importCLIEndpoint(path) {\n return await import(path);\n}\nfunction lastValue(arg) {\n if (Array.isArray(arg)) {\n return arg[arg.length - 1];\n }\n return arg;\n}\nif (typeof import.meta.dirname !== \"string\") {\n console.error(\n `One uses \"import.meta.dirname\", for Node this is version 20.11.0 or greater`\n );\n process.exit(1);\n}\nconst dev = defineCommand({\n meta: {\n name: \"dev\",\n version: \"0.0.0\",\n description: \"Start the dev server\"\n },\n args: {\n clean: {\n type: \"boolean\"\n },\n host: {\n type: \"string\"\n },\n port: {\n type: \"string\"\n },\n \"debug-bundle\": {\n type: \"string\",\n description: `Will output the bundle to a temp file and then serve it from there afterwards allowing you to easily edit the bundle to debug problems. Can pass path or empty path for a random directory.`\n }\n },\n async run({ args }) {\n const { dev: dev2 } = await importCLIEndpoint(\"./exports/dev.mjs\");\n const port = lastValue(args.port);\n const host = lastValue(args.host);\n const { start, stop } = await dev2({\n clean: args.clean,\n root: process.cwd(),\n debugBundle: lastValue(args[\"debug-bundle\"]) || \"\",\n server: {\n host,\n port: port ? +port : void 0\n }\n });\n const { closePromise } = await start();\n process.on(\"beforeExit\", () => {\n stop();\n });\n process.on(\"SIGINT\", () => {\n try {\n stop();\n } finally {\n process.exit(2);\n }\n });\n process.on(\"uncaughtException\", (err) => {\n console.error(err?.message || err);\n });\n await closePromise;\n }\n});\nconst build = defineCommand({\n meta: {\n name: \"build\",\n version: \"0.0.0\",\n description: \"Build your app\"\n },\n args: {\n step: {\n type: \"string\",\n required: false\n },\n // limit the pages built\n only: {\n type: \"string\",\n required: false\n },\n analyze: {\n type: \"boolean\",\n required: false\n },\n platform: {\n type: \"string\",\n description: `One of: web, ios, android`,\n default: \"web\",\n required: false\n }\n },\n async run({ args }) {\n const { build: build2 } = await importCLIEndpoint(\"./exports/build.mjs\");\n process.on(\"uncaughtException\", (err) => {\n console.error(err?.message || err);\n });\n const platforms = {\n ios: \"ios\",\n web: \"web\",\n android: \"android\"\n };\n if (args.platform && !platforms[args.platform]) {\n throw new Error(`Invalid platform: ${args.platform}`);\n }\n const platform = platforms[args.platform] || \"web\";\n const results = await build2(\n {},\n {\n analyze: args.analyze,\n only: args.only,\n step: args.step,\n platform\n }\n );\n if (process.env.DEBUG) {\n console.info(\"results\", results);\n }\n }\n});\nconst serve = defineCommand({\n meta: {\n name: \"serve\",\n version: \"0.0.0\",\n description: \"Serve a built app for production\"\n },\n args: {\n host: {\n type: \"string\"\n },\n port: {\n type: \"string\"\n }\n },\n async run({ args }) {\n const { serve: serve2 } = await importCLIEndpoint(\"./exports/serve.mjs\");\n process.on(\"uncaughtException\", (err) => {\n console.error(err?.message || err);\n });\n const port = lastValue(args.port);\n const host = lastValue(args.host);\n const results = await serve2({\n port: port ? +port : void 0,\n host\n });\n if (process.env.DEBUG) {\n console.info(\"results\", results);\n }\n }\n});\nconst prebuild = defineCommand({\n meta: {\n name: \"prebuild\",\n version: \"0.0.0\",\n description: \"Prebuild native project\"\n },\n args: {\n platform: {\n type: \"string\",\n description: \"ios or android\"\n },\n expo: {\n type: \"boolean\",\n description: \"expo or non-expo folders\",\n default: true\n },\n \"no-install\": {\n type: \"boolean\",\n description: \"skip installing native dependencies\",\n default: false\n }\n },\n async run({ args }) {\n if (args.install === false) args[\"no-install\"] = true;\n const { prebuild: prebuild2 } = await importCLIEndpoint(\n \"./exports/prebuild.mjs\"\n );\n const root = process.cwd();\n const { platform, expo } = args;\n await prebuild2({ root, platform, expo });\n }\n});\nconst runIos = defineCommand({\n meta: {\n name: \"run:ios\",\n version: \"0.0.0\"\n },\n args: {},\n async run() {\n const { runIos: runIos2 } = await importCLIEndpoint(\"./exports/runIos.mjs\");\n const root = process.cwd();\n await runIos2({ root });\n }\n});\nconst runAndroid = defineCommand({\n meta: {\n name: \"run:android\",\n version: \"0.0.0\"\n },\n args: {},\n async run() {\n const { runAndroid: runAndroid2 } = await importCLIEndpoint(\n \"./exports/runAndroid.mjs\"\n );\n const root = process.cwd();\n await runAndroid2({ root });\n }\n});\nconst patch = defineCommand({\n meta: {\n name: \"patch\",\n version: \"0.0.0\",\n description: \"Apply package patches\"\n },\n args: {},\n async run() {\n const { patch: vxrnPatch } = await importCLIEndpoint(\"./exports/patch.mjs\");\n await vxrnPatch({\n root: process.cwd()\n });\n }\n});\nconst clean = defineCommand({\n meta: {\n name: \"clean\",\n version: \"0.0.0\",\n description: \"Clean build folders\"\n },\n args: {},\n async run() {\n const { clean: vxrnClean } = await importCLIEndpoint(\"./exports/clean.mjs\");\n await vxrnClean({\n root: process.cwd()\n });\n }\n});\nconst main = defineCommand({\n meta: {\n name: \"main\",\n version: \"0.0.0\",\n description: \"Welcome to vxrn\"\n },\n subCommands: {\n dev,\n build,\n serve,\n prebuild,\n runIos,\n runAndroid,\n clean,\n patch\n }\n});\nrunMain(main);\n//# sourceMappingURL=cli.js.map\n"],"mappings":";;;AACA,eAAe,kBAAkB,MAAM;CACrC,OAAO,MAAM,OAAO;AACtB;AACA,SAAS,UAAU,KAAK;CACtB,IAAI,MAAM,QAAQ,GAAG,GAAG;EACtB,OAAO,IAAI,IAAI,SAAS;CAC1B;CACA,OAAO;AACT;AACA,IAAI,OAAO,YAAY,YAAY,UAAU;CAC3C,QAAQ,MACN,6EACF;CACA,QAAQ,KAAK,CAAC;AAChB;AACA,MAAM,MAAM,cAAc;CACxB,MAAM;EACJ,MAAM;EACN,SAAS;EACT,aAAa;CACf;CACA,MAAM;EACJ,OAAO,EACL,MAAM,UACR;EACA,MAAM,EACJ,MAAM,SACR;EACA,MAAM,EACJ,MAAM,SACR;EACA,gBAAgB;GACd,MAAM;GACN,aAAa;EACf;CACF;CACA,MAAM,IAAI,EAAE,QAAQ;EAClB,MAAM,EAAE,KAAK,SAAS,MAAM,kBAAkB,mBAAmB;EACjE,MAAM,OAAO,UAAU,KAAK,IAAI;EAChC,MAAM,OAAO,UAAU,KAAK,IAAI;EAChC,MAAM,EAAE,OAAO,SAAS,MAAM,KAAK;GACjC,OAAO,KAAK;GACZ,MAAM,QAAQ,IAAI;GAClB,aAAa,UAAU,KAAK,eAAe,KAAK;GAChD,QAAQ;IACN;IACA,MAAM,OAAO,CAAC,OAAO,KAAK;GAC5B;EACF,CAAC;EACD,MAAM,EAAE,iBAAiB,MAAM,MAAM;EACrC,QAAQ,GAAG,oBAAoB;GAC7B,KAAK;EACP,CAAC;EACD,QAAQ,GAAG,gBAAgB;GACzB,IAAI;IACF,KAAK;GACP,UAAU;IACR,Q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;AACD,MAAM,QAAQ,cAAc;CAC1B,MAAM;EACJ,MAAM;EACN,SAAS;EACT,aAAa;CACf;CACA,MAAM,CAAC;CACP,MAAM,MAAM;EACV,MAAM,EAAE,OAAO,cAAc,MAAM,kBAAkB,qBAAqB;EAC1E,MAAM,UAAU,EACd,MAAM,QAAQ,IAAI,EACpB,CAAC;CACH;AACF,CAAC;AACD,MAAM,QAAQ,cAAc;CAC1B,MAAM;EACJ,MAAM;EACN,SAAS;EACT,aAAa;CACf;CACA,MAAM,CAAC;CACP,MAAM,MAAM;EACV,MAAM,EAAE,OAAO,cAAc,MAAM,kBAAkB,qBAAqB;EAC1E,MAAM,UAAU,EACd,MAAM,QAAQ,IAAI,EACpB,CAAC;CACH;AACF,CAAC;AACD,MAAM,OAAO,cAAc;CACzB,MAAM;EACJ,MAAM;EACN,SAAS;EACT,aAAa;CACf;CACA,aAAa;EACX;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;AACF,CAAC;AACD,QAAQ,IAAI"}
|
|
1
|
+
{"version":3,"file":"cli.js","names":[],"sources":["cli.js"],"sourcesContent":["import { defineCommand, runMain } from \"citty\";\nasync function importCLIEndpoint(path) {\n return await import(path);\n}\nfunction lastValue(arg) {\n if (Array.isArray(arg)) {\n return arg[arg.length - 1];\n }\n return arg;\n}\nif (typeof import.meta.dirname !== \"string\") {\n console.error(\n `One uses \"import.meta.dirname\", for Node this is version 20.11.0 or greater`\n );\n process.exit(1);\n}\nconst dev = defineCommand({\n meta: {\n name: \"dev\",\n version: \"0.0.0\",\n description: \"Start the dev server\"\n },\n args: {\n clean: {\n type: \"boolean\"\n },\n host: {\n type: \"string\"\n },\n port: {\n type: \"string\"\n },\n \"debug-bundle\": {\n type: \"string\",\n description: `Will output the bundle to a temp file and then serve it from there afterwards allowing you to easily edit the bundle to debug problems. Can pass path or empty path for a random directory.`\n }\n },\n async run({ args }) {\n const { dev: dev2 } = await importCLIEndpoint(\"./exports/dev.mjs\");\n const port = lastValue(args.port);\n const host = lastValue(args.host);\n const { start, stop } = await dev2({\n clean: args.clean,\n root: process.cwd(),\n debugBundle: lastValue(args[\"debug-bundle\"]) || \"\",\n server: {\n host,\n port: port ? +port : void 0\n }\n });\n const { closePromise } = await start();\n process.on(\"beforeExit\", () => {\n stop();\n });\n process.on(\"SIGINT\", () => {\n try {\n stop();\n } finally {\n process.exit(2);\n }\n });\n process.on(\"uncaughtException\", (err) => {\n console.error(err?.message || err);\n });\n await closePromise;\n }\n});\nconst build = defineCommand({\n meta: {\n name: \"build\",\n version: \"0.0.0\",\n description: \"Build your app\"\n },\n args: {\n step: {\n type: \"string\",\n required: false\n },\n // limit the pages built\n only: {\n type: \"string\",\n required: false\n },\n analyze: {\n type: \"boolean\",\n required: false\n },\n platform: {\n type: \"string\",\n description: `One of: web, ios, android`,\n default: \"web\",\n required: false\n }\n },\n async run({ args }) {\n const { build: build2 } = await importCLIEndpoint(\"./exports/build.mjs\");\n process.on(\"uncaughtException\", (err) => {\n console.error(err?.message || err);\n });\n const platforms = {\n ios: \"ios\",\n web: \"web\",\n android: \"android\"\n };\n if (args.platform && !platforms[args.platform]) {\n throw new Error(`Invalid platform: ${args.platform}`);\n }\n const platform = platforms[args.platform] || \"web\";\n const results = await build2(\n {},\n {\n analyze: args.analyze,\n only: args.only,\n step: args.step,\n platform\n }\n );\n if (process.env.DEBUG) {\n console.info(\"results\", results);\n }\n }\n});\nconst serve = defineCommand({\n meta: {\n name: \"serve\",\n version: \"0.0.0\",\n description: \"Serve a built app for production\"\n },\n args: {\n host: {\n type: \"string\"\n },\n port: {\n type: \"string\"\n }\n },\n async run({ args }) {\n const { serve: serve2 } = await importCLIEndpoint(\"./exports/serve.mjs\");\n process.on(\"uncaughtException\", (err) => {\n console.error(err?.message || err);\n });\n const port = lastValue(args.port);\n const host = lastValue(args.host);\n const results = await serve2({\n port: port ? +port : void 0,\n host\n });\n if (process.env.DEBUG) {\n console.info(\"results\", results);\n }\n }\n});\nconst prebuild = defineCommand({\n meta: {\n name: \"prebuild\",\n version: \"0.0.0\",\n description: \"Prebuild native project\"\n },\n args: {\n platform: {\n type: \"string\",\n description: \"ios or android\"\n },\n \"app-name\": {\n type: \"string\",\n description: \"native target and AppRegistry key\"\n },\n \"display-name\": {\n type: \"string\",\n description: \"user-visible app name\"\n },\n \"bundle-id\": {\n type: \"string\",\n description: \"ios bundle id (reverse-dns)\"\n },\n \"application-id\": {\n type: \"string\",\n description: \"android application id (reverse-dns)\"\n },\n \"no-install\": {\n type: \"boolean\",\n description: \"skip installing native dependencies\",\n default: false\n }\n },\n async run({ args }) {\n if (args.install === false) args[\"no-install\"] = true;\n const { prebuild: prebuild2 } = await importCLIEndpoint(\n \"./exports/prebuild.mjs\"\n );\n const root = process.cwd();\n const { platform } = args;\n await prebuild2({\n root,\n platform,\n \"no-install\": args[\"no-install\"],\n app: {\n name: args[\"app-name\"],\n displayName: args[\"display-name\"],\n ios: args[\"bundle-id\"] ? { bundleId: args[\"bundle-id\"] } : void 0,\n android: args[\"application-id\"] ? { applicationId: args[\"application-id\"] } : void 0\n }\n });\n }\n});\nconst runIos = defineCommand({\n meta: {\n name: \"run:ios\",\n version: \"0.0.0\"\n },\n args: {},\n async run() {\n const { runIos: runIos2 } = await importCLIEndpoint(\"./exports/runIos.mjs\");\n const root = process.cwd();\n await runIos2({ root });\n }\n});\nconst runAndroid = defineCommand({\n meta: {\n name: \"run:android\",\n version: \"0.0.0\"\n },\n args: {},\n async run() {\n const { runAndroid: runAndroid2 } = await importCLIEndpoint(\n \"./exports/runAndroid.mjs\"\n );\n const root = process.cwd();\n await runAndroid2({ root });\n }\n});\nconst patch = defineCommand({\n meta: {\n name: \"patch\",\n version: \"0.0.0\",\n description: \"Apply package patches\"\n },\n args: {},\n async run() {\n const { patch: vxrnPatch } = await importCLIEndpoint(\"./exports/patch.mjs\");\n await vxrnPatch({\n root: process.cwd()\n });\n }\n});\nconst clean = defineCommand({\n meta: {\n name: \"clean\",\n version: \"0.0.0\",\n description: \"Clean build folders\"\n },\n args: {},\n async run() {\n const { clean: vxrnClean } = await importCLIEndpoint(\"./exports/clean.mjs\");\n await vxrnClean({\n root: process.cwd()\n });\n }\n});\nconst main = defineCommand({\n meta: {\n name: \"main\",\n version: \"0.0.0\",\n description: \"Welcome to vxrn\"\n },\n subCommands: {\n dev,\n build,\n serve,\n prebuild,\n runIos,\n runAndroid,\n clean,\n patch\n }\n});\nrunMain(main);\n//# sourceMappingURL=cli.js.map\n"],"mappings":";;;AACA,eAAe,kBAAkB,MAAM;CACrC,OAAO,MAAM,OAAO;AACtB;AACA,SAAS,UAAU,KAAK;CACtB,IAAI,MAAM,QAAQ,GAAG,GAAG;EACtB,OAAO,IAAI,IAAI,SAAS;CAC1B;CACA,OAAO;AACT;AACA,IAAI,OAAO,YAAY,YAAY,UAAU;CAC3C,QAAQ,MACN,6EACF;CACA,QAAQ,KAAK,CAAC;AAChB;AACA,MAAM,MAAM,cAAc;CACxB,MAAM;EACJ,MAAM;EACN,SAAS;EACT,aAAa;CACf;CACA,MAAM;EACJ,OAAO,EACL,MAAM,UACR;EACA,MAAM,EACJ,MAAM,SACR;EACA,MAAM,EACJ,MAAM,SACR;EACA,gBAAgB;GACd,MAAM;GACN,aAAa;EACf;CACF;CACA,MAAM,IAAI,EAAE,QAAQ;EAClB,MAAM,EAAE,KAAK,SAAS,MAAM,kBAAkB,mBAAmB;EACjE,MAAM,OAAO,UAAU,KAAK,IAAI;EAChC,MAAM,OAAO,UAAU,KAAK,IAAI;EAChC,MAAM,EAAE,OAAO,SAAS,MAAM,KAAK;GACjC,OAAO,KAAK;GACZ,MAAM,QAAQ,IAAI;GAClB,aAAa,UAAU,KAAK,eAAe,KAAK;GAChD,QAAQ;IACN;IACA,MAAM,OAAO,CAAC,OAAO,KAAK;GAC5B;EACF,CAAC;EACD,MAAM,EAAE,iBAAiB,MAAM,MAAM;EACrC,QAAQ,GAAG,oBAAoB;GAC7B,KAAK;EACP,CAAC;EACD,QAAQ,GAAG,gBAAgB;GACzB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C1E,MAAM,OAAO,QAAQ,IAAI;EACzB,MAAM,QAAQ,EAAE,KAAK,CAAC;CACxB;AACF,CAAC;AACD,MAAM,aAAa,cAAc;CAC/B,MAAM;EACJ,MAAM;EACN,SAAS;CACX;CACA,MAAM,CAAC;CACP,MAAM,MAAM;EACV,MAAM,EAAE,YAAY,gBAAgB,MAAM,kBACxC,0BACF;EACA,MAAM,OAAO,QAAQ,IAAI;EACzB,MAAM,YAAY,EAAE,KAAK,CAAC;CAC5B;AACF,CAAC;AACD,MAAM,QAAQ,cAAc;CAC1B,MAAM;EACJ,MAAM;EACN,SAAS;EACT,aAAa;CACf;CACA,MAAM,CAAC;CACP,MAAM,MAAM;EACV,MAAM,EAAE,OAAO,cAAc,MAAM,kBAAkB,qBAAqB;EAC1E,MAAM,UAAU,EACd,MAAM,QAAQ,IAAI,EACpB,CAAC;CACH;AACF,CAAC;AACD,MAAM,QAAQ,cAAc;CAC1B,MAAM;EACJ,MAAM;EACN,SAAS;EACT,aAAa;CACf;CACA,MAAM,CAAC;CACP,MAAM,MAAM;EACV,MAAM,EAAE,OAAO,cAAc,MAAM,kBAAkB,qBAAqB;EAC1E,MAAM,UAAU,EACd,MAAM,QAAQ,IAAI,EACpB,CAAC;CACH;AACF,CAAC;AACD,MAAM,OAAO,cAAc;CACzB,MAAM;EACJ,MAAM;EACN,SAAS;EACT,aAAa;CACf;CACA,aAAa;EACX;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;AACF,CAAC;AACD,QAAQ,IAAI"}
|
package/dist/cli.native.js
CHANGED
|
@@ -149,10 +149,21 @@ var prebuild = defineCommand({
|
|
|
149
149
|
type: "string",
|
|
150
150
|
description: "ios or android"
|
|
151
151
|
},
|
|
152
|
-
|
|
153
|
-
type: "
|
|
154
|
-
description: "
|
|
155
|
-
|
|
152
|
+
"app-name": {
|
|
153
|
+
type: "string",
|
|
154
|
+
description: "native target and AppRegistry key"
|
|
155
|
+
},
|
|
156
|
+
"display-name": {
|
|
157
|
+
type: "string",
|
|
158
|
+
description: "user-visible app name"
|
|
159
|
+
},
|
|
160
|
+
"bundle-id": {
|
|
161
|
+
type: "string",
|
|
162
|
+
description: "ios bundle id (reverse-dns)"
|
|
163
|
+
},
|
|
164
|
+
"application-id": {
|
|
165
|
+
type: "string",
|
|
166
|
+
description: "android application id (reverse-dns)"
|
|
156
167
|
},
|
|
157
168
|
"no-install": {
|
|
158
169
|
type: "boolean",
|
|
@@ -165,11 +176,17 @@ var prebuild = defineCommand({
|
|
|
165
176
|
if (args.install === false) args["no-install"] = true;
|
|
166
177
|
var { prebuild: prebuild2 } = await importCLIEndpoint("./exports/prebuild.mjs");
|
|
167
178
|
var root = process.cwd();
|
|
168
|
-
var { platform
|
|
179
|
+
var { platform } = args;
|
|
169
180
|
await prebuild2({
|
|
170
181
|
root,
|
|
171
182
|
platform,
|
|
172
|
-
|
|
183
|
+
"no-install": args["no-install"],
|
|
184
|
+
app: {
|
|
185
|
+
name: args["app-name"],
|
|
186
|
+
displayName: args["display-name"],
|
|
187
|
+
ios: args["bundle-id"] ? { bundleId: args["bundle-id"] } : void 0,
|
|
188
|
+
android: args["application-id"] ? { applicationId: args["application-id"] } : void 0
|
|
189
|
+
}
|
|
173
190
|
});
|
|
174
191
|
}
|
|
175
192
|
});
|
package/dist/cli.native.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.native.js","names":[],"sources":["cli.native.js"],"sourcesContent":["import { defineCommand, runMain } from \"citty\";\nasync function importCLIEndpoint(path) {\n return await import(path);\n}\nfunction lastValue(arg) {\n if (Array.isArray(arg)) {\n return arg[arg.length - 1];\n }\n return arg;\n}\nif (typeof import.meta.dirname !== \"string\") {\n console.error(`One uses \"import.meta.dirname\", for Node this is version 20.11.0 or greater`);\n process.exit(1);\n}\nvar dev = defineCommand({\n meta: {\n name: \"dev\",\n version: \"0.0.0\",\n description: \"Start the dev server\"\n },\n args: {\n clean: {\n type: \"boolean\"\n },\n host: {\n type: \"string\"\n },\n port: {\n type: \"string\"\n },\n \"debug-bundle\": {\n type: \"string\",\n description: `Will output the bundle to a temp file and then serve it from there afterwards allowing you to easily edit the bundle to debug problems. Can pass path or empty path for a random directory.`\n }\n },\n async run(param) {\n var { args } = param;\n var { dev: dev2 } = await importCLIEndpoint(\"./exports/dev.mjs\");\n var port = lastValue(args.port);\n var host = lastValue(args.host);\n var { start, stop } = await dev2({\n clean: args.clean,\n root: process.cwd(),\n debugBundle: lastValue(args[\"debug-bundle\"]) || \"\",\n server: {\n host,\n port: port ? +port : void 0\n }\n });\n var { closePromise } = await start();\n process.on(\"beforeExit\", function() {\n stop();\n });\n process.on(\"SIGINT\", function() {\n try {\n stop();\n } finally {\n process.exit(2);\n }\n });\n process.on(\"uncaughtException\", function(err) {\n console.error((err === null || err === void 0 ? void 0 : err.message) || err);\n });\n await closePromise;\n }\n});\nvar build = defineCommand({\n meta: {\n name: \"build\",\n version: \"0.0.0\",\n description: \"Build your app\"\n },\n args: {\n step: {\n type: \"string\",\n required: false\n },\n // limit the pages built\n only: {\n type: \"string\",\n required: false\n },\n analyze: {\n type: \"boolean\",\n required: false\n },\n platform: {\n type: \"string\",\n description: `One of: web, ios, android`,\n default: \"web\",\n required: false\n }\n },\n async run(param) {\n var { args } = param;\n var { build: build2 } = await importCLIEndpoint(\"./exports/build.mjs\");\n process.on(\"uncaughtException\", function(err) {\n console.error((err === null || err === void 0 ? void 0 : err.message) || err);\n });\n var platforms = {\n ios: \"ios\",\n web: \"web\",\n android: \"android\"\n };\n if (args.platform && !platforms[args.platform]) {\n throw new Error(`Invalid platform: ${args.platform}`);\n }\n var platform = platforms[args.platform] || \"web\";\n var results = await build2({}, {\n analyze: args.analyze,\n only: args.only,\n step: args.step,\n platform\n });\n if (process.env.DEBUG) {\n console.info(\"results\", results);\n }\n }\n});\nvar serve = defineCommand({\n meta: {\n name: \"serve\",\n version: \"0.0.0\",\n description: \"Serve a built app for production\"\n },\n args: {\n host: {\n type: \"string\"\n },\n port: {\n type: \"string\"\n }\n },\n async run(param) {\n var { args } = param;\n var { serve: serve2 } = await importCLIEndpoint(\"./exports/serve.mjs\");\n process.on(\"uncaughtException\", function(err) {\n console.error((err === null || err === void 0 ? void 0 : err.message) || err);\n });\n var port = lastValue(args.port);\n var host = lastValue(args.host);\n var results = await serve2({\n port: port ? +port : void 0,\n host\n });\n if (process.env.DEBUG) {\n console.info(\"results\", results);\n }\n }\n});\nvar prebuild = defineCommand({\n meta: {\n name: \"prebuild\",\n version: \"0.0.0\",\n description: \"Prebuild native project\"\n },\n args: {\n platform: {\n type: \"string\",\n description: \"ios or android\"\n },\n expo: {\n type: \"boolean\",\n description: \"expo or non-expo folders\",\n default: true\n },\n \"no-install\": {\n type: \"boolean\",\n description: \"skip installing native dependencies\",\n default: false\n }\n },\n async run(param) {\n var { args } = param;\n if (args.install === false) args[\"no-install\"] = true;\n var { prebuild: prebuild2 } = await importCLIEndpoint(\"./exports/prebuild.mjs\");\n var root = process.cwd();\n var { platform, expo } = args;\n await prebuild2({\n root,\n platform,\n expo\n });\n }\n});\nvar runIos = defineCommand({\n meta: {\n name: \"run:ios\",\n version: \"0.0.0\"\n },\n args: {},\n async run() {\n var { runIos: runIos2 } = await importCLIEndpoint(\"./exports/runIos.mjs\");\n var root = process.cwd();\n await runIos2({\n root\n });\n }\n});\nvar runAndroid = defineCommand({\n meta: {\n name: \"run:android\",\n version: \"0.0.0\"\n },\n args: {},\n async run() {\n var { runAndroid: runAndroid2 } = await importCLIEndpoint(\"./exports/runAndroid.mjs\");\n var root = process.cwd();\n await runAndroid2({\n root\n });\n }\n});\nvar patch = defineCommand({\n meta: {\n name: \"patch\",\n version: \"0.0.0\",\n description: \"Apply package patches\"\n },\n args: {},\n async run() {\n var { patch: vxrnPatch } = await importCLIEndpoint(\"./exports/patch.mjs\");\n await vxrnPatch({\n root: process.cwd()\n });\n }\n});\nvar clean = defineCommand({\n meta: {\n name: \"clean\",\n version: \"0.0.0\",\n description: \"Clean build folders\"\n },\n args: {},\n async run() {\n var { clean: vxrnClean } = await importCLIEndpoint(\"./exports/clean.mjs\");\n await vxrnClean({\n root: process.cwd()\n });\n }\n});\nvar main = defineCommand({\n meta: {\n name: \"main\",\n version: \"0.0.0\",\n description: \"Welcome to vxrn\"\n },\n subCommands: {\n dev,\n build,\n serve,\n prebuild,\n runIos,\n runAndroid,\n clean,\n patch\n }\n});\nrunMain(main);\n//# sourceMappingURL=cli.js.map\n"],"mappings":";;;AACA,eAAe,kBAAkB,MAAM;CACrC,OAAO,MAAM,OAAO;AACtB;AACA,SAAS,UAAU,KAAK;CACtB,IAAI,MAAM,QAAQ,GAAG,GAAG;EACtB,OAAO,IAAI,IAAI,SAAS;CAC1B;CACA,OAAO;AACT;AACA,IAAI,OAAO,YAAY,YAAY,UAAU;CAC3C,QAAQ,MAAM,6EAA6E;CAC3F,QAAQ,KAAK,CAAC;AAChB;AACA,IAAI,MAAM,cAAc;CACtB,MAAM;EACJ,MAAM;EACN,SAAS;EACT,aAAa;CACf;CACA,MAAM;EACJ,OAAO,EACL,MAAM,UACR;EACA,MAAM,EACJ,MAAM,SACR;EACA,MAAM,EACJ,MAAM,SACR;EACA,gBAAgB;GACd,MAAM;GACN,aAAa;EACf;CACF;CACA,MAAM,IAAI,OAAO;EACf,IAAI,EAAE,SAAS;EACf,IAAI,EAAE,KAAK,SAAS,MAAM,kBAAkB,mBAAmB;EAC/D,IAAI,OAAO,UAAU,KAAK,IAAI;EAC9B,IAAI,OAAO,UAAU,KAAK,IAAI;EAC9B,IAAI,EAAE,OAAO,SAAS,MAAM,KAAK;GAC/B,OAAO,KAAK;GACZ,MAAM,QAAQ,IAAI;GAClB,aAAa,UAAU,KAAK,eAAe,KAAK;GAChD,QAAQ;IACN;IACA,MAAM,OAAO,CAAC,OAAO,KAAK;GAC5B;EACF,CAAC;EACD,IAAI,EAAE,iBAAiB,MAAM,MAAM;EACnC,QAAQ,GAAG,cAAc,WAAW;GAClC,KAAK;EACP,CAAC;EACD,QAAQ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,KACF,CAAC;CACH;AACF,CAAC;AACD,IAAI,aAAa,cAAc;CAC7B,MAAM;EACJ,MAAM;EACN,SAAS;CACX;CACA,MAAM,CAAC;CACP,MAAM,MAAM;EACV,IAAI,EAAE,YAAY,gBAAgB,MAAM,kBAAkB,0BAA0B;EACpF,IAAI,OAAO,QAAQ,IAAI;EACvB,MAAM,YAAY,EAChB,KACF,CAAC;CACH;AACF,CAAC;AACD,IAAI,QAAQ,cAAc;CACxB,MAAM;EACJ,MAAM;EACN,SAAS;EACT,aAAa;CACf;CACA,MAAM,CAAC;CACP,MAAM,MAAM;EACV,IAAI,EAAE,OAAO,cAAc,MAAM,kBAAkB,qBAAqB;EACxE,MAAM,UAAU,EACd,MAAM,QAAQ,IAAI,EACpB,CAAC;CACH;AACF,CAAC;AACD,IAAI,QAAQ,cAAc;CACxB,MAAM;EACJ,MAAM;EACN,SAAS;EACT,aAAa;CACf;CACA,MAAM,CAAC;CACP,MAAM,MAAM;EACV,IAAI,EAAE,OAAO,cAAc,MAAM,kBAAkB,qBAAqB;EACxE,MAAM,UAAU,EACd,MAAM,QAAQ,IAAI,EACpB,CAAC;CACH;AACF,CAAC;AACD,IAAI,OAAO,cAAc;CACvB,MAAM;EACJ,MAAM;EACN,SAAS;EACT,aAAa;CACf;CACA,aAAa;EACX;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;AACF,CAAC;AACD,QAAQ,IAAI"}
|
|
1
|
+
{"version":3,"file":"cli.native.js","names":[],"sources":["cli.native.js"],"sourcesContent":["import { defineCommand, runMain } from \"citty\";\nasync function importCLIEndpoint(path) {\n return await import(path);\n}\nfunction lastValue(arg) {\n if (Array.isArray(arg)) {\n return arg[arg.length - 1];\n }\n return arg;\n}\nif (typeof import.meta.dirname !== \"string\") {\n console.error(`One uses \"import.meta.dirname\", for Node this is version 20.11.0 or greater`);\n process.exit(1);\n}\nvar dev = defineCommand({\n meta: {\n name: \"dev\",\n version: \"0.0.0\",\n description: \"Start the dev server\"\n },\n args: {\n clean: {\n type: \"boolean\"\n },\n host: {\n type: \"string\"\n },\n port: {\n type: \"string\"\n },\n \"debug-bundle\": {\n type: \"string\",\n description: `Will output the bundle to a temp file and then serve it from there afterwards allowing you to easily edit the bundle to debug problems. Can pass path or empty path for a random directory.`\n }\n },\n async run(param) {\n var { args } = param;\n var { dev: dev2 } = await importCLIEndpoint(\"./exports/dev.mjs\");\n var port = lastValue(args.port);\n var host = lastValue(args.host);\n var { start, stop } = await dev2({\n clean: args.clean,\n root: process.cwd(),\n debugBundle: lastValue(args[\"debug-bundle\"]) || \"\",\n server: {\n host,\n port: port ? +port : void 0\n }\n });\n var { closePromise } = await start();\n process.on(\"beforeExit\", function() {\n stop();\n });\n process.on(\"SIGINT\", function() {\n try {\n stop();\n } finally {\n process.exit(2);\n }\n });\n process.on(\"uncaughtException\", function(err) {\n console.error((err === null || err === void 0 ? void 0 : err.message) || err);\n });\n await closePromise;\n }\n});\nvar build = defineCommand({\n meta: {\n name: \"build\",\n version: \"0.0.0\",\n description: \"Build your app\"\n },\n args: {\n step: {\n type: \"string\",\n required: false\n },\n // limit the pages built\n only: {\n type: \"string\",\n required: false\n },\n analyze: {\n type: \"boolean\",\n required: false\n },\n platform: {\n type: \"string\",\n description: `One of: web, ios, android`,\n default: \"web\",\n required: false\n }\n },\n async run(param) {\n var { args } = param;\n var { build: build2 } = await importCLIEndpoint(\"./exports/build.mjs\");\n process.on(\"uncaughtException\", function(err) {\n console.error((err === null || err === void 0 ? void 0 : err.message) || err);\n });\n var platforms = {\n ios: \"ios\",\n web: \"web\",\n android: \"android\"\n };\n if (args.platform && !platforms[args.platform]) {\n throw new Error(`Invalid platform: ${args.platform}`);\n }\n var platform = platforms[args.platform] || \"web\";\n var results = await build2({}, {\n analyze: args.analyze,\n only: args.only,\n step: args.step,\n platform\n });\n if (process.env.DEBUG) {\n console.info(\"results\", results);\n }\n }\n});\nvar serve = defineCommand({\n meta: {\n name: \"serve\",\n version: \"0.0.0\",\n description: \"Serve a built app for production\"\n },\n args: {\n host: {\n type: \"string\"\n },\n port: {\n type: \"string\"\n }\n },\n async run(param) {\n var { args } = param;\n var { serve: serve2 } = await importCLIEndpoint(\"./exports/serve.mjs\");\n process.on(\"uncaughtException\", function(err) {\n console.error((err === null || err === void 0 ? void 0 : err.message) || err);\n });\n var port = lastValue(args.port);\n var host = lastValue(args.host);\n var results = await serve2({\n port: port ? +port : void 0,\n host\n });\n if (process.env.DEBUG) {\n console.info(\"results\", results);\n }\n }\n});\nvar prebuild = defineCommand({\n meta: {\n name: \"prebuild\",\n version: \"0.0.0\",\n description: \"Prebuild native project\"\n },\n args: {\n platform: {\n type: \"string\",\n description: \"ios or android\"\n },\n \"app-name\": {\n type: \"string\",\n description: \"native target and AppRegistry key\"\n },\n \"display-name\": {\n type: \"string\",\n description: \"user-visible app name\"\n },\n \"bundle-id\": {\n type: \"string\",\n description: \"ios bundle id (reverse-dns)\"\n },\n \"application-id\": {\n type: \"string\",\n description: \"android application id (reverse-dns)\"\n },\n \"no-install\": {\n type: \"boolean\",\n description: \"skip installing native dependencies\",\n default: false\n }\n },\n async run(param) {\n var { args } = param;\n if (args.install === false) args[\"no-install\"] = true;\n var { prebuild: prebuild2 } = await importCLIEndpoint(\"./exports/prebuild.mjs\");\n var root = process.cwd();\n var { platform } = args;\n await prebuild2({\n root,\n platform,\n \"no-install\": args[\"no-install\"],\n app: {\n name: args[\"app-name\"],\n displayName: args[\"display-name\"],\n ios: args[\"bundle-id\"] ? {\n bundleId: args[\"bundle-id\"]\n } : void 0,\n android: args[\"application-id\"] ? {\n applicationId: args[\"application-id\"]\n } : void 0\n }\n });\n }\n});\nvar runIos = defineCommand({\n meta: {\n name: \"run:ios\",\n version: \"0.0.0\"\n },\n args: {},\n async run() {\n var { runIos: runIos2 } = await importCLIEndpoint(\"./exports/runIos.mjs\");\n var root = process.cwd();\n await runIos2({\n root\n });\n }\n});\nvar runAndroid = defineCommand({\n meta: {\n name: \"run:android\",\n version: \"0.0.0\"\n },\n args: {},\n async run() {\n var { runAndroid: runAndroid2 } = await importCLIEndpoint(\"./exports/runAndroid.mjs\");\n var root = process.cwd();\n await runAndroid2({\n root\n });\n }\n});\nvar patch = defineCommand({\n meta: {\n name: \"patch\",\n version: \"0.0.0\",\n description: \"Apply package patches\"\n },\n args: {},\n async run() {\n var { patch: vxrnPatch } = await importCLIEndpoint(\"./exports/patch.mjs\");\n await vxrnPatch({\n root: process.cwd()\n });\n }\n});\nvar clean = defineCommand({\n meta: {\n name: \"clean\",\n version: \"0.0.0\",\n description: \"Clean build folders\"\n },\n args: {},\n async run() {\n var { clean: vxrnClean } = await importCLIEndpoint(\"./exports/clean.mjs\");\n await vxrnClean({\n root: process.cwd()\n });\n }\n});\nvar main = defineCommand({\n meta: {\n name: \"main\",\n version: \"0.0.0\",\n description: \"Welcome to vxrn\"\n },\n subCommands: {\n dev,\n build,\n serve,\n prebuild,\n runIos,\n runAndroid,\n clean,\n patch\n }\n});\nrunMain(main);\n//# sourceMappingURL=cli.js.map\n"],"mappings":";;;AACA,eAAe,kBAAkB,MAAM;CACrC,OAAO,MAAM,OAAO;AACtB;AACA,SAAS,UAAU,KAAK;CACtB,IAAI,MAAM,QAAQ,GAAG,GAAG;EACtB,OAAO,IAAI,IAAI,SAAS;CAC1B;CACA,OAAO;AACT;AACA,IAAI,OAAO,YAAY,YAAY,UAAU;CAC3C,QAAQ,MAAM,6EAA6E;CAC3F,QAAQ,KAAK,CAAC;AAChB;AACA,IAAI,MAAM,cAAc;CACtB,MAAM;EACJ,MAAM;EACN,SAAS;EACT,aAAa;CACf;CACA,MAAM;EACJ,OAAO,EACL,MAAM,UACR;EACA,MAAM,EACJ,MAAM,SACR;EACA,MAAM,EACJ,MAAM,SACR;EACA,gBAAgB;GACd,MAAM;GACN,aAAa;EACf;CACF;CACA,MAAM,IAAI,OAAO;EACf,IAAI,EAAE,SAAS;EACf,IAAI,EAAE,KAAK,SAAS,MAAM,kBAAkB,mBAAmB;EAC/D,IAAI,OAAO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AAM;EACV,IAAI,EAAE,OAAO,cAAc,MAAM,kBAAkB,qBAAqB;EACxE,MAAM,UAAU,EACd,MAAM,QAAQ,IAAI,EACpB,CAAC;CACH;AACF,CAAC;AACD,IAAI,OAAO,cAAc;CACvB,MAAM;EACJ,MAAM;EACN,SAAS;EACT,aAAa;CACf;CACA,aAAa;EACX;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;AACF,CAAC;AACD,QAAQ,IAAI"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaults.js","names":[],"sources":["constants/defaults.js"],"sourcesContent":["const DEFAULT_ASSET_EXTS = [\n // Image formats\n \"bmp\",\n \"gif\",\n \"jpg\",\n \"jpeg\",\n \"png\",\n \"psd\",\n \"svg\",\n \"webp\",\n // Video formats\n \"m4v\",\n \"mov\",\n \"mp4\",\n \"mpeg\",\n \"mpg\",\n \"webm\",\n // Audio formats\n \"aac\",\n \"aiff\",\n \"caf\",\n \"m4a\",\n \"mp3\",\n \"wav\",\n // Document formats\n \"html\",\n \"pdf\",\n \"yaml\",\n \"yml\",\n // Font formats\n \"otf\",\n \"ttf\",\n // Archives (virtual files)\n \"zip\"\n];\nexport {\n DEFAULT_ASSET_EXTS\n};\n//# sourceMappingURL=defaults.js.map\n"],"mappings":";AAAA,MAAM,qBAAqB;CAEzB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAEA;CACA;CACA;CACA;CACA;CACA;CAEA;CACA;CACA;CACA;CACA;CACA;CAEA;CACA;CACA;CACA;CAEA;CACA;CAEA;AACF"}
|
|
1
|
+
{"version":3,"file":"defaults.js","names":[],"sources":["constants/defaults.js"],"sourcesContent":["const DEFAULT_ASSET_EXTS = [\n // Image formats\n \"bmp\",\n \"gif\",\n \"jpg\",\n \"jpeg\",\n \"png\",\n \"psd\",\n \"svg\",\n \"webp\",\n // Video formats\n \"m4v\",\n \"mov\",\n \"mp4\",\n \"mpeg\",\n \"mpg\",\n \"webm\",\n // Audio formats\n \"aac\",\n \"aiff\",\n \"caf\",\n \"m4a\",\n \"mp3\",\n \"wav\",\n // Document formats\n \"html\",\n \"pdf\",\n \"txt\",\n \"yaml\",\n \"yml\",\n // Font formats\n \"otf\",\n \"ttf\",\n // Archives (virtual files)\n \"zip\"\n];\nexport {\n DEFAULT_ASSET_EXTS\n};\n//# sourceMappingURL=defaults.js.map\n"],"mappings":";AAAA,MAAM,qBAAqB;CAEzB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAEA;CACA;CACA;CACA;CACA;CACA;CAEA;CACA;CACA;CACA;CACA;CACA;CAEA;CACA;CACA;CACA;CACA;CAEA;CACA;CAEA;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaults.native.js","names":[],"sources":["constants/defaults.native.js"],"sourcesContent":["var DEFAULT_ASSET_EXTS = [\n // Image formats\n \"bmp\",\n \"gif\",\n \"jpg\",\n \"jpeg\",\n \"png\",\n \"psd\",\n \"svg\",\n \"webp\",\n // Video formats\n \"m4v\",\n \"mov\",\n \"mp4\",\n \"mpeg\",\n \"mpg\",\n \"webm\",\n // Audio formats\n \"aac\",\n \"aiff\",\n \"caf\",\n \"m4a\",\n \"mp3\",\n \"wav\",\n // Document formats\n \"html\",\n \"pdf\",\n \"yaml\",\n \"yml\",\n // Font formats\n \"otf\",\n \"ttf\",\n // Archives (virtual files)\n \"zip\"\n];\nexport {\n DEFAULT_ASSET_EXTS\n};\n//# sourceMappingURL=defaults.js.map\n"],"mappings":";AAAA,IAAI,qBAAqB;CAEvB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAEA;CACA;CACA;CACA;CACA;CACA;CAEA;CACA;CACA;CACA;CACA;CACA;CAEA;CACA;CACA;CACA;CAEA;CACA;CAEA;AACF"}
|
|
1
|
+
{"version":3,"file":"defaults.native.js","names":[],"sources":["constants/defaults.native.js"],"sourcesContent":["var DEFAULT_ASSET_EXTS = [\n // Image formats\n \"bmp\",\n \"gif\",\n \"jpg\",\n \"jpeg\",\n \"png\",\n \"psd\",\n \"svg\",\n \"webp\",\n // Video formats\n \"m4v\",\n \"mov\",\n \"mp4\",\n \"mpeg\",\n \"mpg\",\n \"webm\",\n // Audio formats\n \"aac\",\n \"aiff\",\n \"caf\",\n \"m4a\",\n \"mp3\",\n \"wav\",\n // Document formats\n \"html\",\n \"pdf\",\n \"txt\",\n \"yaml\",\n \"yml\",\n // Font formats\n \"otf\",\n \"ttf\",\n // Archives (virtual files)\n \"zip\"\n];\nexport {\n DEFAULT_ASSET_EXTS\n};\n//# sourceMappingURL=defaults.js.map\n"],"mappings":";AAAA,IAAI,qBAAqB;CAEvB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAEA;CACA;CACA;CACA;CACA;CACA;CAEA;CACA;CACA;CACA;CACA;CACA;CAEA;CACA;CACA;CACA;CACA;CAEA;CACA;CAEA;AACF"}
|
|
@@ -2,76 +2,54 @@ import { resolvePath } from "@vxrn/resolve";
|
|
|
2
2
|
import { detectPackageManager } from "@vxrn/utils";
|
|
3
3
|
import FSExtra from "fs-extra";
|
|
4
4
|
import path from "node:path";
|
|
5
|
-
import { pathToFileURL } from "node:url";
|
|
6
5
|
import colors from "picocolors";
|
|
7
6
|
import { fillOptions } from "../config/getOptionsFilled.mjs";
|
|
8
7
|
import { applyBuiltInPatches } from "../utils/patches.mjs";
|
|
9
|
-
import { generateForPlatform } from "./prebuildWithoutExpo.mjs";
|
|
8
|
+
import { generateForPlatform, getNativeDependencyInventory, installNativeDependencies, validatePrebuildApp } from "./prebuildWithoutExpo.mjs";
|
|
10
9
|
|
|
11
|
-
const prebuild = async ({ root, platform, "no-install": noInstall = false,
|
|
10
|
+
const prebuild = async ({ root, platform, "no-install": noInstall = false, app }) => {
|
|
11
|
+
validatePrebuildApp(app, platform);
|
|
12
12
|
const options = await fillOptions({ root });
|
|
13
13
|
await applyBuiltInPatches(options);
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
RCT_USE_RN_DEP: process.env.RCT_USE_RN_DEP
|
|
27
|
-
} : null;
|
|
28
|
-
if (useRolldownIOS) {
|
|
29
|
-
process.env.EXPO_USE_PRECOMPILED_MODULES = "0";
|
|
30
|
-
process.env.RCT_HERMES_V1_ENABLED = "1";
|
|
31
|
-
process.env.RCT_USE_PREBUILT_RNCORE = "0";
|
|
32
|
-
process.env.RCT_USE_RN_DEP = "0";
|
|
33
|
-
}
|
|
34
|
-
try {
|
|
35
|
-
await expoPrebuild([
|
|
36
|
-
...platform ? ["--platform", platform] : [],
|
|
37
|
-
...noInstall ? ["--no-install"] : [],
|
|
38
|
-
"--skip-dependency-update",
|
|
39
|
-
"react,react-native,expo"
|
|
40
|
-
]);
|
|
41
|
-
} finally {
|
|
42
|
-
if (previousNativeBuildEnvironment) {
|
|
43
|
-
for (const [name, value] of Object.entries(previousNativeBuildEnvironment)) {
|
|
44
|
-
if (value === void 0) delete process.env[name];
|
|
45
|
-
else process.env[name] = value;
|
|
46
|
-
}
|
|
14
|
+
try {
|
|
15
|
+
const packageJsonPath = path.join(root, "package.json");
|
|
16
|
+
const packageJsonContents = await FSExtra.readFile(packageJsonPath, "utf8");
|
|
17
|
+
const { devDependencies } = JSON.parse(packageJsonContents);
|
|
18
|
+
if (!devDependencies?.["@react-native-community/template"]) {
|
|
19
|
+
const installCommand = await (async () => {
|
|
20
|
+
const found = await detectPackageManager();
|
|
21
|
+
switch (true) {
|
|
22
|
+
case found.bun: return `bun add -D @react-native-community/template`;
|
|
23
|
+
case found.pnpm: return `pnpm install -D @react-native-community/template`;
|
|
24
|
+
case found.yarn: return `yarn add -D @react-native-community/template`;
|
|
25
|
+
default: return `npm install -D @react-native-community/template`;
|
|
47
26
|
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
let packageJsonContents = await FSExtra.readFile(packageJsonPath, "utf8");
|
|
52
|
-
packageJsonContents = packageJsonContents.replace(/expo run:ios/g, "one run:ios");
|
|
53
|
-
packageJsonContents = packageJsonContents.replace(/expo run:android/g, "one run:android");
|
|
54
|
-
await FSExtra.writeFile(packageJsonPath, packageJsonContents, "utf8");
|
|
55
|
-
} catch (error) {
|
|
56
|
-
console.error("Error updating package.json", error);
|
|
57
|
-
}
|
|
58
|
-
try {
|
|
59
|
-
FSExtra.removeSync(path.join(root, "ios", ".xcode.env.local"));
|
|
60
|
-
} catch (e) {}
|
|
61
|
-
} catch (e) {
|
|
62
|
-
throw new Error(`Failed to prebuild native project: ${e}
|
|
63
|
-
Is "expo" listed in your dependencies?`);
|
|
64
|
-
}
|
|
65
|
-
if (!platform || platform === "ios") {
|
|
66
|
-
if (!isMetro) {
|
|
67
|
-
ensureRolldownPodfileProperties(root);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
if (!platform || platform === "ios") {
|
|
71
|
-
validateSwift6Workaround(root);
|
|
27
|
+
})();
|
|
28
|
+
throw new Error(`"@react-native-community/template" is not found in package.json, please install "@react-native-community/template" as dev dependency:
|
|
29
|
+
\`${installCommand}\``);
|
|
72
30
|
}
|
|
73
|
-
|
|
74
|
-
|
|
31
|
+
} catch (error) {
|
|
32
|
+
throw new Error("package.json checks are failing:\n" + error);
|
|
33
|
+
}
|
|
34
|
+
if (platform == "ios" || !platform) {
|
|
35
|
+
await generateForPlatform(root, "ios", app);
|
|
36
|
+
}
|
|
37
|
+
if (platform == "android" || !platform) {
|
|
38
|
+
await generateForPlatform(root, "android", app);
|
|
39
|
+
}
|
|
40
|
+
const inventory = await getNativeDependencyInventory(root);
|
|
41
|
+
console.info(`[vxrn] native dependencies discovered through community autolinking: ${inventory.map((entry) => entry.name).join(", ") || "(none)"}`);
|
|
42
|
+
if (!noInstall) {
|
|
43
|
+
installNativeDependencies({
|
|
44
|
+
root,
|
|
45
|
+
platform
|
|
46
|
+
});
|
|
47
|
+
} else if (!platform || platform === "ios") {
|
|
48
|
+
console.info(`Run cd ios && pod install`);
|
|
49
|
+
console.info("Then run `open *.xcworkspace` in your terminal to open the prebuilt iOS project, then you can either run it via Xcode or archive it for distribution.");
|
|
50
|
+
}
|
|
51
|
+
if (!platform || platform === "ios") {
|
|
52
|
+
console.info(`
|
|
75
53
|
iOS:
|
|
76
54
|
|
|
77
55
|
Run \`open ios/*.xcworkspace\` in your terminal to open the prebuilt iOS project.
|
|
@@ -81,54 +59,6 @@ iOS:
|
|
|
81
59
|
|
|
82
60
|
---
|
|
83
61
|
`);
|
|
84
|
-
}
|
|
85
|
-
} else {
|
|
86
|
-
try {
|
|
87
|
-
const packageJsonPath = path.join(root, "package.json");
|
|
88
|
-
let packageJsonContents = await FSExtra.readFile(packageJsonPath, "utf8");
|
|
89
|
-
let { devDependencies } = JSON.parse(packageJsonContents);
|
|
90
|
-
if (!devDependencies["@react-native-community/template"]) {
|
|
91
|
-
const installCommand = await (async () => {
|
|
92
|
-
const found = await detectPackageManager();
|
|
93
|
-
switch (true) {
|
|
94
|
-
case found.bun: return `bun add -D @react-native-community/template`;
|
|
95
|
-
case found.pnpm: return `pnpm install -D @react-native-community/template`;
|
|
96
|
-
case found.yarn: return `yarn add -D @react-native-community/template`;
|
|
97
|
-
default: return `npm install -D @react-native-community/template`;
|
|
98
|
-
}
|
|
99
|
-
})();
|
|
100
|
-
throw new Error(`"@react-native-community/template" is not found in package.json, please install "@react-native-community/template" as dev dependency:
|
|
101
|
-
\`${installCommand}\``);
|
|
102
|
-
}
|
|
103
|
-
} catch (error) {
|
|
104
|
-
throw new Error("package.json checks are failing:\n" + error);
|
|
105
|
-
}
|
|
106
|
-
let appConfig;
|
|
107
|
-
try {
|
|
108
|
-
const appConfigPath = path.resolve("app.json");
|
|
109
|
-
const appConfigContents = await FSExtra.readFile(appConfigPath, "utf8");
|
|
110
|
-
appConfig = JSON.parse(appConfigContents);
|
|
111
|
-
} catch (error) {
|
|
112
|
-
throw new Error("app.json checks are failing:\n" + error);
|
|
113
|
-
}
|
|
114
|
-
if (platform == "ios" || !platform) {
|
|
115
|
-
if (!doesIOSExist) {
|
|
116
|
-
await generateForPlatform(root, "ios", appConfig);
|
|
117
|
-
} else {
|
|
118
|
-
console.error("ios/ folder already exists");
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
if (platform == "android" || !platform) {
|
|
122
|
-
if (!doesAndroidExist) {
|
|
123
|
-
await generateForPlatform(root, "android", appConfig);
|
|
124
|
-
} else {
|
|
125
|
-
console.error("android/ folder already exists");
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
if (!platform || platform === "ios") {
|
|
129
|
-
console.info(`Run cd ios && pod install`);
|
|
130
|
-
console.info("Then run `open *.xcworkspace` in your terminal to open the prebuilt iOS project, then you can either run it via Xcode or archive it for distribution.");
|
|
131
|
-
}
|
|
132
62
|
}
|
|
133
63
|
if (!platform || platform === "android") {
|
|
134
64
|
console.info(`
|
|
@@ -151,37 +81,6 @@ Android:
|
|
|
151
81
|
}
|
|
152
82
|
}
|
|
153
83
|
};
|
|
154
|
-
function validateSwift6Workaround(root) {
|
|
155
|
-
const podfilePath = path.join(root, "ios", "Podfile");
|
|
156
|
-
if (!FSExtra.existsSync(podfilePath)) return;
|
|
157
|
-
const propsPath = path.join(root, "ios", "Podfile.properties.json");
|
|
158
|
-
if (FSExtra.existsSync(propsPath)) {
|
|
159
|
-
try {
|
|
160
|
-
const props = JSON.parse(FSExtra.readFileSync(propsPath, "utf8"));
|
|
161
|
-
if (props["one.disableSwift6Workaround"] === "true") return;
|
|
162
|
-
} catch {}
|
|
163
|
-
}
|
|
164
|
-
try {
|
|
165
|
-
const emcPkgPath = resolvePath("expo-modules-core/package.json", root);
|
|
166
|
-
const emcVersion = JSON.parse(FSExtra.readFileSync(emcPkgPath, "utf8")).version;
|
|
167
|
-
const major = Number.parseInt(emcVersion.match(/^(\d+)/)?.[1] || "0", 10);
|
|
168
|
-
if (major >= 56) return;
|
|
169
|
-
} catch {}
|
|
170
|
-
const podfile = FSExtra.readFileSync(podfilePath, "utf8");
|
|
171
|
-
if (!podfile.includes("SWIFT_STRICT_CONCURRENCY")) {
|
|
172
|
-
console.warn(colors.yellow(`
|
|
173
|
-
\u26A0\uFE0F Your ios/Podfile is missing the Swift 6 workaround for expo-modules-core.
|
|
174
|
-
Without this, your iOS build will fail with Swift concurrency errors.
|
|
175
|
-
|
|
176
|
-
Fix: add "vxrn/expo-plugin" to your app.json plugins and re-run prebuild.
|
|
177
|
-
|
|
178
|
-
To disable this check: set "one.disableSwift6Workaround": "true"
|
|
179
|
-
in ios/Podfile.properties.json.
|
|
180
|
-
|
|
181
|
-
See: expo/expo#43199
|
|
182
|
-
`));
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
84
|
function isMissingCliDependency(error) {
|
|
186
85
|
return error.code === "MODULE_NOT_FOUND" && /@react-native-community\/cli/.test(error.message);
|
|
187
86
|
}
|
|
@@ -196,37 +95,10 @@ ${colors.white(colors.bold(`
|
|
|
196
95
|
async function replaceInUTF8File(filePath, findThis, replaceWith) {
|
|
197
96
|
const fileContent = await FSExtra.readFile(filePath, "utf8");
|
|
198
97
|
const replacedFileContent = fileContent.replace(findThis, replaceWith);
|
|
199
|
-
if (
|
|
98
|
+
if (replacedFileContent !== fileContent) {
|
|
200
99
|
await FSExtra.writeFile(filePath, replacedFileContent, "utf8");
|
|
201
100
|
}
|
|
202
101
|
}
|
|
203
|
-
function ensureRolldownPodfileProperties(root) {
|
|
204
|
-
const propsPath = path.join(root, "ios", "Podfile.properties.json");
|
|
205
|
-
if (!FSExtra.existsSync(path.join(root, "ios"))) return;
|
|
206
|
-
let props = {};
|
|
207
|
-
if (FSExtra.existsSync(propsPath)) {
|
|
208
|
-
try {
|
|
209
|
-
props = JSON.parse(FSExtra.readFileSync(propsPath, "utf8"));
|
|
210
|
-
} catch {}
|
|
211
|
-
}
|
|
212
|
-
let changed = false;
|
|
213
|
-
if (props["expo.useHermesV1"] !== "true") {
|
|
214
|
-
props["expo.useHermesV1"] = "true";
|
|
215
|
-
changed = true;
|
|
216
|
-
}
|
|
217
|
-
if (props["ios.buildReactNativeFromSource"] !== "true") {
|
|
218
|
-
props["ios.buildReactNativeFromSource"] = "true";
|
|
219
|
-
changed = true;
|
|
220
|
-
}
|
|
221
|
-
if (props["EXPO_USE_PRECOMPILED_MODULES"] !== "false") {
|
|
222
|
-
props["EXPO_USE_PRECOMPILED_MODULES"] = "false";
|
|
223
|
-
changed = true;
|
|
224
|
-
}
|
|
225
|
-
if (changed) {
|
|
226
|
-
FSExtra.writeFileSync(propsPath, JSON.stringify(props, null, 2) + "\n", "utf8");
|
|
227
|
-
console.info(colors.cyan(`[vxrn] Updated ios/Podfile.properties.json for rolldown mode (hermes v1 + React Native and Expo modules from source)`));
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
102
|
|
|
231
103
|
export { prebuild, replaceInUTF8File };
|
|
232
104
|
//# sourceMappingURL=prebuild.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prebuild.js","names":[],"sources":["exports/prebuild.js"],"sourcesContent":["import { resolvePath } from \"@vxrn/resolve\";\nimport { detectPackageManager } from \"@vxrn/utils\";\nimport FSExtra from \"fs-extra\";\nimport path from \"node:path\";\nimport { pathToFileURL } from \"node:url\";\nimport colors from \"picocolors\";\nimport { fillOptions } from \"../config/getOptionsFilled\";\nimport { applyBuiltInPatches } from \"../utils/patches\";\nimport { generateForPlatform } from \"./prebuildWithoutExpo\";\nconst prebuild = async ({\n root,\n platform,\n \"no-install\": noInstall = false,\n expo = true\n}) => {\n const options = await fillOptions({ root });\n await applyBuiltInPatches(options);\n const doesIOSExist = FSExtra.existsSync(path.resolve(\"ios\"));\n const doesAndroidExist = FSExtra.existsSync(path.resolve(\"android\"));\n const isMetro = process.env.ONE_METRO_MODE || globalThis[\"__vxrnMetroOptions__\"] || globalThis[\"__vxrnPluginConfig__\"]?.native?.bundler === \"metro\";\n const useRolldownIOS = (!platform || platform === \"ios\") && !isMetro;\n if (expo) {\n try {\n const importPath = resolvePath(\"@expo/cli/build/src/prebuild/index.js\", root);\n const expoPrebuild = (await import(pathToFileURL(importPath).href)).default.expoPrebuild;\n const previousNativeBuildEnvironment = useRolldownIOS ? {\n EXPO_USE_PRECOMPILED_MODULES: process.env.EXPO_USE_PRECOMPILED_MODULES,\n RCT_HERMES_V1_ENABLED: process.env.RCT_HERMES_V1_ENABLED,\n RCT_USE_PREBUILT_RNCORE: process.env.RCT_USE_PREBUILT_RNCORE,\n RCT_USE_RN_DEP: process.env.RCT_USE_RN_DEP\n } : null;\n if (useRolldownIOS) {\n process.env.EXPO_USE_PRECOMPILED_MODULES = \"0\";\n process.env.RCT_HERMES_V1_ENABLED = \"1\";\n process.env.RCT_USE_PREBUILT_RNCORE = \"0\";\n process.env.RCT_USE_RN_DEP = \"0\";\n }\n try {\n await expoPrebuild([\n ...platform ? [\"--platform\", platform] : [],\n ...noInstall ? [\"--no-install\"] : [],\n \"--skip-dependency-update\",\n \"react,react-native,expo\"\n ]);\n } finally {\n if (previousNativeBuildEnvironment) {\n for (const [name, value] of Object.entries(previousNativeBuildEnvironment)) {\n if (value === void 0) delete process.env[name];\n else process.env[name] = value;\n }\n }\n }\n try {\n const packageJsonPath = path.join(root, \"package.json\");\n let packageJsonContents = await FSExtra.readFile(packageJsonPath, \"utf8\");\n packageJsonContents = packageJsonContents.replace(/expo run:ios/g, \"one run:ios\");\n packageJsonContents = packageJsonContents.replace(\n /expo run:android/g,\n \"one run:android\"\n );\n await FSExtra.writeFile(packageJsonPath, packageJsonContents, \"utf8\");\n } catch (error) {\n console.error(\"Error updating package.json\", error);\n }\n try {\n FSExtra.removeSync(path.join(root, \"ios\", \".xcode.env.local\"));\n } catch (e) {\n }\n } catch (e) {\n throw new Error(\n `Failed to prebuild native project: ${e}\nIs \"expo\" listed in your dependencies?`\n );\n }\n if (!platform || platform === \"ios\") {\n if (!isMetro) {\n ensureRolldownPodfileProperties(root);\n }\n }\n if (!platform || platform === \"ios\") {\n validateSwift6Workaround(root);\n }\n if (!platform || platform === \"ios\") {\n console.info(\n `\niOS:\n\n Run \\`open ios/*.xcworkspace\\` in your terminal to open the prebuilt iOS project.\n Then you can either run it via Xcode or archive it for distribution.\n\n See https://onestack.dev/docs/guides-ios-native for more information.\n\n---\n`\n );\n }\n } else {\n try {\n const packageJsonPath = path.join(root, \"package.json\");\n let packageJsonContents = await FSExtra.readFile(packageJsonPath, \"utf8\");\n let { devDependencies } = JSON.parse(packageJsonContents);\n if (!devDependencies[\"@react-native-community/template\"]) {\n const installCommand = await (async () => {\n const found = await detectPackageManager();\n switch (true) {\n case found.bun:\n return `bun add -D @react-native-community/template`;\n case found.pnpm:\n return `pnpm install -D @react-native-community/template`;\n case found.yarn:\n return `yarn add -D @react-native-community/template`;\n default:\n return `npm install -D @react-native-community/template`;\n }\n })();\n throw new Error(\n `\"@react-native-community/template\" is not found in package.json, please install \"@react-native-community/template\" as dev dependency:\n\\`${installCommand}\\``\n );\n }\n } catch (error) {\n throw new Error(\"package.json checks are failing:\\n\" + error);\n }\n let appConfig;\n try {\n const appConfigPath = path.resolve(\"app.json\");\n const appConfigContents = await FSExtra.readFile(appConfigPath, \"utf8\");\n appConfig = JSON.parse(appConfigContents);\n } catch (error) {\n throw new Error(\"app.json checks are failing:\\n\" + error);\n }\n if (platform == \"ios\" || !platform) {\n if (!doesIOSExist) {\n await generateForPlatform(root, \"ios\", appConfig);\n } else {\n console.error(\"ios/ folder already exists\");\n }\n }\n if (platform == \"android\" || !platform) {\n if (!doesAndroidExist) {\n await generateForPlatform(root, \"android\", appConfig);\n } else {\n console.error(\"android/ folder already exists\");\n }\n }\n if (!platform || platform === \"ios\") {\n console.info(`Run cd ios && pod install`);\n console.info(\n \"Then run `open *.xcworkspace` in your terminal to open the prebuilt iOS project, then you can either run it via Xcode or archive it for distribution.\"\n );\n }\n }\n if (!platform || platform === \"android\") {\n console.info(\n `\nAndroid:\n\n \\`cd android\\` and run \\`./gradlew generateCodegenArtifactsFromSchema\\`, then \\`./gradlew assembleRelease\\` or \\`./gradlew assembleDebug\\` to build the Android project.\n\n Afterwards, you can find the built APK at \\`android/app/build/outputs/apk/release/app-release.apk\\` or\n \\`android/app/build/outputs/apk/debug/app-debug.apk\\`.\n\n`\n );\n }\n try {\n resolvePath(\"@react-native-community/cli\", root);\n } catch (e) {\n if (isMissingCliDependency(e)) {\n warnMissingCliDependency();\n } else {\n throw e;\n }\n }\n};\nfunction validateSwift6Workaround(root) {\n const podfilePath = path.join(root, \"ios\", \"Podfile\");\n if (!FSExtra.existsSync(podfilePath)) return;\n const propsPath = path.join(root, \"ios\", \"Podfile.properties.json\");\n if (FSExtra.existsSync(propsPath)) {\n try {\n const props = JSON.parse(FSExtra.readFileSync(propsPath, \"utf8\"));\n if (props[\"one.disableSwift6Workaround\"] === \"true\") return;\n } catch {\n }\n }\n try {\n const emcPkgPath = resolvePath(\"expo-modules-core/package.json\", root);\n const emcVersion = JSON.parse(FSExtra.readFileSync(emcPkgPath, \"utf8\")).version;\n const major = Number.parseInt(emcVersion.match(/^(\\d+)/)?.[1] || \"0\", 10);\n if (major >= 56) return;\n } catch {\n }\n const podfile = FSExtra.readFileSync(podfilePath, \"utf8\");\n if (!podfile.includes(\"SWIFT_STRICT_CONCURRENCY\")) {\n console.warn(\n colors.yellow(`\n\\u26A0\\uFE0F Your ios/Podfile is missing the Swift 6 workaround for expo-modules-core.\n Without this, your iOS build will fail with Swift concurrency errors.\n\n Fix: add \"vxrn/expo-plugin\" to your app.json plugins and re-run prebuild.\n\n To disable this check: set \"one.disableSwift6Workaround\": \"true\"\n in ios/Podfile.properties.json.\n\n See: expo/expo#43199\n`)\n );\n }\n}\nfunction isMissingCliDependency(error) {\n return error.code === \"MODULE_NOT_FOUND\" && /@react-native-community\\/cli/.test(error.message);\n}\nfunction warnMissingCliDependency() {\n console.warn(`\n${colors.red(\"\\u26A0\")}\\uFE0F To build the app, ${colors.dim(\"react-native\")} depends on ${colors.dim(\"@react-native-community/cli\")} for cli commands. Please update your ${colors.dim(\"package.json\")} to include:\n${colors.white(\n colors.bold(`\n \"devDependencies\": {\n \"@react-native-community/cli\": \"latest\",\n }`)\n )}`);\n}\nasync function replaceInUTF8File(filePath, findThis, replaceWith) {\n const fileContent = await FSExtra.readFile(filePath, \"utf8\");\n const replacedFileContent = fileContent.replace(findThis, replaceWith);\n if (fileContent !== replacedFileContent) {\n await FSExtra.writeFile(filePath, replacedFileContent, \"utf8\");\n }\n}\nfunction ensureRolldownPodfileProperties(root) {\n const propsPath = path.join(root, \"ios\", \"Podfile.properties.json\");\n if (!FSExtra.existsSync(path.join(root, \"ios\"))) return;\n let props = {};\n if (FSExtra.existsSync(propsPath)) {\n try {\n props = JSON.parse(FSExtra.readFileSync(propsPath, \"utf8\"));\n } catch {\n }\n }\n let changed = false;\n if (props[\"expo.useHermesV1\"] !== \"true\") {\n props[\"expo.useHermesV1\"] = \"true\";\n changed = true;\n }\n if (props[\"ios.buildReactNativeFromSource\"] !== \"true\") {\n props[\"ios.buildReactNativeFromSource\"] = \"true\";\n changed = true;\n }\n if (props[\"EXPO_USE_PRECOMPILED_MODULES\"] !== \"false\") {\n props[\"EXPO_USE_PRECOMPILED_MODULES\"] = \"false\";\n changed = true;\n }\n if (changed) {\n FSExtra.writeFileSync(propsPath, JSON.stringify(props, null, 2) + \"\\n\", \"utf8\");\n console.info(\n colors.cyan(\n `[vxrn] Updated ios/Podfile.properties.json for rolldown mode (hermes v1 + React Native and Expo modules from source)`\n )\n );\n }\n}\nexport {\n prebuild,\n replaceInUTF8File\n};\n//# sourceMappingURL=prebuild.js.map\n"],"mappings":";;;;;;;;;;;AASA,MAAM,WAAW,OAAO,EACtB,MACA,UACA,cAAc,YAAY,OAC1B,OAAO,WACH;CACJ,MAAM,UAAU,MAAM,YAAY,EAAE,KAAK,CAAC;CAC1C,MAAM,oBAAoB,OAAO;CACjC,MAAM,eAAe,QAAQ,WAAW,KAAK,QAAQ,KAAK,CAAC;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":"prebuild.js","names":[],"sources":["exports/prebuild.js"],"sourcesContent":["import { resolvePath } from \"@vxrn/resolve\";\nimport { detectPackageManager } from \"@vxrn/utils\";\nimport FSExtra from \"fs-extra\";\nimport path from \"node:path\";\nimport colors from \"picocolors\";\nimport { fillOptions } from \"../config/getOptionsFilled\";\nimport { applyBuiltInPatches } from \"../utils/patches\";\nimport {\n generateForPlatform,\n getNativeDependencyInventory,\n installNativeDependencies,\n validatePrebuildApp\n} from \"./prebuildWithoutExpo\";\nconst prebuild = async ({\n root,\n platform,\n \"no-install\": noInstall = false,\n app\n}) => {\n validatePrebuildApp(app, platform);\n const options = await fillOptions({ root });\n await applyBuiltInPatches(options);\n try {\n const packageJsonPath = path.join(root, \"package.json\");\n const packageJsonContents = await FSExtra.readFile(packageJsonPath, \"utf8\");\n const { devDependencies } = JSON.parse(packageJsonContents);\n if (!devDependencies?.[\"@react-native-community/template\"]) {\n const installCommand = await (async () => {\n const found = await detectPackageManager();\n switch (true) {\n case found.bun:\n return `bun add -D @react-native-community/template`;\n case found.pnpm:\n return `pnpm install -D @react-native-community/template`;\n case found.yarn:\n return `yarn add -D @react-native-community/template`;\n default:\n return `npm install -D @react-native-community/template`;\n }\n })();\n throw new Error(\n `\"@react-native-community/template\" is not found in package.json, please install \"@react-native-community/template\" as dev dependency:\n\\`${installCommand}\\``\n );\n }\n } catch (error) {\n throw new Error(\"package.json checks are failing:\\n\" + error);\n }\n if (platform == \"ios\" || !platform) {\n await generateForPlatform(root, \"ios\", app);\n }\n if (platform == \"android\" || !platform) {\n await generateForPlatform(root, \"android\", app);\n }\n const inventory = await getNativeDependencyInventory(root);\n console.info(\n `[vxrn] native dependencies discovered through community autolinking: ${inventory.map((entry) => entry.name).join(\", \") || \"(none)\"}`\n );\n if (!noInstall) {\n installNativeDependencies({ root, platform });\n } else if (!platform || platform === \"ios\") {\n console.info(`Run cd ios && pod install`);\n console.info(\n \"Then run `open *.xcworkspace` in your terminal to open the prebuilt iOS project, then you can either run it via Xcode or archive it for distribution.\"\n );\n }\n if (!platform || platform === \"ios\") {\n console.info(\n `\niOS:\n\n Run \\`open ios/*.xcworkspace\\` in your terminal to open the prebuilt iOS project.\n Then you can either run it via Xcode or archive it for distribution.\n\n See https://onestack.dev/docs/guides-ios-native for more information.\n\n---\n`\n );\n }\n if (!platform || platform === \"android\") {\n console.info(\n `\nAndroid:\n\n \\`cd android\\` and run \\`./gradlew generateCodegenArtifactsFromSchema\\`, then \\`./gradlew assembleRelease\\` or \\`./gradlew assembleDebug\\` to build the Android project.\n\n Afterwards, you can find the built APK at \\`android/app/build/outputs/apk/release/app-release.apk\\` or\n \\`android/app/build/outputs/apk/debug/app-debug.apk\\`.\n\n`\n );\n }\n try {\n resolvePath(\"@react-native-community/cli\", root);\n } catch (e) {\n if (isMissingCliDependency(e)) {\n warnMissingCliDependency();\n } else {\n throw e;\n }\n }\n};\nfunction isMissingCliDependency(error) {\n return error.code === \"MODULE_NOT_FOUND\" && /@react-native-community\\/cli/.test(error.message);\n}\nfunction warnMissingCliDependency() {\n console.warn(`\n${colors.red(\"\\u26A0\")}\\uFE0F To build the app, ${colors.dim(\"react-native\")} depends on ${colors.dim(\"@react-native-community/cli\")} for cli commands. Please update your ${colors.dim(\"package.json\")} to include:\n${colors.white(\n colors.bold(`\n \"devDependencies\": {\n \"@react-native-community/cli\": \"latest\",\n }`)\n )}`);\n}\nasync function replaceInUTF8File(filePath, findThis, replaceWith) {\n const fileContent = await FSExtra.readFile(filePath, \"utf8\");\n const replacedFileContent = fileContent.replace(findThis, replaceWith);\n if (replacedFileContent !== fileContent) {\n await FSExtra.writeFile(filePath, replacedFileContent, \"utf8\");\n }\n}\nexport {\n prebuild,\n replaceInUTF8File\n};\n//# sourceMappingURL=prebuild.js.map\n"],"mappings":";;;;;;;;;;AAaA,MAAM,WAAW,OAAO,EACtB,MACA,UACA,cAAc,YAAY,OAC1B,UACI;CACJ,oBAAoB,KAAK,QAAQ;CACjC,MAAM,UAAU,MAAM,YAAY,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