@xylabs/ts-scripts-yarn3 6.0.9 → 6.1.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/build.mjs +2 -2
- package/dist/actions/build.mjs.map +1 -1
- package/dist/actions/index.mjs +17 -2
- package/dist/actions/index.mjs.map +1 -1
- package/dist/actions/knip.mjs +113 -0
- package/dist/actions/knip.mjs.map +1 -0
- package/dist/actions/relint.mjs.map +1 -1
- package/dist/bin/xy.mjs +23 -2
- package/dist/bin/xy.mjs.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.mjs +24 -2
- package/dist/index.mjs.map +1 -1
- package/dist/types/actions/index.d.ts +1 -0
- package/dist/types/actions/index.d.ts.map +1 -1
- package/dist/types/actions/knip.d.ts +2 -0
- package/dist/types/actions/knip.d.ts.map +1 -0
- package/dist/types/actions/relint.d.ts.map +1 -1
- package/dist/types/xy/xyLintCommands.d.ts.map +1 -1
- package/dist/xy/index.mjs +23 -2
- package/dist/xy/index.mjs.map +1 -1
- package/dist/xy/xy.mjs +23 -2
- package/dist/xy/xy.mjs.map +1 -1
- package/dist/xy/xyBuildCommands.mjs +2 -2
- package/dist/xy/xyBuildCommands.mjs.map +1 -1
- package/dist/xy/xyLintCommands.mjs +21 -0
- package/dist/xy/xyLintCommands.mjs.map +1 -1
- package/package.json +10 -4
- package/spec/yarn/workspace/tsconfig.json +0 -3
- package/src/actions/build.ts +0 -34
- package/src/actions/clean-docs.ts +0 -12
- package/src/actions/clean-eslint.ts +0 -15
- package/src/actions/clean-jest.ts +0 -7
- package/src/actions/clean.ts +0 -26
- package/src/actions/compile-types.ts +0 -67
- package/src/actions/compile.ts +0 -67
- package/src/actions/copy-assets.ts +0 -70
- package/src/actions/cycle.ts +0 -15
- package/src/actions/dead.ts +0 -5
- package/src/actions/deploy-major.ts +0 -11
- package/src/actions/deploy-minor.ts +0 -11
- package/src/actions/deploy-next.ts +0 -11
- package/src/actions/deploy.ts +0 -11
- package/src/actions/deps.ts +0 -43
- package/src/actions/dupdeps.ts +0 -12
- package/src/actions/fix.ts +0 -6
- package/src/actions/gen-docs.ts +0 -26
- package/src/actions/gitignore-gen.ts +0 -5
- package/src/actions/gitlint-fix.ts +0 -27
- package/src/actions/gitlint.ts +0 -46
- package/src/actions/index.ts +0 -37
- package/src/actions/license.ts +0 -81
- package/src/actions/lint.ts +0 -61
- package/src/actions/npmignore-gen.ts +0 -5
- package/src/actions/package/clean-outputs.ts +0 -18
- package/src/actions/package/clean-typescript.ts +0 -18
- package/src/actions/package/clean.ts +0 -6
- package/src/actions/package/compile/XyConfig.ts +0 -60
- package/src/actions/package/compile/buildEntries.ts +0 -22
- package/src/actions/package/compile/compile.ts +0 -21
- package/src/actions/package/compile/compileTypes.ts +0 -13
- package/src/actions/package/compile/copyTypeFiles.ts +0 -38
- package/src/actions/package/compile/deepMerge.ts +0 -33
- package/src/actions/package/compile/getCompilerOptions.ts +0 -30
- package/src/actions/package/compile/index.ts +0 -6
- package/src/actions/package/compile/inputs.ts +0 -6
- package/src/actions/package/compile/packageCompileTsc.ts +0 -67
- package/src/actions/package/compile/packageCompileTscTypes.ts +0 -68
- package/src/actions/package/compile/packageCompileTsup.ts +0 -154
- package/src/actions/package/copy-assets.ts +0 -46
- package/src/actions/package/deps.ts +0 -144
- package/src/actions/package/gen-docs.ts +0 -126
- package/src/actions/package/index.ts +0 -10
- package/src/actions/package/lint.ts +0 -86
- package/src/actions/package/publint.ts +0 -75
- package/src/actions/package/recompile.ts +0 -6
- package/src/actions/publint.ts +0 -26
- package/src/actions/rebuild.ts +0 -13
- package/src/actions/recompile.ts +0 -81
- package/src/actions/reinstall.ts +0 -29
- package/src/actions/relint.ts +0 -76
- package/src/actions/retest.ts +0 -8
- package/src/actions/sonar.ts +0 -5
- package/src/actions/statics.ts +0 -13
- package/src/actions/test.ts +0 -5
- package/src/actions/up.ts +0 -5
- package/src/actions/updo.ts +0 -9
- package/src/actions/upplug.ts +0 -10
- package/src/actions/upyarn.ts +0 -5
- package/src/actions/yarn3only.ts +0 -9
- package/src/bin/package/build-only.ts +0 -16
- package/src/bin/package/build.ts +0 -16
- package/src/bin/package/clean-outputs.ts +0 -5
- package/src/bin/package/clean-typescript.ts +0 -5
- package/src/bin/package/clean.ts +0 -12
- package/src/bin/package/compile-only.ts +0 -12
- package/src/bin/package/compile-tsup.ts +0 -12
- package/src/bin/package/compile-types.ts +0 -16
- package/src/bin/package/compile.ts +0 -16
- package/src/bin/package/copy-assets-cjs.ts +0 -12
- package/src/bin/package/copy-assets-esm.ts +0 -12
- package/src/bin/package/deps.ts +0 -12
- package/src/bin/package/fix.ts +0 -16
- package/src/bin/package/gen-docs.ts +0 -12
- package/src/bin/package/lint.ts +0 -16
- package/src/bin/package/publint.ts +0 -13
- package/src/bin/package/recompile.ts +0 -12
- package/src/bin/package/relint.ts +0 -16
- package/src/bin/xy.ts +0 -12
- package/src/index.ts +0 -4
- package/src/lib/checkResult.ts +0 -12
- package/src/lib/createBuildConfig.ts +0 -37
- package/src/lib/defaultBuildConfig.ts +0 -18
- package/src/lib/deleteGlob.ts +0 -13
- package/src/lib/dependencies/DuplicateDetector.ts +0 -97
- package/src/lib/dependencies/detectDuplicateDependencies.ts +0 -41
- package/src/lib/dependencies/index.ts +0 -2
- package/src/lib/file/ReadFileSyncOptions.ts +0 -6
- package/src/lib/file/constants.ts +0 -2
- package/src/lib/file/fileLines.ts +0 -25
- package/src/lib/file/index.ts +0 -4
- package/src/lib/file/tryReadFileSync.ts +0 -9
- package/src/lib/generateIgnoreFiles.ts +0 -31
- package/src/lib/index.ts +0 -20
- package/src/lib/jsonFormatters.ts +0 -6
- package/src/lib/loadConfig.ts +0 -19
- package/src/lib/parsedPackageJSON.ts +0 -7
- package/src/lib/processEx.ts +0 -27
- package/src/lib/runSteps.ts +0 -40
- package/src/lib/runStepsAsync.ts +0 -53
- package/src/lib/runXy.ts +0 -8
- package/src/lib/runXyWithWarning.ts +0 -9
- package/src/lib/safeExit.ts +0 -29
- package/src/lib/string/empty.ts +0 -2
- package/src/lib/string/index.ts +0 -2
- package/src/lib/string/union.ts +0 -1
- package/src/lib/withErrnoException.ts +0 -7
- package/src/lib/withError.ts +0 -8
- package/src/lib/yarn/index.ts +0 -3
- package/src/lib/yarn/isYarnVersionOrGreater.ts +0 -16
- package/src/lib/yarn/workspace/Workspace.ts +0 -4
- package/src/lib/yarn/workspace/index.ts +0 -3
- package/src/lib/yarn/workspace/yarnWorkspace.ts +0 -8
- package/src/lib/yarn/workspace/yarnWorkspaces.ts +0 -21
- package/src/lib/yarn/yarnInitCwd.ts +0 -4
- package/src/loadPackageConfig.ts +0 -13
- package/src/types.d.ts +0 -26
- package/src/xy/index.ts +0 -7
- package/src/xy/param.ts +0 -5
- package/src/xy/xy.ts +0 -20
- package/src/xy/xyBuildCommands.ts +0 -127
- package/src/xy/xyCommonCommands.ts +0 -167
- package/src/xy/xyDeployCommands.ts +0 -53
- package/src/xy/xyInstallCommands.ts +0 -80
- package/src/xy/xyLintCommands.ts +0 -92
- package/src/xy/xyParseOptions.ts +0 -58
- package/tsconfig.build.json +0 -29
- package/tsconfig.json +0 -4
- package/tsconfig.test.json +0 -4
- package/tsup.config.ts +0 -16
- package/types/node-cmd.d.ts +0 -1
- package/xy.config.ts +0 -3
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
import type { Argv } from 'yargs'
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
cleanDocs,
|
|
5
|
-
dead,
|
|
6
|
-
deps,
|
|
7
|
-
genDocs,
|
|
8
|
-
gitignoreGen,
|
|
9
|
-
gitlint,
|
|
10
|
-
gitlintFix,
|
|
11
|
-
license,
|
|
12
|
-
npmignoreGen,
|
|
13
|
-
retest,
|
|
14
|
-
test,
|
|
15
|
-
updateYarnPlugins,
|
|
16
|
-
updateYarnVersion,
|
|
17
|
-
yarn3Only,
|
|
18
|
-
} from '../actions/index.ts'
|
|
19
|
-
import { packagePositionalParam } from './param.ts'
|
|
20
|
-
|
|
21
|
-
export const xyCommonCommands = (args: Argv) => {
|
|
22
|
-
return args
|
|
23
|
-
|
|
24
|
-
.command(
|
|
25
|
-
'license [package]',
|
|
26
|
-
'License - Check licenses of dependencies',
|
|
27
|
-
(yargs) => {
|
|
28
|
-
return packagePositionalParam(yargs)
|
|
29
|
-
},
|
|
30
|
-
async (argv) => {
|
|
31
|
-
if (argv.verbose) console.log(`License: ${argv.package ?? 'all'}`)
|
|
32
|
-
process.exitCode = await license()
|
|
33
|
-
},
|
|
34
|
-
)
|
|
35
|
-
.command(
|
|
36
|
-
'dead [package]',
|
|
37
|
-
'Dead - Check for dead code',
|
|
38
|
-
(yargs) => {
|
|
39
|
-
return packagePositionalParam(yargs)
|
|
40
|
-
},
|
|
41
|
-
(argv) => {
|
|
42
|
-
if (argv.verbose) console.log('Dead')
|
|
43
|
-
process.exitCode = dead()
|
|
44
|
-
},
|
|
45
|
-
)
|
|
46
|
-
.command(
|
|
47
|
-
'deps [package]',
|
|
48
|
-
'Deps - Check for unused or missing dependencies',
|
|
49
|
-
(yargs) => {
|
|
50
|
-
return packagePositionalParam(yargs)
|
|
51
|
-
},
|
|
52
|
-
(argv) => {
|
|
53
|
-
if (argv.verbose) console.log(`Checking Dependencies: ${argv.package ?? 'all'}`)
|
|
54
|
-
process.exitCode = deps({
|
|
55
|
-
incremental: !!argv.incremental, jobs: argv.jobs as number, pkg: argv.package as string,
|
|
56
|
-
})
|
|
57
|
-
},
|
|
58
|
-
)
|
|
59
|
-
.command(
|
|
60
|
-
'gen-docs [package]',
|
|
61
|
-
'GenDocs - Generate TypeDocs',
|
|
62
|
-
(yargs) => {
|
|
63
|
-
return packagePositionalParam(yargs)
|
|
64
|
-
},
|
|
65
|
-
(argv) => {
|
|
66
|
-
if (argv.verbose) console.log(`Generating TypeDocs: ${argv.package ?? 'all'}`)
|
|
67
|
-
process.exitCode = genDocs({ incremental: !!argv.incremental, pkg: argv.package as string })
|
|
68
|
-
},
|
|
69
|
-
)
|
|
70
|
-
.command(
|
|
71
|
-
'clean-docs',
|
|
72
|
-
'CleanDocs - Clean TypeDocs',
|
|
73
|
-
yargs => yargs,
|
|
74
|
-
(argv) => {
|
|
75
|
-
if (argv.verbose) console.log('Cleaning TypeDocs: all')
|
|
76
|
-
process.exitCode = cleanDocs()
|
|
77
|
-
},
|
|
78
|
-
)
|
|
79
|
-
.command(
|
|
80
|
-
'gitlint [package]',
|
|
81
|
-
'Gitlint - Lint your git config',
|
|
82
|
-
(yargs) => {
|
|
83
|
-
return yargs
|
|
84
|
-
},
|
|
85
|
-
(argv) => {
|
|
86
|
-
if (argv.verbose) console.log('Gitlint')
|
|
87
|
-
process.exitCode = argv.fix ? gitlintFix() : gitlint()
|
|
88
|
-
},
|
|
89
|
-
)
|
|
90
|
-
.command(
|
|
91
|
-
'gitignore-gen',
|
|
92
|
-
'GitIgnore Gen - Generate .gitignore files',
|
|
93
|
-
(yargs) => {
|
|
94
|
-
return yargs
|
|
95
|
-
},
|
|
96
|
-
(argv) => {
|
|
97
|
-
if (argv.verbose) console.log('GitIgnore Gen')
|
|
98
|
-
process.exitCode = gitignoreGen()
|
|
99
|
-
},
|
|
100
|
-
)
|
|
101
|
-
.command(
|
|
102
|
-
'npmignore-gen',
|
|
103
|
-
'NpmIgnore Gen - Generate .npmignore files',
|
|
104
|
-
(yargs) => {
|
|
105
|
-
return yargs
|
|
106
|
-
},
|
|
107
|
-
(argv) => {
|
|
108
|
-
if (argv.verbose) console.log('NpmIgnore Gen')
|
|
109
|
-
process.exitCode = npmignoreGen()
|
|
110
|
-
},
|
|
111
|
-
)
|
|
112
|
-
.command(
|
|
113
|
-
'retest',
|
|
114
|
-
'Re-Test - Run Jest Tests with cleaned cache',
|
|
115
|
-
(yargs) => {
|
|
116
|
-
return yargs
|
|
117
|
-
},
|
|
118
|
-
(argv) => {
|
|
119
|
-
if (argv.verbose) console.log('Re-Testing')
|
|
120
|
-
process.exitCode = retest()
|
|
121
|
-
},
|
|
122
|
-
)
|
|
123
|
-
.command(
|
|
124
|
-
'test',
|
|
125
|
-
'Test - Run Jest Tests',
|
|
126
|
-
(yargs) => {
|
|
127
|
-
return yargs
|
|
128
|
-
},
|
|
129
|
-
(argv) => {
|
|
130
|
-
if (argv.verbose) console.log('Testing')
|
|
131
|
-
process.exitCode = test()
|
|
132
|
-
},
|
|
133
|
-
)
|
|
134
|
-
.command(
|
|
135
|
-
'upplug',
|
|
136
|
-
'UpPlug - Update Yarn Plugins',
|
|
137
|
-
(yargs) => {
|
|
138
|
-
return yargs
|
|
139
|
-
},
|
|
140
|
-
(argv) => {
|
|
141
|
-
if (argv.verbose) console.log('UpPlug')
|
|
142
|
-
process.exitCode = updateYarnPlugins()
|
|
143
|
-
},
|
|
144
|
-
)
|
|
145
|
-
.command(
|
|
146
|
-
'upyarn',
|
|
147
|
-
'UpYarn - Update Yarn Version',
|
|
148
|
-
(yargs) => {
|
|
149
|
-
return yargs
|
|
150
|
-
},
|
|
151
|
-
(argv) => {
|
|
152
|
-
if (argv.verbose) console.log('UpYarn')
|
|
153
|
-
process.exitCode = updateYarnVersion()
|
|
154
|
-
},
|
|
155
|
-
)
|
|
156
|
-
.command(
|
|
157
|
-
'yarn3only',
|
|
158
|
-
'Yarn3Only - Check if using Yarn v3',
|
|
159
|
-
(yargs) => {
|
|
160
|
-
return yargs
|
|
161
|
-
},
|
|
162
|
-
(argv) => {
|
|
163
|
-
if (argv.verbose) console.log('Yarn 3 Check')
|
|
164
|
-
process.exitCode = yarn3Only()
|
|
165
|
-
},
|
|
166
|
-
)
|
|
167
|
-
}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import type { Argv } from 'yargs'
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
deploy, deployMajor, deployMinor, deployNext,
|
|
5
|
-
} from '../actions/index.ts'
|
|
6
|
-
|
|
7
|
-
export const xyDeployCommands = (args: Argv) => {
|
|
8
|
-
return args
|
|
9
|
-
.command(
|
|
10
|
-
'deploy',
|
|
11
|
-
'Deploy - Deploy patch',
|
|
12
|
-
(yargs) => {
|
|
13
|
-
return yargs
|
|
14
|
-
},
|
|
15
|
-
(argv) => {
|
|
16
|
-
if (argv.verbose) console.log('Deploy patch')
|
|
17
|
-
process.exitCode = deploy()
|
|
18
|
-
},
|
|
19
|
-
)
|
|
20
|
-
.command(
|
|
21
|
-
'deploy-minor',
|
|
22
|
-
'Deploy - Deploy minor',
|
|
23
|
-
(yargs) => {
|
|
24
|
-
return yargs
|
|
25
|
-
},
|
|
26
|
-
(argv) => {
|
|
27
|
-
if (argv.verbose) console.log('Deploy minor')
|
|
28
|
-
process.exitCode = deployMinor()
|
|
29
|
-
},
|
|
30
|
-
)
|
|
31
|
-
.command(
|
|
32
|
-
'deploy-major',
|
|
33
|
-
'Deploy - Deploy major',
|
|
34
|
-
(yargs) => {
|
|
35
|
-
return yargs
|
|
36
|
-
},
|
|
37
|
-
(argv) => {
|
|
38
|
-
if (argv.verbose) console.log('Deploy major')
|
|
39
|
-
process.exitCode = deployMajor()
|
|
40
|
-
},
|
|
41
|
-
)
|
|
42
|
-
.command(
|
|
43
|
-
'deploy-next',
|
|
44
|
-
'Deploy - Deploy next',
|
|
45
|
-
(yargs) => {
|
|
46
|
-
return yargs
|
|
47
|
-
},
|
|
48
|
-
(argv) => {
|
|
49
|
-
if (argv.verbose) console.log('Deploy next')
|
|
50
|
-
process.exitCode = deployNext()
|
|
51
|
-
},
|
|
52
|
-
)
|
|
53
|
-
}
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import type { Argv } from 'yargs'
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
clean, dupdeps, reinstall, statics, up, updo,
|
|
5
|
-
} from '../actions/index.ts'
|
|
6
|
-
|
|
7
|
-
export const xyInstallCommands = (args: Argv) => {
|
|
8
|
-
return args
|
|
9
|
-
.command(
|
|
10
|
-
'clean [package]',
|
|
11
|
-
'Clean',
|
|
12
|
-
(yargs) => {
|
|
13
|
-
return yargs.positional('package', { describe: 'Specific package to clean' })
|
|
14
|
-
},
|
|
15
|
-
async (argv) => {
|
|
16
|
-
if (argv.verbose) {
|
|
17
|
-
console.log(`Cleaning: ${argv.package ?? 'all'}`)
|
|
18
|
-
}
|
|
19
|
-
process.exitCode = await clean({
|
|
20
|
-
pkg: argv.package as string,
|
|
21
|
-
verbose: !!argv.verbose,
|
|
22
|
-
})
|
|
23
|
-
},
|
|
24
|
-
)
|
|
25
|
-
.command(
|
|
26
|
-
'reinstall',
|
|
27
|
-
'Reinstall - Clean & Install',
|
|
28
|
-
(yargs) => {
|
|
29
|
-
return yargs
|
|
30
|
-
},
|
|
31
|
-
(argv) => {
|
|
32
|
-
if (argv.verbose) console.log('Reinstalling')
|
|
33
|
-
process.exitCode = reinstall()
|
|
34
|
-
},
|
|
35
|
-
)
|
|
36
|
-
.command(
|
|
37
|
-
'up',
|
|
38
|
-
'Up - Update dependencies',
|
|
39
|
-
(yargs) => {
|
|
40
|
-
return yargs
|
|
41
|
-
},
|
|
42
|
-
(argv) => {
|
|
43
|
-
if (argv.verbose) console.log('Up')
|
|
44
|
-
process.exitCode = up()
|
|
45
|
-
},
|
|
46
|
-
)
|
|
47
|
-
.command(
|
|
48
|
-
'updo',
|
|
49
|
-
'Updo - Update dependencies [Interactive]',
|
|
50
|
-
(yargs) => {
|
|
51
|
-
return yargs
|
|
52
|
-
},
|
|
53
|
-
(argv) => {
|
|
54
|
-
if (argv.verbose) console.log('Updo')
|
|
55
|
-
process.exitCode = updo()
|
|
56
|
-
},
|
|
57
|
-
)
|
|
58
|
-
.command(
|
|
59
|
-
'statics',
|
|
60
|
-
'Statics - Confirming Static Packages',
|
|
61
|
-
(yargs) => {
|
|
62
|
-
return yargs
|
|
63
|
-
},
|
|
64
|
-
(argv) => {
|
|
65
|
-
if (argv.verbose) console.log('Statics')
|
|
66
|
-
process.exitCode = statics()
|
|
67
|
-
},
|
|
68
|
-
)
|
|
69
|
-
.command(
|
|
70
|
-
'dupdeps',
|
|
71
|
-
'Dupdeps - Duplicate Dependencies in package.json',
|
|
72
|
-
(yargs) => {
|
|
73
|
-
return yargs
|
|
74
|
-
},
|
|
75
|
-
(argv) => {
|
|
76
|
-
if (argv.verbose) console.log('Dupdeps')
|
|
77
|
-
process.exitCode = dupdeps()
|
|
78
|
-
},
|
|
79
|
-
)
|
|
80
|
-
}
|
package/src/xy/xyLintCommands.ts
DELETED
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import chalk from 'chalk'
|
|
2
|
-
import type { Argv } from 'yargs'
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
cycle, fix, lint, publint, relint, sonar,
|
|
6
|
-
} from '../actions/index.ts'
|
|
7
|
-
import { packagePositionalParam } from './param.ts'
|
|
8
|
-
|
|
9
|
-
export const xyLintCommands = (args: Argv) => {
|
|
10
|
-
return args
|
|
11
|
-
.command(
|
|
12
|
-
'cycle [package]',
|
|
13
|
-
'Cycle - Check for dependency cycles',
|
|
14
|
-
(yargs) => {
|
|
15
|
-
return packagePositionalParam(yargs)
|
|
16
|
-
},
|
|
17
|
-
async (argv) => {
|
|
18
|
-
const start = Date.now()
|
|
19
|
-
if (argv.verbose) console.log('Cycle')
|
|
20
|
-
process.exitCode = await cycle()
|
|
21
|
-
console.log(chalk.blue(`Finished in ${Date.now() - start}ms`))
|
|
22
|
-
},
|
|
23
|
-
)
|
|
24
|
-
.command(
|
|
25
|
-
'lint [package]',
|
|
26
|
-
'Lint - Run Eslint',
|
|
27
|
-
(yargs) => {
|
|
28
|
-
return packagePositionalParam(yargs)
|
|
29
|
-
},
|
|
30
|
-
(argv) => {
|
|
31
|
-
if (argv.verbose) console.log('Lint')
|
|
32
|
-
const start = Date.now()
|
|
33
|
-
process.exitCode
|
|
34
|
-
= argv.fix
|
|
35
|
-
? fix({ pkg: argv.package as string })
|
|
36
|
-
: lint({ pkg: argv.package as string })
|
|
37
|
-
console.log(chalk.blue(`Finished in ${Date.now() - start}ms`))
|
|
38
|
-
},
|
|
39
|
-
)
|
|
40
|
-
.command(
|
|
41
|
-
'fix [package]',
|
|
42
|
-
'Fix - Run Eslint w/fix',
|
|
43
|
-
(yargs) => {
|
|
44
|
-
return packagePositionalParam(yargs)
|
|
45
|
-
},
|
|
46
|
-
(argv) => {
|
|
47
|
-
const start = Date.now()
|
|
48
|
-
if (argv.verbose) console.log('Fix')
|
|
49
|
-
process.exitCode = fix()
|
|
50
|
-
console.log(chalk.blue(`Finished in ${Date.now() - start}ms`))
|
|
51
|
-
},
|
|
52
|
-
)
|
|
53
|
-
.command(
|
|
54
|
-
'relint [package]',
|
|
55
|
-
'Relint - Clean & Lint',
|
|
56
|
-
(yargs) => {
|
|
57
|
-
return packagePositionalParam(yargs)
|
|
58
|
-
},
|
|
59
|
-
(argv) => {
|
|
60
|
-
if (argv.verbose) console.log('Relinting')
|
|
61
|
-
const start = Date.now()
|
|
62
|
-
process.exitCode = relint()
|
|
63
|
-
console.log(chalk.blue(`Finished in ${Date.now() - start}ms`))
|
|
64
|
-
},
|
|
65
|
-
)
|
|
66
|
-
.command(
|
|
67
|
-
'publint [package]',
|
|
68
|
-
'Publint - Run Publint',
|
|
69
|
-
(yargs) => {
|
|
70
|
-
return packagePositionalParam(yargs)
|
|
71
|
-
},
|
|
72
|
-
async (argv) => {
|
|
73
|
-
if (argv.verbose) console.log('Publint')
|
|
74
|
-
const start = Date.now()
|
|
75
|
-
process.exitCode = await publint({ pkg: argv.package as string, verbose: !!argv.verbose })
|
|
76
|
-
console.log(chalk.blue(`Finished in ${Date.now() - start}ms`))
|
|
77
|
-
},
|
|
78
|
-
)
|
|
79
|
-
.command(
|
|
80
|
-
'sonar',
|
|
81
|
-
'Sonar - Run Sonar Check',
|
|
82
|
-
(yargs) => {
|
|
83
|
-
return packagePositionalParam(yargs)
|
|
84
|
-
},
|
|
85
|
-
(argv) => {
|
|
86
|
-
const start = Date.now()
|
|
87
|
-
if (argv.verbose) console.log('Sonar Check')
|
|
88
|
-
process.exitCode = sonar()
|
|
89
|
-
console.log(chalk.blue(`Finished in ${Date.now() - start}ms`))
|
|
90
|
-
},
|
|
91
|
-
)
|
|
92
|
-
}
|
package/src/xy/xyParseOptions.ts
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import type { Argv } from 'yargs'
|
|
2
|
-
import yargs from 'yargs'
|
|
3
|
-
// eslint-disable-next-line import-x/no-internal-modules
|
|
4
|
-
import { hideBin } from 'yargs/helpers'
|
|
5
|
-
|
|
6
|
-
export const xyParseOptions = (): Argv => {
|
|
7
|
-
return yargs(hideBin(process.argv))
|
|
8
|
-
.scriptName('yarn xy')
|
|
9
|
-
.option('jobs', {
|
|
10
|
-
alias: 'j',
|
|
11
|
-
default: undefined,
|
|
12
|
-
description: 'Max parallel jobs',
|
|
13
|
-
type: 'number',
|
|
14
|
-
})
|
|
15
|
-
.option('verbose', {
|
|
16
|
-
alias: 'v',
|
|
17
|
-
default: false,
|
|
18
|
-
description: 'Run with verbose logging',
|
|
19
|
-
type: 'boolean',
|
|
20
|
-
})
|
|
21
|
-
.option('target', {
|
|
22
|
-
alias: 't',
|
|
23
|
-
default: 'esm',
|
|
24
|
-
choices: ['esm', 'cjs'],
|
|
25
|
-
description: 'Limit output to specific target',
|
|
26
|
-
type: 'string',
|
|
27
|
-
})
|
|
28
|
-
.option('incremental', {
|
|
29
|
-
alias: 'i',
|
|
30
|
-
default: false,
|
|
31
|
-
description: 'Attempt to perform the action only on changed packages',
|
|
32
|
-
type: 'boolean',
|
|
33
|
-
})
|
|
34
|
-
.option('fix', {
|
|
35
|
-
alias: 'f',
|
|
36
|
-
default: false,
|
|
37
|
-
description: 'Try to fix errors',
|
|
38
|
-
type: 'boolean',
|
|
39
|
-
})
|
|
40
|
-
.option('cache', {
|
|
41
|
-
alias: 'c',
|
|
42
|
-
default: false,
|
|
43
|
-
description: 'Use caching for performance',
|
|
44
|
-
type: 'boolean',
|
|
45
|
-
})
|
|
46
|
-
.option('profile', {
|
|
47
|
-
alias: 'p',
|
|
48
|
-
default: false,
|
|
49
|
-
description: 'Profile action',
|
|
50
|
-
type: 'boolean',
|
|
51
|
-
})
|
|
52
|
-
.option('types', {
|
|
53
|
-
default: 'tsc',
|
|
54
|
-
choices: ['tsc', 'tsup'],
|
|
55
|
-
description: 'Tool to generate Typescript types',
|
|
56
|
-
type: 'string',
|
|
57
|
-
})
|
|
58
|
-
}
|
package/tsconfig.build.json
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"allowImportingTsExtensions": true,
|
|
4
|
-
"allowSyntheticDefaultImports": true,
|
|
5
|
-
"declaration": true,
|
|
6
|
-
"declarationMap": true,
|
|
7
|
-
"downlevelIteration": true,
|
|
8
|
-
"emitDecoratorMetadata": true,
|
|
9
|
-
"esModuleInterop": true,
|
|
10
|
-
"experimentalDecorators": true,
|
|
11
|
-
"isolatedModules": true,
|
|
12
|
-
"importHelpers": true,
|
|
13
|
-
"incremental": false,
|
|
14
|
-
"module": "NodeNext",
|
|
15
|
-
"moduleResolution": "NodeNext",
|
|
16
|
-
"noImplicitAny": true,
|
|
17
|
-
"noImplicitOverride": true,
|
|
18
|
-
"outDir": "dist",
|
|
19
|
-
"removeComments": true,
|
|
20
|
-
"resolveJsonModule": true,
|
|
21
|
-
"skipDefaultLibCheck": true,
|
|
22
|
-
"skipLibCheck": true,
|
|
23
|
-
"sourceMap": true,
|
|
24
|
-
"strict": true,
|
|
25
|
-
"target": "ESNext",
|
|
26
|
-
},
|
|
27
|
-
"exclude": [".github", ".vscode", ".yarn", "dist", "node_modules", "storybook-static", "build"],
|
|
28
|
-
"include": ["src"]
|
|
29
|
-
}
|
package/tsconfig.json
DELETED
package/tsconfig.test.json
DELETED
package/tsup.config.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { defineConfig } from 'tsup'
|
|
2
|
-
|
|
3
|
-
export default defineConfig({
|
|
4
|
-
bundle: true,
|
|
5
|
-
cjsInterop: true,
|
|
6
|
-
clean: false,
|
|
7
|
-
dts: { entry: ['src/index.ts'] },
|
|
8
|
-
outExtension: ({ format }) => ({ js: format === 'cjs' ? '.cjs' : '.mjs' }),
|
|
9
|
-
entry: ['src'],
|
|
10
|
-
format: ['esm'],
|
|
11
|
-
outDir: 'dist',
|
|
12
|
-
sourcemap: true,
|
|
13
|
-
splitting: false,
|
|
14
|
-
target: 'esnext',
|
|
15
|
-
tsconfig: 'tsconfig.build.json',
|
|
16
|
-
})
|
package/types/node-cmd.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
declare module 'node-cmd'
|
package/xy.config.ts
DELETED