liftbay 0.5.1 → 0.5.2
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.js +21 -7
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -28582,6 +28582,11 @@ function writeAppJson(data, cwd = process.cwd()) {
|
|
|
28582
28582
|
|
|
28583
28583
|
// src/prompts.ts
|
|
28584
28584
|
var import_picocolors3 = __toESM(require_picocolors(), 1);
|
|
28585
|
+
function fit(text2, reserve = 8) {
|
|
28586
|
+
const width = Math.max(20, (process.stdout.columns || 80) - reserve);
|
|
28587
|
+
const plain = text2.replace(/\x1b\[[0-9;]*m/g, "");
|
|
28588
|
+
return plain.length <= width ? text2 : `${plain.slice(0, width - 1)}\u2026`;
|
|
28589
|
+
}
|
|
28585
28590
|
var symbol2 = (state) => state === "submit" ? import_picocolors3.default.green("\u25C7") : state === "cancel" ? import_picocolors3.default.red("\u25A0") : state === "error" ? import_picocolors3.default.yellow("\u25B2") : import_picocolors3.default.cyan("\u25C6");
|
|
28586
28591
|
function checkboxes(opts) {
|
|
28587
28592
|
const required = opts.required ?? true;
|
|
@@ -28983,7 +28988,7 @@ async function status(lb, config, refresh = true) {
|
|
|
28983
28988
|
}
|
|
28984
28989
|
async function waitFor(lb, config, message, done) {
|
|
28985
28990
|
const spin = spinner();
|
|
28986
|
-
spin.start(
|
|
28991
|
+
spin.start(fit(message));
|
|
28987
28992
|
const until = Date.now() + WAIT_MINUTES * 6e4;
|
|
28988
28993
|
while (Date.now() < until) {
|
|
28989
28994
|
await sleep2(4e3);
|
|
@@ -28998,7 +29003,13 @@ async function waitFor(lb, config, message, done) {
|
|
|
28998
29003
|
}
|
|
28999
29004
|
async function waitForInstall(lb, config, attempt) {
|
|
29000
29005
|
const spin = spinner();
|
|
29001
|
-
spin.start(
|
|
29006
|
+
spin.start(fit("Waiting for the GitHub App to be installed"));
|
|
29007
|
+
const explain = (text2, spinnerText) => {
|
|
29008
|
+
spin.stop(import_picocolors6.default.dim("\u2026"));
|
|
29009
|
+
log.info(text2);
|
|
29010
|
+
spin.start(fit(spinnerText));
|
|
29011
|
+
};
|
|
29012
|
+
let noRepoAccessShown = false;
|
|
29002
29013
|
const until = Date.now() + WAIT_MINUTES * 6e4;
|
|
29003
29014
|
let last = "waiting";
|
|
29004
29015
|
while (Date.now() < until) {
|
|
@@ -29006,7 +29017,7 @@ async function waitForInstall(lb, config, attempt) {
|
|
|
29006
29017
|
const a2 = attempt ? (await lb.GET("/v1/orgs/{org}/github/install/{attempt}", { params: { path: { org: config.org, attempt } } })).data : void 0;
|
|
29007
29018
|
if (a2 && a2.status !== last) {
|
|
29008
29019
|
last = a2.status;
|
|
29009
|
-
if (a2.status === "needs_sign_in")
|
|
29020
|
+
if (a2.status === "needs_sign_in") explain("GitHub is done. Sign in to Liftbay in that browser to finish linking.", "Waiting for you to sign in to Liftbay in the browser");
|
|
29010
29021
|
else if (a2.status !== "waiting" && a2.status !== "connected") {
|
|
29011
29022
|
spin.error("GitHub didn't connect");
|
|
29012
29023
|
return { ok: false, message: a2.message };
|
|
@@ -29018,7 +29029,10 @@ async function waitForInstall(lb, config, attempt) {
|
|
|
29018
29029
|
return { ok: true, status: s };
|
|
29019
29030
|
}
|
|
29020
29031
|
if (a2?.status === "connected") {
|
|
29021
|
-
|
|
29032
|
+
if (!noRepoAccessShown) {
|
|
29033
|
+
noRepoAccessShown = true;
|
|
29034
|
+
explain(`Installed on ${s.repo.split("/")[0]}, but without access to ${s.repo}. On GitHub, Configure the app and select the repository.`, "Waiting for access to the repository");
|
|
29035
|
+
}
|
|
29022
29036
|
}
|
|
29023
29037
|
}
|
|
29024
29038
|
spin.error("Stopped waiting");
|
|
@@ -29544,7 +29558,7 @@ async function xcodeCloudConnect(opts) {
|
|
|
29544
29558
|
last = s.step;
|
|
29545
29559
|
if (!wait || s.step === "apple_key") fail(s.step === "apple_key" ? s.message : "Not connected yet. Run this again once the step above is done.");
|
|
29546
29560
|
const spin = spinner();
|
|
29547
|
-
spin.start("Waiting for that step (checking every 10 seconds
|
|
29561
|
+
spin.start(fit("Waiting for that step (checking every 10 seconds)"));
|
|
29548
29562
|
await sleep5(1e4);
|
|
29549
29563
|
spin.stop("Checking again");
|
|
29550
29564
|
}
|
|
@@ -30552,7 +30566,7 @@ async function publish(opts) {
|
|
|
30552
30566
|
let done = 0;
|
|
30553
30567
|
for (const m of prep.missing) {
|
|
30554
30568
|
const f = bySha.get(m.sha256);
|
|
30555
|
-
spin.message(`Uploading ${++done}/${prep.missing.length}: ${f.path}`);
|
|
30569
|
+
spin.message(fit(`Uploading ${++done}/${prep.missing.length}: ${f.path}`));
|
|
30556
30570
|
const res = await fetch(m.uploadUrl, { method: "PUT", body: readFileSync10(f.abs), headers: { "Content-Type": f.contentType } });
|
|
30557
30571
|
if (!res.ok) fail(`Upload failed for ${f.path} (${res.status})`);
|
|
30558
30572
|
}
|
|
@@ -30638,7 +30652,7 @@ async function channels() {
|
|
|
30638
30652
|
}
|
|
30639
30653
|
|
|
30640
30654
|
// src/index.ts
|
|
30641
|
-
var program2 = new Command("liftbay").description("Build, ship and update React Native apps").version("0.5.
|
|
30655
|
+
var program2 = new Command("liftbay").description("Build, ship and update React Native apps").version("0.5.2").option("--json", "print the result as JSON on stdout (progress goes to stderr; never prompts). Also LIFTBAY_JSON=1").hook("preAction", () => {
|
|
30642
30656
|
if (program2.opts().json || process.env.LIFTBAY_JSON === "1") enableJson();
|
|
30643
30657
|
});
|
|
30644
30658
|
var wrap = (fn) => async (...args) => {
|