Skip to content

Commit 67357bf

Browse files
feat: add template update for config changes
1 parent 84cccf8 commit 67357bf

File tree

7 files changed

+53
-50
lines changed

7 files changed

+53
-50
lines changed

apps/client/cloud-push.config.ts

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,26 @@
1-
import { SupabaseStorageClient, SupabaseDbClient } from "@cloud-push/cloud";
21
import { defineConfig } from "@cloud-push/cli";
3-
import sharedConfig from "./sharedConfig";
2+
import { SupabaseStorageClient, SupabaseDbClient } from "@cloud-push/cloud";
43

54
export default defineConfig(() => ({
65
loadClients: () => {
7-
const storageClient = new SupabaseStorageClient({
8-
bucketName: process.env.SUPABASE_BUCKET_NAME,
9-
supabaseUrl: process.env.SUPABASE_URL,
10-
supabaseKey: process.env.SUPABASE_KEY,
11-
});
12-
13-
const dbClient = new SupabaseDbClient({
14-
tableName: process.env.SUPABASE_TABLE_NAME!,
15-
supabaseUrl: process.env.SUPABASE_URL!,
16-
supabaseKey: process.env.SUPABASE_KEY!,
17-
});
6+
7+
const storageClient = new SupabaseStorageClient({
8+
bucketName: process.env.SUPABASE_BUCKET_NAME,
9+
supabaseUrl: process.env.SUPABASE_URL,
10+
supabaseKey: process.env.SUPABASE_KEY,
11+
});
12+
13+
14+
const dbClient = new SupabaseDbClient({
15+
tableName: process.env.SUPABASE_TABLE_NAME!,
16+
supabaseUrl: process.env.SUPABASE_URL!,
17+
supabaseKey: process.env.SUPABASE_KEY!,
18+
});
19+
1820

1921
return {
2022
storage: storageClient,
2123
db: dbClient,
2224
};
2325
},
24-
envSource: "file",
25-
runtimeVersion: sharedConfig.runtimeVersion,
26-
channel: sharedConfig.channel,
27-
environment: "development",
28-
privateKeyPath: sharedConfig.privateKeyPath,
2926
}));

apps/server/cloud-push.server.ts

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,24 @@
1-
import { SupabaseStorageClient, SupabaseDbClient } from "@cloud-push/cloud";
21
import type { CloudPushConfig } from "@cloud-push/next";
32

3+
import { SupabaseStorageClient, SupabaseDbClient } from "@cloud-push/cloud";
4+
45
export const storageNodeClient = new SupabaseStorageClient({
5-
bucketName: process.env.SUPABASE_BUCKET_NAME,
6-
supabaseUrl: process.env.SUPABASE_URL,
7-
supabaseKey: process.env.SUPABASE_KEY,
6+
bucketName: process.env.SUPABASE_BUCKET_NAME,
7+
supabaseUrl: process.env.SUPABASE_URL,
8+
supabaseKey: process.env.SUPABASE_KEY,
89
});
910

11+
12+
1013
export const dbNodeClient = new SupabaseDbClient({
11-
tableName: process.env.SUPABASE_TABLE_NAME!,
12-
supabaseUrl: process.env.SUPABASE_URL!,
13-
supabaseKey: process.env.SUPABASE_KEY!,
14+
tableName: process.env.SUPABASE_TABLE_NAME!,
15+
supabaseUrl: process.env.SUPABASE_URL!,
16+
supabaseKey: process.env.SUPABASE_KEY!,
1417
});
1518

19+
1620
const cloudPushConfig: CloudPushConfig = {
1721
codeSigningPrivateKey: process.env.CLOUD_PUSH_PRIVATE_KEY,
1822
};
1923

20-
export default cloudPushConfig;
24+
export default cloudPushConfig;

apps/server/components/BundleCard.tsx

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,19 @@ export function BundleCard({
2121
const isIosLatestBundle = iosLatestBundle?.bundleId === bundle.bundleId;
2222

2323
return (
24-
<div className="bg-white rounded-xl shadow-md p-6 border border-gray-200 hover:shadow-lg transition">
25-
<div className="flex justify-between items-start mb-4">
26-
<div>
27-
<h3 className="font-semibold text-gray-800 flex items-center gap-4">
24+
<div className="bg-white rounded-xl shadow-md p-4 sm:p-6 border border-gray-200 hover:shadow-lg transition w-full max-w-full">
25+
<div className="flex flex-col sm:flex-row sm:justify-between sm:items-start gap-4 mb-4">
26+
<div className="flex-1">
27+
<h3 className="font-semibold text-gray-800 flex flex-wrap items-center gap-2 text-base sm:text-lg">
2828
<span className="text-blue-600">#{index + 1}</span> Bundle ID
29-
<div className="flex gap-2">
29+
<div className="flex flex-wrap gap-1">
3030
{isAndroidLatestBundle && (
31-
<span className="px-2 py-1 text-xs font-medium text-white bg-green-500 rounded">
31+
<span className="px-2 py-0.5 text-xs font-medium text-white bg-green-500 rounded">
3232
Android Latest
3333
</span>
3434
)}
3535
{isIosLatestBundle && (
36-
<span className="px-2 py-1 text-xs font-medium text-white bg-green-500 rounded">
36+
<span className="px-2 py-0.5 text-xs font-medium text-white bg-green-500 rounded">
3737
iOS Latest
3838
</span>
3939
)}
@@ -44,15 +44,15 @@ export function BundleCard({
4444
</p>
4545
</div>
4646

47-
<div className="space-y-2">
47+
<div className="flex flex-wrap gap-2">
4848
{(
4949
["FORCE_UPDATE", "NORMAL_UPDATE", "ROLLBACK"] as UpdatePolicy[]
5050
).map((policy) => (
5151
<button
5252
type="button"
5353
key={policy}
5454
onClick={() => onUpdatePolicyChange(bundle, policy)}
55-
className={`px-4 py-1 rounded-md text-xs font-medium transition ${
55+
className={`px-3 py-1 rounded-md text-xs font-medium transition ${
5656
bundle.updatePolicy === policy
5757
? "bg-blue-600 text-white"
5858
: "bg-gray-200 text-gray-700 hover:bg-gray-300"
@@ -90,14 +90,13 @@ export function BundleCard({
9090
rel="noreferrer"
9191
>
9292
<strong>Commit:</strong>{" "}
93-
<span className="underline">{bundle.gitHash}</span>
93+
<span className="underline break-all">{bundle.gitHash}</span>
9494
</a>
95-
{/* ✅ 수정된 부분: <p> 태그 밖에 <ul> 위치 */}
9695
<div>
9796
<p className="mb-1">
9897
<strong>Policy Target:</strong>
9998
</p>
100-
<ul className="ml-4 list-disc text-xs">
99+
<ul className="ml-4 list-disc text-xs sm:text-sm">
101100
{bundle.updatePolicy === "ROLLBACK" ? (
102101
<>
103102
{bundle.supportAndroid && (

apps/server/components/DashboardPageContent.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ export function DashboardPageContent({
104104
<BundleCard
105105
key={bundle.bundleId}
106106
bundle={bundle}
107-
index={index + 1}
107+
index={targetBundles.length - (index + 1)}
108108
androidLastestBundle={androidLastestBundle}
109109
iosLatestBundle={iosLatestBundle}
110110
gitRepositoryUrl={setting.repositoryUrl}

packages/cli/src/expo/lib/createTemplate.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,8 @@ import { ${[importMethods.join(", ")]} } from "@cloud-push/cloud";
116116
117117
export default defineConfig(() => ({
118118
loadClients: () => {
119-
const storageClient = ${storageClientInstance};
120-
const dbClient = ${dbClientInstance};
119+
${storageClientInstance}
120+
${dbClientInstance}
121121
122122
return {
123123
storage: storageClient,

packages/cli/src/next/templates/cloud-push.server.ts.ejs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import type { CloudPushConfig } from "@cloud-push/next";
12
<%
23
const importClasses = [];
34
@@ -75,10 +76,10 @@ const generateDbClient = (): DbClient => {
7576
};
7677
};
7778
export const dbNodeClient = generateDbClient();
79+
<% } %>
7880

7981
const cloudPushConfig: CloudPushConfig = {
8082
codeSigningPrivateKey: process.env.CLOUD_PUSH_PRIVATE_KEY,
8183
};
8284

83-
export default cloudPushConfig;
84-
<% } %>
85+
export default cloudPushConfig;

packages/cloud/src/providers/lowdb/LowDbClient.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -77,14 +77,16 @@ export class LowDbClient extends DbClient {
7777
const aValue = a[field];
7878
const bValue = b[field];
7979

80-
// 값 비교
81-
if (aValue < bValue) {
82-
return direction === "asc" ? -1 : 1;
80+
if (typeof aValue === "number" && typeof bValue === "number") {
81+
// 값 비교
82+
if (aValue < bValue) {
83+
return direction === "asc" ? -1 : 1;
84+
}
85+
if (aValue > bValue) {
86+
return direction === "asc" ? 1 : -1;
87+
}
88+
// 값이 같으면 다음 정렬 기준으로 넘어감
8389
}
84-
if (aValue > bValue) {
85-
return direction === "asc" ? 1 : -1;
86-
}
87-
// 값이 같으면 다음 정렬 기준으로 넘어감
8890
}
8991

9092
// 모든 정렬 기준이 같으면 0 반환

0 commit comments

Comments
 (0)