@xylabs/ts-scripts-yarn3 2.12.0 → 2.12.2

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 (46) 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/clean.js +1 -1
  4. package/dist/cjs/actions/clean.js.map +1 -1
  5. package/dist/cjs/actions/index.d.ts +0 -1
  6. package/dist/cjs/actions/index.d.ts.map +1 -1
  7. package/dist/cjs/actions/index.js +0 -1
  8. package/dist/cjs/actions/index.js.map +1 -1
  9. package/dist/cjs/actions/lint-clean.d.ts.map +1 -1
  10. package/dist/cjs/actions/lint-clean.js +4 -4
  11. package/dist/cjs/actions/lint-clean.js.map +1 -1
  12. package/dist/cjs/actions/package/clean.d.ts.map +1 -1
  13. package/dist/cjs/actions/package/clean.js +6 -2
  14. package/dist/cjs/actions/package/clean.js.map +1 -1
  15. package/dist/cjs/actions/reinstall.js +4 -4
  16. package/dist/cjs/actions/reinstall.js.map +1 -1
  17. package/dist/cjs/lib/xy/xyCommonCommands.d.ts.map +1 -1
  18. package/dist/cjs/lib/xy/xyCommonCommands.js +0 -7
  19. package/dist/cjs/lib/xy/xyCommonCommands.js.map +1 -1
  20. package/dist/esm/actions/clean.js +1 -1
  21. package/dist/esm/actions/clean.js.map +1 -1
  22. package/dist/esm/actions/index.d.ts +0 -1
  23. package/dist/esm/actions/index.d.ts.map +1 -1
  24. package/dist/esm/actions/index.js +0 -1
  25. package/dist/esm/actions/index.js.map +1 -1
  26. package/dist/esm/actions/lint-clean.d.ts.map +1 -1
  27. package/dist/esm/actions/lint-clean.js +4 -4
  28. package/dist/esm/actions/lint-clean.js.map +1 -1
  29. package/dist/esm/actions/package/clean.d.ts.map +1 -1
  30. package/dist/esm/actions/package/clean.js +6 -2
  31. package/dist/esm/actions/package/clean.js.map +1 -1
  32. package/dist/esm/actions/reinstall.js +5 -5
  33. package/dist/esm/actions/reinstall.js.map +1 -1
  34. package/dist/esm/lib/xy/xyCommonCommands.d.ts.map +1 -1
  35. package/dist/esm/lib/xy/xyCommonCommands.js +1 -8
  36. package/dist/esm/lib/xy/xyCommonCommands.js.map +1 -1
  37. package/dist/tsconfig.build.cjs.tsbuildinfo +1 -1
  38. package/dist/tsconfig.build.esm.tsbuildinfo +1 -1
  39. package/package.json +12 -12
  40. package/src/actions/clean.ts +1 -1
  41. package/src/actions/index.ts +0 -1
  42. package/src/actions/lint-clean.ts +5 -4
  43. package/src/actions/package/clean.ts +7 -4
  44. package/src/actions/reinstall.ts +5 -5
  45. package/src/lib/xy/xyCommonCommands.ts +0 -12
  46. package/src/actions/rimraf.ts +0 -68
@@ -7,7 +7,6 @@ import {
7
7
  gitlint,
8
8
  gitlintFix,
9
9
  license,
10
- runRimraf,
11
10
  test,
12
11
  tsconfigGen,
13
12
  tsconfigGenClean,
@@ -139,17 +138,6 @@ export const xyCommonCommands = (args: yargs.Argv) => {
139
138
  process.exitCode = updateYarnVersion()
140
139
  },
141
140
  )
142
- .command(
143
- 'rimraf',
144
- 'Run rimraf',
145
- (yargs) => {
146
- return yargs
147
- },
148
- (argv) => {
149
- if (argv.verbose) console.info('Rimraf')
150
- process.exitCode = runRimraf()
151
- },
152
- )
153
141
  .command(
154
142
  'yarn3only',
155
143
  'Yarn3Only - Check if using Yarn v3',
@@ -1,68 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- import path from 'path'
4
- import rimraf from 'rimraf'
5
-
6
- export const runRimraf = () => {
7
- try {
8
- const isRoot = (arg: string) => /^(\/|[a-zA-Z]:\\)$/.test(path.resolve(arg))
9
- const filterOutRoot = (arg: string) => {
10
- const ok = preserveRoot === false || !isRoot(arg)
11
- if (!ok) {
12
- console.error(`refusing to remove ${arg}`)
13
- console.error('Set --no-preserve-root to allow this')
14
- }
15
- return ok
16
- }
17
-
18
- let help = false
19
- let dashdash = false
20
- let noglob = false
21
- let preserveRoot = true
22
- const args = process.argv
23
- .slice(2)
24
- .filter((arg) => {
25
- if (dashdash) return !!arg
26
- else if (arg === '--') dashdash = true
27
- else if (arg === '--no-glob' || arg === '-G') noglob = true
28
- else if (arg === '--glob' || arg === '-g') noglob = false
29
- else if (arg.match(/^(-+|\/)(h(elp)?|\?)$/)) help = true
30
- else if (arg === '--preserve-root') preserveRoot = true
31
- else if (arg === '--no-preserve-root') preserveRoot = false
32
- else return !!arg
33
- })
34
- .filter((arg) => !preserveRoot || filterOutRoot(arg))
35
-
36
- const go = (n: number) => {
37
- if (n >= args.length) return
38
- const options: rimraf.Options = noglob ? { glob: false } : {}
39
- rimraf(args[n], options, (er) => {
40
- if (er) throw er
41
- go(n + 1)
42
- })
43
- }
44
-
45
- if (help || args.length === 0) {
46
- // If they didn't ask for help, then this is not a "success"
47
- const log = help ? console.log : console.error
48
- log('Usage: rimraf <path> [<path> ...]')
49
- log('')
50
- log(' Deletes all files and folders at "path" recursively.')
51
- log('')
52
- log('Options:')
53
- log('')
54
- log(' -h, --help Display this usage info')
55
- log(' -G, --no-glob Do not expand glob patterns in arguments')
56
- log(' -g, --glob Expand glob patterns in arguments (default)')
57
- log(" --preserve-root Do not remove '/' (default)")
58
- log(" --no-preserve-root Do not treat '/' specially")
59
- log(' -- Stop parsing flags')
60
- return help ? 0 : 1
61
- } else go(0)
62
- return 0
63
- } catch (ex) {
64
- const error = ex as Error
65
- console.error(error.message)
66
- return 1
67
- }
68
- }