@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.
- package/dist/.tsconfig.build.cjs.tsbuildinfo +1 -1
- package/dist/.tsconfig.build.esm.tsbuildinfo +1 -1
- package/dist/cjs/actions/clean.js +1 -1
- package/dist/cjs/actions/clean.js.map +1 -1
- package/dist/cjs/actions/index.d.ts +0 -1
- package/dist/cjs/actions/index.d.ts.map +1 -1
- package/dist/cjs/actions/index.js +0 -1
- package/dist/cjs/actions/index.js.map +1 -1
- package/dist/cjs/actions/lint-clean.d.ts.map +1 -1
- package/dist/cjs/actions/lint-clean.js +4 -4
- package/dist/cjs/actions/lint-clean.js.map +1 -1
- package/dist/cjs/actions/package/clean.d.ts.map +1 -1
- package/dist/cjs/actions/package/clean.js +6 -2
- package/dist/cjs/actions/package/clean.js.map +1 -1
- package/dist/cjs/actions/reinstall.js +4 -4
- package/dist/cjs/actions/reinstall.js.map +1 -1
- package/dist/cjs/lib/xy/xyCommonCommands.d.ts.map +1 -1
- package/dist/cjs/lib/xy/xyCommonCommands.js +0 -7
- package/dist/cjs/lib/xy/xyCommonCommands.js.map +1 -1
- package/dist/esm/actions/clean.js +1 -1
- package/dist/esm/actions/clean.js.map +1 -1
- package/dist/esm/actions/index.d.ts +0 -1
- package/dist/esm/actions/index.d.ts.map +1 -1
- package/dist/esm/actions/index.js +0 -1
- package/dist/esm/actions/index.js.map +1 -1
- package/dist/esm/actions/lint-clean.d.ts.map +1 -1
- package/dist/esm/actions/lint-clean.js +4 -4
- package/dist/esm/actions/lint-clean.js.map +1 -1
- package/dist/esm/actions/package/clean.d.ts.map +1 -1
- package/dist/esm/actions/package/clean.js +6 -2
- package/dist/esm/actions/package/clean.js.map +1 -1
- package/dist/esm/actions/reinstall.js +5 -5
- package/dist/esm/actions/reinstall.js.map +1 -1
- package/dist/esm/lib/xy/xyCommonCommands.d.ts.map +1 -1
- package/dist/esm/lib/xy/xyCommonCommands.js +1 -8
- package/dist/esm/lib/xy/xyCommonCommands.js.map +1 -1
- package/dist/tsconfig.build.cjs.tsbuildinfo +1 -1
- package/dist/tsconfig.build.esm.tsbuildinfo +1 -1
- package/package.json +12 -12
- package/src/actions/clean.ts +1 -1
- package/src/actions/index.ts +0 -1
- package/src/actions/lint-clean.ts +5 -4
- package/src/actions/package/clean.ts +7 -4
- package/src/actions/reinstall.ts +5 -5
- package/src/lib/xy/xyCommonCommands.ts +0 -12
- 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',
|
package/src/actions/rimraf.ts
DELETED
|
@@ -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
|
-
}
|