@xylabs/ts-scripts-yarn3 2.12.8 → 2.12.10

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 (87) hide show
  1. package/dist/.tsconfig.build.cjs.tsbuildinfo +1 -1
  2. package/dist/.tsconfig.build.esm.tsbuildinfo +1 -1
  3. package/dist/cjs/actions/build.js +1 -1
  4. package/dist/cjs/actions/build.js.map +1 -1
  5. package/dist/cjs/actions/deploy-major.js +4 -4
  6. package/dist/cjs/actions/deploy-major.js.map +1 -1
  7. package/dist/cjs/actions/deploy-minor.js +4 -4
  8. package/dist/cjs/actions/deploy-minor.js.map +1 -1
  9. package/dist/cjs/actions/deploy-next.js +4 -4
  10. package/dist/cjs/actions/deploy-next.js.map +1 -1
  11. package/dist/cjs/actions/deploy.js +4 -4
  12. package/dist/cjs/actions/deploy.js.map +1 -1
  13. package/dist/cjs/actions/index.d.ts +1 -2
  14. package/dist/cjs/actions/index.d.ts.map +1 -1
  15. package/dist/cjs/actions/index.js +1 -2
  16. package/dist/cjs/actions/index.js.map +1 -1
  17. package/dist/cjs/actions/lint-clean.d.ts.map +1 -1
  18. package/dist/cjs/actions/lint-clean.js +18 -4
  19. package/dist/cjs/actions/lint-clean.js.map +1 -1
  20. package/dist/cjs/actions/lint.d.ts +2 -0
  21. package/dist/cjs/actions/lint.d.ts.map +1 -0
  22. package/dist/cjs/actions/lint.js +9 -0
  23. package/dist/cjs/actions/lint.js.map +1 -0
  24. package/dist/cjs/actions/rebuild.js +2 -2
  25. package/dist/cjs/actions/rebuild.js.map +1 -1
  26. package/dist/cjs/actions/relint.d.ts.map +1 -1
  27. package/dist/cjs/actions/relint.js +18 -1
  28. package/dist/cjs/actions/relint.js.map +1 -1
  29. package/dist/cjs/lib/runStepsAsync.d.ts.map +1 -1
  30. package/dist/cjs/lib/runStepsAsync.js +1 -1
  31. package/dist/cjs/lib/runStepsAsync.js.map +1 -1
  32. package/dist/cjs/lib/xy/xyBuildCommands.d.ts.map +1 -1
  33. package/dist/cjs/lib/xy/xyBuildCommands.js +5 -0
  34. package/dist/cjs/lib/xy/xyBuildCommands.js.map +1 -1
  35. package/dist/cjs/lib/xy/xyLintCommands.js +1 -1
  36. package/dist/cjs/lib/xy/xyLintCommands.js.map +1 -1
  37. package/dist/esm/actions/build.js +1 -1
  38. package/dist/esm/actions/build.js.map +1 -1
  39. package/dist/esm/actions/deploy-major.js +4 -4
  40. package/dist/esm/actions/deploy-major.js.map +1 -1
  41. package/dist/esm/actions/deploy-minor.js +4 -4
  42. package/dist/esm/actions/deploy-minor.js.map +1 -1
  43. package/dist/esm/actions/deploy-next.js +4 -4
  44. package/dist/esm/actions/deploy-next.js.map +1 -1
  45. package/dist/esm/actions/deploy.js +4 -4
  46. package/dist/esm/actions/deploy.js.map +1 -1
  47. package/dist/esm/actions/index.d.ts +1 -2
  48. package/dist/esm/actions/index.d.ts.map +1 -1
  49. package/dist/esm/actions/index.js +1 -2
  50. package/dist/esm/actions/index.js.map +1 -1
  51. package/dist/esm/actions/lint-clean.d.ts.map +1 -1
  52. package/dist/esm/actions/lint-clean.js +19 -5
  53. package/dist/esm/actions/lint-clean.js.map +1 -1
  54. package/dist/esm/actions/lint.d.ts +2 -0
  55. package/dist/esm/actions/lint.d.ts.map +1 -0
  56. package/dist/esm/actions/lint.js +5 -0
  57. package/dist/esm/actions/lint.js.map +1 -0
  58. package/dist/esm/actions/rebuild.js +2 -2
  59. package/dist/esm/actions/rebuild.js.map +1 -1
  60. package/dist/esm/actions/relint.d.ts.map +1 -1
  61. package/dist/esm/actions/relint.js +19 -2
  62. package/dist/esm/actions/relint.js.map +1 -1
  63. package/dist/esm/lib/runStepsAsync.d.ts.map +1 -1
  64. package/dist/esm/lib/runStepsAsync.js +1 -0
  65. package/dist/esm/lib/runStepsAsync.js.map +1 -1
  66. package/dist/esm/lib/xy/xyBuildCommands.d.ts.map +1 -1
  67. package/dist/esm/lib/xy/xyBuildCommands.js +5 -0
  68. package/dist/esm/lib/xy/xyBuildCommands.js.map +1 -1
  69. package/dist/esm/lib/xy/xyLintCommands.js +2 -2
  70. package/dist/esm/lib/xy/xyLintCommands.js.map +1 -1
  71. package/dist/tsconfig.build.cjs.tsbuildinfo +1 -1
  72. package/dist/tsconfig.build.esm.tsbuildinfo +1 -1
  73. package/package.json +4 -7
  74. package/src/actions/build.ts +1 -1
  75. package/src/actions/deploy-major.ts +4 -4
  76. package/src/actions/deploy-minor.ts +4 -4
  77. package/src/actions/deploy-next.ts +4 -4
  78. package/src/actions/deploy.ts +4 -4
  79. package/src/actions/index.ts +1 -2
  80. package/src/actions/lint-clean.ts +18 -5
  81. package/src/actions/{lint-slow.ts → lint.ts} +0 -0
  82. package/src/actions/rebuild.ts +2 -2
  83. package/src/actions/relint.ts +19 -2
  84. package/src/lib/runStepsAsync.ts +1 -0
  85. package/src/lib/xy/xyBuildCommands.ts +3 -0
  86. package/src/lib/xy/xyLintCommands.ts +2 -2
  87. package/src/actions/lint-fast.ts +0 -9
@@ -1,9 +1,22 @@
1
- import { rimrafSync } from 'rimraf'
1
+ import { rmSync } from 'fs'
2
2
 
3
- import { runSteps } from '../lib'
3
+ import { runSteps, yarnWorkspaces } from '../lib'
4
4
 
5
5
  export const lintClean = () => {
6
- console.log('Clean [.eslintcache]')
7
- rimrafSync('.eslintcache')
8
- return runSteps('Lint [Clean]', [['yarn', ['eslint', '.', '--cache']]])
6
+ console.log('Lint Clean [.eslintcache]')
7
+ const workspaces = yarnWorkspaces()
8
+ const result = workspaces
9
+ .map(({ location, name }) => {
10
+ const dist = `${location}/.eslintcache`
11
+ try {
12
+ rmSync(dist, { force: true, recursive: true })
13
+ return 0
14
+ } catch (ex) {
15
+ const error = ex as Error
16
+ console.error(`Lint Clean [.eslintcache] Failed [${name}, ${error.message}]`)
17
+ return 1
18
+ }
19
+ })
20
+ .reduce((prev, result) => prev || result, 0)
21
+ return result || runSteps('Lint [Clean]', [['yarn', ['eslint', '.', '--cache']]])
9
22
  }
File without changes
@@ -7,8 +7,8 @@ export interface RebuildParams {
7
7
 
8
8
  export const rebuild = ({ target }: RebuildParams) => {
9
9
  return runSteps('Rebuild', [
10
- ['yarn', 'clean'],
10
+ ['yarn', 'xy clean'],
11
11
  ['yarn', target ? `xy compile -t ${target}` : 'xy compile'],
12
- ['yarn', 'lint'],
12
+ ['yarn', 'xy lint'],
13
13
  ])
14
14
  }
@@ -1,5 +1,22 @@
1
- import { runSteps } from '../lib'
1
+ import { rmSync } from 'fs'
2
+
3
+ import { runSteps, yarnWorkspaces } from '../lib'
2
4
 
3
5
  export const relint = () => {
4
- return runSteps('Relint [Caching]', [['yarn', ['eslint', '.']]])
6
+ console.log('Relint - Cleaning [.eslintcache]')
7
+ const workspaces = yarnWorkspaces()
8
+ const result = workspaces
9
+ .map(({ location, name }) => {
10
+ const dist = `${location}/.eslintcache`
11
+ try {
12
+ rmSync(dist, { force: true, recursive: true })
13
+ return 0
14
+ } catch (ex) {
15
+ const error = ex as Error
16
+ console.error(`Relint - Cleaning [.eslintcache] Failed [${name}, ${error.message}]`)
17
+ return 1
18
+ }
19
+ })
20
+ .reduce((prev, result) => prev || result, 0)
21
+ return result || runSteps('Relint', [['yarn', ['eslint', '.', '--cache']]])
5
22
  }
@@ -16,6 +16,7 @@ export const runStepAsync = (step: ScriptStep, exitOnFail = true, message?: stri
16
16
  }
17
17
  spawn(command, Array.isArray(args) ? args : args.split(' '), {
18
18
  ...config,
19
+ env: { FORCE_COLOR: '3', ...process.env },
19
20
  shell: true,
20
21
  stdio: 'inherit',
21
22
  }).on('close', (code) => {
@@ -1,3 +1,4 @@
1
+ import { getHeapStatistics } from 'v8'
1
2
  import yargs from 'yargs'
2
3
 
3
4
  import { build, compile, copyAssets, rebuild } from '../../actions'
@@ -14,6 +15,7 @@ export const xyBuildCommands = (args: yargs.Argv) => {
14
15
  },
15
16
  (argv) => {
16
17
  if (argv.verbose) console.info(`Building: ${argv.package ?? 'all'}`)
18
+ if (argv.verbose) console.info(`Building-Heap: ${JSON.stringify(getHeapStatistics())}`)
17
19
  process.exitCode = build({ pkg: argv.package as string, target: argv.target as 'esm' | 'cjs' })
18
20
  },
19
21
  )
@@ -27,6 +29,7 @@ export const xyBuildCommands = (args: yargs.Argv) => {
27
29
  },
28
30
  (argv) => {
29
31
  if (argv.verbose) console.info(`Compiling: ${argv.package ?? 'all'}`)
32
+ if (argv.verbose) console.info(`Compiling-Heap: ${JSON.stringify(getHeapStatistics())}`)
30
33
  process.exitCode = compile({ incremental: !!argv.incremental, pkg: argv.package as string, target: argv.target as 'esm' | 'cjs' })
31
34
  },
32
35
  )
@@ -1,6 +1,6 @@
1
1
  import yargs from 'yargs'
2
2
 
3
- import { cycle, fix, lint, lintFast, lintProfile, relint, sonar } from '../../actions'
3
+ import { cycle, fix, lint, lintProfile, relint, sonar } from '../../actions'
4
4
 
5
5
  export const xyLintCommands = (args: yargs.Argv) => {
6
6
  return args
@@ -27,7 +27,7 @@ export const xyLintCommands = (args: yargs.Argv) => {
27
27
  },
28
28
  (argv) => {
29
29
  if (argv.verbose) console.info('Lint')
30
- process.exitCode = argv.fix ? fix() : argv.profile ? lintProfile() : argv.cache ? lintFast() : lint()
30
+ process.exitCode = argv.fix ? fix() : argv.profile ? lintProfile() : lint()
31
31
  },
32
32
  )
33
33
  .command(
@@ -1,9 +0,0 @@
1
- import chalk from 'chalk'
2
-
3
- import { runSteps } from '../lib'
4
-
5
- export const lintFast = () => {
6
- console.log(chalk.magenta("Deprecated. Use 'yarn lint' instead"))
7
-
8
- return runSteps('Lint [Caching]', [['yarn', ['eslint', '.', '--cache']]])
9
- }