@xylabs/ts-scripts-yarn3 3.15.15 → 4.0.0-rc.10
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/compile.mjs +3 -2
- package/dist/actions/compile.mjs.map +1 -1
- package/dist/actions/index.mjs +96 -287
- package/dist/actions/index.mjs.map +1 -1
- package/dist/actions/package/compile/compile.mjs +57 -259
- package/dist/actions/package/compile/compile.mjs.map +1 -1
- package/dist/actions/package/compile/index.mjs +57 -259
- package/dist/actions/package/compile/index.mjs.map +1 -1
- package/dist/actions/package/compile/packageCompileTsc.mjs +1 -1
- package/dist/actions/package/compile/packageCompileTsc.mjs.map +1 -1
- package/dist/actions/package/compile/packageCompileTscTypes.mjs +2 -36
- package/dist/actions/package/compile/packageCompileTscTypes.mjs.map +1 -1
- package/dist/actions/package/compile/packageCompileTsup.mjs +54 -339
- package/dist/actions/package/compile/packageCompileTsup.mjs.map +1 -1
- package/dist/actions/package/index.mjs +72 -277
- package/dist/actions/package/index.mjs.map +1 -1
- package/dist/actions/package/recompile.mjs +58 -263
- package/dist/actions/package/recompile.mjs.map +1 -1
- package/dist/actions/recompile.mjs +14 -1
- package/dist/actions/recompile.mjs.map +1 -1
- package/dist/bin/package/compile-only.mjs +59 -261
- package/dist/bin/package/compile-only.mjs.map +1 -1
- package/dist/bin/package/compile-tsup.mjs +56 -341
- package/dist/bin/package/compile-tsup.mjs.map +1 -1
- package/dist/bin/package/compile.mjs +59 -261
- package/dist/bin/package/compile.mjs.map +1 -1
- package/dist/bin/package/recompile.mjs +60 -265
- package/dist/bin/package/recompile.mjs.map +1 -1
- package/dist/bin/xy-ts.mjs +17 -3
- package/dist/bin/xy-ts.mjs.map +1 -1
- package/dist/bin/xy.mjs +17 -3
- package/dist/bin/xy.mjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +106 -297
- package/dist/index.mjs.map +1 -1
- package/dist/xy/index.mjs +17 -3
- package/dist/xy/index.mjs.map +1 -1
- package/dist/xy/xy.mjs +17 -3
- package/dist/xy/xy.mjs.map +1 -1
- package/dist/xy/xyBuildCommands.mjs +17 -3
- package/dist/xy/xyBuildCommands.mjs.map +1 -1
- package/package.json +10 -20
- package/src/actions/compile.ts +2 -2
- package/src/actions/package/compile/XyConfig.ts +2 -2
- package/src/actions/package/compile/packageCompileTsc.ts +1 -1
- package/src/actions/package/compile/packageCompileTscTypes.ts +3 -8
- package/src/actions/package/compile/packageCompileTsup.ts +54 -130
- package/src/actions/package/recompile.ts +1 -1
- package/src/actions/recompile.ts +2 -1
- package/tsup.config.ts +1 -1
- package/dist/actions/build.cjs +0 -208
- package/dist/actions/build.cjs.map +0 -1
- package/dist/actions/clean-docs.cjs +0 -74
- package/dist/actions/clean-docs.cjs.map +0 -1
- package/dist/actions/clean-eslint.cjs +0 -53
- package/dist/actions/clean-eslint.cjs.map +0 -1
- package/dist/actions/clean-jest.cjs +0 -147
- package/dist/actions/clean-jest.cjs.map +0 -1
- package/dist/actions/clean.cjs +0 -192
- package/dist/actions/clean.cjs.map +0 -1
- package/dist/actions/compile.cjs +0 -217
- package/dist/actions/compile.cjs.map +0 -1
- package/dist/actions/copy-assets.cjs +0 -121
- package/dist/actions/copy-assets.cjs.map +0 -1
- package/dist/actions/cycle.cjs +0 -156
- package/dist/actions/cycle.cjs.map +0 -1
- package/dist/actions/dead.cjs +0 -148
- package/dist/actions/dead.cjs.map +0 -1
- package/dist/actions/deploy-major.cjs +0 -160
- package/dist/actions/deploy-major.cjs.map +0 -1
- package/dist/actions/deploy-minor.cjs +0 -160
- package/dist/actions/deploy-minor.cjs.map +0 -1
- package/dist/actions/deploy-next.cjs +0 -160
- package/dist/actions/deploy-next.cjs.map +0 -1
- package/dist/actions/deploy.cjs +0 -160
- package/dist/actions/deploy.cjs.map +0 -1
- package/dist/actions/deps.cjs +0 -205
- package/dist/actions/deps.cjs.map +0 -1
- package/dist/actions/dupdeps.cjs +0 -226
- package/dist/actions/dupdeps.cjs.map +0 -1
- package/dist/actions/fix.cjs +0 -149
- package/dist/actions/fix.cjs.map +0 -1
- package/dist/actions/gen-docs.cjs +0 -186
- package/dist/actions/gen-docs.cjs.map +0 -1
- package/dist/actions/gitignore-gen.cjs +0 -138
- package/dist/actions/gitignore-gen.cjs.map +0 -1
- package/dist/actions/gitlint-fix.cjs +0 -69
- package/dist/actions/gitlint-fix.cjs.map +0 -1
- package/dist/actions/gitlint.cjs +0 -84
- package/dist/actions/gitlint.cjs.map +0 -1
- package/dist/actions/index.cjs +0 -2600
- package/dist/actions/index.cjs.map +0 -1
- package/dist/actions/license.cjs +0 -133
- package/dist/actions/license.cjs.map +0 -1
- package/dist/actions/lint-clean.cjs +0 -227
- package/dist/actions/lint-clean.cjs.map +0 -1
- package/dist/actions/lint-profile.cjs +0 -153
- package/dist/actions/lint-profile.cjs.map +0 -1
- package/dist/actions/lint.cjs +0 -217
- package/dist/actions/lint.cjs.map +0 -1
- package/dist/actions/npmignore-gen.cjs +0 -138
- package/dist/actions/npmignore-gen.cjs.map +0 -1
- package/dist/actions/package/clean-outputs.cjs +0 -56
- package/dist/actions/package/clean-outputs.cjs.map +0 -1
- package/dist/actions/package/clean-typescript.cjs +0 -56
- package/dist/actions/package/clean-typescript.cjs.map +0 -1
- package/dist/actions/package/clean.cjs +0 -83
- package/dist/actions/package/clean.cjs.map +0 -1
- package/dist/actions/package/compile/XyConfig.cjs +0 -19
- package/dist/actions/package/compile/XyConfig.cjs.map +0 -1
- package/dist/actions/package/compile/buildEntries.cjs +0 -68
- package/dist/actions/package/compile/buildEntries.cjs.map +0 -1
- package/dist/actions/package/compile/compile.cjs +0 -565
- package/dist/actions/package/compile/compile.cjs.map +0 -1
- package/dist/actions/package/compile/copyTypeFiles.cjs +0 -60
- package/dist/actions/package/compile/copyTypeFiles.cjs.map +0 -1
- package/dist/actions/package/compile/getCompilerOptions.cjs +0 -67
- package/dist/actions/package/compile/getCompilerOptions.cjs.map +0 -1
- package/dist/actions/package/compile/index.cjs +0 -571
- package/dist/actions/package/compile/index.cjs.map +0 -1
- package/dist/actions/package/compile/inputs.cjs +0 -79
- package/dist/actions/package/compile/inputs.cjs.map +0 -1
- package/dist/actions/package/compile/packageCompileTsc.cjs +0 -164
- package/dist/actions/package/compile/packageCompileTsc.cjs.map +0 -1
- package/dist/actions/package/compile/packageCompileTscTypes.cjs +0 -199
- package/dist/actions/package/compile/packageCompileTscTypes.cjs.map +0 -1
- package/dist/actions/package/compile/packageCompileTsup.cjs +0 -521
- package/dist/actions/package/compile/packageCompileTsup.cjs.map +0 -1
- package/dist/actions/package/copy-assets.cjs +0 -88
- package/dist/actions/package/copy-assets.cjs.map +0 -1
- package/dist/actions/package/deps.cjs +0 -214
- package/dist/actions/package/deps.cjs.map +0 -1
- package/dist/actions/package/gen-docs.cjs +0 -148
- package/dist/actions/package/gen-docs.cjs.map +0 -1
- package/dist/actions/package/index.cjs +0 -968
- package/dist/actions/package/index.cjs.map +0 -1
- package/dist/actions/package/publint.cjs +0 -80
- package/dist/actions/package/publint.cjs.map +0 -1
- package/dist/actions/package/recompile.cjs +0 -617
- package/dist/actions/package/recompile.cjs.map +0 -1
- package/dist/actions/publint.cjs +0 -237
- package/dist/actions/publint.cjs.map +0 -1
- package/dist/actions/rebuild.cjs +0 -148
- package/dist/actions/rebuild.cjs.map +0 -1
- package/dist/actions/recompile.cjs +0 -232
- package/dist/actions/recompile.cjs.map +0 -1
- package/dist/actions/reinstall.cjs +0 -183
- package/dist/actions/reinstall.cjs.map +0 -1
- package/dist/actions/relint.cjs +0 -185
- package/dist/actions/relint.cjs.map +0 -1
- package/dist/actions/retest.cjs +0 -154
- package/dist/actions/retest.cjs.map +0 -1
- package/dist/actions/sonar.cjs +0 -149
- package/dist/actions/sonar.cjs.map +0 -1
- package/dist/actions/statics.cjs +0 -234
- package/dist/actions/statics.cjs.map +0 -1
- package/dist/actions/test.cjs +0 -147
- package/dist/actions/test.cjs.map +0 -1
- package/dist/actions/up.cjs +0 -144
- package/dist/actions/up.cjs.map +0 -1
- package/dist/actions/updo.cjs +0 -152
- package/dist/actions/updo.cjs.map +0 -1
- package/dist/actions/upplug.cjs +0 -172
- package/dist/actions/upplug.cjs.map +0 -1
- package/dist/actions/upyarn.cjs +0 -148
- package/dist/actions/upyarn.cjs.map +0 -1
- package/dist/actions/yarn3only.cjs +0 -106
- package/dist/actions/yarn3only.cjs.map +0 -1
- package/dist/bin/build.cjs +0 -39
- package/dist/bin/build.cjs.map +0 -1
- package/dist/bin/clean.cjs +0 -39
- package/dist/bin/clean.cjs.map +0 -1
- package/dist/bin/compile-only.cjs +0 -39
- package/dist/bin/compile-only.cjs.map +0 -1
- package/dist/bin/compile.cjs +0 -39
- package/dist/bin/compile.cjs.map +0 -1
- package/dist/bin/cycle.cjs +0 -39
- package/dist/bin/cycle.cjs.map +0 -1
- package/dist/bin/dead.cjs +0 -39
- package/dist/bin/dead.cjs.map +0 -1
- package/dist/bin/deploy-major.cjs +0 -39
- package/dist/bin/deploy-major.cjs.map +0 -1
- package/dist/bin/deploy-minor.cjs +0 -39
- package/dist/bin/deploy-minor.cjs.map +0 -1
- package/dist/bin/deploy-next.cjs +0 -39
- package/dist/bin/deploy-next.cjs.map +0 -1
- package/dist/bin/deploy.cjs +0 -39
- package/dist/bin/deploy.cjs.map +0 -1
- package/dist/bin/deps.cjs +0 -39
- package/dist/bin/deps.cjs.map +0 -1
- package/dist/bin/fix.cjs +0 -39
- package/dist/bin/fix.cjs.map +0 -1
- package/dist/bin/gen-docs.cjs +0 -39
- package/dist/bin/gen-docs.cjs.map +0 -1
- package/dist/bin/gitlint-fix.cjs +0 -39
- package/dist/bin/gitlint-fix.cjs.map +0 -1
- package/dist/bin/gitlint.cjs +0 -39
- package/dist/bin/gitlint.cjs.map +0 -1
- package/dist/bin/license.cjs +0 -39
- package/dist/bin/license.cjs.map +0 -1
- package/dist/bin/lint-clean.cjs +0 -39
- package/dist/bin/lint-clean.cjs.map +0 -1
- package/dist/bin/lint-fast.cjs +0 -39
- package/dist/bin/lint-fast.cjs.map +0 -1
- package/dist/bin/lint-profile.cjs +0 -39
- package/dist/bin/lint-profile.cjs.map +0 -1
- package/dist/bin/lint.cjs +0 -39
- package/dist/bin/lint.cjs.map +0 -1
- package/dist/bin/package/clean-outputs.cjs +0 -51
- package/dist/bin/package/clean-outputs.cjs.map +0 -1
- package/dist/bin/package/clean-typescript.cjs +0 -51
- package/dist/bin/package/clean-typescript.cjs.map +0 -1
- package/dist/bin/package/clean.cjs +0 -76
- package/dist/bin/package/clean.cjs.map +0 -1
- package/dist/bin/package/compile-only.cjs +0 -564
- package/dist/bin/package/compile-only.cjs.map +0 -1
- package/dist/bin/package/compile-tsup.cjs +0 -519
- package/dist/bin/package/compile-tsup.cjs.map +0 -1
- package/dist/bin/package/compile.cjs +0 -567
- package/dist/bin/package/compile.cjs.map +0 -1
- package/dist/bin/package/copy-assets-cjs.cjs +0 -86
- package/dist/bin/package/copy-assets-cjs.cjs.map +0 -1
- package/dist/bin/package/copy-assets-esm.cjs +0 -86
- package/dist/bin/package/copy-assets-esm.cjs.map +0 -1
- package/dist/bin/package/deps.cjs +0 -208
- package/dist/bin/package/deps.cjs.map +0 -1
- package/dist/bin/package/gen-docs.cjs +0 -143
- package/dist/bin/package/gen-docs.cjs.map +0 -1
- package/dist/bin/package/publint.cjs +0 -77
- package/dist/bin/package/publint.cjs.map +0 -1
- package/dist/bin/package/recompile.cjs +0 -611
- package/dist/bin/package/recompile.cjs.map +0 -1
- package/dist/bin/publint.cjs +0 -39
- package/dist/bin/publint.cjs.map +0 -1
- package/dist/bin/rebuild.cjs +0 -39
- package/dist/bin/rebuild.cjs.map +0 -1
- package/dist/bin/recompile.cjs +0 -39
- package/dist/bin/recompile.cjs.map +0 -1
- package/dist/bin/reinstall.cjs +0 -39
- package/dist/bin/reinstall.cjs.map +0 -1
- package/dist/bin/relint.cjs +0 -39
- package/dist/bin/relint.cjs.map +0 -1
- package/dist/bin/sonar.cjs +0 -39
- package/dist/bin/sonar.cjs.map +0 -1
- package/dist/bin/test.cjs +0 -39
- package/dist/bin/test.cjs.map +0 -1
- package/dist/bin/up.cjs +0 -39
- package/dist/bin/up.cjs.map +0 -1
- package/dist/bin/updo.cjs +0 -39
- package/dist/bin/updo.cjs.map +0 -1
- package/dist/bin/upplug.cjs +0 -39
- package/dist/bin/upplug.cjs.map +0 -1
- package/dist/bin/upyarn.cjs +0 -39
- package/dist/bin/upyarn.cjs.map +0 -1
- package/dist/bin/xy-ts.cjs +0 -1890
- package/dist/bin/xy-ts.cjs.map +0 -1
- package/dist/bin/xy.cjs +0 -1890
- package/dist/bin/xy.cjs.map +0 -1
- package/dist/bin/yarn3only.cjs +0 -39
- package/dist/bin/yarn3only.cjs.map +0 -1
- package/dist/index.cjs +0 -3129
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.cts +0 -359
- package/dist/lib/checkResult.cjs +0 -52
- package/dist/lib/checkResult.cjs.map +0 -1
- package/dist/lib/createBuildConfig.cjs +0 -93
- package/dist/lib/createBuildConfig.cjs.map +0 -1
- package/dist/lib/defaultBuildConfig.cjs +0 -52
- package/dist/lib/defaultBuildConfig.cjs.map +0 -1
- package/dist/lib/dependencies/DuplicateDetector.cjs +0 -124
- package/dist/lib/dependencies/DuplicateDetector.cjs.map +0 -1
- package/dist/lib/dependencies/detectDuplicateDependencies.cjs +0 -207
- package/dist/lib/dependencies/detectDuplicateDependencies.cjs.map +0 -1
- package/dist/lib/dependencies/index.cjs +0 -211
- package/dist/lib/dependencies/index.cjs.map +0 -1
- package/dist/lib/file/ReadFileSyncOptions.cjs +0 -33
- package/dist/lib/file/ReadFileSyncOptions.cjs.map +0 -1
- package/dist/lib/file/constants.cjs +0 -34
- package/dist/lib/file/constants.cjs.map +0 -1
- package/dist/lib/file/fileLines.cjs +0 -58
- package/dist/lib/file/fileLines.cjs.map +0 -1
- package/dist/lib/file/index.cjs +0 -74
- package/dist/lib/file/index.cjs.map +0 -1
- package/dist/lib/file/tryReadFileSync.cjs +0 -42
- package/dist/lib/file/tryReadFileSync.cjs.map +0 -1
- package/dist/lib/generateIgnoreFiles.cjs +0 -132
- package/dist/lib/generateIgnoreFiles.cjs.map +0 -1
- package/dist/lib/index.cjs +0 -614
- package/dist/lib/index.cjs.map +0 -1
- package/dist/lib/jsonFormatters.cjs +0 -37
- package/dist/lib/jsonFormatters.cjs.map +0 -1
- package/dist/lib/loadConfig.cjs +0 -59
- package/dist/lib/loadConfig.cjs.map +0 -1
- package/dist/lib/parsedPackageJSON.cjs +0 -37
- package/dist/lib/parsedPackageJSON.cjs.map +0 -1
- package/dist/lib/processEx.cjs +0 -72
- package/dist/lib/processEx.cjs.map +0 -1
- package/dist/lib/runSteps.cjs +0 -134
- package/dist/lib/runSteps.cjs.map +0 -1
- package/dist/lib/runStepsAsync.cjs +0 -147
- package/dist/lib/runStepsAsync.cjs.map +0 -1
- package/dist/lib/runXy.cjs +0 -150
- package/dist/lib/runXy.cjs.map +0 -1
- package/dist/lib/runXyWithWarning.cjs +0 -49
- package/dist/lib/runXyWithWarning.cjs.map +0 -1
- package/dist/lib/safeExit.cjs +0 -100
- package/dist/lib/safeExit.cjs.map +0 -1
- package/dist/lib/string/empty.cjs +0 -35
- package/dist/lib/string/empty.cjs.map +0 -1
- package/dist/lib/string/index.cjs +0 -45
- package/dist/lib/string/index.cjs.map +0 -1
- package/dist/lib/string/union.cjs +0 -35
- package/dist/lib/string/union.cjs.map +0 -1
- package/dist/lib/withErrnoException.cjs +0 -41
- package/dist/lib/withErrnoException.cjs.map +0 -1
- package/dist/lib/withError.cjs +0 -34
- package/dist/lib/withError.cjs.map +0 -1
- package/dist/lib/yarn/index.cjs +0 -93
- package/dist/lib/yarn/index.cjs.map +0 -1
- package/dist/lib/yarn/isYarnVersionOrGreater.cjs +0 -52
- package/dist/lib/yarn/isYarnVersionOrGreater.cjs.map +0 -1
- package/dist/lib/yarn/workspace/Workspace.cjs +0 -19
- package/dist/lib/yarn/workspace/Workspace.cjs.map +0 -1
- package/dist/lib/yarn/workspace/index.cjs +0 -60
- package/dist/lib/yarn/workspace/index.cjs.map +0 -1
- package/dist/lib/yarn/workspace/yarnWorkspace.cjs +0 -58
- package/dist/lib/yarn/workspace/yarnWorkspace.cjs.map +0 -1
- package/dist/lib/yarn/workspace/yarnWorkspaces.cjs +0 -49
- package/dist/lib/yarn/workspace/yarnWorkspaces.cjs.map +0 -1
- package/dist/lib/yarn/yarnInitCwd.cjs +0 -35
- package/dist/lib/yarn/yarnInitCwd.cjs.map +0 -1
- package/dist/loadPackageConfig.cjs +0 -39
- package/dist/loadPackageConfig.cjs.map +0 -1
- package/dist/types.d.cjs +0 -2
- package/dist/types.d.cjs.map +0 -1
- package/dist/xy/index.cjs +0 -1909
- package/dist/xy/index.cjs.map +0 -1
- package/dist/xy/param.cjs +0 -36
- package/dist/xy/param.cjs.map +0 -1
- package/dist/xy/xy.cjs +0 -1895
- package/dist/xy/xy.cjs.map +0 -1
- package/dist/xy/xyBuildCommands.cjs +0 -595
- package/dist/xy/xyBuildCommands.cjs.map +0 -1
- package/dist/xy/xyCommonCommands.cjs +0 -723
- package/dist/xy/xyCommonCommands.cjs.map +0 -1
- package/dist/xy/xyDeployCommands.cjs +0 -263
- package/dist/xy/xyDeployCommands.cjs.map +0 -1
- package/dist/xy/xyInstallCommands.cjs +0 -508
- package/dist/xy/xyInstallCommands.cjs.map +0 -1
- package/dist/xy/xyLintCommands.cjs +0 -466
- package/dist/xy/xyLintCommands.cjs.map +0 -1
- package/dist/xy/xyParseOptions.cjs +0 -84
- package/dist/xy/xyParseOptions.cjs.map +0 -1
package/dist/index.mjs
CHANGED
|
@@ -362,7 +362,7 @@ var mergeEntries = /* @__PURE__ */ __name((a, b) => [
|
|
|
362
362
|
].sort(), "mergeEntries");
|
|
363
363
|
var generateIgnoreFiles = /* @__PURE__ */ __name((filename3, pkg) => {
|
|
364
364
|
console.log(chalk4.green(`Generate ${filename3} Files`));
|
|
365
|
-
const
|
|
365
|
+
const cwd3 = INIT_CWD() ?? ".";
|
|
366
366
|
const workspaces = pkg ? [
|
|
367
367
|
yarnWorkspace(pkg)
|
|
368
368
|
] : yarnWorkspaces();
|
|
@@ -370,7 +370,7 @@ var generateIgnoreFiles = /* @__PURE__ */ __name((filename3, pkg) => {
|
|
|
370
370
|
const writeEntries = /* @__PURE__ */ __name((location, entries) => writeLines(`${location}/${filename3}`, entries), "writeEntries");
|
|
371
371
|
const results = workspaces.map(({ location, name }) => {
|
|
372
372
|
try {
|
|
373
|
-
writeEntries(location, mergeEntries(readEntries(
|
|
373
|
+
writeEntries(location, mergeEntries(readEntries(cwd3), readEntries(location)));
|
|
374
374
|
return 0;
|
|
375
375
|
} catch (ex) {
|
|
376
376
|
const error = ex;
|
|
@@ -633,7 +633,7 @@ var cleanDocs = /* @__PURE__ */ __name(() => {
|
|
|
633
633
|
|
|
634
634
|
// src/actions/compile.ts
|
|
635
635
|
import chalk11 from "chalk";
|
|
636
|
-
var compile = /* @__PURE__ */ __name(({ verbose, target, pkg, incremental, publint: publint2 }) => {
|
|
636
|
+
var compile = /* @__PURE__ */ __name(({ verbose, target, pkg, incremental, publint: publint2, jobs }) => {
|
|
637
637
|
return pkg ? compilePackage({
|
|
638
638
|
pkg,
|
|
639
639
|
publint: publint2,
|
|
@@ -643,7 +643,8 @@ var compile = /* @__PURE__ */ __name(({ verbose, target, pkg, incremental, publi
|
|
|
643
643
|
incremental,
|
|
644
644
|
publint: publint2,
|
|
645
645
|
target,
|
|
646
|
-
verbose
|
|
646
|
+
verbose,
|
|
647
|
+
jobs
|
|
647
648
|
});
|
|
648
649
|
}, "compile");
|
|
649
650
|
var compilePackage = /* @__PURE__ */ __name(({ target, pkg }) => {
|
|
@@ -1347,7 +1348,7 @@ var packageClean = /* @__PURE__ */ __name(async () => {
|
|
|
1347
1348
|
}, "packageClean");
|
|
1348
1349
|
|
|
1349
1350
|
// src/actions/package/compile/compile.ts
|
|
1350
|
-
import
|
|
1351
|
+
import chalk23 from "chalk";
|
|
1351
1352
|
|
|
1352
1353
|
// src/actions/package/publint.ts
|
|
1353
1354
|
import { promises as fs } from "node:fs";
|
|
@@ -1435,7 +1436,7 @@ var packageCompileTsc = /* @__PURE__ */ __name(async (noEmit, config2, compilerO
|
|
|
1435
1436
|
console.log(`Compiling with NoEmit TSC [${pkg}]`);
|
|
1436
1437
|
}
|
|
1437
1438
|
const compilerOptions = {
|
|
1438
|
-
...
|
|
1439
|
+
...getCompilerOptions({
|
|
1439
1440
|
outDir: "dist",
|
|
1440
1441
|
removeComments: true,
|
|
1441
1442
|
rootDir: "src"
|
|
@@ -1474,7 +1475,6 @@ var packageCompileTsc = /* @__PURE__ */ __name(async (noEmit, config2, compilerO
|
|
|
1474
1475
|
}, "packageCompileTsc");
|
|
1475
1476
|
|
|
1476
1477
|
// src/actions/package/compile/packageCompileTsup.ts
|
|
1477
|
-
import merge3 from "lodash/merge.js";
|
|
1478
1478
|
import { build as build2, defineConfig } from "tsup";
|
|
1479
1479
|
|
|
1480
1480
|
// src/actions/package/compile/inputs.ts
|
|
@@ -1513,123 +1513,23 @@ var buildEntries = /* @__PURE__ */ __name((folder, entryMode, verbose = false) =
|
|
|
1513
1513
|
}
|
|
1514
1514
|
}, "buildEntries");
|
|
1515
1515
|
|
|
1516
|
-
// src/actions/package/compile/packageCompileTscTypes.ts
|
|
1517
|
-
import { cwd as cwd2 } from "node:process";
|
|
1518
|
-
import chalk23 from "chalk";
|
|
1519
|
-
import { createProgramFromConfig as createProgramFromConfig2 } from "tsc-prog";
|
|
1520
|
-
import { DiagnosticCategory as DiagnosticCategory2 } from "typescript";
|
|
1521
|
-
|
|
1522
|
-
// src/actions/package/compile/copyTypeFiles.ts
|
|
1523
|
-
import { copyFile, readdir } from "node:fs/promises";
|
|
1524
|
-
import { Mutex } from "async-mutex";
|
|
1525
|
-
var copyFileMutex = new Mutex();
|
|
1526
|
-
var getDistTypeFiles = /* @__PURE__ */ __name(async (compilerOptions) => {
|
|
1527
|
-
const outDir = compilerOptions.outDir ?? "dist";
|
|
1528
|
-
return (await readdir(outDir, {
|
|
1529
|
-
recursive: true
|
|
1530
|
-
})).filter((file) => file.endsWith("d.ts")).map((file) => `${outDir}/${file}`);
|
|
1531
|
-
}, "getDistTypeFiles");
|
|
1532
|
-
var getDistTypeMapFiles = /* @__PURE__ */ __name(async (compilerOptions) => {
|
|
1533
|
-
const outDir = compilerOptions.outDir ?? "dist";
|
|
1534
|
-
return (await readdir(outDir, {
|
|
1535
|
-
recursive: true
|
|
1536
|
-
})).filter((file) => file.endsWith("d.ts.map")).map((file) => `${outDir}/${file}`);
|
|
1537
|
-
}, "getDistTypeMapFiles");
|
|
1538
|
-
var copyTypeFiles = /* @__PURE__ */ __name(async (compilerOptions) => {
|
|
1539
|
-
await copyFileMutex.runExclusive(async () => {
|
|
1540
|
-
const distTypeFiles = await getDistTypeFiles(compilerOptions);
|
|
1541
|
-
await Promise.all(distTypeFiles.map(async (file) => {
|
|
1542
|
-
await copyFile(file, file.replace("d.ts", "d.mts"));
|
|
1543
|
-
await copyFile(file, file.replace("d.ts", "d.cts"));
|
|
1544
|
-
}));
|
|
1545
|
-
const distTypeMapFiles = await getDistTypeMapFiles(compilerOptions);
|
|
1546
|
-
await Promise.all(distTypeMapFiles.map(async (file) => {
|
|
1547
|
-
await copyFile(file, file.replace("d.ts.map", "d.mts.map"));
|
|
1548
|
-
await copyFile(file, file.replace("d.ts.map", "d.cts.map"));
|
|
1549
|
-
}));
|
|
1550
|
-
});
|
|
1551
|
-
}, "copyTypeFiles");
|
|
1552
|
-
|
|
1553
|
-
// src/actions/package/compile/packageCompileTscTypes.ts
|
|
1554
|
-
var packageCompileTscTypes = /* @__PURE__ */ __name(async (folder = "src", { verbose } = {}, compilerOptionsParam, generateMts = true) => {
|
|
1555
|
-
const pkg = process.env.INIT_CWD ?? cwd2();
|
|
1556
|
-
if (verbose) {
|
|
1557
|
-
console.log(`Compiling types with TSC [${pkg}]`);
|
|
1558
|
-
}
|
|
1559
|
-
const compilerOptions = {
|
|
1560
|
-
...await getCompilerOptions({
|
|
1561
|
-
declaration: true,
|
|
1562
|
-
emitDeclarationOnly: true,
|
|
1563
|
-
outDir: "dist",
|
|
1564
|
-
removeComments: true,
|
|
1565
|
-
skipDefaultLibCheck: true,
|
|
1566
|
-
skipLibCheck: true,
|
|
1567
|
-
sourceMap: true
|
|
1568
|
-
}),
|
|
1569
|
-
...compilerOptionsParam
|
|
1570
|
-
};
|
|
1571
|
-
const files = buildEntries(folder, "all");
|
|
1572
|
-
const result = createProgramFromConfig2({
|
|
1573
|
-
basePath: pkg ?? cwd2(),
|
|
1574
|
-
compilerOptions,
|
|
1575
|
-
exclude: [
|
|
1576
|
-
"dist",
|
|
1577
|
-
"docs",
|
|
1578
|
-
"**/*.spec.*",
|
|
1579
|
-
"**/*.stories.*",
|
|
1580
|
-
"src/**/spec/**/*"
|
|
1581
|
-
],
|
|
1582
|
-
files
|
|
1583
|
-
}).emit();
|
|
1584
|
-
const diagResults = result.diagnostics.length;
|
|
1585
|
-
for (const diag of result.diagnostics) {
|
|
1586
|
-
switch (diag.category) {
|
|
1587
|
-
case DiagnosticCategory2.Error: {
|
|
1588
|
-
console.error(chalk23.red(diag.messageText));
|
|
1589
|
-
console.error(chalk23.grey(pkg));
|
|
1590
|
-
console.error(chalk23.blue(diag.file?.fileName));
|
|
1591
|
-
break;
|
|
1592
|
-
}
|
|
1593
|
-
case DiagnosticCategory2.Warning: {
|
|
1594
|
-
console.error(chalk23.yellow(diag.messageText));
|
|
1595
|
-
console.error(chalk23.grey(pkg));
|
|
1596
|
-
console.error(chalk23.blue(diag.file?.fileName));
|
|
1597
|
-
break;
|
|
1598
|
-
}
|
|
1599
|
-
case DiagnosticCategory2.Suggestion: {
|
|
1600
|
-
console.error(chalk23.white(diag.messageText));
|
|
1601
|
-
console.error(chalk23.grey(pkg));
|
|
1602
|
-
console.error(chalk23.blue(diag.file?.fileName));
|
|
1603
|
-
break;
|
|
1604
|
-
}
|
|
1605
|
-
}
|
|
1606
|
-
}
|
|
1607
|
-
if (generateMts) {
|
|
1608
|
-
await copyTypeFiles(compilerOptions);
|
|
1609
|
-
}
|
|
1610
|
-
return diagResults;
|
|
1611
|
-
}, "packageCompileTscTypes");
|
|
1612
|
-
|
|
1613
1516
|
// src/actions/package/compile/packageCompileTsup.ts
|
|
1614
|
-
var compileFolder = /* @__PURE__ */ __name(async (folder, entryMode = "single", options,
|
|
1517
|
+
var compileFolder = /* @__PURE__ */ __name(async (folder, entryMode = "single", options, _verbose) => {
|
|
1615
1518
|
const outDir = options?.outDir ?? "dist";
|
|
1616
1519
|
const entry = buildEntries(folder, entryMode);
|
|
1617
1520
|
const optionsResult = defineConfig({
|
|
1618
1521
|
bundle: true,
|
|
1619
1522
|
cjsInterop: true,
|
|
1620
1523
|
clean: true,
|
|
1621
|
-
dts:
|
|
1524
|
+
dts: true,
|
|
1622
1525
|
entry,
|
|
1623
1526
|
format: [
|
|
1624
|
-
"cjs",
|
|
1625
1527
|
"esm"
|
|
1626
1528
|
],
|
|
1627
|
-
// minify: true,
|
|
1628
1529
|
outDir,
|
|
1629
1530
|
silent: true,
|
|
1630
1531
|
sourcemap: true,
|
|
1631
1532
|
splitting: false,
|
|
1632
|
-
// terserOptions: { format: { comments: false } },
|
|
1633
1533
|
tsconfig: "tsconfig.json",
|
|
1634
1534
|
...options
|
|
1635
1535
|
});
|
|
@@ -1644,11 +1544,6 @@ var compileFolder = /* @__PURE__ */ __name(async (folder, entryMode = "single",
|
|
|
1644
1544
|
];
|
|
1645
1545
|
}))).flat();
|
|
1646
1546
|
await Promise.all(optionsList.map((options2) => build2(options2)));
|
|
1647
|
-
await packageCompileTscTypes(folder, {
|
|
1648
|
-
verbose
|
|
1649
|
-
}, {
|
|
1650
|
-
outDir
|
|
1651
|
-
});
|
|
1652
1547
|
return 0;
|
|
1653
1548
|
}, "compileFolder");
|
|
1654
1549
|
var packageCompileTsup = /* @__PURE__ */ __name(async (config2) => {
|
|
@@ -1667,172 +1562,76 @@ var packageCompileTsup = /* @__PURE__ */ __name(async (config2) => {
|
|
|
1667
1562
|
const compileForNeutral = compile2?.neutral ?? {
|
|
1668
1563
|
src: {}
|
|
1669
1564
|
};
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1565
|
+
const standardLoaders = {
|
|
1566
|
+
".gif": "copy",
|
|
1567
|
+
".html": "copy",
|
|
1568
|
+
".jpg": "copy",
|
|
1569
|
+
".json": "json",
|
|
1570
|
+
".png": "copy",
|
|
1571
|
+
".svg": "copy",
|
|
1572
|
+
".webp": "copy"
|
|
1573
|
+
};
|
|
1574
|
+
const standardOptions = {
|
|
1575
|
+
bundle: true,
|
|
1576
|
+
format: [
|
|
1577
|
+
"esm"
|
|
1578
|
+
],
|
|
1579
|
+
loader: standardLoaders,
|
|
1580
|
+
outExtension: /* @__PURE__ */ __name(({ format }) => format === "esm" ? {
|
|
1581
|
+
js: ".mjs"
|
|
1582
|
+
} : {
|
|
1583
|
+
js: ".cjs"
|
|
1584
|
+
}, "outExtension"),
|
|
1585
|
+
skipNodeModulesBundle: true,
|
|
1586
|
+
sourcemap: true,
|
|
1587
|
+
target: "esnext"
|
|
1588
|
+
};
|
|
1589
|
+
return (await Promise.all(Object.entries(compileForNode).map(async ([folder, options]) => {
|
|
1674
1590
|
const inEsBuildOptions = typeof compile2?.node?.esbuildOptions === "object" ? compile2?.node?.esbuildOptions : {};
|
|
1675
1591
|
return folder ? await compileFolder(folder, compile2?.entryMode, {
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
loader: merge3({}, {
|
|
1682
|
-
".gif": "copy",
|
|
1683
|
-
".html": "copy",
|
|
1684
|
-
".jpg": "copy",
|
|
1685
|
-
".json": "json",
|
|
1686
|
-
".png": "copy",
|
|
1687
|
-
".svg": "copy",
|
|
1688
|
-
".webp": "copy"
|
|
1689
|
-
}, inEsBuildOptions?.loader),
|
|
1690
|
-
// minify: true,
|
|
1592
|
+
...standardOptions,
|
|
1593
|
+
loader: {
|
|
1594
|
+
...standardOptions.loader,
|
|
1595
|
+
...inEsBuildOptions?.loader
|
|
1596
|
+
},
|
|
1691
1597
|
outDir: "dist/node",
|
|
1692
|
-
outExtension: /* @__PURE__ */ __name(({ format }) => format === "esm" ? {
|
|
1693
|
-
js: ".mjs"
|
|
1694
|
-
} : {
|
|
1695
|
-
js: ".cjs"
|
|
1696
|
-
}, "outExtension"),
|
|
1697
1598
|
platform: "node",
|
|
1698
|
-
skipNodeModulesBundle: true,
|
|
1699
|
-
sourcemap: true,
|
|
1700
|
-
target: "node16",
|
|
1701
|
-
// terserOptions: { format: { comments: false } },
|
|
1702
1599
|
...compile2?.tsup?.options,
|
|
1703
1600
|
...typeof options === "object" ? options : {}
|
|
1704
1601
|
}, verbose) : 0;
|
|
1705
1602
|
}))).reduce((prev, value) => prev + value, 0) || (await Promise.all(Object.entries(compileForBrowser).map(async ([folder, options]) => {
|
|
1706
1603
|
const inEsBuildOptions = typeof compile2?.browser?.esbuildOptions === "object" ? compile2?.browser?.esbuildOptions : {};
|
|
1707
|
-
return folder ?
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
".png": "copy",
|
|
1719
|
-
".svg": "copy",
|
|
1720
|
-
".webp": "copy"
|
|
1721
|
-
}, inEsBuildOptions?.loader),
|
|
1722
|
-
// minify: true,
|
|
1723
|
-
outDir: "dist/browser",
|
|
1724
|
-
outExtension: /* @__PURE__ */ __name(({ format }) => format === "esm" ? {
|
|
1725
|
-
js: ".mjs"
|
|
1726
|
-
} : {
|
|
1727
|
-
js: ".cjs"
|
|
1728
|
-
}, "outExtension"),
|
|
1729
|
-
platform: "browser",
|
|
1730
|
-
skipNodeModulesBundle: true,
|
|
1731
|
-
sourcemap: true,
|
|
1732
|
-
target: "esnext",
|
|
1733
|
-
// terserOptions: { format: { comments: false } },
|
|
1734
|
-
...compile2?.tsup?.options,
|
|
1735
|
-
...typeof options === "object" ? options : {}
|
|
1736
|
-
}, verbose),
|
|
1737
|
-
compileFolder(folder, compile2?.entryMode, {
|
|
1738
|
-
bundle: true,
|
|
1739
|
-
format: [
|
|
1740
|
-
"esm"
|
|
1741
|
-
],
|
|
1742
|
-
loader: merge3({}, {
|
|
1743
|
-
".gif": "copy",
|
|
1744
|
-
".html": "copy",
|
|
1745
|
-
".jpg": "copy",
|
|
1746
|
-
".json": "json",
|
|
1747
|
-
".png": "copy",
|
|
1748
|
-
".svg": "copy",
|
|
1749
|
-
".webp": "copy"
|
|
1750
|
-
}, inEsBuildOptions?.loader),
|
|
1751
|
-
// minify: true,
|
|
1752
|
-
outDir: "dist/browser",
|
|
1753
|
-
outExtension: /* @__PURE__ */ __name(({ format }) => format === "esm" ? {
|
|
1754
|
-
js: ".mjs"
|
|
1755
|
-
} : {
|
|
1756
|
-
js: ".cjs"
|
|
1757
|
-
}, "outExtension"),
|
|
1758
|
-
platform: "browser",
|
|
1759
|
-
skipNodeModulesBundle: true,
|
|
1760
|
-
sourcemap: true,
|
|
1761
|
-
target: "esnext",
|
|
1762
|
-
// terserOptions: { format: { comments: false } },
|
|
1763
|
-
...compile2?.tsup?.options,
|
|
1764
|
-
...typeof options === "object" ? options : {}
|
|
1765
|
-
}, verbose)
|
|
1766
|
-
])).reduce((prev, value) => prev + value, 0) : 0;
|
|
1604
|
+
return folder ? await compileFolder(folder, compile2?.entryMode, {
|
|
1605
|
+
...standardOptions,
|
|
1606
|
+
loader: {
|
|
1607
|
+
...standardOptions.loader,
|
|
1608
|
+
...inEsBuildOptions?.loader
|
|
1609
|
+
},
|
|
1610
|
+
outDir: "dist/browser",
|
|
1611
|
+
platform: "browser",
|
|
1612
|
+
...compile2?.tsup?.options,
|
|
1613
|
+
...typeof options === "object" ? options : {}
|
|
1614
|
+
}, verbose) : 0;
|
|
1767
1615
|
}))).reduce((prev, value) => prev + value, 0) || (await Promise.all(Object.entries(compileForNeutral).map(async ([folder, options]) => {
|
|
1768
1616
|
const inEsBuildOptions = typeof compile2?.neutral?.esbuildOptions === "object" ? compile2?.neutral?.esbuildOptions : {};
|
|
1769
|
-
return folder ?
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
".png": "copy",
|
|
1781
|
-
".svg": "copy",
|
|
1782
|
-
".webp": "copy"
|
|
1783
|
-
}, inEsBuildOptions?.loader),
|
|
1784
|
-
// minify: true,
|
|
1785
|
-
outDir: "dist/neutral",
|
|
1786
|
-
outExtension: /* @__PURE__ */ __name(({ format }) => format === "esm" ? {
|
|
1787
|
-
js: ".mjs"
|
|
1788
|
-
} : {
|
|
1789
|
-
js: ".cjs"
|
|
1790
|
-
}, "outExtension"),
|
|
1791
|
-
platform: "neutral",
|
|
1792
|
-
skipNodeModulesBundle: true,
|
|
1793
|
-
sourcemap: true,
|
|
1794
|
-
target: "esnext",
|
|
1795
|
-
// terserOptions: { format: { comments: false } },
|
|
1796
|
-
...compile2?.tsup?.options,
|
|
1797
|
-
...typeof options === "object" ? options : {}
|
|
1798
|
-
}, verbose),
|
|
1799
|
-
compileFolder(folder, compile2?.entryMode, {
|
|
1800
|
-
bundle: true,
|
|
1801
|
-
format: [
|
|
1802
|
-
"esm"
|
|
1803
|
-
],
|
|
1804
|
-
loader: merge3({}, {
|
|
1805
|
-
".gif": "copy",
|
|
1806
|
-
".html": "copy",
|
|
1807
|
-
".jpg": "copy",
|
|
1808
|
-
".json": "json",
|
|
1809
|
-
".png": "copy",
|
|
1810
|
-
".svg": "copy",
|
|
1811
|
-
".webp": "copy"
|
|
1812
|
-
}, inEsBuildOptions?.loader),
|
|
1813
|
-
// minify: true,
|
|
1814
|
-
outDir: "dist/neutral",
|
|
1815
|
-
outExtension: /* @__PURE__ */ __name(({ format }) => format === "esm" ? {
|
|
1816
|
-
js: ".mjs"
|
|
1817
|
-
} : {
|
|
1818
|
-
js: ".cjs"
|
|
1819
|
-
}, "outExtension"),
|
|
1820
|
-
platform: "neutral",
|
|
1821
|
-
skipNodeModulesBundle: true,
|
|
1822
|
-
sourcemap: true,
|
|
1823
|
-
target: "esnext",
|
|
1824
|
-
// terserOptions: { format: { comments: false } },
|
|
1825
|
-
...compile2?.tsup?.options,
|
|
1826
|
-
...typeof options === "object" ? options : {}
|
|
1827
|
-
}, verbose)
|
|
1828
|
-
])).reduce((prev, value) => prev + value, 0) : 0;
|
|
1617
|
+
return folder ? await compileFolder(folder, compile2?.entryMode, {
|
|
1618
|
+
...standardOptions,
|
|
1619
|
+
loader: {
|
|
1620
|
+
...standardOptions.loader,
|
|
1621
|
+
...inEsBuildOptions?.loader
|
|
1622
|
+
},
|
|
1623
|
+
outDir: "dist/neutral",
|
|
1624
|
+
platform: "neutral",
|
|
1625
|
+
...compile2?.tsup?.options,
|
|
1626
|
+
...typeof options === "object" ? options : {}
|
|
1627
|
+
}, verbose) : 0;
|
|
1829
1628
|
}))).reduce((prev, value) => prev + value, 0) || (publint2 ? await packagePublint() : 0);
|
|
1830
1629
|
}, "packageCompileTsup");
|
|
1831
1630
|
|
|
1832
1631
|
// src/actions/package/compile/compile.ts
|
|
1833
1632
|
var packageCompile = /* @__PURE__ */ __name(async (inConfig = {}) => {
|
|
1834
1633
|
const pkg = process.env.INIT_CWD;
|
|
1835
|
-
console.log(
|
|
1634
|
+
console.log(chalk23.green(`Compiling ${pkg}`));
|
|
1836
1635
|
const config2 = await loadConfig(inConfig);
|
|
1837
1636
|
const publint2 = config2.publint;
|
|
1838
1637
|
const mode = config2.compile?.mode ?? "tsup";
|
|
@@ -1852,7 +1651,7 @@ var packageCompile = /* @__PURE__ */ __name(async (inConfig = {}) => {
|
|
|
1852
1651
|
|
|
1853
1652
|
// src/actions/package/copy-assets.ts
|
|
1854
1653
|
import path5 from "node:path/posix";
|
|
1855
|
-
import
|
|
1654
|
+
import chalk24 from "chalk";
|
|
1856
1655
|
import cpy2 from "cpy";
|
|
1857
1656
|
var copyTargetAssets2 = /* @__PURE__ */ __name(async (target, name, location) => {
|
|
1858
1657
|
try {
|
|
@@ -1871,7 +1670,7 @@ var copyTargetAssets2 = /* @__PURE__ */ __name(async (target, name, location) =>
|
|
|
1871
1670
|
flat: false
|
|
1872
1671
|
});
|
|
1873
1672
|
if (values.length > 0) {
|
|
1874
|
-
console.log(
|
|
1673
|
+
console.log(chalk24.green(`Copying Assets [${target.toUpperCase()}] - ${name} - ${location}`));
|
|
1875
1674
|
}
|
|
1876
1675
|
for (const value of values) {
|
|
1877
1676
|
console.log(`${value.split("/").pop()} => ./dist/${target}`);
|
|
@@ -1901,8 +1700,8 @@ var packageCopyAssets = /* @__PURE__ */ __name(async ({ target }) => {
|
|
|
1901
1700
|
|
|
1902
1701
|
// src/actions/package/deps.ts
|
|
1903
1702
|
import { existsSync as existsSync5, readFileSync as readFileSync5 } from "node:fs";
|
|
1904
|
-
import { cwd as
|
|
1905
|
-
import
|
|
1703
|
+
import { cwd as cwd2 } from "node:process";
|
|
1704
|
+
import chalk25 from "chalk";
|
|
1906
1705
|
import depcheck from "depcheck";
|
|
1907
1706
|
var special = depcheck.special;
|
|
1908
1707
|
var defaultIgnorePatterns = [
|
|
@@ -1929,21 +1728,21 @@ var defaultIgnoreDevPatterns = [
|
|
|
1929
1728
|
var reportUnused = /* @__PURE__ */ __name((name, unused) => {
|
|
1930
1729
|
if (unused.length > 0) {
|
|
1931
1730
|
const message = [
|
|
1932
|
-
|
|
1731
|
+
chalk25.yellow(`${unused.length} Unused ${name}`)
|
|
1933
1732
|
];
|
|
1934
|
-
for (const value of unused) message.push(
|
|
1733
|
+
for (const value of unused) message.push(chalk25.gray(` ${value}`));
|
|
1935
1734
|
console.log(message.join("\n"));
|
|
1936
1735
|
}
|
|
1937
1736
|
}, "reportUnused");
|
|
1938
1737
|
var reportMissing = /* @__PURE__ */ __name((name, missing) => {
|
|
1939
1738
|
if (Object.keys(missing).length > 0) {
|
|
1940
1739
|
const message = [
|
|
1941
|
-
|
|
1740
|
+
chalk25.yellow(`${Object.entries(missing).length} Missing ${name}`)
|
|
1942
1741
|
];
|
|
1943
1742
|
for (const [key, value] of Object.entries(missing)) {
|
|
1944
|
-
message.push(`${key}`,
|
|
1743
|
+
message.push(`${key}`, chalk25.gray(` ${value.at(0)}`));
|
|
1945
1744
|
}
|
|
1946
|
-
console.log(
|
|
1745
|
+
console.log(chalk25.yellow(message.join("\n")));
|
|
1947
1746
|
}
|
|
1948
1747
|
}, "reportMissing");
|
|
1949
1748
|
var analyzeDeps = /* @__PURE__ */ __name(async (pkg, ignoreMatches) => {
|
|
@@ -1998,7 +1797,7 @@ var analyzeDeps = /* @__PURE__ */ __name(async (pkg, ignoreMatches) => {
|
|
|
1998
1797
|
};
|
|
1999
1798
|
}, "analyzeDeps");
|
|
2000
1799
|
var packageDeps = /* @__PURE__ */ __name(async () => {
|
|
2001
|
-
const pkg = process.env.INIT_CWD ??
|
|
1800
|
+
const pkg = process.env.INIT_CWD ?? cwd2();
|
|
2002
1801
|
const pkgName = process.env.npm_package_name;
|
|
2003
1802
|
const packageContent = existsSync5(`${pkg}/package.json`) ? JSON.parse(readFileSync5(`${pkg}/package.json`, {
|
|
2004
1803
|
encoding: "utf8"
|
|
@@ -2048,10 +1847,10 @@ var packageDeps = /* @__PURE__ */ __name(async () => {
|
|
|
2048
1847
|
reportUnused("dependencies", unusedDeps);
|
|
2049
1848
|
reportUnused("devDependencies", unusedDevDeps);
|
|
2050
1849
|
if (Object.entries(invalidDirs).length > 0) {
|
|
2051
|
-
for (const [key, value] of Object.entries(invalidDirs)) console.warn(
|
|
1850
|
+
for (const [key, value] of Object.entries(invalidDirs)) console.warn(chalk25.gray(`Invalid Dir: ${key}: ${value}`));
|
|
2052
1851
|
}
|
|
2053
1852
|
if (Object.entries(invalidFiles).length > 0) {
|
|
2054
|
-
for (const [key, value] of Object.entries(invalidFiles)) console.warn(
|
|
1853
|
+
for (const [key, value] of Object.entries(invalidFiles)) console.warn(chalk25.gray(`Invalid File: ${key}: ${value}`));
|
|
2055
1854
|
}
|
|
2056
1855
|
reportMissing("dependencies", missingDepsObject);
|
|
2057
1856
|
reportMissing("devDependencies", missingDevDepsObject);
|
|
@@ -2062,7 +1861,7 @@ var packageDeps = /* @__PURE__ */ __name(async () => {
|
|
|
2062
1861
|
// src/actions/package/gen-docs.ts
|
|
2063
1862
|
import { existsSync as existsSync6 } from "node:fs";
|
|
2064
1863
|
import path6 from "node:path";
|
|
2065
|
-
import
|
|
1864
|
+
import chalk26 from "chalk";
|
|
2066
1865
|
import { Application, ArgumentsReader, TSConfigReader, TypeDocReader } from "typedoc";
|
|
2067
1866
|
var ExitCodes = {
|
|
2068
1867
|
CompileError: 3,
|
|
@@ -2164,16 +1963,13 @@ var runTypeDoc = /* @__PURE__ */ __name(async (app) => {
|
|
|
2164
1963
|
return ExitCodes.OutputError;
|
|
2165
1964
|
}
|
|
2166
1965
|
}
|
|
2167
|
-
console.log(
|
|
1966
|
+
console.log(chalk26.green(`${pkgName} - Ok`));
|
|
2168
1967
|
return ExitCodes.Ok;
|
|
2169
1968
|
}, "runTypeDoc");
|
|
2170
1969
|
|
|
2171
1970
|
// src/actions/package/recompile.ts
|
|
2172
1971
|
var packageRecompile = /* @__PURE__ */ __name(async () => {
|
|
2173
|
-
return (await
|
|
2174
|
-
packageClean(),
|
|
2175
|
-
packageCompile()
|
|
2176
|
-
])).reduce((prev, value) => prev + value, 0);
|
|
1972
|
+
return await packageClean() || await packageCompile();
|
|
2177
1973
|
}, "packageRecompile");
|
|
2178
1974
|
|
|
2179
1975
|
// src/actions/publint.ts
|
|
@@ -2234,7 +2030,7 @@ var rebuild = /* @__PURE__ */ __name(({ target }) => {
|
|
|
2234
2030
|
}, "rebuild");
|
|
2235
2031
|
|
|
2236
2032
|
// src/actions/recompile.ts
|
|
2237
|
-
import
|
|
2033
|
+
import chalk27 from "chalk";
|
|
2238
2034
|
var recompile = /* @__PURE__ */ __name(async ({ verbose, target, pkg, incremental }) => {
|
|
2239
2035
|
return pkg ? await recompilePackage({
|
|
2240
2036
|
pkg,
|
|
@@ -2295,7 +2091,7 @@ var recompileAll = /* @__PURE__ */ __name(async ({ jobs, verbose, target, increm
|
|
|
2295
2091
|
`${jobs}`
|
|
2296
2092
|
] : [];
|
|
2297
2093
|
if (jobs) {
|
|
2298
|
-
console.log(
|
|
2094
|
+
console.log(chalk27.blue(`Jobs set to [${jobs}]`));
|
|
2299
2095
|
}
|
|
2300
2096
|
const result = await runStepsAsync(`Recompile${incremental ? "-Incremental" : ""} [All]`, [
|
|
2301
2097
|
[
|
|
@@ -2307,12 +2103,25 @@ var recompileAll = /* @__PURE__ */ __name(async ({ jobs, verbose, target, increm
|
|
|
2307
2103
|
...jobsOptions,
|
|
2308
2104
|
...verboseOptions,
|
|
2309
2105
|
"run",
|
|
2310
|
-
"package-
|
|
2106
|
+
"package-clean",
|
|
2107
|
+
...targetOptions
|
|
2108
|
+
]
|
|
2109
|
+
],
|
|
2110
|
+
[
|
|
2111
|
+
"yarn",
|
|
2112
|
+
[
|
|
2113
|
+
"workspaces",
|
|
2114
|
+
"foreach",
|
|
2115
|
+
...incrementalOptions,
|
|
2116
|
+
...jobsOptions,
|
|
2117
|
+
...verboseOptions,
|
|
2118
|
+
"run",
|
|
2119
|
+
"package-compile",
|
|
2311
2120
|
...targetOptions
|
|
2312
2121
|
]
|
|
2313
2122
|
]
|
|
2314
2123
|
]);
|
|
2315
|
-
console.log(`${
|
|
2124
|
+
console.log(`${chalk27.gray("Recompiled in")} [${chalk27.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk27.gray("seconds")}`);
|
|
2316
2125
|
return result;
|
|
2317
2126
|
}, "recompileAll");
|
|
2318
2127
|
|
|
@@ -2412,7 +2221,7 @@ var sonar = /* @__PURE__ */ __name(() => {
|
|
|
2412
2221
|
}, "sonar");
|
|
2413
2222
|
|
|
2414
2223
|
// src/actions/statics.ts
|
|
2415
|
-
import
|
|
2224
|
+
import chalk28 from "chalk";
|
|
2416
2225
|
var DefaultDependencies = [
|
|
2417
2226
|
"axios",
|
|
2418
2227
|
"@xylabs/pixel",
|
|
@@ -2423,7 +2232,7 @@ var DefaultDependencies = [
|
|
|
2423
2232
|
"@mui/system"
|
|
2424
2233
|
];
|
|
2425
2234
|
var statics = /* @__PURE__ */ __name(() => {
|
|
2426
|
-
console.log(
|
|
2235
|
+
console.log(chalk28.green("Check Required Static Dependencies"));
|
|
2427
2236
|
const statics2 = parsedPackageJSON()?.xy?.deps?.statics;
|
|
2428
2237
|
return detectDuplicateDependencies(statics2, DefaultDependencies);
|
|
2429
2238
|
}, "statics");
|
|
@@ -2541,7 +2350,7 @@ var loadPackageConfig = /* @__PURE__ */ __name(async () => {
|
|
|
2541
2350
|
}, "loadPackageConfig");
|
|
2542
2351
|
|
|
2543
2352
|
// src/xy/xy.ts
|
|
2544
|
-
import
|
|
2353
|
+
import chalk30 from "chalk";
|
|
2545
2354
|
|
|
2546
2355
|
// src/xy/xyBuildCommands.ts
|
|
2547
2356
|
var xyBuildCommands = /* @__PURE__ */ __name((args) => {
|
|
@@ -2777,7 +2586,7 @@ var xyInstallCommands = /* @__PURE__ */ __name((args) => {
|
|
|
2777
2586
|
}, "xyInstallCommands");
|
|
2778
2587
|
|
|
2779
2588
|
// src/xy/xyLintCommands.ts
|
|
2780
|
-
import
|
|
2589
|
+
import chalk29 from "chalk";
|
|
2781
2590
|
var xyLintCommands = /* @__PURE__ */ __name((args) => {
|
|
2782
2591
|
return args.command("cycle [package]", "Cycle - Check for dependency cycles", (yargs2) => {
|
|
2783
2592
|
return packagePositionalParam(yargs2);
|
|
@@ -2785,7 +2594,7 @@ var xyLintCommands = /* @__PURE__ */ __name((args) => {
|
|
|
2785
2594
|
const start = Date.now();
|
|
2786
2595
|
if (argv.verbose) console.log("Cycle");
|
|
2787
2596
|
process.exitCode = cycle();
|
|
2788
|
-
console.log(
|
|
2597
|
+
console.log(chalk29.blue(`Finished in ${Date.now() - start}ms`));
|
|
2789
2598
|
}).command("lint [package]", "Lint - Run Eslint", (yargs2) => {
|
|
2790
2599
|
return packagePositionalParam(yargs2);
|
|
2791
2600
|
}, async (argv) => {
|
|
@@ -2794,21 +2603,21 @@ var xyLintCommands = /* @__PURE__ */ __name((args) => {
|
|
|
2794
2603
|
process.exitCode = argv.fix ? fix() : argv.profile ? lintProfile() : await lint({
|
|
2795
2604
|
pkg: argv.package
|
|
2796
2605
|
});
|
|
2797
|
-
console.log(
|
|
2606
|
+
console.log(chalk29.blue(`Finished in ${Date.now() - start}ms`));
|
|
2798
2607
|
}).command("fix [package]", "Fix - Run Eslint w/fix", (yargs2) => {
|
|
2799
2608
|
return packagePositionalParam(yargs2);
|
|
2800
2609
|
}, (argv) => {
|
|
2801
2610
|
const start = Date.now();
|
|
2802
2611
|
if (argv.verbose) console.log("Fix");
|
|
2803
2612
|
process.exitCode = fix();
|
|
2804
|
-
console.log(
|
|
2613
|
+
console.log(chalk29.blue(`Finished in ${Date.now() - start}ms`));
|
|
2805
2614
|
}).command("relint [package]", "Relint - Clean & Lint", (yargs2) => {
|
|
2806
2615
|
return packagePositionalParam(yargs2);
|
|
2807
2616
|
}, (argv) => {
|
|
2808
2617
|
if (argv.verbose) console.log("Relinting");
|
|
2809
2618
|
const start = Date.now();
|
|
2810
2619
|
process.exitCode = relint();
|
|
2811
|
-
console.log(
|
|
2620
|
+
console.log(chalk29.blue(`Finished in ${Date.now() - start}ms`));
|
|
2812
2621
|
}).command("publint [package]", "Publint - Run Publint", (yargs2) => {
|
|
2813
2622
|
return packagePositionalParam(yargs2);
|
|
2814
2623
|
}, async (argv) => {
|
|
@@ -2818,14 +2627,14 @@ var xyLintCommands = /* @__PURE__ */ __name((args) => {
|
|
|
2818
2627
|
pkg: argv.package,
|
|
2819
2628
|
verbose: !!argv.verbose
|
|
2820
2629
|
});
|
|
2821
|
-
console.log(
|
|
2630
|
+
console.log(chalk29.blue(`Finished in ${Date.now() - start}ms`));
|
|
2822
2631
|
}).command("sonar", "Sonar - Run Sonar Check", (yargs2) => {
|
|
2823
2632
|
return packagePositionalParam(yargs2);
|
|
2824
2633
|
}, (argv) => {
|
|
2825
2634
|
const start = Date.now();
|
|
2826
2635
|
if (argv.verbose) console.log("Sonar Check");
|
|
2827
2636
|
process.exitCode = sonar();
|
|
2828
|
-
console.log(
|
|
2637
|
+
console.log(chalk29.blue(`Finished in ${Date.now() - start}ms`));
|
|
2829
2638
|
});
|
|
2830
2639
|
}, "xyLintCommands");
|
|
2831
2640
|
|
|
@@ -2878,8 +2687,8 @@ var xyParseOptions = /* @__PURE__ */ __name(() => {
|
|
|
2878
2687
|
var xy = /* @__PURE__ */ __name(async () => {
|
|
2879
2688
|
const options = xyParseOptions();
|
|
2880
2689
|
return await xyBuildCommands(xyCommonCommands(xyInstallCommands(xyDeployCommands(xyLintCommands(options))))).demandCommand(1).command("*", "", () => {
|
|
2881
|
-
console.error(
|
|
2882
|
-
console.log(
|
|
2690
|
+
console.error(chalk30.yellow(`Command not found [${chalk30.magenta(process.argv[2])}]`));
|
|
2691
|
+
console.log(chalk30.gray("Try 'yarn xy --help' for list of commands"));
|
|
2883
2692
|
}).version().help().argv;
|
|
2884
2693
|
}, "xy");
|
|
2885
2694
|
export {
|