@xylabs/ts-scripts-yarn3 4.0.7 → 4.2.0

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 (62) hide show
  1. package/dist/actions/cycle.mjs +1 -5
  2. package/dist/actions/cycle.mjs.map +1 -1
  3. package/dist/actions/index.mjs +18 -163
  4. package/dist/actions/index.mjs.map +1 -1
  5. package/dist/actions/package/compile/compile.mjs +6 -146
  6. package/dist/actions/package/compile/compile.mjs.map +1 -1
  7. package/dist/actions/package/compile/getCompilerOptions.mjs +3 -143
  8. package/dist/actions/package/compile/getCompilerOptions.mjs.map +1 -1
  9. package/dist/actions/package/compile/index.mjs +6 -146
  10. package/dist/actions/package/compile/index.mjs.map +1 -1
  11. package/dist/actions/package/compile/packageCompileTsc.mjs +3 -143
  12. package/dist/actions/package/compile/packageCompileTsc.mjs.map +1 -1
  13. package/dist/actions/package/compile/packageCompileTscTypes.mjs +3 -143
  14. package/dist/actions/package/compile/packageCompileTscTypes.mjs.map +1 -1
  15. package/dist/actions/package/compile/packageCompileTsup.mjs +3 -143
  16. package/dist/actions/package/compile/packageCompileTsup.mjs.map +1 -1
  17. package/dist/actions/package/deps.mjs +0 -1
  18. package/dist/actions/package/deps.mjs.map +1 -1
  19. package/dist/actions/package/index.mjs +6 -147
  20. package/dist/actions/package/index.mjs.map +1 -1
  21. package/dist/actions/package/recompile.mjs +6 -146
  22. package/dist/actions/package/recompile.mjs.map +1 -1
  23. package/dist/actions/test.mjs +1 -1
  24. package/dist/actions/test.mjs.map +1 -1
  25. package/dist/bin/package/build-only.mjs +6 -146
  26. package/dist/bin/package/build-only.mjs.map +1 -1
  27. package/dist/bin/package/build.mjs +6 -146
  28. package/dist/bin/package/build.mjs.map +1 -1
  29. package/dist/bin/package/compile-only.mjs +6 -146
  30. package/dist/bin/package/compile-only.mjs.map +1 -1
  31. package/dist/bin/package/compile-tsup.mjs +3 -143
  32. package/dist/bin/package/compile-tsup.mjs.map +1 -1
  33. package/dist/bin/package/compile.mjs +6 -146
  34. package/dist/bin/package/compile.mjs.map +1 -1
  35. package/dist/bin/package/deps.mjs +0 -1
  36. package/dist/bin/package/deps.mjs.map +1 -1
  37. package/dist/bin/package/recompile.mjs +6 -146
  38. package/dist/bin/package/recompile.mjs.map +1 -1
  39. package/dist/bin/xy-ts.mjs +4 -8
  40. package/dist/bin/xy-ts.mjs.map +1 -1
  41. package/dist/bin/xy.mjs +4 -8
  42. package/dist/bin/xy.mjs.map +1 -1
  43. package/dist/index.mjs +18 -163
  44. package/dist/index.mjs.map +1 -1
  45. package/dist/lib/index.mjs +3 -143
  46. package/dist/lib/index.mjs.map +1 -1
  47. package/dist/lib/loadConfig.mjs +3 -143
  48. package/dist/lib/loadConfig.mjs.map +1 -1
  49. package/dist/xy/index.mjs +4 -8
  50. package/dist/xy/index.mjs.map +1 -1
  51. package/dist/xy/xy.mjs +4 -8
  52. package/dist/xy/xy.mjs.map +1 -1
  53. package/dist/xy/xyCommonCommands.mjs +1 -1
  54. package/dist/xy/xyCommonCommands.mjs.map +1 -1
  55. package/dist/xy/xyLintCommands.mjs +1 -5
  56. package/dist/xy/xyLintCommands.mjs.map +1 -1
  57. package/package.json +23 -28
  58. package/spec/yarn/workspace/tsconfig.json +1 -1
  59. package/src/actions/cycle.ts +1 -3
  60. package/src/actions/package/deps.ts +0 -1
  61. package/src/actions/test.ts +1 -1
  62. package/tsconfig.json +1 -2
package/dist/index.mjs CHANGED
@@ -1,145 +1,5 @@
1
- var __create = Object.create;
2
1
  var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
2
  var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
8
- var __commonJS = (cb, mod) => function __require() {
9
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
-
28
- // ../../node_modules/deepmerge/dist/cjs.js
29
- var require_cjs = __commonJS({
30
- "../../node_modules/deepmerge/dist/cjs.js"(exports, module) {
31
- "use strict";
32
- var isMergeableObject = /* @__PURE__ */ __name(function isMergeableObject2(value) {
33
- return isNonNullObject(value) && !isSpecial(value);
34
- }, "isMergeableObject");
35
- function isNonNullObject(value) {
36
- return !!value && typeof value === "object";
37
- }
38
- __name(isNonNullObject, "isNonNullObject");
39
- function isSpecial(value) {
40
- var stringValue = Object.prototype.toString.call(value);
41
- return stringValue === "[object RegExp]" || stringValue === "[object Date]" || isReactElement(value);
42
- }
43
- __name(isSpecial, "isSpecial");
44
- var canUseSymbol = typeof Symbol === "function" && Symbol.for;
45
- var REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for("react.element") : 60103;
46
- function isReactElement(value) {
47
- return value.$$typeof === REACT_ELEMENT_TYPE;
48
- }
49
- __name(isReactElement, "isReactElement");
50
- function emptyTarget(val) {
51
- return Array.isArray(val) ? [] : {};
52
- }
53
- __name(emptyTarget, "emptyTarget");
54
- function cloneUnlessOtherwiseSpecified(value, options) {
55
- return options.clone !== false && options.isMergeableObject(value) ? deepmerge3(emptyTarget(value), value, options) : value;
56
- }
57
- __name(cloneUnlessOtherwiseSpecified, "cloneUnlessOtherwiseSpecified");
58
- function defaultArrayMerge(target, source, options) {
59
- return target.concat(source).map(function(element) {
60
- return cloneUnlessOtherwiseSpecified(element, options);
61
- });
62
- }
63
- __name(defaultArrayMerge, "defaultArrayMerge");
64
- function getMergeFunction(key, options) {
65
- if (!options.customMerge) {
66
- return deepmerge3;
67
- }
68
- var customMerge = options.customMerge(key);
69
- return typeof customMerge === "function" ? customMerge : deepmerge3;
70
- }
71
- __name(getMergeFunction, "getMergeFunction");
72
- function getEnumerableOwnPropertySymbols(target) {
73
- return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(target).filter(function(symbol) {
74
- return Object.propertyIsEnumerable.call(target, symbol);
75
- }) : [];
76
- }
77
- __name(getEnumerableOwnPropertySymbols, "getEnumerableOwnPropertySymbols");
78
- function getKeys(target) {
79
- return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target));
80
- }
81
- __name(getKeys, "getKeys");
82
- function propertyIsOnObject(object, property) {
83
- try {
84
- return property in object;
85
- } catch (_) {
86
- return false;
87
- }
88
- }
89
- __name(propertyIsOnObject, "propertyIsOnObject");
90
- function propertyIsUnsafe(target, key) {
91
- return propertyIsOnObject(target, key) && !(Object.hasOwnProperty.call(target, key) && Object.propertyIsEnumerable.call(target, key));
92
- }
93
- __name(propertyIsUnsafe, "propertyIsUnsafe");
94
- function mergeObject(target, source, options) {
95
- var destination = {};
96
- if (options.isMergeableObject(target)) {
97
- getKeys(target).forEach(function(key) {
98
- destination[key] = cloneUnlessOtherwiseSpecified(target[key], options);
99
- });
100
- }
101
- getKeys(source).forEach(function(key) {
102
- if (propertyIsUnsafe(target, key)) {
103
- return;
104
- }
105
- if (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) {
106
- destination[key] = getMergeFunction(key, options)(target[key], source[key], options);
107
- } else {
108
- destination[key] = cloneUnlessOtherwiseSpecified(source[key], options);
109
- }
110
- });
111
- return destination;
112
- }
113
- __name(mergeObject, "mergeObject");
114
- function deepmerge3(target, source, options) {
115
- options = options || {};
116
- options.arrayMerge = options.arrayMerge || defaultArrayMerge;
117
- options.isMergeableObject = options.isMergeableObject || isMergeableObject;
118
- options.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified;
119
- var sourceIsArray = Array.isArray(source);
120
- var targetIsArray = Array.isArray(target);
121
- var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;
122
- if (!sourceAndTargetTypesMatch) {
123
- return cloneUnlessOtherwiseSpecified(source, options);
124
- } else if (sourceIsArray) {
125
- return options.arrayMerge(target, source, options);
126
- } else {
127
- return mergeObject(target, source, options);
128
- }
129
- }
130
- __name(deepmerge3, "deepmerge");
131
- deepmerge3.all = /* @__PURE__ */ __name(function deepmergeAll(array, options) {
132
- if (!Array.isArray(array)) {
133
- throw new Error("first argument should be an array");
134
- }
135
- return array.reduce(function(prev, next) {
136
- return deepmerge3(prev, next, options);
137
- }, {});
138
- }, "deepmergeAll");
139
- var deepmerge_1 = deepmerge3;
140
- module.exports = deepmerge_1;
141
- }
142
- });
143
3
 
144
4
  // src/actions/build.ts
145
5
  import chalk9 from "chalk";
@@ -516,7 +376,7 @@ var mergeEntries = /* @__PURE__ */ __name((a, b) => [
516
376
  ].sort(), "mergeEntries");
517
377
  var generateIgnoreFiles = /* @__PURE__ */ __name((filename3, pkg) => {
518
378
  console.log(chalk4.green(`Generate ${filename3} Files`));
519
- const cwd5 = INIT_CWD() ?? ".";
379
+ const cwd4 = INIT_CWD() ?? ".";
520
380
  const workspaces = pkg ? [
521
381
  yarnWorkspace(pkg)
522
382
  ] : yarnWorkspaces();
@@ -524,7 +384,7 @@ var generateIgnoreFiles = /* @__PURE__ */ __name((filename3, pkg) => {
524
384
  const writeEntries = /* @__PURE__ */ __name((location, entries) => writeLines(`${location}/${filename3}`, entries), "writeEntries");
525
385
  const results = workspaces.map(({ location, name }) => {
526
386
  try {
527
- writeEntries(location, mergeEntries(readEntries(cwd5), readEntries(location)));
387
+ writeEntries(location, mergeEntries(readEntries(cwd4), readEntries(location)));
528
388
  return 0;
529
389
  } catch (ex) {
530
390
  const error = ex;
@@ -537,13 +397,13 @@ var generateIgnoreFiles = /* @__PURE__ */ __name((filename3, pkg) => {
537
397
  }, "generateIgnoreFiles");
538
398
 
539
399
  // src/lib/loadConfig.ts
540
- var import_deepmerge = __toESM(require_cjs(), 1);
541
400
  import chalk5 from "chalk";
542
401
  import { cosmiconfig } from "cosmiconfig";
402
+ import deepmerge from "deepmerge";
543
403
  var config;
544
404
  var loadConfig = /* @__PURE__ */ __name(async (params) => {
545
405
  if (config) {
546
- return (0, import_deepmerge.default)(config, params ?? {});
406
+ return deepmerge(config, params ?? {});
547
407
  }
548
408
  const cosmicConfigResult = await cosmiconfig("xy", {
549
409
  cache: true
@@ -553,7 +413,7 @@ var loadConfig = /* @__PURE__ */ __name(async (params) => {
553
413
  if (configFilePath) {
554
414
  console.log(chalk5.gray(`Loading config from ${configFilePath}`));
555
415
  }
556
- return (0, import_deepmerge.default)(config, params ?? {});
416
+ return deepmerge(config, params ?? {});
557
417
  }, "loadConfig");
558
418
 
559
419
  // src/lib/parsedPackageJSON.ts
@@ -927,7 +787,6 @@ var copyAssets = /* @__PURE__ */ __name(async ({ target, pkg }) => {
927
787
  }, "copyAssets");
928
788
 
929
789
  // src/actions/cycle.ts
930
- import { cwd } from "node:process";
931
790
  import { ESLint } from "eslint";
932
791
  var cycle = /* @__PURE__ */ __name(async () => {
933
792
  const eslint = new ESLint({
@@ -948,10 +807,7 @@ var cycle = /* @__PURE__ */ __name(async () => {
948
807
  "packages/**/src/**/*.ts*"
949
808
  ]);
950
809
  const formatter = await eslint.loadFormatter("stylish");
951
- const resultText = formatter.format(results, {
952
- cwd: cwd(),
953
- rulesMeta: {}
954
- });
810
+ const resultText = formatter.format(results);
955
811
  console.log(resultText);
956
812
  return results.length;
957
813
  }, "cycle");
@@ -1556,20 +1412,20 @@ var packagePublint = /* @__PURE__ */ __name(async (params) => {
1556
1412
  }, "packagePublint");
1557
1413
 
1558
1414
  // src/actions/package/compile/packageCompileTsc.ts
1559
- import { cwd as cwd2 } from "node:process";
1415
+ import { cwd } from "node:process";
1560
1416
  import chalk22 from "chalk";
1561
1417
  import { createProgramFromConfig } from "tsc-prog";
1562
1418
  import { DiagnosticCategory, formatDiagnosticsWithColorAndContext, getLineAndCharacterOfPosition, getPreEmitDiagnostics } from "typescript";
1563
1419
 
1564
1420
  // src/actions/package/compile/getCompilerOptions.ts
1565
- var import_deepmerge2 = __toESM(require_cjs(), 1);
1566
1421
  import { createRequire } from "node:module";
1422
+ import deepmerge2 from "deepmerge";
1567
1423
  import { findConfigFile, readConfigFile, sys } from "typescript";
1568
1424
  var getNested = /* @__PURE__ */ __name((config2) => {
1569
1425
  if (config2.extends) {
1570
1426
  const require2 = createRequire(import.meta.url);
1571
1427
  const opts = require2(config2.extends);
1572
- return (0, import_deepmerge2.default)(getNested(opts), config2.compilerOptions ?? {});
1428
+ return deepmerge2(getNested(opts), config2.compilerOptions ?? {});
1573
1429
  }
1574
1430
  return config2.compilerOptions;
1575
1431
  }, "getNested");
@@ -1580,12 +1436,12 @@ var getCompilerOptionsJSONFollowExtends = /* @__PURE__ */ __name((filename3) =>
1580
1436
  var getCompilerOptions = /* @__PURE__ */ __name((options = {}, tsconfig = "tsconfig.json") => {
1581
1437
  const configFileName = findConfigFile("./", sys.fileExists, tsconfig);
1582
1438
  const configFileCompilerOptions = (configFileName ? getCompilerOptionsJSONFollowExtends(configFileName) : void 0) ?? {};
1583
- return (0, import_deepmerge2.default)(configFileCompilerOptions, options);
1439
+ return deepmerge2(configFileCompilerOptions, options);
1584
1440
  }, "getCompilerOptions");
1585
1441
 
1586
1442
  // src/actions/package/compile/packageCompileTsc.ts
1587
1443
  var packageCompileTsc = /* @__PURE__ */ __name(async (noEmit, config2, compilerOptionsParam) => {
1588
- const pkg = process.env.INIT_CWD ?? cwd2();
1444
+ const pkg = process.env.INIT_CWD ?? cwd();
1589
1445
  const publint2 = config2?.publint ?? true;
1590
1446
  const verbose = config2?.verbose ?? false;
1591
1447
  const formatHost = {
@@ -1608,7 +1464,7 @@ var packageCompileTsc = /* @__PURE__ */ __name(async (noEmit, config2, compilerO
1608
1464
  }
1609
1465
  };
1610
1466
  const program = createProgramFromConfig({
1611
- basePath: pkg ?? cwd2(),
1467
+ basePath: pkg ?? cwd(),
1612
1468
  compilerOptions,
1613
1469
  exclude: [
1614
1470
  "dist",
@@ -1675,12 +1531,12 @@ var buildEntries = /* @__PURE__ */ __name((folder, entryMode, verbose = false) =
1675
1531
  }, "buildEntries");
1676
1532
 
1677
1533
  // src/actions/package/compile/packageCompileTscTypes.ts
1678
- import { cwd as cwd3 } from "node:process";
1534
+ import { cwd as cwd2 } from "node:process";
1679
1535
  import chalk23 from "chalk";
1680
1536
  import { createProgramFromConfig as createProgramFromConfig2 } from "tsc-prog";
1681
1537
  import { DiagnosticCategory as DiagnosticCategory2 } from "typescript";
1682
1538
  var packageCompileTscTypes = /* @__PURE__ */ __name((folder = "src", { verbose } = {}, compilerOptionsParam) => {
1683
- const pkg = process.env.INIT_CWD ?? cwd3();
1539
+ const pkg = process.env.INIT_CWD ?? cwd2();
1684
1540
  if (verbose) {
1685
1541
  console.log(`Compiling types with TSC [${pkg}]`);
1686
1542
  }
@@ -1698,7 +1554,7 @@ var packageCompileTscTypes = /* @__PURE__ */ __name((folder = "src", { verbose }
1698
1554
  };
1699
1555
  const files = buildEntries(folder, "all");
1700
1556
  const result = createProgramFromConfig2({
1701
- basePath: pkg ?? cwd3(),
1557
+ basePath: pkg ?? cwd2(),
1702
1558
  compilerOptions,
1703
1559
  exclude: [
1704
1560
  "dist",
@@ -1930,7 +1786,7 @@ var packageCopyAssets = /* @__PURE__ */ __name(async ({ target }) => {
1930
1786
 
1931
1787
  // src/actions/package/deps.ts
1932
1788
  import { existsSync as existsSync5, readFileSync as readFileSync5 } from "node:fs";
1933
- import { cwd as cwd4 } from "node:process";
1789
+ import { cwd as cwd3 } from "node:process";
1934
1790
  import chalk26 from "chalk";
1935
1791
  import depcheck from "depcheck";
1936
1792
  var special = depcheck.special;
@@ -1945,7 +1801,6 @@ var defaultIgnoreDevDeps = [
1945
1801
  "@xylabs/tsconfig",
1946
1802
  "@xylabs/tsconfig-dom",
1947
1803
  "@xylabs/tsconfig-react",
1948
- "@xylabs/tsconfig-jest",
1949
1804
  "typescript"
1950
1805
  ];
1951
1806
  var defaultIgnoreDevPatterns = [
@@ -2027,7 +1882,7 @@ var analyzeDeps = /* @__PURE__ */ __name(async (pkg, ignoreMatches) => {
2027
1882
  };
2028
1883
  }, "analyzeDeps");
2029
1884
  var packageDeps = /* @__PURE__ */ __name(async () => {
2030
- const pkg = process.env.INIT_CWD ?? cwd4();
1885
+ const pkg = process.env.INIT_CWD ?? cwd3();
2031
1886
  const pkgName = process.env.npm_package_name;
2032
1887
  const packageContent = existsSync5(`${pkg}/package.json`) ? JSON.parse(readFileSync5(`${pkg}/package.json`, {
2033
1888
  encoding: "utf8"
@@ -2473,7 +2328,7 @@ var test = /* @__PURE__ */ __name(() => {
2473
2328
  [
2474
2329
  "yarn",
2475
2330
  [
2476
- "jest",
2331
+ "vitest",
2477
2332
  "."
2478
2333
  ]
2479
2334
  ]