@xylabs/ts-scripts-yarn3 4.0.0-rc.9 → 4.0.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 (198) hide show
  1. package/dist/actions/build.mjs.map +1 -1
  2. package/dist/actions/clean-docs.mjs +14 -4
  3. package/dist/actions/clean-docs.mjs.map +1 -1
  4. package/dist/actions/clean-eslint.mjs +16 -4
  5. package/dist/actions/clean-eslint.mjs.map +1 -1
  6. package/dist/actions/clean-jest.mjs.map +1 -1
  7. package/dist/actions/clean.mjs.map +1 -1
  8. package/dist/actions/compile.mjs +3 -2
  9. package/dist/actions/compile.mjs.map +1 -1
  10. package/dist/actions/copy-assets.mjs.map +1 -1
  11. package/dist/actions/cycle.mjs +25 -110
  12. package/dist/actions/cycle.mjs.map +1 -1
  13. package/dist/actions/dead.mjs.map +1 -1
  14. package/dist/actions/deploy-major.mjs.map +1 -1
  15. package/dist/actions/deploy-minor.mjs.map +1 -1
  16. package/dist/actions/deploy-next.mjs.map +1 -1
  17. package/dist/actions/deploy.mjs.map +1 -1
  18. package/dist/actions/deps.mjs.map +1 -1
  19. package/dist/actions/dupdeps.mjs +3 -2
  20. package/dist/actions/dupdeps.mjs.map +1 -1
  21. package/dist/actions/fix.mjs.map +1 -1
  22. package/dist/actions/gen-docs.mjs.map +1 -1
  23. package/dist/actions/gitignore-gen.mjs.map +1 -1
  24. package/dist/actions/index.mjs +213 -55
  25. package/dist/actions/index.mjs.map +1 -1
  26. package/dist/actions/license.mjs.map +1 -1
  27. package/dist/actions/lint-clean.mjs.map +1 -1
  28. package/dist/actions/lint-profile.mjs.map +1 -1
  29. package/dist/actions/lint.mjs.map +1 -1
  30. package/dist/actions/npmignore-gen.mjs.map +1 -1
  31. package/dist/actions/package/clean-outputs.mjs +16 -2
  32. package/dist/actions/package/clean-outputs.mjs.map +1 -1
  33. package/dist/actions/package/clean-typescript.mjs +16 -2
  34. package/dist/actions/package/clean-typescript.mjs.map +1 -1
  35. package/dist/actions/package/clean.mjs +17 -4
  36. package/dist/actions/package/clean.mjs.map +1 -1
  37. package/dist/actions/package/compile/buildEntries.mjs.map +1 -1
  38. package/dist/actions/package/compile/compile.mjs +151 -11
  39. package/dist/actions/package/compile/compile.mjs.map +1 -1
  40. package/dist/actions/package/compile/copyTypeFiles.mjs.map +1 -1
  41. package/dist/actions/package/compile/getCompilerOptions.mjs +145 -8
  42. package/dist/actions/package/compile/getCompilerOptions.mjs.map +1 -1
  43. package/dist/actions/package/compile/index.mjs +151 -11
  44. package/dist/actions/package/compile/index.mjs.map +1 -1
  45. package/dist/actions/package/compile/packageCompileTsc.mjs +148 -8
  46. package/dist/actions/package/compile/packageCompileTsc.mjs.map +1 -1
  47. package/dist/actions/package/compile/packageCompileTscTypes.mjs +145 -8
  48. package/dist/actions/package/compile/packageCompileTscTypes.mjs.map +1 -1
  49. package/dist/actions/package/compile/packageCompileTsup.mjs +3 -0
  50. package/dist/actions/package/compile/packageCompileTsup.mjs.map +1 -1
  51. package/dist/actions/package/copy-assets.mjs.map +1 -1
  52. package/dist/actions/package/deps.mjs.map +1 -1
  53. package/dist/actions/package/gen-docs.mjs.map +1 -1
  54. package/dist/actions/package/index.mjs +205 -52
  55. package/dist/actions/package/index.mjs.map +1 -1
  56. package/dist/actions/package/publint.mjs +3 -0
  57. package/dist/actions/package/publint.mjs.map +1 -1
  58. package/dist/actions/package/recompile.mjs +192 -39
  59. package/dist/actions/package/recompile.mjs.map +1 -1
  60. package/dist/actions/publint.mjs.map +1 -1
  61. package/dist/actions/rebuild.mjs.map +1 -1
  62. package/dist/actions/recompile.mjs.map +1 -1
  63. package/dist/actions/reinstall.mjs.map +1 -1
  64. package/dist/actions/relint.mjs.map +1 -1
  65. package/dist/actions/retest.mjs.map +1 -1
  66. package/dist/actions/sonar.mjs.map +1 -1
  67. package/dist/actions/statics.mjs +3 -2
  68. package/dist/actions/statics.mjs.map +1 -1
  69. package/dist/actions/test.mjs.map +1 -1
  70. package/dist/actions/up.mjs.map +1 -1
  71. package/dist/actions/updo.mjs.map +1 -1
  72. package/dist/actions/upplug.mjs.map +1 -1
  73. package/dist/actions/upyarn.mjs.map +1 -1
  74. package/dist/actions/yarn3only.mjs.map +1 -1
  75. package/dist/bin/package/clean-outputs.mjs +14 -2
  76. package/dist/bin/package/clean-outputs.mjs.map +1 -1
  77. package/dist/bin/package/clean-typescript.mjs +14 -2
  78. package/dist/bin/package/clean-typescript.mjs.map +1 -1
  79. package/dist/bin/package/clean.mjs +15 -4
  80. package/dist/bin/package/clean.mjs.map +1 -1
  81. package/dist/bin/package/compile-only.mjs +151 -11
  82. package/dist/bin/package/compile-only.mjs.map +1 -1
  83. package/dist/bin/package/compile-tsup.mjs +3 -0
  84. package/dist/bin/package/compile-tsup.mjs.map +1 -1
  85. package/dist/bin/package/compile.mjs +151 -11
  86. package/dist/bin/package/compile.mjs.map +1 -1
  87. package/dist/bin/package/copy-assets-cjs.mjs.map +1 -1
  88. package/dist/bin/package/copy-assets-esm.mjs.map +1 -1
  89. package/dist/bin/package/deps.mjs.map +1 -1
  90. package/dist/bin/package/gen-docs.mjs.map +1 -1
  91. package/dist/bin/package/publint.mjs +3 -0
  92. package/dist/bin/package/publint.mjs.map +1 -1
  93. package/dist/bin/package/recompile.mjs +170 -19
  94. package/dist/bin/package/recompile.mjs.map +1 -1
  95. package/dist/bin/xy-ts.mjs +52 -32
  96. package/dist/bin/xy-ts.mjs.map +1 -1
  97. package/dist/bin/xy.mjs +52 -32
  98. package/dist/bin/xy.mjs.map +1 -1
  99. package/dist/index.d.ts +11 -9
  100. package/dist/index.mjs +216 -57
  101. package/dist/index.mjs.map +1 -1
  102. package/dist/lib/createBuildConfig.mjs.map +1 -1
  103. package/dist/lib/defaultBuildConfig.mjs.map +1 -1
  104. package/dist/lib/deleteGlob.mjs +19 -0
  105. package/dist/lib/deleteGlob.mjs.map +1 -0
  106. package/dist/lib/dependencies/DuplicateDetector.mjs +3 -2
  107. package/dist/lib/dependencies/DuplicateDetector.mjs.map +1 -1
  108. package/dist/lib/dependencies/detectDuplicateDependencies.mjs +3 -2
  109. package/dist/lib/dependencies/detectDuplicateDependencies.mjs.map +1 -1
  110. package/dist/lib/dependencies/index.mjs +3 -2
  111. package/dist/lib/dependencies/index.mjs.map +1 -1
  112. package/dist/lib/file/ReadFileSyncOptions.mjs.map +1 -1
  113. package/dist/lib/file/fileLines.mjs.map +1 -1
  114. package/dist/lib/file/index.mjs.map +1 -1
  115. package/dist/lib/file/tryReadFileSync.mjs.map +1 -1
  116. package/dist/lib/generateIgnoreFiles.mjs.map +1 -1
  117. package/dist/lib/index.mjs +160 -5
  118. package/dist/lib/index.mjs.map +1 -1
  119. package/dist/lib/loadConfig.mjs +143 -3
  120. package/dist/lib/loadConfig.mjs.map +1 -1
  121. package/dist/lib/processEx.mjs.map +1 -1
  122. package/dist/lib/runSteps.mjs.map +1 -1
  123. package/dist/lib/runStepsAsync.mjs.map +1 -1
  124. package/dist/lib/runXy.mjs.map +1 -1
  125. package/dist/lib/safeExit.mjs.map +1 -1
  126. package/dist/lib/withErrnoException.mjs.map +1 -1
  127. package/dist/lib/yarn/index.mjs.map +1 -1
  128. package/dist/lib/yarn/workspace/index.mjs.map +1 -1
  129. package/dist/lib/yarn/workspace/yarnWorkspace.mjs.map +1 -1
  130. package/dist/lib/yarn/workspace/yarnWorkspaces.mjs.map +1 -1
  131. package/dist/loadPackageConfig.mjs.map +1 -1
  132. package/dist/xy/index.mjs +52 -32
  133. package/dist/xy/index.mjs.map +1 -1
  134. package/dist/xy/param.mjs.map +1 -1
  135. package/dist/xy/xy.mjs +52 -32
  136. package/dist/xy/xy.mjs.map +1 -1
  137. package/dist/xy/xyBuildCommands.mjs +3 -2
  138. package/dist/xy/xyBuildCommands.mjs.map +1 -1
  139. package/dist/xy/xyCommonCommands.mjs +14 -4
  140. package/dist/xy/xyCommonCommands.mjs.map +1 -1
  141. package/dist/xy/xyDeployCommands.mjs.map +1 -1
  142. package/dist/xy/xyInstallCommands.mjs +3 -2
  143. package/dist/xy/xyInstallCommands.mjs.map +1 -1
  144. package/dist/xy/xyLintCommands.mjs +30 -22
  145. package/dist/xy/xyLintCommands.mjs.map +1 -1
  146. package/dist/xy/xyParseOptions.mjs.map +1 -1
  147. package/package.json +53 -55
  148. package/src/actions/build.ts +3 -1
  149. package/src/actions/clean-docs.ts +2 -3
  150. package/src/actions/clean-eslint.ts +3 -2
  151. package/src/actions/clean.ts +3 -1
  152. package/src/actions/compile.ts +13 -3
  153. package/src/actions/cycle.ts +15 -4
  154. package/src/actions/deps.ts +6 -5
  155. package/src/actions/gen-docs.ts +3 -4
  156. package/src/actions/package/clean-outputs.ts +3 -2
  157. package/src/actions/package/clean-typescript.ts +3 -2
  158. package/src/actions/package/compile/XyConfig.ts +5 -13
  159. package/src/actions/package/compile/buildEntries.ts +1 -1
  160. package/src/actions/package/compile/compile.ts +3 -1
  161. package/src/actions/package/compile/copyTypeFiles.ts +1 -1
  162. package/src/actions/package/compile/getCompilerOptions.ts +10 -8
  163. package/src/actions/package/compile/packageCompileTsc.ts +11 -6
  164. package/src/actions/package/compile/packageCompileTscTypes.ts +5 -3
  165. package/src/actions/package/compile/packageCompileTsup.ts +6 -3
  166. package/src/actions/package/copy-assets.ts +1 -3
  167. package/src/actions/package/deps.ts +6 -2
  168. package/src/actions/package/gen-docs.ts +3 -1
  169. package/src/actions/package/publint.ts +8 -5
  170. package/src/actions/publint.ts +3 -1
  171. package/src/actions/recompile.ts +47 -9
  172. package/src/actions/reinstall.ts +3 -1
  173. package/src/lib/defaultBuildConfig.ts +11 -1
  174. package/src/lib/deleteGlob.ts +13 -0
  175. package/src/lib/dependencies/DuplicateDetector.ts +4 -4
  176. package/src/lib/file/ReadFileSyncOptions.ts +4 -1
  177. package/src/lib/file/fileLines.ts +9 -3
  178. package/src/lib/file/tryReadFileSync.ts +4 -2
  179. package/src/lib/generateIgnoreFiles.ts +3 -1
  180. package/src/lib/index.ts +1 -0
  181. package/src/lib/loadConfig.ts +3 -4
  182. package/src/lib/runSteps.ts +2 -1
  183. package/src/lib/runStepsAsync.ts +1 -1
  184. package/src/lib/runXy.ts +4 -1
  185. package/src/lib/withErrnoException.ts +3 -1
  186. package/src/lib/yarn/workspace/yarnWorkspace.ts +1 -1
  187. package/src/lib/yarn/workspace/yarnWorkspaces.ts +1 -1
  188. package/src/loadPackageConfig.ts +1 -1
  189. package/src/types.d.ts +23 -0
  190. package/src/xy/param.ts +2 -4
  191. package/src/xy/xyBuildCommands.ts +10 -20
  192. package/src/xy/xyCommonCommands.ts +4 -2
  193. package/src/xy/xyDeployCommands.ts +4 -2
  194. package/src/xy/xyInstallCommands.ts +5 -5
  195. package/src/xy/xyLintCommands.ts +6 -4
  196. package/src/xy/xyParseOptions.ts +3 -2
  197. package/tsup.config.ts +2 -6
  198. package/xy.config.ts +1 -5
@@ -1,5 +1,145 @@
1
+ var __create = Object.create;
1
2
  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;
2
7
  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
+ });
3
143
 
4
144
  // src/actions/build.ts
5
145
  import chalk8 from "chalk";
@@ -17,6 +157,19 @@ var checkResult = /* @__PURE__ */ __name((name, result, level = "error", exitOnF
17
157
  }
18
158
  }, "checkResult");
19
159
 
160
+ // src/lib/deleteGlob.ts
161
+ import fs from "node:fs";
162
+ import { glob } from "glob";
163
+ var deleteGlob = /* @__PURE__ */ __name((globPath) => {
164
+ const files = glob.sync(globPath);
165
+ for (const file of files) {
166
+ fs.rmSync(file, {
167
+ recursive: true,
168
+ force: true
169
+ });
170
+ }
171
+ }, "deleteGlob");
172
+
20
173
  // src/lib/dependencies/detectDuplicateDependencies.ts
21
174
  import { execSync } from "node:child_process";
22
175
 
@@ -80,7 +233,6 @@ var safeExitAsync = /* @__PURE__ */ __name(async (func, exitOnFail = true) => {
80
233
  // src/lib/dependencies/DuplicateDetector.ts
81
234
  import { EOL } from "node:os";
82
235
  import chalk3 from "chalk";
83
- import uniq from "lodash/uniq.js";
84
236
 
85
237
  // src/lib/jsonFormatters.ts
86
238
  var multiLineToJSONArray = /* @__PURE__ */ __name((output) => {
@@ -151,7 +303,9 @@ var DuplicateDetector = class {
151
303
  acc.duplicateVersions.push(acc.currentVersion);
152
304
  }
153
305
  acc.duplicateVersions.push(version);
154
- acc.duplicateVersions = uniq(acc.duplicateVersions);
306
+ acc.duplicateVersions = [
307
+ ...new Set(acc.duplicateVersions)
308
+ ];
155
309
  }
156
310
  return acc;
157
311
  }
@@ -292,7 +446,7 @@ var mergeEntries = /* @__PURE__ */ __name((a, b) => [
292
446
  ].sort(), "mergeEntries");
293
447
  var generateIgnoreFiles = /* @__PURE__ */ __name((filename3, pkg) => {
294
448
  console.log(chalk4.green(`Generate ${filename3} Files`));
295
- const cwd3 = INIT_CWD() ?? ".";
449
+ const cwd4 = INIT_CWD() ?? ".";
296
450
  const workspaces = pkg ? [
297
451
  yarnWorkspace(pkg)
298
452
  ] : yarnWorkspaces();
@@ -300,7 +454,7 @@ var generateIgnoreFiles = /* @__PURE__ */ __name((filename3, pkg) => {
300
454
  const writeEntries = /* @__PURE__ */ __name((location, entries) => writeLines(`${location}/${filename3}`, entries), "writeEntries");
301
455
  const results = workspaces.map(({ location, name }) => {
302
456
  try {
303
- writeEntries(location, mergeEntries(readEntries(cwd3), readEntries(location)));
457
+ writeEntries(location, mergeEntries(readEntries(cwd4), readEntries(location)));
304
458
  return 0;
305
459
  } catch (ex) {
306
460
  const error = ex;
@@ -313,13 +467,13 @@ var generateIgnoreFiles = /* @__PURE__ */ __name((filename3, pkg) => {
313
467
  }, "generateIgnoreFiles");
314
468
 
315
469
  // src/lib/loadConfig.ts
470
+ var import_deepmerge = __toESM(require_cjs(), 1);
316
471
  import chalk5 from "chalk";
317
472
  import { cosmiconfig } from "cosmiconfig";
318
- import merge from "lodash/merge.js";
319
473
  var config;
320
474
  var loadConfig = /* @__PURE__ */ __name(async (params) => {
321
475
  if (config) {
322
- return merge({}, config, params);
476
+ return (0, import_deepmerge.default)(config, params ?? {});
323
477
  }
324
478
  const cosmicConfigResult = await cosmiconfig("xy", {
325
479
  cache: true
@@ -329,7 +483,7 @@ var loadConfig = /* @__PURE__ */ __name(async (params) => {
329
483
  if (configFilePath) {
330
484
  console.log(chalk5.gray(`Loading config from ${configFilePath}`));
331
485
  }
332
- return merge({}, config, params);
486
+ return (0, import_deepmerge.default)(config, params ?? {});
333
487
  }, "loadConfig");
334
488
 
335
489
  // src/lib/parsedPackageJSON.ts
@@ -527,19 +681,16 @@ var cleanAll = /* @__PURE__ */ __name(({ verbose }) => {
527
681
  // src/actions/clean-docs.ts
528
682
  import path from "node:path";
529
683
  import chalk9 from "chalk";
530
- import { rimrafSync } from "rimraf";
531
684
  var cleanDocs = /* @__PURE__ */ __name(() => {
532
685
  const pkgName = process.env.npm_package_name;
533
686
  console.log(chalk9.green(`Cleaning Docs [${pkgName}]`));
534
- for (const { location } of yarnWorkspaces()) rimrafSync(path.join(location, "docs"), {
535
- glob: true
536
- });
687
+ for (const { location } of yarnWorkspaces()) deleteGlob(path.join(location, "docs"));
537
688
  return 0;
538
689
  }, "cleanDocs");
539
690
 
540
691
  // src/actions/compile.ts
541
692
  import chalk10 from "chalk";
542
- var compile = /* @__PURE__ */ __name(({ verbose, target, pkg, incremental, publint: publint2 }) => {
693
+ var compile = /* @__PURE__ */ __name(({ verbose, target, pkg, incremental, publint: publint2, jobs }) => {
543
694
  return pkg ? compilePackage({
544
695
  pkg,
545
696
  publint: publint2,
@@ -549,7 +700,8 @@ var compile = /* @__PURE__ */ __name(({ verbose, target, pkg, incremental, publi
549
700
  incremental,
550
701
  publint: publint2,
551
702
  target,
552
- verbose
703
+ verbose,
704
+ jobs
553
705
  });
554
706
  }, "compile");
555
707
  var compilePackage = /* @__PURE__ */ __name(({ target, pkg }) => {
@@ -677,25 +829,33 @@ var copyAssets = /* @__PURE__ */ __name(async ({ target, pkg }) => {
677
829
  }, "copyAssets");
678
830
 
679
831
  // src/actions/cycle.ts
680
- var cycle = /* @__PURE__ */ __name(() => {
681
- const rules = [
682
- `"'import/no-cycle': [1, { maxDepth: 6 }]"`,
683
- `"'import/no-internal-modules': ['off']"`
684
- ];
685
- return runSteps("Cycle", [
686
- [
687
- "yarn",
688
- [
689
- "eslint",
690
- ...rules.flatMap((rule) => [
691
- "--rule",
692
- rule
693
- ]),
694
- "--cache",
695
- "."
696
- ]
697
- ]
832
+ import { cwd } from "node:process";
833
+ import { ESLint } from "eslint";
834
+ var cycle = /* @__PURE__ */ __name(async () => {
835
+ const eslint = new ESLint({
836
+ fix: false,
837
+ overrideConfig: {
838
+ rules: {
839
+ "import-x/no-cycle": [
840
+ "error",
841
+ {
842
+ maxDepth: 10
843
+ }
844
+ ]
845
+ }
846
+ }
847
+ });
848
+ const results = await eslint.lintFiles([
849
+ "src/**/*.ts*",
850
+ "packages/**/src/**/*.ts*"
698
851
  ]);
852
+ const formatter = await eslint.loadFormatter("stylish");
853
+ const resultText = formatter.format(results, {
854
+ cwd: cwd(),
855
+ rulesMeta: {}
856
+ });
857
+ console.log(resultText);
858
+ return results.length;
699
859
  }, "cycle");
700
860
 
701
861
  // src/actions/dead.ts
@@ -1108,7 +1268,7 @@ var license = /* @__PURE__ */ __name(async (pkg) => {
1108
1268
 
1109
1269
  // src/actions/lint.ts
1110
1270
  import chalk17 from "chalk";
1111
- import { ESLint } from "eslint";
1271
+ import { ESLint as ESLint2 } from "eslint";
1112
1272
  var dumpMessages = /* @__PURE__ */ __name((lintResults) => {
1113
1273
  const colors = [
1114
1274
  "white",
@@ -1135,7 +1295,7 @@ var lintPackage = /* @__PURE__ */ __name(async ({ pkg }) => {
1135
1295
  console.error(chalk17.red(`Unable to locate package [${chalk17.magenta(pkg)}]`));
1136
1296
  process.exit(1);
1137
1297
  }
1138
- const engine = new ESLint({
1298
+ const engine = new ESLint2({
1139
1299
  cache: true
1140
1300
  });
1141
1301
  const lintResults = await engine.lintFiles(workspace.location);
@@ -1143,7 +1303,7 @@ var lintPackage = /* @__PURE__ */ __name(async ({ pkg }) => {
1143
1303
  return lintResults.reduce((prev, lintResult) => prev + lintResult.errorCount, 0);
1144
1304
  }, "lintPackage");
1145
1305
  var lintAll = /* @__PURE__ */ __name(async () => {
1146
- const engine = new ESLint({
1306
+ const engine = new ESLint2({
1147
1307
  cache: true
1148
1308
  });
1149
1309
  const lintResults = await engine.lintFiles("./**/*.*");
@@ -1213,7 +1373,6 @@ var npmignoreGen = /* @__PURE__ */ __name((pkg) => generateIgnoreFiles(filename2
1213
1373
  // src/actions/package/clean-outputs.ts
1214
1374
  import path3 from "node:path";
1215
1375
  import chalk18 from "chalk";
1216
- import { rimraf } from "rimraf";
1217
1376
  var packageCleanOutputs = /* @__PURE__ */ __name(async () => {
1218
1377
  const pkg = process.env.INIT_CWD ?? ".";
1219
1378
  const pkgName = process.env.npm_package_name;
@@ -1223,14 +1382,13 @@ var packageCleanOutputs = /* @__PURE__ */ __name(async () => {
1223
1382
  path3.join(pkg, "docs")
1224
1383
  ];
1225
1384
  console.log(chalk18.green(`Cleaning Outputs [${pkgName}]`));
1226
- await Promise.all(folders.map((folder) => rimraf(folder)));
1385
+ await Promise.all(folders.map((folder) => deleteGlob(folder)));
1227
1386
  return 0;
1228
1387
  }, "packageCleanOutputs");
1229
1388
 
1230
1389
  // src/actions/package/clean-typescript.ts
1231
1390
  import path4 from "node:path";
1232
1391
  import chalk19 from "chalk";
1233
- import { rimraf as rimraf2 } from "rimraf";
1234
1392
  var packageCleanTypescript = /* @__PURE__ */ __name(async () => {
1235
1393
  const pkg = process.env.INIT_CWD ?? ".";
1236
1394
  const pkgName = process.env.npm_package_name;
@@ -1240,7 +1398,7 @@ var packageCleanTypescript = /* @__PURE__ */ __name(async () => {
1240
1398
  path4.join(pkg, ".tsconfig.*"),
1241
1399
  path4.join(pkg, ".eslintcache")
1242
1400
  ];
1243
- await Promise.all(files.map((file) => rimraf2(file)));
1401
+ await Promise.all(files.map((file) => deleteGlob(file)));
1244
1402
  return 0;
1245
1403
  }, "packageCleanTypescript");
1246
1404
 
@@ -1256,11 +1414,14 @@ var packageClean = /* @__PURE__ */ __name(async () => {
1256
1414
  import chalk22 from "chalk";
1257
1415
 
1258
1416
  // src/actions/package/publint.ts
1259
- import { promises as fs } from "node:fs";
1417
+ import { promises as fs2 } from "node:fs";
1260
1418
  import chalk20 from "chalk";
1419
+ import sortPackageJson from "sort-package-json";
1261
1420
  var packagePublint = /* @__PURE__ */ __name(async (params) => {
1262
1421
  const pkgDir = process.env.INIT_CWD;
1263
- const pkg = JSON.parse(await fs.readFile(`${pkgDir}/package.json`, "utf8"));
1422
+ const sortedPkg = sortPackageJson(await fs2.readFile(`${pkgDir}/package.json`, "utf8"));
1423
+ await fs2.writeFile(`${pkgDir}/package.json`, sortedPkg);
1424
+ const pkg = JSON.parse(await fs2.readFile(`${pkgDir}/package.json`, "utf8"));
1264
1425
  console.log(chalk20.green(`Publint: ${pkg.name}`));
1265
1426
  console.log(chalk20.gray(pkgDir));
1266
1427
  const { publint: publint2 } = await import("publint");
@@ -1297,23 +1458,20 @@ var packagePublint = /* @__PURE__ */ __name(async (params) => {
1297
1458
  }, "packagePublint");
1298
1459
 
1299
1460
  // src/actions/package/compile/packageCompileTsc.ts
1300
- import { cwd } from "node:process";
1461
+ import { cwd as cwd2 } from "node:process";
1301
1462
  import chalk21 from "chalk";
1302
1463
  import { createProgramFromConfig } from "tsc-prog";
1303
1464
  import { DiagnosticCategory, formatDiagnosticsWithColorAndContext, getLineAndCharacterOfPosition, getPreEmitDiagnostics } from "typescript";
1304
1465
 
1305
1466
  // src/actions/package/compile/getCompilerOptions.ts
1467
+ var import_deepmerge2 = __toESM(require_cjs(), 1);
1306
1468
  import { createRequire } from "node:module";
1307
- import merge2 from "lodash/merge.js";
1308
1469
  import { findConfigFile, readConfigFile, sys } from "typescript";
1309
1470
  var getNested = /* @__PURE__ */ __name((config2) => {
1310
1471
  if (config2.extends) {
1311
1472
  const require2 = createRequire(import.meta.url);
1312
1473
  const opts = require2(config2.extends);
1313
- return {
1314
- ...getNested(opts),
1315
- ...config2.compilerOptions
1316
- };
1474
+ return (0, import_deepmerge2.default)(getNested(opts), config2.compilerOptions ?? {});
1317
1475
  }
1318
1476
  return config2.compilerOptions;
1319
1477
  }, "getNested");
@@ -1321,15 +1479,15 @@ var getCompilerOptionsJSONFollowExtends = /* @__PURE__ */ __name((filename3) =>
1321
1479
  const config2 = readConfigFile(filename3, sys.readFile).config;
1322
1480
  return getNested(config2);
1323
1481
  }, "getCompilerOptionsJSONFollowExtends");
1324
- var getCompilerOptions = /* @__PURE__ */ __name((options, tsconfig = "tsconfig.json") => {
1482
+ var getCompilerOptions = /* @__PURE__ */ __name((options = {}, tsconfig = "tsconfig.json") => {
1325
1483
  const configFileName = findConfigFile("./", sys.fileExists, tsconfig);
1326
- const configFileCompilerOptions = configFileName ? getCompilerOptionsJSONFollowExtends(configFileName) : void 0;
1327
- return merge2({}, configFileCompilerOptions, options);
1484
+ const configFileCompilerOptions = (configFileName ? getCompilerOptionsJSONFollowExtends(configFileName) : void 0) ?? {};
1485
+ return (0, import_deepmerge2.default)(configFileCompilerOptions, options);
1328
1486
  }, "getCompilerOptions");
1329
1487
 
1330
1488
  // src/actions/package/compile/packageCompileTsc.ts
1331
1489
  var packageCompileTsc = /* @__PURE__ */ __name(async (noEmit, config2, compilerOptionsParam) => {
1332
- const pkg = process.env.INIT_CWD ?? cwd();
1490
+ const pkg = process.env.INIT_CWD ?? cwd2();
1333
1491
  const publint2 = config2?.publint ?? true;
1334
1492
  const verbose = config2?.verbose ?? false;
1335
1493
  const formatHost = {
@@ -1352,7 +1510,7 @@ var packageCompileTsc = /* @__PURE__ */ __name(async (noEmit, config2, compilerO
1352
1510
  }
1353
1511
  };
1354
1512
  const program = createProgramFromConfig({
1355
- basePath: pkg ?? cwd(),
1513
+ basePath: pkg ?? cwd2(),
1356
1514
  compilerOptions,
1357
1515
  exclude: [
1358
1516
  "dist",
@@ -1383,9 +1541,9 @@ var packageCompileTsc = /* @__PURE__ */ __name(async (noEmit, config2, compilerO
1383
1541
  import { build as build2, defineConfig } from "tsup";
1384
1542
 
1385
1543
  // src/actions/package/compile/inputs.ts
1386
- import { glob } from "glob";
1544
+ import { glob as glob2 } from "glob";
1387
1545
  var getAllInputs2 = /* @__PURE__ */ __name((folder) => {
1388
- return glob.sync(`${folder}/**/*.*`, {
1546
+ return glob2.sync(`${folder}/**/*.*`, {
1389
1547
  ignore: [
1390
1548
  "**/*.spec.*",
1391
1549
  "**/*.stories.*",
@@ -1605,7 +1763,7 @@ var packageCopyAssets = /* @__PURE__ */ __name(async ({ target }) => {
1605
1763
 
1606
1764
  // src/actions/package/deps.ts
1607
1765
  import { existsSync as existsSync4, readFileSync as readFileSync3 } from "node:fs";
1608
- import { cwd as cwd2 } from "node:process";
1766
+ import { cwd as cwd3 } from "node:process";
1609
1767
  import chalk24 from "chalk";
1610
1768
  import depcheck from "depcheck";
1611
1769
  var special = depcheck.special;
@@ -1702,7 +1860,7 @@ var analyzeDeps = /* @__PURE__ */ __name(async (pkg, ignoreMatches) => {
1702
1860
  };
1703
1861
  }, "analyzeDeps");
1704
1862
  var packageDeps = /* @__PURE__ */ __name(async () => {
1705
- const pkg = process.env.INIT_CWD ?? cwd2();
1863
+ const pkg = process.env.INIT_CWD ?? cwd3();
1706
1864
  const pkgName = process.env.npm_package_name;
1707
1865
  const packageContent = existsSync4(`${pkg}/package.json`) ? JSON.parse(readFileSync3(`${pkg}/package.json`, {
1708
1866
  encoding: "utf8"