@xylabs/ts-scripts-yarn3 6.0.4 → 6.0.6
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 +10 -0
- package/dist/actions/build.mjs.map +1 -1
- package/dist/actions/compile-types.mjs +2 -2
- package/dist/actions/compile-types.mjs.map +1 -1
- package/dist/actions/compile.mjs +7 -9
- package/dist/actions/compile.mjs.map +1 -1
- package/dist/actions/fix.mjs +1 -7
- package/dist/actions/fix.mjs.map +1 -1
- package/dist/actions/index.mjs +204 -235
- package/dist/actions/index.mjs.map +1 -1
- package/dist/actions/lint.mjs +1 -7
- package/dist/actions/lint.mjs.map +1 -1
- package/dist/actions/package/compile/compile.mjs +101 -169
- package/dist/actions/package/compile/compile.mjs.map +1 -1
- package/dist/actions/package/compile/compileTypes.mjs +16 -31
- package/dist/actions/package/compile/compileTypes.mjs.map +1 -1
- package/dist/actions/package/compile/index.mjs +156 -177
- package/dist/actions/package/compile/index.mjs.map +1 -1
- package/dist/actions/package/compile/packageCompileTscTypes.mjs +14 -29
- package/dist/actions/package/compile/packageCompileTscTypes.mjs.map +1 -1
- package/dist/actions/package/compile/packageCompileTsup.mjs +94 -82
- package/dist/actions/package/compile/packageCompileTsup.mjs.map +1 -1
- package/dist/actions/package/index.mjs +172 -193
- package/dist/actions/package/index.mjs.map +1 -1
- package/dist/actions/package/recompile.mjs +101 -169
- package/dist/actions/package/recompile.mjs.map +1 -1
- package/dist/actions/recompile.mjs +1 -7
- package/dist/actions/recompile.mjs.map +1 -1
- package/dist/actions/relint.mjs +1 -7
- package/dist/actions/relint.mjs.map +1 -1
- package/dist/bin/package/build-only.mjs +104 -172
- package/dist/bin/package/build-only.mjs.map +1 -1
- package/dist/bin/package/build.mjs +104 -172
- package/dist/bin/package/build.mjs.map +1 -1
- package/dist/bin/package/clean-outputs.mjs +1 -6
- package/dist/bin/package/clean-outputs.mjs.map +1 -1
- package/dist/bin/package/clean-typescript.mjs +1 -6
- package/dist/bin/package/clean-typescript.mjs.map +1 -1
- package/dist/bin/package/compile-only.mjs +103 -171
- package/dist/bin/package/compile-only.mjs.map +1 -1
- package/dist/bin/package/compile-tsup.mjs +113 -99
- package/dist/bin/package/compile-tsup.mjs.map +1 -1
- package/dist/bin/package/compile-types.mjs +45 -56
- package/dist/bin/package/compile-types.mjs.map +1 -1
- package/dist/bin/package/compile.mjs +103 -171
- package/dist/bin/package/compile.mjs.map +1 -1
- package/dist/bin/package/recompile.mjs +103 -171
- package/dist/bin/package/recompile.mjs.map +1 -1
- package/dist/bin/xy.mjs +22 -33
- package/dist/bin/xy.mjs.map +1 -1
- package/dist/index.d.ts +9 -14
- package/dist/index.mjs +214 -246
- package/dist/index.mjs.map +1 -1
- package/dist/types/actions/build.d.ts +9 -0
- package/dist/types/actions/build.d.ts.map +1 -0
- package/dist/types/actions/clean-docs.d.ts +2 -0
- package/dist/types/actions/clean-docs.d.ts.map +1 -0
- package/dist/types/actions/clean-eslint.d.ts +2 -0
- package/dist/types/actions/clean-eslint.d.ts.map +1 -0
- package/dist/types/actions/clean-jest.d.ts +2 -0
- package/dist/types/actions/clean-jest.d.ts.map +1 -0
- package/dist/types/actions/clean.d.ts +12 -0
- package/dist/types/actions/clean.d.ts.map +1 -0
- package/dist/types/actions/compile-types.d.ts +16 -0
- package/dist/types/actions/compile-types.d.ts.map +1 -0
- package/dist/types/actions/compile.d.ts +19 -0
- package/dist/types/actions/compile.d.ts.map +1 -0
- package/dist/types/actions/copy-assets.d.ts +6 -0
- package/dist/types/actions/copy-assets.d.ts.map +1 -0
- package/dist/types/actions/cycle.d.ts +2 -0
- package/dist/types/actions/cycle.d.ts.map +1 -0
- package/dist/types/actions/dead.d.ts +2 -0
- package/dist/types/actions/dead.d.ts.map +1 -0
- package/dist/types/actions/deploy-major.d.ts +2 -0
- package/dist/types/actions/deploy-major.d.ts.map +1 -0
- package/dist/types/actions/deploy-minor.d.ts +2 -0
- package/dist/types/actions/deploy-minor.d.ts.map +1 -0
- package/dist/types/actions/deploy-next.d.ts +2 -0
- package/dist/types/actions/deploy-next.d.ts.map +1 -0
- package/dist/types/actions/deploy.d.ts +2 -0
- package/dist/types/actions/deploy.d.ts.map +1 -0
- package/dist/types/actions/deps.d.ts +13 -0
- package/dist/types/actions/deps.d.ts.map +1 -0
- package/dist/types/actions/dupdeps.d.ts +2 -0
- package/dist/types/actions/dupdeps.d.ts.map +1 -0
- package/dist/types/actions/fix.d.ts +3 -0
- package/dist/types/actions/fix.d.ts.map +1 -0
- package/dist/types/actions/gen-docs.d.ts +11 -0
- package/dist/types/actions/gen-docs.d.ts.map +1 -0
- package/dist/types/actions/gitignore-gen.d.ts +2 -0
- package/dist/types/actions/gitignore-gen.d.ts.map +1 -0
- package/dist/types/actions/gitlint-fix.d.ts +2 -0
- package/dist/types/actions/gitlint-fix.d.ts.map +1 -0
- package/dist/types/actions/gitlint.d.ts +2 -0
- package/dist/types/actions/gitlint.d.ts.map +1 -0
- package/dist/types/actions/index.d.ts +38 -0
- package/dist/types/actions/index.d.ts.map +1 -0
- package/dist/types/actions/license.d.ts +2 -0
- package/dist/types/actions/license.d.ts.map +1 -0
- package/dist/types/actions/lint.d.ts +14 -0
- package/dist/types/actions/lint.d.ts.map +1 -0
- package/dist/types/actions/npmignore-gen.d.ts +2 -0
- package/dist/types/actions/npmignore-gen.d.ts.map +1 -0
- package/dist/types/actions/package/clean-outputs.d.ts +2 -0
- package/dist/types/actions/package/clean-outputs.d.ts.map +1 -0
- package/dist/types/actions/package/clean-typescript.d.ts +2 -0
- package/dist/types/actions/package/clean-typescript.d.ts.map +1 -0
- package/dist/types/actions/package/clean.d.ts +2 -0
- package/dist/types/actions/package/clean.d.ts.map +1 -0
- package/dist/types/actions/package/compile/XyConfig.d.ts +58 -0
- package/dist/types/actions/package/compile/XyConfig.d.ts.map +1 -0
- package/dist/types/actions/package/compile/buildEntries.d.ts +3 -0
- package/dist/types/actions/package/compile/buildEntries.d.ts.map +1 -0
- package/dist/types/actions/package/compile/compile.d.ts +3 -0
- package/dist/types/actions/package/compile/compile.d.ts.map +1 -0
- package/dist/types/actions/package/compile/compileTypes.d.ts +3 -0
- package/dist/types/actions/package/compile/compileTypes.d.ts.map +1 -0
- package/dist/types/actions/package/compile/copyTypeFiles.d.ts +3 -0
- package/dist/types/actions/package/compile/copyTypeFiles.d.ts.map +1 -0
- package/dist/types/actions/package/compile/deepMerge.d.ts +4 -0
- package/dist/types/actions/package/compile/deepMerge.d.ts.map +1 -0
- package/dist/types/actions/package/compile/getCompilerOptions.d.ts +3 -0
- package/dist/types/actions/package/compile/getCompilerOptions.d.ts.map +1 -0
- package/dist/types/actions/package/compile/index.d.ts +7 -0
- package/dist/types/actions/package/compile/index.d.ts.map +1 -0
- package/dist/types/actions/package/compile/inputs.d.ts +2 -0
- package/dist/types/actions/package/compile/inputs.d.ts.map +1 -0
- package/dist/types/actions/package/compile/packageCompileTsc.d.ts +4 -0
- package/dist/types/actions/package/compile/packageCompileTsc.d.ts.map +1 -0
- package/dist/types/actions/package/compile/packageCompileTscTypes.d.ts +4 -0
- package/dist/types/actions/package/compile/packageCompileTscTypes.d.ts.map +1 -0
- package/dist/types/actions/package/compile/packageCompileTsup.d.ts +5 -0
- package/dist/types/actions/package/compile/packageCompileTsup.d.ts.map +1 -0
- package/dist/types/actions/package/copy-assets.d.ts +5 -0
- package/dist/types/actions/package/copy-assets.d.ts.map +1 -0
- package/dist/types/actions/package/deps.d.ts +2 -0
- package/dist/types/actions/package/deps.d.ts.map +1 -0
- package/dist/types/actions/package/gen-docs.d.ts +2 -0
- package/dist/types/actions/package/gen-docs.d.ts.map +1 -0
- package/dist/types/actions/package/index.d.ts +11 -0
- package/dist/types/actions/package/index.d.ts.map +1 -0
- package/dist/types/actions/package/lint.d.ts +2 -0
- package/dist/types/actions/package/lint.d.ts.map +1 -0
- package/dist/types/actions/package/publint.d.ts +5 -0
- package/dist/types/actions/package/publint.d.ts.map +1 -0
- package/dist/types/actions/package/recompile.d.ts +2 -0
- package/dist/types/actions/package/recompile.d.ts.map +1 -0
- package/dist/types/actions/publint.d.ts +12 -0
- package/dist/types/actions/publint.d.ts.map +1 -0
- package/dist/types/actions/rebuild.d.ts +6 -0
- package/dist/types/actions/rebuild.d.ts.map +1 -0
- package/dist/types/actions/recompile.d.ts +16 -0
- package/dist/types/actions/recompile.d.ts.map +1 -0
- package/dist/types/actions/reinstall.d.ts +2 -0
- package/dist/types/actions/reinstall.d.ts.map +1 -0
- package/dist/types/actions/relint.d.ts +13 -0
- package/dist/types/actions/relint.d.ts.map +1 -0
- package/dist/types/actions/retest.d.ts +2 -0
- package/dist/types/actions/retest.d.ts.map +1 -0
- package/dist/types/actions/sonar.d.ts +2 -0
- package/dist/types/actions/sonar.d.ts.map +1 -0
- package/dist/types/actions/statics.d.ts +2 -0
- package/dist/types/actions/statics.d.ts.map +1 -0
- package/dist/types/actions/test.d.ts +2 -0
- package/dist/types/actions/test.d.ts.map +1 -0
- package/dist/types/actions/up.d.ts +2 -0
- package/dist/types/actions/up.d.ts.map +1 -0
- package/dist/types/actions/updo.d.ts +2 -0
- package/dist/types/actions/updo.d.ts.map +1 -0
- package/dist/types/actions/upplug.d.ts +2 -0
- package/dist/types/actions/upplug.d.ts.map +1 -0
- package/dist/types/actions/upyarn.d.ts +2 -0
- package/dist/types/actions/upyarn.d.ts.map +1 -0
- package/dist/types/actions/yarn3only.d.ts +2 -0
- package/dist/types/actions/yarn3only.d.ts.map +1 -0
- package/dist/types/bin/package/build-only.d.ts +3 -0
- package/dist/types/bin/package/build-only.d.ts.map +1 -0
- package/dist/types/bin/package/build.d.ts +3 -0
- package/dist/types/bin/package/build.d.ts.map +1 -0
- package/dist/types/bin/package/clean-outputs.d.ts +3 -0
- package/dist/types/bin/package/clean-outputs.d.ts.map +1 -0
- package/dist/types/bin/package/clean-typescript.d.ts +3 -0
- package/dist/types/bin/package/clean-typescript.d.ts.map +1 -0
- package/dist/types/bin/package/clean.d.ts +3 -0
- package/dist/types/bin/package/clean.d.ts.map +1 -0
- package/dist/types/bin/package/compile-only.d.ts +3 -0
- package/dist/types/bin/package/compile-only.d.ts.map +1 -0
- package/dist/types/bin/package/compile-tsup.d.ts +3 -0
- package/dist/types/bin/package/compile-tsup.d.ts.map +1 -0
- package/dist/types/bin/package/compile-types.d.ts +3 -0
- package/dist/types/bin/package/compile-types.d.ts.map +1 -0
- package/dist/types/bin/package/compile.d.ts +3 -0
- package/dist/types/bin/package/compile.d.ts.map +1 -0
- package/dist/types/bin/package/copy-assets-cjs.d.ts +3 -0
- package/dist/types/bin/package/copy-assets-cjs.d.ts.map +1 -0
- package/dist/types/bin/package/copy-assets-esm.d.ts +3 -0
- package/dist/types/bin/package/copy-assets-esm.d.ts.map +1 -0
- package/dist/types/bin/package/deps.d.ts +3 -0
- package/dist/types/bin/package/deps.d.ts.map +1 -0
- package/dist/types/bin/package/fix.d.ts +3 -0
- package/dist/types/bin/package/fix.d.ts.map +1 -0
- package/dist/types/bin/package/gen-docs.d.ts +3 -0
- package/dist/types/bin/package/gen-docs.d.ts.map +1 -0
- package/dist/types/bin/package/lint.d.ts +3 -0
- package/dist/types/bin/package/lint.d.ts.map +1 -0
- package/dist/types/bin/package/publint.d.ts +3 -0
- package/dist/types/bin/package/publint.d.ts.map +1 -0
- package/dist/types/bin/package/recompile.d.ts +3 -0
- package/dist/types/bin/package/recompile.d.ts.map +1 -0
- package/dist/types/bin/package/relint.d.ts +3 -0
- package/dist/types/bin/package/relint.d.ts.map +1 -0
- package/dist/types/bin/xy.d.ts +3 -0
- package/dist/types/bin/xy.d.ts.map +1 -0
- package/dist/types/index.d.ts +5 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/lib/checkResult.d.ts +2 -0
- package/dist/types/lib/checkResult.d.ts.map +1 -0
- package/dist/types/lib/createBuildConfig.d.ts +2 -0
- package/dist/types/lib/createBuildConfig.d.ts.map +1 -0
- package/dist/types/lib/defaultBuildConfig.d.ts +9 -0
- package/dist/types/lib/defaultBuildConfig.d.ts.map +1 -0
- package/dist/types/lib/deleteGlob.d.ts +2 -0
- package/dist/types/lib/deleteGlob.d.ts.map +1 -0
- package/dist/types/lib/dependencies/DuplicateDetector.d.ts +9 -0
- package/dist/types/lib/dependencies/DuplicateDetector.d.ts.map +1 -0
- package/dist/types/lib/dependencies/detectDuplicateDependencies.d.ts +2 -0
- package/dist/types/lib/dependencies/detectDuplicateDependencies.d.ts.map +1 -0
- package/dist/types/lib/dependencies/index.d.ts +3 -0
- package/dist/types/lib/dependencies/index.d.ts.map +1 -0
- package/dist/types/lib/file/ReadFileSyncOptions.d.ts +6 -0
- package/dist/types/lib/file/ReadFileSyncOptions.d.ts.map +1 -0
- package/dist/types/lib/file/constants.d.ts +3 -0
- package/dist/types/lib/file/constants.d.ts.map +1 -0
- package/dist/types/lib/file/fileLines.d.ts +6 -0
- package/dist/types/lib/file/fileLines.d.ts.map +1 -0
- package/dist/types/lib/file/index.d.ts +5 -0
- package/dist/types/lib/file/index.d.ts.map +1 -0
- package/dist/types/lib/file/tryReadFileSync.d.ts +4 -0
- package/dist/types/lib/file/tryReadFileSync.d.ts.map +1 -0
- package/dist/types/lib/generateIgnoreFiles.d.ts +2 -0
- package/dist/types/lib/generateIgnoreFiles.d.ts.map +1 -0
- package/dist/types/lib/index.d.ts +21 -0
- package/dist/types/lib/index.d.ts.map +1 -0
- package/dist/types/lib/jsonFormatters.d.ts +2 -0
- package/dist/types/lib/jsonFormatters.d.ts.map +1 -0
- package/dist/types/lib/loadConfig.d.ts +2 -0
- package/dist/types/lib/loadConfig.d.ts.map +1 -0
- package/dist/types/lib/parsedPackageJSON.d.ts +2 -0
- package/dist/types/lib/parsedPackageJSON.d.ts.map +1 -0
- package/dist/types/lib/processEx.d.ts +2 -0
- package/dist/types/lib/processEx.d.ts.map +1 -0
- package/dist/types/lib/runSteps.d.ts +4 -0
- package/dist/types/lib/runSteps.d.ts.map +1 -0
- package/dist/types/lib/runStepsAsync.d.ts +4 -0
- package/dist/types/lib/runStepsAsync.d.ts.map +1 -0
- package/dist/types/lib/runXy.d.ts +2 -0
- package/dist/types/lib/runXy.d.ts.map +1 -0
- package/dist/types/lib/runXyWithWarning.d.ts +2 -0
- package/dist/types/lib/runXyWithWarning.d.ts.map +1 -0
- package/dist/types/lib/safeExit.d.ts +5 -0
- package/dist/types/lib/safeExit.d.ts.map +1 -0
- package/dist/types/lib/string/empty.d.ts +3 -0
- package/dist/types/lib/string/empty.d.ts.map +1 -0
- package/dist/types/lib/string/index.d.ts +3 -0
- package/dist/types/lib/string/index.d.ts.map +1 -0
- package/dist/types/lib/string/union.d.ts +2 -0
- package/dist/types/lib/string/union.d.ts.map +1 -0
- package/dist/types/lib/withErrnoException.d.ts +2 -0
- package/dist/types/lib/withErrnoException.d.ts.map +1 -0
- package/dist/types/lib/withError.d.ts +2 -0
- package/dist/types/lib/withError.d.ts.map +1 -0
- package/dist/types/lib/yarn/index.d.ts +4 -0
- package/dist/types/lib/yarn/index.d.ts.map +1 -0
- package/dist/types/lib/yarn/isYarnVersionOrGreater.d.ts +2 -0
- package/dist/types/lib/yarn/isYarnVersionOrGreater.d.ts.map +1 -0
- package/dist/types/lib/yarn/workspace/Workspace.d.ts +5 -0
- package/dist/types/lib/yarn/workspace/Workspace.d.ts.map +1 -0
- package/dist/types/lib/yarn/workspace/index.d.ts +4 -0
- package/dist/types/lib/yarn/workspace/index.d.ts.map +1 -0
- package/dist/types/lib/yarn/workspace/yarnWorkspace.d.ts +3 -0
- package/dist/types/lib/yarn/workspace/yarnWorkspace.d.ts.map +1 -0
- package/dist/types/lib/yarn/workspace/yarnWorkspaces.d.ts +3 -0
- package/dist/types/lib/yarn/workspace/yarnWorkspaces.d.ts.map +1 -0
- package/dist/types/lib/yarn/yarnInitCwd.d.ts +2 -0
- package/dist/types/lib/yarn/yarnInitCwd.d.ts.map +1 -0
- package/dist/types/loadPackageConfig.d.ts +6 -0
- package/dist/types/loadPackageConfig.d.ts.map +1 -0
- package/dist/types/xy/index.d.ts +8 -0
- package/dist/types/xy/index.d.ts.map +1 -0
- package/dist/types/xy/param.d.ts +5 -0
- package/dist/types/xy/param.d.ts.map +1 -0
- package/dist/types/xy/xy.d.ts +10 -0
- package/dist/types/xy/xy.d.ts.map +1 -0
- package/dist/types/xy/xyBuildCommands.d.ts +3 -0
- package/dist/types/xy/xyBuildCommands.d.ts.map +1 -0
- package/dist/types/xy/xyCommonCommands.d.ts +3 -0
- package/dist/types/xy/xyCommonCommands.d.ts.map +1 -0
- package/dist/types/xy/xyDeployCommands.d.ts +3 -0
- package/dist/types/xy/xyDeployCommands.d.ts.map +1 -0
- package/dist/types/xy/xyInstallCommands.d.ts +3 -0
- package/dist/types/xy/xyInstallCommands.d.ts.map +1 -0
- package/dist/types/xy/xyLintCommands.d.ts +3 -0
- package/dist/types/xy/xyLintCommands.d.ts.map +1 -0
- package/dist/types/xy/xyParseOptions.d.ts +3 -0
- package/dist/types/xy/xyParseOptions.d.ts.map +1 -0
- package/dist/xy/index.mjs +22 -33
- package/dist/xy/index.mjs.map +1 -1
- package/dist/xy/xy.mjs +22 -33
- package/dist/xy/xy.mjs.map +1 -1
- package/dist/xy/xyBuildCommands.mjs +20 -19
- package/dist/xy/xyBuildCommands.mjs.map +1 -1
- package/dist/xy/xyLintCommands.mjs +2 -14
- package/dist/xy/xyLintCommands.mjs.map +1 -1
- package/package.json +4 -4
- package/src/actions/build.ts +1 -0
- package/src/actions/compile-types.ts +1 -1
- package/src/actions/compile.ts +7 -11
- package/src/actions/lint.ts +1 -5
- package/src/actions/package/compile/XyConfig.ts +0 -4
- package/src/actions/package/compile/compile.ts +15 -17
- package/src/actions/package/compile/packageCompileTscTypes.ts +21 -29
- package/src/actions/package/compile/packageCompileTsup.ts +12 -19
- package/src/actions/recompile.ts +2 -5
- package/src/actions/relint.ts +1 -3
- package/src/bin/package/build-only.ts +1 -1
- package/src/bin/package/build.ts +1 -1
- package/src/bin/package/clean-outputs.ts +1 -8
- package/src/bin/package/clean-typescript.ts +1 -8
- package/src/xy/xyBuildCommands.ts +0 -1
package/src/actions/lint.ts
CHANGED
|
@@ -14,17 +14,13 @@ export interface LintPackageParams {
|
|
|
14
14
|
verbose?: boolean
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
export const lintPackage = ({
|
|
18
|
-
pkg, fix, verbose,
|
|
19
|
-
}: LintParams & Required<Pick<LintParams, 'pkg'>>) => {
|
|
17
|
+
export const lintPackage = ({ pkg, fix }: LintParams & Required<Pick<LintParams, 'pkg'>>) => {
|
|
20
18
|
console.log(chalk.gray(`${fix ? 'Fix' : 'Lint'} [All-Packages]`))
|
|
21
19
|
const start = Date.now()
|
|
22
|
-
const verboseOptions = verbose ? ['--verbose'] : ['--no-verbose']
|
|
23
20
|
|
|
24
21
|
const result = runSteps(`${fix ? 'Fix' : 'Lint'} [All-Packages]`, [
|
|
25
22
|
['yarn', ['workspace',
|
|
26
23
|
pkg,
|
|
27
|
-
...verboseOptions,
|
|
28
24
|
'run',
|
|
29
25
|
fix ? 'package-fix' : 'package-lint',
|
|
30
26
|
]],
|
|
@@ -2,8 +2,6 @@ import type { Options } from 'tsup'
|
|
|
2
2
|
|
|
3
3
|
export type EntryMode = 'all' | 'single' | 'auto' | 'platform'
|
|
4
4
|
|
|
5
|
-
export type CompileMode = 'tsup' | 'tsc'
|
|
6
|
-
|
|
7
5
|
/**
|
|
8
6
|
* Configuration for specifying which paths are targeted.
|
|
9
7
|
*/
|
|
@@ -36,12 +34,10 @@ export interface CompileConfig {
|
|
|
36
34
|
entryMode?: EntryMode
|
|
37
35
|
/** @param files Manually specify the files to be compiled */
|
|
38
36
|
files?: string[]
|
|
39
|
-
mode?: CompileMode
|
|
40
37
|
}
|
|
41
38
|
|
|
42
39
|
export type PackageCompileTsupConfig = CompileConfig & {
|
|
43
40
|
browser?: Record<string, Options | boolean>
|
|
44
|
-
mode?: 'tsup'
|
|
45
41
|
neutral?: Record<string, Options | boolean>
|
|
46
42
|
node?: Record<string, Options | boolean>
|
|
47
43
|
tsup?: { options?: Options }
|
|
@@ -2,29 +2,27 @@ import chalk from 'chalk'
|
|
|
2
2
|
|
|
3
3
|
import { loadConfig } from '../../../lib/index.ts'
|
|
4
4
|
import { packagePublint } from '../publint.ts'
|
|
5
|
-
import {
|
|
5
|
+
import { packageCompileTypes } from './compileTypes.ts'
|
|
6
6
|
import { packageCompileTsup } from './packageCompileTsup.ts'
|
|
7
|
-
import type {
|
|
8
|
-
XyConfig, XyTscConfig, XyTsupConfig,
|
|
9
|
-
} from './XyConfig.ts'
|
|
7
|
+
import type { XyConfig } from './XyConfig.ts'
|
|
10
8
|
|
|
11
|
-
export const packageCompile = async (inConfig: XyConfig = {}
|
|
9
|
+
export const packageCompile = async (inConfig: XyConfig = {}): Promise<number> => {
|
|
12
10
|
const pkg = process.env.INIT_CWD
|
|
13
11
|
console.log(chalk.green(`Compiling ${pkg}`))
|
|
14
12
|
const config = await loadConfig(inConfig)
|
|
15
13
|
const publint = config.publint
|
|
16
14
|
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
result += await packageCompileTsc(undefined, config as XyTscConfig)
|
|
22
|
-
break
|
|
23
|
-
}
|
|
24
|
-
case 'tsup': {
|
|
25
|
-
result += await packageCompileTsup(config as XyTsupConfig, types)
|
|
26
|
-
break
|
|
27
|
-
}
|
|
15
|
+
const tscResults = await packageCompileTypes(config)
|
|
16
|
+
|
|
17
|
+
if (tscResults > 0) {
|
|
18
|
+
return tscResults
|
|
28
19
|
}
|
|
29
|
-
|
|
20
|
+
|
|
21
|
+
const tsupResults = await packageCompileTsup(config)
|
|
22
|
+
|
|
23
|
+
if (tsupResults > 0) {
|
|
24
|
+
return tsupResults
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return (publint ? await packagePublint(config) : 0)
|
|
30
28
|
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { cwd } from 'node:process'
|
|
2
2
|
|
|
3
|
-
import chalk from 'chalk'
|
|
4
3
|
import type { TsConfigCompilerOptions } from 'tsc-prog'
|
|
5
4
|
import { createProgramFromConfig } from 'tsc-prog'
|
|
6
5
|
import type { CompilerOptions } from 'typescript'
|
|
7
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
DiagnosticCategory, formatDiagnosticsWithColorAndContext, getPreEmitDiagnostics, sys,
|
|
8
|
+
} from 'typescript'
|
|
8
9
|
|
|
9
10
|
import { buildEntries } from './buildEntries.ts'
|
|
10
11
|
import { getCompilerOptions } from './getCompilerOptions.ts'
|
|
@@ -19,12 +20,11 @@ export const packageCompileTscTypes = (
|
|
|
19
20
|
const verbose = config?.verbose ?? false
|
|
20
21
|
|
|
21
22
|
if (verbose) {
|
|
22
|
-
console.log(`Compiling types
|
|
23
|
+
console.log(`Compiling types [${pkg}]`)
|
|
23
24
|
}
|
|
24
25
|
|
|
25
26
|
const compilerOptions = {
|
|
26
27
|
...(getCompilerOptions({
|
|
27
|
-
declaration: true,
|
|
28
28
|
emitDeclarationOnly: true,
|
|
29
29
|
outDir: 'dist/types',
|
|
30
30
|
removeComments: false,
|
|
@@ -40,35 +40,27 @@ export const packageCompileTscTypes = (
|
|
|
40
40
|
// calling all here since the types do not get rolled up
|
|
41
41
|
const files = buildEntries(folder, 'all', verbose)
|
|
42
42
|
|
|
43
|
-
const
|
|
43
|
+
const program = createProgramFromConfig({
|
|
44
44
|
basePath: pkg ?? cwd(),
|
|
45
45
|
compilerOptions,
|
|
46
46
|
exclude: ['dist', 'docs', '**/*.spec.*', '**/*.stories.*', 'src/**/spec/**/*'],
|
|
47
47
|
files,
|
|
48
|
-
})
|
|
48
|
+
})
|
|
49
49
|
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
console.error(chalk.blue(diag.file?.fileName))
|
|
63
|
-
break
|
|
64
|
-
}
|
|
65
|
-
case DiagnosticCategory.Suggestion: {
|
|
66
|
-
console.error(chalk.white(diag.messageText))
|
|
67
|
-
console.error(chalk.grey(pkg))
|
|
68
|
-
console.error(chalk.blue(diag.file?.fileName))
|
|
69
|
-
break
|
|
70
|
-
}
|
|
71
|
-
}
|
|
50
|
+
const diagnostics = getPreEmitDiagnostics(program)
|
|
51
|
+
|
|
52
|
+
if (diagnostics.length > 0) {
|
|
53
|
+
const formattedDiagnostics = formatDiagnosticsWithColorAndContext(
|
|
54
|
+
diagnostics,
|
|
55
|
+
{
|
|
56
|
+
getCanonicalFileName: fileName => fileName,
|
|
57
|
+
getCurrentDirectory: () => folder,
|
|
58
|
+
getNewLine: () => sys.newLine,
|
|
59
|
+
},
|
|
60
|
+
)
|
|
61
|
+
console.error(formattedDiagnostics)
|
|
72
62
|
}
|
|
73
|
-
|
|
63
|
+
|
|
64
|
+
program.emit()
|
|
65
|
+
return diagnostics.reduce((acc, diag) => acc + (diag.category === DiagnosticCategory.Error ? 1 : 0), 0)
|
|
74
66
|
}
|
|
@@ -1,18 +1,16 @@
|
|
|
1
|
-
/* eslint-disable complexity */
|
|
2
1
|
import type { Loader } from 'esbuild'
|
|
3
2
|
import type { Options } from 'tsup'
|
|
4
3
|
import { build, defineConfig } from 'tsup'
|
|
5
4
|
|
|
6
5
|
import { buildEntries } from './buildEntries.ts'
|
|
6
|
+
import { packageCompileTypes } from './compileTypes.ts'
|
|
7
7
|
import { deepMergeObjects } from './deepMerge.ts'
|
|
8
|
-
import { packageCompileTscTypes } from './packageCompileTscTypes.ts'
|
|
9
8
|
import type { EntryMode, XyTsupConfig } from './XyConfig.ts'
|
|
10
9
|
|
|
11
10
|
const compileFolder = async (
|
|
12
11
|
folder: string,
|
|
13
12
|
entryMode: EntryMode = 'single',
|
|
14
13
|
options?: Options,
|
|
15
|
-
types: 'tsc' | 'tsup' = 'tsc',
|
|
16
14
|
verbose?: boolean,
|
|
17
15
|
): Promise<number> => {
|
|
18
16
|
const outDir = options?.outDir ?? 'dist'
|
|
@@ -26,7 +24,7 @@ const compileFolder = async (
|
|
|
26
24
|
bundle: true,
|
|
27
25
|
cjsInterop: true,
|
|
28
26
|
clean: true,
|
|
29
|
-
dts:
|
|
27
|
+
dts: false,
|
|
30
28
|
entry,
|
|
31
29
|
format: ['esm'],
|
|
32
30
|
outDir,
|
|
@@ -46,13 +44,13 @@ const compileFolder = async (
|
|
|
46
44
|
).flat()
|
|
47
45
|
|
|
48
46
|
if (verbose) {
|
|
49
|
-
console.log(`TSUP:build:start [${folder}]
|
|
47
|
+
console.log(`TSUP:build:start [${folder}]`)
|
|
50
48
|
}
|
|
51
49
|
|
|
52
50
|
await Promise.all(optionsList.map(options => build(options)))
|
|
53
51
|
|
|
54
52
|
if (verbose) {
|
|
55
|
-
console.log(`TSUP:build:stop [${folder}]
|
|
53
|
+
console.log(`TSUP:build:stop [${folder}]`)
|
|
56
54
|
}
|
|
57
55
|
|
|
58
56
|
return 0
|
|
@@ -76,8 +74,8 @@ export const tsupOptions = (options: Options[] = []): Options => {
|
|
|
76
74
|
return deepMergeObjects([standardOptions, ...options])
|
|
77
75
|
}
|
|
78
76
|
|
|
79
|
-
export const packageCompileTsup = async (config?: XyTsupConfig
|
|
80
|
-
console.
|
|
77
|
+
export const packageCompileTsup = async (config?: XyTsupConfig) => {
|
|
78
|
+
console.log('packageCompileTsup-types')
|
|
81
79
|
const compile = config?.compile
|
|
82
80
|
const verbose = config?.verbose ?? false
|
|
83
81
|
if (verbose) {
|
|
@@ -88,14 +86,12 @@ export const packageCompileTsup = async (config?: XyTsupConfig, types: 'tsc' | '
|
|
|
88
86
|
const compileForBrowser = compile?.browser ?? { src: {} }
|
|
89
87
|
const compileForNeutral = compile?.neutral ?? { src: {} }
|
|
90
88
|
|
|
91
|
-
if (
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
return errors
|
|
98
|
-
}
|
|
89
|
+
if (verbose) {
|
|
90
|
+
console.log('Calling packageCompileTscTypes')
|
|
91
|
+
}
|
|
92
|
+
const errors = await packageCompileTypes(config)
|
|
93
|
+
if (errors > 0) {
|
|
94
|
+
return errors
|
|
99
95
|
}
|
|
100
96
|
|
|
101
97
|
return (
|
|
@@ -111,7 +107,6 @@ export const packageCompileTsup = async (config?: XyTsupConfig, types: 'tsc' | '
|
|
|
111
107
|
compile?.tsup?.options ?? {},
|
|
112
108
|
(typeof options === 'object' ? options : {}),
|
|
113
109
|
{ platform: 'node', outDir: 'dist/node' }]),
|
|
114
|
-
types,
|
|
115
110
|
verbose,
|
|
116
111
|
)
|
|
117
112
|
: 0
|
|
@@ -130,7 +125,6 @@ export const packageCompileTsup = async (config?: XyTsupConfig, types: 'tsc' | '
|
|
|
130
125
|
compile?.tsup?.options ?? {},
|
|
131
126
|
(typeof options === 'object' ? options : {}),
|
|
132
127
|
{ platform: 'browser', outDir: 'dist/browser' }]),
|
|
133
|
-
types,
|
|
134
128
|
verbose,
|
|
135
129
|
)
|
|
136
130
|
: 0
|
|
@@ -149,7 +143,6 @@ export const packageCompileTsup = async (config?: XyTsupConfig, types: 'tsc' | '
|
|
|
149
143
|
compile?.tsup?.options ?? {},
|
|
150
144
|
(typeof options === 'object' ? options : {}),
|
|
151
145
|
{ platform: 'neutral', outDir: 'dist/neutral' }]),
|
|
152
|
-
types,
|
|
153
146
|
verbose,
|
|
154
147
|
)
|
|
155
148
|
: 0
|
package/src/actions/recompile.ts
CHANGED
|
@@ -28,15 +28,12 @@ export const recompile = async ({
|
|
|
28
28
|
})
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
export const recompilePackage = ({
|
|
32
|
-
verbose, target, pkg,
|
|
33
|
-
}: RecompilePackageParams) => {
|
|
31
|
+
export const recompilePackage = ({ target, pkg }: RecompilePackageParams) => {
|
|
34
32
|
const targetOptions = target ? ['-t', target] : []
|
|
35
|
-
const verboseOptions = verbose ? ['--verbose'] : ['--no-verbose']
|
|
36
33
|
|
|
37
34
|
return runStepsAsync(
|
|
38
35
|
`Recompile [${pkg}]`,
|
|
39
|
-
[['yarn', ['workspace', pkg,
|
|
36
|
+
[['yarn', ['workspace', pkg, 'run', 'package-recompile', ...targetOptions]]],
|
|
40
37
|
)
|
|
41
38
|
}
|
|
42
39
|
|
package/src/actions/relint.ts
CHANGED
|
@@ -33,15 +33,13 @@ const dumpMessages = (lintResults: ESLint.LintResult[]) => {
|
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
export const relintPackage = ({ pkg
|
|
36
|
+
export const relintPackage = ({ pkg }: RelintParams & Required<Pick<RelintParams, 'pkg'>>) => {
|
|
37
37
|
console.log(chalk.gray(`${'Relint'} [All-Packages]`))
|
|
38
38
|
const start = Date.now()
|
|
39
|
-
const verboseOptions = verbose ? ['--verbose'] : ['--no-verbose']
|
|
40
39
|
|
|
41
40
|
const result = runSteps('Relint [All-Packages]', [
|
|
42
41
|
['yarn', ['workspace',
|
|
43
42
|
pkg,
|
|
44
|
-
...verboseOptions,
|
|
45
43
|
'run',
|
|
46
44
|
'package-relint',
|
|
47
45
|
]],
|
package/src/bin/package/build.ts
CHANGED