@xylabs/ts-scripts-yarn3 4.0.0-rc.4 → 4.0.0-rc.6

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.mjs CHANGED
@@ -362,7 +362,7 @@ var mergeEntries = /* @__PURE__ */ __name((a, b) => [
362
362
  ].sort(), "mergeEntries");
363
363
  var generateIgnoreFiles = /* @__PURE__ */ __name((filename3, pkg) => {
364
364
  console.log(chalk4.green(`Generate ${filename3} Files`));
365
- const cwd4 = INIT_CWD() ?? ".";
365
+ const cwd3 = INIT_CWD() ?? ".";
366
366
  const workspaces = pkg ? [
367
367
  yarnWorkspace(pkg)
368
368
  ] : yarnWorkspaces();
@@ -370,7 +370,7 @@ var generateIgnoreFiles = /* @__PURE__ */ __name((filename3, pkg) => {
370
370
  const writeEntries = /* @__PURE__ */ __name((location, entries) => writeLines(`${location}/${filename3}`, entries), "writeEntries");
371
371
  const results = workspaces.map(({ location, name }) => {
372
372
  try {
373
- writeEntries(location, mergeEntries(readEntries(cwd4), readEntries(location)));
373
+ writeEntries(location, mergeEntries(readEntries(cwd3), readEntries(location)));
374
374
  return 0;
375
375
  } catch (ex) {
376
376
  const error = ex;
@@ -1347,7 +1347,7 @@ var packageClean = /* @__PURE__ */ __name(async () => {
1347
1347
  }, "packageClean");
1348
1348
 
1349
1349
  // src/actions/package/compile/compile.ts
1350
- import chalk24 from "chalk";
1350
+ import chalk23 from "chalk";
1351
1351
 
1352
1352
  // src/actions/package/publint.ts
1353
1353
  import { promises as fs } from "node:fs";
@@ -1512,86 +1512,23 @@ var buildEntries = /* @__PURE__ */ __name((folder, entryMode, verbose = false) =
1512
1512
  }
1513
1513
  }, "buildEntries");
1514
1514
 
1515
- // src/actions/package/compile/packageCompileTscTypes.ts
1516
- import { cwd as cwd2 } from "node:process";
1517
- import chalk23 from "chalk";
1518
- import { createProgramFromConfig as createProgramFromConfig2 } from "tsc-prog";
1519
- import { DiagnosticCategory as DiagnosticCategory2 } from "typescript";
1520
- var packageCompileTscTypes = /* @__PURE__ */ __name((folder = "src", { verbose } = {}, compilerOptionsParam) => {
1521
- const pkg = process.env.INIT_CWD ?? cwd2();
1522
- if (verbose) {
1523
- console.log(`Compiling types with TSC [${pkg}]`);
1524
- }
1525
- const compilerOptions = {
1526
- ...getCompilerOptions({
1527
- declaration: true,
1528
- emitDeclarationOnly: true,
1529
- outDir: "dist",
1530
- removeComments: true,
1531
- skipDefaultLibCheck: true,
1532
- skipLibCheck: true,
1533
- sourceMap: true
1534
- }),
1535
- ...compilerOptionsParam
1536
- };
1537
- const files = buildEntries(folder, "all");
1538
- const result = createProgramFromConfig2({
1539
- basePath: pkg ?? cwd2(),
1540
- compilerOptions,
1541
- exclude: [
1542
- "dist",
1543
- "docs",
1544
- "**/*.spec.*",
1545
- "**/*.stories.*",
1546
- "src/**/spec/**/*"
1547
- ],
1548
- files
1549
- }).emit();
1550
- const diagResults = result.diagnostics.length;
1551
- for (const diag of result.diagnostics) {
1552
- switch (diag.category) {
1553
- case DiagnosticCategory2.Error: {
1554
- console.error(chalk23.red(diag.messageText));
1555
- console.error(chalk23.grey(pkg));
1556
- console.error(chalk23.blue(diag.file?.fileName));
1557
- break;
1558
- }
1559
- case DiagnosticCategory2.Warning: {
1560
- console.error(chalk23.yellow(diag.messageText));
1561
- console.error(chalk23.grey(pkg));
1562
- console.error(chalk23.blue(diag.file?.fileName));
1563
- break;
1564
- }
1565
- case DiagnosticCategory2.Suggestion: {
1566
- console.error(chalk23.white(diag.messageText));
1567
- console.error(chalk23.grey(pkg));
1568
- console.error(chalk23.blue(diag.file?.fileName));
1569
- break;
1570
- }
1571
- }
1572
- }
1573
- return diagResults;
1574
- }, "packageCompileTscTypes");
1575
-
1576
1515
  // src/actions/package/compile/packageCompileTsup.ts
1577
- var compileFolder = /* @__PURE__ */ __name(async (folder, entryMode = "single", options, verbose) => {
1516
+ var compileFolder = /* @__PURE__ */ __name(async (folder, entryMode = "single", options, _verbose) => {
1578
1517
  const outDir = options?.outDir ?? "dist";
1579
1518
  const entry = buildEntries(folder, entryMode);
1580
1519
  const optionsResult = defineConfig({
1581
1520
  bundle: true,
1582
1521
  cjsInterop: true,
1583
1522
  clean: true,
1584
- dts: false,
1523
+ dts: true,
1585
1524
  entry,
1586
1525
  format: [
1587
1526
  "esm"
1588
1527
  ],
1589
- // minify: true,
1590
1528
  outDir,
1591
1529
  silent: true,
1592
1530
  sourcemap: true,
1593
1531
  splitting: false,
1594
- // terserOptions: { format: { comments: false } },
1595
1532
  tsconfig: "tsconfig.json",
1596
1533
  ...options
1597
1534
  });
@@ -1606,11 +1543,6 @@ var compileFolder = /* @__PURE__ */ __name(async (folder, entryMode = "single",
1606
1543
  ];
1607
1544
  }))).flat();
1608
1545
  await Promise.all(optionsList.map((options2) => build2(options2)));
1609
- packageCompileTscTypes(folder, {
1610
- verbose
1611
- }, {
1612
- outDir
1613
- });
1614
1546
  return 0;
1615
1547
  }, "compileFolder");
1616
1548
  var packageCompileTsup = /* @__PURE__ */ __name(async (config2) => {
@@ -1653,10 +1585,7 @@ var packageCompileTsup = /* @__PURE__ */ __name(async (config2) => {
1653
1585
  sourcemap: true,
1654
1586
  target: "esnext"
1655
1587
  };
1656
- return await packageCompileTsc(true, {
1657
- publint: false,
1658
- verbose
1659
- }) || (await Promise.all(Object.entries(compileForNode).map(async ([folder, options]) => {
1588
+ return (await Promise.all(Object.entries(compileForNode).map(async ([folder, options]) => {
1660
1589
  const inEsBuildOptions = typeof compile2?.node?.esbuildOptions === "object" ? compile2?.node?.esbuildOptions : {};
1661
1590
  return folder ? await compileFolder(folder, compile2?.entryMode, {
1662
1591
  ...standardOptions,
@@ -1701,7 +1630,7 @@ var packageCompileTsup = /* @__PURE__ */ __name(async (config2) => {
1701
1630
  // src/actions/package/compile/compile.ts
1702
1631
  var packageCompile = /* @__PURE__ */ __name(async (inConfig = {}) => {
1703
1632
  const pkg = process.env.INIT_CWD;
1704
- console.log(chalk24.green(`Compiling ${pkg}`));
1633
+ console.log(chalk23.green(`Compiling ${pkg}`));
1705
1634
  const config2 = await loadConfig(inConfig);
1706
1635
  const publint2 = config2.publint;
1707
1636
  const mode = config2.compile?.mode ?? "tsup";
@@ -1721,7 +1650,7 @@ var packageCompile = /* @__PURE__ */ __name(async (inConfig = {}) => {
1721
1650
 
1722
1651
  // src/actions/package/copy-assets.ts
1723
1652
  import path5 from "node:path/posix";
1724
- import chalk25 from "chalk";
1653
+ import chalk24 from "chalk";
1725
1654
  import cpy2 from "cpy";
1726
1655
  var copyTargetAssets2 = /* @__PURE__ */ __name(async (target, name, location) => {
1727
1656
  try {
@@ -1740,7 +1669,7 @@ var copyTargetAssets2 = /* @__PURE__ */ __name(async (target, name, location) =>
1740
1669
  flat: false
1741
1670
  });
1742
1671
  if (values.length > 0) {
1743
- console.log(chalk25.green(`Copying Assets [${target.toUpperCase()}] - ${name} - ${location}`));
1672
+ console.log(chalk24.green(`Copying Assets [${target.toUpperCase()}] - ${name} - ${location}`));
1744
1673
  }
1745
1674
  for (const value of values) {
1746
1675
  console.log(`${value.split("/").pop()} => ./dist/${target}`);
@@ -1770,8 +1699,8 @@ var packageCopyAssets = /* @__PURE__ */ __name(async ({ target }) => {
1770
1699
 
1771
1700
  // src/actions/package/deps.ts
1772
1701
  import { existsSync as existsSync5, readFileSync as readFileSync5 } from "node:fs";
1773
- import { cwd as cwd3 } from "node:process";
1774
- import chalk26 from "chalk";
1702
+ import { cwd as cwd2 } from "node:process";
1703
+ import chalk25 from "chalk";
1775
1704
  import depcheck from "depcheck";
1776
1705
  var special = depcheck.special;
1777
1706
  var defaultIgnorePatterns = [
@@ -1798,21 +1727,21 @@ var defaultIgnoreDevPatterns = [
1798
1727
  var reportUnused = /* @__PURE__ */ __name((name, unused) => {
1799
1728
  if (unused.length > 0) {
1800
1729
  const message = [
1801
- chalk26.yellow(`${unused.length} Unused ${name}`)
1730
+ chalk25.yellow(`${unused.length} Unused ${name}`)
1802
1731
  ];
1803
- for (const value of unused) message.push(chalk26.gray(` ${value}`));
1732
+ for (const value of unused) message.push(chalk25.gray(` ${value}`));
1804
1733
  console.log(message.join("\n"));
1805
1734
  }
1806
1735
  }, "reportUnused");
1807
1736
  var reportMissing = /* @__PURE__ */ __name((name, missing) => {
1808
1737
  if (Object.keys(missing).length > 0) {
1809
1738
  const message = [
1810
- chalk26.yellow(`${Object.entries(missing).length} Missing ${name}`)
1739
+ chalk25.yellow(`${Object.entries(missing).length} Missing ${name}`)
1811
1740
  ];
1812
1741
  for (const [key, value] of Object.entries(missing)) {
1813
- message.push(`${key}`, chalk26.gray(` ${value.at(0)}`));
1742
+ message.push(`${key}`, chalk25.gray(` ${value.at(0)}`));
1814
1743
  }
1815
- console.log(chalk26.yellow(message.join("\n")));
1744
+ console.log(chalk25.yellow(message.join("\n")));
1816
1745
  }
1817
1746
  }, "reportMissing");
1818
1747
  var analyzeDeps = /* @__PURE__ */ __name(async (pkg, ignoreMatches) => {
@@ -1867,7 +1796,7 @@ var analyzeDeps = /* @__PURE__ */ __name(async (pkg, ignoreMatches) => {
1867
1796
  };
1868
1797
  }, "analyzeDeps");
1869
1798
  var packageDeps = /* @__PURE__ */ __name(async () => {
1870
- const pkg = process.env.INIT_CWD ?? cwd3();
1799
+ const pkg = process.env.INIT_CWD ?? cwd2();
1871
1800
  const pkgName = process.env.npm_package_name;
1872
1801
  const packageContent = existsSync5(`${pkg}/package.json`) ? JSON.parse(readFileSync5(`${pkg}/package.json`, {
1873
1802
  encoding: "utf8"
@@ -1917,10 +1846,10 @@ var packageDeps = /* @__PURE__ */ __name(async () => {
1917
1846
  reportUnused("dependencies", unusedDeps);
1918
1847
  reportUnused("devDependencies", unusedDevDeps);
1919
1848
  if (Object.entries(invalidDirs).length > 0) {
1920
- for (const [key, value] of Object.entries(invalidDirs)) console.warn(chalk26.gray(`Invalid Dir: ${key}: ${value}`));
1849
+ for (const [key, value] of Object.entries(invalidDirs)) console.warn(chalk25.gray(`Invalid Dir: ${key}: ${value}`));
1921
1850
  }
1922
1851
  if (Object.entries(invalidFiles).length > 0) {
1923
- for (const [key, value] of Object.entries(invalidFiles)) console.warn(chalk26.gray(`Invalid File: ${key}: ${value}`));
1852
+ for (const [key, value] of Object.entries(invalidFiles)) console.warn(chalk25.gray(`Invalid File: ${key}: ${value}`));
1924
1853
  }
1925
1854
  reportMissing("dependencies", missingDepsObject);
1926
1855
  reportMissing("devDependencies", missingDevDepsObject);
@@ -1931,7 +1860,7 @@ var packageDeps = /* @__PURE__ */ __name(async () => {
1931
1860
  // src/actions/package/gen-docs.ts
1932
1861
  import { existsSync as existsSync6 } from "node:fs";
1933
1862
  import path6 from "node:path";
1934
- import chalk27 from "chalk";
1863
+ import chalk26 from "chalk";
1935
1864
  import { Application, ArgumentsReader, TSConfigReader, TypeDocReader } from "typedoc";
1936
1865
  var ExitCodes = {
1937
1866
  CompileError: 3,
@@ -2033,7 +1962,7 @@ var runTypeDoc = /* @__PURE__ */ __name(async (app) => {
2033
1962
  return ExitCodes.OutputError;
2034
1963
  }
2035
1964
  }
2036
- console.log(chalk27.green(`${pkgName} - Ok`));
1965
+ console.log(chalk26.green(`${pkgName} - Ok`));
2037
1966
  return ExitCodes.Ok;
2038
1967
  }, "runTypeDoc");
2039
1968
 
@@ -2103,7 +2032,7 @@ var rebuild = /* @__PURE__ */ __name(({ target }) => {
2103
2032
  }, "rebuild");
2104
2033
 
2105
2034
  // src/actions/recompile.ts
2106
- import chalk28 from "chalk";
2035
+ import chalk27 from "chalk";
2107
2036
  var recompile = /* @__PURE__ */ __name(async ({ verbose, target, pkg, incremental }) => {
2108
2037
  return pkg ? await recompilePackage({
2109
2038
  pkg,
@@ -2164,7 +2093,7 @@ var recompileAll = /* @__PURE__ */ __name(async ({ jobs, verbose, target, increm
2164
2093
  `${jobs}`
2165
2094
  ] : [];
2166
2095
  if (jobs) {
2167
- console.log(chalk28.blue(`Jobs set to [${jobs}]`));
2096
+ console.log(chalk27.blue(`Jobs set to [${jobs}]`));
2168
2097
  }
2169
2098
  const result = await runStepsAsync(`Recompile${incremental ? "-Incremental" : ""} [All]`, [
2170
2099
  [
@@ -2181,7 +2110,7 @@ var recompileAll = /* @__PURE__ */ __name(async ({ jobs, verbose, target, increm
2181
2110
  ]
2182
2111
  ]
2183
2112
  ]);
2184
- console.log(`${chalk28.gray("Recompiled in")} [${chalk28.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk28.gray("seconds")}`);
2113
+ console.log(`${chalk27.gray("Recompiled in")} [${chalk27.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk27.gray("seconds")}`);
2185
2114
  return result;
2186
2115
  }, "recompileAll");
2187
2116
 
@@ -2281,7 +2210,7 @@ var sonar = /* @__PURE__ */ __name(() => {
2281
2210
  }, "sonar");
2282
2211
 
2283
2212
  // src/actions/statics.ts
2284
- import chalk29 from "chalk";
2213
+ import chalk28 from "chalk";
2285
2214
  var DefaultDependencies = [
2286
2215
  "axios",
2287
2216
  "@xylabs/pixel",
@@ -2292,7 +2221,7 @@ var DefaultDependencies = [
2292
2221
  "@mui/system"
2293
2222
  ];
2294
2223
  var statics = /* @__PURE__ */ __name(() => {
2295
- console.log(chalk29.green("Check Required Static Dependencies"));
2224
+ console.log(chalk28.green("Check Required Static Dependencies"));
2296
2225
  const statics2 = parsedPackageJSON()?.xy?.deps?.statics;
2297
2226
  return detectDuplicateDependencies(statics2, DefaultDependencies);
2298
2227
  }, "statics");
@@ -2410,7 +2339,7 @@ var loadPackageConfig = /* @__PURE__ */ __name(async () => {
2410
2339
  }, "loadPackageConfig");
2411
2340
 
2412
2341
  // src/xy/xy.ts
2413
- import chalk31 from "chalk";
2342
+ import chalk30 from "chalk";
2414
2343
 
2415
2344
  // src/xy/xyBuildCommands.ts
2416
2345
  var xyBuildCommands = /* @__PURE__ */ __name((args) => {
@@ -2646,7 +2575,7 @@ var xyInstallCommands = /* @__PURE__ */ __name((args) => {
2646
2575
  }, "xyInstallCommands");
2647
2576
 
2648
2577
  // src/xy/xyLintCommands.ts
2649
- import chalk30 from "chalk";
2578
+ import chalk29 from "chalk";
2650
2579
  var xyLintCommands = /* @__PURE__ */ __name((args) => {
2651
2580
  return args.command("cycle [package]", "Cycle - Check for dependency cycles", (yargs2) => {
2652
2581
  return packagePositionalParam(yargs2);
@@ -2654,7 +2583,7 @@ var xyLintCommands = /* @__PURE__ */ __name((args) => {
2654
2583
  const start = Date.now();
2655
2584
  if (argv.verbose) console.log("Cycle");
2656
2585
  process.exitCode = cycle();
2657
- console.log(chalk30.blue(`Finished in ${Date.now() - start}ms`));
2586
+ console.log(chalk29.blue(`Finished in ${Date.now() - start}ms`));
2658
2587
  }).command("lint [package]", "Lint - Run Eslint", (yargs2) => {
2659
2588
  return packagePositionalParam(yargs2);
2660
2589
  }, async (argv) => {
@@ -2663,21 +2592,21 @@ var xyLintCommands = /* @__PURE__ */ __name((args) => {
2663
2592
  process.exitCode = argv.fix ? fix() : argv.profile ? lintProfile() : await lint({
2664
2593
  pkg: argv.package
2665
2594
  });
2666
- console.log(chalk30.blue(`Finished in ${Date.now() - start}ms`));
2595
+ console.log(chalk29.blue(`Finished in ${Date.now() - start}ms`));
2667
2596
  }).command("fix [package]", "Fix - Run Eslint w/fix", (yargs2) => {
2668
2597
  return packagePositionalParam(yargs2);
2669
2598
  }, (argv) => {
2670
2599
  const start = Date.now();
2671
2600
  if (argv.verbose) console.log("Fix");
2672
2601
  process.exitCode = fix();
2673
- console.log(chalk30.blue(`Finished in ${Date.now() - start}ms`));
2602
+ console.log(chalk29.blue(`Finished in ${Date.now() - start}ms`));
2674
2603
  }).command("relint [package]", "Relint - Clean & Lint", (yargs2) => {
2675
2604
  return packagePositionalParam(yargs2);
2676
2605
  }, (argv) => {
2677
2606
  if (argv.verbose) console.log("Relinting");
2678
2607
  const start = Date.now();
2679
2608
  process.exitCode = relint();
2680
- console.log(chalk30.blue(`Finished in ${Date.now() - start}ms`));
2609
+ console.log(chalk29.blue(`Finished in ${Date.now() - start}ms`));
2681
2610
  }).command("publint [package]", "Publint - Run Publint", (yargs2) => {
2682
2611
  return packagePositionalParam(yargs2);
2683
2612
  }, async (argv) => {
@@ -2687,14 +2616,14 @@ var xyLintCommands = /* @__PURE__ */ __name((args) => {
2687
2616
  pkg: argv.package,
2688
2617
  verbose: !!argv.verbose
2689
2618
  });
2690
- console.log(chalk30.blue(`Finished in ${Date.now() - start}ms`));
2619
+ console.log(chalk29.blue(`Finished in ${Date.now() - start}ms`));
2691
2620
  }).command("sonar", "Sonar - Run Sonar Check", (yargs2) => {
2692
2621
  return packagePositionalParam(yargs2);
2693
2622
  }, (argv) => {
2694
2623
  const start = Date.now();
2695
2624
  if (argv.verbose) console.log("Sonar Check");
2696
2625
  process.exitCode = sonar();
2697
- console.log(chalk30.blue(`Finished in ${Date.now() - start}ms`));
2626
+ console.log(chalk29.blue(`Finished in ${Date.now() - start}ms`));
2698
2627
  });
2699
2628
  }, "xyLintCommands");
2700
2629
 
@@ -2747,8 +2676,8 @@ var xyParseOptions = /* @__PURE__ */ __name(() => {
2747
2676
  var xy = /* @__PURE__ */ __name(async () => {
2748
2677
  const options = xyParseOptions();
2749
2678
  return await xyBuildCommands(xyCommonCommands(xyInstallCommands(xyDeployCommands(xyLintCommands(options))))).demandCommand(1).command("*", "", () => {
2750
- console.error(chalk31.yellow(`Command not found [${chalk31.magenta(process.argv[2])}]`));
2751
- console.log(chalk31.gray("Try 'yarn xy --help' for list of commands"));
2679
+ console.error(chalk30.yellow(`Command not found [${chalk30.magenta(process.argv[2])}]`));
2680
+ console.log(chalk30.gray("Try 'yarn xy --help' for list of commands"));
2752
2681
  }).version().help().argv;
2753
2682
  }, "xy");
2754
2683
  export {