@xylabs/ts-scripts-yarn3 4.0.0-rc.28 → 4.0.0-rc.30

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 (118) hide show
  1. package/dist/actions/build.mjs.map +1 -1
  2. package/dist/actions/clean-docs.mjs.map +1 -1
  3. package/dist/actions/clean-eslint.mjs.map +1 -1
  4. package/dist/actions/clean-jest.mjs.map +1 -1
  5. package/dist/actions/clean.mjs.map +1 -1
  6. package/dist/actions/compile.mjs.map +1 -1
  7. package/dist/actions/copy-assets.mjs.map +1 -1
  8. package/dist/actions/cycle.mjs.map +1 -1
  9. package/dist/actions/dead.mjs.map +1 -1
  10. package/dist/actions/deploy-major.mjs.map +1 -1
  11. package/dist/actions/deploy-minor.mjs.map +1 -1
  12. package/dist/actions/deploy-next.mjs.map +1 -1
  13. package/dist/actions/deploy.mjs.map +1 -1
  14. package/dist/actions/deps.mjs.map +1 -1
  15. package/dist/actions/dupdeps.mjs.map +1 -1
  16. package/dist/actions/fix.mjs.map +1 -1
  17. package/dist/actions/gen-docs.mjs.map +1 -1
  18. package/dist/actions/gitignore-gen.mjs.map +1 -1
  19. package/dist/actions/index.mjs.map +1 -1
  20. package/dist/actions/license.mjs.map +1 -1
  21. package/dist/actions/lint-clean.mjs.map +1 -1
  22. package/dist/actions/lint-profile.mjs.map +1 -1
  23. package/dist/actions/lint.mjs.map +1 -1
  24. package/dist/actions/npmignore-gen.mjs.map +1 -1
  25. package/dist/actions/package/clean-outputs.mjs.map +1 -1
  26. package/dist/actions/package/clean-typescript.mjs.map +1 -1
  27. package/dist/actions/package/clean.mjs.map +1 -1
  28. package/dist/actions/package/compile/buildEntries.mjs.map +1 -1
  29. package/dist/actions/package/compile/compile.mjs.map +1 -1
  30. package/dist/actions/package/compile/copyTypeFiles.mjs.map +1 -1
  31. package/dist/actions/package/compile/index.mjs.map +1 -1
  32. package/dist/actions/package/compile/inputs.mjs.map +1 -1
  33. package/dist/actions/package/compile/packageCompileTsc.mjs.map +1 -1
  34. package/dist/actions/package/compile/packageCompileTscTypes.mjs.map +1 -1
  35. package/dist/actions/package/compile/packageCompileTsup.mjs.map +1 -1
  36. package/dist/actions/package/deps.mjs.map +1 -1
  37. package/dist/actions/package/index.mjs.map +1 -1
  38. package/dist/actions/package/recompile.mjs.map +1 -1
  39. package/dist/actions/publint.mjs.map +1 -1
  40. package/dist/actions/rebuild.mjs.map +1 -1
  41. package/dist/actions/recompile.mjs.map +1 -1
  42. package/dist/actions/reinstall.mjs.map +1 -1
  43. package/dist/actions/relint.mjs.map +1 -1
  44. package/dist/actions/retest.mjs.map +1 -1
  45. package/dist/actions/sonar.mjs.map +1 -1
  46. package/dist/actions/statics.mjs.map +1 -1
  47. package/dist/actions/test.mjs.map +1 -1
  48. package/dist/actions/up.mjs.map +1 -1
  49. package/dist/actions/updo.mjs.map +1 -1
  50. package/dist/actions/upplug.mjs.map +1 -1
  51. package/dist/actions/upyarn.mjs.map +1 -1
  52. package/dist/actions/yarn3only.mjs.map +1 -1
  53. package/dist/bin/package/clean-outputs.mjs.map +1 -1
  54. package/dist/bin/package/clean-typescript.mjs.map +1 -1
  55. package/dist/bin/package/clean.mjs.map +1 -1
  56. package/dist/bin/package/compile-only.mjs.map +1 -1
  57. package/dist/bin/package/compile-tsup.mjs.map +1 -1
  58. package/dist/bin/package/compile.mjs.map +1 -1
  59. package/dist/bin/package/deps.mjs.map +1 -1
  60. package/dist/bin/package/recompile.mjs.map +1 -1
  61. package/dist/bin/xy-ts.mjs.map +1 -1
  62. package/dist/bin/xy.mjs.map +1 -1
  63. package/dist/index.d.ts +6 -6
  64. package/dist/index.mjs.map +1 -1
  65. package/dist/lib/deleteGlob.mjs.map +1 -1
  66. package/dist/lib/dependencies/DuplicateDetector.mjs.map +1 -1
  67. package/dist/lib/dependencies/detectDuplicateDependencies.mjs.map +1 -1
  68. package/dist/lib/dependencies/index.mjs.map +1 -1
  69. package/dist/lib/generateIgnoreFiles.mjs.map +1 -1
  70. package/dist/lib/index.mjs.map +1 -1
  71. package/dist/lib/runSteps.mjs.map +1 -1
  72. package/dist/lib/runStepsAsync.mjs.map +1 -1
  73. package/dist/lib/runXy.mjs.map +1 -1
  74. package/dist/lib/yarn/index.mjs.map +1 -1
  75. package/dist/lib/yarn/isYarnVersionOrGreater.mjs.map +1 -1
  76. package/dist/lib/yarn/workspace/index.mjs.map +1 -1
  77. package/dist/lib/yarn/workspace/yarnWorkspace.mjs.map +1 -1
  78. package/dist/lib/yarn/workspace/yarnWorkspaces.mjs.map +1 -1
  79. package/dist/xy/index.mjs.map +1 -1
  80. package/dist/xy/xy.mjs.map +1 -1
  81. package/dist/xy/xyBuildCommands.mjs.map +1 -1
  82. package/dist/xy/xyCommonCommands.mjs.map +1 -1
  83. package/dist/xy/xyDeployCommands.mjs.map +1 -1
  84. package/dist/xy/xyInstallCommands.mjs.map +1 -1
  85. package/dist/xy/xyLintCommands.mjs.map +1 -1
  86. package/package.json +6 -6
  87. package/src/actions/clean-docs.ts +1 -3
  88. package/src/actions/clean.ts +2 -6
  89. package/src/actions/compile.ts +1 -3
  90. package/src/actions/copy-assets.ts +2 -6
  91. package/src/actions/cycle.ts +1 -3
  92. package/src/actions/deps.ts +1 -3
  93. package/src/actions/dupdeps.ts +1 -3
  94. package/src/actions/gen-docs.ts +1 -3
  95. package/src/actions/license.ts +2 -6
  96. package/src/actions/lint-clean.ts +2 -6
  97. package/src/actions/lint-profile.ts +1 -5
  98. package/src/actions/lint.ts +1 -3
  99. package/src/actions/package/compile/copyTypeFiles.ts +1 -3
  100. package/src/actions/package/compile/inputs.ts +2 -6
  101. package/src/actions/package/compile/packageCompileTsc.ts +1 -3
  102. package/src/actions/package/compile/packageCompileTsup.ts +2 -6
  103. package/src/actions/package/deps.ts +3 -9
  104. package/src/actions/publint.ts +3 -9
  105. package/src/actions/reinstall.ts +3 -9
  106. package/src/actions/relint.ts +3 -9
  107. package/src/actions/statics.ts +1 -3
  108. package/src/actions/yarn3only.ts +1 -3
  109. package/src/bin/package/compile-only.ts +1 -3
  110. package/src/lib/deleteGlob.ts +1 -3
  111. package/src/lib/dependencies/DuplicateDetector.ts +1 -3
  112. package/src/lib/generateIgnoreFiles.ts +1 -3
  113. package/src/lib/runSteps.ts +1 -3
  114. package/src/lib/runStepsAsync.ts +1 -3
  115. package/src/lib/yarn/isYarnVersionOrGreater.ts +1 -3
  116. package/src/lib/yarn/workspace/yarnWorkspaces.ts +1 -3
  117. package/src/xy/xyCommonCommands.ts +1 -3
  118. package/src/xy/xyLintCommands.ts +1 -3
@@ -1,6 +1,4 @@
1
- import {
2
- runSteps, runStepsAsync,
3
- } from '../lib/index.ts'
1
+ import { runSteps, runStepsAsync } from '../lib/index.ts'
4
2
 
5
3
  export interface PublintParams {
6
4
  pkg?: string
@@ -12,13 +10,9 @@ export interface PublintPackageParams {
12
10
  verbose?: boolean
13
11
  }
14
12
 
15
- export const publint = async ({
16
- verbose, pkg,
17
- }: PublintParams) => {
13
+ export const publint = async ({ verbose, pkg }: PublintParams) => {
18
14
  return pkg
19
- ? await publintPackage({
20
- pkg, verbose,
21
- })
15
+ ? await publintPackage({ pkg, verbose })
22
16
  : publintAll({ verbose })
23
17
  }
24
18
 
@@ -2,9 +2,7 @@ import {
2
2
  closeSync, openSync, rmSync,
3
3
  } from 'node:fs'
4
4
 
5
- import {
6
- runSteps, yarnWorkspaces,
7
- } from '../lib/index.ts'
5
+ import { runSteps, yarnWorkspaces } from '../lib/index.ts'
8
6
 
9
7
  export const reinstall = () => {
10
8
  console.log('Reinstall [Clear Lock File]')
@@ -13,14 +11,10 @@ export const reinstall = () => {
13
11
  console.log('Reinstall [Clear Node Modules]')
14
12
  const workspaces = yarnWorkspaces()
15
13
  const result = workspaces
16
- .map(({
17
- location, name,
18
- }) => {
14
+ .map(({ location, name }) => {
19
15
  const dist = `${location}/node_modules`
20
16
  try {
21
- rmSync(dist, {
22
- force: true, recursive: true,
23
- })
17
+ rmSync(dist, { force: true, recursive: true })
24
18
  return 0
25
19
  } catch (ex) {
26
20
  const error = ex as Error
@@ -1,21 +1,15 @@
1
1
  import { rmSync } from 'node:fs'
2
2
 
3
- import {
4
- runSteps, yarnWorkspaces,
5
- } from '../lib/index.ts'
3
+ import { runSteps, yarnWorkspaces } from '../lib/index.ts'
6
4
 
7
5
  export const relint = () => {
8
6
  console.log('Relint - Cleaning [.eslintcache]')
9
7
  const workspaces = yarnWorkspaces()
10
8
  const result = workspaces
11
- .map(({
12
- location, name,
13
- }) => {
9
+ .map(({ location, name }) => {
14
10
  const dist = `${location}/.eslintcache`
15
11
  try {
16
- rmSync(dist, {
17
- force: true, recursive: true,
18
- })
12
+ rmSync(dist, { force: true, recursive: true })
19
13
  return 0
20
14
  } catch (ex) {
21
15
  const error = ex as Error
@@ -1,8 +1,6 @@
1
1
  import chalk from 'chalk'
2
2
 
3
- import {
4
- detectDuplicateDependencies, parsedPackageJSON,
5
- } from '../lib/index.ts'
3
+ import { detectDuplicateDependencies, parsedPackageJSON } from '../lib/index.ts'
6
4
 
7
5
  const DefaultDependencies = ['axios', '@xylabs/pixel', 'react', 'graphql', 'react-router', '@mui/material', '@mui/system']
8
6
 
@@ -1,6 +1,4 @@
1
- import {
2
- isYarnVersionOrGreater, processEx,
3
- } from '../lib/index.ts'
1
+ import { isYarnVersionOrGreater, processEx } from '../lib/index.ts'
4
2
 
5
3
  export const yarn3Only = () => {
6
4
  const [valid, version] = isYarnVersionOrGreater(3)
@@ -4,9 +4,7 @@ import chalk from 'chalk'
4
4
 
5
5
  import { packageCompile } from '../../actions/index.ts'
6
6
 
7
- packageCompile({
8
- verbose: true, publint: false,
9
- })
7
+ packageCompile({ verbose: true, publint: false })
10
8
  .then(value => (process.exitCode = value))
11
9
  .catch((reason) => {
12
10
  console.error(chalk.red(reason))
@@ -8,8 +8,6 @@ export const deleteGlob = (globPath: string) => {
8
8
 
9
9
  // Remove each file or directory
10
10
  for (const file of files) {
11
- fs.rmSync(file, {
12
- recursive: true, force: true,
13
- })
11
+ fs.rmSync(file, { recursive: true, force: true })
14
12
  }
15
13
  }
@@ -32,9 +32,7 @@ const trimObjectDependencyVirtualMeta = (obj: Record<string, ChildFields>): Reco
32
32
 
33
33
  const trimDependencyVirtualMeta = (dependencies: DependencyEntries): DependencyEntries => {
34
34
  return dependencies.map((dependency) => {
35
- return {
36
- children: trimObjectDependencyVirtualMeta(dependency.children), value: trimVirtualMeta(dependency.value),
37
- }
35
+ return { children: trimObjectDependencyVirtualMeta(dependency.children), value: trimVirtualMeta(dependency.value) }
38
36
  })
39
37
  }
40
38
 
@@ -14,9 +14,7 @@ export const generateIgnoreFiles = (filename: string, pkg?: string) => {
14
14
  const workspaces = pkg ? [yarnWorkspace(pkg)] : yarnWorkspaces()
15
15
  const readEntries = (location: string): string[] => readNonEmptyLines(`${location}/${filename}`)
16
16
  const writeEntries = (location: string, entries: string[]) => writeLines(`${location}/${filename}`, entries)
17
- const results = workspaces.map(({
18
- location, name,
19
- }) => {
17
+ const results = workspaces.map(({ location, name }) => {
20
18
  try {
21
19
  writeEntries(location, mergeEntries(readEntries(cwd), readEntries(location)))
22
20
  return 0
@@ -28,9 +28,7 @@ export const runSteps = (name: string, steps: ScriptStep[], exitOnFail = true, m
28
28
  = spawnSync(command, Array.isArray(args) ? args : args.split(' '), {
29
29
  ...config,
30
30
  encoding: 'utf8',
31
- env: {
32
- FORCE_COLOR: '3', ...process.env,
33
- },
31
+ env: { FORCE_COLOR: '3', ...process.env },
34
32
  shell: true,
35
33
  stdio: 'inherit',
36
34
  }).status ?? 0
@@ -19,9 +19,7 @@ export const runStepAsync = (name: string, step: ScriptStep, exitOnFail = true,
19
19
  }
20
20
  spawn(command, Array.isArray(args) ? args : args.split(' '), {
21
21
  ...config,
22
- env: {
23
- FORCE_COLOR: '3', ...process.env,
24
- },
22
+ env: { FORCE_COLOR: '3', ...process.env },
25
23
  shell: true,
26
24
  stdio: 'inherit',
27
25
  }).on('close', (code) => {
@@ -1,9 +1,7 @@
1
1
  import { spawnSync } from 'node:child_process'
2
2
 
3
3
  export const isYarnVersionOrGreater = (major: number, minor?: number, patch?: number): [boolean, string] => {
4
- const result = spawnSync('yarn', ['-v'], {
5
- encoding: 'utf8', shell: true,
6
- })
4
+ const result = spawnSync('yarn', ['-v'], { encoding: 'utf8', shell: true })
7
5
  const version = result.stdout.toString().replaceAll('\n', '')
8
6
  const versionNumbers = version.split('.').map(ver => Number.parseInt(ver))
9
7
  const majorDelta = versionNumbers[0] - major
@@ -3,9 +3,7 @@ import { spawnSync } from 'node:child_process'
3
3
  import type { Workspace } from './Workspace.ts'
4
4
 
5
5
  export const yarnWorkspaces = (): Workspace[] => {
6
- const result = spawnSync('yarn', ['workspaces', 'list', '--json', '--recursive'], {
7
- encoding: 'utf8', shell: true,
8
- })
6
+ const result = spawnSync('yarn', ['workspaces', 'list', '--json', '--recursive'], { encoding: 'utf8', shell: true })
9
7
  if (result.error) {
10
8
  throw result.error
11
9
  }
@@ -64,9 +64,7 @@ export const xyCommonCommands = (args: Argv) => {
64
64
  },
65
65
  (argv) => {
66
66
  if (argv.verbose) console.log(`Generating TypeDocs: ${argv.package ?? 'all'}`)
67
- process.exitCode = genDocs({
68
- incremental: !!argv.incremental, pkg: argv.package as string,
69
- })
67
+ process.exitCode = genDocs({ incremental: !!argv.incremental, pkg: argv.package as string })
70
68
  },
71
69
  )
72
70
  .command(
@@ -74,9 +74,7 @@ export const xyLintCommands = (args: Argv) => {
74
74
  async (argv) => {
75
75
  if (argv.verbose) console.log('Publint')
76
76
  const start = Date.now()
77
- process.exitCode = await publint({
78
- pkg: argv.package as string, verbose: !!argv.verbose,
79
- })
77
+ process.exitCode = await publint({ pkg: argv.package as string, verbose: !!argv.verbose })
80
78
  console.log(chalk.blue(`Finished in ${Date.now() - start}ms`))
81
79
  },
82
80
  )