@hot-updater/expo 0.19.5 → 0.19.7
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/index.cjs +30 -0
- package/dist/index.js +43 -13
- package/package.json +4 -3
package/dist/index.cjs
CHANGED
|
@@ -43,6 +43,7 @@ const node_fs = __toESM(require("node:fs"));
|
|
|
43
43
|
const node_stream_promises = __toESM(require("node:stream/promises"));
|
|
44
44
|
const node_stream = __toESM(require("node:stream"));
|
|
45
45
|
const node_buffer = __toESM(require("node:buffer"));
|
|
46
|
+
const __clack_prompts = __toESM(require("@clack/prompts"));
|
|
46
47
|
|
|
47
48
|
//#region ../../node_modules/.pnpm/is-plain-obj@4.1.0/node_modules/is-plain-obj/index.js
|
|
48
49
|
function isPlainObject(value) {
|
|
@@ -6488,6 +6489,32 @@ function resolveMain(cwd) {
|
|
|
6488
6489
|
}
|
|
6489
6490
|
}
|
|
6490
6491
|
|
|
6492
|
+
//#endregion
|
|
6493
|
+
//#region src/util/prebuild.ts
|
|
6494
|
+
/**
|
|
6495
|
+
* Run expo `prebuild` command
|
|
6496
|
+
*/
|
|
6497
|
+
const runExpoPrebuild = async ({ platform: platform$1 }) => {
|
|
6498
|
+
const spinner = __clack_prompts.spinner();
|
|
6499
|
+
try {
|
|
6500
|
+
spinner.start("Run expo prebuild");
|
|
6501
|
+
const args = [
|
|
6502
|
+
"expo",
|
|
6503
|
+
"prebuild",
|
|
6504
|
+
"--platform",
|
|
6505
|
+
platform$1,
|
|
6506
|
+
"--no-install"
|
|
6507
|
+
];
|
|
6508
|
+
spinner.stop("Expo prebuild done");
|
|
6509
|
+
await execa("npx", args);
|
|
6510
|
+
} catch (e) {
|
|
6511
|
+
spinner.stop("Expo prebuild failed");
|
|
6512
|
+
if (e instanceof ExecaError) __clack_prompts.log.error(e.stderr || e.stdout || e.message);
|
|
6513
|
+
else if (e instanceof Error) __clack_prompts.log.error(e.message);
|
|
6514
|
+
process.exit(1);
|
|
6515
|
+
}
|
|
6516
|
+
};
|
|
6517
|
+
|
|
6491
6518
|
//#endregion
|
|
6492
6519
|
//#region src/expo.ts
|
|
6493
6520
|
const isHermesEnabled = (cwd, platform$1) => {
|
|
@@ -6568,6 +6595,9 @@ const expo = (config = {
|
|
|
6568
6595
|
}) => ({ cwd }) => {
|
|
6569
6596
|
const { outDir = "dist", sourcemap = false } = config;
|
|
6570
6597
|
return {
|
|
6598
|
+
nativeBuild: { prebuild: async ({ platform: platform$1 }) => {
|
|
6599
|
+
await runExpoPrebuild({ platform: platform$1 });
|
|
6600
|
+
} },
|
|
6571
6601
|
build: async ({ platform: platform$1 }) => {
|
|
6572
6602
|
const buildPath = path.default.join(cwd, outDir);
|
|
6573
6603
|
await fs.default.promises.rm(buildPath, {
|
package/dist/index.js
CHANGED
|
@@ -20,6 +20,7 @@ import { appendFileSync, createReadStream, createWriteStream, readFileSync, stat
|
|
|
20
20
|
import { finished } from "node:stream/promises";
|
|
21
21
|
import { Duplex, PassThrough, Readable, Transform, Writable, getDefaultHighWaterMark } from "node:stream";
|
|
22
22
|
import { Buffer as Buffer$1 } from "node:buffer";
|
|
23
|
+
import * as p from "@clack/prompts";
|
|
23
24
|
|
|
24
25
|
//#region rolldown:runtime
|
|
25
26
|
var __create = Object.create;
|
|
@@ -858,8 +859,8 @@ var require_windows = __commonJS({ "../../node_modules/.pnpm/isexe@2.0.0/node_mo
|
|
|
858
859
|
pathext = pathext.split(";");
|
|
859
860
|
if (pathext.indexOf("") !== -1) return true;
|
|
860
861
|
for (var i$1 = 0; i$1 < pathext.length; i$1++) {
|
|
861
|
-
var p = pathext[i$1].toLowerCase();
|
|
862
|
-
if (p && path$6.substr(-p.length).toLowerCase() === p) return true;
|
|
862
|
+
var p$1 = pathext[i$1].toLowerCase();
|
|
863
|
+
if (p$1 && path$6.substr(-p$1.length).toLowerCase() === p$1) return true;
|
|
863
864
|
}
|
|
864
865
|
return false;
|
|
865
866
|
}
|
|
@@ -987,16 +988,16 @@ var require_which = __commonJS({ "../../node_modules/.pnpm/which@2.0.2/node_modu
|
|
|
987
988
|
const ppRaw = pathEnv[i$1];
|
|
988
989
|
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
989
990
|
const pCmd = path$5.join(pathPart, cmd);
|
|
990
|
-
const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
991
|
-
resolve(subStep(p, i$1, 0));
|
|
991
|
+
const p$1 = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
992
|
+
resolve(subStep(p$1, i$1, 0));
|
|
992
993
|
});
|
|
993
|
-
const subStep = (p, i$1, ii) => new Promise((resolve, reject) => {
|
|
994
|
+
const subStep = (p$1, i$1, ii) => new Promise((resolve, reject) => {
|
|
994
995
|
if (ii === pathExt.length) return resolve(step(i$1 + 1));
|
|
995
996
|
const ext = pathExt[ii];
|
|
996
|
-
isexe(p + ext, { pathExt: pathExtExe }, (er, is) => {
|
|
997
|
-
if (!er && is) if (opt.all) found.push(p + ext);
|
|
998
|
-
else return resolve(p + ext);
|
|
999
|
-
return resolve(subStep(p, i$1, ii + 1));
|
|
997
|
+
isexe(p$1 + ext, { pathExt: pathExtExe }, (er, is) => {
|
|
998
|
+
if (!er && is) if (opt.all) found.push(p$1 + ext);
|
|
999
|
+
else return resolve(p$1 + ext);
|
|
1000
|
+
return resolve(subStep(p$1, i$1, ii + 1));
|
|
1000
1001
|
});
|
|
1001
1002
|
});
|
|
1002
1003
|
return cb ? step(0).then((res) => cb(null, res), cb) : step(0);
|
|
@@ -1009,9 +1010,9 @@ var require_which = __commonJS({ "../../node_modules/.pnpm/which@2.0.2/node_modu
|
|
|
1009
1010
|
const ppRaw = pathEnv[i$1];
|
|
1010
1011
|
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
1011
1012
|
const pCmd = path$5.join(pathPart, cmd);
|
|
1012
|
-
const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
1013
|
+
const p$1 = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
1013
1014
|
for (let j = 0; j < pathExt.length; j++) {
|
|
1014
|
-
const cur = p + pathExt[j];
|
|
1015
|
+
const cur = p$1 + pathExt[j];
|
|
1015
1016
|
try {
|
|
1016
1017
|
const is = isexe.sync(cur, { pathExt: pathExtExe });
|
|
1017
1018
|
if (is) if (opt.all) found.push(cur);
|
|
@@ -5117,8 +5118,8 @@ var SignalExit = class extends SignalExitBase {
|
|
|
5117
5118
|
const listeners = this.#process.listeners(sig);
|
|
5118
5119
|
let { count: count$1 } = this.#emitter;
|
|
5119
5120
|
/* c8 ignore start */
|
|
5120
|
-
const p = process$3;
|
|
5121
|
-
if (typeof p.__signal_exit_emitter__ === "object" && typeof p.__signal_exit_emitter__.count === "number") count$1 += p.__signal_exit_emitter__.count;
|
|
5121
|
+
const p$1 = process$3;
|
|
5122
|
+
if (typeof p$1.__signal_exit_emitter__ === "object" && typeof p$1.__signal_exit_emitter__.count === "number") count$1 += p$1.__signal_exit_emitter__.count;
|
|
5122
5123
|
/* c8 ignore stop */
|
|
5123
5124
|
if (listeners.length === count$1) {
|
|
5124
5125
|
this.unload();
|
|
@@ -6492,6 +6493,32 @@ function resolveMain(cwd) {
|
|
|
6492
6493
|
}
|
|
6493
6494
|
}
|
|
6494
6495
|
|
|
6496
|
+
//#endregion
|
|
6497
|
+
//#region src/util/prebuild.ts
|
|
6498
|
+
/**
|
|
6499
|
+
* Run expo `prebuild` command
|
|
6500
|
+
*/
|
|
6501
|
+
const runExpoPrebuild = async ({ platform: platform$1 }) => {
|
|
6502
|
+
const spinner = p.spinner();
|
|
6503
|
+
try {
|
|
6504
|
+
spinner.start("Run expo prebuild");
|
|
6505
|
+
const args = [
|
|
6506
|
+
"expo",
|
|
6507
|
+
"prebuild",
|
|
6508
|
+
"--platform",
|
|
6509
|
+
platform$1,
|
|
6510
|
+
"--no-install"
|
|
6511
|
+
];
|
|
6512
|
+
spinner.stop("Expo prebuild done");
|
|
6513
|
+
await execa("npx", args);
|
|
6514
|
+
} catch (e) {
|
|
6515
|
+
spinner.stop("Expo prebuild failed");
|
|
6516
|
+
if (e instanceof ExecaError) p.log.error(e.stderr || e.stdout || e.message);
|
|
6517
|
+
else if (e instanceof Error) p.log.error(e.message);
|
|
6518
|
+
process.exit(1);
|
|
6519
|
+
}
|
|
6520
|
+
};
|
|
6521
|
+
|
|
6495
6522
|
//#endregion
|
|
6496
6523
|
//#region src/expo.ts
|
|
6497
6524
|
const isHermesEnabled = (cwd, platform$1) => {
|
|
@@ -6572,6 +6599,9 @@ const expo = (config = {
|
|
|
6572
6599
|
}) => ({ cwd }) => {
|
|
6573
6600
|
const { outDir = "dist", sourcemap = false } = config;
|
|
6574
6601
|
return {
|
|
6602
|
+
nativeBuild: { prebuild: async ({ platform: platform$1 }) => {
|
|
6603
|
+
await runExpoPrebuild({ platform: platform$1 });
|
|
6604
|
+
} },
|
|
6575
6605
|
build: async ({ platform: platform$1 }) => {
|
|
6576
6606
|
const buildPath = path.join(cwd, outDir);
|
|
6577
6607
|
await fs.promises.rm(buildPath, {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hot-updater/expo",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.19.
|
|
4
|
+
"version": "0.19.7",
|
|
5
5
|
"description": "React Native OTA solution for self-hosted",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
7
7
|
"module": "dist/index.js",
|
|
@@ -21,8 +21,9 @@
|
|
|
21
21
|
"package.json"
|
|
22
22
|
],
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@
|
|
25
|
-
"@hot-updater/
|
|
24
|
+
"@clack/prompts": "0.10.0",
|
|
25
|
+
"@hot-updater/bare": "0.19.7",
|
|
26
|
+
"@hot-updater/plugin-core": "0.19.7"
|
|
26
27
|
},
|
|
27
28
|
"devDependencies": {
|
|
28
29
|
"@types/node": "^22.8.7",
|