sayren 0.12.1 → 0.13.1
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 +84 -5
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -5944,6 +5944,25 @@ const cli_deploy_force_yes_required = ((inputs = {}, options = {}) => {
|
|
|
5944
5944
|
return ko_cli_deploy_force_yes_required(inputs);
|
|
5945
5945
|
});
|
|
5946
5946
|
|
|
5947
|
+
//#endregion
|
|
5948
|
+
//#region src/paraglide/messages/cli_deploy_merged.js
|
|
5949
|
+
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
|
|
5950
|
+
/** @typedef {{}} Cli_Deploy_MergedInputs */
|
|
5951
|
+
const ko_cli_deploy_merged = () => {
|
|
5952
|
+
return `pull 이후 원격 작업 트리가 바뀌어(상점 플랫폼·AI 편집) 서버가 병합했습니다. 원격 변경은 그대로 남습니다.
|
|
5953
|
+
· 병합된 트리를 이 폴더에 받으려면: npx sayren pull --force`;
|
|
5954
|
+
};
|
|
5955
|
+
/**
|
|
5956
|
+
|
|
5957
|
+
* @param {Cli_Deploy_MergedInputs} inputs
|
|
5958
|
+
* @param {{ locale?: "ko" }} options
|
|
5959
|
+
* @returns {LocalizedString}
|
|
5960
|
+
*/
|
|
5961
|
+
const cli_deploy_merged = ((inputs = {}, options = {}) => {
|
|
5962
|
+
experimentalStaticLocale ?? options.locale ?? getLocale();
|
|
5963
|
+
return ko_cli_deploy_merged(inputs);
|
|
5964
|
+
});
|
|
5965
|
+
|
|
5947
5966
|
//#endregion
|
|
5948
5967
|
//#region src/paraglide/messages/cli_deploy_no_state.js
|
|
5949
5968
|
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
|
|
@@ -6034,6 +6053,24 @@ const cli_deploy_published = ((inputs, options = {}) => {
|
|
|
6034
6053
|
return ko_cli_deploy_published(inputs);
|
|
6035
6054
|
});
|
|
6036
6055
|
|
|
6056
|
+
//#endregion
|
|
6057
|
+
//#region src/paraglide/messages/cli_deploy_seller_git.js
|
|
6058
|
+
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
|
|
6059
|
+
/** @typedef {{ repository: NonNullable<unknown>, branch: NonNullable<unknown> }} Cli_Deploy_Seller_GitInputs */
|
|
6060
|
+
const ko_cli_deploy_seller_git = (i) => {
|
|
6061
|
+
return `이 사이트는 GitHub 저장소 ${i?.repository}에 연결돼 있습니다. ${i?.branch} 브랜치에 git push하면 빌드하고 배포합니다(다른 브랜치는 미리보기). 업로드 배포는 npx sayren pull로 받은 폴더에서 하십시오`;
|
|
6062
|
+
};
|
|
6063
|
+
/**
|
|
6064
|
+
|
|
6065
|
+
* @param {Cli_Deploy_Seller_GitInputs} inputs
|
|
6066
|
+
* @param {{ locale?: "ko" }} options
|
|
6067
|
+
* @returns {LocalizedString}
|
|
6068
|
+
*/
|
|
6069
|
+
const cli_deploy_seller_git = ((inputs, options = {}) => {
|
|
6070
|
+
experimentalStaticLocale ?? options.locale ?? getLocale();
|
|
6071
|
+
return ko_cli_deploy_seller_git(inputs);
|
|
6072
|
+
});
|
|
6073
|
+
|
|
6037
6074
|
//#endregion
|
|
6038
6075
|
//#region src/paraglide/messages/cli_deploy_site_changed.js
|
|
6039
6076
|
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
|
|
@@ -8166,6 +8203,27 @@ const cli_source_changed = ((inputs = {}, options = {}) => {
|
|
|
8166
8203
|
return ko_cli_source_changed(inputs);
|
|
8167
8204
|
});
|
|
8168
8205
|
|
|
8206
|
+
//#endregion
|
|
8207
|
+
//#region src/paraglide/messages/cli_source_conflicts.js
|
|
8208
|
+
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
|
|
8209
|
+
/** @typedef {{ files: NonNullable<unknown> }} Cli_Source_ConflictsInputs */
|
|
8210
|
+
const ko_cli_source_conflicts = (i) => {
|
|
8211
|
+
return `pull 이후 원격 작업 트리가 바뀌었고 같은 파일을 서로 다르게 고쳤습니다. 덮어쓰지 않았습니다.
|
|
8212
|
+
${i?.files}
|
|
8213
|
+
· 원격을 받아 다시 고치려면: npx sayren pull --force (로컬 변경은 먼저 커밋·백업하십시오)
|
|
8214
|
+
· 이 폴더 내용으로 덮어쓰려면: npx sayren deploy --force`;
|
|
8215
|
+
};
|
|
8216
|
+
/**
|
|
8217
|
+
|
|
8218
|
+
* @param {Cli_Source_ConflictsInputs} inputs
|
|
8219
|
+
* @param {{ locale?: "ko" }} options
|
|
8220
|
+
* @returns {LocalizedString}
|
|
8221
|
+
*/
|
|
8222
|
+
const cli_source_conflicts = ((inputs, options = {}) => {
|
|
8223
|
+
experimentalStaticLocale ?? options.locale ?? getLocale();
|
|
8224
|
+
return ko_cli_source_conflicts(inputs);
|
|
8225
|
+
});
|
|
8226
|
+
|
|
8169
8227
|
//#endregion
|
|
8170
8228
|
//#region src/paraglide/messages/cli_state_invalid.js
|
|
8171
8229
|
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
|
|
@@ -9726,7 +9784,7 @@ async function selectStore(auth, client, io, candidates, folderStore = null) {
|
|
|
9726
9784
|
|
|
9727
9785
|
//#endregion
|
|
9728
9786
|
//#region package.json
|
|
9729
|
-
var version = "0.
|
|
9787
|
+
var version = "0.13.1";
|
|
9730
9788
|
|
|
9731
9789
|
//#endregion
|
|
9732
9790
|
//#region src/client.ts
|
|
@@ -11073,7 +11131,7 @@ function verifySources(files, options = {}) {
|
|
|
11073
11131
|
if (cookieFiles.length > 0 && !cookieFiles.some((file) => /httpOnly\s*:\s*true/.test(file.content))) inProject("buyer-token-cookie", mcp_verify_buyer_token_cookie_missing());
|
|
11074
11132
|
if (!has(".refresh(")) inProject("buyer-session-refresh", mcp_verify_buyer_session_refresh());
|
|
11075
11133
|
if (has(".session(") && !has(".signUp(")) inProject("buyer-signup", mcp_verify_buyer_signup());
|
|
11076
|
-
if (!matches(/\b(auth|authFor\(\))
|
|
11134
|
+
if (!matches(/\b(auth|authFor\(\))\s*\.signOut\(|\.signOut\(\s*accessToken\b/)) inProject("buyer-signout", mcp_verify_buyer_signout());
|
|
11077
11135
|
if (!has("reconsentRequired")) inProject("buyer-reconsent", mcp_verify_buyer_reconsent());
|
|
11078
11136
|
}
|
|
11079
11137
|
if (has("startPayment(") && !has("checkoutAvailable")) inProject("checkout-availability", mcp_verify_checkout_availability());
|
|
@@ -11470,6 +11528,13 @@ function accessOf(path) {
|
|
|
11470
11528
|
|
|
11471
11529
|
//#endregion
|
|
11472
11530
|
//#region ../../apps/hosting-sandbox/src/tar.ts
|
|
11531
|
+
/** 풀어낸 크기가 호출자가 준 상한을 넘었다(압축 폭탄 방어). 형식 오류와 구별해 413으로 답할 수 있게 따로 둔다 */
|
|
11532
|
+
var TarLimitError = class extends Error {
|
|
11533
|
+
constructor(message) {
|
|
11534
|
+
super(message);
|
|
11535
|
+
this.name = "TarLimitError";
|
|
11536
|
+
}
|
|
11537
|
+
};
|
|
11473
11538
|
const BLOCK = 512;
|
|
11474
11539
|
const enc = new TextEncoder();
|
|
11475
11540
|
const dec = new TextDecoder();
|
|
@@ -11537,7 +11602,7 @@ function readTar(buf, maxBytes = Number.POSITIVE_INFINITY) {
|
|
|
11537
11602
|
while (path.startsWith("./")) path = path.slice(2);
|
|
11538
11603
|
if (!path) continue;
|
|
11539
11604
|
total += size;
|
|
11540
|
-
if (total > maxBytes) throw new
|
|
11605
|
+
if (total > maxBytes) throw new TarLimitError("tar 합계가 상한을 넘습니다");
|
|
11541
11606
|
out.push({
|
|
11542
11607
|
path,
|
|
11543
11608
|
bytes: data.slice()
|
|
@@ -11556,7 +11621,7 @@ async function gunzip(bytes, maxBytes) {
|
|
|
11556
11621
|
total += value.length;
|
|
11557
11622
|
if (total > maxBytes) {
|
|
11558
11623
|
await reader.cancel();
|
|
11559
|
-
throw new
|
|
11624
|
+
throw new TarLimitError("압축을 푼 크기가 상한을 넘습니다");
|
|
11560
11625
|
}
|
|
11561
11626
|
chunks.push(value);
|
|
11562
11627
|
}
|
|
@@ -12191,6 +12256,15 @@ async function deploy(flags, io) {
|
|
|
12191
12256
|
} catch {
|
|
12192
12257
|
storeId = null;
|
|
12193
12258
|
}
|
|
12259
|
+
const git$1 = await apiFor(flags, dir, null, {
|
|
12260
|
+
...io,
|
|
12261
|
+
select: null,
|
|
12262
|
+
confirm: null
|
|
12263
|
+
}).then(({ client: client$1 }) => client$1.storefront.getGit()).catch(() => null);
|
|
12264
|
+
if (git$1?.owner === "SELLER" && git$1.repository) throw new CliError(cli_deploy_seller_git({
|
|
12265
|
+
repository: git$1.repository,
|
|
12266
|
+
branch: git$1.productionBranch ?? "main"
|
|
12267
|
+
}));
|
|
12194
12268
|
throw new CliError(cli_deploy_no_state({
|
|
12195
12269
|
stateFile: STATE_FILE,
|
|
12196
12270
|
storeId: storeId ?? "<storeId>",
|
|
@@ -12226,9 +12300,10 @@ async function deploy(flags, io) {
|
|
|
12226
12300
|
}
|
|
12227
12301
|
writeState(dir, {
|
|
12228
12302
|
...rc,
|
|
12229
|
-
baseRef: replaced.sourceRef
|
|
12303
|
+
baseRef: replaced.uploadedRef ?? (replaced.merged ? rc.baseRef : replaced.sourceRef)
|
|
12230
12304
|
});
|
|
12231
12305
|
io.out(!replaced.changed ? cli_deploy_unchanged() : replaced.endedEditSession ? cli_deploy_uploaded_edit_ended({ files: replaced.files }) : cli_deploy_uploaded({ files: replaced.files }));
|
|
12306
|
+
if (replaced.merged) io.out(cli_deploy_merged());
|
|
12232
12307
|
let created;
|
|
12233
12308
|
try {
|
|
12234
12309
|
created = await client.storefront.createVersion({
|
|
@@ -12353,10 +12428,14 @@ async function replaceSource(client, tree, rc, force, io) {
|
|
|
12353
12428
|
files: remote.files,
|
|
12354
12429
|
bytes: remote.bytes,
|
|
12355
12430
|
changed: false,
|
|
12431
|
+
merged: false,
|
|
12432
|
+
uploadedRef: remote.sourceRef,
|
|
12356
12433
|
endedEditSession: false,
|
|
12357
12434
|
dependencyWarnings: []
|
|
12358
12435
|
};
|
|
12359
12436
|
}
|
|
12437
|
+
const conflicts = Array.isArray(details.conflicts) ? details.conflicts : [];
|
|
12438
|
+
if (conflicts.length > 0) throw new CliError(cli_source_conflicts({ files: conflicts.map((path) => ` · ${path}`).join("\n") }));
|
|
12360
12439
|
throw new CliError(cli_source_changed());
|
|
12361
12440
|
}
|
|
12362
12441
|
if (code === "EDIT_SESSION_OPEN") throw new CliError(cli_edit_session_open());
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sayren",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"imports": {
|
|
6
6
|
"#paraglide/*": "./src/paraglide/*"
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"esbuild": "^0.28.2",
|
|
20
|
-
"@sayren/store-sdk": "^0.
|
|
20
|
+
"@sayren/store-sdk": "^0.40.0"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"@biomejs/biome": "^2.5.14",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"tsx": "^4.20.3",
|
|
29
29
|
"typescript": "^6.0.3",
|
|
30
30
|
"vitest": "^5.0.1",
|
|
31
|
-
"@sayren/mcp": "0.
|
|
31
|
+
"@sayren/mcp": "0.29.1"
|
|
32
32
|
},
|
|
33
33
|
"publishConfig": {
|
|
34
34
|
"access": "public"
|