Skip to content

Commit

Permalink
feat: migration message
Browse files Browse the repository at this point in the history
  • Loading branch information
gronxb committed Nov 29, 2024
1 parent 55bccae commit 21f76da
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 33 deletions.
4 changes: 2 additions & 2 deletions examples/v0.71.19/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ SPEC CHECKSUMS:
fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9
glog: 04b94705f318337d7ead9e6d17c019bd9b1f6b1b
hermes-engine: 1468b458e81705fcd55ed6e29c32ff069f04b69c
HotUpdater: f5170cc46c94aaf20483b5fc2b7081ff9a2dd15e
HotUpdater: d6750bfc8f250202c467ad5ee2a619f70829f10c
libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913
RCT-Folly: 424b8c9a7a0b9ab2886ffe9c3b041ef628fd4fb1
RCTRequired: 79b5f823c2b4b865451ba9ddb33c676786760ea8
Expand Down Expand Up @@ -516,4 +516,4 @@ SPEC CHECKSUMS:

PODFILE CHECKSUM: 8c66f8668f50d0d6f095a6437029b5db2e5f1365

COCOAPODS: 1.15.2
COCOAPODS: 1.16.2
6 changes: 3 additions & 3 deletions examples/v0.74.1/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ PODS:
- hermes-engine (0.74.1):
- hermes-engine/Pre-built (= 0.74.1)
- hermes-engine/Pre-built (0.74.1)
- HotUpdater (0.1.0):
- HotUpdater (0.1.4):
- DoubleConversion
- glog
- hermes-engine
Expand Down Expand Up @@ -1407,7 +1407,7 @@ SPEC CHECKSUMS:
fmt: 4c2741a687cc09f0634a2e2c72a838b99f1ff120
glog: c5d68082e772fa1c511173d6b30a9de2c05a69a2
hermes-engine: 16b8530de1b383cdada1476cf52d1b52f0692cbc
HotUpdater: f420d220b34d215bec9fa318b2e46244eebba09b
HotUpdater: 67695808eb4cc8583df165ba7332566a997c556e
JWTDecode: 2eed97c2fa46ccaf3049a787004eedf0be474a87
RCT-Folly: 02617c592a293bd6d418e0a88ff4ee1f88329b47
RCTDeprecation: efb313d8126259e9294dc4ee0002f44a6f676aba
Expand Down Expand Up @@ -1463,4 +1463,4 @@ SPEC CHECKSUMS:

PODFILE CHECKSUM: cc55395e59b150551f4a637b217582fe65682d08

COCOAPODS: 1.15.2
COCOAPODS: 1.16.2
2 changes: 1 addition & 1 deletion packages/console/src-server/rpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const bundleSchema = v.object({
enabled: v.boolean(),
file: v.string(),
hash: v.string(),
description: v.optional(v.string(), ""),
message: v.optional(v.string(), ""),
});

let config: Config | null = null;
Expand Down
4 changes: 2 additions & 2 deletions packages/console/src/routes/_components/columns.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ export const columns: ColumnDef<Bundle>[] = [
),
},
{
accessorKey: "description",
header: "Description",
accessorKey: "message",
header: "Message",
cell: (info) => info.getValue(),
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const EditBundleSheetForm = ({
}: EditBundleSheetFormProps) => {
const form = createForm(() => ({
defaultValues: {
description: bundle.description,
message: bundle.message,
targetVersion: bundle.targetVersion,
enabled: bundle.enabled,
forceUpdate: bundle.forceUpdate,
Expand Down Expand Up @@ -60,13 +60,13 @@ const EditBundleSheetForm = ({
>
<div>
<TextField class="grid w-full max-w-sm items-center gap-1.5">
<TextFieldLabel for="description">Description</TextFieldLabel>
<form.Field name="description">
<TextFieldLabel for="message">Message</TextFieldLabel>
<form.Field name="message">
{(field) => (
<TextFieldInput
type="text"
id="description"
placeholder="Description"
id="message"
placeholder="Message"
name={field().name}
value={field().state.value}
onBlur={field().handleBlur}
Expand Down
11 changes: 6 additions & 5 deletions packages/hot-updater/src/commands/deploy.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import fs from "node:fs/promises";
import { intro, spinner, text } from "@clack/prompts";
import { spinner } from "@clack/prompts";

import { createZip } from "@/utils/createZip";
import { getDefaultTargetVersion } from "@/utils/getDefaultTargetVersion";
import { getFileHashFromFile } from "@/utils/getFileHash";
import { getCwd, loadConfig } from "@hot-updater/plugin-core";
import { type Platform, filterTargetVersion } from "@hot-updater/utils";
import { getBranchName, getRecentCommitMessages } from "workspace-tools";

export interface DeployOptions {
targetVersion?: string;
Expand All @@ -22,11 +23,11 @@ export const deploy = async (options: DeployOptions) => {
console.error("No config found. Please run `hot-updater init` first.");
process.exit(1);
}
const cwd = getCwd();

intro("Please provide a description for the bundle.");
const description = await text({ message: "Description" });
const branch = getBranchName(cwd);
const message = branch ? getRecentCommitMessages(branch, cwd)[0] : void 0;

const cwd = getCwd();
const targetVersion =
options.targetVersion ??
(await getDefaultTargetVersion(cwd, options.platform));
Expand Down Expand Up @@ -81,7 +82,7 @@ export const deploy = async (options: DeployOptions) => {
platform: options.platform,
file,
hash,
description: String(description),
message,
targetVersion,
id: bundleId,
enabled: true,
Expand Down
2 changes: 1 addition & 1 deletion packages/react-native/src/checkForUpdate.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ describe("appVersion 1.0, bundleId null", async () => {
platform: "ios",
file: "20240722210327/build.zip",
hash: "a5cbf59a627759a88d472c502423ff55a4f6cd1aafeed3536f6a5f6e870c2290",
description: "",
message: "",
targetVersion: "1.0",
id: "20240722210327",
enabled: true,
Expand Down
24 changes: 12 additions & 12 deletions packages/utils/src/filterTargetVersion.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ describe("filterTargetVersion", () => {
platform: "android",
file: "/build.zip",
hash: "d0cc1d97b7a50645db1ad0e502c63ac52c1afe799550949a62c04fe0ae99a606",
description: "",
message: "",
targetVersion: "1.0",
id: "00000000-0000-0000-0000-000000000001",
enabled: true,
Expand All @@ -466,7 +466,7 @@ describe("filterTargetVersion", () => {
platform: "ios",
file: "/build.zip",
hash: "516490c4a042d487cda558986a9a162b75625f242cb2291ba3b915fae9a1b264",
description: "",
message: "",
targetVersion: "1.0",
id: "00000000-0000-0000-0000-000000000002",
enabled: true,
Expand All @@ -476,7 +476,7 @@ describe("filterTargetVersion", () => {
platform: "android",
file: "/build.zip",
hash: "f519fc7d303eede4c3c549622a5640a88700a3e58daf5df44b0b748971c77bb3",
description: "",
message: "",
targetVersion: "1.0",
id: "00000000-0000-0000-0000-000000000003",
enabled: true,
Expand All @@ -486,7 +486,7 @@ describe("filterTargetVersion", () => {
platform: "ios",
file: "/build.zip",
hash: "eea69b75925f9f9e266cf3ffce87effd1f00b9a09832d690ca145d64c92714e1",
description: "",
message: "",
targetVersion: "1.0",
id: "00000000-0000-0000-0000-000000000004",
enabled: true,
Expand All @@ -501,7 +501,7 @@ describe("filterTargetVersion", () => {
platform: "ios",
file: "/build.zip",
hash: "eea69b75925f9f9e266cf3ffce87effd1f00b9a09832d690ca145d64c92714e1",
description: "",
message: "",
targetVersion: "1.0",
id: "00000000-0000-0000-0000-000000000004",
enabled: true,
Expand All @@ -511,7 +511,7 @@ describe("filterTargetVersion", () => {
platform: "ios",
file: "/build.zip",
hash: "516490c4a042d487cda558986a9a162b75625f242cb2291ba3b915fae9a1b264",
description: "",
message: "",
targetVersion: "1.0",
id: "00000000-0000-0000-0000-000000000002",
enabled: true,
Expand All @@ -527,7 +527,7 @@ describe("filterTargetVersion", () => {
platform: "android",
file: "/build.zip",
hash: "d0cc1d97b7a50645db1ad0e502c63ac52c1afe799550949a62c04fe0ae99a606",
description: "",
message: "",
targetVersion: "1.0",
id: "00000000-0000-0000-0000-000000000001",
enabled: true,
Expand All @@ -537,7 +537,7 @@ describe("filterTargetVersion", () => {
platform: "ios",
file: "/build.zip",
hash: "516490c4a042d487cda558986a9a162b75625f242cb2291ba3b915fae9a1b264",
description: "",
message: "",
targetVersion: "1.0",
id: "00000000-0000-0000-0000-000000000002",
enabled: true,
Expand All @@ -547,7 +547,7 @@ describe("filterTargetVersion", () => {
platform: "android",
file: "/build.zip",
hash: "f519fc7d303eede4c3c549622a5640a88700a3e58daf5df44b0b748971c77bb3",
description: "",
message: "",
targetVersion: "1.0",
id: "00000000-0000-0000-0000-000000000003",
enabled: true,
Expand All @@ -557,7 +557,7 @@ describe("filterTargetVersion", () => {
platform: "ios",
file: "/build.zip",
hash: "eea69b75925f9f9e266cf3ffce87effd1f00b9a09832d690ca145d64c92714e1",
description: "",
message: "",
targetVersion: "1.0",
id: "00000000-0000-0000-0000-000000000004",
enabled: true,
Expand All @@ -572,7 +572,7 @@ describe("filterTargetVersion", () => {
platform: "ios",
file: "/build.zip",
hash: "eea69b75925f9f9e266cf3ffce87effd1f00b9a09832d690ca145d64c92714e1",
description: "",
message: "",
targetVersion: "1.0",
id: "00000000-0000-0000-0000-000000000004",
enabled: true,
Expand All @@ -582,7 +582,7 @@ describe("filterTargetVersion", () => {
platform: "ios",
file: "/build.zip",
hash: "516490c4a042d487cda558986a9a162b75625f242cb2291ba3b915fae9a1b264",
description: "",
message: "",
targetVersion: "1.0",
id: "00000000-0000-0000-0000-000000000002",
enabled: true,
Expand Down
4 changes: 2 additions & 2 deletions packages/utils/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ export interface Bundle {
*/
hash: string;
/**
* The description of the bundle.
* The message of the bundle.
*/
description?: string;
message?: string;
}

export type BundleArg =
Expand Down

0 comments on commit 21f76da

Please sign in to comment.