@simplysm/sd-cli 14.0.53 → 14.0.55

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 (52) hide show
  1. package/dist/capacitor/capacitor-android.d.ts.map +1 -1
  2. package/dist/capacitor/capacitor-android.js +32 -0
  3. package/dist/capacitor/capacitor-android.js.map +1 -1
  4. package/dist/capacitor/capacitor-icon.js +1 -1
  5. package/dist/capacitor/capacitor-icon.js.map +1 -1
  6. package/dist/capacitor/capacitor-npm-config.d.ts.map +1 -1
  7. package/dist/capacitor/capacitor-npm-config.js +5 -4
  8. package/dist/capacitor/capacitor-npm-config.js.map +1 -1
  9. package/dist/capacitor/capacitor.d.ts +1 -1
  10. package/dist/capacitor/capacitor.d.ts.map +1 -1
  11. package/dist/capacitor/capacitor.js +7 -7
  12. package/dist/capacitor/capacitor.js.map +1 -1
  13. package/dist/commands/check.d.ts.map +1 -1
  14. package/dist/commands/check.js +21 -12
  15. package/dist/commands/check.js.map +1 -1
  16. package/dist/commands/device.d.ts.map +1 -1
  17. package/dist/commands/device.js +13 -1
  18. package/dist/commands/device.js.map +1 -1
  19. package/dist/commands/publish/git-phase.d.ts +1 -1
  20. package/dist/commands/publish/git-phase.d.ts.map +1 -1
  21. package/dist/commands/publish/git-phase.js +12 -22
  22. package/dist/commands/publish/git-phase.js.map +1 -1
  23. package/dist/commands/publish/npm-publisher.js +2 -2
  24. package/dist/commands/publish/npm-publisher.js.map +1 -1
  25. package/dist/commands/publish/publish-command.d.ts.map +1 -1
  26. package/dist/commands/publish/publish-command.js +3 -2
  27. package/dist/commands/publish/publish-command.js.map +1 -1
  28. package/dist/electron/electron.d.ts.map +1 -1
  29. package/dist/electron/electron.js +4 -5
  30. package/dist/electron/electron.js.map +1 -1
  31. package/dist/utils/shell-spawn.d.ts +6 -0
  32. package/dist/utils/shell-spawn.d.ts.map +1 -0
  33. package/dist/utils/shell-spawn.js +5 -0
  34. package/dist/utils/shell-spawn.js.map +1 -0
  35. package/package.json +5 -5
  36. package/src/capacitor/capacitor-android.ts +44 -0
  37. package/src/capacitor/capacitor-icon.ts +1 -1
  38. package/src/capacitor/capacitor-npm-config.ts +5 -4
  39. package/src/capacitor/capacitor.ts +8 -6
  40. package/src/commands/check.ts +21 -12
  41. package/src/commands/device.ts +13 -1
  42. package/src/commands/publish/git-phase.ts +12 -22
  43. package/src/commands/publish/npm-publisher.ts +2 -2
  44. package/src/commands/publish/publish-command.ts +3 -2
  45. package/src/electron/electron.ts +5 -5
  46. package/src/utils/shell-spawn.ts +10 -0
  47. package/tests/capacitor/capacitor-icon.spec.ts +23 -1
  48. package/tests/capacitor/capacitor-npm-config.acc.spec.ts +14 -6
  49. package/tests/commands/check.spec.ts +21 -0
  50. package/tests/commands/git-phase.acc.spec.ts +14 -11
  51. package/tests/commands/publish.spec.ts +22 -13
  52. package/tests/electron/electron.spec.ts +9 -3
@@ -264,6 +264,27 @@ describe("runCheck", () => {
264
264
  expect(successArgs.some((a) => a.includes("LINT"))).toBe(true);
265
265
  expect(process.exitCode).toBeUndefined();
266
266
  });
267
+
268
+ it("runs scripts lint when typecheck has no engine lint result", async () => {
269
+ mocks.executeTypecheck.mockResolvedValue({
270
+ success: true, errorCount: 0, warningCount: 0, formattedOutput: "",
271
+ scriptsPackagePaths: ["packages/sd-codex"],
272
+ });
273
+ mocks.runLintInWorker.mockResolvedValue({
274
+ success: true, errorCount: 0, warningCount: 0, formattedOutput: "",
275
+ });
276
+
277
+ await runCheck({ targets: [], types: ["typecheck", "lint"], fix: false });
278
+
279
+ expect(mocks.runLintInWorker).toHaveBeenCalledWith({
280
+ targets: ["packages/sd-codex"],
281
+ fix: false,
282
+ timing: false,
283
+ });
284
+ const successArgs = collectArgs(mockLogger.success);
285
+ expect(successArgs.some((a) => a.includes("LINT"))).toBe(true);
286
+ expect(process.exitCode).toBeUndefined();
287
+ });
267
288
  });
268
289
 
269
290
  describe("lint-only path", () => {
@@ -29,7 +29,7 @@ describe("ensureCleanWorkingTree", () => {
29
29
  vi.clearAllMocks();
30
30
  });
31
31
 
32
- it("auto-commits with claude when uncommitted changes detected", async () => {
32
+ it("auto-commits with codex when uncommitted changes detected", async () => {
33
33
  const logger = createLogger();
34
34
  mocks.execa.mockImplementation((cmd: string, args?: string[]) => {
35
35
  if (cmd === "git" && args?.[0] === "diff") {
@@ -40,11 +40,14 @@ describe("ensureCleanWorkingTree", () => {
40
40
 
41
41
  await ensureCleanWorkingTree(true, logger);
42
42
 
43
- const claudeCalls = mocks.execa.mock.calls.filter(
44
- (c: unknown[]) => c[0] === "claude",
43
+ const codexCalls = mocks.execa.mock.calls.filter(
44
+ (c: unknown[]) => c[0] === "codex",
45
45
  );
46
- expect(claudeCalls).toHaveLength(1);
47
- expect((claudeCalls[0][1] as string[])).toContain("/sd-commit");
46
+ expect(codexCalls).toHaveLength(1);
47
+ expect((codexCalls[0][1] as string[])).toContain("exec");
48
+ expect((codexCalls[0][1] as string[])).toContain("gpt-5.3-codex-spark");
49
+ expect((codexCalls[0][1] as string[])).toContain('model_reasoning_effort="low"');
50
+ expect((codexCalls[0][1] as string[])).toContain("$sd-commit");
48
51
  });
49
52
 
50
53
  it("skips auto-commit when no uncommitted changes", async () => {
@@ -55,20 +58,20 @@ describe("ensureCleanWorkingTree", () => {
55
58
 
56
59
  await ensureCleanWorkingTree(true, logger);
57
60
 
58
- const claudeCalls = mocks.execa.mock.calls.filter(
59
- (c: unknown[]) => c[0] === "claude",
61
+ const codexCalls = mocks.execa.mock.calls.filter(
62
+ (c: unknown[]) => c[0] === "codex",
60
63
  );
61
- expect(claudeCalls).toHaveLength(0);
64
+ expect(codexCalls).toHaveLength(0);
62
65
  });
63
66
 
64
- it("throws when claude auto-commit fails", async () => {
67
+ it("throws when codex auto-commit fails", async () => {
65
68
  const logger = createLogger();
66
69
  mocks.execa.mockImplementation((cmd: string, args?: string[]) => {
67
70
  if (cmd === "git" && args?.[0] === "diff") {
68
71
  return { stdout: "file.txt", stderr: "", exitCode: 0 };
69
72
  }
70
- if (cmd === "claude") {
71
- throw new Error("claude commit failed");
73
+ if (cmd === "codex") {
74
+ throw new Error("codex commit failed");
72
75
  }
73
76
  return { stdout: "", stderr: "", exitCode: 0 };
74
77
  });
@@ -256,6 +256,7 @@ describe("runPublish", () => {
256
256
  (c: unknown[]) => c[0] === "pnpm" && (c[1] as string[] | undefined)?.[0] === "publish",
257
257
  );
258
258
  expect(call?.[2]).toHaveProperty("cwd", pkgPath("pkg-a"));
259
+ expect(call?.[2]).toHaveProperty("shell", true);
259
260
  });
260
261
 
261
262
  it("publishes all packages with publish config when targets empty", async () => {
@@ -334,6 +335,11 @@ describe("runPublish", () => {
334
335
 
335
336
  expect(process.exitCode).toBeUndefined();
336
337
  expect(getExecaCalls("npm", "whoami")).toHaveLength(1);
338
+ expect(mocks.execa).toHaveBeenCalledWith(
339
+ "npm",
340
+ ["whoami"],
341
+ expect.objectContaining({ shell: true }),
342
+ );
337
343
  });
338
344
 
339
345
  it("aborts when npm whoami fails", async () => {
@@ -379,7 +385,7 @@ describe("runPublish", () => {
379
385
  expect(getExecaCalls("npm", "whoami")).toHaveLength(0);
380
386
  });
381
387
 
382
- it("auto-commits with claude when uncommitted changes detected", async () => {
388
+ it("auto-commits with codex when uncommitted changes detected", async () => {
383
389
  setupHappyPath();
384
390
  mocks.execa.mockImplementation(
385
391
  (cmd: string, args?: string[], _opts?: unknown) => {
@@ -398,23 +404,26 @@ describe("runPublish", () => {
398
404
  options: [],
399
405
  });
400
406
 
401
- // claude CLI should have been called for auto-commit
402
- const claudeCalls = mocks.execa.mock.calls.filter(
403
- (c: unknown[]) => c[0] === "claude",
407
+ // codex CLI should have been called for auto-commit
408
+ const codexCalls = mocks.execa.mock.calls.filter(
409
+ (c: unknown[]) => c[0] === "codex",
404
410
  );
405
- expect(claudeCalls).toHaveLength(1);
406
- expect((claudeCalls[0][1] as string[])).toContain("/sd-commit");
411
+ expect(codexCalls).toHaveLength(1);
412
+ expect((codexCalls[0][1] as string[])).toContain("exec");
413
+ expect((codexCalls[0][1] as string[])).toContain("gpt-5.3-codex-spark");
414
+ expect((codexCalls[0][1] as string[])).toContain('model_reasoning_effort="low"');
415
+ expect((codexCalls[0][1] as string[])).toContain("$sd-commit");
407
416
  });
408
417
 
409
- it("aborts when auto-commit claude command fails", async () => {
418
+ it("aborts when auto-commit codex command fails", async () => {
410
419
  setupHappyPath();
411
420
  mocks.execa.mockImplementation((cmd: string, args?: string[]) => {
412
421
  if (cmd === "npm") return { stdout: "testuser", stderr: "", exitCode: 0 };
413
422
  if (cmd === "git" && args?.[0] === "diff") {
414
423
  return { stdout: "file.txt", stderr: "", exitCode: 0 };
415
424
  }
416
- if (cmd === "claude") {
417
- throw new Error("claude commit failed");
425
+ if (cmd === "codex") {
426
+ throw new Error("codex commit failed");
418
427
  }
419
428
  return { stdout: "", stderr: "", exitCode: 0 };
420
429
  });
@@ -439,11 +448,11 @@ describe("runPublish", () => {
439
448
  options: [],
440
449
  });
441
450
 
442
- // No claude CLI calls
443
- const claudeCalls = mocks.execa.mock.calls.filter(
444
- (c: unknown[]) => c[0] === "claude",
451
+ // No codex CLI calls
452
+ const codexCalls = mocks.execa.mock.calls.filter(
453
+ (c: unknown[]) => c[0] === "codex",
445
454
  );
446
- expect(claudeCalls).toHaveLength(0);
455
+ expect(codexCalls).toHaveLength(0);
447
456
  });
448
457
  });
449
458
 
@@ -182,9 +182,11 @@ describe("Electron", () => {
182
182
  expect(findElectronPackageJson()).toBeDefined();
183
183
 
184
184
  const spawnCalls = mockCpxSpawn.mock.calls;
185
- expect(
186
- spawnCalls.find((c) => c[0] === "pnpm" && (c[1] as string[]).includes("install")),
187
- ).toBeDefined();
185
+ const installCall = spawnCalls.find(
186
+ (c) => c[0] === "pnpm" && (c[1] as string[]).includes("install"),
187
+ );
188
+ expect(installCall).toBeDefined();
189
+ expect(installCall?.[2]).toEqual(expect.objectContaining({ shell: true }));
188
190
  expect(
189
191
  spawnCalls.find(
190
192
  (c) => c[0] === "pnpm" && (c[1] as string[]).includes("electron-rebuild"),
@@ -520,6 +522,10 @@ describe("Electron", () => {
520
522
  expect(callArgs.format).toBe("esm");
521
523
  expect(callArgs.bundle).toBe(true);
522
524
  expect(callArgs.external).toContain("electron");
525
+ const electronCall = mockCpxSpawn.mock.calls.find(
526
+ (c) => c[0] === "pnpm" && (c[1] as string[]).includes("electron"),
527
+ );
528
+ expect(electronCall?.[2]).toEqual(expect.objectContaining({ shell: true, reject: false }));
523
529
 
524
530
  // ESM 배너에 createRequire shim 포함
525
531
  expect(banner).toContain("createRequire");