sayren 0.12.0 → 0.13.0

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.
Files changed (2) hide show
  1. package/dist/index.mjs +83 -23
  2. 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 */
@@ -6502,24 +6539,6 @@ const cli_init_dir_not_empty = ((inputs, options = {}) => {
6502
6539
  return ko_cli_init_dir_not_empty(inputs);
6503
6540
  });
6504
6541
 
6505
- //#endregion
6506
- //#region src/paraglide/messages/cli_init_hosting_disabled.js
6507
- /** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
6508
- /** @typedef {{}} Cli_Init_Hosting_DisabledInputs */
6509
- const ko_cli_init_hosting_disabled = () => {
6510
- return `지금은 새 호스팅 사이트를 만들 수 없습니다(호스팅 기능이 꺼져 있습니다)`;
6511
- };
6512
- /**
6513
-
6514
- * @param {Cli_Init_Hosting_DisabledInputs} inputs
6515
- * @param {{ locale?: "ko" }} options
6516
- * @returns {LocalizedString}
6517
- */
6518
- const cli_init_hosting_disabled = ((inputs = {}, options = {}) => {
6519
- experimentalStaticLocale ?? options.locale ?? getLocale();
6520
- return ko_cli_init_hosting_disabled(inputs);
6521
- });
6522
-
6523
6542
  //#endregion
6524
6543
  //#region src/paraglide/messages/cli_init_inside_pulled.js
6525
6544
  /** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
@@ -8184,6 +8203,27 @@ const cli_source_changed = ((inputs = {}, options = {}) => {
8184
8203
  return ko_cli_source_changed(inputs);
8185
8204
  });
8186
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
+
8187
8227
  //#endregion
8188
8228
  //#region src/paraglide/messages/cli_state_invalid.js
8189
8229
  /** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
@@ -9744,7 +9784,7 @@ async function selectStore(auth, client, io, candidates, folderStore = null) {
9744
9784
 
9745
9785
  //#endregion
9746
9786
  //#region package.json
9747
- var version = "0.12.0";
9787
+ var version = "0.13.0";
9748
9788
 
9749
9789
  //#endregion
9750
9790
  //#region src/client.ts
@@ -11488,6 +11528,13 @@ function accessOf(path) {
11488
11528
 
11489
11529
  //#endregion
11490
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
+ };
11491
11538
  const BLOCK = 512;
11492
11539
  const enc = new TextEncoder();
11493
11540
  const dec = new TextDecoder();
@@ -11555,7 +11602,7 @@ function readTar(buf, maxBytes = Number.POSITIVE_INFINITY) {
11555
11602
  while (path.startsWith("./")) path = path.slice(2);
11556
11603
  if (!path) continue;
11557
11604
  total += size;
11558
- if (total > maxBytes) throw new Error("tar 합계가 상한을 넘습니다");
11605
+ if (total > maxBytes) throw new TarLimitError("tar 합계가 상한을 넘습니다");
11559
11606
  out.push({
11560
11607
  path,
11561
11608
  bytes: data.slice()
@@ -11574,7 +11621,7 @@ async function gunzip(bytes, maxBytes) {
11574
11621
  total += value.length;
11575
11622
  if (total > maxBytes) {
11576
11623
  await reader.cancel();
11577
- throw new Error("압축을 푼 크기가 상한을 넘습니다");
11624
+ throw new TarLimitError("압축을 푼 크기가 상한을 넘습니다");
11578
11625
  }
11579
11626
  chunks.push(value);
11580
11627
  }
@@ -12109,7 +12156,6 @@ async function init(flags, io) {
12109
12156
  io.out(cli_init_site_url({ url: hosting.site.url }));
12110
12157
  throw new CliError(cli_init_site_exists({ storeId }));
12111
12158
  }
12112
- if (!hosting.enabled) throw new CliError(cli_init_hosting_disabled());
12113
12159
  if (!hosting.editingEnabled) throw new CliError(cli_pull_editing_disabled());
12114
12160
  const template = await pickTemplate(await client.storefront.listTemplates(), flags.template, io);
12115
12161
  io.out(cli_init_summary({
@@ -12210,6 +12256,15 @@ async function deploy(flags, io) {
12210
12256
  } catch {
12211
12257
  storeId = null;
12212
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
+ }));
12213
12268
  throw new CliError(cli_deploy_no_state({
12214
12269
  stateFile: STATE_FILE,
12215
12270
  storeId: storeId ?? "<storeId>",
@@ -12245,9 +12300,10 @@ async function deploy(flags, io) {
12245
12300
  }
12246
12301
  writeState(dir, {
12247
12302
  ...rc,
12248
- baseRef: replaced.sourceRef
12303
+ baseRef: replaced.uploadedRef ?? (replaced.merged ? rc.baseRef : replaced.sourceRef)
12249
12304
  });
12250
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());
12251
12307
  let created;
12252
12308
  try {
12253
12309
  created = await client.storefront.createVersion({
@@ -12372,10 +12428,14 @@ async function replaceSource(client, tree, rc, force, io) {
12372
12428
  files: remote.files,
12373
12429
  bytes: remote.bytes,
12374
12430
  changed: false,
12431
+ merged: false,
12432
+ uploadedRef: remote.sourceRef,
12375
12433
  endedEditSession: false,
12376
12434
  dependencyWarnings: []
12377
12435
  };
12378
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") }));
12379
12439
  throw new CliError(cli_source_changed());
12380
12440
  }
12381
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.12.0",
3
+ "version": "0.13.0",
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.33.0"
20
+ "@sayren/store-sdk": "^0.37.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.26.0"
31
+ "@sayren/mcp": "0.27.0"
32
32
  },
33
33
  "publishConfig": {
34
34
  "access": "public"