@xylabs/ts-scripts-yarn3 3.2.41 → 3.3.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 (184) hide show
  1. package/dist/actions/clean-docs.js +2 -2
  2. package/dist/actions/clean-docs.js.map +1 -1
  3. package/dist/actions/clean-docs.mjs +1 -1
  4. package/dist/actions/clean-docs.mjs.map +1 -1
  5. package/dist/actions/clean-eslint.js +2 -2
  6. package/dist/actions/clean-eslint.js.map +1 -1
  7. package/dist/actions/clean-eslint.mjs +1 -1
  8. package/dist/actions/clean-eslint.mjs.map +1 -1
  9. package/dist/actions/compile.js.map +1 -1
  10. package/dist/actions/compile.mjs.map +1 -1
  11. package/dist/actions/copy-assets.js +9 -6
  12. package/dist/actions/copy-assets.js.map +1 -1
  13. package/dist/actions/copy-assets.mjs +9 -6
  14. package/dist/actions/copy-assets.mjs.map +1 -1
  15. package/dist/actions/cycle.js +1 -1
  16. package/dist/actions/cycle.js.map +1 -1
  17. package/dist/actions/cycle.mjs +1 -1
  18. package/dist/actions/cycle.mjs.map +1 -1
  19. package/dist/actions/gitlint-fix.js +4 -4
  20. package/dist/actions/gitlint-fix.js.map +1 -1
  21. package/dist/actions/gitlint-fix.mjs +1 -1
  22. package/dist/actions/gitlint-fix.mjs.map +1 -1
  23. package/dist/actions/gitlint.js +6 -6
  24. package/dist/actions/gitlint.js.map +1 -1
  25. package/dist/actions/gitlint.mjs +6 -6
  26. package/dist/actions/gitlint.mjs.map +1 -1
  27. package/dist/actions/license.js +11 -11
  28. package/dist/actions/license.js.map +1 -1
  29. package/dist/actions/license.mjs +11 -11
  30. package/dist/actions/license.mjs.map +1 -1
  31. package/dist/actions/lint-clean.js +2 -2
  32. package/dist/actions/lint-clean.js.map +1 -1
  33. package/dist/actions/lint-clean.mjs +1 -1
  34. package/dist/actions/lint-clean.mjs.map +1 -1
  35. package/dist/actions/lint.js +4 -4
  36. package/dist/actions/lint.js.map +1 -1
  37. package/dist/actions/lint.mjs +4 -4
  38. package/dist/actions/lint.mjs.map +1 -1
  39. package/dist/actions/package/clean-outputs.js +6 -6
  40. package/dist/actions/package/clean-outputs.js.map +1 -1
  41. package/dist/actions/package/clean-outputs.mjs +2 -2
  42. package/dist/actions/package/clean-outputs.mjs.map +1 -1
  43. package/dist/actions/package/clean-typescript.js +3 -3
  44. package/dist/actions/package/clean-typescript.js.map +1 -1
  45. package/dist/actions/package/clean-typescript.mjs +1 -1
  46. package/dist/actions/package/clean-typescript.mjs.map +1 -1
  47. package/dist/actions/package/compile/buildEntries.js +6 -4
  48. package/dist/actions/package/compile/buildEntries.js.map +1 -1
  49. package/dist/actions/package/compile/buildEntries.mjs +6 -4
  50. package/dist/actions/package/compile/buildEntries.mjs.map +1 -1
  51. package/dist/actions/package/compile/copyTypeFiles.js +1 -1
  52. package/dist/actions/package/compile/copyTypeFiles.js.map +1 -1
  53. package/dist/actions/package/compile/copyTypeFiles.mjs +1 -1
  54. package/dist/actions/package/compile/copyTypeFiles.mjs.map +1 -1
  55. package/dist/actions/package/compile/getCompilerOptions.js +1 -1
  56. package/dist/actions/package/compile/getCompilerOptions.js.map +1 -1
  57. package/dist/actions/package/compile/getCompilerOptions.mjs +1 -1
  58. package/dist/actions/package/compile/getCompilerOptions.mjs.map +1 -1
  59. package/dist/actions/package/compile/inputs.js +2 -2
  60. package/dist/actions/package/compile/inputs.js.map +1 -1
  61. package/dist/actions/package/compile/inputs.mjs +2 -2
  62. package/dist/actions/package/compile/inputs.mjs.map +1 -1
  63. package/dist/actions/package/compile/packageCompileTsc.js +8 -8
  64. package/dist/actions/package/compile/packageCompileTsc.js.map +1 -1
  65. package/dist/actions/package/compile/packageCompileTsc.mjs +6 -6
  66. package/dist/actions/package/compile/packageCompileTsc.mjs.map +1 -1
  67. package/dist/actions/package/compile/packageCompileTscTypes.js +13 -10
  68. package/dist/actions/package/compile/packageCompileTscTypes.js.map +1 -1
  69. package/dist/actions/package/compile/packageCompileTscTypes.mjs +11 -8
  70. package/dist/actions/package/compile/packageCompileTscTypes.mjs.map +1 -1
  71. package/dist/actions/package/compile/packageCompileTsup.js +5 -5
  72. package/dist/actions/package/compile/packageCompileTsup.js.map +1 -1
  73. package/dist/actions/package/compile/packageCompileTsup.mjs +5 -5
  74. package/dist/actions/package/compile/packageCompileTsup.mjs.map +1 -1
  75. package/dist/actions/package/copy-assets.js +9 -6
  76. package/dist/actions/package/copy-assets.js.map +1 -1
  77. package/dist/actions/package/copy-assets.mjs +9 -6
  78. package/dist/actions/package/copy-assets.mjs.map +1 -1
  79. package/dist/actions/package/deps.js +23 -21
  80. package/dist/actions/package/deps.js.map +1 -1
  81. package/dist/actions/package/deps.mjs +19 -17
  82. package/dist/actions/package/deps.mjs.map +1 -1
  83. package/dist/actions/package/gen-docs.js +2 -4
  84. package/dist/actions/package/gen-docs.js.map +1 -1
  85. package/dist/actions/package/gen-docs.mjs +2 -4
  86. package/dist/actions/package/gen-docs.mjs.map +1 -1
  87. package/dist/actions/package/publint.js +10 -7
  88. package/dist/actions/package/publint.js.map +1 -1
  89. package/dist/actions/package/publint.mjs +9 -6
  90. package/dist/actions/package/publint.mjs.map +1 -1
  91. package/dist/actions/reinstall.js +3 -3
  92. package/dist/actions/reinstall.js.map +1 -1
  93. package/dist/actions/reinstall.mjs +1 -1
  94. package/dist/actions/reinstall.mjs.map +1 -1
  95. package/dist/actions/relint.js +2 -2
  96. package/dist/actions/relint.js.map +1 -1
  97. package/dist/actions/relint.mjs +1 -1
  98. package/dist/actions/relint.mjs.map +1 -1
  99. package/dist/index.d.mts +1 -1
  100. package/dist/index.d.ts +1 -1
  101. package/dist/lib/createBuildConfig.js +4 -4
  102. package/dist/lib/createBuildConfig.js.map +1 -1
  103. package/dist/lib/createBuildConfig.mjs +3 -3
  104. package/dist/lib/createBuildConfig.mjs.map +1 -1
  105. package/dist/lib/dependencies/DuplicateDetector.js +6 -6
  106. package/dist/lib/dependencies/DuplicateDetector.js.map +1 -1
  107. package/dist/lib/dependencies/DuplicateDetector.mjs +4 -4
  108. package/dist/lib/dependencies/DuplicateDetector.mjs.map +1 -1
  109. package/dist/lib/dependencies/detectDuplicateDependencies.js +10 -7
  110. package/dist/lib/dependencies/detectDuplicateDependencies.js.map +1 -1
  111. package/dist/lib/dependencies/detectDuplicateDependencies.mjs +9 -6
  112. package/dist/lib/dependencies/detectDuplicateDependencies.mjs.map +1 -1
  113. package/dist/lib/file/ReadFileSyncOptions.js +1 -1
  114. package/dist/lib/file/ReadFileSyncOptions.js.map +1 -1
  115. package/dist/lib/file/ReadFileSyncOptions.mjs +1 -1
  116. package/dist/lib/file/ReadFileSyncOptions.mjs.map +1 -1
  117. package/dist/lib/jsonFormatters.js +2 -2
  118. package/dist/lib/jsonFormatters.js.map +1 -1
  119. package/dist/lib/jsonFormatters.mjs +2 -2
  120. package/dist/lib/jsonFormatters.mjs.map +1 -1
  121. package/dist/lib/parsedPackageJSON.js +2 -2
  122. package/dist/lib/parsedPackageJSON.js.map +1 -1
  123. package/dist/lib/parsedPackageJSON.mjs +1 -1
  124. package/dist/lib/parsedPackageJSON.mjs.map +1 -1
  125. package/dist/lib/runSteps.js +6 -7
  126. package/dist/lib/runSteps.js.map +1 -1
  127. package/dist/lib/runSteps.mjs +4 -5
  128. package/dist/lib/runSteps.mjs.map +1 -1
  129. package/dist/lib/runStepsAsync.js +7 -7
  130. package/dist/lib/runStepsAsync.js.map +1 -1
  131. package/dist/lib/runStepsAsync.mjs +5 -5
  132. package/dist/lib/runStepsAsync.mjs.map +1 -1
  133. package/dist/lib/yarn/isYarnVersionOrGreater.js +3 -3
  134. package/dist/lib/yarn/isYarnVersionOrGreater.js.map +1 -1
  135. package/dist/lib/yarn/isYarnVersionOrGreater.mjs +2 -2
  136. package/dist/lib/yarn/isYarnVersionOrGreater.mjs.map +1 -1
  137. package/dist/lib/yarn/workspace/yarnWorkspaces.js +2 -2
  138. package/dist/lib/yarn/workspace/yarnWorkspaces.js.map +1 -1
  139. package/dist/lib/yarn/workspace/yarnWorkspaces.mjs +1 -1
  140. package/dist/lib/yarn/workspace/yarnWorkspaces.mjs.map +1 -1
  141. package/dist/loadPackageConfig.js +1 -1
  142. package/dist/loadPackageConfig.js.map +1 -1
  143. package/dist/loadPackageConfig.mjs +1 -1
  144. package/dist/loadPackageConfig.mjs.map +1 -1
  145. package/dist/xy/xyLintCommands.js.map +1 -1
  146. package/dist/xy/xyLintCommands.mjs.map +1 -1
  147. package/package.json +19 -19
  148. package/src/actions/clean-docs.ts +2 -1
  149. package/src/actions/clean-eslint.ts +2 -1
  150. package/src/actions/compile.ts +2 -2
  151. package/src/actions/copy-assets.ts +11 -6
  152. package/src/actions/cycle.ts +1 -1
  153. package/src/actions/gitlint-fix.ts +2 -1
  154. package/src/actions/gitlint.ts +6 -6
  155. package/src/actions/license.ts +44 -40
  156. package/src/actions/lint-clean.ts +2 -1
  157. package/src/actions/lint.ts +4 -4
  158. package/src/actions/package/clean-outputs.ts +3 -2
  159. package/src/actions/package/clean-typescript.ts +2 -1
  160. package/src/actions/package/compile/buildEntries.ts +6 -4
  161. package/src/actions/package/compile/copyTypeFiles.ts +2 -1
  162. package/src/actions/package/compile/getCompilerOptions.ts +1 -1
  163. package/src/actions/package/compile/inputs.ts +3 -2
  164. package/src/actions/package/compile/packageCompileTsc.ts +7 -5
  165. package/src/actions/package/compile/packageCompileTscTypes.ts +11 -7
  166. package/src/actions/package/compile/packageCompileTsup.ts +11 -13
  167. package/src/actions/package/copy-assets.ts +10 -6
  168. package/src/actions/package/deps.ts +19 -20
  169. package/src/actions/package/gen-docs.ts +2 -4
  170. package/src/actions/package/publint.ts +10 -6
  171. package/src/actions/reinstall.ts +2 -1
  172. package/src/actions/relint.ts +2 -1
  173. package/src/lib/createBuildConfig.ts +3 -3
  174. package/src/lib/dependencies/DuplicateDetector.ts +6 -4
  175. package/src/lib/dependencies/detectDuplicateDependencies.ts +9 -6
  176. package/src/lib/file/ReadFileSyncOptions.ts +1 -1
  177. package/src/lib/jsonFormatters.ts +2 -2
  178. package/src/lib/parsedPackageJSON.ts +1 -1
  179. package/src/lib/runSteps.ts +5 -5
  180. package/src/lib/runStepsAsync.ts +6 -5
  181. package/src/lib/yarn/isYarnVersionOrGreater.ts +2 -2
  182. package/src/lib/yarn/workspace/yarnWorkspaces.ts +1 -1
  183. package/src/loadPackageConfig.ts +2 -1
  184. package/src/xy/xyLintCommands.ts +4 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/loadPackageConfig.ts"],"sourcesContent":["import { readFile } from 'fs/promises'\nimport { PackageJson } from 'types-package-json'\n\nexport type PackageJsonEx = PackageJson & { type: 'module' | 'commonjs' }\n\nexport const loadPackageConfig = async () => {\n const pkg = process.env.INIT_CWD\n\n const pkgConfig = await readFile(`${pkg}/package.json`, { encoding: 'utf8' })\n\n return JSON.parse(pkgConfig) as PackageJsonEx\n}\n"],"mappings":"AAAA,SAAS,gBAAgB;AAKlB,MAAM,oBAAoB,YAAY;AAC3C,QAAM,MAAM,QAAQ,IAAI;AAExB,QAAM,YAAY,MAAM,SAAS,GAAG,GAAG,iBAAiB,EAAE,UAAU,OAAO,CAAC;AAE5E,SAAO,KAAK,MAAM,SAAS;AAC7B;","names":[]}
1
+ {"version":3,"sources":["../src/loadPackageConfig.ts"],"sourcesContent":["import { readFile } from 'node:fs/promises'\n\nimport { PackageJson } from 'types-package-json'\n\nexport type PackageJsonEx = PackageJson & { type: 'module' | 'commonjs' }\n\nexport const loadPackageConfig = async () => {\n const pkg = process.env.INIT_CWD\n\n const pkgConfig = await readFile(`${pkg}/package.json`, { encoding: 'utf8' })\n\n return JSON.parse(pkgConfig) as PackageJsonEx\n}\n"],"mappings":"AAAA,SAAS,gBAAgB;AAMlB,MAAM,oBAAoB,YAAY;AAC3C,QAAM,MAAM,QAAQ,IAAI;AAExB,QAAM,YAAY,MAAM,SAAS,GAAG,GAAG,iBAAiB,EAAE,UAAU,OAAO,CAAC;AAE5E,SAAO,KAAK,MAAM,SAAS;AAC7B;","names":[]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/xy/xyLintCommands.ts"],"sourcesContent":["import chalk from 'chalk'\nimport { Argv } from 'yargs'\n\nimport { cycle, fix, lint, lintProfile, publint, relint, sonar } from '../actions'\n\nexport const xyLintCommands = (args: Argv) => {\n return args\n .command(\n 'cycle [package]',\n 'Cycle - Check for dependency cycles',\n (yargs) => {\n return yargs.positional('package', {\n describe: 'Specific package to check',\n })\n },\n (argv) => {\n const start = Date.now()\n if (argv.verbose) console.log('Cycle')\n process.exitCode = cycle()\n console.log(chalk.blue(`Finished in ${Date.now() - start}ms`))\n },\n )\n .command(\n 'lint [package]',\n 'Lint - Run Eslint',\n (yargs) => {\n return yargs.positional('package', {\n describe: 'Specific package to check',\n })\n },\n async (argv) => {\n if (argv.verbose) console.log('Lint')\n const start = Date.now()\n process.exitCode = argv.fix ? fix() : argv.profile ? lintProfile() : await lint({ pkg: argv.package as string })\n console.log(chalk.blue(`Finished in ${Date.now() - start}ms`))\n },\n )\n .command(\n 'fix [package]',\n 'Fix - Run Eslint w/fix',\n (yargs) => {\n return yargs.positional('package', {\n describe: 'Specific package to check',\n })\n },\n (argv) => {\n const start = Date.now()\n if (argv.verbose) console.log('Fix')\n process.exitCode = fix()\n console.log(chalk.blue(`Finished in ${Date.now() - start}ms`))\n },\n )\n .command(\n 'relint [package]',\n 'Relint - Clean & Lint',\n (yargs) => {\n return yargs.positional('package', {\n describe: 'Specific package to relint',\n })\n },\n (argv) => {\n if (argv.verbose) console.log('Relinting')\n const start = Date.now()\n process.exitCode = relint()\n console.log(chalk.blue(`Finished in ${Date.now() - start}ms`))\n },\n )\n .command(\n 'publint [package]',\n 'Publint - Run Publint',\n (yargs) => {\n return yargs.positional('package', {\n describe: 'Specific package to publint',\n })\n },\n async (argv) => {\n if (argv.verbose) console.log('Publint')\n const start = Date.now()\n process.exitCode = await publint({ pkg: argv.package as string, verbose: !!argv.verbose })\n console.log(chalk.blue(`Finished in ${Date.now() - start}ms`))\n },\n )\n .command(\n 'sonar',\n 'Sonar - Run Sonar Check',\n (yargs) => {\n return yargs\n },\n (argv) => {\n const start = Date.now()\n if (argv.verbose) console.log('Sonar Check')\n process.exitCode = sonar()\n console.log(chalk.blue(`Finished in ${Date.now() - start}ms`))\n },\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB;AAGlB,qBAAsE;AAE/D,MAAM,iBAAiB,CAAC,SAAe;AAC5C,SAAO,KACJ;AAAA,IACC;AAAA,IACA;AAAA,IACA,CAAC,UAAU;AACT,aAAO,MAAM,WAAW,WAAW;AAAA,QACjC,UAAU;AAAA,MACZ,CAAC;AAAA,IACH;AAAA,IACA,CAAC,SAAS;AACR,YAAM,QAAQ,KAAK,IAAI;AACvB,UAAI,KAAK;AAAS,gBAAQ,IAAI,OAAO;AACrC,cAAQ,eAAW,sBAAM;AACzB,cAAQ,IAAI,aAAAA,QAAM,KAAK,eAAe,KAAK,IAAI,IAAI,KAAK,IAAI,CAAC;AAAA,IAC/D;AAAA,EACF,EACC;AAAA,IACC;AAAA,IACA;AAAA,IACA,CAAC,UAAU;AACT,aAAO,MAAM,WAAW,WAAW;AAAA,QACjC,UAAU;AAAA,MACZ,CAAC;AAAA,IACH;AAAA,IACA,OAAO,SAAS;AACd,UAAI,KAAK;AAAS,gBAAQ,IAAI,MAAM;AACpC,YAAM,QAAQ,KAAK,IAAI;AACvB,cAAQ,WAAW,KAAK,UAAM,oBAAI,IAAI,KAAK,cAAU,4BAAY,IAAI,UAAM,qBAAK,EAAE,KAAK,KAAK,QAAkB,CAAC;AAC/G,cAAQ,IAAI,aAAAA,QAAM,KAAK,eAAe,KAAK,IAAI,IAAI,KAAK,IAAI,CAAC;AAAA,IAC/D;AAAA,EACF,EACC;AAAA,IACC;AAAA,IACA;AAAA,IACA,CAAC,UAAU;AACT,aAAO,MAAM,WAAW,WAAW;AAAA,QACjC,UAAU;AAAA,MACZ,C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IAAI,aAAAA,QAAM,KAAK,eAAe,KAAK,IAAI,IAAI,KAAK,IAAI,CAAC;AAAA,IAC/D;AAAA,EACF;AACJ;","names":["chalk"]}
1
+ {"version":3,"sources":["../../src/xy/xyLintCommands.ts"],"sourcesContent":["import chalk from 'chalk'\nimport { Argv } from 'yargs'\n\nimport { cycle, fix, lint, lintProfile, publint, relint, sonar } from '../actions'\n\nexport const xyLintCommands = (args: Argv) => {\n return args\n .command(\n 'cycle [package]',\n 'Cycle - Check for dependency cycles',\n (yargs) => {\n return yargs.positional('package', {\n describe: 'Specific package to check',\n })\n },\n (argv) => {\n const start = Date.now()\n if (argv.verbose) console.log('Cycle')\n process.exitCode = cycle()\n console.log(chalk.blue(`Finished in ${Date.now() - start}ms`))\n },\n )\n .command(\n 'lint [package]',\n 'Lint - Run Eslint',\n (yargs) => {\n return yargs.positional('package', {\n describe: 'Specific package to check',\n })\n },\n async (argv) => {\n if (argv.verbose) console.log('Lint')\n const start = Date.now()\n process.exitCode =\n argv.fix ? fix()\n : argv.profile ? lintProfile()\n : await lint({ pkg: argv.package as string })\n console.log(chalk.blue(`Finished in ${Date.now() - start}ms`))\n },\n )\n .command(\n 'fix [package]',\n 'Fix - Run Eslint w/fix',\n (yargs) => {\n return yargs.positional('package', {\n describe: 'Specific package to check',\n })\n },\n (argv) => {\n const start = Date.now()\n if (argv.verbose) console.log('Fix')\n process.exitCode = fix()\n console.log(chalk.blue(`Finished in ${Date.now() - start}ms`))\n },\n )\n .command(\n 'relint [package]',\n 'Relint - Clean & Lint',\n (yargs) => {\n return yargs.positional('package', {\n describe: 'Specific package to relint',\n })\n },\n (argv) => {\n if (argv.verbose) console.log('Relinting')\n const start = Date.now()\n process.exitCode = relint()\n console.log(chalk.blue(`Finished in ${Date.now() - start}ms`))\n },\n )\n .command(\n 'publint [package]',\n 'Publint - Run Publint',\n (yargs) => {\n return yargs.positional('package', {\n describe: 'Specific package to publint',\n })\n },\n async (argv) => {\n if (argv.verbose) console.log('Publint')\n const start = Date.now()\n process.exitCode = await publint({ pkg: argv.package as string, verbose: !!argv.verbose })\n console.log(chalk.blue(`Finished in ${Date.now() - start}ms`))\n },\n )\n .command(\n 'sonar',\n 'Sonar - Run Sonar Check',\n (yargs) => {\n return yargs\n },\n (argv) => {\n const start = Date.now()\n if (argv.verbose) console.log('Sonar Check')\n process.exitCode = sonar()\n console.log(chalk.blue(`Finished in ${Date.now() - start}ms`))\n },\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB;AAGlB,qBAAsE;AAE/D,MAAM,iBAAiB,CAAC,SAAe;AAC5C,SAAO,KACJ;AAAA,IACC;AAAA,IACA;AAAA,IACA,CAAC,UAAU;AACT,aAAO,MAAM,WAAW,WAAW;AAAA,QACjC,UAAU;AAAA,MACZ,CAAC;AAAA,IACH;AAAA,IACA,CAAC,SAAS;AACR,YAAM,QAAQ,KAAK,IAAI;AACvB,UAAI,KAAK;AAAS,gBAAQ,IAAI,OAAO;AACrC,cAAQ,eAAW,sBAAM;AACzB,cAAQ,IAAI,aAAAA,QAAM,KAAK,eAAe,KAAK,IAAI,IAAI,KAAK,IAAI,CAAC;AAAA,IAC/D;AAAA,EACF,EACC;AAAA,IACC;AAAA,IACA;AAAA,IACA,CAAC,UAAU;AACT,aAAO,MAAM,WAAW,WAAW;AAAA,QACjC,UAAU;AAAA,MACZ,CAAC;AAAA,IACH;AAAA,IACA,OAAO,SAAS;AACd,UAAI,KAAK;AAAS,gBAAQ,IAAI,MAAM;AACpC,YAAM,QAAQ,KAAK,IAAI;AACvB,cAAQ,WACN,KAAK,UAAM,oBAAI,IACb,KAAK,cAAU,4BAAY,IAC3B,UAAM,qBAAK,EAAE,KAAK,KAAK,QAAkB,CAAC;AAC9C,cAAQ,IAAI,aAAAA,QAAM,KAAK,eAAe,KAAK,IAAI,IAAI,KAAK,IAAI,CAAC;AAAA,IAC/D;AAAA,EACF,EACC;AAA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Q,KAAK,IAAI;AACvB,UAAI,KAAK;AAAS,gBAAQ,IAAI,aAAa;AAC3C,cAAQ,eAAW,sBAAM;AACzB,cAAQ,IAAI,aAAAA,QAAM,KAAK,eAAe,KAAK,IAAI,IAAI,KAAK,IAAI,CAAC;AAAA,IAC/D;AAAA,EACF;AACJ;","names":["chalk"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/xy/xyLintCommands.ts"],"sourcesContent":["import chalk from 'chalk'\nimport { Argv } from 'yargs'\n\nimport { cycle, fix, lint, lintProfile, publint, relint, sonar } from '../actions'\n\nexport const xyLintCommands = (args: Argv) => {\n return args\n .command(\n 'cycle [package]',\n 'Cycle - Check for dependency cycles',\n (yargs) => {\n return yargs.positional('package', {\n describe: 'Specific package to check',\n })\n },\n (argv) => {\n const start = Date.now()\n if (argv.verbose) console.log('Cycle')\n process.exitCode = cycle()\n console.log(chalk.blue(`Finished in ${Date.now() - start}ms`))\n },\n )\n .command(\n 'lint [package]',\n 'Lint - Run Eslint',\n (yargs) => {\n return yargs.positional('package', {\n describe: 'Specific package to check',\n })\n },\n async (argv) => {\n if (argv.verbose) console.log('Lint')\n const start = Date.now()\n process.exitCode = argv.fix ? fix() : argv.profile ? lintProfile() : await lint({ pkg: argv.package as string })\n console.log(chalk.blue(`Finished in ${Date.now() - start}ms`))\n },\n )\n .command(\n 'fix [package]',\n 'Fix - Run Eslint w/fix',\n (yargs) => {\n return yargs.positional('package', {\n describe: 'Specific package to check',\n })\n },\n (argv) => {\n const start = Date.now()\n if (argv.verbose) console.log('Fix')\n process.exitCode = fix()\n console.log(chalk.blue(`Finished in ${Date.now() - start}ms`))\n },\n )\n .command(\n 'relint [package]',\n 'Relint - Clean & Lint',\n (yargs) => {\n return yargs.positional('package', {\n describe: 'Specific package to relint',\n })\n },\n (argv) => {\n if (argv.verbose) console.log('Relinting')\n const start = Date.now()\n process.exitCode = relint()\n console.log(chalk.blue(`Finished in ${Date.now() - start}ms`))\n },\n )\n .command(\n 'publint [package]',\n 'Publint - Run Publint',\n (yargs) => {\n return yargs.positional('package', {\n describe: 'Specific package to publint',\n })\n },\n async (argv) => {\n if (argv.verbose) console.log('Publint')\n const start = Date.now()\n process.exitCode = await publint({ pkg: argv.package as string, verbose: !!argv.verbose })\n console.log(chalk.blue(`Finished in ${Date.now() - start}ms`))\n },\n )\n .command(\n 'sonar',\n 'Sonar - Run Sonar Check',\n (yargs) => {\n return yargs\n },\n (argv) => {\n const start = Date.now()\n if (argv.verbose) console.log('Sonar Check')\n process.exitCode = sonar()\n console.log(chalk.blue(`Finished in ${Date.now() - start}ms`))\n },\n )\n}\n"],"mappings":"AAAA,OAAO,WAAW;AAGlB,SAAS,OAAO,KAAK,MAAM,aAAa,SAAS,QAAQ,aAAa;AAE/D,MAAM,iBAAiB,CAAC,SAAe;AAC5C,SAAO,KACJ;AAAA,IACC;AAAA,IACA;AAAA,IACA,CAAC,UAAU;AACT,aAAO,MAAM,WAAW,WAAW;AAAA,QACjC,UAAU;AAAA,MACZ,CAAC;AAAA,IACH;AAAA,IACA,CAAC,SAAS;AACR,YAAM,QAAQ,KAAK,IAAI;AACvB,UAAI,KAAK;AAAS,gBAAQ,IAAI,OAAO;AACrC,cAAQ,WAAW,MAAM;AACzB,cAAQ,IAAI,MAAM,KAAK,eAAe,KAAK,IAAI,IAAI,KAAK,IAAI,CAAC;AAAA,IAC/D;AAAA,EACF,EACC;AAAA,IACC;AAAA,IACA;AAAA,IACA,CAAC,UAAU;AACT,aAAO,MAAM,WAAW,WAAW;AAAA,QACjC,UAAU;AAAA,MACZ,CAAC;AAAA,IACH;AAAA,IACA,OAAO,SAAS;AACd,UAAI,KAAK;AAAS,gBAAQ,IAAI,MAAM;AACpC,YAAM,QAAQ,KAAK,IAAI;AACvB,cAAQ,WAAW,KAAK,MAAM,IAAI,IAAI,KAAK,UAAU,YAAY,IAAI,MAAM,KAAK,EAAE,KAAK,KAAK,QAAkB,CAAC;AAC/G,cAAQ,IAAI,MAAM,KAAK,eAA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AA,IACT;AAAA,IACA,CAAC,SAAS;AACR,YAAM,QAAQ,KAAK,IAAI;AACvB,UAAI,KAAK;AAAS,gBAAQ,IAAI,aAAa;AAC3C,cAAQ,WAAW,MAAM;AACzB,cAAQ,IAAI,MAAM,KAAK,eAAe,KAAK,IAAI,IAAI,KAAK,IAAI,CAAC;AAAA,IAC/D;AAAA,EACF;AACJ;","names":[]}
1
+ {"version":3,"sources":["../../src/xy/xyLintCommands.ts"],"sourcesContent":["import chalk from 'chalk'\nimport { Argv } from 'yargs'\n\nimport { cycle, fix, lint, lintProfile, publint, relint, sonar } from '../actions'\n\nexport const xyLintCommands = (args: Argv) => {\n return args\n .command(\n 'cycle [package]',\n 'Cycle - Check for dependency cycles',\n (yargs) => {\n return yargs.positional('package', {\n describe: 'Specific package to check',\n })\n },\n (argv) => {\n const start = Date.now()\n if (argv.verbose) console.log('Cycle')\n process.exitCode = cycle()\n console.log(chalk.blue(`Finished in ${Date.now() - start}ms`))\n },\n )\n .command(\n 'lint [package]',\n 'Lint - Run Eslint',\n (yargs) => {\n return yargs.positional('package', {\n describe: 'Specific package to check',\n })\n },\n async (argv) => {\n if (argv.verbose) console.log('Lint')\n const start = Date.now()\n process.exitCode =\n argv.fix ? fix()\n : argv.profile ? lintProfile()\n : await lint({ pkg: argv.package as string })\n console.log(chalk.blue(`Finished in ${Date.now() - start}ms`))\n },\n )\n .command(\n 'fix [package]',\n 'Fix - Run Eslint w/fix',\n (yargs) => {\n return yargs.positional('package', {\n describe: 'Specific package to check',\n })\n },\n (argv) => {\n const start = Date.now()\n if (argv.verbose) console.log('Fix')\n process.exitCode = fix()\n console.log(chalk.blue(`Finished in ${Date.now() - start}ms`))\n },\n )\n .command(\n 'relint [package]',\n 'Relint - Clean & Lint',\n (yargs) => {\n return yargs.positional('package', {\n describe: 'Specific package to relint',\n })\n },\n (argv) => {\n if (argv.verbose) console.log('Relinting')\n const start = Date.now()\n process.exitCode = relint()\n console.log(chalk.blue(`Finished in ${Date.now() - start}ms`))\n },\n )\n .command(\n 'publint [package]',\n 'Publint - Run Publint',\n (yargs) => {\n return yargs.positional('package', {\n describe: 'Specific package to publint',\n })\n },\n async (argv) => {\n if (argv.verbose) console.log('Publint')\n const start = Date.now()\n process.exitCode = await publint({ pkg: argv.package as string, verbose: !!argv.verbose })\n console.log(chalk.blue(`Finished in ${Date.now() - start}ms`))\n },\n )\n .command(\n 'sonar',\n 'Sonar - Run Sonar Check',\n (yargs) => {\n return yargs\n },\n (argv) => {\n const start = Date.now()\n if (argv.verbose) console.log('Sonar Check')\n process.exitCode = sonar()\n console.log(chalk.blue(`Finished in ${Date.now() - start}ms`))\n },\n )\n}\n"],"mappings":"AAAA,OAAO,WAAW;AAGlB,SAAS,OAAO,KAAK,MAAM,aAAa,SAAS,QAAQ,aAAa;AAE/D,MAAM,iBAAiB,CAAC,SAAe;AAC5C,SAAO,KACJ;AAAA,IACC;AAAA,IACA;AAAA,IACA,CAAC,UAAU;AACT,aAAO,MAAM,WAAW,WAAW;AAAA,QACjC,UAAU;AAAA,MACZ,CAAC;AAAA,IACH;AAAA,IACA,CAAC,SAAS;AACR,YAAM,QAAQ,KAAK,IAAI;AACvB,UAAI,KAAK;AAAS,gBAAQ,IAAI,OAAO;AACrC,cAAQ,WAAW,MAAM;AACzB,cAAQ,IAAI,MAAM,KAAK,eAAe,KAAK,IAAI,IAAI,KAAK,IAAI,CAAC;AAAA,IAC/D;AAAA,EACF,EACC;AAAA,IACC;AAAA,IACA;AAAA,IACA,CAAC,UAAU;AACT,aAAO,MAAM,WAAW,WAAW;AAAA,QACjC,UAAU;AAAA,MACZ,CAAC;AAAA,IACH;AAAA,IACA,OAAO,SAAS;AACd,UAAI,KAAK;AAAS,gBAAQ,IAAI,MAAM;AACpC,YAAM,QAAQ,KAAK,IAAI;AACvB,cAAQ,WACN,KAAK,MAAM,IAAI,IACb,KAAK,UAAU,YAAY,IAC3B,MAAM,KAAK,EAAE,KAAK,KAAK,QAAkB,CAAC;AAC9C,cAA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CAAC,UAAU;AACT,aAAO;AAAA,IACT;AAAA,IACA,CAAC,SAAS;AACR,YAAM,QAAQ,KAAK,IAAI;AACvB,UAAI,KAAK;AAAS,gBAAQ,IAAI,aAAa;AAC3C,cAAQ,WAAW,MAAM;AACzB,cAAQ,IAAI,MAAM,KAAK,eAAe,KAAK,IAAI,IAAI,KAAK,IAAI,CAAC;AAAA,IAC/D;AAAA,EACF;AACJ;","names":[]}
package/package.json CHANGED
@@ -59,21 +59,21 @@
59
59
  "dependencies": {
60
60
  "@rollup/plugin-commonjs": "^25.0.7",
61
61
  "@rollup/plugin-json": "^6.1.0",
62
- "@rollup/plugin-typescript": "^11.1.5",
63
- "@types/node": "^20.10.6",
62
+ "@rollup/plugin-typescript": "^11.1.6",
63
+ "@types/node": "^20.11.19",
64
64
  "@types/yargs": "^17.0.32",
65
- "@typescript-eslint/eslint-plugin": "^6.18.0",
66
- "@typescript-eslint/parser": "^6.18.0",
67
- "@xylabs/tsconfig": "~3.2.41",
68
- "async-mutex": "^0.4.0",
65
+ "@typescript-eslint/eslint-plugin": "^6.21.0",
66
+ "@typescript-eslint/parser": "^6.21.0",
67
+ "@xylabs/tsconfig": "~3.3.0",
68
+ "async-mutex": "^0.4.1",
69
69
  "chalk": "^4.1.2",
70
- "cosmiconfig": "^8.3.6",
70
+ "cosmiconfig": "^9.0.0",
71
71
  "cosmiconfig-typescript-loader": "^5.0.0",
72
72
  "cpy": "^8.1.2",
73
73
  "depcheck": "^1.4.7",
74
74
  "eslint": "^8.56.0",
75
75
  "eslint-config-prettier": "^9.1.0",
76
- "eslint-plugin-prettier": "^5.1.2",
76
+ "eslint-plugin-prettier": "^5.1.3",
77
77
  "eslint-plugin-sonarjs": "^0.23.0",
78
78
  "glob": "^10.3.10",
79
79
  "jest": "^29.7.0",
@@ -84,36 +84,36 @@
84
84
  "license-checker": "^25.0.1",
85
85
  "lodash": "^4.17.21",
86
86
  "node-cmd": "^5.0.0",
87
- "npm-check-updates": "^16.14.12",
87
+ "npm-check-updates": "^16.14.15",
88
88
  "npm-package-json-lint": "^7.1.0",
89
89
  "npm-package-json-lint-config-default": "^6.0.0",
90
90
  "parse-git-config": "^3.0.0",
91
- "prettier": "^3.1.1",
91
+ "prettier": "^3.2.5",
92
92
  "publint": "^0.2.7",
93
93
  "reflect-metadata": "^0.2.1",
94
94
  "rimraf": "^4.4.1",
95
- "rollup": "^4.9.4",
95
+ "rollup": "^4.12.0",
96
96
  "rollup-plugin-exclude-dependencies-from-bundle": "^1.1.23",
97
97
  "rollup-plugin-node-externals": "^6.1.2",
98
- "supertest": "^6.3.3",
99
- "ts-jest": "^29.1.1",
98
+ "supertest": "^6.3.4",
99
+ "ts-jest": "^29.1.2",
100
100
  "ts-node": "^10.9.2",
101
101
  "ts-prune": "^0.10.3",
102
102
  "tsc-prog": "^2.3.0",
103
103
  "tslib": "^2.6.2",
104
- "tsup": "^7.3.0",
105
- "typedoc": "^0.25.6",
104
+ "tsup": "^8.0.2",
105
+ "typedoc": "^0.25.8",
106
106
  "types-package-json": "^2.0.39",
107
107
  "yargs": "^17.7.2"
108
108
  },
109
109
  "description": "TypeScript project scripts",
110
110
  "devDependencies": {
111
- "@types/eslint": "^8.56.1",
111
+ "@types/eslint": "^8.56.2",
112
112
  "@types/license-checker": "^25.0.6",
113
113
  "@types/lodash": "^4.14.202",
114
114
  "@types/parse-git-config": "^3.0.4",
115
- "@xylabs/eslint-config": "~3.2.41",
116
- "@xylabs/tsconfig": "~3.2.41",
115
+ "@xylabs/eslint-config": "~3.3.0",
116
+ "@xylabs/tsconfig": "~3.3.0",
117
117
  "publint": "^0.2.7",
118
118
  "typescript": "^5.3.3"
119
119
  },
@@ -169,6 +169,6 @@
169
169
  "package-clean": "echo Not cleaning..."
170
170
  },
171
171
  "sideEffects": false,
172
- "version": "3.2.41",
172
+ "version": "3.3.0",
173
173
  "type": "commonjs"
174
174
  }
@@ -1,5 +1,6 @@
1
+ import path from 'node:path'
2
+
1
3
  import chalk from 'chalk'
2
- import path from 'path'
3
4
  import { rimrafSync } from 'rimraf'
4
5
 
5
6
  import { yarnWorkspaces } from '../lib'
@@ -1,5 +1,6 @@
1
+ import path from 'node:path'
2
+
1
3
  import chalk from 'chalk'
2
- import path from 'path'
3
4
  import { rimrafSync } from 'rimraf'
4
5
 
5
6
  export const cleanESLint = () => {
@@ -25,8 +25,8 @@ export const compile = ({ verbose, target, pkg, incremental, publint }: CompileP
25
25
  export const compilePackage = ({ target, pkg, publint = true }: CompilePackageParams) => {
26
26
  const targetOptions = target ? ['-t', target] : []
27
27
 
28
- return publint
29
- ? runSteps(`Compile [${pkg}]`, [['yarn', ['workspace', pkg, 'run', 'package-compile', ...targetOptions]]])
28
+ return publint ?
29
+ runSteps(`Compile [${pkg}]`, [['yarn', ['workspace', pkg, 'run', 'package-compile', ...targetOptions]]])
30
30
  : runSteps(`Compile [${pkg}]`, [['yarn', ['workspace', pkg, 'run', 'package-compile', ...targetOptions]]])
31
31
  }
32
32
 
@@ -1,6 +1,7 @@
1
+ import path from 'node:path/posix'
2
+
1
3
  import chalk from 'chalk'
2
4
  import cpy from 'cpy'
3
- import path from 'path/posix'
4
5
 
5
6
  import { yarnWorkspaces } from '../lib'
6
7
 
@@ -19,9 +20,9 @@ const copyPackageTargetAssets = async (target: 'esm' | 'cjs', name: string, loca
19
20
  parents: true,
20
21
  },
21
22
  )
22
- values.forEach((value) => {
23
+ for (const value of values) {
23
24
  console.log(`${value.split('/').pop()} => ./dist/${target}`)
24
- })
25
+ }
25
26
  return 0
26
27
  } catch (reason) {
27
28
  console.log(`Copy Failed: ${name}: ${reason}`)
@@ -48,6 +49,7 @@ const copyTargetAssets = async (target: 'esm' | 'cjs', pkg?: string) => {
48
49
  return await copyPackageTargetAssets(target, name, location)
49
50
  }),
50
51
  )
52
+ // eslint-disable-next-line unicorn/no-array-reduce
51
53
  return results.reduce((prev, result) => prev || result, 0)
52
54
  }
53
55
  return 0
@@ -55,11 +57,14 @@ const copyTargetAssets = async (target: 'esm' | 'cjs', pkg?: string) => {
55
57
 
56
58
  export const copyAssets = async ({ target, pkg }: CopyAssetsParams) => {
57
59
  switch (target) {
58
- case 'esm':
60
+ case 'esm': {
59
61
  return await copyTargetAssets('esm', pkg)
60
- case 'cjs':
62
+ }
63
+ case 'cjs': {
61
64
  return await copyTargetAssets('cjs', pkg)
62
- default:
65
+ }
66
+ default: {
63
67
  return (await copyTargetAssets('esm', pkg)) || (await copyTargetAssets('cjs', pkg))
68
+ }
64
69
  }
65
70
  }
@@ -2,5 +2,5 @@ import { runSteps } from '../lib'
2
2
 
3
3
  export const cycle = () => {
4
4
  const rules = ['"\'import/no-cycle\': [1, { maxDepth: 6 }]"', "\"'import/no-internal-modules': ['off']\""]
5
- return runSteps('Cycle', [['yarn', ['eslint', ...rules.map((rule) => ['--rule', rule]).flat(), '--cache', '.']]])
5
+ return runSteps('Cycle', [['yarn', ['eslint', ...rules.flatMap((rule) => ['--rule', rule]), '--cache', '.']]])
6
6
  }
@@ -1,5 +1,6 @@
1
+ import { execSync } from 'node:child_process'
2
+
1
3
  import chalk from 'chalk'
2
- import { execSync } from 'child_process'
3
4
  import { sync } from 'parse-git-config'
4
5
 
5
6
  export const gitlintFix = () => {
@@ -19,16 +19,16 @@ export const gitlint = () => {
19
19
  valid++
20
20
  }
21
21
 
22
- if (gitConfig.core.autocrlf !== false) {
23
- warn('Please set core.autocrlf to FALSE in .git/config file [run yarn gitlint-fix]')
24
- } else {
22
+ if (gitConfig.core.autocrlf === false) {
25
23
  valid++
24
+ } else {
25
+ warn('Please set core.autocrlf to FALSE in .git/config file [run yarn gitlint-fix]')
26
26
  }
27
27
 
28
- if (gitConfig.core.eol !== 'lf') {
29
- warn('Please set core.eol to "lf" in .git/config file [run yarn gitlint-fix]')
30
- } else {
28
+ if (gitConfig.core.eol === 'lf') {
31
29
  valid++
30
+ } else {
31
+ warn('Please set core.eol to "lf" in .git/config file [run yarn gitlint-fix]')
32
32
  }
33
33
 
34
34
  const resultMessages: string[] = []
@@ -9,7 +9,7 @@ export const license = async (pkg?: string) => {
9
9
  return pkg === undefined || name === pkg
10
10
  })
11
11
 
12
- const exclude: string[] = [
12
+ const exclude = new Set([
13
13
  'MIT',
14
14
  'MIT*',
15
15
  'ISC',
@@ -26,52 +26,56 @@ export const license = async (pkg?: string) => {
26
26
  'LGPL-3.0',
27
27
  'LGPL-3.0-or-later',
28
28
  'Python-2.0',
29
- ]
29
+ ])
30
30
 
31
31
  console.log(chalk.green('License Checker'))
32
32
 
33
33
  return (
34
- await Promise.all(
35
- workspaceList.map(({ location, name }) => {
36
- return new Promise<number>((resolve) => {
37
- init({ production: true, start: location }, (error, packages) => {
38
- if (error) {
39
- console.error(chalk.red(`License Checker [${name}] Error`))
40
- console.error(chalk.gray(error))
41
- console.log('\n')
42
- resolve(1)
43
- } else {
44
- console.log(chalk.green(`License Checker [${name}]`))
45
- let count = 0
46
- Object.entries(packages).forEach(([name, info]) => {
47
- const licenses = Array.isArray(info.licenses) ? info.licenses : [info.licenses]
48
- licenses.forEach((license) => {
49
- if (license) {
50
- //remove surrounding parens on some string
51
- if (license[0] === '(' && license[license.length - 1] === ')') {
52
- license = license.substring(1, license.length - 2)
53
- }
54
- //get list of OR licenses from string
55
- const orLicenses = license.split(' OR ')
56
- let orLicenseFound = false
57
- orLicenses.forEach((orLicense) => {
58
- if (exclude.includes(orLicense)) {
59
- orLicenseFound = true
34
+ (
35
+ await Promise.all(
36
+ workspaceList.map(({ location, name }) => {
37
+ return new Promise<number>((resolve) => {
38
+ init({ production: true, start: location }, (error, packages) => {
39
+ if (error) {
40
+ console.error(chalk.red(`License Checker [${name}] Error`))
41
+ console.error(chalk.gray(error))
42
+ console.log('\n')
43
+ resolve(1)
44
+ } else {
45
+ console.log(chalk.green(`License Checker [${name}]`))
46
+ let count = 0
47
+ for (const [name, info] of Object.entries(packages)) {
48
+ const licenses = Array.isArray(info.licenses) ? info.licenses : [info.licenses]
49
+ for (let license of licenses) {
50
+ if (license) {
51
+ //remove surrounding parens on some string
52
+ if (license[0] === '(' && license.at(-1) === ')') {
53
+ license = license.slice(1, -2)
54
+ }
55
+ //get list of OR licenses from string
56
+ const orLicenses = license.split(' OR ')
57
+ let orLicenseFound = false
58
+ for (const orLicense of orLicenses) {
59
+ if (exclude.has(orLicense)) {
60
+ orLicenseFound = true
61
+ }
62
+ }
63
+ if (!orLicenseFound) {
64
+ count++
65
+ console.warn(chalk.yellow(`${name}: Package License not allowed [${license}]`))
60
66
  }
61
- })
62
- if (!orLicenseFound) {
63
- count++
64
- console.warn(chalk.yellow(`${name}: Package License not allowed [${license}]`))
65
67
  }
66
68
  }
67
- })
68
- })
69
- console.log('\n')
70
- resolve(count)
71
- }
69
+ }
70
+ console.log('\n')
71
+ resolve(count)
72
+ }
73
+ })
72
74
  })
73
- })
74
- }),
75
+ }),
76
+ )
75
77
  )
76
- ).reduce((prev, value) => prev || value, 0)
78
+ // eslint-disable-next-line unicorn/no-array-reduce
79
+ .reduce((prev, value) => prev || value, 0)
80
+ )
77
81
  }
@@ -1,4 +1,4 @@
1
- import { rmSync } from 'fs'
1
+ import { rmSync } from 'node:fs'
2
2
 
3
3
  import { yarnWorkspaces } from '../lib'
4
4
  import { lint } from './lint'
@@ -18,6 +18,7 @@ export const lintClean = () => {
18
18
  return 1
19
19
  }
20
20
  })
21
+ // eslint-disable-next-line unicorn/no-array-reduce
21
22
  .reduce((prev, result) => prev || result, 0)
22
23
  return result || lint()
23
24
  }
@@ -17,19 +17,19 @@ const dumpMessages = (lintResults: ESLint.LintResult[]) => {
17
17
  const colors: ('white' | 'red' | 'yellow')[] = ['white', 'yellow', 'red']
18
18
  const severity: string[] = ['none', 'warning', 'error']
19
19
 
20
- lintResults.forEach((lintResult) => {
20
+ for (const lintResult of lintResults) {
21
21
  if (lintResult.messages.length > 0) {
22
22
  console.log(chalk.gray(`${lintResult.filePath}`))
23
- lintResult.messages.forEach((message) => {
23
+ for (const message of lintResult.messages) {
24
24
  console.log(
25
25
  chalk.gray(`\t${message.line}:${message.column}`),
26
26
  chalk[colors[message.severity]](`\t${severity[message.severity]}`),
27
27
  chalk.white(`\t${message.message}`),
28
28
  chalk.gray(`\t${message.ruleId}`),
29
29
  )
30
- })
30
+ }
31
31
  }
32
- })
32
+ }
33
33
  }
34
34
 
35
35
  export const lintPackage = async ({ pkg }: LintParams) => {
@@ -1,6 +1,7 @@
1
+ import { rmSync } from 'node:fs'
2
+ import path from 'node:path'
3
+
1
4
  import chalk from 'chalk'
2
- import { rmSync } from 'fs'
3
- import path from 'path'
4
5
 
5
6
  export const packageCleanOutputs = () => {
6
7
  const pkg = process.env.INIT_CWD ?? '.'
@@ -1,5 +1,6 @@
1
+ import path from 'node:path'
2
+
1
3
  import chalk from 'chalk'
2
- import path from 'path'
3
4
  import { rimrafSync } from 'rimraf'
4
5
 
5
6
  export const packageCleanTypescript = () => {
@@ -3,15 +3,17 @@ import { EntryMode } from './XyConfig'
3
3
 
4
4
  export const buildEntries = (folder: string, entryMode?: EntryMode, verbose = false) => {
5
5
  switch (entryMode) {
6
- case 'platform':
6
+ case 'platform': {
7
7
  if (verbose) console.log('buildEntries [platform]')
8
8
  return [`${folder}/index-node.ts`, `${folder}/index-browser.ts`]
9
- case 'all':
9
+ }
10
+ case 'all': {
10
11
  if (verbose) console.log('buildEntries [all]')
11
12
  return getAllInputs2(folder).filter((entry) => !entry.includes('.spec.') && !entry.includes('.story.'))
12
- case 'single':
13
- default:
13
+ }
14
+ default: {
14
15
  if (verbose) console.log('buildEntries [single]')
15
16
  return [`${folder}/index.ts`]
17
+ }
16
18
  }
17
19
  }
@@ -1,5 +1,6 @@
1
+ import { copyFile, readdir } from 'node:fs/promises'
2
+
1
3
  import { Mutex } from 'async-mutex'
2
- import { copyFile, readdir } from 'fs/promises'
3
4
  import { TsConfigCompilerOptions } from 'tsc-prog'
4
5
 
5
6
  const copyFileMutex = new Mutex()
@@ -10,7 +10,7 @@ export const getCompilerOptionsJSONFollowExtends = (filename: string): CompilerO
10
10
  opts = getCompilerOptionsJSONFollowExtends(requirePath)
11
11
  }
12
12
  if (config?.error) {
13
- throw Error(`getCompilerOptionsJSONFollowExtends failed ${JSON.stringify(config?.error?.messageText, null, 2)}`)
13
+ throw new Error(`getCompilerOptionsJSONFollowExtends failed ${JSON.stringify(config?.error?.messageText, null, 2)}`)
14
14
  }
15
15
 
16
16
  return { ...opts, ...config.compilerOptions }
@@ -1,4 +1,5 @@
1
- import { readdir } from 'fs/promises'
1
+ import { readdir } from 'node:fs/promises'
2
+
2
3
  import { glob } from 'glob'
3
4
 
4
5
  export const getInputs = async (subDir?: string) => {
@@ -20,7 +21,7 @@ export const getInputDirs = async (depth: number = 0) => {
20
21
  .map((file) => {
21
22
  const pathParts = file.path?.split('/') ?? []
22
23
  pathParts.shift()
23
- if (pathParts.length) {
24
+ if (pathParts.length > 0) {
24
25
  const root = pathParts.join('/')
25
26
  return `${root}/${file.name}`
26
27
  } else {
@@ -1,5 +1,6 @@
1
+ import { cwd } from 'node:process'
2
+
1
3
  import chalk from 'chalk'
2
- import { cwd } from 'process'
3
4
  import { createProgramFromConfig, TsConfigCompilerOptions } from 'tsc-prog'
4
5
  import {
5
6
  CompilerOptions,
@@ -36,8 +37,8 @@ export const packageCompileTsc = async (noEmit?: boolean, config?: XyTscConfig,
36
37
  outDir: 'dist',
37
38
  rootDir: 'src',
38
39
  }),
39
- ...(compilerOptionsParam ?? {}),
40
- ...(noEmit !== undefined ? { noEmit } : {}),
40
+ ...compilerOptionsParam,
41
+ ...(noEmit === undefined ? {} : { noEmit }),
41
42
  } as TsConfigCompilerOptions
42
43
 
43
44
  const program = createProgramFromConfig({
@@ -49,11 +50,12 @@ export const packageCompileTsc = async (noEmit?: boolean, config?: XyTscConfig,
49
50
 
50
51
  const results = getPreEmitDiagnostics(program)
51
52
 
52
- results.forEach((diag) => {
53
+ for (const diag of results) {
53
54
  const lineAndChar: LineAndCharacter = diag.file ? getLineAndCharacterOfPosition(diag.file, diag.start ?? 0) : { character: 0, line: 0 }
54
55
  console.log(chalk.cyan(`${diag.file?.fileName}:${lineAndChar.line + 1}:${lineAndChar.character + 1}`))
55
56
  console.log(formatDiagnosticsWithColorAndContext([diag], formatHost))
56
- })
57
+ }
57
58
 
59
+ // eslint-disable-next-line unicorn/no-array-reduce
58
60
  return results.reduce((prev, diag) => (prev + diag.category === DiagnosticCategory.Error ? 1 : 0), 0) || (publint ? await packagePublint() : 0)
59
61
  }
@@ -1,5 +1,6 @@
1
+ import { cwd } from 'node:process'
2
+
1
3
  import chalk from 'chalk'
2
- import { cwd } from 'process'
3
4
  import { createProgramFromConfig, TsConfigCompilerOptions } from 'tsc-prog'
4
5
  import { CompilerOptions, DiagnosticCategory } from 'typescript'
5
6
 
@@ -29,7 +30,7 @@ export const packageCompileTscTypes = async (
29
30
  skipLibCheck: true,
30
31
  sourceMap: true,
31
32
  }),
32
- ...(compilerOptionsParam ?? {}),
33
+ ...compilerOptionsParam,
33
34
  } as TsConfigCompilerOptions
34
35
 
35
36
  //calling all here since the types do not get rolled up
@@ -43,25 +44,28 @@ export const packageCompileTscTypes = async (
43
44
  }).emit()
44
45
 
45
46
  const diagResults = result.diagnostics.length
46
- result.diagnostics.forEach((diag) => {
47
+ for (const diag of result.diagnostics) {
47
48
  switch (diag.category) {
48
- case DiagnosticCategory.Error:
49
+ case DiagnosticCategory.Error: {
49
50
  console.error(chalk.red(diag.messageText))
50
51
  console.error(chalk.grey(pkg))
51
52
  console.error(chalk.blue(diag.file?.fileName))
52
53
  break
53
- case DiagnosticCategory.Warning:
54
+ }
55
+ case DiagnosticCategory.Warning: {
54
56
  console.error(chalk.yellow(diag.messageText))
55
57
  console.error(chalk.grey(pkg))
56
58
  console.error(chalk.blue(diag.file?.fileName))
57
59
  break
58
- case DiagnosticCategory.Suggestion:
60
+ }
61
+ case DiagnosticCategory.Suggestion: {
59
62
  console.error(chalk.white(diag.messageText))
60
63
  console.error(chalk.grey(pkg))
61
64
  console.error(chalk.blue(diag.file?.fileName))
62
65
  break
66
+ }
63
67
  }
64
- })
68
+ }
65
69
  if (generateMts) {
66
70
  await copyTypeFiles(compilerOptions)
67
71
  }
@@ -27,12 +27,10 @@ const compileFolder = async (folder: string, entryMode: EntryMode = 'single', op
27
27
  })
28
28
  const optionsList = (
29
29
  await Promise.all(
30
- (Array.isArray(optionsResult) ? optionsResult : [optionsResult])
31
- .map<Promise<Options[]>>(async (options) => {
32
- const result = typeof options === 'function' ? await options({}) : [options]
33
- return Array.isArray(result) ? result : [result]
34
- })
35
- .flat(),
30
+ (Array.isArray(optionsResult) ? optionsResult : [optionsResult]).flatMap<Promise<Options[]>>(async (options) => {
31
+ const result = typeof options === 'function' ? await options({}) : [options]
32
+ return Array.isArray(result) ? result : [result]
33
+ }),
36
34
  )
37
35
  ).flat()
38
36
 
@@ -59,8 +57,8 @@ export const packageCompileTsup = async (config?: XyTsupConfig) => {
59
57
  await Promise.all(
60
58
  Object.entries(compileForNode).map(async ([folder, options]) => {
61
59
  const inEsBuildOptions = typeof compile?.node?.esbuildOptions === 'object' ? compile?.node?.esbuildOptions : {}
62
- return folder
63
- ? await compileFolder(
60
+ return folder ?
61
+ await compileFolder(
64
62
  folder,
65
63
  compile?.entryMode,
66
64
  {
@@ -75,7 +73,7 @@ export const packageCompileTsup = async (config?: XyTsupConfig) => {
75
73
  platform: 'node',
76
74
  skipNodeModulesBundle: true,
77
75
  target: 'node16',
78
- ...(compile?.tsup?.options ?? {}),
76
+ ...compile?.tsup?.options,
79
77
  ...(typeof options === 'object' ? options : {}),
80
78
  },
81
79
  verbose,
@@ -88,8 +86,8 @@ export const packageCompileTsup = async (config?: XyTsupConfig) => {
88
86
  await Promise.all(
89
87
  Object.entries(compileForBrowser).map(async ([folder, options]) => {
90
88
  const inEsBuildOptions = typeof compile?.browser?.esbuildOptions === 'object' ? compile?.browser?.esbuildOptions : {}
91
- return folder
92
- ? (
89
+ return folder ?
90
+ (
93
91
  await Promise.all([
94
92
  compileFolder(
95
93
  folder,
@@ -107,7 +105,7 @@ export const packageCompileTsup = async (config?: XyTsupConfig) => {
107
105
  platform: 'browser',
108
106
  skipNodeModulesBundle: true,
109
107
  target: 'esnext',
110
- ...(compile?.tsup?.options ?? {}),
108
+ ...compile?.tsup?.options,
111
109
  ...(typeof options === 'object' ? options : {}),
112
110
  },
113
111
  verbose,
@@ -128,7 +126,7 @@ export const packageCompileTsup = async (config?: XyTsupConfig) => {
128
126
  platform: 'browser',
129
127
  skipNodeModulesBundle: true,
130
128
  target: 'esnext',
131
- ...(compile?.tsup?.options ?? {}),
129
+ ...compile?.tsup?.options,
132
130
  ...(typeof options === 'object' ? options : {}),
133
131
  },
134
132
  verbose,