@xylabs/ts-scripts-yarn3 4.0.0-rc.12 → 4.0.0-rc.13

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 (86) hide show
  1. package/dist/actions/clean-docs.mjs +14 -4
  2. package/dist/actions/clean-docs.mjs.map +1 -1
  3. package/dist/actions/clean-eslint.mjs +16 -4
  4. package/dist/actions/clean-eslint.mjs.map +1 -1
  5. package/dist/actions/dupdeps.mjs +3 -2
  6. package/dist/actions/dupdeps.mjs.map +1 -1
  7. package/dist/actions/index.mjs +35 -19
  8. package/dist/actions/index.mjs.map +1 -1
  9. package/dist/actions/package/clean-outputs.mjs +16 -2
  10. package/dist/actions/package/clean-outputs.mjs.map +1 -1
  11. package/dist/actions/package/clean-typescript.mjs +16 -2
  12. package/dist/actions/package/clean-typescript.mjs.map +1 -1
  13. package/dist/actions/package/clean.mjs +17 -4
  14. package/dist/actions/package/clean.mjs.map +1 -1
  15. package/dist/actions/package/compile/compile.mjs +12 -5
  16. package/dist/actions/package/compile/compile.mjs.map +1 -1
  17. package/dist/actions/package/compile/getCompilerOptions.mjs +4 -2
  18. package/dist/actions/package/compile/getCompilerOptions.mjs.map +1 -1
  19. package/dist/actions/package/compile/index.mjs +12 -5
  20. package/dist/actions/package/compile/index.mjs.map +1 -1
  21. package/dist/actions/package/compile/packageCompileTsc.mjs +4 -2
  22. package/dist/actions/package/compile/packageCompileTsc.mjs.map +1 -1
  23. package/dist/actions/package/compile/packageCompileTscTypes.mjs +4 -2
  24. package/dist/actions/package/compile/packageCompileTscTypes.mjs.map +1 -1
  25. package/dist/actions/package/compile/packageCompileTsup.mjs.map +1 -1
  26. package/dist/actions/package/index.mjs +66 -46
  27. package/dist/actions/package/index.mjs.map +1 -1
  28. package/dist/actions/package/publint.mjs.map +1 -1
  29. package/dist/actions/package/recompile.mjs +53 -33
  30. package/dist/actions/package/recompile.mjs.map +1 -1
  31. package/dist/actions/statics.mjs +3 -2
  32. package/dist/actions/statics.mjs.map +1 -1
  33. package/dist/bin/package/clean-outputs.mjs +14 -2
  34. package/dist/bin/package/clean-outputs.mjs.map +1 -1
  35. package/dist/bin/package/clean-typescript.mjs +14 -2
  36. package/dist/bin/package/clean-typescript.mjs.map +1 -1
  37. package/dist/bin/package/clean.mjs +15 -4
  38. package/dist/bin/package/clean.mjs.map +1 -1
  39. package/dist/bin/package/compile-only.mjs +12 -5
  40. package/dist/bin/package/compile-only.mjs.map +1 -1
  41. package/dist/bin/package/compile-tsup.mjs.map +1 -1
  42. package/dist/bin/package/compile.mjs +12 -5
  43. package/dist/bin/package/compile.mjs.map +1 -1
  44. package/dist/bin/package/publint.mjs.map +1 -1
  45. package/dist/bin/package/recompile.mjs +31 -13
  46. package/dist/bin/package/recompile.mjs.map +1 -1
  47. package/dist/bin/xy-ts.mjs +17 -6
  48. package/dist/bin/xy-ts.mjs.map +1 -1
  49. package/dist/bin/xy.mjs +17 -6
  50. package/dist/bin/xy.mjs.map +1 -1
  51. package/dist/index.d.ts +3 -1
  52. package/dist/index.mjs +36 -19
  53. package/dist/index.mjs.map +1 -1
  54. package/dist/lib/deleteGlob.mjs +19 -0
  55. package/dist/lib/deleteGlob.mjs.map +1 -0
  56. package/dist/lib/dependencies/DuplicateDetector.mjs +3 -2
  57. package/dist/lib/dependencies/DuplicateDetector.mjs.map +1 -1
  58. package/dist/lib/dependencies/detectDuplicateDependencies.mjs +3 -2
  59. package/dist/lib/dependencies/detectDuplicateDependencies.mjs.map +1 -1
  60. package/dist/lib/dependencies/index.mjs +3 -2
  61. package/dist/lib/dependencies/index.mjs.map +1 -1
  62. package/dist/lib/index.mjs +25 -5
  63. package/dist/lib/index.mjs.map +1 -1
  64. package/dist/lib/loadConfig.mjs +8 -3
  65. package/dist/lib/loadConfig.mjs.map +1 -1
  66. package/dist/xy/index.mjs +17 -6
  67. package/dist/xy/index.mjs.map +1 -1
  68. package/dist/xy/xy.mjs +17 -6
  69. package/dist/xy/xy.mjs.map +1 -1
  70. package/dist/xy/xyCommonCommands.mjs +14 -4
  71. package/dist/xy/xyCommonCommands.mjs.map +1 -1
  72. package/dist/xy/xyInstallCommands.mjs +3 -2
  73. package/dist/xy/xyInstallCommands.mjs.map +1 -1
  74. package/dist/xy/xyParseOptions.mjs.map +1 -1
  75. package/package.json +10 -13
  76. package/src/actions/clean-docs.ts +2 -3
  77. package/src/actions/clean-eslint.ts +3 -2
  78. package/src/actions/package/clean-outputs.ts +3 -2
  79. package/src/actions/package/clean-typescript.ts +3 -2
  80. package/src/actions/package/compile/getCompilerOptions.ts +1 -3
  81. package/src/actions/package/publint.ts +1 -1
  82. package/src/lib/deleteGlob.ts +13 -0
  83. package/src/lib/dependencies/DuplicateDetector.ts +1 -3
  84. package/src/lib/index.ts +1 -0
  85. package/src/lib/loadConfig.ts +2 -4
  86. package/src/xy/xyParseOptions.ts +1 -1
package/dist/index.mjs CHANGED
@@ -81,6 +81,19 @@ var createBuildConfig = /* @__PURE__ */ __name((location, module, target, outDir
81
81
  };
82
82
  }, "createBuildConfig");
83
83
 
84
+ // src/lib/deleteGlob.ts
85
+ import fs from "node:fs";
86
+ import { glob } from "glob";
87
+ var deleteGlob = /* @__PURE__ */ __name((globPath) => {
88
+ const files = glob.sync(globPath);
89
+ for (const file of files) {
90
+ fs.rmSync(file, {
91
+ recursive: true,
92
+ force: true
93
+ });
94
+ }
95
+ }, "deleteGlob");
96
+
84
97
  // src/lib/dependencies/detectDuplicateDependencies.ts
85
98
  import { execSync } from "node:child_process";
86
99
 
@@ -144,7 +157,6 @@ var safeExitAsync = /* @__PURE__ */ __name(async (func, exitOnFail = true) => {
144
157
  // src/lib/dependencies/DuplicateDetector.ts
145
158
  import { EOL } from "node:os";
146
159
  import chalk3 from "chalk";
147
- import uniq from "lodash/uniq.js";
148
160
 
149
161
  // src/lib/jsonFormatters.ts
150
162
  var multiLineToJSONArray = /* @__PURE__ */ __name((output) => {
@@ -215,7 +227,9 @@ var DuplicateDetector = class {
215
227
  acc.duplicateVersions.push(acc.currentVersion);
216
228
  }
217
229
  acc.duplicateVersions.push(version);
218
- acc.duplicateVersions = uniq(acc.duplicateVersions);
230
+ acc.duplicateVersions = [
231
+ ...new Set(acc.duplicateVersions)
232
+ ];
219
233
  }
220
234
  return acc;
221
235
  }
@@ -385,11 +399,13 @@ var generateIgnoreFiles = /* @__PURE__ */ __name((filename3, pkg) => {
385
399
  // src/lib/loadConfig.ts
386
400
  import chalk5 from "chalk";
387
401
  import { cosmiconfig } from "cosmiconfig";
388
- import merge from "lodash/merge.js";
389
402
  var config;
390
403
  var loadConfig = /* @__PURE__ */ __name(async (params) => {
391
404
  if (config) {
392
- return merge({}, config, params);
405
+ return {
406
+ ...config,
407
+ ...params
408
+ };
393
409
  }
394
410
  const cosmicConfigResult = await cosmiconfig("xy", {
395
411
  cache: true
@@ -399,7 +415,10 @@ var loadConfig = /* @__PURE__ */ __name(async (params) => {
399
415
  if (configFilePath) {
400
416
  console.log(chalk5.gray(`Loading config from ${configFilePath}`));
401
417
  }
402
- return merge({}, config, params);
418
+ return {
419
+ ...config,
420
+ ...params
421
+ };
403
422
  }, "loadConfig");
404
423
 
405
424
  // src/lib/parsedPackageJSON.ts
@@ -621,13 +640,10 @@ var cleanAll = /* @__PURE__ */ __name(({ verbose }) => {
621
640
  // src/actions/clean-docs.ts
622
641
  import path from "node:path";
623
642
  import chalk10 from "chalk";
624
- import { rimrafSync } from "rimraf";
625
643
  var cleanDocs = /* @__PURE__ */ __name(() => {
626
644
  const pkgName = process.env.npm_package_name;
627
645
  console.log(chalk10.green(`Cleaning Docs [${pkgName}]`));
628
- for (const { location } of yarnWorkspaces()) rimrafSync(path.join(location, "docs"), {
629
- glob: true
630
- });
646
+ for (const { location } of yarnWorkspaces()) deleteGlob(path.join(location, "docs"));
631
647
  return 0;
632
648
  }, "cleanDocs");
633
649
 
@@ -1316,7 +1332,6 @@ var npmignoreGen = /* @__PURE__ */ __name((pkg) => generateIgnoreFiles(filename2
1316
1332
  // src/actions/package/clean-outputs.ts
1317
1333
  import path3 from "node:path";
1318
1334
  import chalk19 from "chalk";
1319
- import { rimraf } from "rimraf";
1320
1335
  var packageCleanOutputs = /* @__PURE__ */ __name(async () => {
1321
1336
  const pkg = process.env.INIT_CWD ?? ".";
1322
1337
  const pkgName = process.env.npm_package_name;
@@ -1326,14 +1341,13 @@ var packageCleanOutputs = /* @__PURE__ */ __name(async () => {
1326
1341
  path3.join(pkg, "docs")
1327
1342
  ];
1328
1343
  console.log(chalk19.green(`Cleaning Outputs [${pkgName}]`));
1329
- await Promise.all(folders.map((folder) => rimraf(folder)));
1344
+ await Promise.all(folders.map((folder) => deleteGlob(folder)));
1330
1345
  return 0;
1331
1346
  }, "packageCleanOutputs");
1332
1347
 
1333
1348
  // src/actions/package/clean-typescript.ts
1334
1349
  import path4 from "node:path";
1335
1350
  import chalk20 from "chalk";
1336
- import { rimraf as rimraf2 } from "rimraf";
1337
1351
  var packageCleanTypescript = /* @__PURE__ */ __name(async () => {
1338
1352
  const pkg = process.env.INIT_CWD ?? ".";
1339
1353
  const pkgName = process.env.npm_package_name;
@@ -1343,7 +1357,7 @@ var packageCleanTypescript = /* @__PURE__ */ __name(async () => {
1343
1357
  path4.join(pkg, ".tsconfig.*"),
1344
1358
  path4.join(pkg, ".eslintcache")
1345
1359
  ];
1346
- await Promise.all(files.map((file) => rimraf2(file)));
1360
+ await Promise.all(files.map((file) => deleteGlob(file)));
1347
1361
  return 0;
1348
1362
  }, "packageCleanTypescript");
1349
1363
 
@@ -1359,11 +1373,11 @@ var packageClean = /* @__PURE__ */ __name(async () => {
1359
1373
  import chalk23 from "chalk";
1360
1374
 
1361
1375
  // src/actions/package/publint.ts
1362
- import { promises as fs } from "node:fs";
1376
+ import { promises as fs2 } from "node:fs";
1363
1377
  import chalk21 from "chalk";
1364
1378
  var packagePublint = /* @__PURE__ */ __name(async (params) => {
1365
1379
  const pkgDir = process.env.INIT_CWD;
1366
- const pkg = JSON.parse(await fs.readFile(`${pkgDir}/package.json`, "utf8"));
1380
+ const pkg = JSON.parse(await fs2.readFile(`${pkgDir}/package.json`, "utf8"));
1367
1381
  console.log(chalk21.green(`Publint: ${pkg.name}`));
1368
1382
  console.log(chalk21.gray(pkgDir));
1369
1383
  const { publint: publint2 } = await import("publint");
@@ -1407,7 +1421,6 @@ import { DiagnosticCategory, formatDiagnosticsWithColorAndContext, getLineAndCha
1407
1421
 
1408
1422
  // src/actions/package/compile/getCompilerOptions.ts
1409
1423
  import { createRequire } from "node:module";
1410
- import merge2 from "lodash/merge.js";
1411
1424
  import { findConfigFile, readConfigFile, sys } from "typescript";
1412
1425
  var getNested = /* @__PURE__ */ __name((config2) => {
1413
1426
  if (config2.extends) {
@@ -1427,7 +1440,10 @@ var getCompilerOptionsJSONFollowExtends = /* @__PURE__ */ __name((filename3) =>
1427
1440
  var getCompilerOptions = /* @__PURE__ */ __name((options, tsconfig = "tsconfig.json") => {
1428
1441
  const configFileName = findConfigFile("./", sys.fileExists, tsconfig);
1429
1442
  const configFileCompilerOptions = configFileName ? getCompilerOptionsJSONFollowExtends(configFileName) : void 0;
1430
- return merge2({}, configFileCompilerOptions, options);
1443
+ return {
1444
+ ...configFileCompilerOptions,
1445
+ ...options
1446
+ };
1431
1447
  }, "getCompilerOptions");
1432
1448
 
1433
1449
  // src/actions/package/compile/packageCompileTsc.ts
@@ -1486,9 +1502,9 @@ var packageCompileTsc = /* @__PURE__ */ __name(async (noEmit, config2, compilerO
1486
1502
  import { build as build2, defineConfig } from "tsup";
1487
1503
 
1488
1504
  // src/actions/package/compile/inputs.ts
1489
- import { glob } from "glob";
1505
+ import { glob as glob2 } from "glob";
1490
1506
  var getAllInputs2 = /* @__PURE__ */ __name((folder) => {
1491
- return glob.sync(`${folder}/**/*.*`, {
1507
+ return glob2.sync(`${folder}/**/*.*`, {
1492
1508
  ignore: [
1493
1509
  "**/*.spec.*",
1494
1510
  "**/*.stories.*",
@@ -2719,6 +2735,7 @@ export {
2719
2735
  dead,
2720
2736
  defaultBuildConfig,
2721
2737
  defaultReadFileSyncOptions,
2738
+ deleteGlob,
2722
2739
  deploy,
2723
2740
  deployMajor,
2724
2741
  deployMinor,