@better-update/cli 0.18.1 → 0.18.3
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.mjs +29 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
|
-
import { spawn, spawnSync } from "node:child_process";
|
|
3
|
+
import { execFile, spawn, spawnSync } from "node:child_process";
|
|
4
4
|
import { defineCommand, runMain } from "citty";
|
|
5
|
-
import { Console, Context, Data, Deferred, Duration, Effect, Layer, Match, Option, ParseResult, Schema } from "effect";
|
|
5
|
+
import { Console, Context, Data, Deferred, Duration, Effect, Layer, Match, Option, ParseResult, Schedule, Schema } from "effect";
|
|
6
6
|
import { Command, FetchHttpClient, FileSystem, HttpApi, HttpApiClient, HttpApiEndpoint, HttpApiGroup, HttpApiMiddleware, HttpApiSchema, HttpApiSecurity, HttpClient, HttpClientRequest, OpenApi, Path } from "@effect/platform";
|
|
7
7
|
import { NodeContext } from "@effect/platform-node";
|
|
8
8
|
import path, { join } from "node:path";
|
|
@@ -20,6 +20,7 @@ import chalk from "chalk";
|
|
|
20
20
|
import os from "node:os";
|
|
21
21
|
import plistMod from "@expo/plist";
|
|
22
22
|
import { ExpoRunFormatter } from "@expo/xcpretty";
|
|
23
|
+
import { promisify } from "node:util";
|
|
23
24
|
import ignore from "ignore";
|
|
24
25
|
import { Buffer as Buffer$1 } from "node:buffer";
|
|
25
26
|
import { getFormattedSerialNumber, getX509Certificate, parsePKCS12 } from "@expo/pkcs12";
|
|
@@ -31,7 +32,7 @@ var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
|
31
32
|
|
|
32
33
|
//#endregion
|
|
33
34
|
//#region package.json
|
|
34
|
-
var version = "0.18.
|
|
35
|
+
var version = "0.18.3";
|
|
35
36
|
|
|
36
37
|
//#endregion
|
|
37
38
|
//#region src/lib/interactive-mode.ts
|
|
@@ -1814,17 +1815,23 @@ const ConfigStoreLive = Layer.effect(ConfigStore, Effect.gen(function* () {
|
|
|
1814
1815
|
HttpApiClient.make(ManagementApi);
|
|
1815
1816
|
var ApiClientService = class extends Context.Tag("cli/ApiClient")() {};
|
|
1816
1817
|
const apiClient = Effect.flatMap(ApiClientService, ({ get }) => get);
|
|
1818
|
+
const RETRY_TRANSIENT_OPTIONS = {
|
|
1819
|
+
mode: "errors-only",
|
|
1820
|
+
times: 4,
|
|
1821
|
+
schedule: Schedule.exponential("500 millis", 2)
|
|
1822
|
+
};
|
|
1817
1823
|
const ApiClientLive = Layer.effect(ApiClientService, Effect.gen(function* () {
|
|
1818
1824
|
const clientService = yield* HttpClient.HttpClient;
|
|
1819
1825
|
const authStore = yield* AuthStore;
|
|
1820
1826
|
const configStore = yield* ConfigStore;
|
|
1827
|
+
const retryingClient = HttpClient.retryTransient(clientService, RETRY_TRANSIENT_OPTIONS);
|
|
1821
1828
|
return { get: Effect.gen(function* () {
|
|
1822
1829
|
const token = yield* authStore.getToken;
|
|
1823
1830
|
const baseUrl = yield* configStore.getBaseUrl;
|
|
1824
1831
|
return yield* HttpApiClient.make(ManagementApi, {
|
|
1825
1832
|
transformClient: HttpClient.mapRequest(HttpClientRequest.bearerToken(token)),
|
|
1826
1833
|
baseUrl
|
|
1827
|
-
}).pipe(Effect.provideService(HttpClient.HttpClient,
|
|
1834
|
+
}).pipe(Effect.provideService(HttpClient.HttpClient, retryingClient));
|
|
1828
1835
|
}) };
|
|
1829
1836
|
}));
|
|
1830
1837
|
|
|
@@ -6599,6 +6606,7 @@ const detectPlatform = (explicit, config) => Effect.gen(function* () {
|
|
|
6599
6606
|
|
|
6600
6607
|
//#endregion
|
|
6601
6608
|
//#region src/lib/project-staging.ts
|
|
6609
|
+
const execFileAsync = promisify(execFile);
|
|
6602
6610
|
const LOCKFILES = [
|
|
6603
6611
|
["bun.lock", "bun"],
|
|
6604
6612
|
["bun.lockb", "bun"],
|
|
@@ -6685,6 +6693,22 @@ const copyProjectTree = (params) => Effect.tryPromise({
|
|
|
6685
6693
|
},
|
|
6686
6694
|
catch: (cause) => new StagingError({ message: `Failed to copy project to staging dir: ${formatCause(cause)}` })
|
|
6687
6695
|
});
|
|
6696
|
+
/**
|
|
6697
|
+
* EAS stages projects via `git clone`, so `.git` is always present and prepare
|
|
6698
|
+
* scripts that shell out to git (lefthook install, husky install,
|
|
6699
|
+
* simple-git-hooks, etc.) succeed naturally. Our copy strips `.git` for size,
|
|
6700
|
+
* so we recreate a bare repo at the staging root before install runs. The
|
|
6701
|
+
* hooks installed here never fire because no one commits in the staging dir —
|
|
6702
|
+
* they exist only so `git rev-parse` succeeds during postinstall.
|
|
6703
|
+
*/
|
|
6704
|
+
const initGitRepo = (stagingRoot) => Effect.tryPromise({
|
|
6705
|
+
try: async () => execFileAsync("git", [
|
|
6706
|
+
"init",
|
|
6707
|
+
"-q",
|
|
6708
|
+
stagingRoot
|
|
6709
|
+
]),
|
|
6710
|
+
catch: (cause) => new StagingError({ message: `Failed to init git repo in staging dir: ${formatCause(cause)}` })
|
|
6711
|
+
}).pipe(Effect.asVoid);
|
|
6688
6712
|
const runInstall = (params) => runStep({
|
|
6689
6713
|
command: params.packageManager,
|
|
6690
6714
|
args: ["install"],
|
|
@@ -6709,6 +6733,7 @@ const prepareStagingProject = (input) => Effect.gen(function* () {
|
|
|
6709
6733
|
dest: stagingRoot,
|
|
6710
6734
|
ig: yield* buildIgnoreInstance(workspaceRoot)
|
|
6711
6735
|
});
|
|
6736
|
+
yield* initGitRepo(stagingRoot);
|
|
6712
6737
|
yield* runInstall({
|
|
6713
6738
|
stagingRoot,
|
|
6714
6739
|
packageManager,
|