Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support new arch ios #30

Merged
merged 13 commits into from
Nov 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
1 change: 1 addition & 0 deletions examples/v0.74.1/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"dotenv": "^16.4.5",
"eslint": "^8.19.0",
"hot-updater": "0.1.4",
"invariant": "^2.2.4",
"jest": "^29.6.3",
"prettier": "2.8.8",
"react-test-renderer": "18.2.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
buildConfiguration = "Release"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
Expand Down
4 changes: 2 additions & 2 deletions examples/v0.76.1-new-arch/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1746,7 +1746,7 @@ SPEC CHECKSUMS:
fmt: 10c6e61f4be25dc963c36bd73fc7b1705fe975be
glog: 08b301085f15bcbb6ff8632a8ebaf239aae04e6a
hermes-engine: 46f1ffbf0297f4298862068dd4c274d4ac17a1fd
HotUpdater: b88320531fa11539bb724ca0f943d588d87ba368
HotUpdater: f2b03c78c2367dfad7a6781d1643030ec8f083d9
RCT-Folly: bf5c0376ffe4dd2cf438dcf86db385df9fdce648
RCTDeprecation: fde92935b3caa6cb65cbff9fbb7d3a9867ffb259
RCTRequired: 75c6cee42d21c1530a6f204ba32ff57335d19007
Expand Down Expand Up @@ -1809,4 +1809,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
10 changes: 5 additions & 5 deletions packages/hot-updater/src/commands/deploy.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
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 { getLatestGitCommitMessage } from "@/utils/getLatestGitCommitMessage";
import { getCwd, loadConfig } from "@hot-updater/plugin-core";
import { type Platform, filterTargetVersion } from "@hot-updater/utils";

Expand All @@ -22,11 +23,10 @@ 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 message = await getLatestGitCommitMessage();

const cwd = getCwd();
const targetVersion =
options.targetVersion ??
(await getDefaultTargetVersion(cwd, options.platform));
Expand Down Expand Up @@ -81,7 +81,7 @@ export const deploy = async (options: DeployOptions) => {
platform: options.platform,
file,
hash,
description: String(description),
message: message ?? undefined,
targetVersion,
id: bundleId,
enabled: true,
Expand Down
13 changes: 13 additions & 0 deletions packages/hot-updater/src/utils/getLatestGitCommitMessage.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { exec } from "child_process";

export const getLatestGitCommitMessage = () => {
return new Promise<string | null>((resolve) => {
exec("git log --decorate --pretty=format:%s -1", (error, stdout) => {
if (error) {
resolve(null);
return;
}
resolve(stdout.trim());
});
});
};
3 changes: 1 addition & 2 deletions packages/react-native/HotUpdater.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@ Pod::Spec.new do |s|
s.license = package["license"]
s.authors = package["author"]

s.platforms = { :ios => "11.0" }
s.platforms = { :ios => min_ios_version_supported }
s.source = { :git => "https://github.com/gronxb/hot-updater.git", :tag => "#{s.version}" }

s.source_files = "ios/**/*.{h,m,mm}"
s.public_header_files = ['ios/HotUpdater/HotUpdater.h']

s.dependency "SSZipArchive", "~> 2.2.2"

Expand Down
12 changes: 8 additions & 4 deletions packages/react-native/ios/HotUpdater/HotUpdater.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
#import <React/RCTBridgeModule.h>

#import <React/RCTEventEmitter.h>
#import <React/RCTBundleURLProvider.h>
#import <React/RCTReloadCommand.h>

@interface HotUpdater : NSObject <RCTBridgeModule>
#ifdef RCT_NEW_ARCH_ENABLED
#import "HotUpdaterSpec.h"
@interface HotUpdater : RCTEventEmitter <NativeHotUpdaterSpec>
#else
#import <React/RCTBridgeModule.h>
@interface HotUpdater : RCTEventEmitter <RCTBridgeModule>
#endif // RCT_NEW_ARCH_ENABLED

+ (NSURL *)bundleURL;

Expand Down
Loading