@xylabs/ts-scripts-yarn3 7.4.25 → 7.4.27

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/xy/xy.mjs CHANGED
@@ -2806,10 +2806,20 @@ var relintAllPackages = ({ fix: fix2 = false } = {}) => {
2806
2806
  };
2807
2807
 
2808
2808
  // src/actions/retest.ts
2809
- var retest = () => {
2810
- return runSteps("Test", [
2809
+ function isWorkspace(target) {
2810
+ return yarnWorkspaces().some((ws) => ws.name === target);
2811
+ }
2812
+ var retest = ({ target } = {}) => {
2813
+ if (target && isWorkspace(target)) {
2814
+ return runSteps(`Re-Test [${target}]`, [
2815
+ ["yarn", ["workspace", target, "run", "vitest", "--clearCache"]],
2816
+ ["yarn", ["workspace", target, "run", "vitest", "."]]
2817
+ ]);
2818
+ }
2819
+ const path8 = target ?? ".";
2820
+ return runSteps("Re-Test", [
2811
2821
  ["yarn", ["vitest", "--clearCache"]],
2812
- ["yarn", ["vitest", "."]]
2822
+ ["yarn", ["vitest", path8]]
2813
2823
  ]);
2814
2824
  };
2815
2825
 
@@ -2828,8 +2838,15 @@ var statics = () => {
2828
2838
  };
2829
2839
 
2830
2840
  // src/actions/test.ts
2831
- var test = () => {
2832
- return runSteps("Test", [["yarn", ["vitest", "."]]]);
2841
+ function isWorkspace2(target) {
2842
+ return yarnWorkspaces().some((ws) => ws.name === target);
2843
+ }
2844
+ var test = ({ target } = {}) => {
2845
+ if (target && isWorkspace2(target)) {
2846
+ return runSteps(`Test [${target}]`, [["yarn", ["workspace", target, "run", "vitest", "."]]]);
2847
+ }
2848
+ const path8 = target ?? ".";
2849
+ return runSteps("Test", [["yarn", ["vitest", path8]]]);
2833
2850
  };
2834
2851
 
2835
2852
  // src/actions/up.ts
@@ -3221,21 +3238,27 @@ var readmeCommand = {
3221
3238
 
3222
3239
  // src/xy/common/retestCommand.ts
3223
3240
  var retestCommand = {
3224
- command: "retest",
3225
- describe: "Re-Test - Run Jest Tests with cleaned cache",
3241
+ command: "retest [target]",
3242
+ describe: "Re-Test - Run Vitest Tests with cleaned cache",
3243
+ builder: (yargs2) => {
3244
+ return yargs2.positional("target", { describe: "Package name or file/folder path to test" });
3245
+ },
3226
3246
  handler: (argv) => {
3227
- if (argv.verbose) console.log("Re-Testing");
3228
- process.exitCode = retest();
3247
+ if (argv.verbose) console.log(`Re-Testing: ${argv.target ?? "all"}`);
3248
+ process.exitCode = retest({ target: argv.target });
3229
3249
  }
3230
3250
  };
3231
3251
 
3232
3252
  // src/xy/common/testCommand.ts
3233
3253
  var testCommand = {
3234
- command: "test",
3235
- describe: "Test - Run Jest Tests",
3254
+ command: "test [target]",
3255
+ describe: "Test - Run Vitest Tests",
3256
+ builder: (yargs2) => {
3257
+ return yargs2.positional("target", { describe: "Package name or file/folder path to test" });
3258
+ },
3236
3259
  handler: (argv) => {
3237
- if (argv.verbose) console.log("Testing");
3238
- process.exitCode = test();
3260
+ if (argv.verbose) console.log(`Testing: ${argv.target ?? "all"}`);
3261
+ process.exitCode = test({ target: argv.target });
3239
3262
  }
3240
3263
  };
3241
3264