@art-work/cli 0.1.2 → 0.1.3

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 (31) hide show
  1. package/dist/cjs/commands/checkouts/runCheckoutsRun.d.ts +1 -1
  2. package/dist/cjs/commands/checkouts/runCheckoutsRun.d.ts.map +1 -1
  3. package/dist/cjs/index.js +9 -8
  4. package/dist/cjs/index.js.map +2 -2
  5. package/dist/cjs/private/commands/checkouts/doCheckoutRun.d.ts +1 -1
  6. package/dist/cjs/private/commands/checkouts/doCheckoutRun.d.ts.map +1 -1
  7. package/dist/cjs/private/exec/runCommandInDirectory.d.ts +1 -1
  8. package/dist/cjs/private/exec/runCommandInDirectory.d.ts.map +1 -1
  9. package/dist/commands/checkouts/runCheckoutsRun.d.ts +1 -1
  10. package/dist/commands/checkouts/runCheckoutsRun.d.ts.map +1 -1
  11. package/dist/esm/commands/checkouts/runCheckoutRun.test.mjs +6 -17
  12. package/dist/esm/commands/checkouts/runCheckoutRun.test.mjs.map +2 -2
  13. package/dist/esm/commands/checkouts/runCheckoutsRun.d.ts +1 -1
  14. package/dist/esm/commands/checkouts/runCheckoutsRun.d.ts.map +1 -1
  15. package/dist/esm/commands/checkouts/runCheckoutsRun.mjs +1 -1
  16. package/dist/esm/commands/checkouts/runCheckoutsRun.mjs.map +2 -2
  17. package/dist/esm/index.mjs +1 -1
  18. package/dist/esm/index.mjs.map +2 -2
  19. package/dist/esm/private/commands/checkouts/doCheckoutRun.d.ts +1 -1
  20. package/dist/esm/private/commands/checkouts/doCheckoutRun.d.ts.map +1 -1
  21. package/dist/esm/private/commands/checkouts/doCheckoutRun.mjs +6 -4
  22. package/dist/esm/private/commands/checkouts/doCheckoutRun.mjs.map +2 -2
  23. package/dist/esm/private/exec/runCommandInDirectory.d.ts +1 -1
  24. package/dist/esm/private/exec/runCommandInDirectory.d.ts.map +1 -1
  25. package/dist/esm/private/exec/runCommandInDirectory.mjs +1 -2
  26. package/dist/esm/private/exec/runCommandInDirectory.mjs.map +2 -2
  27. package/dist/private/commands/checkouts/doCheckoutRun.d.ts +1 -1
  28. package/dist/private/commands/checkouts/doCheckoutRun.d.ts.map +1 -1
  29. package/dist/private/exec/runCommandInDirectory.d.ts +1 -1
  30. package/dist/private/exec/runCommandInDirectory.d.ts.map +1 -1
  31. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
1
  import type { WorkspaceContext } from '../../context/createWorkspaceContext';
2
2
  import type { Checkout } from '../../store/createCheckout';
3
- export declare function doCheckoutRun(ctx: WorkspaceContext, checkout: Checkout, command: string[]): Promise<Checkout | null>;
3
+ export declare function doCheckoutRun(ctx: WorkspaceContext, checkout: Checkout, command: string): Promise<Checkout | null>;
4
4
  //# sourceMappingURL=doCheckoutRun.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"doCheckoutRun.d.ts","sourceRoot":"","sources":["../../../../../src/private/commands/checkouts/doCheckoutRun.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAI7E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAG3D,wBAAsB,aAAa,CAClC,GAAG,EAAE,gBAAgB,EACrB,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,MAAM,EAAE,GACf,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,CAwC1B"}
1
+ {"version":3,"file":"doCheckoutRun.d.ts","sourceRoot":"","sources":["../../../../../src/private/commands/checkouts/doCheckoutRun.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAI7E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAG3D,wBAAsB,aAAa,CAClC,GAAG,EAAE,gBAAgB,EACrB,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,MAAM,GACb,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,CAuC1B"}
@@ -3,5 +3,5 @@ export interface RunCommandOutcome {
3
3
  output: string;
4
4
  error: string;
5
5
  }
6
- export declare function runCommandInDirectory(dir: string, command: string[]): Promise<RunCommandOutcome>;
6
+ export declare function runCommandInDirectory(dir: string, command: string): Promise<RunCommandOutcome>;
7
7
  //# sourceMappingURL=runCommandInDirectory.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"runCommandInDirectory.d.ts","sourceRoot":"","sources":["../../../../src/private/exec/runCommandInDirectory.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,iBAAiB;IACjC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACd;AAED,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAWhG"}
1
+ {"version":3,"file":"runCommandInDirectory.d.ts","sourceRoot":"","sources":["../../../../src/private/exec/runCommandInDirectory.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,iBAAiB;IACjC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACd;AAED,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAU9F"}
@@ -1,6 +1,6 @@
1
1
  import type { WorkspaceContext } from '../../private/context/createWorkspaceContext';
2
2
  export declare function runCheckoutsRun(ctx: WorkspaceContext, options: {
3
- command: string[];
3
+ command: string;
4
4
  checkouts?: string[];
5
5
  all?: boolean;
6
6
  }): Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"runCheckoutsRun.d.ts","sourceRoot":"","sources":["../../../src/commands/checkouts/runCheckoutsRun.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8CAA8C,CAAC;AASrF,wBAAsB,eAAe,CACpC,GAAG,EAAE,gBAAgB,EACrB,OAAO,EAAE;IAAE,OAAO,EAAE,MAAM,EAAE,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IAAC,GAAG,CAAC,EAAE,OAAO,CAAA;CAAE,GACjE,OAAO,CAAC,IAAI,CAAC,CA2Bf"}
1
+ {"version":3,"file":"runCheckoutsRun.d.ts","sourceRoot":"","sources":["../../../src/commands/checkouts/runCheckoutsRun.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8CAA8C,CAAC;AASrF,wBAAsB,eAAe,CACpC,GAAG,EAAE,gBAAgB,EACrB,OAAO,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IAAC,GAAG,CAAC,EAAE,OAAO,CAAA;CAAE,GAC/D,OAAO,CAAC,IAAI,CAAC,CA2Bf"}
@@ -2658,7 +2658,7 @@ describe2("checkouts run command", () => {
2658
2658
  await initWorkingRepoTest(repoDir, bareDir);
2659
2659
  writeRepoMockRecord(tempDir, "Art", bareDir);
2660
2660
  writeCheckoutMockRecord(tempDir, "Art", "Art", "art");
2661
- await runCheckoutsRun(ctx, { command: ["touch", "marker.txt"] });
2661
+ await runCheckoutsRun(ctx, { command: "touch marker.txt" });
2662
2662
  globalExpect(existsSync(join(repoDir, "marker.txt"))).toBe(false);
2663
2663
  globalExpect(ctx.log.all().filter((op) => op.operation === "run")).toHaveLength(0);
2664
2664
  globalExpect(console.error).toHaveBeenCalledWith(
@@ -2678,24 +2678,13 @@ describe2("checkouts run command", () => {
2678
2678
  writeCheckoutMockRecord(tempDir, "Art", "Art", "art");
2679
2679
  writeRepoMockRecord(tempDir, "Purrception", purrBare);
2680
2680
  writeCheckoutMockRecord(tempDir, "Purrception", "Purrception", "purr");
2681
- await runCheckoutsRun(ctx, { command: ["touch", "marker.txt"], all: true });
2681
+ await runCheckoutsRun(ctx, { command: "touch marker.txt", all: true });
2682
2682
  globalExpect(existsSync(join(artDir, "marker.txt"))).toBe(true);
2683
2683
  globalExpect(existsSync(join(purrDir, "marker.txt"))).toBe(true);
2684
2684
  const runOps = ctx.log.all().filter((op) => op.operation === "run");
2685
2685
  globalExpect(runOps).toHaveLength(2);
2686
2686
  globalExpect(runOps.map((op) => op.outcome)).toEqual(["success", "success"]);
2687
2687
  });
2688
- it2("runs a multi-word command passed as a single string", async () => {
2689
- const tempDir = makeTempDir(tempDirs);
2690
- const ctx = createMockCommandContext(tempDir);
2691
- const artBare = makeTempDir(tempDirs);
2692
- const artDir = join(tempDir, ctx.config.clone.path, "art");
2693
- await initWorkingRepoTest(artDir, artBare);
2694
- writeRepoMockRecord(tempDir, "Art", artBare);
2695
- writeCheckoutMockRecord(tempDir, "Art", "Art", "art");
2696
- await runCheckoutsRun(ctx, { command: ["touch marker.txt"], all: true });
2697
- globalExpect(existsSync(join(artDir, "marker.txt"))).toBe(true);
2698
- });
2699
2688
  it2("runs only in checkouts matching the pattern", async () => {
2700
2689
  const tempDir = makeTempDir(tempDirs);
2701
2690
  const ctx = createMockCommandContext(tempDir);
@@ -2709,7 +2698,7 @@ describe2("checkouts run command", () => {
2709
2698
  writeCheckoutMockRecord(tempDir, "Art", "Art", "art");
2710
2699
  writeRepoMockRecord(tempDir, "Purrception", purrBare);
2711
2700
  writeCheckoutMockRecord(tempDir, "Purrception", "Purrception", "purr");
2712
- await runCheckoutsRun(ctx, { command: ["touch", "marker.txt"], checkouts: ["art*"] });
2701
+ await runCheckoutsRun(ctx, { command: "touch marker.txt", checkouts: ["art*"] });
2713
2702
  globalExpect(existsSync(join(artDir, "marker.txt"))).toBe(true);
2714
2703
  globalExpect(existsSync(join(purrDir, "marker.txt"))).toBe(false);
2715
2704
  const runOps = ctx.log.all().filter((op) => op.operation === "run");
@@ -2730,7 +2719,7 @@ describe2("checkouts run command", () => {
2730
2719
  writeCheckoutMockRecord(tempDir, "Art", "Art", "art");
2731
2720
  writeRepoMockRecord(tempDir, "Purrception", purrBare);
2732
2721
  writeCheckoutMockRecord(tempDir, "Purrception", "Purrception", "purr");
2733
- await runCheckoutsRun(ctx, { command: ["sh", "-c", "exit 1"], all: true });
2722
+ await runCheckoutsRun(ctx, { command: 'sh -c "exit 1"', all: true });
2734
2723
  const runOps = ctx.log.all().filter((op) => op.operation === "run");
2735
2724
  globalExpect(runOps).toHaveLength(2);
2736
2725
  globalExpect(runOps.map((op) => op.outcome)).toEqual(["failure", "failure"]);
@@ -2739,7 +2728,7 @@ describe2("checkouts run command", () => {
2739
2728
  it2("warns and executes nothing when no checkout matches the pattern", async () => {
2740
2729
  const tempDir = makeTempDir(tempDirs);
2741
2730
  const ctx = createMockCommandContext(tempDir);
2742
- await runCheckoutsRun(ctx, { command: ["touch", "marker.txt"], checkouts: ["nonexistent"] });
2731
+ await runCheckoutsRun(ctx, { command: "touch marker.txt", checkouts: ["nonexistent"] });
2743
2732
  globalExpect(console.warn).toHaveBeenCalledWith('no checkout matches pattern: "nonexistent"');
2744
2733
  globalExpect(ctx.log.all().filter((op) => op.operation === "run")).toHaveLength(0);
2745
2734
  });
@@ -2748,7 +2737,7 @@ describe2("checkouts run command", () => {
2748
2737
  const ctx = createMockCommandContext(tempDir);
2749
2738
  writeRepoMockRecord(tempDir, "Missing", "git@example.com:missing.git");
2750
2739
  writeCheckoutMockRecord(tempDir, "Missing", "Missing", "missing");
2751
- await runCheckoutsRun(ctx, { command: ["touch", "marker.txt"], all: true });
2740
+ await runCheckoutsRun(ctx, { command: "touch marker.txt", all: true });
2752
2741
  const runOps = ctx.log.all().filter((op) => op.operation === "run");
2753
2742
  globalExpect(runOps).toHaveLength(1);
2754
2743
  globalExpect(runOps[0].outcome).toBe("failure");