@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.
- package/dist/capacitor/capacitor-android.d.ts.map +1 -1
- package/dist/capacitor/capacitor-android.js +32 -0
- package/dist/capacitor/capacitor-android.js.map +1 -1
- package/dist/capacitor/capacitor-icon.js +1 -1
- package/dist/capacitor/capacitor-icon.js.map +1 -1
- package/dist/capacitor/capacitor-npm-config.d.ts.map +1 -1
- package/dist/capacitor/capacitor-npm-config.js +5 -4
- package/dist/capacitor/capacitor-npm-config.js.map +1 -1
- package/dist/capacitor/capacitor.d.ts +1 -1
- package/dist/capacitor/capacitor.d.ts.map +1 -1
- package/dist/capacitor/capacitor.js +7 -7
- package/dist/capacitor/capacitor.js.map +1 -1
- package/dist/commands/check.d.ts.map +1 -1
- package/dist/commands/check.js +21 -12
- package/dist/commands/check.js.map +1 -1
- package/dist/commands/device.d.ts.map +1 -1
- package/dist/commands/device.js +13 -1
- package/dist/commands/device.js.map +1 -1
- package/dist/commands/publish/git-phase.d.ts +1 -1
- package/dist/commands/publish/git-phase.d.ts.map +1 -1
- package/dist/commands/publish/git-phase.js +12 -22
- package/dist/commands/publish/git-phase.js.map +1 -1
- package/dist/commands/publish/npm-publisher.js +2 -2
- package/dist/commands/publish/npm-publisher.js.map +1 -1
- package/dist/commands/publish/publish-command.d.ts.map +1 -1
- package/dist/commands/publish/publish-command.js +3 -2
- package/dist/commands/publish/publish-command.js.map +1 -1
- package/dist/electron/electron.d.ts.map +1 -1
- package/dist/electron/electron.js +4 -5
- package/dist/electron/electron.js.map +1 -1
- package/dist/utils/shell-spawn.d.ts +6 -0
- package/dist/utils/shell-spawn.d.ts.map +1 -0
- package/dist/utils/shell-spawn.js +5 -0
- package/dist/utils/shell-spawn.js.map +1 -0
- package/package.json +5 -5
- package/src/capacitor/capacitor-android.ts +44 -0
- package/src/capacitor/capacitor-icon.ts +1 -1
- package/src/capacitor/capacitor-npm-config.ts +5 -4
- package/src/capacitor/capacitor.ts +8 -6
- package/src/commands/check.ts +21 -12
- package/src/commands/device.ts +13 -1
- package/src/commands/publish/git-phase.ts +12 -22
- package/src/commands/publish/npm-publisher.ts +2 -2
- package/src/commands/publish/publish-command.ts +3 -2
- package/src/electron/electron.ts +5 -5
- package/src/utils/shell-spawn.ts +10 -0
- package/tests/capacitor/capacitor-icon.spec.ts +23 -1
- package/tests/capacitor/capacitor-npm-config.acc.spec.ts +14 -6
- package/tests/commands/check.spec.ts +21 -0
- package/tests/commands/git-phase.acc.spec.ts +14 -11
- package/tests/commands/publish.spec.ts +22 -13
- 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
|
|
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
|
|
44
|
-
(c: unknown[]) => c[0] === "
|
|
43
|
+
const codexCalls = mocks.execa.mock.calls.filter(
|
|
44
|
+
(c: unknown[]) => c[0] === "codex",
|
|
45
45
|
);
|
|
46
|
-
expect(
|
|
47
|
-
expect((
|
|
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
|
|
59
|
-
(c: unknown[]) => c[0] === "
|
|
61
|
+
const codexCalls = mocks.execa.mock.calls.filter(
|
|
62
|
+
(c: unknown[]) => c[0] === "codex",
|
|
60
63
|
);
|
|
61
|
-
expect(
|
|
64
|
+
expect(codexCalls).toHaveLength(0);
|
|
62
65
|
});
|
|
63
66
|
|
|
64
|
-
it("throws when
|
|
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 === "
|
|
71
|
-
throw new Error("
|
|
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
|
|
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
|
-
//
|
|
402
|
-
const
|
|
403
|
-
(c: unknown[]) => c[0] === "
|
|
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(
|
|
406
|
-
expect((
|
|
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
|
|
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 === "
|
|
417
|
-
throw new Error("
|
|
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
|
|
443
|
-
const
|
|
444
|
-
(c: unknown[]) => c[0] === "
|
|
451
|
+
// No codex CLI calls
|
|
452
|
+
const codexCalls = mocks.execa.mock.calls.filter(
|
|
453
|
+
(c: unknown[]) => c[0] === "codex",
|
|
445
454
|
);
|
|
446
|
-
expect(
|
|
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
|
-
|
|
186
|
-
|
|
187
|
-
)
|
|
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");
|