@xylabs/ts-scripts-yarn3 4.0.0-rc.8 → 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 (199) 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 +227 -56
  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 +14 -1
  63. package/dist/actions/recompile.mjs.map +1 -1
  64. package/dist/actions/reinstall.mjs.map +1 -1
  65. package/dist/actions/relint.mjs.map +1 -1
  66. package/dist/actions/retest.mjs.map +1 -1
  67. package/dist/actions/sonar.mjs.map +1 -1
  68. package/dist/actions/statics.mjs +3 -2
  69. package/dist/actions/statics.mjs.map +1 -1
  70. package/dist/actions/test.mjs.map +1 -1
  71. package/dist/actions/up.mjs.map +1 -1
  72. package/dist/actions/updo.mjs.map +1 -1
  73. package/dist/actions/upplug.mjs.map +1 -1
  74. package/dist/actions/upyarn.mjs.map +1 -1
  75. package/dist/actions/yarn3only.mjs.map +1 -1
  76. package/dist/bin/package/clean-outputs.mjs +14 -2
  77. package/dist/bin/package/clean-outputs.mjs.map +1 -1
  78. package/dist/bin/package/clean-typescript.mjs +14 -2
  79. package/dist/bin/package/clean-typescript.mjs.map +1 -1
  80. package/dist/bin/package/clean.mjs +15 -4
  81. package/dist/bin/package/clean.mjs.map +1 -1
  82. package/dist/bin/package/compile-only.mjs +151 -11
  83. package/dist/bin/package/compile-only.mjs.map +1 -1
  84. package/dist/bin/package/compile-tsup.mjs +3 -0
  85. package/dist/bin/package/compile-tsup.mjs.map +1 -1
  86. package/dist/bin/package/compile.mjs +151 -11
  87. package/dist/bin/package/compile.mjs.map +1 -1
  88. package/dist/bin/package/copy-assets-cjs.mjs.map +1 -1
  89. package/dist/bin/package/copy-assets-esm.mjs.map +1 -1
  90. package/dist/bin/package/deps.mjs.map +1 -1
  91. package/dist/bin/package/gen-docs.mjs.map +1 -1
  92. package/dist/bin/package/publint.mjs +3 -0
  93. package/dist/bin/package/publint.mjs.map +1 -1
  94. package/dist/bin/package/recompile.mjs +170 -19
  95. package/dist/bin/package/recompile.mjs.map +1 -1
  96. package/dist/bin/xy-ts.mjs +66 -33
  97. package/dist/bin/xy-ts.mjs.map +1 -1
  98. package/dist/bin/xy.mjs +66 -33
  99. package/dist/bin/xy.mjs.map +1 -1
  100. package/dist/index.d.ts +11 -9
  101. package/dist/index.mjs +230 -58
  102. package/dist/index.mjs.map +1 -1
  103. package/dist/lib/createBuildConfig.mjs.map +1 -1
  104. package/dist/lib/defaultBuildConfig.mjs.map +1 -1
  105. package/dist/lib/deleteGlob.mjs +19 -0
  106. package/dist/lib/deleteGlob.mjs.map +1 -0
  107. package/dist/lib/dependencies/DuplicateDetector.mjs +3 -2
  108. package/dist/lib/dependencies/DuplicateDetector.mjs.map +1 -1
  109. package/dist/lib/dependencies/detectDuplicateDependencies.mjs +3 -2
  110. package/dist/lib/dependencies/detectDuplicateDependencies.mjs.map +1 -1
  111. package/dist/lib/dependencies/index.mjs +3 -2
  112. package/dist/lib/dependencies/index.mjs.map +1 -1
  113. package/dist/lib/file/ReadFileSyncOptions.mjs.map +1 -1
  114. package/dist/lib/file/fileLines.mjs.map +1 -1
  115. package/dist/lib/file/index.mjs.map +1 -1
  116. package/dist/lib/file/tryReadFileSync.mjs.map +1 -1
  117. package/dist/lib/generateIgnoreFiles.mjs.map +1 -1
  118. package/dist/lib/index.mjs +160 -5
  119. package/dist/lib/index.mjs.map +1 -1
  120. package/dist/lib/loadConfig.mjs +143 -3
  121. package/dist/lib/loadConfig.mjs.map +1 -1
  122. package/dist/lib/processEx.mjs.map +1 -1
  123. package/dist/lib/runSteps.mjs.map +1 -1
  124. package/dist/lib/runStepsAsync.mjs.map +1 -1
  125. package/dist/lib/runXy.mjs.map +1 -1
  126. package/dist/lib/safeExit.mjs.map +1 -1
  127. package/dist/lib/withErrnoException.mjs.map +1 -1
  128. package/dist/lib/yarn/index.mjs.map +1 -1
  129. package/dist/lib/yarn/workspace/index.mjs.map +1 -1
  130. package/dist/lib/yarn/workspace/yarnWorkspace.mjs.map +1 -1
  131. package/dist/lib/yarn/workspace/yarnWorkspaces.mjs.map +1 -1
  132. package/dist/loadPackageConfig.mjs.map +1 -1
  133. package/dist/xy/index.mjs +66 -33
  134. package/dist/xy/index.mjs.map +1 -1
  135. package/dist/xy/param.mjs.map +1 -1
  136. package/dist/xy/xy.mjs +66 -33
  137. package/dist/xy/xy.mjs.map +1 -1
  138. package/dist/xy/xyBuildCommands.mjs +17 -3
  139. package/dist/xy/xyBuildCommands.mjs.map +1 -1
  140. package/dist/xy/xyCommonCommands.mjs +14 -4
  141. package/dist/xy/xyCommonCommands.mjs.map +1 -1
  142. package/dist/xy/xyDeployCommands.mjs.map +1 -1
  143. package/dist/xy/xyInstallCommands.mjs +3 -2
  144. package/dist/xy/xyInstallCommands.mjs.map +1 -1
  145. package/dist/xy/xyLintCommands.mjs +30 -22
  146. package/dist/xy/xyLintCommands.mjs.map +1 -1
  147. package/dist/xy/xyParseOptions.mjs.map +1 -1
  148. package/package.json +53 -55
  149. package/src/actions/build.ts +3 -1
  150. package/src/actions/clean-docs.ts +2 -3
  151. package/src/actions/clean-eslint.ts +3 -2
  152. package/src/actions/clean.ts +3 -1
  153. package/src/actions/compile.ts +13 -3
  154. package/src/actions/cycle.ts +15 -4
  155. package/src/actions/deps.ts +6 -5
  156. package/src/actions/gen-docs.ts +3 -4
  157. package/src/actions/package/clean-outputs.ts +3 -2
  158. package/src/actions/package/clean-typescript.ts +3 -2
  159. package/src/actions/package/compile/XyConfig.ts +5 -13
  160. package/src/actions/package/compile/buildEntries.ts +1 -1
  161. package/src/actions/package/compile/compile.ts +3 -1
  162. package/src/actions/package/compile/copyTypeFiles.ts +1 -1
  163. package/src/actions/package/compile/getCompilerOptions.ts +10 -8
  164. package/src/actions/package/compile/packageCompileTsc.ts +11 -6
  165. package/src/actions/package/compile/packageCompileTscTypes.ts +5 -3
  166. package/src/actions/package/compile/packageCompileTsup.ts +6 -3
  167. package/src/actions/package/copy-assets.ts +1 -3
  168. package/src/actions/package/deps.ts +6 -2
  169. package/src/actions/package/gen-docs.ts +3 -1
  170. package/src/actions/package/publint.ts +8 -5
  171. package/src/actions/publint.ts +3 -1
  172. package/src/actions/recompile.ts +47 -8
  173. package/src/actions/reinstall.ts +3 -1
  174. package/src/lib/defaultBuildConfig.ts +11 -1
  175. package/src/lib/deleteGlob.ts +13 -0
  176. package/src/lib/dependencies/DuplicateDetector.ts +4 -4
  177. package/src/lib/file/ReadFileSyncOptions.ts +4 -1
  178. package/src/lib/file/fileLines.ts +9 -3
  179. package/src/lib/file/tryReadFileSync.ts +4 -2
  180. package/src/lib/generateIgnoreFiles.ts +3 -1
  181. package/src/lib/index.ts +1 -0
  182. package/src/lib/loadConfig.ts +3 -4
  183. package/src/lib/runSteps.ts +2 -1
  184. package/src/lib/runStepsAsync.ts +1 -1
  185. package/src/lib/runXy.ts +4 -1
  186. package/src/lib/withErrnoException.ts +3 -1
  187. package/src/lib/yarn/workspace/yarnWorkspace.ts +1 -1
  188. package/src/lib/yarn/workspace/yarnWorkspaces.ts +1 -1
  189. package/src/loadPackageConfig.ts +1 -1
  190. package/src/types.d.ts +23 -0
  191. package/src/xy/param.ts +2 -4
  192. package/src/xy/xyBuildCommands.ts +10 -20
  193. package/src/xy/xyCommonCommands.ts +4 -2
  194. package/src/xy/xyDeployCommands.ts +4 -2
  195. package/src/xy/xyInstallCommands.ts +5 -5
  196. package/src/xy/xyLintCommands.ts +6 -4
  197. package/src/xy/xyParseOptions.ts +3 -2
  198. package/tsup.config.ts +2 -6
  199. package/xy.config.ts +1 -5
package/src/lib/index.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  export * from './checkResult.ts'
2
2
  export * from './createBuildConfig.ts'
3
3
  export * from './defaultBuildConfig.ts'
4
+ export * from './deleteGlob.ts'
4
5
  export * from './dependencies/index.ts'
5
6
  export * from './file/index.ts'
6
7
  export * from './generateIgnoreFiles.ts'
@@ -1,13 +1,12 @@
1
1
  import chalk from 'chalk'
2
2
  import { cosmiconfig } from 'cosmiconfig'
3
- // eslint-disable-next-line import/no-internal-modules
4
- import merge from 'lodash/merge.js'
3
+ import deepmerge from 'deepmerge'
5
4
 
6
5
  let config: Record<string, unknown>
7
6
 
8
7
  export const loadConfig = async <T extends object>(params?: T): Promise<T> => {
9
8
  if (config) {
10
- return merge({}, config, params)
9
+ return deepmerge(config, params ?? {}) as T
11
10
  }
12
11
 
13
12
  const cosmicConfigResult = await cosmiconfig('xy', { cache: true }).search()
@@ -16,5 +15,5 @@ export const loadConfig = async <T extends object>(params?: T): Promise<T> => {
16
15
  if (configFilePath) {
17
16
  console.log(chalk.gray(`Loading config from ${configFilePath}`))
18
17
  }
19
- return merge({}, config, params)
18
+ return deepmerge(config, params ?? {}) as T
20
19
  }
@@ -1,4 +1,5 @@
1
- import { spawnSync, SpawnSyncOptionsWithBufferEncoding } from 'node:child_process'
1
+ import type { SpawnSyncOptionsWithBufferEncoding } from 'node:child_process'
2
+ import { spawnSync } from 'node:child_process'
2
3
  import { existsSync } from 'node:fs'
3
4
 
4
5
  import chalk from 'chalk'
@@ -4,7 +4,7 @@ import { existsSync } from 'node:fs'
4
4
  import chalk from 'chalk'
5
5
 
6
6
  import { checkResult } from './checkResult.ts'
7
- import { ScriptStep } from './runSteps.ts'
7
+ import type { ScriptStep } from './runSteps.ts'
8
8
  import { safeExitAsync } from './safeExit.ts'
9
9
 
10
10
  export const runStepAsync = (name: string, step: ScriptStep, exitOnFail = true, message?: string) => {
package/src/lib/runXy.ts CHANGED
@@ -1,5 +1,8 @@
1
1
  import { runSteps } from './runSteps.ts'
2
2
 
3
3
  export const runXy = (command: string) => {
4
- return runSteps(`XY [${command}]`, [['yarn', ['xy', command, ...process.argv.filter((value, index) => (index > 1 ? value : undefined))]]])
4
+ return runSteps(
5
+ `XY [${command}]`,
6
+ [['yarn', ['xy', command, ...process.argv.filter((value, index) => (index > 1 ? value : undefined))]]],
7
+ )
5
8
  }
@@ -1,5 +1,7 @@
1
1
  import { withError } from './withError.ts'
2
2
 
3
- export const withErrnoException = <T extends NodeJS.ErrnoException = NodeJS.ErrnoException>(ex: unknown, closure: (error: T) => number) => {
3
+ export const withErrnoException = <T extends NodeJS.ErrnoException = NodeJS.ErrnoException>(
4
+ ex: unknown, closure: (error: T) => number,
5
+ ) => {
4
6
  return withError<T>(ex, closure, (ex: unknown) => (ex as NodeJS.ErrnoException).errno !== undefined)
5
7
  }
@@ -1,4 +1,4 @@
1
- import { Workspace } from './Workspace.ts'
1
+ import type { Workspace } from './Workspace.ts'
2
2
  import { yarnWorkspaces } from './yarnWorkspaces.ts'
3
3
 
4
4
  export const yarnWorkspace = (pkg: string): Workspace => {
@@ -1,6 +1,6 @@
1
1
  import { spawnSync } from 'node:child_process'
2
2
 
3
- import { Workspace } from './Workspace.ts'
3
+ import type { Workspace } from './Workspace.ts'
4
4
 
5
5
  export const yarnWorkspaces = (): Workspace[] => {
6
6
  const result = spawnSync('yarn', ['workspaces', 'list', '--json', '--recursive'], { encoding: 'utf8', shell: true })
@@ -1,6 +1,6 @@
1
1
  import { readFile } from 'node:fs/promises'
2
2
 
3
- import { PackageJson } from 'types-package-json'
3
+ import type { PackageJson } from 'types-package-json'
4
4
 
5
5
  export type PackageJsonEx = PackageJson & { type: 'module' | 'commonjs' }
6
6
 
package/src/types.d.ts CHANGED
@@ -1,3 +1,26 @@
1
1
  declare module 'rollup-plugin-exclude-dependencies-from-bundle'
2
2
  declare module '@haensl/rollup-plugin-local-resolve'
3
3
  declare module 'rollup-plugin-progress'
4
+
5
+ declare module 'eslint-plugin-import' {
6
+ const configs: Linter.Plugin
7
+ }
8
+
9
+ declare module 'eslint-plugin-workspaces' {
10
+ const configs: Linter.Plugin
11
+ }
12
+
13
+ declare module 'eslint-plugin-unicorn' {
14
+ const configs: {
15
+ 'all': unknown
16
+ 'flat/all': unknown
17
+ 'flat/recommended': unknown
18
+ 'recommended': unknown
19
+ }
20
+ }
21
+
22
+ declare module 'markdown-eslint-parser' {}
23
+
24
+ declare module 'eslint-plugin-md' {
25
+ const configs: Linter.Plugin
26
+ }
package/src/xy/param.ts CHANGED
@@ -1,7 +1,5 @@
1
- import { Argv } from 'yargs'
1
+ import type { Argv } from 'yargs'
2
2
 
3
3
  export const packagePositionalParam = (yargs: Argv<unknown>) => {
4
- return yargs.positional('package', {
5
- describe: 'Specific package to target',
6
- })
4
+ return yargs.positional('package', { describe: 'Specific package to target' })
7
5
  }
@@ -1,6 +1,8 @@
1
- import { Argv } from 'yargs'
1
+ import type { Argv } from 'yargs'
2
2
 
3
- import { build, compile, copyAssets, rebuild, recompile } from '../actions/index.ts'
3
+ import {
4
+ build, compile, copyAssets, rebuild, recompile,
5
+ } from '../actions/index.ts'
4
6
 
5
7
  export const xyBuildCommands = (args: Argv) => {
6
8
  return args
@@ -8,9 +10,7 @@ export const xyBuildCommands = (args: Argv) => {
8
10
  'build [package]',
9
11
  'Build - Compile & Lint',
10
12
  (yargs) => {
11
- return yargs.positional('package', {
12
- describe: 'Specific package to build',
13
- })
13
+ return yargs.positional('package', { describe: 'Specific package to build' })
14
14
  },
15
15
  async (argv) => {
16
16
  if (argv.verbose) {
@@ -30,9 +30,7 @@ export const xyBuildCommands = (args: Argv) => {
30
30
  'compile [package]',
31
31
  'Compile with Typescript & Copy Images',
32
32
  (yargs) => {
33
- return yargs.positional('package', {
34
- describe: 'Specific package to compile',
35
- })
33
+ return yargs.positional('package', { describe: 'Specific package to compile' })
36
34
  },
37
35
  async (argv) => {
38
36
  if (argv.verbose) {
@@ -51,9 +49,7 @@ export const xyBuildCommands = (args: Argv) => {
51
49
  'compile-only [package]',
52
50
  'Compile with Typescript & Copy Images (No Publint)',
53
51
  (yargs) => {
54
- return yargs.positional('package', {
55
- describe: 'Specific package to compile',
56
- })
52
+ return yargs.positional('package', { describe: 'Specific package to compile' })
57
53
  },
58
54
  async (argv) => {
59
55
  if (argv.verbose) {
@@ -73,9 +69,7 @@ export const xyBuildCommands = (args: Argv) => {
73
69
  'recompile [package]',
74
70
  'Re-compile with Typescript & Copy Images',
75
71
  (yargs) => {
76
- return yargs.positional('package', {
77
- describe: 'Specific package to re-compile',
78
- })
72
+ return yargs.positional('package', { describe: 'Specific package to re-compile' })
79
73
  },
80
74
  async (argv) => {
81
75
  if (argv.verbose) {
@@ -94,9 +88,7 @@ export const xyBuildCommands = (args: Argv) => {
94
88
  'rebuild [package]',
95
89
  'Rebuild - Clean, Compile & Lint',
96
90
  (yargs) => {
97
- return yargs.positional('package', {
98
- describe: 'Specific package to rebuild',
99
- })
91
+ return yargs.positional('package', { describe: 'Specific package to rebuild' })
100
92
  },
101
93
  (argv) => {
102
94
  if (argv.verbose) console.log(`Rebuilding: ${argv.package ?? 'all'}`)
@@ -107,9 +99,7 @@ export const xyBuildCommands = (args: Argv) => {
107
99
  'copy-assets [package]',
108
100
  'Copy Assets - Copy the assets from src to dist',
109
101
  (yargs) => {
110
- return yargs.positional('package', {
111
- describe: 'Specific package to copy assets',
112
- })
102
+ return yargs.positional('package', { describe: 'Specific package to copy assets' })
113
103
  },
114
104
  async (argv) => {
115
105
  if (argv.verbose) console.log(`Copying Assets: ${argv.package ?? 'all'}`)
@@ -1,4 +1,4 @@
1
- import { Argv } from 'yargs'
1
+ import type { Argv } from 'yargs'
2
2
 
3
3
  import {
4
4
  cleanDocs,
@@ -51,7 +51,9 @@ export const xyCommonCommands = (args: Argv) => {
51
51
  },
52
52
  (argv) => {
53
53
  if (argv.verbose) console.log(`Checking Dependencies: ${argv.package ?? 'all'}`)
54
- process.exitCode = deps({ incremental: !!argv.incremental, jobs: argv.jobs as number, pkg: argv.package as string })
54
+ process.exitCode = deps({
55
+ incremental: !!argv.incremental, jobs: argv.jobs as number, pkg: argv.package as string,
56
+ })
55
57
  },
56
58
  )
57
59
  .command(
@@ -1,6 +1,8 @@
1
- import { Argv } from 'yargs'
1
+ import type { Argv } from 'yargs'
2
2
 
3
- import { deploy, deployMajor, deployMinor, deployNext } from '../actions/index.ts'
3
+ import {
4
+ deploy, deployMajor, deployMinor, deployNext,
5
+ } from '../actions/index.ts'
4
6
 
5
7
  export const xyDeployCommands = (args: Argv) => {
6
8
  return args
@@ -1,6 +1,8 @@
1
- import { Argv } from 'yargs'
1
+ import type { Argv } from 'yargs'
2
2
 
3
- import { clean, dupdeps, reinstall, statics, up, updo } from '../actions/index.ts'
3
+ import {
4
+ clean, dupdeps, reinstall, statics, up, updo,
5
+ } from '../actions/index.ts'
4
6
 
5
7
  export const xyInstallCommands = (args: Argv) => {
6
8
  return args
@@ -8,9 +10,7 @@ export const xyInstallCommands = (args: Argv) => {
8
10
  'clean [package]',
9
11
  'Clean',
10
12
  (yargs) => {
11
- return yargs.positional('package', {
12
- describe: 'Specific package to clean',
13
- })
13
+ return yargs.positional('package', { describe: 'Specific package to clean' })
14
14
  },
15
15
  async (argv) => {
16
16
  if (argv.verbose) {
@@ -1,7 +1,9 @@
1
1
  import chalk from 'chalk'
2
- import { Argv } from 'yargs'
2
+ import type { Argv } from 'yargs'
3
3
 
4
- import { cycle, fix, lint, lintProfile, publint, relint, sonar } from '../actions/index.ts'
4
+ import {
5
+ cycle, fix, lint, lintProfile, publint, relint, sonar,
6
+ } from '../actions/index.ts'
5
7
  import { packagePositionalParam } from './param.ts'
6
8
 
7
9
  export const xyLintCommands = (args: Argv) => {
@@ -12,10 +14,10 @@ export const xyLintCommands = (args: Argv) => {
12
14
  (yargs) => {
13
15
  return packagePositionalParam(yargs)
14
16
  },
15
- (argv) => {
17
+ async (argv) => {
16
18
  const start = Date.now()
17
19
  if (argv.verbose) console.log('Cycle')
18
- process.exitCode = cycle()
20
+ process.exitCode = await cycle()
19
21
  console.log(chalk.blue(`Finished in ${Date.now() - start}ms`))
20
22
  },
21
23
  )
@@ -1,5 +1,6 @@
1
- import yargs, { Argv } from 'yargs'
2
- // eslint-disable-next-line import/no-internal-modules
1
+ import type { Argv } from 'yargs'
2
+ import yargs from 'yargs'
3
+ // eslint-disable-next-line import-x/no-internal-modules
3
4
  import { hideBin } from 'yargs/helpers'
4
5
 
5
6
  export const xyParseOptions = (): Argv => {
package/tsup.config.ts CHANGED
@@ -4,12 +4,8 @@ export default defineConfig({
4
4
  bundle: true,
5
5
  cjsInterop: true,
6
6
  clean: false,
7
- dts: {
8
- entry: ['src/index.ts'],
9
- },
10
- outExtension: ({ format }) => ({
11
- js: format === 'cjs' ? '.cjs' : '.mjs',
12
- }),
7
+ dts: { entry: ['src/index.ts'] },
8
+ outExtension: ({ format }) => ({ js: format === 'cjs' ? '.cjs' : '.mjs' }),
13
9
  entry: ['src'],
14
10
  format: ['esm'],
15
11
  outDir: 'dist',
package/xy.config.ts CHANGED
@@ -1,7 +1,3 @@
1
- const config = {
2
- compile: {
3
- browser: false,
4
- },
5
- }
1
+ const config = { compile: { browser: false } }
6
2
 
7
3
  export default config