@xylabs/ts-scripts-yarn3 3.15.16 → 4.0.0-rc.11
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/cycle.mjs +32 -110
- package/dist/actions/cycle.mjs.map +1 -1
- package/dist/actions/index.mjs +131 -307
- 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 +56 -27
- package/dist/bin/xy-ts.mjs.map +1 -1
- package/dist/bin/xy.mjs +56 -27
- package/dist/bin/xy.mjs.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.mjs +143 -319
- package/dist/index.mjs.map +1 -1
- package/dist/xy/index.mjs +56 -27
- package/dist/xy/index.mjs.map +1 -1
- package/dist/xy/xy.mjs +56 -27
- package/dist/xy/xy.mjs.map +1 -1
- package/dist/xy/xyBuildCommands.mjs +17 -3
- package/dist/xy/xyBuildCommands.mjs.map +1 -1
- package/dist/xy/xyLintCommands.mjs +37 -22
- package/dist/xy/xyLintCommands.mjs.map +1 -1
- package/package.json +11 -20
- package/src/actions/compile.ts +2 -2
- package/src/actions/cycle.ts +21 -4
- 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/src/types.d.ts +23 -0
- package/src/xy/xyLintCommands.ts +2 -2
- 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
|
@@ -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 }) => {
|
|
@@ -771,25 +772,40 @@ var copyAssets = /* @__PURE__ */ __name(async ({ target, pkg }) => {
|
|
|
771
772
|
}, "copyAssets");
|
|
772
773
|
|
|
773
774
|
// src/actions/cycle.ts
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
775
|
+
import { cwd } from "node:process";
|
|
776
|
+
import { ESLint } from "eslint";
|
|
777
|
+
import importPlugin from "eslint-plugin-import";
|
|
778
|
+
var cycle = /* @__PURE__ */ __name(async () => {
|
|
779
|
+
const eslint = new ESLint({
|
|
780
|
+
fix: false,
|
|
781
|
+
overrideConfig: {
|
|
782
|
+
plugins: {
|
|
783
|
+
import: importPlugin
|
|
784
|
+
},
|
|
785
|
+
rules: {
|
|
786
|
+
"import/no-cycle": [
|
|
787
|
+
"error",
|
|
788
|
+
{
|
|
789
|
+
maxDepth: 10
|
|
790
|
+
}
|
|
791
|
+
]
|
|
792
|
+
}
|
|
793
|
+
}
|
|
794
|
+
});
|
|
795
|
+
const configFile = await eslint.findConfigFile();
|
|
796
|
+
console.log("Config file:", configFile);
|
|
797
|
+
const results = await eslint.lintFiles([
|
|
798
|
+
"src/**/*.ts*",
|
|
799
|
+
"packages/**/src/**/*.ts*"
|
|
792
800
|
]);
|
|
801
|
+
const formatter = await eslint.loadFormatter("stylish");
|
|
802
|
+
const resultText = formatter.format(results, {
|
|
803
|
+
cwd: cwd(),
|
|
804
|
+
rulesMeta: {}
|
|
805
|
+
});
|
|
806
|
+
console.log(resultText);
|
|
807
|
+
console.log("Lint Errors:", results.length);
|
|
808
|
+
return results.length;
|
|
793
809
|
}, "cycle");
|
|
794
810
|
|
|
795
811
|
// src/actions/dead.ts
|
|
@@ -1202,7 +1218,7 @@ var license = /* @__PURE__ */ __name(async (pkg) => {
|
|
|
1202
1218
|
|
|
1203
1219
|
// src/actions/lint.ts
|
|
1204
1220
|
import chalk18 from "chalk";
|
|
1205
|
-
import { ESLint } from "eslint";
|
|
1221
|
+
import { ESLint as ESLint2 } from "eslint";
|
|
1206
1222
|
var dumpMessages = /* @__PURE__ */ __name((lintResults) => {
|
|
1207
1223
|
const colors = [
|
|
1208
1224
|
"white",
|
|
@@ -1229,7 +1245,7 @@ var lintPackage = /* @__PURE__ */ __name(async ({ pkg }) => {
|
|
|
1229
1245
|
console.error(chalk18.red(`Unable to locate package [${chalk18.magenta(pkg)}]`));
|
|
1230
1246
|
process.exit(1);
|
|
1231
1247
|
}
|
|
1232
|
-
const engine = new
|
|
1248
|
+
const engine = new ESLint2({
|
|
1233
1249
|
cache: true
|
|
1234
1250
|
});
|
|
1235
1251
|
const lintResults = await engine.lintFiles(workspace.location);
|
|
@@ -1237,7 +1253,7 @@ var lintPackage = /* @__PURE__ */ __name(async ({ pkg }) => {
|
|
|
1237
1253
|
return lintResults.reduce((prev, lintResult) => prev + lintResult.errorCount, 0);
|
|
1238
1254
|
}, "lintPackage");
|
|
1239
1255
|
var lintAll = /* @__PURE__ */ __name(async () => {
|
|
1240
|
-
const engine = new
|
|
1256
|
+
const engine = new ESLint2({
|
|
1241
1257
|
cache: true
|
|
1242
1258
|
});
|
|
1243
1259
|
const lintResults = await engine.lintFiles("./**/*.*");
|
|
@@ -1347,7 +1363,7 @@ var packageClean = /* @__PURE__ */ __name(async () => {
|
|
|
1347
1363
|
}, "packageClean");
|
|
1348
1364
|
|
|
1349
1365
|
// src/actions/package/compile/compile.ts
|
|
1350
|
-
import
|
|
1366
|
+
import chalk23 from "chalk";
|
|
1351
1367
|
|
|
1352
1368
|
// src/actions/package/publint.ts
|
|
1353
1369
|
import { promises as fs } from "node:fs";
|
|
@@ -1391,7 +1407,7 @@ var packagePublint = /* @__PURE__ */ __name(async (params) => {
|
|
|
1391
1407
|
}, "packagePublint");
|
|
1392
1408
|
|
|
1393
1409
|
// src/actions/package/compile/packageCompileTsc.ts
|
|
1394
|
-
import { cwd } from "node:process";
|
|
1410
|
+
import { cwd as cwd2 } from "node:process";
|
|
1395
1411
|
import chalk22 from "chalk";
|
|
1396
1412
|
import { createProgramFromConfig } from "tsc-prog";
|
|
1397
1413
|
import { DiagnosticCategory, formatDiagnosticsWithColorAndContext, getLineAndCharacterOfPosition, getPreEmitDiagnostics } from "typescript";
|
|
@@ -1423,7 +1439,7 @@ var getCompilerOptions = /* @__PURE__ */ __name((options, tsconfig = "tsconfig.j
|
|
|
1423
1439
|
|
|
1424
1440
|
// src/actions/package/compile/packageCompileTsc.ts
|
|
1425
1441
|
var packageCompileTsc = /* @__PURE__ */ __name(async (noEmit, config2, compilerOptionsParam) => {
|
|
1426
|
-
const pkg = process.env.INIT_CWD ??
|
|
1442
|
+
const pkg = process.env.INIT_CWD ?? cwd2();
|
|
1427
1443
|
const publint2 = config2?.publint ?? true;
|
|
1428
1444
|
const verbose = config2?.verbose ?? false;
|
|
1429
1445
|
const formatHost = {
|
|
@@ -1435,7 +1451,7 @@ var packageCompileTsc = /* @__PURE__ */ __name(async (noEmit, config2, compilerO
|
|
|
1435
1451
|
console.log(`Compiling with NoEmit TSC [${pkg}]`);
|
|
1436
1452
|
}
|
|
1437
1453
|
const compilerOptions = {
|
|
1438
|
-
...
|
|
1454
|
+
...getCompilerOptions({
|
|
1439
1455
|
outDir: "dist",
|
|
1440
1456
|
removeComments: true,
|
|
1441
1457
|
rootDir: "src"
|
|
@@ -1446,7 +1462,7 @@ var packageCompileTsc = /* @__PURE__ */ __name(async (noEmit, config2, compilerO
|
|
|
1446
1462
|
}
|
|
1447
1463
|
};
|
|
1448
1464
|
const program = createProgramFromConfig({
|
|
1449
|
-
basePath: pkg ??
|
|
1465
|
+
basePath: pkg ?? cwd2(),
|
|
1450
1466
|
compilerOptions,
|
|
1451
1467
|
exclude: [
|
|
1452
1468
|
"dist",
|
|
@@ -1474,7 +1490,6 @@ var packageCompileTsc = /* @__PURE__ */ __name(async (noEmit, config2, compilerO
|
|
|
1474
1490
|
}, "packageCompileTsc");
|
|
1475
1491
|
|
|
1476
1492
|
// src/actions/package/compile/packageCompileTsup.ts
|
|
1477
|
-
import merge3 from "lodash/merge.js";
|
|
1478
1493
|
import { build as build2, defineConfig } from "tsup";
|
|
1479
1494
|
|
|
1480
1495
|
// src/actions/package/compile/inputs.ts
|
|
@@ -1513,123 +1528,23 @@ var buildEntries = /* @__PURE__ */ __name((folder, entryMode, verbose = false) =
|
|
|
1513
1528
|
}
|
|
1514
1529
|
}, "buildEntries");
|
|
1515
1530
|
|
|
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
1531
|
// src/actions/package/compile/packageCompileTsup.ts
|
|
1614
|
-
var compileFolder = /* @__PURE__ */ __name(async (folder, entryMode = "single", options,
|
|
1532
|
+
var compileFolder = /* @__PURE__ */ __name(async (folder, entryMode = "single", options, _verbose) => {
|
|
1615
1533
|
const outDir = options?.outDir ?? "dist";
|
|
1616
1534
|
const entry = buildEntries(folder, entryMode);
|
|
1617
1535
|
const optionsResult = defineConfig({
|
|
1618
1536
|
bundle: true,
|
|
1619
1537
|
cjsInterop: true,
|
|
1620
1538
|
clean: true,
|
|
1621
|
-
dts:
|
|
1539
|
+
dts: true,
|
|
1622
1540
|
entry,
|
|
1623
1541
|
format: [
|
|
1624
|
-
"cjs",
|
|
1625
1542
|
"esm"
|
|
1626
1543
|
],
|
|
1627
|
-
// minify: true,
|
|
1628
1544
|
outDir,
|
|
1629
1545
|
silent: true,
|
|
1630
1546
|
sourcemap: true,
|
|
1631
1547
|
splitting: false,
|
|
1632
|
-
// terserOptions: { format: { comments: false } },
|
|
1633
1548
|
tsconfig: "tsconfig.json",
|
|
1634
1549
|
...options
|
|
1635
1550
|
});
|
|
@@ -1644,11 +1559,6 @@ var compileFolder = /* @__PURE__ */ __name(async (folder, entryMode = "single",
|
|
|
1644
1559
|
];
|
|
1645
1560
|
}))).flat();
|
|
1646
1561
|
await Promise.all(optionsList.map((options2) => build2(options2)));
|
|
1647
|
-
await packageCompileTscTypes(folder, {
|
|
1648
|
-
verbose
|
|
1649
|
-
}, {
|
|
1650
|
-
outDir
|
|
1651
|
-
});
|
|
1652
1562
|
return 0;
|
|
1653
1563
|
}, "compileFolder");
|
|
1654
1564
|
var packageCompileTsup = /* @__PURE__ */ __name(async (config2) => {
|
|
@@ -1667,172 +1577,76 @@ var packageCompileTsup = /* @__PURE__ */ __name(async (config2) => {
|
|
|
1667
1577
|
const compileForNeutral = compile2?.neutral ?? {
|
|
1668
1578
|
src: {}
|
|
1669
1579
|
};
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1580
|
+
const standardLoaders = {
|
|
1581
|
+
".gif": "copy",
|
|
1582
|
+
".html": "copy",
|
|
1583
|
+
".jpg": "copy",
|
|
1584
|
+
".json": "json",
|
|
1585
|
+
".png": "copy",
|
|
1586
|
+
".svg": "copy",
|
|
1587
|
+
".webp": "copy"
|
|
1588
|
+
};
|
|
1589
|
+
const standardOptions = {
|
|
1590
|
+
bundle: true,
|
|
1591
|
+
format: [
|
|
1592
|
+
"esm"
|
|
1593
|
+
],
|
|
1594
|
+
loader: standardLoaders,
|
|
1595
|
+
outExtension: /* @__PURE__ */ __name(({ format }) => format === "esm" ? {
|
|
1596
|
+
js: ".mjs"
|
|
1597
|
+
} : {
|
|
1598
|
+
js: ".cjs"
|
|
1599
|
+
}, "outExtension"),
|
|
1600
|
+
skipNodeModulesBundle: true,
|
|
1601
|
+
sourcemap: true,
|
|
1602
|
+
target: "esnext"
|
|
1603
|
+
};
|
|
1604
|
+
return (await Promise.all(Object.entries(compileForNode).map(async ([folder, options]) => {
|
|
1674
1605
|
const inEsBuildOptions = typeof compile2?.node?.esbuildOptions === "object" ? compile2?.node?.esbuildOptions : {};
|
|
1675
1606
|
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,
|
|
1607
|
+
...standardOptions,
|
|
1608
|
+
loader: {
|
|
1609
|
+
...standardOptions.loader,
|
|
1610
|
+
...inEsBuildOptions?.loader
|
|
1611
|
+
},
|
|
1691
1612
|
outDir: "dist/node",
|
|
1692
|
-
outExtension: /* @__PURE__ */ __name(({ format }) => format === "esm" ? {
|
|
1693
|
-
js: ".mjs"
|
|
1694
|
-
} : {
|
|
1695
|
-
js: ".cjs"
|
|
1696
|
-
}, "outExtension"),
|
|
1697
1613
|
platform: "node",
|
|
1698
|
-
skipNodeModulesBundle: true,
|
|
1699
|
-
sourcemap: true,
|
|
1700
|
-
target: "node16",
|
|
1701
|
-
// terserOptions: { format: { comments: false } },
|
|
1702
1614
|
...compile2?.tsup?.options,
|
|
1703
1615
|
...typeof options === "object" ? options : {}
|
|
1704
1616
|
}, verbose) : 0;
|
|
1705
1617
|
}))).reduce((prev, value) => prev + value, 0) || (await Promise.all(Object.entries(compileForBrowser).map(async ([folder, options]) => {
|
|
1706
1618
|
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;
|
|
1619
|
+
return folder ? await compileFolder(folder, compile2?.entryMode, {
|
|
1620
|
+
...standardOptions,
|
|
1621
|
+
loader: {
|
|
1622
|
+
...standardOptions.loader,
|
|
1623
|
+
...inEsBuildOptions?.loader
|
|
1624
|
+
},
|
|
1625
|
+
outDir: "dist/browser",
|
|
1626
|
+
platform: "browser",
|
|
1627
|
+
...compile2?.tsup?.options,
|
|
1628
|
+
...typeof options === "object" ? options : {}
|
|
1629
|
+
}, verbose) : 0;
|
|
1767
1630
|
}))).reduce((prev, value) => prev + value, 0) || (await Promise.all(Object.entries(compileForNeutral).map(async ([folder, options]) => {
|
|
1768
1631
|
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;
|
|
1632
|
+
return folder ? await compileFolder(folder, compile2?.entryMode, {
|
|
1633
|
+
...standardOptions,
|
|
1634
|
+
loader: {
|
|
1635
|
+
...standardOptions.loader,
|
|
1636
|
+
...inEsBuildOptions?.loader
|
|
1637
|
+
},
|
|
1638
|
+
outDir: "dist/neutral",
|
|
1639
|
+
platform: "neutral",
|
|
1640
|
+
...compile2?.tsup?.options,
|
|
1641
|
+
...typeof options === "object" ? options : {}
|
|
1642
|
+
}, verbose) : 0;
|
|
1829
1643
|
}))).reduce((prev, value) => prev + value, 0) || (publint2 ? await packagePublint() : 0);
|
|
1830
1644
|
}, "packageCompileTsup");
|
|
1831
1645
|
|
|
1832
1646
|
// src/actions/package/compile/compile.ts
|
|
1833
1647
|
var packageCompile = /* @__PURE__ */ __name(async (inConfig = {}) => {
|
|
1834
1648
|
const pkg = process.env.INIT_CWD;
|
|
1835
|
-
console.log(
|
|
1649
|
+
console.log(chalk23.green(`Compiling ${pkg}`));
|
|
1836
1650
|
const config2 = await loadConfig(inConfig);
|
|
1837
1651
|
const publint2 = config2.publint;
|
|
1838
1652
|
const mode = config2.compile?.mode ?? "tsup";
|
|
@@ -1852,7 +1666,7 @@ var packageCompile = /* @__PURE__ */ __name(async (inConfig = {}) => {
|
|
|
1852
1666
|
|
|
1853
1667
|
// src/actions/package/copy-assets.ts
|
|
1854
1668
|
import path5 from "node:path/posix";
|
|
1855
|
-
import
|
|
1669
|
+
import chalk24 from "chalk";
|
|
1856
1670
|
import cpy2 from "cpy";
|
|
1857
1671
|
var copyTargetAssets2 = /* @__PURE__ */ __name(async (target, name, location) => {
|
|
1858
1672
|
try {
|
|
@@ -1871,7 +1685,7 @@ var copyTargetAssets2 = /* @__PURE__ */ __name(async (target, name, location) =>
|
|
|
1871
1685
|
flat: false
|
|
1872
1686
|
});
|
|
1873
1687
|
if (values.length > 0) {
|
|
1874
|
-
console.log(
|
|
1688
|
+
console.log(chalk24.green(`Copying Assets [${target.toUpperCase()}] - ${name} - ${location}`));
|
|
1875
1689
|
}
|
|
1876
1690
|
for (const value of values) {
|
|
1877
1691
|
console.log(`${value.split("/").pop()} => ./dist/${target}`);
|
|
@@ -1902,7 +1716,7 @@ var packageCopyAssets = /* @__PURE__ */ __name(async ({ target }) => {
|
|
|
1902
1716
|
// src/actions/package/deps.ts
|
|
1903
1717
|
import { existsSync as existsSync5, readFileSync as readFileSync5 } from "node:fs";
|
|
1904
1718
|
import { cwd as cwd3 } from "node:process";
|
|
1905
|
-
import
|
|
1719
|
+
import chalk25 from "chalk";
|
|
1906
1720
|
import depcheck from "depcheck";
|
|
1907
1721
|
var special = depcheck.special;
|
|
1908
1722
|
var defaultIgnorePatterns = [
|
|
@@ -1929,21 +1743,21 @@ var defaultIgnoreDevPatterns = [
|
|
|
1929
1743
|
var reportUnused = /* @__PURE__ */ __name((name, unused) => {
|
|
1930
1744
|
if (unused.length > 0) {
|
|
1931
1745
|
const message = [
|
|
1932
|
-
|
|
1746
|
+
chalk25.yellow(`${unused.length} Unused ${name}`)
|
|
1933
1747
|
];
|
|
1934
|
-
for (const value of unused) message.push(
|
|
1748
|
+
for (const value of unused) message.push(chalk25.gray(` ${value}`));
|
|
1935
1749
|
console.log(message.join("\n"));
|
|
1936
1750
|
}
|
|
1937
1751
|
}, "reportUnused");
|
|
1938
1752
|
var reportMissing = /* @__PURE__ */ __name((name, missing) => {
|
|
1939
1753
|
if (Object.keys(missing).length > 0) {
|
|
1940
1754
|
const message = [
|
|
1941
|
-
|
|
1755
|
+
chalk25.yellow(`${Object.entries(missing).length} Missing ${name}`)
|
|
1942
1756
|
];
|
|
1943
1757
|
for (const [key, value] of Object.entries(missing)) {
|
|
1944
|
-
message.push(`${key}`,
|
|
1758
|
+
message.push(`${key}`, chalk25.gray(` ${value.at(0)}`));
|
|
1945
1759
|
}
|
|
1946
|
-
console.log(
|
|
1760
|
+
console.log(chalk25.yellow(message.join("\n")));
|
|
1947
1761
|
}
|
|
1948
1762
|
}, "reportMissing");
|
|
1949
1763
|
var analyzeDeps = /* @__PURE__ */ __name(async (pkg, ignoreMatches) => {
|
|
@@ -2048,10 +1862,10 @@ var packageDeps = /* @__PURE__ */ __name(async () => {
|
|
|
2048
1862
|
reportUnused("dependencies", unusedDeps);
|
|
2049
1863
|
reportUnused("devDependencies", unusedDevDeps);
|
|
2050
1864
|
if (Object.entries(invalidDirs).length > 0) {
|
|
2051
|
-
for (const [key, value] of Object.entries(invalidDirs)) console.warn(
|
|
1865
|
+
for (const [key, value] of Object.entries(invalidDirs)) console.warn(chalk25.gray(`Invalid Dir: ${key}: ${value}`));
|
|
2052
1866
|
}
|
|
2053
1867
|
if (Object.entries(invalidFiles).length > 0) {
|
|
2054
|
-
for (const [key, value] of Object.entries(invalidFiles)) console.warn(
|
|
1868
|
+
for (const [key, value] of Object.entries(invalidFiles)) console.warn(chalk25.gray(`Invalid File: ${key}: ${value}`));
|
|
2055
1869
|
}
|
|
2056
1870
|
reportMissing("dependencies", missingDepsObject);
|
|
2057
1871
|
reportMissing("devDependencies", missingDevDepsObject);
|
|
@@ -2062,7 +1876,7 @@ var packageDeps = /* @__PURE__ */ __name(async () => {
|
|
|
2062
1876
|
// src/actions/package/gen-docs.ts
|
|
2063
1877
|
import { existsSync as existsSync6 } from "node:fs";
|
|
2064
1878
|
import path6 from "node:path";
|
|
2065
|
-
import
|
|
1879
|
+
import chalk26 from "chalk";
|
|
2066
1880
|
import { Application, ArgumentsReader, TSConfigReader, TypeDocReader } from "typedoc";
|
|
2067
1881
|
var ExitCodes = {
|
|
2068
1882
|
CompileError: 3,
|
|
@@ -2164,16 +1978,13 @@ var runTypeDoc = /* @__PURE__ */ __name(async (app) => {
|
|
|
2164
1978
|
return ExitCodes.OutputError;
|
|
2165
1979
|
}
|
|
2166
1980
|
}
|
|
2167
|
-
console.log(
|
|
1981
|
+
console.log(chalk26.green(`${pkgName} - Ok`));
|
|
2168
1982
|
return ExitCodes.Ok;
|
|
2169
1983
|
}, "runTypeDoc");
|
|
2170
1984
|
|
|
2171
1985
|
// src/actions/package/recompile.ts
|
|
2172
1986
|
var packageRecompile = /* @__PURE__ */ __name(async () => {
|
|
2173
|
-
return (await
|
|
2174
|
-
packageClean(),
|
|
2175
|
-
packageCompile()
|
|
2176
|
-
])).reduce((prev, value) => prev + value, 0);
|
|
1987
|
+
return await packageClean() || await packageCompile();
|
|
2177
1988
|
}, "packageRecompile");
|
|
2178
1989
|
|
|
2179
1990
|
// src/actions/publint.ts
|
|
@@ -2234,7 +2045,7 @@ var rebuild = /* @__PURE__ */ __name(({ target }) => {
|
|
|
2234
2045
|
}, "rebuild");
|
|
2235
2046
|
|
|
2236
2047
|
// src/actions/recompile.ts
|
|
2237
|
-
import
|
|
2048
|
+
import chalk27 from "chalk";
|
|
2238
2049
|
var recompile = /* @__PURE__ */ __name(async ({ verbose, target, pkg, incremental }) => {
|
|
2239
2050
|
return pkg ? await recompilePackage({
|
|
2240
2051
|
pkg,
|
|
@@ -2295,7 +2106,7 @@ var recompileAll = /* @__PURE__ */ __name(async ({ jobs, verbose, target, increm
|
|
|
2295
2106
|
`${jobs}`
|
|
2296
2107
|
] : [];
|
|
2297
2108
|
if (jobs) {
|
|
2298
|
-
console.log(
|
|
2109
|
+
console.log(chalk27.blue(`Jobs set to [${jobs}]`));
|
|
2299
2110
|
}
|
|
2300
2111
|
const result = await runStepsAsync(`Recompile${incremental ? "-Incremental" : ""} [All]`, [
|
|
2301
2112
|
[
|
|
@@ -2307,12 +2118,25 @@ var recompileAll = /* @__PURE__ */ __name(async ({ jobs, verbose, target, increm
|
|
|
2307
2118
|
...jobsOptions,
|
|
2308
2119
|
...verboseOptions,
|
|
2309
2120
|
"run",
|
|
2310
|
-
"package-
|
|
2121
|
+
"package-clean",
|
|
2122
|
+
...targetOptions
|
|
2123
|
+
]
|
|
2124
|
+
],
|
|
2125
|
+
[
|
|
2126
|
+
"yarn",
|
|
2127
|
+
[
|
|
2128
|
+
"workspaces",
|
|
2129
|
+
"foreach",
|
|
2130
|
+
...incrementalOptions,
|
|
2131
|
+
...jobsOptions,
|
|
2132
|
+
...verboseOptions,
|
|
2133
|
+
"run",
|
|
2134
|
+
"package-compile",
|
|
2311
2135
|
...targetOptions
|
|
2312
2136
|
]
|
|
2313
2137
|
]
|
|
2314
2138
|
]);
|
|
2315
|
-
console.log(`${
|
|
2139
|
+
console.log(`${chalk27.gray("Recompiled in")} [${chalk27.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk27.gray("seconds")}`);
|
|
2316
2140
|
return result;
|
|
2317
2141
|
}, "recompileAll");
|
|
2318
2142
|
|
|
@@ -2412,7 +2236,7 @@ var sonar = /* @__PURE__ */ __name(() => {
|
|
|
2412
2236
|
}, "sonar");
|
|
2413
2237
|
|
|
2414
2238
|
// src/actions/statics.ts
|
|
2415
|
-
import
|
|
2239
|
+
import chalk28 from "chalk";
|
|
2416
2240
|
var DefaultDependencies = [
|
|
2417
2241
|
"axios",
|
|
2418
2242
|
"@xylabs/pixel",
|
|
@@ -2423,7 +2247,7 @@ var DefaultDependencies = [
|
|
|
2423
2247
|
"@mui/system"
|
|
2424
2248
|
];
|
|
2425
2249
|
var statics = /* @__PURE__ */ __name(() => {
|
|
2426
|
-
console.log(
|
|
2250
|
+
console.log(chalk28.green("Check Required Static Dependencies"));
|
|
2427
2251
|
const statics2 = parsedPackageJSON()?.xy?.deps?.statics;
|
|
2428
2252
|
return detectDuplicateDependencies(statics2, DefaultDependencies);
|
|
2429
2253
|
}, "statics");
|
|
@@ -2541,7 +2365,7 @@ var loadPackageConfig = /* @__PURE__ */ __name(async () => {
|
|
|
2541
2365
|
}, "loadPackageConfig");
|
|
2542
2366
|
|
|
2543
2367
|
// src/xy/xy.ts
|
|
2544
|
-
import
|
|
2368
|
+
import chalk30 from "chalk";
|
|
2545
2369
|
|
|
2546
2370
|
// src/xy/xyBuildCommands.ts
|
|
2547
2371
|
var xyBuildCommands = /* @__PURE__ */ __name((args) => {
|
|
@@ -2777,15 +2601,15 @@ var xyInstallCommands = /* @__PURE__ */ __name((args) => {
|
|
|
2777
2601
|
}, "xyInstallCommands");
|
|
2778
2602
|
|
|
2779
2603
|
// src/xy/xyLintCommands.ts
|
|
2780
|
-
import
|
|
2604
|
+
import chalk29 from "chalk";
|
|
2781
2605
|
var xyLintCommands = /* @__PURE__ */ __name((args) => {
|
|
2782
2606
|
return args.command("cycle [package]", "Cycle - Check for dependency cycles", (yargs2) => {
|
|
2783
2607
|
return packagePositionalParam(yargs2);
|
|
2784
|
-
}, (argv) => {
|
|
2608
|
+
}, async (argv) => {
|
|
2785
2609
|
const start = Date.now();
|
|
2786
2610
|
if (argv.verbose) console.log("Cycle");
|
|
2787
|
-
process.exitCode = cycle();
|
|
2788
|
-
console.log(
|
|
2611
|
+
process.exitCode = await cycle();
|
|
2612
|
+
console.log(chalk29.blue(`Finished in ${Date.now() - start}ms`));
|
|
2789
2613
|
}).command("lint [package]", "Lint - Run Eslint", (yargs2) => {
|
|
2790
2614
|
return packagePositionalParam(yargs2);
|
|
2791
2615
|
}, async (argv) => {
|
|
@@ -2794,21 +2618,21 @@ var xyLintCommands = /* @__PURE__ */ __name((args) => {
|
|
|
2794
2618
|
process.exitCode = argv.fix ? fix() : argv.profile ? lintProfile() : await lint({
|
|
2795
2619
|
pkg: argv.package
|
|
2796
2620
|
});
|
|
2797
|
-
console.log(
|
|
2621
|
+
console.log(chalk29.blue(`Finished in ${Date.now() - start}ms`));
|
|
2798
2622
|
}).command("fix [package]", "Fix - Run Eslint w/fix", (yargs2) => {
|
|
2799
2623
|
return packagePositionalParam(yargs2);
|
|
2800
2624
|
}, (argv) => {
|
|
2801
2625
|
const start = Date.now();
|
|
2802
2626
|
if (argv.verbose) console.log("Fix");
|
|
2803
2627
|
process.exitCode = fix();
|
|
2804
|
-
console.log(
|
|
2628
|
+
console.log(chalk29.blue(`Finished in ${Date.now() - start}ms`));
|
|
2805
2629
|
}).command("relint [package]", "Relint - Clean & Lint", (yargs2) => {
|
|
2806
2630
|
return packagePositionalParam(yargs2);
|
|
2807
2631
|
}, (argv) => {
|
|
2808
2632
|
if (argv.verbose) console.log("Relinting");
|
|
2809
2633
|
const start = Date.now();
|
|
2810
2634
|
process.exitCode = relint();
|
|
2811
|
-
console.log(
|
|
2635
|
+
console.log(chalk29.blue(`Finished in ${Date.now() - start}ms`));
|
|
2812
2636
|
}).command("publint [package]", "Publint - Run Publint", (yargs2) => {
|
|
2813
2637
|
return packagePositionalParam(yargs2);
|
|
2814
2638
|
}, async (argv) => {
|
|
@@ -2818,14 +2642,14 @@ var xyLintCommands = /* @__PURE__ */ __name((args) => {
|
|
|
2818
2642
|
pkg: argv.package,
|
|
2819
2643
|
verbose: !!argv.verbose
|
|
2820
2644
|
});
|
|
2821
|
-
console.log(
|
|
2645
|
+
console.log(chalk29.blue(`Finished in ${Date.now() - start}ms`));
|
|
2822
2646
|
}).command("sonar", "Sonar - Run Sonar Check", (yargs2) => {
|
|
2823
2647
|
return packagePositionalParam(yargs2);
|
|
2824
2648
|
}, (argv) => {
|
|
2825
2649
|
const start = Date.now();
|
|
2826
2650
|
if (argv.verbose) console.log("Sonar Check");
|
|
2827
2651
|
process.exitCode = sonar();
|
|
2828
|
-
console.log(
|
|
2652
|
+
console.log(chalk29.blue(`Finished in ${Date.now() - start}ms`));
|
|
2829
2653
|
});
|
|
2830
2654
|
}, "xyLintCommands");
|
|
2831
2655
|
|
|
@@ -2878,8 +2702,8 @@ var xyParseOptions = /* @__PURE__ */ __name(() => {
|
|
|
2878
2702
|
var xy = /* @__PURE__ */ __name(async () => {
|
|
2879
2703
|
const options = xyParseOptions();
|
|
2880
2704
|
return await xyBuildCommands(xyCommonCommands(xyInstallCommands(xyDeployCommands(xyLintCommands(options))))).demandCommand(1).command("*", "", () => {
|
|
2881
|
-
console.error(
|
|
2882
|
-
console.log(
|
|
2705
|
+
console.error(chalk30.yellow(`Command not found [${chalk30.magenta(process.argv[2])}]`));
|
|
2706
|
+
console.log(chalk30.gray("Try 'yarn xy --help' for list of commands"));
|
|
2883
2707
|
}).version().help().argv;
|
|
2884
2708
|
}, "xy");
|
|
2885
2709
|
export {
|