@better-update/cli 0.39.2 → 0.40.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.mjs +92 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -35,7 +35,7 @@ var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
|
35
35
|
|
|
36
36
|
//#endregion
|
|
37
37
|
//#region package.json
|
|
38
|
-
var version = "0.
|
|
38
|
+
var version = "0.40.2";
|
|
39
39
|
|
|
40
40
|
//#endregion
|
|
41
41
|
//#region src/lib/interactive-mode.ts
|
|
@@ -2402,6 +2402,8 @@ var Project = class extends Schema.Class("Project")({
|
|
|
2402
2402
|
slug: Schema.String,
|
|
2403
2403
|
createdAt: DateTimeString,
|
|
2404
2404
|
lastActivityAt: DateTimeString,
|
|
2405
|
+
/** ISO-8601 timestamp the project was archived (read-only); `null` when active. */
|
|
2406
|
+
archivedAt: Schema.NullOr(DateTimeString),
|
|
2405
2407
|
branchCount: Schema.Number,
|
|
2406
2408
|
channelCount: Schema.Number,
|
|
2407
2409
|
updateCount: Schema.Number
|
|
@@ -2411,7 +2413,8 @@ const ProjectSort = sortParam(ProjectSortColumn);
|
|
|
2411
2413
|
const ListProjectsParams = Schema.Struct({
|
|
2412
2414
|
...PaginationParams.fields,
|
|
2413
2415
|
query: Schema.optional(Schema.String),
|
|
2414
|
-
sort: Schema.optional(ProjectSort)
|
|
2416
|
+
sort: Schema.optional(ProjectSort),
|
|
2417
|
+
status: Schema.optional(Schema.Literal("active", "archived", "all"))
|
|
2415
2418
|
});
|
|
2416
2419
|
const CreateProjectBody = Schema.Struct({
|
|
2417
2420
|
name: Schema.String.pipe(Schema.minLength(1)),
|
|
@@ -2441,6 +2444,12 @@ var ProjectsGroup = class extends HttpApiGroup.make("projects").add(HttpApiEndpo
|
|
|
2441
2444
|
}))).add(HttpApiEndpoint.del("delete")`/api/projects/${idParam}`.addSuccess(DeleteProjectResult).annotateContext(OpenApi.annotations({
|
|
2442
2445
|
title: "Delete project",
|
|
2443
2446
|
description: "Delete a project and all its branches, channels, and updates"
|
|
2447
|
+
}))).add(HttpApiEndpoint.post("archive")`/api/projects/${idParam}/archive`.addSuccess(Project).annotateContext(OpenApi.annotations({
|
|
2448
|
+
title: "Archive project",
|
|
2449
|
+
description: "Archive a project: it is hidden from the default project list and becomes read-only (publishes, builds and other writes are blocked) until unarchived. OTA serving to existing devices is unaffected. Reversible."
|
|
2450
|
+
}))).add(HttpApiEndpoint.post("unarchive")`/api/projects/${idParam}/unarchive`.addSuccess(Project).annotateContext(OpenApi.annotations({
|
|
2451
|
+
title: "Unarchive project",
|
|
2452
|
+
description: "Restore an archived project to active, writable state"
|
|
2444
2453
|
}))).addError(NotFound).addError(Conflict).addError(Forbidden).annotateContext(OpenApi.annotations({
|
|
2445
2454
|
title: "Projects",
|
|
2446
2455
|
description: "Project management endpoints"
|
|
@@ -24774,6 +24783,7 @@ const runBuildWorkflow = (options) => Effect.scoped(Effect.gen(function* () {
|
|
|
24774
24783
|
BETTER_UPDATE_BUILD_PLATFORM: platform,
|
|
24775
24784
|
BETTER_UPDATE_BUILD_PROFILE: profile.name,
|
|
24776
24785
|
BETTER_UPDATE_BUILD_PROJECT_ID: projectId,
|
|
24786
|
+
EXPO_NO_GIT_STATUS: "1",
|
|
24777
24787
|
...compact({ BETTER_UPDATE_BUILD_GIT_COMMIT_HASH: rawGitContext.commit })
|
|
24778
24788
|
};
|
|
24779
24789
|
const { appMeta, runtimeVersion } = isExpo ? yield* resolveExpoBuildMeta({
|
|
@@ -33574,6 +33584,11 @@ const policiesCommand = defineCommand({
|
|
|
33574
33584
|
|
|
33575
33585
|
//#endregion
|
|
33576
33586
|
//#region src/commands/projects.ts
|
|
33587
|
+
const projectStatus = (archivedAt) => archivedAt === null ? "active" : "archived";
|
|
33588
|
+
const listStatus = (all, archived) => {
|
|
33589
|
+
if (all) return "all";
|
|
33590
|
+
if (archived) return "archived";
|
|
33591
|
+
};
|
|
33577
33592
|
const listCommand$1 = defineCommand({
|
|
33578
33593
|
meta: {
|
|
33579
33594
|
name: "list",
|
|
@@ -33589,6 +33604,14 @@ const listCommand$1 = defineCommand({
|
|
|
33589
33604
|
description: "Sort key: lastActivityAt (default) or name",
|
|
33590
33605
|
default: "lastActivityAt"
|
|
33591
33606
|
},
|
|
33607
|
+
archived: {
|
|
33608
|
+
type: "boolean",
|
|
33609
|
+
description: "List only archived projects"
|
|
33610
|
+
},
|
|
33611
|
+
all: {
|
|
33612
|
+
type: "boolean",
|
|
33613
|
+
description: "List both active and archived projects"
|
|
33614
|
+
},
|
|
33592
33615
|
limit: {
|
|
33593
33616
|
type: "string",
|
|
33594
33617
|
description: "Page size (default 50, max 100)",
|
|
@@ -33605,21 +33628,25 @@ const listCommand$1 = defineCommand({
|
|
|
33605
33628
|
const sort = args.sort === "name" ? "name" : "lastActivityAt";
|
|
33606
33629
|
const page = yield* parseLimit(args.page, 1);
|
|
33607
33630
|
const limit = yield* parseLimit(args.limit, 50);
|
|
33631
|
+
const status = listStatus(args.all, args.archived);
|
|
33608
33632
|
const result = yield* api.projects.list({ urlParams: {
|
|
33609
33633
|
page,
|
|
33610
33634
|
limit,
|
|
33611
33635
|
sort,
|
|
33612
|
-
...args.query ? { query: args.query } : {}
|
|
33636
|
+
...args.query ? { query: args.query } : {},
|
|
33637
|
+
...status ? { status } : {}
|
|
33613
33638
|
} });
|
|
33614
33639
|
yield* printList([
|
|
33615
33640
|
"ID",
|
|
33616
33641
|
"Name",
|
|
33617
33642
|
"Slug",
|
|
33643
|
+
"Status",
|
|
33618
33644
|
"Last activity"
|
|
33619
33645
|
], result.items.map((project) => [
|
|
33620
33646
|
project.id,
|
|
33621
33647
|
project.name,
|
|
33622
33648
|
project.slug,
|
|
33649
|
+
projectStatus(project.archivedAt),
|
|
33623
33650
|
project.lastActivityAt
|
|
33624
33651
|
]), "No projects found.");
|
|
33625
33652
|
yield* printHuman(`Page ${result.page} · ${result.items.length} of ${result.total} project(s)`);
|
|
@@ -33672,6 +33699,7 @@ const getCommand = defineCommand({
|
|
|
33672
33699
|
["ID", project.id],
|
|
33673
33700
|
["Name", project.name],
|
|
33674
33701
|
["Slug", project.slug],
|
|
33702
|
+
["Status", projectStatus(project.archivedAt)],
|
|
33675
33703
|
["Created", project.createdAt]
|
|
33676
33704
|
]);
|
|
33677
33705
|
return project;
|
|
@@ -33703,10 +33731,38 @@ const renameCommand = defineCommand({
|
|
|
33703
33731
|
return project;
|
|
33704
33732
|
}), { json: "value" })
|
|
33705
33733
|
});
|
|
33706
|
-
const
|
|
33734
|
+
const archiveCommand = defineCommand({
|
|
33707
33735
|
meta: {
|
|
33708
|
-
name: "
|
|
33709
|
-
description: "
|
|
33736
|
+
name: "archive",
|
|
33737
|
+
description: "Archive a project (hides it and makes it read-only until unarchived)"
|
|
33738
|
+
},
|
|
33739
|
+
args: {
|
|
33740
|
+
id: {
|
|
33741
|
+
type: "positional",
|
|
33742
|
+
required: true,
|
|
33743
|
+
description: "Project ID"
|
|
33744
|
+
},
|
|
33745
|
+
yes: {
|
|
33746
|
+
type: "boolean",
|
|
33747
|
+
description: "Skip confirmation prompt"
|
|
33748
|
+
}
|
|
33749
|
+
},
|
|
33750
|
+
run: async ({ args }) => runEffect(Effect.gen(function* () {
|
|
33751
|
+
if (!args.yes) {
|
|
33752
|
+
if (!(yield* promptConfirm(`Archive project ${args.id}? It becomes read-only (no publishes or builds) until unarchived.`, { initialValue: false }))) {
|
|
33753
|
+
yield* printHuman("Cancelled.");
|
|
33754
|
+
return;
|
|
33755
|
+
}
|
|
33756
|
+
}
|
|
33757
|
+
const project = yield* (yield* apiClient).projects.archive({ path: { id: args.id } });
|
|
33758
|
+
yield* printHuman(`Project ${project.name} archived. Unarchive with: projects unarchive ${project.id}`);
|
|
33759
|
+
return project;
|
|
33760
|
+
}), { json: "value" })
|
|
33761
|
+
});
|
|
33762
|
+
const unarchiveCommand = defineCommand({
|
|
33763
|
+
meta: {
|
|
33764
|
+
name: "unarchive",
|
|
33765
|
+
description: "Restore an archived project to active, writable state"
|
|
33710
33766
|
},
|
|
33711
33767
|
args: { id: {
|
|
33712
33768
|
type: "positional",
|
|
@@ -33714,6 +33770,34 @@ const deleteCommand$1 = defineCommand({
|
|
|
33714
33770
|
description: "Project ID"
|
|
33715
33771
|
} },
|
|
33716
33772
|
run: async ({ args }) => runEffect(Effect.gen(function* () {
|
|
33773
|
+
const project = yield* (yield* apiClient).projects.unarchive({ path: { id: args.id } });
|
|
33774
|
+
yield* printHuman(`Project ${project.name} unarchived. It is writable again.`);
|
|
33775
|
+
return project;
|
|
33776
|
+
}), { json: "value" })
|
|
33777
|
+
});
|
|
33778
|
+
const deleteCommand$1 = defineCommand({
|
|
33779
|
+
meta: {
|
|
33780
|
+
name: "delete",
|
|
33781
|
+
description: "Delete a project and all its branches, channels, and updates"
|
|
33782
|
+
},
|
|
33783
|
+
args: {
|
|
33784
|
+
id: {
|
|
33785
|
+
type: "positional",
|
|
33786
|
+
required: true,
|
|
33787
|
+
description: "Project ID"
|
|
33788
|
+
},
|
|
33789
|
+
yes: {
|
|
33790
|
+
type: "boolean",
|
|
33791
|
+
description: "Skip confirmation prompt"
|
|
33792
|
+
}
|
|
33793
|
+
},
|
|
33794
|
+
run: async ({ args }) => runEffect(Effect.gen(function* () {
|
|
33795
|
+
if (!args.yes) {
|
|
33796
|
+
if (!(yield* promptConfirm(`Delete project ${args.id}? This permanently removes all its branches, channels, and updates.`, { initialValue: false }))) {
|
|
33797
|
+
yield* printHuman("Cancelled.");
|
|
33798
|
+
return;
|
|
33799
|
+
}
|
|
33800
|
+
}
|
|
33717
33801
|
yield* (yield* apiClient).projects.delete({ path: { id: args.id } });
|
|
33718
33802
|
yield* printHuman(`Project ${args.id} deleted.`);
|
|
33719
33803
|
return {
|
|
@@ -33732,6 +33816,8 @@ const projectsCommand = defineCommand({
|
|
|
33732
33816
|
create: createCommand,
|
|
33733
33817
|
get: getCommand,
|
|
33734
33818
|
rename: renameCommand,
|
|
33819
|
+
archive: archiveCommand,
|
|
33820
|
+
unarchive: unarchiveCommand,
|
|
33735
33821
|
delete: deleteCommand$1
|
|
33736
33822
|
}
|
|
33737
33823
|
});
|