@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/index.d.ts CHANGED
@@ -484,13 +484,19 @@ declare const relintPackage: ({ pkg, fix, verbose, }: RelintParams & Required<Pi
484
484
  declare const relint: ({ pkg, verbose, incremental, fix, }?: RelintParams) => number;
485
485
  declare const relintAllPackages: ({ fix }?: RelintParams) => number;
486
486
 
487
- declare const retest: () => number;
487
+ interface RetestParams {
488
+ target?: string;
489
+ }
490
+ declare const retest: ({ target }?: RetestParams) => number;
488
491
 
489
492
  declare const sonar: () => number;
490
493
 
491
494
  declare const statics: () => number;
492
495
 
493
- declare const test: () => number;
496
+ interface TestParams {
497
+ target?: string;
498
+ }
499
+ declare const test: ({ target }?: TestParams) => number;
494
500
 
495
501
  declare const up: () => number;
496
502
 
@@ -529,4 +535,4 @@ declare const xy: () => Promise<{
529
535
 
530
536
  declare const xyParseOptions: () => Argv;
531
537
 
532
- export { type BuildParams, CROSS_PLATFORM_NEWLINE, type CleanPackageParams, type CleanParams, type CompileConfig, type CompileParams, type CopyAssetsParams, type CycleParams, DEFAULT_README_BODY, DEFAULT_README_TEMPLATE, type DepLintOptions, type DeplintConfig, DuplicateDetector, type DynamicShareConfig, type EntryMode, type GenDocsPackageParams, type GenDocsParams, INIT_CWD, LEGACY_COMMANDS_PREFIX, type LintPackageParams, type LintParams, type LiveShareConfig, type PackageCompileTscConfig, type PackageCompileTsupConfig, type PackageCopyAssetsParams, type PackageJsonEx, type PackagePublintParams, type PathConfig, type PublintPackageParams, type PublintParams, type ReadFileSyncOptions, type ReadmeConfig, type ReadmeGenParams, type ReadmeInitParams, type RebuildParams, type RecompilePackageParams, type RecompileParams, type RelintPackageParams, type RelintParams, type ScriptStep, WINDOWS_NEWLINE_REGEX, type Workspace, XYLABS_COMMANDS_PREFIX, XYLABS_RULES_PREFIX, XYLABS_SKILLS_PREFIX, type XyConfig, type XyConfigBase, type XyConfigLegacy, type XyTscConfig, type XyTsupConfig, applyLogoConfig, build, checkResult, claudeClean, claudeCommandTemplates, claudeCommands, claudeMdLocalTemplate, claudeMdProjectTemplate, claudeMdRuleTemplates, claudeRules, claudeSettings, claudeSkillTemplates, claudeSkills, clean, cleanAll, cleanDocs, cleanPackage, compile, compileAll, compilePackage, copyAssets, createBuildConfig, cycle, cycleAll, cyclePackage, dead, defaultBuildConfig, defaultReadFileSyncOptions, deleteGlob, deplint, deploy, deployMajor, deployMinor, deployNext, detectDuplicateDependencies, dupdeps, empty, fix, genDocs, genDocsAll, genDocsPackage, generateIgnoreFiles, generateReadmeFiles, gitignore, gitignoreGen, gitignoreTemplate, gitlint, gitlintFix, isYarnVersionOrGreater, knip, license, lint, lintAllPackages, lintPackage, loadConfig, loadPackageConfig, multiLineToJSONArray, notEmpty, npmignoreGen, packageClean, packageCleanOutputs, packageCleanTypescript, packageCompile, packageCompileTsc, packageCompileTsup, packageCopyAssets, packageCycle, packageGenDocs, packageLint, packageLintMonorepo, packagePublint, packageRecompile, parsedPackageJSON, processEx, publint, publintAll, publintPackage, publish, readLines, readNonEmptyLines, readmeGen, readmeInit, rebuild, recompile, recompileAll, recompilePackage, reinstall, relint, relintAllPackages, relintPackage, resolveTemplatePath, retest, runStepAsync, runSteps, runStepsAsync, runXy, runXyWithWarning, safeExit, safeExitAsync, scaffoldTemplate, sonar, statics, test, tryReadFileSync, tryRunLocalScript, tsupOptions, union, up, updateYarnPlugins, updateYarnVersion, updo, withErrnoException, withError, writeLines, xy, xyBuildCommands, xyCommonCommands, xyDeployCommands, xyInstallCommands, xyLintCommands, xyParseOptions, yarn3Only, yarnWorkspace, yarnWorkspaces };
538
+ export { type BuildParams, CROSS_PLATFORM_NEWLINE, type CleanPackageParams, type CleanParams, type CompileConfig, type CompileParams, type CopyAssetsParams, type CycleParams, DEFAULT_README_BODY, DEFAULT_README_TEMPLATE, type DepLintOptions, type DeplintConfig, DuplicateDetector, type DynamicShareConfig, type EntryMode, type GenDocsPackageParams, type GenDocsParams, INIT_CWD, LEGACY_COMMANDS_PREFIX, type LintPackageParams, type LintParams, type LiveShareConfig, type PackageCompileTscConfig, type PackageCompileTsupConfig, type PackageCopyAssetsParams, type PackageJsonEx, type PackagePublintParams, type PathConfig, type PublintPackageParams, type PublintParams, type ReadFileSyncOptions, type ReadmeConfig, type ReadmeGenParams, type ReadmeInitParams, type RebuildParams, type RecompilePackageParams, type RecompileParams, type RelintPackageParams, type RelintParams, type RetestParams, type ScriptStep, type TestParams, WINDOWS_NEWLINE_REGEX, type Workspace, XYLABS_COMMANDS_PREFIX, XYLABS_RULES_PREFIX, XYLABS_SKILLS_PREFIX, type XyConfig, type XyConfigBase, type XyConfigLegacy, type XyTscConfig, type XyTsupConfig, applyLogoConfig, build, checkResult, claudeClean, claudeCommandTemplates, claudeCommands, claudeMdLocalTemplate, claudeMdProjectTemplate, claudeMdRuleTemplates, claudeRules, claudeSettings, claudeSkillTemplates, claudeSkills, clean, cleanAll, cleanDocs, cleanPackage, compile, compileAll, compilePackage, copyAssets, createBuildConfig, cycle, cycleAll, cyclePackage, dead, defaultBuildConfig, defaultReadFileSyncOptions, deleteGlob, deplint, deploy, deployMajor, deployMinor, deployNext, detectDuplicateDependencies, dupdeps, empty, fix, genDocs, genDocsAll, genDocsPackage, generateIgnoreFiles, generateReadmeFiles, gitignore, gitignoreGen, gitignoreTemplate, gitlint, gitlintFix, isYarnVersionOrGreater, knip, license, lint, lintAllPackages, lintPackage, loadConfig, loadPackageConfig, multiLineToJSONArray, notEmpty, npmignoreGen, packageClean, packageCleanOutputs, packageCleanTypescript, packageCompile, packageCompileTsc, packageCompileTsup, packageCopyAssets, packageCycle, packageGenDocs, packageLint, packageLintMonorepo, packagePublint, packageRecompile, parsedPackageJSON, processEx, publint, publintAll, publintPackage, publish, readLines, readNonEmptyLines, readmeGen, readmeInit, rebuild, recompile, recompileAll, recompilePackage, reinstall, relint, relintAllPackages, relintPackage, resolveTemplatePath, retest, runStepAsync, runSteps, runStepsAsync, runXy, runXyWithWarning, safeExit, safeExitAsync, scaffoldTemplate, sonar, statics, test, tryReadFileSync, tryRunLocalScript, tsupOptions, union, up, updateYarnPlugins, updateYarnVersion, updo, withErrnoException, withError, writeLines, xy, xyBuildCommands, xyCommonCommands, xyDeployCommands, xyInstallCommands, xyLintCommands, xyParseOptions, yarn3Only, yarnWorkspace, yarnWorkspaces };
package/dist/index.mjs CHANGED
@@ -3658,10 +3658,20 @@ var relintAllPackages = ({ fix: fix2 = false } = {}) => {
3658
3658
  };
3659
3659
 
3660
3660
  // src/actions/retest.ts
3661
- var retest = () => {
3662
- return runSteps("Test", [
3661
+ function isWorkspace(target) {
3662
+ return yarnWorkspaces().some((ws) => ws.name === target);
3663
+ }
3664
+ var retest = ({ target } = {}) => {
3665
+ if (target && isWorkspace(target)) {
3666
+ return runSteps(`Re-Test [${target}]`, [
3667
+ ["yarn", ["workspace", target, "run", "vitest", "--clearCache"]],
3668
+ ["yarn", ["workspace", target, "run", "vitest", "."]]
3669
+ ]);
3670
+ }
3671
+ const path14 = target ?? ".";
3672
+ return runSteps("Re-Test", [
3663
3673
  ["yarn", ["vitest", "--clearCache"]],
3664
- ["yarn", ["vitest", "."]]
3674
+ ["yarn", ["vitest", path14]]
3665
3675
  ]);
3666
3676
  };
3667
3677
 
@@ -3680,8 +3690,15 @@ var statics = () => {
3680
3690
  };
3681
3691
 
3682
3692
  // src/actions/test.ts
3683
- var test = () => {
3684
- return runSteps("Test", [["yarn", ["vitest", "."]]]);
3693
+ function isWorkspace2(target) {
3694
+ return yarnWorkspaces().some((ws) => ws.name === target);
3695
+ }
3696
+ var test = ({ target } = {}) => {
3697
+ if (target && isWorkspace2(target)) {
3698
+ return runSteps(`Test [${target}]`, [["yarn", ["workspace", target, "run", "vitest", "."]]]);
3699
+ }
3700
+ const path14 = target ?? ".";
3701
+ return runSteps("Test", [["yarn", ["vitest", path14]]]);
3685
3702
  };
3686
3703
 
3687
3704
  // src/actions/up.ts
@@ -4081,21 +4098,27 @@ var readmeCommand = {
4081
4098
 
4082
4099
  // src/xy/common/retestCommand.ts
4083
4100
  var retestCommand = {
4084
- command: "retest",
4085
- describe: "Re-Test - Run Jest Tests with cleaned cache",
4101
+ command: "retest [target]",
4102
+ describe: "Re-Test - Run Vitest Tests with cleaned cache",
4103
+ builder: (yargs2) => {
4104
+ return yargs2.positional("target", { describe: "Package name or file/folder path to test" });
4105
+ },
4086
4106
  handler: (argv) => {
4087
- if (argv.verbose) console.log("Re-Testing");
4088
- process.exitCode = retest();
4107
+ if (argv.verbose) console.log(`Re-Testing: ${argv.target ?? "all"}`);
4108
+ process.exitCode = retest({ target: argv.target });
4089
4109
  }
4090
4110
  };
4091
4111
 
4092
4112
  // src/xy/common/testCommand.ts
4093
4113
  var testCommand = {
4094
- command: "test",
4095
- describe: "Test - Run Jest Tests",
4114
+ command: "test [target]",
4115
+ describe: "Test - Run Vitest Tests",
4116
+ builder: (yargs2) => {
4117
+ return yargs2.positional("target", { describe: "Package name or file/folder path to test" });
4118
+ },
4096
4119
  handler: (argv) => {
4097
- if (argv.verbose) console.log("Testing");
4098
- process.exitCode = test();
4120
+ if (argv.verbose) console.log(`Testing: ${argv.target ?? "all"}`);
4121
+ process.exitCode = test({ target: argv.target });
4099
4122
  }
4100
4123
  };
4101
4124