@xylabs/ts-scripts-yarn3 3.13.0 → 3.13.1
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/actions/clean-docs.js +1 -1
- package/dist/actions/clean-docs.js.map +1 -1
- package/dist/actions/clean-docs.mjs +1 -1
- package/dist/actions/clean-docs.mjs.map +1 -1
- package/dist/actions/compile.js +2 -2
- package/dist/actions/compile.js.map +1 -1
- package/dist/actions/compile.mjs +2 -2
- package/dist/actions/compile.mjs.map +1 -1
- package/dist/actions/lint.js +2 -4
- package/dist/actions/lint.js.map +1 -1
- package/dist/actions/lint.mjs +2 -4
- package/dist/actions/lint.mjs.map +1 -1
- package/dist/bin/package/clean-outputs.js +1 -1
- package/dist/bin/package/clean-outputs.js.map +1 -1
- package/dist/bin/package/clean-outputs.mjs +1 -1
- package/dist/bin/package/clean-outputs.mjs.map +1 -1
- package/dist/bin/package/clean-typescript.js +1 -1
- package/dist/bin/package/clean-typescript.js.map +1 -1
- package/dist/bin/package/clean-typescript.mjs +1 -1
- package/dist/bin/package/clean-typescript.mjs.map +1 -1
- package/dist/bin/package/clean.js +1 -1
- package/dist/bin/package/clean.js.map +1 -1
- package/dist/bin/package/clean.mjs +1 -1
- package/dist/bin/package/clean.mjs.map +1 -1
- package/dist/bin/package/compile-only.js.map +1 -1
- package/dist/bin/package/compile-only.mjs.map +1 -1
- package/dist/bin/package/compile-tsup.js.map +1 -1
- package/dist/bin/package/compile-tsup.mjs.map +1 -1
- package/dist/bin/package/compile.js.map +1 -1
- package/dist/bin/package/compile.mjs.map +1 -1
- package/dist/bin/package/copy-assets-cjs.js.map +1 -1
- package/dist/bin/package/copy-assets-cjs.mjs.map +1 -1
- package/dist/bin/package/copy-assets-esm.js.map +1 -1
- package/dist/bin/package/copy-assets-esm.mjs.map +1 -1
- package/dist/bin/package/deps.js.map +1 -1
- package/dist/bin/package/deps.mjs.map +1 -1
- package/dist/bin/package/gen-docs.js +1 -1
- package/dist/bin/package/gen-docs.js.map +1 -1
- package/dist/bin/package/gen-docs.mjs +1 -1
- package/dist/bin/package/gen-docs.mjs.map +1 -1
- package/dist/bin/package/publint.js.map +1 -1
- package/dist/bin/package/publint.mjs.map +1 -1
- package/dist/bin/package/recompile.js.map +1 -1
- package/dist/bin/package/recompile.mjs.map +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/lib/dependencies/DuplicateDetector.js +2 -1
- package/dist/lib/dependencies/DuplicateDetector.js.map +1 -1
- package/dist/lib/dependencies/DuplicateDetector.mjs +2 -1
- package/dist/lib/dependencies/DuplicateDetector.mjs.map +1 -1
- package/dist/lib/dependencies/detectDuplicateDependencies.js +0 -2
- package/dist/lib/dependencies/detectDuplicateDependencies.js.map +1 -1
- package/dist/lib/dependencies/detectDuplicateDependencies.mjs +0 -2
- package/dist/lib/dependencies/detectDuplicateDependencies.mjs.map +1 -1
- package/dist/lib/loadConfig.js.map +1 -1
- package/dist/lib/loadConfig.mjs.map +1 -1
- package/dist/lib/runXyWithWarning.js +4 -2
- package/dist/lib/runXyWithWarning.js.map +1 -1
- package/dist/lib/runXyWithWarning.mjs +4 -2
- package/dist/lib/runXyWithWarning.mjs.map +1 -1
- package/dist/lib/yarn/workspace/yarnWorkspaces.js +1 -2
- package/dist/lib/yarn/workspace/yarnWorkspaces.js.map +1 -1
- package/dist/lib/yarn/workspace/yarnWorkspaces.mjs +1 -2
- package/dist/lib/yarn/workspace/yarnWorkspaces.mjs.map +1 -1
- package/dist/xy/param.js +33 -0
- package/dist/xy/param.js.map +1 -0
- package/dist/xy/param.mjs +9 -0
- package/dist/xy/param.mjs.map +1 -0
- package/dist/xy/xyCommonCommands.js +5 -12
- package/dist/xy/xyCommonCommands.js.map +1 -1
- package/dist/xy/xyCommonCommands.mjs +5 -12
- package/dist/xy/xyCommonCommands.mjs.map +1 -1
- package/dist/xy/xyLintCommands.js +7 -16
- package/dist/xy/xyLintCommands.js.map +1 -1
- package/dist/xy/xyLintCommands.mjs +7 -16
- package/dist/xy/xyLintCommands.mjs.map +1 -1
- package/dist/xy/xyParseOptions.js.map +1 -1
- package/dist/xy/xyParseOptions.mjs.map +1 -1
- package/package.json +5 -5
- package/src/actions/clean-docs.ts +1 -1
- package/src/actions/compile.ts +2 -4
- package/src/actions/lint.ts +2 -6
- package/src/bin/package/clean-outputs.ts +2 -2
- package/src/bin/package/clean-typescript.ts +2 -2
- package/src/bin/package/clean.ts +2 -2
- package/src/bin/package/compile-only.ts +1 -0
- package/src/bin/package/compile-tsup.ts +1 -0
- package/src/bin/package/compile.ts +1 -0
- package/src/bin/package/copy-assets-cjs.ts +1 -0
- package/src/bin/package/copy-assets-esm.ts +1 -0
- package/src/bin/package/deps.ts +1 -0
- package/src/bin/package/gen-docs.ts +2 -2
- package/src/bin/package/publint.ts +1 -0
- package/src/bin/package/recompile.ts +1 -0
- package/src/lib/dependencies/DuplicateDetector.ts +2 -2
- package/src/lib/dependencies/detectDuplicateDependencies.ts +0 -2
- package/src/lib/loadConfig.ts +0 -1
- package/src/lib/runXyWithWarning.ts +4 -2
- package/src/lib/yarn/workspace/yarnWorkspaces.ts +11 -10
- package/src/xy/param.ts +7 -0
- package/src/xy/xyCommonCommands.ts +5 -12
- package/src/xy/xyLintCommands.ts +7 -16
- package/src/xy/xyParseOptions.ts +0 -1
package/src/actions/compile.ts
CHANGED
|
@@ -22,12 +22,10 @@ export const compile = ({ verbose, target, pkg, incremental, publint }: CompileP
|
|
|
22
22
|
return pkg ? compilePackage({ pkg, publint, target, verbose }) : compileAll({ incremental, publint, target, verbose })
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
export const compilePackage = ({ target, pkg
|
|
25
|
+
export const compilePackage = ({ target, pkg }: CompilePackageParams) => {
|
|
26
26
|
const targetOptions = target ? ['-t', target] : []
|
|
27
27
|
|
|
28
|
-
return
|
|
29
|
-
runSteps(`Compile [${pkg}]`, [['yarn', ['workspace', pkg, 'run', 'package-compile', ...targetOptions]]])
|
|
30
|
-
: runSteps(`Compile [${pkg}]`, [['yarn', ['workspace', pkg, 'run', 'package-compile', ...targetOptions]]])
|
|
28
|
+
return runSteps(`Compile [${pkg}]`, [['yarn', ['workspace', pkg, 'run', 'package-compile', ...targetOptions]]])
|
|
31
29
|
}
|
|
32
30
|
|
|
33
31
|
export const compileAll = ({ jobs, verbose, target, incremental }: CompileParams) => {
|
package/src/actions/lint.ts
CHANGED
|
@@ -45,9 +45,7 @@ export const lintPackage = async ({ pkg }: LintParams) => {
|
|
|
45
45
|
|
|
46
46
|
dumpMessages(lintResults)
|
|
47
47
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
return errorCount
|
|
48
|
+
return lintResults.reduce((prev, lintResult) => prev + lintResult.errorCount, 0)
|
|
51
49
|
}
|
|
52
50
|
|
|
53
51
|
export const lintAll = async () => {
|
|
@@ -57,9 +55,7 @@ export const lintAll = async () => {
|
|
|
57
55
|
|
|
58
56
|
dumpMessages(lintResults)
|
|
59
57
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
return errorCount
|
|
58
|
+
return lintResults.reduce((prev, lintResult) => prev + lintResult.errorCount, 0)
|
|
63
59
|
}
|
|
64
60
|
|
|
65
61
|
export const lint = async ({ pkg }: LintParams = {}) => {
|
package/src/bin/package/clean.ts
CHANGED
package/src/bin/package/deps.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { EOL } from 'node:os'
|
|
2
2
|
|
|
3
3
|
import chalk from 'chalk'
|
|
4
|
-
|
|
5
4
|
import uniq from 'lodash/uniq'
|
|
6
5
|
|
|
7
6
|
import { multiLineToJSONArray } from '../jsonFormatters'
|
|
@@ -65,7 +64,8 @@ export class DuplicateDetector {
|
|
|
65
64
|
const result = this.dependencyEntries.reduce(this.detectReducer, this.resultsFactory(this.dependency))
|
|
66
65
|
if (result.duplicateVersions.length > 0) {
|
|
67
66
|
console.log(chalk.yellow(`${EOL}Duplicates found for: ${this.dependency}`))
|
|
68
|
-
|
|
67
|
+
const duplicateVersions = result.duplicateVersions.toString().replaceAll(',', `${EOL} `)
|
|
68
|
+
console.log(chalk.grey(` ${duplicateVersions}`, EOL))
|
|
69
69
|
return 1
|
|
70
70
|
} else {
|
|
71
71
|
console.log(`${this.dependency} - OK`)
|
|
@@ -26,7 +26,6 @@ export const detectDuplicateDependencies = (depsFromPackageJSON?: string[], Defa
|
|
|
26
26
|
if (output) {
|
|
27
27
|
exitCode = new DuplicateDetector(output, dependency).detect()
|
|
28
28
|
exitCode
|
|
29
|
-
continue
|
|
30
29
|
} else {
|
|
31
30
|
console.log(`${dependency} - N/A`)
|
|
32
31
|
if (depsFromPackageJSON) {
|
|
@@ -34,7 +33,6 @@ export const detectDuplicateDependencies = (depsFromPackageJSON?: string[], Defa
|
|
|
34
33
|
console.log(`🚨 Library ${dependency} was requested in package.json but not found`)
|
|
35
34
|
}
|
|
36
35
|
exitCode
|
|
37
|
-
continue
|
|
38
36
|
}
|
|
39
37
|
}
|
|
40
38
|
return exitCode
|
package/src/lib/loadConfig.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import chalk from 'chalk'
|
|
2
2
|
|
|
3
3
|
export const runXyWithWarning = (command: string) => {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
const commandString = `yarn ${command}`
|
|
5
|
+
const commandXyString = `yarn xy ${command}`
|
|
6
|
+
console.warn(chalk.yellow(`WARNING: [${chalk.white(commandString)}] is deprecated for XY Labs Scripts.`))
|
|
7
|
+
console.warn(chalk.gray(`Did you mean [${chalk.magenta(commandXyString)}]?`))
|
|
6
8
|
return 1
|
|
7
9
|
}
|
|
@@ -7,14 +7,15 @@ export const yarnWorkspaces = (): Workspace[] => {
|
|
|
7
7
|
if (result.error) {
|
|
8
8
|
throw result.error
|
|
9
9
|
}
|
|
10
|
-
|
|
11
|
-
.
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
10
|
+
return (
|
|
11
|
+
result.stdout
|
|
12
|
+
.toString()
|
|
13
|
+
// NOTE: This probably doesn't work on Windows
|
|
14
|
+
// TODO: Replace /r/n with /n first
|
|
15
|
+
.split('\n')
|
|
16
|
+
.slice(0, -1)
|
|
17
|
+
.map((item) => {
|
|
18
|
+
return JSON.parse(item)
|
|
19
|
+
})
|
|
20
|
+
)
|
|
20
21
|
}
|
package/src/xy/param.ts
ADDED
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
updateYarnVersion,
|
|
17
17
|
yarn3Only,
|
|
18
18
|
} from '../actions'
|
|
19
|
+
import { packagePositionalParam } from './param'
|
|
19
20
|
|
|
20
21
|
export const xyCommonCommands = (args: Argv) => {
|
|
21
22
|
return args
|
|
@@ -24,9 +25,7 @@ export const xyCommonCommands = (args: Argv) => {
|
|
|
24
25
|
'license [package]',
|
|
25
26
|
'License - Check licenses of dependencies',
|
|
26
27
|
(yargs) => {
|
|
27
|
-
return yargs
|
|
28
|
-
describe: 'Specific package to check',
|
|
29
|
-
})
|
|
28
|
+
return packagePositionalParam(yargs)
|
|
30
29
|
},
|
|
31
30
|
async (argv) => {
|
|
32
31
|
if (argv.verbose) console.log(`License: ${argv.package ?? 'all'}`)
|
|
@@ -37,9 +36,7 @@ export const xyCommonCommands = (args: Argv) => {
|
|
|
37
36
|
'dead [package]',
|
|
38
37
|
'Dead - Check for dead code',
|
|
39
38
|
(yargs) => {
|
|
40
|
-
return yargs
|
|
41
|
-
describe: 'Specific package to check',
|
|
42
|
-
})
|
|
39
|
+
return packagePositionalParam(yargs)
|
|
43
40
|
},
|
|
44
41
|
(argv) => {
|
|
45
42
|
if (argv.verbose) console.log('Dead')
|
|
@@ -50,9 +47,7 @@ export const xyCommonCommands = (args: Argv) => {
|
|
|
50
47
|
'deps [package]',
|
|
51
48
|
'Deps - Check for unused or missing dependencies',
|
|
52
49
|
(yargs) => {
|
|
53
|
-
return yargs
|
|
54
|
-
describe: 'Specific package to check',
|
|
55
|
-
})
|
|
50
|
+
return packagePositionalParam(yargs)
|
|
56
51
|
},
|
|
57
52
|
(argv) => {
|
|
58
53
|
if (argv.verbose) console.log(`Checking Dependencies: ${argv.package ?? 'all'}`)
|
|
@@ -63,9 +58,7 @@ export const xyCommonCommands = (args: Argv) => {
|
|
|
63
58
|
'gen-docs [package]',
|
|
64
59
|
'GenDocs - Generate TypeDocs',
|
|
65
60
|
(yargs) => {
|
|
66
|
-
return yargs
|
|
67
|
-
describe: 'Specific package to generate docs for',
|
|
68
|
-
})
|
|
61
|
+
return packagePositionalParam(yargs)
|
|
69
62
|
},
|
|
70
63
|
(argv) => {
|
|
71
64
|
if (argv.verbose) console.log(`Generating TypeDocs: ${argv.package ?? 'all'}`)
|
package/src/xy/xyLintCommands.ts
CHANGED
|
@@ -2,6 +2,7 @@ import chalk from 'chalk'
|
|
|
2
2
|
import { Argv } from 'yargs'
|
|
3
3
|
|
|
4
4
|
import { cycle, fix, lint, lintProfile, publint, relint, sonar } from '../actions'
|
|
5
|
+
import { packagePositionalParam } from './param'
|
|
5
6
|
|
|
6
7
|
export const xyLintCommands = (args: Argv) => {
|
|
7
8
|
return args
|
|
@@ -9,9 +10,7 @@ export const xyLintCommands = (args: Argv) => {
|
|
|
9
10
|
'cycle [package]',
|
|
10
11
|
'Cycle - Check for dependency cycles',
|
|
11
12
|
(yargs) => {
|
|
12
|
-
return yargs
|
|
13
|
-
describe: 'Specific package to check',
|
|
14
|
-
})
|
|
13
|
+
return packagePositionalParam(yargs)
|
|
15
14
|
},
|
|
16
15
|
(argv) => {
|
|
17
16
|
const start = Date.now()
|
|
@@ -24,9 +23,7 @@ export const xyLintCommands = (args: Argv) => {
|
|
|
24
23
|
'lint [package]',
|
|
25
24
|
'Lint - Run Eslint',
|
|
26
25
|
(yargs) => {
|
|
27
|
-
return yargs
|
|
28
|
-
describe: 'Specific package to check',
|
|
29
|
-
})
|
|
26
|
+
return packagePositionalParam(yargs)
|
|
30
27
|
},
|
|
31
28
|
async (argv) => {
|
|
32
29
|
if (argv.verbose) console.log('Lint')
|
|
@@ -42,9 +39,7 @@ export const xyLintCommands = (args: Argv) => {
|
|
|
42
39
|
'fix [package]',
|
|
43
40
|
'Fix - Run Eslint w/fix',
|
|
44
41
|
(yargs) => {
|
|
45
|
-
return yargs
|
|
46
|
-
describe: 'Specific package to check',
|
|
47
|
-
})
|
|
42
|
+
return packagePositionalParam(yargs)
|
|
48
43
|
},
|
|
49
44
|
(argv) => {
|
|
50
45
|
const start = Date.now()
|
|
@@ -57,9 +52,7 @@ export const xyLintCommands = (args: Argv) => {
|
|
|
57
52
|
'relint [package]',
|
|
58
53
|
'Relint - Clean & Lint',
|
|
59
54
|
(yargs) => {
|
|
60
|
-
return yargs
|
|
61
|
-
describe: 'Specific package to relint',
|
|
62
|
-
})
|
|
55
|
+
return packagePositionalParam(yargs)
|
|
63
56
|
},
|
|
64
57
|
(argv) => {
|
|
65
58
|
if (argv.verbose) console.log('Relinting')
|
|
@@ -72,9 +65,7 @@ export const xyLintCommands = (args: Argv) => {
|
|
|
72
65
|
'publint [package]',
|
|
73
66
|
'Publint - Run Publint',
|
|
74
67
|
(yargs) => {
|
|
75
|
-
return yargs
|
|
76
|
-
describe: 'Specific package to publint',
|
|
77
|
-
})
|
|
68
|
+
return packagePositionalParam(yargs)
|
|
78
69
|
},
|
|
79
70
|
async (argv) => {
|
|
80
71
|
if (argv.verbose) console.log('Publint')
|
|
@@ -87,7 +78,7 @@ export const xyLintCommands = (args: Argv) => {
|
|
|
87
78
|
'sonar',
|
|
88
79
|
'Sonar - Run Sonar Check',
|
|
89
80
|
(yargs) => {
|
|
90
|
-
return yargs
|
|
81
|
+
return packagePositionalParam(yargs)
|
|
91
82
|
},
|
|
92
83
|
(argv) => {
|
|
93
84
|
const start = Date.now()
|