@xylabs/ts-scripts-yarn3 6.0.4 → 6.0.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.
Files changed (329) hide show
  1. package/dist/actions/build.mjs +10 -0
  2. package/dist/actions/build.mjs.map +1 -1
  3. package/dist/actions/compile-types.mjs +2 -2
  4. package/dist/actions/compile-types.mjs.map +1 -1
  5. package/dist/actions/compile.mjs +7 -9
  6. package/dist/actions/compile.mjs.map +1 -1
  7. package/dist/actions/fix.mjs +1 -7
  8. package/dist/actions/fix.mjs.map +1 -1
  9. package/dist/actions/index.mjs +204 -235
  10. package/dist/actions/index.mjs.map +1 -1
  11. package/dist/actions/lint.mjs +1 -7
  12. package/dist/actions/lint.mjs.map +1 -1
  13. package/dist/actions/package/compile/compile.mjs +101 -169
  14. package/dist/actions/package/compile/compile.mjs.map +1 -1
  15. package/dist/actions/package/compile/compileTypes.mjs +16 -31
  16. package/dist/actions/package/compile/compileTypes.mjs.map +1 -1
  17. package/dist/actions/package/compile/index.mjs +156 -177
  18. package/dist/actions/package/compile/index.mjs.map +1 -1
  19. package/dist/actions/package/compile/packageCompileTscTypes.mjs +14 -29
  20. package/dist/actions/package/compile/packageCompileTscTypes.mjs.map +1 -1
  21. package/dist/actions/package/compile/packageCompileTsup.mjs +94 -82
  22. package/dist/actions/package/compile/packageCompileTsup.mjs.map +1 -1
  23. package/dist/actions/package/index.mjs +172 -193
  24. package/dist/actions/package/index.mjs.map +1 -1
  25. package/dist/actions/package/recompile.mjs +101 -169
  26. package/dist/actions/package/recompile.mjs.map +1 -1
  27. package/dist/actions/recompile.mjs +1 -7
  28. package/dist/actions/recompile.mjs.map +1 -1
  29. package/dist/actions/relint.mjs +1 -7
  30. package/dist/actions/relint.mjs.map +1 -1
  31. package/dist/bin/package/build-only.mjs +104 -172
  32. package/dist/bin/package/build-only.mjs.map +1 -1
  33. package/dist/bin/package/build.mjs +104 -172
  34. package/dist/bin/package/build.mjs.map +1 -1
  35. package/dist/bin/package/clean-outputs.mjs +1 -6
  36. package/dist/bin/package/clean-outputs.mjs.map +1 -1
  37. package/dist/bin/package/clean-typescript.mjs +1 -6
  38. package/dist/bin/package/clean-typescript.mjs.map +1 -1
  39. package/dist/bin/package/compile-only.mjs +103 -171
  40. package/dist/bin/package/compile-only.mjs.map +1 -1
  41. package/dist/bin/package/compile-tsup.mjs +113 -99
  42. package/dist/bin/package/compile-tsup.mjs.map +1 -1
  43. package/dist/bin/package/compile-types.mjs +45 -56
  44. package/dist/bin/package/compile-types.mjs.map +1 -1
  45. package/dist/bin/package/compile.mjs +103 -171
  46. package/dist/bin/package/compile.mjs.map +1 -1
  47. package/dist/bin/package/recompile.mjs +103 -171
  48. package/dist/bin/package/recompile.mjs.map +1 -1
  49. package/dist/bin/xy.mjs +22 -33
  50. package/dist/bin/xy.mjs.map +1 -1
  51. package/dist/index.d.ts +9 -14
  52. package/dist/index.mjs +214 -246
  53. package/dist/index.mjs.map +1 -1
  54. package/dist/types/actions/build.d.ts +9 -0
  55. package/dist/types/actions/build.d.ts.map +1 -0
  56. package/dist/types/actions/clean-docs.d.ts +2 -0
  57. package/dist/types/actions/clean-docs.d.ts.map +1 -0
  58. package/dist/types/actions/clean-eslint.d.ts +2 -0
  59. package/dist/types/actions/clean-eslint.d.ts.map +1 -0
  60. package/dist/types/actions/clean-jest.d.ts +2 -0
  61. package/dist/types/actions/clean-jest.d.ts.map +1 -0
  62. package/dist/types/actions/clean.d.ts +12 -0
  63. package/dist/types/actions/clean.d.ts.map +1 -0
  64. package/dist/types/actions/compile-types.d.ts +16 -0
  65. package/dist/types/actions/compile-types.d.ts.map +1 -0
  66. package/dist/types/actions/compile.d.ts +19 -0
  67. package/dist/types/actions/compile.d.ts.map +1 -0
  68. package/dist/types/actions/copy-assets.d.ts +6 -0
  69. package/dist/types/actions/copy-assets.d.ts.map +1 -0
  70. package/dist/types/actions/cycle.d.ts +2 -0
  71. package/dist/types/actions/cycle.d.ts.map +1 -0
  72. package/dist/types/actions/dead.d.ts +2 -0
  73. package/dist/types/actions/dead.d.ts.map +1 -0
  74. package/dist/types/actions/deploy-major.d.ts +2 -0
  75. package/dist/types/actions/deploy-major.d.ts.map +1 -0
  76. package/dist/types/actions/deploy-minor.d.ts +2 -0
  77. package/dist/types/actions/deploy-minor.d.ts.map +1 -0
  78. package/dist/types/actions/deploy-next.d.ts +2 -0
  79. package/dist/types/actions/deploy-next.d.ts.map +1 -0
  80. package/dist/types/actions/deploy.d.ts +2 -0
  81. package/dist/types/actions/deploy.d.ts.map +1 -0
  82. package/dist/types/actions/deps.d.ts +13 -0
  83. package/dist/types/actions/deps.d.ts.map +1 -0
  84. package/dist/types/actions/dupdeps.d.ts +2 -0
  85. package/dist/types/actions/dupdeps.d.ts.map +1 -0
  86. package/dist/types/actions/fix.d.ts +3 -0
  87. package/dist/types/actions/fix.d.ts.map +1 -0
  88. package/dist/types/actions/gen-docs.d.ts +11 -0
  89. package/dist/types/actions/gen-docs.d.ts.map +1 -0
  90. package/dist/types/actions/gitignore-gen.d.ts +2 -0
  91. package/dist/types/actions/gitignore-gen.d.ts.map +1 -0
  92. package/dist/types/actions/gitlint-fix.d.ts +2 -0
  93. package/dist/types/actions/gitlint-fix.d.ts.map +1 -0
  94. package/dist/types/actions/gitlint.d.ts +2 -0
  95. package/dist/types/actions/gitlint.d.ts.map +1 -0
  96. package/dist/types/actions/index.d.ts +38 -0
  97. package/dist/types/actions/index.d.ts.map +1 -0
  98. package/dist/types/actions/license.d.ts +2 -0
  99. package/dist/types/actions/license.d.ts.map +1 -0
  100. package/dist/types/actions/lint.d.ts +14 -0
  101. package/dist/types/actions/lint.d.ts.map +1 -0
  102. package/dist/types/actions/npmignore-gen.d.ts +2 -0
  103. package/dist/types/actions/npmignore-gen.d.ts.map +1 -0
  104. package/dist/types/actions/package/clean-outputs.d.ts +2 -0
  105. package/dist/types/actions/package/clean-outputs.d.ts.map +1 -0
  106. package/dist/types/actions/package/clean-typescript.d.ts +2 -0
  107. package/dist/types/actions/package/clean-typescript.d.ts.map +1 -0
  108. package/dist/types/actions/package/clean.d.ts +2 -0
  109. package/dist/types/actions/package/clean.d.ts.map +1 -0
  110. package/dist/types/actions/package/compile/XyConfig.d.ts +58 -0
  111. package/dist/types/actions/package/compile/XyConfig.d.ts.map +1 -0
  112. package/dist/types/actions/package/compile/buildEntries.d.ts +3 -0
  113. package/dist/types/actions/package/compile/buildEntries.d.ts.map +1 -0
  114. package/dist/types/actions/package/compile/compile.d.ts +3 -0
  115. package/dist/types/actions/package/compile/compile.d.ts.map +1 -0
  116. package/dist/types/actions/package/compile/compileTypes.d.ts +3 -0
  117. package/dist/types/actions/package/compile/compileTypes.d.ts.map +1 -0
  118. package/dist/types/actions/package/compile/copyTypeFiles.d.ts +3 -0
  119. package/dist/types/actions/package/compile/copyTypeFiles.d.ts.map +1 -0
  120. package/dist/types/actions/package/compile/deepMerge.d.ts +4 -0
  121. package/dist/types/actions/package/compile/deepMerge.d.ts.map +1 -0
  122. package/dist/types/actions/package/compile/getCompilerOptions.d.ts +3 -0
  123. package/dist/types/actions/package/compile/getCompilerOptions.d.ts.map +1 -0
  124. package/dist/types/actions/package/compile/index.d.ts +7 -0
  125. package/dist/types/actions/package/compile/index.d.ts.map +1 -0
  126. package/dist/types/actions/package/compile/inputs.d.ts +2 -0
  127. package/dist/types/actions/package/compile/inputs.d.ts.map +1 -0
  128. package/dist/types/actions/package/compile/packageCompileTsc.d.ts +4 -0
  129. package/dist/types/actions/package/compile/packageCompileTsc.d.ts.map +1 -0
  130. package/dist/types/actions/package/compile/packageCompileTscTypes.d.ts +4 -0
  131. package/dist/types/actions/package/compile/packageCompileTscTypes.d.ts.map +1 -0
  132. package/dist/types/actions/package/compile/packageCompileTsup.d.ts +5 -0
  133. package/dist/types/actions/package/compile/packageCompileTsup.d.ts.map +1 -0
  134. package/dist/types/actions/package/copy-assets.d.ts +5 -0
  135. package/dist/types/actions/package/copy-assets.d.ts.map +1 -0
  136. package/dist/types/actions/package/deps.d.ts +2 -0
  137. package/dist/types/actions/package/deps.d.ts.map +1 -0
  138. package/dist/types/actions/package/gen-docs.d.ts +2 -0
  139. package/dist/types/actions/package/gen-docs.d.ts.map +1 -0
  140. package/dist/types/actions/package/index.d.ts +11 -0
  141. package/dist/types/actions/package/index.d.ts.map +1 -0
  142. package/dist/types/actions/package/lint.d.ts +2 -0
  143. package/dist/types/actions/package/lint.d.ts.map +1 -0
  144. package/dist/types/actions/package/publint.d.ts +5 -0
  145. package/dist/types/actions/package/publint.d.ts.map +1 -0
  146. package/dist/types/actions/package/recompile.d.ts +2 -0
  147. package/dist/types/actions/package/recompile.d.ts.map +1 -0
  148. package/dist/types/actions/publint.d.ts +12 -0
  149. package/dist/types/actions/publint.d.ts.map +1 -0
  150. package/dist/types/actions/rebuild.d.ts +6 -0
  151. package/dist/types/actions/rebuild.d.ts.map +1 -0
  152. package/dist/types/actions/recompile.d.ts +16 -0
  153. package/dist/types/actions/recompile.d.ts.map +1 -0
  154. package/dist/types/actions/reinstall.d.ts +2 -0
  155. package/dist/types/actions/reinstall.d.ts.map +1 -0
  156. package/dist/types/actions/relint.d.ts +13 -0
  157. package/dist/types/actions/relint.d.ts.map +1 -0
  158. package/dist/types/actions/retest.d.ts +2 -0
  159. package/dist/types/actions/retest.d.ts.map +1 -0
  160. package/dist/types/actions/sonar.d.ts +2 -0
  161. package/dist/types/actions/sonar.d.ts.map +1 -0
  162. package/dist/types/actions/statics.d.ts +2 -0
  163. package/dist/types/actions/statics.d.ts.map +1 -0
  164. package/dist/types/actions/test.d.ts +2 -0
  165. package/dist/types/actions/test.d.ts.map +1 -0
  166. package/dist/types/actions/up.d.ts +2 -0
  167. package/dist/types/actions/up.d.ts.map +1 -0
  168. package/dist/types/actions/updo.d.ts +2 -0
  169. package/dist/types/actions/updo.d.ts.map +1 -0
  170. package/dist/types/actions/upplug.d.ts +2 -0
  171. package/dist/types/actions/upplug.d.ts.map +1 -0
  172. package/dist/types/actions/upyarn.d.ts +2 -0
  173. package/dist/types/actions/upyarn.d.ts.map +1 -0
  174. package/dist/types/actions/yarn3only.d.ts +2 -0
  175. package/dist/types/actions/yarn3only.d.ts.map +1 -0
  176. package/dist/types/bin/package/build-only.d.ts +3 -0
  177. package/dist/types/bin/package/build-only.d.ts.map +1 -0
  178. package/dist/types/bin/package/build.d.ts +3 -0
  179. package/dist/types/bin/package/build.d.ts.map +1 -0
  180. package/dist/types/bin/package/clean-outputs.d.ts +3 -0
  181. package/dist/types/bin/package/clean-outputs.d.ts.map +1 -0
  182. package/dist/types/bin/package/clean-typescript.d.ts +3 -0
  183. package/dist/types/bin/package/clean-typescript.d.ts.map +1 -0
  184. package/dist/types/bin/package/clean.d.ts +3 -0
  185. package/dist/types/bin/package/clean.d.ts.map +1 -0
  186. package/dist/types/bin/package/compile-only.d.ts +3 -0
  187. package/dist/types/bin/package/compile-only.d.ts.map +1 -0
  188. package/dist/types/bin/package/compile-tsup.d.ts +3 -0
  189. package/dist/types/bin/package/compile-tsup.d.ts.map +1 -0
  190. package/dist/types/bin/package/compile-types.d.ts +3 -0
  191. package/dist/types/bin/package/compile-types.d.ts.map +1 -0
  192. package/dist/types/bin/package/compile.d.ts +3 -0
  193. package/dist/types/bin/package/compile.d.ts.map +1 -0
  194. package/dist/types/bin/package/copy-assets-cjs.d.ts +3 -0
  195. package/dist/types/bin/package/copy-assets-cjs.d.ts.map +1 -0
  196. package/dist/types/bin/package/copy-assets-esm.d.ts +3 -0
  197. package/dist/types/bin/package/copy-assets-esm.d.ts.map +1 -0
  198. package/dist/types/bin/package/deps.d.ts +3 -0
  199. package/dist/types/bin/package/deps.d.ts.map +1 -0
  200. package/dist/types/bin/package/fix.d.ts +3 -0
  201. package/dist/types/bin/package/fix.d.ts.map +1 -0
  202. package/dist/types/bin/package/gen-docs.d.ts +3 -0
  203. package/dist/types/bin/package/gen-docs.d.ts.map +1 -0
  204. package/dist/types/bin/package/lint.d.ts +3 -0
  205. package/dist/types/bin/package/lint.d.ts.map +1 -0
  206. package/dist/types/bin/package/publint.d.ts +3 -0
  207. package/dist/types/bin/package/publint.d.ts.map +1 -0
  208. package/dist/types/bin/package/recompile.d.ts +3 -0
  209. package/dist/types/bin/package/recompile.d.ts.map +1 -0
  210. package/dist/types/bin/package/relint.d.ts +3 -0
  211. package/dist/types/bin/package/relint.d.ts.map +1 -0
  212. package/dist/types/bin/xy.d.ts +3 -0
  213. package/dist/types/bin/xy.d.ts.map +1 -0
  214. package/dist/types/index.d.ts +5 -0
  215. package/dist/types/index.d.ts.map +1 -0
  216. package/dist/types/lib/checkResult.d.ts +2 -0
  217. package/dist/types/lib/checkResult.d.ts.map +1 -0
  218. package/dist/types/lib/createBuildConfig.d.ts +2 -0
  219. package/dist/types/lib/createBuildConfig.d.ts.map +1 -0
  220. package/dist/types/lib/defaultBuildConfig.d.ts +9 -0
  221. package/dist/types/lib/defaultBuildConfig.d.ts.map +1 -0
  222. package/dist/types/lib/deleteGlob.d.ts +2 -0
  223. package/dist/types/lib/deleteGlob.d.ts.map +1 -0
  224. package/dist/types/lib/dependencies/DuplicateDetector.d.ts +9 -0
  225. package/dist/types/lib/dependencies/DuplicateDetector.d.ts.map +1 -0
  226. package/dist/types/lib/dependencies/detectDuplicateDependencies.d.ts +2 -0
  227. package/dist/types/lib/dependencies/detectDuplicateDependencies.d.ts.map +1 -0
  228. package/dist/types/lib/dependencies/index.d.ts +3 -0
  229. package/dist/types/lib/dependencies/index.d.ts.map +1 -0
  230. package/dist/types/lib/file/ReadFileSyncOptions.d.ts +6 -0
  231. package/dist/types/lib/file/ReadFileSyncOptions.d.ts.map +1 -0
  232. package/dist/types/lib/file/constants.d.ts +3 -0
  233. package/dist/types/lib/file/constants.d.ts.map +1 -0
  234. package/dist/types/lib/file/fileLines.d.ts +6 -0
  235. package/dist/types/lib/file/fileLines.d.ts.map +1 -0
  236. package/dist/types/lib/file/index.d.ts +5 -0
  237. package/dist/types/lib/file/index.d.ts.map +1 -0
  238. package/dist/types/lib/file/tryReadFileSync.d.ts +4 -0
  239. package/dist/types/lib/file/tryReadFileSync.d.ts.map +1 -0
  240. package/dist/types/lib/generateIgnoreFiles.d.ts +2 -0
  241. package/dist/types/lib/generateIgnoreFiles.d.ts.map +1 -0
  242. package/dist/types/lib/index.d.ts +21 -0
  243. package/dist/types/lib/index.d.ts.map +1 -0
  244. package/dist/types/lib/jsonFormatters.d.ts +2 -0
  245. package/dist/types/lib/jsonFormatters.d.ts.map +1 -0
  246. package/dist/types/lib/loadConfig.d.ts +2 -0
  247. package/dist/types/lib/loadConfig.d.ts.map +1 -0
  248. package/dist/types/lib/parsedPackageJSON.d.ts +2 -0
  249. package/dist/types/lib/parsedPackageJSON.d.ts.map +1 -0
  250. package/dist/types/lib/processEx.d.ts +2 -0
  251. package/dist/types/lib/processEx.d.ts.map +1 -0
  252. package/dist/types/lib/runSteps.d.ts +4 -0
  253. package/dist/types/lib/runSteps.d.ts.map +1 -0
  254. package/dist/types/lib/runStepsAsync.d.ts +4 -0
  255. package/dist/types/lib/runStepsAsync.d.ts.map +1 -0
  256. package/dist/types/lib/runXy.d.ts +2 -0
  257. package/dist/types/lib/runXy.d.ts.map +1 -0
  258. package/dist/types/lib/runXyWithWarning.d.ts +2 -0
  259. package/dist/types/lib/runXyWithWarning.d.ts.map +1 -0
  260. package/dist/types/lib/safeExit.d.ts +5 -0
  261. package/dist/types/lib/safeExit.d.ts.map +1 -0
  262. package/dist/types/lib/string/empty.d.ts +3 -0
  263. package/dist/types/lib/string/empty.d.ts.map +1 -0
  264. package/dist/types/lib/string/index.d.ts +3 -0
  265. package/dist/types/lib/string/index.d.ts.map +1 -0
  266. package/dist/types/lib/string/union.d.ts +2 -0
  267. package/dist/types/lib/string/union.d.ts.map +1 -0
  268. package/dist/types/lib/withErrnoException.d.ts +2 -0
  269. package/dist/types/lib/withErrnoException.d.ts.map +1 -0
  270. package/dist/types/lib/withError.d.ts +2 -0
  271. package/dist/types/lib/withError.d.ts.map +1 -0
  272. package/dist/types/lib/yarn/index.d.ts +4 -0
  273. package/dist/types/lib/yarn/index.d.ts.map +1 -0
  274. package/dist/types/lib/yarn/isYarnVersionOrGreater.d.ts +2 -0
  275. package/dist/types/lib/yarn/isYarnVersionOrGreater.d.ts.map +1 -0
  276. package/dist/types/lib/yarn/workspace/Workspace.d.ts +5 -0
  277. package/dist/types/lib/yarn/workspace/Workspace.d.ts.map +1 -0
  278. package/dist/types/lib/yarn/workspace/index.d.ts +4 -0
  279. package/dist/types/lib/yarn/workspace/index.d.ts.map +1 -0
  280. package/dist/types/lib/yarn/workspace/yarnWorkspace.d.ts +3 -0
  281. package/dist/types/lib/yarn/workspace/yarnWorkspace.d.ts.map +1 -0
  282. package/dist/types/lib/yarn/workspace/yarnWorkspaces.d.ts +3 -0
  283. package/dist/types/lib/yarn/workspace/yarnWorkspaces.d.ts.map +1 -0
  284. package/dist/types/lib/yarn/yarnInitCwd.d.ts +2 -0
  285. package/dist/types/lib/yarn/yarnInitCwd.d.ts.map +1 -0
  286. package/dist/types/loadPackageConfig.d.ts +6 -0
  287. package/dist/types/loadPackageConfig.d.ts.map +1 -0
  288. package/dist/types/xy/index.d.ts +8 -0
  289. package/dist/types/xy/index.d.ts.map +1 -0
  290. package/dist/types/xy/param.d.ts +5 -0
  291. package/dist/types/xy/param.d.ts.map +1 -0
  292. package/dist/types/xy/xy.d.ts +10 -0
  293. package/dist/types/xy/xy.d.ts.map +1 -0
  294. package/dist/types/xy/xyBuildCommands.d.ts +3 -0
  295. package/dist/types/xy/xyBuildCommands.d.ts.map +1 -0
  296. package/dist/types/xy/xyCommonCommands.d.ts +3 -0
  297. package/dist/types/xy/xyCommonCommands.d.ts.map +1 -0
  298. package/dist/types/xy/xyDeployCommands.d.ts +3 -0
  299. package/dist/types/xy/xyDeployCommands.d.ts.map +1 -0
  300. package/dist/types/xy/xyInstallCommands.d.ts +3 -0
  301. package/dist/types/xy/xyInstallCommands.d.ts.map +1 -0
  302. package/dist/types/xy/xyLintCommands.d.ts +3 -0
  303. package/dist/types/xy/xyLintCommands.d.ts.map +1 -0
  304. package/dist/types/xy/xyParseOptions.d.ts +3 -0
  305. package/dist/types/xy/xyParseOptions.d.ts.map +1 -0
  306. package/dist/xy/index.mjs +22 -33
  307. package/dist/xy/index.mjs.map +1 -1
  308. package/dist/xy/xy.mjs +22 -33
  309. package/dist/xy/xy.mjs.map +1 -1
  310. package/dist/xy/xyBuildCommands.mjs +20 -19
  311. package/dist/xy/xyBuildCommands.mjs.map +1 -1
  312. package/dist/xy/xyLintCommands.mjs +2 -14
  313. package/dist/xy/xyLintCommands.mjs.map +1 -1
  314. package/package.json +4 -4
  315. package/src/actions/build.ts +1 -0
  316. package/src/actions/compile-types.ts +1 -1
  317. package/src/actions/compile.ts +7 -11
  318. package/src/actions/lint.ts +1 -5
  319. package/src/actions/package/compile/XyConfig.ts +0 -4
  320. package/src/actions/package/compile/compile.ts +15 -17
  321. package/src/actions/package/compile/packageCompileTscTypes.ts +21 -29
  322. package/src/actions/package/compile/packageCompileTsup.ts +12 -19
  323. package/src/actions/recompile.ts +2 -5
  324. package/src/actions/relint.ts +1 -3
  325. package/src/bin/package/build-only.ts +1 -1
  326. package/src/bin/package/build.ts +1 -1
  327. package/src/bin/package/clean-outputs.ts +1 -8
  328. package/src/bin/package/clean-typescript.ts +1 -8
  329. package/src/xy/xyBuildCommands.ts +0 -1
@@ -14,17 +14,13 @@ export interface LintPackageParams {
14
14
  verbose?: boolean
15
15
  }
16
16
 
17
- export const lintPackage = ({
18
- pkg, fix, verbose,
19
- }: LintParams & Required<Pick<LintParams, 'pkg'>>) => {
17
+ export const lintPackage = ({ pkg, fix }: LintParams & Required<Pick<LintParams, 'pkg'>>) => {
20
18
  console.log(chalk.gray(`${fix ? 'Fix' : 'Lint'} [All-Packages]`))
21
19
  const start = Date.now()
22
- const verboseOptions = verbose ? ['--verbose'] : ['--no-verbose']
23
20
 
24
21
  const result = runSteps(`${fix ? 'Fix' : 'Lint'} [All-Packages]`, [
25
22
  ['yarn', ['workspace',
26
23
  pkg,
27
- ...verboseOptions,
28
24
  'run',
29
25
  fix ? 'package-fix' : 'package-lint',
30
26
  ]],
@@ -2,8 +2,6 @@ import type { Options } from 'tsup'
2
2
 
3
3
  export type EntryMode = 'all' | 'single' | 'auto' | 'platform'
4
4
 
5
- export type CompileMode = 'tsup' | 'tsc'
6
-
7
5
  /**
8
6
  * Configuration for specifying which paths are targeted.
9
7
  */
@@ -36,12 +34,10 @@ export interface CompileConfig {
36
34
  entryMode?: EntryMode
37
35
  /** @param files Manually specify the files to be compiled */
38
36
  files?: string[]
39
- mode?: CompileMode
40
37
  }
41
38
 
42
39
  export type PackageCompileTsupConfig = CompileConfig & {
43
40
  browser?: Record<string, Options | boolean>
44
- mode?: 'tsup'
45
41
  neutral?: Record<string, Options | boolean>
46
42
  node?: Record<string, Options | boolean>
47
43
  tsup?: { options?: Options }
@@ -2,29 +2,27 @@ import chalk from 'chalk'
2
2
 
3
3
  import { loadConfig } from '../../../lib/index.ts'
4
4
  import { packagePublint } from '../publint.ts'
5
- import { packageCompileTsc } from './packageCompileTsc.ts'
5
+ import { packageCompileTypes } from './compileTypes.ts'
6
6
  import { packageCompileTsup } from './packageCompileTsup.ts'
7
- import type {
8
- XyConfig, XyTscConfig, XyTsupConfig,
9
- } from './XyConfig.ts'
7
+ import type { XyConfig } from './XyConfig.ts'
10
8
 
11
- export const packageCompile = async (inConfig: XyConfig = {}, types?: 'tsc' | 'tsup'): Promise<number> => {
9
+ export const packageCompile = async (inConfig: XyConfig = {}): Promise<number> => {
12
10
  const pkg = process.env.INIT_CWD
13
11
  console.log(chalk.green(`Compiling ${pkg}`))
14
12
  const config = await loadConfig(inConfig)
15
13
  const publint = config.publint
16
14
 
17
- const mode = config.compile?.mode ?? 'tsup'
18
- let result: number = 0
19
- switch (mode) {
20
- case 'tsc': {
21
- result += await packageCompileTsc(undefined, config as XyTscConfig)
22
- break
23
- }
24
- case 'tsup': {
25
- result += await packageCompileTsup(config as XyTsupConfig, types)
26
- break
27
- }
15
+ const tscResults = await packageCompileTypes(config)
16
+
17
+ if (tscResults > 0) {
18
+ return tscResults
28
19
  }
29
- return result + (publint ? await packagePublint(config) : 0)
20
+
21
+ const tsupResults = await packageCompileTsup(config)
22
+
23
+ if (tsupResults > 0) {
24
+ return tsupResults
25
+ }
26
+
27
+ return (publint ? await packagePublint(config) : 0)
30
28
  }
@@ -1,10 +1,11 @@
1
1
  import { cwd } from 'node:process'
2
2
 
3
- import chalk from 'chalk'
4
3
  import type { TsConfigCompilerOptions } from 'tsc-prog'
5
4
  import { createProgramFromConfig } from 'tsc-prog'
6
5
  import type { CompilerOptions } from 'typescript'
7
- import { DiagnosticCategory } from 'typescript'
6
+ import {
7
+ DiagnosticCategory, formatDiagnosticsWithColorAndContext, getPreEmitDiagnostics, sys,
8
+ } from 'typescript'
8
9
 
9
10
  import { buildEntries } from './buildEntries.ts'
10
11
  import { getCompilerOptions } from './getCompilerOptions.ts'
@@ -19,12 +20,11 @@ export const packageCompileTscTypes = (
19
20
  const verbose = config?.verbose ?? false
20
21
 
21
22
  if (verbose) {
22
- console.log(`Compiling types with TSC [${pkg}]`)
23
+ console.log(`Compiling types [${pkg}]`)
23
24
  }
24
25
 
25
26
  const compilerOptions = {
26
27
  ...(getCompilerOptions({
27
- declaration: true,
28
28
  emitDeclarationOnly: true,
29
29
  outDir: 'dist/types',
30
30
  removeComments: false,
@@ -40,35 +40,27 @@ export const packageCompileTscTypes = (
40
40
  // calling all here since the types do not get rolled up
41
41
  const files = buildEntries(folder, 'all', verbose)
42
42
 
43
- const result = createProgramFromConfig({
43
+ const program = createProgramFromConfig({
44
44
  basePath: pkg ?? cwd(),
45
45
  compilerOptions,
46
46
  exclude: ['dist', 'docs', '**/*.spec.*', '**/*.stories.*', 'src/**/spec/**/*'],
47
47
  files,
48
- }).emit()
48
+ })
49
49
 
50
- const diagResults = result.diagnostics.length
51
- for (const diag of result.diagnostics) {
52
- switch (diag.category) {
53
- case DiagnosticCategory.Error: {
54
- console.error(chalk.red(diag.messageText))
55
- console.error(chalk.grey(pkg))
56
- console.error(chalk.blue(diag.file?.fileName))
57
- break
58
- }
59
- case DiagnosticCategory.Warning: {
60
- console.error(chalk.yellow(diag.messageText))
61
- console.error(chalk.grey(pkg))
62
- console.error(chalk.blue(diag.file?.fileName))
63
- break
64
- }
65
- case DiagnosticCategory.Suggestion: {
66
- console.error(chalk.white(diag.messageText))
67
- console.error(chalk.grey(pkg))
68
- console.error(chalk.blue(diag.file?.fileName))
69
- break
70
- }
71
- }
50
+ const diagnostics = getPreEmitDiagnostics(program)
51
+
52
+ if (diagnostics.length > 0) {
53
+ const formattedDiagnostics = formatDiagnosticsWithColorAndContext(
54
+ diagnostics,
55
+ {
56
+ getCanonicalFileName: fileName => fileName,
57
+ getCurrentDirectory: () => folder,
58
+ getNewLine: () => sys.newLine,
59
+ },
60
+ )
61
+ console.error(formattedDiagnostics)
72
62
  }
73
- return diagResults
63
+
64
+ program.emit()
65
+ return diagnostics.reduce((acc, diag) => acc + (diag.category === DiagnosticCategory.Error ? 1 : 0), 0)
74
66
  }
@@ -1,18 +1,16 @@
1
- /* eslint-disable complexity */
2
1
  import type { Loader } from 'esbuild'
3
2
  import type { Options } from 'tsup'
4
3
  import { build, defineConfig } from 'tsup'
5
4
 
6
5
  import { buildEntries } from './buildEntries.ts'
6
+ import { packageCompileTypes } from './compileTypes.ts'
7
7
  import { deepMergeObjects } from './deepMerge.ts'
8
- import { packageCompileTscTypes } from './packageCompileTscTypes.ts'
9
8
  import type { EntryMode, XyTsupConfig } from './XyConfig.ts'
10
9
 
11
10
  const compileFolder = async (
12
11
  folder: string,
13
12
  entryMode: EntryMode = 'single',
14
13
  options?: Options,
15
- types: 'tsc' | 'tsup' = 'tsc',
16
14
  verbose?: boolean,
17
15
  ): Promise<number> => {
18
16
  const outDir = options?.outDir ?? 'dist'
@@ -26,7 +24,7 @@ const compileFolder = async (
26
24
  bundle: true,
27
25
  cjsInterop: true,
28
26
  clean: true,
29
- dts: types === 'tsup',
27
+ dts: false,
30
28
  entry,
31
29
  format: ['esm'],
32
30
  outDir,
@@ -46,13 +44,13 @@ const compileFolder = async (
46
44
  ).flat()
47
45
 
48
46
  if (verbose) {
49
- console.log(`TSUP:build:start [${folder}] ${types}`)
47
+ console.log(`TSUP:build:start [${folder}]`)
50
48
  }
51
49
 
52
50
  await Promise.all(optionsList.map(options => build(options)))
53
51
 
54
52
  if (verbose) {
55
- console.log(`TSUP:build:stop [${folder}] ${types}`)
53
+ console.log(`TSUP:build:stop [${folder}]`)
56
54
  }
57
55
 
58
56
  return 0
@@ -76,8 +74,8 @@ export const tsupOptions = (options: Options[] = []): Options => {
76
74
  return deepMergeObjects([standardOptions, ...options])
77
75
  }
78
76
 
79
- export const packageCompileTsup = async (config?: XyTsupConfig, types: 'tsc' | 'tsup' = 'tsc') => {
80
- console.warn('packageCompileTsup-types', types)
77
+ export const packageCompileTsup = async (config?: XyTsupConfig) => {
78
+ console.log('packageCompileTsup-types')
81
79
  const compile = config?.compile
82
80
  const verbose = config?.verbose ?? false
83
81
  if (verbose) {
@@ -88,14 +86,12 @@ export const packageCompileTsup = async (config?: XyTsupConfig, types: 'tsc' | '
88
86
  const compileForBrowser = compile?.browser ?? { src: {} }
89
87
  const compileForNeutral = compile?.neutral ?? { src: {} }
90
88
 
91
- if (types === 'tsc') {
92
- if (verbose) {
93
- console.log(`Calling packageCompileTscTypes [${types}`)
94
- }
95
- const errors = packageCompileTscTypes('src', { verbose })
96
- if (errors) {
97
- return errors
98
- }
89
+ if (verbose) {
90
+ console.log('Calling packageCompileTscTypes')
91
+ }
92
+ const errors = await packageCompileTypes(config)
93
+ if (errors > 0) {
94
+ return errors
99
95
  }
100
96
 
101
97
  return (
@@ -111,7 +107,6 @@ export const packageCompileTsup = async (config?: XyTsupConfig, types: 'tsc' | '
111
107
  compile?.tsup?.options ?? {},
112
108
  (typeof options === 'object' ? options : {}),
113
109
  { platform: 'node', outDir: 'dist/node' }]),
114
- types,
115
110
  verbose,
116
111
  )
117
112
  : 0
@@ -130,7 +125,6 @@ export const packageCompileTsup = async (config?: XyTsupConfig, types: 'tsc' | '
130
125
  compile?.tsup?.options ?? {},
131
126
  (typeof options === 'object' ? options : {}),
132
127
  { platform: 'browser', outDir: 'dist/browser' }]),
133
- types,
134
128
  verbose,
135
129
  )
136
130
  : 0
@@ -149,7 +143,6 @@ export const packageCompileTsup = async (config?: XyTsupConfig, types: 'tsc' | '
149
143
  compile?.tsup?.options ?? {},
150
144
  (typeof options === 'object' ? options : {}),
151
145
  { platform: 'neutral', outDir: 'dist/neutral' }]),
152
- types,
153
146
  verbose,
154
147
  )
155
148
  : 0
@@ -28,15 +28,12 @@ export const recompile = async ({
28
28
  })
29
29
  }
30
30
 
31
- export const recompilePackage = ({
32
- verbose, target, pkg,
33
- }: RecompilePackageParams) => {
31
+ export const recompilePackage = ({ target, pkg }: RecompilePackageParams) => {
34
32
  const targetOptions = target ? ['-t', target] : []
35
- const verboseOptions = verbose ? ['--verbose'] : ['--no-verbose']
36
33
 
37
34
  return runStepsAsync(
38
35
  `Recompile [${pkg}]`,
39
- [['yarn', ['workspace', pkg, ...verboseOptions, 'run', 'package-recompile', ...targetOptions]]],
36
+ [['yarn', ['workspace', pkg, 'run', 'package-recompile', ...targetOptions]]],
40
37
  )
41
38
  }
42
39
 
@@ -33,15 +33,13 @@ const dumpMessages = (lintResults: ESLint.LintResult[]) => {
33
33
  }
34
34
  }
35
35
 
36
- export const relintPackage = ({ pkg, verbose }: RelintParams & Required<Pick<RelintParams, 'pkg'>>) => {
36
+ export const relintPackage = ({ pkg }: RelintParams & Required<Pick<RelintParams, 'pkg'>>) => {
37
37
  console.log(chalk.gray(`${'Relint'} [All-Packages]`))
38
38
  const start = Date.now()
39
- const verboseOptions = verbose ? ['--verbose'] : ['--no-verbose']
40
39
 
41
40
  const result = runSteps('Relint [All-Packages]', [
42
41
  ['yarn', ['workspace',
43
42
  pkg,
44
- ...verboseOptions,
45
43
  'run',
46
44
  'package-relint',
47
45
  ]],
@@ -4,7 +4,7 @@ import chalk from 'chalk'
4
4
 
5
5
  import { packageCompile } from '../../actions/index.ts'
6
6
 
7
- packageCompile({ verbose: true, publint: false }, 'tsc')
7
+ packageCompile({ verbose: true, publint: false })
8
8
  .then((value) => {
9
9
  if (value) {
10
10
  process.exit(value)
@@ -4,7 +4,7 @@ import chalk from 'chalk'
4
4
 
5
5
  import { packageCompile } from '../../actions/index.ts'
6
6
 
7
- packageCompile({ verbose: false, publint: true }, 'tsc')
7
+ packageCompile({ verbose: false, publint: true })
8
8
  .then((value) => {
9
9
  if (value) {
10
10
  process.exit(value)
@@ -2,11 +2,4 @@
2
2
 
3
3
  import { packageCleanOutputs } from '../../actions/index.ts'
4
4
 
5
- packageCleanOutputs()
6
- .then(() => {
7
- process.exit(0)
8
- })
9
- .catch((error) => {
10
- console.error(error)
11
- process.exit(1)
12
- })
5
+ process.exitCode = packageCleanOutputs()
@@ -2,11 +2,4 @@
2
2
 
3
3
  import { packageCleanTypescript } from '../../actions/index.ts'
4
4
 
5
- packageCleanTypescript()
6
- .then(() => {
7
- process.exit(0)
8
- })
9
- .catch((error) => {
10
- console.error(error)
11
- process.exit(1)
12
- })
5
+ process.exitCode = packageCleanTypescript()
@@ -41,7 +41,6 @@ export const xyBuildCommands = (args: Argv) => {
41
41
  jobs: argv.jobs as number,
42
42
  pkg: argv.package as string,
43
43
  target: argv.target as 'esm' | 'cjs',
44
- types: argv.types as 'tsc' | 'tsup',
45
44
  verbose: !!argv.verbose,
46
45
  })
47
46
  },