@xylabs/ts-scripts-yarn3 3.15.16 → 4.0.0-rc.4
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/index.mjs +55 -186
- package/dist/actions/index.mjs.map +1 -1
- package/dist/actions/package/compile/compile.mjs +55 -186
- package/dist/actions/package/compile/compile.mjs.map +1 -1
- package/dist/actions/package/compile/index.mjs +55 -186
- 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 +55 -186
- package/dist/actions/package/compile/packageCompileTsup.mjs.map +1 -1
- package/dist/actions/package/index.mjs +55 -186
- package/dist/actions/package/index.mjs.map +1 -1
- package/dist/actions/package/recompile.mjs +55 -186
- package/dist/actions/package/recompile.mjs.map +1 -1
- package/dist/bin/package/compile-only.mjs +55 -186
- package/dist/bin/package/compile-only.mjs.map +1 -1
- package/dist/bin/package/compile-tsup.mjs +55 -186
- package/dist/bin/package/compile-tsup.mjs.map +1 -1
- package/dist/bin/package/compile.mjs +55 -186
- package/dist/bin/package/compile.mjs.map +1 -1
- package/dist/bin/package/recompile.mjs +55 -186
- package/dist/bin/package/recompile.mjs.map +1 -1
- package/dist/index.mjs +55 -186
- package/dist/index.mjs.map +1 -1
- package/package.json +9 -19
- 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 +51 -121
- 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/package.json
CHANGED
|
@@ -60,13 +60,11 @@
|
|
|
60
60
|
"@rollup/plugin-commonjs": "^26.0.1",
|
|
61
61
|
"@rollup/plugin-json": "^6.1.0",
|
|
62
62
|
"@rollup/plugin-typescript": "^11.1.6",
|
|
63
|
-
"@swc/core": "^1.7.
|
|
63
|
+
"@swc/core": "^1.7.6",
|
|
64
64
|
"@types/node": "^22.1.0",
|
|
65
65
|
"@types/yargs": "^17.0.32",
|
|
66
|
-
"@
|
|
67
|
-
"@
|
|
68
|
-
"@xylabs/tsconfig": "^3.15.16",
|
|
69
|
-
"@xylabs/tsconfig-dom": "^3.15.16",
|
|
66
|
+
"@xylabs/tsconfig": "^4.0.0-rc.4",
|
|
67
|
+
"@xylabs/tsconfig-dom": "^4.0.0-rc.4",
|
|
70
68
|
"async-mutex": "^0.5.0",
|
|
71
69
|
"chalk": "^5.3.0",
|
|
72
70
|
"cosmiconfig": "^9.0.0",
|
|
@@ -74,9 +72,6 @@
|
|
|
74
72
|
"cpy": "^11.1.0",
|
|
75
73
|
"depcheck": "^1.4.7",
|
|
76
74
|
"eslint": "^9.8.0",
|
|
77
|
-
"eslint-config-prettier": "^9.1.0",
|
|
78
|
-
"eslint-plugin-prettier": "^5.2.1",
|
|
79
|
-
"eslint-plugin-sonarjs": "^1.0.4",
|
|
80
75
|
"glob": "^11.0.0",
|
|
81
76
|
"jest": "^29.7.0",
|
|
82
77
|
"jest-extended": "^4.0.2",
|
|
@@ -86,7 +81,7 @@
|
|
|
86
81
|
"license-checker": "^25.0.1",
|
|
87
82
|
"lodash": "^4.17.21",
|
|
88
83
|
"node-cmd": "^5.0.0",
|
|
89
|
-
"npm-check-updates": "^17.0.
|
|
84
|
+
"npm-check-updates": "^17.0.3",
|
|
90
85
|
"npm-package-json-lint": "^8.0.0",
|
|
91
86
|
"npm-package-json-lint-config-default": "^7.0.1",
|
|
92
87
|
"parse-git-config": "^3.0.0",
|
|
@@ -94,7 +89,7 @@
|
|
|
94
89
|
"publint": "^0.2.9",
|
|
95
90
|
"reflect-metadata": "^0.2.2",
|
|
96
91
|
"rimraf": "^6.0.1",
|
|
97
|
-
"rollup": "^4.
|
|
92
|
+
"rollup": "^4.20.0",
|
|
98
93
|
"rollup-plugin-exclude-dependencies-from-bundle": "^1.1.23",
|
|
99
94
|
"rollup-plugin-node-externals": "^7.1.2",
|
|
100
95
|
"supertest": "^7.0.0",
|
|
@@ -114,8 +109,7 @@
|
|
|
114
109
|
"@types/license-checker": "^25.0.6",
|
|
115
110
|
"@types/lodash": "^4.17.7",
|
|
116
111
|
"@types/parse-git-config": "^3.0.4",
|
|
117
|
-
"@xylabs/
|
|
118
|
-
"@xylabs/tsconfig": "^3.15.16",
|
|
112
|
+
"@xylabs/tsconfig": "^4.0.0-rc.4",
|
|
119
113
|
"publint": "^0.2.9",
|
|
120
114
|
"typescript": "^5.5.4"
|
|
121
115
|
},
|
|
@@ -134,10 +128,6 @@
|
|
|
134
128
|
},
|
|
135
129
|
"exports": {
|
|
136
130
|
".": {
|
|
137
|
-
"require": {
|
|
138
|
-
"types": "./dist/index.d.cts",
|
|
139
|
-
"default": "./dist/index.cjs"
|
|
140
|
-
},
|
|
141
131
|
"import": {
|
|
142
132
|
"types": "./dist/index.d.ts",
|
|
143
133
|
"default": "./dist/index.mjs"
|
|
@@ -145,7 +135,6 @@
|
|
|
145
135
|
},
|
|
146
136
|
"./package.json": "./package.json"
|
|
147
137
|
},
|
|
148
|
-
"main": "dist/index.cjs",
|
|
149
138
|
"module": "dist/index.mjs",
|
|
150
139
|
"types": "dist/index.d.ts",
|
|
151
140
|
"repository": {
|
|
@@ -162,6 +151,7 @@
|
|
|
162
151
|
"package-clean": "echo Not cleaning..."
|
|
163
152
|
},
|
|
164
153
|
"sideEffects": false,
|
|
165
|
-
"version": "
|
|
166
|
-
"type": "module"
|
|
154
|
+
"version": "4.0.0-rc.4",
|
|
155
|
+
"type": "module",
|
|
156
|
+
"stableVersion": "3.15.16"
|
|
167
157
|
}
|
|
@@ -21,13 +21,13 @@ export interface PathConfig {
|
|
|
21
21
|
/**
|
|
22
22
|
* Configuration for Dynamic Share.
|
|
23
23
|
*/
|
|
24
|
-
|
|
24
|
+
|
|
25
25
|
export interface DynamicShareConfig extends PathConfig {}
|
|
26
26
|
|
|
27
27
|
/**
|
|
28
28
|
* Configuration for Live Share.
|
|
29
29
|
*/
|
|
30
|
-
|
|
30
|
+
|
|
31
31
|
export interface LiveShareConfig extends PathConfig {}
|
|
32
32
|
|
|
33
33
|
export interface CompileConfig {
|
|
@@ -5,16 +5,14 @@ import { createProgramFromConfig, TsConfigCompilerOptions } from 'tsc-prog'
|
|
|
5
5
|
import { CompilerOptions, DiagnosticCategory } from 'typescript'
|
|
6
6
|
|
|
7
7
|
import { buildEntries } from './buildEntries.ts'
|
|
8
|
-
import { copyTypeFiles } from './copyTypeFiles.ts'
|
|
9
8
|
import { getCompilerOptions } from './getCompilerOptions.ts'
|
|
10
9
|
import { XyConfig } from './XyConfig.ts'
|
|
11
10
|
|
|
12
|
-
export const packageCompileTscTypes =
|
|
11
|
+
export const packageCompileTscTypes = (
|
|
13
12
|
folder: string = 'src',
|
|
14
13
|
{ verbose }: XyConfig = {},
|
|
15
14
|
compilerOptionsParam?: CompilerOptions,
|
|
16
|
-
|
|
17
|
-
): Promise<number> => {
|
|
15
|
+
): number => {
|
|
18
16
|
const pkg = process.env.INIT_CWD ?? cwd()
|
|
19
17
|
|
|
20
18
|
if (verbose) {
|
|
@@ -22,7 +20,7 @@ export const packageCompileTscTypes = async (
|
|
|
22
20
|
}
|
|
23
21
|
|
|
24
22
|
const compilerOptions = {
|
|
25
|
-
...(
|
|
23
|
+
...(getCompilerOptions({
|
|
26
24
|
declaration: true,
|
|
27
25
|
emitDeclarationOnly: true,
|
|
28
26
|
outDir: 'dist',
|
|
@@ -67,8 +65,5 @@ export const packageCompileTscTypes = async (
|
|
|
67
65
|
}
|
|
68
66
|
}
|
|
69
67
|
}
|
|
70
|
-
if (generateMts) {
|
|
71
|
-
await copyTypeFiles(compilerOptions)
|
|
72
|
-
}
|
|
73
68
|
return diagResults
|
|
74
69
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import merge from 'lodash/merge.js'
|
|
1
|
+
import type { Loader } from 'esbuild'
|
|
3
2
|
import { build, defineConfig, Options } from 'tsup'
|
|
4
3
|
|
|
5
4
|
import { packagePublint } from '../publint.ts'
|
|
@@ -17,7 +16,7 @@ const compileFolder = async (folder: string, entryMode: EntryMode = 'single', op
|
|
|
17
16
|
clean: true,
|
|
18
17
|
dts: false,
|
|
19
18
|
entry,
|
|
20
|
-
format: ['
|
|
19
|
+
format: ['esm'],
|
|
21
20
|
// minify: true,
|
|
22
21
|
outDir,
|
|
23
22
|
silent: true,
|
|
@@ -37,7 +36,7 @@ const compileFolder = async (folder: string, entryMode: EntryMode = 'single', op
|
|
|
37
36
|
).flat()
|
|
38
37
|
|
|
39
38
|
await Promise.all(optionsList.map(options => build(options)))
|
|
40
|
-
|
|
39
|
+
packageCompileTscTypes(folder, { verbose }, { outDir })
|
|
41
40
|
|
|
42
41
|
return 0
|
|
43
42
|
}
|
|
@@ -55,6 +54,17 @@ export const packageCompileTsup = async (config?: XyTsupConfig) => {
|
|
|
55
54
|
const compileForBrowser = compile?.browser ?? { src: {} }
|
|
56
55
|
const compileForNeutral = compile?.neutral ?? { src: {} }
|
|
57
56
|
|
|
57
|
+
const standardLoaders: Record<string, Loader> = { '.gif': 'copy', '.html': 'copy', '.jpg': 'copy', '.json': 'json', '.png': 'copy', '.svg': 'copy', '.webp': 'copy' }
|
|
58
|
+
const standardOptions: Options = {
|
|
59
|
+
bundle: true,
|
|
60
|
+
format: ['esm'],
|
|
61
|
+
loader: standardLoaders,
|
|
62
|
+
outExtension: ({ format }) => (format === 'esm' ? { js: '.mjs' } : { js: '.cjs' }),
|
|
63
|
+
skipNodeModulesBundle: true,
|
|
64
|
+
sourcemap: true,
|
|
65
|
+
target: 'esnext',
|
|
66
|
+
}
|
|
67
|
+
|
|
58
68
|
return (
|
|
59
69
|
(await packageCompileTsc(true, { publint: false, verbose }))
|
|
60
70
|
|| (
|
|
@@ -66,21 +76,13 @@ export const packageCompileTsup = async (config?: XyTsupConfig) => {
|
|
|
66
76
|
folder,
|
|
67
77
|
compile?.entryMode,
|
|
68
78
|
{
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
inEsBuildOptions?.loader,
|
|
75
|
-
),
|
|
76
|
-
// minify: true,
|
|
79
|
+
...standardOptions,
|
|
80
|
+
loader: {
|
|
81
|
+
...standardOptions.loader,
|
|
82
|
+
...inEsBuildOptions?.loader,
|
|
83
|
+
},
|
|
77
84
|
outDir: 'dist/node',
|
|
78
|
-
outExtension: ({ format }) => (format === 'esm' ? { js: '.mjs' } : { js: '.cjs' }),
|
|
79
85
|
platform: 'node',
|
|
80
|
-
skipNodeModulesBundle: true,
|
|
81
|
-
sourcemap: true,
|
|
82
|
-
target: 'node16',
|
|
83
|
-
// terserOptions: { format: { comments: false } },
|
|
84
86
|
...compile?.tsup?.options,
|
|
85
87
|
...(typeof options === 'object' ? options : {}),
|
|
86
88
|
},
|
|
@@ -95,58 +97,22 @@ export const packageCompileTsup = async (config?: XyTsupConfig) => {
|
|
|
95
97
|
Object.entries(compileForBrowser).map(async ([folder, options]) => {
|
|
96
98
|
const inEsBuildOptions = typeof compile?.browser?.esbuildOptions === 'object' ? compile?.browser?.esbuildOptions : {}
|
|
97
99
|
return folder
|
|
98
|
-
? (
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
platform: 'browser',
|
|
115
|
-
skipNodeModulesBundle: true,
|
|
116
|
-
sourcemap: true,
|
|
117
|
-
target: 'esnext',
|
|
118
|
-
// terserOptions: { format: { comments: false } },
|
|
119
|
-
...compile?.tsup?.options,
|
|
120
|
-
...(typeof options === 'object' ? options : {}),
|
|
121
|
-
},
|
|
122
|
-
verbose,
|
|
123
|
-
),
|
|
124
|
-
compileFolder(
|
|
125
|
-
folder,
|
|
126
|
-
compile?.entryMode,
|
|
127
|
-
{
|
|
128
|
-
bundle: true,
|
|
129
|
-
format: ['esm'],
|
|
130
|
-
loader: merge(
|
|
131
|
-
{},
|
|
132
|
-
{ '.gif': 'copy', '.html': 'copy', '.jpg': 'copy', '.json': 'json', '.png': 'copy', '.svg': 'copy', '.webp': 'copy' },
|
|
133
|
-
inEsBuildOptions?.loader,
|
|
134
|
-
),
|
|
135
|
-
// minify: true,
|
|
136
|
-
outDir: 'dist/browser',
|
|
137
|
-
outExtension: ({ format }) => (format === 'esm' ? { js: '.mjs' } : { js: '.cjs' }),
|
|
138
|
-
platform: 'browser',
|
|
139
|
-
skipNodeModulesBundle: true,
|
|
140
|
-
sourcemap: true,
|
|
141
|
-
target: 'esnext',
|
|
142
|
-
// terserOptions: { format: { comments: false } },
|
|
143
|
-
...compile?.tsup?.options,
|
|
144
|
-
...(typeof options === 'object' ? options : {}),
|
|
145
|
-
},
|
|
146
|
-
verbose,
|
|
147
|
-
),
|
|
148
|
-
])
|
|
149
|
-
).reduce((prev, value) => prev + value, 0)
|
|
100
|
+
? await compileFolder(
|
|
101
|
+
folder,
|
|
102
|
+
compile?.entryMode,
|
|
103
|
+
{
|
|
104
|
+
...standardOptions,
|
|
105
|
+
loader: {
|
|
106
|
+
...standardOptions.loader,
|
|
107
|
+
...inEsBuildOptions?.loader,
|
|
108
|
+
},
|
|
109
|
+
outDir: 'dist/browser',
|
|
110
|
+
platform: 'browser',
|
|
111
|
+
...compile?.tsup?.options,
|
|
112
|
+
...(typeof options === 'object' ? options : {}),
|
|
113
|
+
},
|
|
114
|
+
verbose,
|
|
115
|
+
)
|
|
150
116
|
: 0
|
|
151
117
|
}),
|
|
152
118
|
)
|
|
@@ -156,58 +122,22 @@ export const packageCompileTsup = async (config?: XyTsupConfig) => {
|
|
|
156
122
|
Object.entries(compileForNeutral).map(async ([folder, options]) => {
|
|
157
123
|
const inEsBuildOptions = typeof compile?.neutral?.esbuildOptions === 'object' ? compile?.neutral?.esbuildOptions : {}
|
|
158
124
|
return folder
|
|
159
|
-
? (
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
platform: 'neutral',
|
|
176
|
-
skipNodeModulesBundle: true,
|
|
177
|
-
sourcemap: true,
|
|
178
|
-
target: 'esnext',
|
|
179
|
-
// terserOptions: { format: { comments: false } },
|
|
180
|
-
...compile?.tsup?.options,
|
|
181
|
-
...(typeof options === 'object' ? options : {}),
|
|
182
|
-
},
|
|
183
|
-
verbose,
|
|
184
|
-
),
|
|
185
|
-
compileFolder(
|
|
186
|
-
folder,
|
|
187
|
-
compile?.entryMode,
|
|
188
|
-
{
|
|
189
|
-
bundle: true,
|
|
190
|
-
format: ['esm'],
|
|
191
|
-
loader: merge(
|
|
192
|
-
{},
|
|
193
|
-
{ '.gif': 'copy', '.html': 'copy', '.jpg': 'copy', '.json': 'json', '.png': 'copy', '.svg': 'copy', '.webp': 'copy' },
|
|
194
|
-
inEsBuildOptions?.loader,
|
|
195
|
-
),
|
|
196
|
-
// minify: true,
|
|
197
|
-
outDir: 'dist/neutral',
|
|
198
|
-
outExtension: ({ format }) => (format === 'esm' ? { js: '.mjs' } : { js: '.cjs' }),
|
|
199
|
-
platform: 'neutral',
|
|
200
|
-
skipNodeModulesBundle: true,
|
|
201
|
-
sourcemap: true,
|
|
202
|
-
target: 'esnext',
|
|
203
|
-
// terserOptions: { format: { comments: false } },
|
|
204
|
-
...compile?.tsup?.options,
|
|
205
|
-
...(typeof options === 'object' ? options : {}),
|
|
206
|
-
},
|
|
207
|
-
verbose,
|
|
208
|
-
),
|
|
209
|
-
])
|
|
210
|
-
).reduce((prev, value) => prev + value, 0)
|
|
125
|
+
? await compileFolder(
|
|
126
|
+
folder,
|
|
127
|
+
compile?.entryMode,
|
|
128
|
+
{
|
|
129
|
+
...standardOptions,
|
|
130
|
+
loader: {
|
|
131
|
+
...standardOptions.loader,
|
|
132
|
+
...inEsBuildOptions?.loader,
|
|
133
|
+
},
|
|
134
|
+
outDir: 'dist/neutral',
|
|
135
|
+
platform: 'neutral',
|
|
136
|
+
...compile?.tsup?.options,
|
|
137
|
+
...(typeof options === 'object' ? options : {}),
|
|
138
|
+
},
|
|
139
|
+
verbose,
|
|
140
|
+
)
|
|
211
141
|
: 0
|
|
212
142
|
}),
|
|
213
143
|
)
|
package/tsup.config.ts
CHANGED
package/dist/actions/build.cjs
DELETED
|
@@ -1,208 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
9
|
-
var __export = (target, all) => {
|
|
10
|
-
for (var name in all)
|
|
11
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
12
|
-
};
|
|
13
|
-
var __copyProps = (to, from, except, desc) => {
|
|
14
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
-
for (let key of __getOwnPropNames(from))
|
|
16
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
17
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
18
|
-
}
|
|
19
|
-
return to;
|
|
20
|
-
};
|
|
21
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
-
mod
|
|
28
|
-
));
|
|
29
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
|
-
|
|
31
|
-
// src/actions/build.ts
|
|
32
|
-
var build_exports = {};
|
|
33
|
-
__export(build_exports, {
|
|
34
|
-
build: () => build
|
|
35
|
-
});
|
|
36
|
-
module.exports = __toCommonJS(build_exports);
|
|
37
|
-
var import_chalk4 = __toESM(require("chalk"), 1);
|
|
38
|
-
|
|
39
|
-
// src/lib/checkResult.ts
|
|
40
|
-
var import_chalk = __toESM(require("chalk"), 1);
|
|
41
|
-
var checkResult = /* @__PURE__ */ __name((name, result, level = "error", exitOnFail = false) => {
|
|
42
|
-
if (result) {
|
|
43
|
-
const exiting = exitOnFail ? "[Exiting Process]" : "[Continuing]";
|
|
44
|
-
const chalkFunc = level === "error" ? import_chalk.default.red : import_chalk.default.yellow;
|
|
45
|
-
console[level](chalkFunc(`${name} had ${result} failures ${exiting}`));
|
|
46
|
-
if (exitOnFail) {
|
|
47
|
-
process.exit(result);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}, "checkResult");
|
|
51
|
-
|
|
52
|
-
// src/lib/processEx.ts
|
|
53
|
-
var import_chalk2 = __toESM(require("chalk"), 1);
|
|
54
|
-
|
|
55
|
-
// src/lib/withError.ts
|
|
56
|
-
var withError = /* @__PURE__ */ __name((ex, closure, predicate = (ex2) => ex2.name !== void 0 && ex2.message !== void 0) => {
|
|
57
|
-
return predicate(ex) ? closure(ex) : void 0;
|
|
58
|
-
}, "withError");
|
|
59
|
-
|
|
60
|
-
// src/lib/withErrnoException.ts
|
|
61
|
-
var withErrnoException = /* @__PURE__ */ __name((ex, closure) => {
|
|
62
|
-
return withError(ex, closure, (ex2) => ex2.errno !== void 0);
|
|
63
|
-
}, "withErrnoException");
|
|
64
|
-
|
|
65
|
-
// src/lib/processEx.ts
|
|
66
|
-
var processEx = /* @__PURE__ */ __name((ex) => {
|
|
67
|
-
const error = typeof ex === "string" ? new Error(ex) : ex;
|
|
68
|
-
const exitCode = withErrnoException(error, (error2) => {
|
|
69
|
-
if (error2.code === "ENOENT") {
|
|
70
|
-
console.error(import_chalk2.default.red(`'${error2.path}' not found.`));
|
|
71
|
-
} else {
|
|
72
|
-
console.error(import_chalk2.default.red(`Errno: ${error2.code}`));
|
|
73
|
-
}
|
|
74
|
-
return error2.errno ?? -1;
|
|
75
|
-
}) ?? withError(error, (error2) => {
|
|
76
|
-
console.error(import_chalk2.default.red(`${error2.name}: ${error2.message}`));
|
|
77
|
-
return -1;
|
|
78
|
-
}) ?? (() => {
|
|
79
|
-
console.error(import_chalk2.default.red(`Unexpected Error: ${JSON.stringify(ex, null, 2)}`));
|
|
80
|
-
return -1;
|
|
81
|
-
})();
|
|
82
|
-
process.exit(process.exitCode ?? exitCode);
|
|
83
|
-
}, "processEx");
|
|
84
|
-
|
|
85
|
-
// src/lib/safeExit.ts
|
|
86
|
-
var safeExitAsync = /* @__PURE__ */ __name(async (func, exitOnFail = true) => {
|
|
87
|
-
try {
|
|
88
|
-
const result = await func();
|
|
89
|
-
if (result && exitOnFail) {
|
|
90
|
-
process.exit(result);
|
|
91
|
-
}
|
|
92
|
-
return result;
|
|
93
|
-
} catch (ex) {
|
|
94
|
-
return processEx(ex);
|
|
95
|
-
}
|
|
96
|
-
}, "safeExitAsync");
|
|
97
|
-
|
|
98
|
-
// src/lib/runStepsAsync.ts
|
|
99
|
-
var import_node_child_process = require("child_process");
|
|
100
|
-
var import_node_fs = require("fs");
|
|
101
|
-
var import_chalk3 = __toESM(require("chalk"), 1);
|
|
102
|
-
var runStepAsync = /* @__PURE__ */ __name((name, step, exitOnFail = true, message) => {
|
|
103
|
-
return new Promise((resolve) => {
|
|
104
|
-
const [command, args, config] = step;
|
|
105
|
-
if (message) {
|
|
106
|
-
console.log(import_chalk3.default.gray(message));
|
|
107
|
-
}
|
|
108
|
-
const argList = Array.isArray(args) ? args : args.split(" ");
|
|
109
|
-
if (command === "node" && !(0, import_node_fs.existsSync)(argList[0])) {
|
|
110
|
-
throw new Error(`File not found [${argList[0]}]`);
|
|
111
|
-
}
|
|
112
|
-
(0, import_node_child_process.spawn)(command, Array.isArray(args) ? args : args.split(" "), {
|
|
113
|
-
...config,
|
|
114
|
-
env: {
|
|
115
|
-
FORCE_COLOR: "3",
|
|
116
|
-
...process.env
|
|
117
|
-
},
|
|
118
|
-
shell: true,
|
|
119
|
-
stdio: "inherit"
|
|
120
|
-
}).on("close", (code) => {
|
|
121
|
-
if (code) {
|
|
122
|
-
console.error(import_chalk3.default.red(`Command Exited With Non-Zero Result [${import_chalk3.default.gray(code)}] | ${import_chalk3.default.yellow(command)} ${import_chalk3.default.white(Array.isArray(args) ? args.join(" ") : args)}`));
|
|
123
|
-
checkResult(name, code, "error", exitOnFail);
|
|
124
|
-
resolve(code);
|
|
125
|
-
} else {
|
|
126
|
-
resolve(0);
|
|
127
|
-
}
|
|
128
|
-
});
|
|
129
|
-
});
|
|
130
|
-
}, "runStepAsync");
|
|
131
|
-
var runStepsAsync = /* @__PURE__ */ __name(async (name, steps, exitOnFail = true, messages) => {
|
|
132
|
-
return await safeExitAsync(async () => {
|
|
133
|
-
const pkgName = process.env.npm_package_name;
|
|
134
|
-
console.log(import_chalk3.default.green(`${name} [${pkgName}]`));
|
|
135
|
-
let result = 0;
|
|
136
|
-
for (const [i, step] of steps.entries()) {
|
|
137
|
-
result += await runStepAsync(name, step, exitOnFail, messages?.[i]);
|
|
138
|
-
}
|
|
139
|
-
return result;
|
|
140
|
-
});
|
|
141
|
-
}, "runStepsAsync");
|
|
142
|
-
|
|
143
|
-
// src/actions/build.ts
|
|
144
|
-
var build = /* @__PURE__ */ __name(async ({ incremental, jobs, target, verbose, pkg }) => {
|
|
145
|
-
const start = Date.now();
|
|
146
|
-
const pkgOptions = pkg ? [
|
|
147
|
-
pkg
|
|
148
|
-
] : [];
|
|
149
|
-
const incrementalOptions = incremental ? [
|
|
150
|
-
"-i"
|
|
151
|
-
] : [];
|
|
152
|
-
const verboseOptions = verbose ? [
|
|
153
|
-
"-v"
|
|
154
|
-
] : [];
|
|
155
|
-
const targetOptions = target ? [
|
|
156
|
-
"-t",
|
|
157
|
-
target
|
|
158
|
-
] : [];
|
|
159
|
-
const jobsOptions = jobs ? [
|
|
160
|
-
"-j",
|
|
161
|
-
`${jobs}`
|
|
162
|
-
] : [];
|
|
163
|
-
if (jobs) {
|
|
164
|
-
console.log(import_chalk4.default.blue(`Jobs set to [${jobs}]`));
|
|
165
|
-
}
|
|
166
|
-
const result = await runStepsAsync(`Build${incremental ? "-Incremental" : ""} [${pkg ?? "All"}]`, [
|
|
167
|
-
[
|
|
168
|
-
"yarn",
|
|
169
|
-
[
|
|
170
|
-
"xy",
|
|
171
|
-
"compile",
|
|
172
|
-
...pkgOptions,
|
|
173
|
-
...targetOptions,
|
|
174
|
-
...verboseOptions,
|
|
175
|
-
...jobsOptions,
|
|
176
|
-
...incrementalOptions
|
|
177
|
-
]
|
|
178
|
-
],
|
|
179
|
-
[
|
|
180
|
-
"yarn",
|
|
181
|
-
[
|
|
182
|
-
"xy",
|
|
183
|
-
"lint",
|
|
184
|
-
...pkgOptions,
|
|
185
|
-
...verboseOptions,
|
|
186
|
-
...incrementalOptions
|
|
187
|
-
]
|
|
188
|
-
],
|
|
189
|
-
[
|
|
190
|
-
"yarn",
|
|
191
|
-
[
|
|
192
|
-
"xy",
|
|
193
|
-
"deps",
|
|
194
|
-
...pkgOptions,
|
|
195
|
-
...verboseOptions,
|
|
196
|
-
...jobsOptions,
|
|
197
|
-
...incrementalOptions
|
|
198
|
-
]
|
|
199
|
-
]
|
|
200
|
-
]);
|
|
201
|
-
console.log(`${import_chalk4.default.gray("Built in")} [${import_chalk4.default.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${import_chalk4.default.gray("seconds")}`);
|
|
202
|
-
return result;
|
|
203
|
-
}, "build");
|
|
204
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
205
|
-
0 && (module.exports = {
|
|
206
|
-
build
|
|
207
|
-
});
|
|
208
|
-
//# sourceMappingURL=build.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/actions/build.ts","../../src/lib/checkResult.ts","../../src/lib/processEx.ts","../../src/lib/withError.ts","../../src/lib/withErrnoException.ts","../../src/lib/safeExit.ts","../../src/lib/runStepsAsync.ts"],"sourcesContent":["import chalk from 'chalk'\n\nimport { runStepsAsync } from '../lib/index.ts'\n\nexport interface BuildParams {\n incremental?: boolean\n jobs?: number\n pkg?: string\n target?: 'esm' | 'cjs'\n verbose?: boolean\n}\n\nexport const build = async ({ incremental, jobs, target, verbose, pkg }: BuildParams) => {\n const start = Date.now()\n const pkgOptions = pkg ? [pkg] : [] // must go first\n const incrementalOptions = incremental ? ['-i'] : []\n const verboseOptions = verbose ? ['-v'] : []\n const targetOptions = target ? ['-t', target] : []\n const jobsOptions = jobs ? ['-j', `${jobs}`] : []\n if (jobs) {\n console.log(chalk.blue(`Jobs set to [${jobs}]`))\n }\n\n const result = await runStepsAsync(`Build${incremental ? '-Incremental' : ''} [${pkg ?? 'All'}]`, [\n ['yarn', ['xy', 'compile', ...pkgOptions, ...targetOptions, ...verboseOptions, ...jobsOptions, ...incrementalOptions]],\n ['yarn', ['xy', 'lint', ...pkgOptions, ...verboseOptions, ...incrementalOptions]],\n ['yarn', ['xy', 'deps', ...pkgOptions, ...verboseOptions, ...jobsOptions, ...incrementalOptions]],\n ])\n console.log(`${chalk.gray('Built in')} [${chalk.magenta(((Date.now() - start) / 1000).toFixed(2))}] ${chalk.gray('seconds')}`)\n return result\n}\n","import chalk from 'chalk'\n\nexport const checkResult = (name: string, result: number, level: 'error' | 'warn' = 'error', exitOnFail = false) => {\n if (result) {\n const exiting = exitOnFail ? '[Exiting Process]' : '[Continuing]'\n const chalkFunc = level === 'error' ? chalk.red : chalk.yellow\n console[level](chalkFunc(`${name} had ${result} failures ${exiting}`))\n if (exitOnFail) {\n process.exit(result)\n }\n }\n}\n","import chalk from 'chalk'\n\nimport { withErrnoException } from './withErrnoException.ts'\nimport { withError } from './withError.ts'\n\nexport const processEx = (ex: unknown) => {\n const error = typeof ex === 'string' ? new Error(ex) : ex\n const exitCode\n = withErrnoException(error, (error) => {\n if (error.code === 'ENOENT') {\n console.error(chalk.red(`'${error.path}' not found.`))\n } else {\n console.error(chalk.red(`Errno: ${error.code}`))\n }\n return error.errno ?? -1\n })\n ?? withError(error, (error) => {\n console.error(chalk.red(`${error.name}: ${error.message}`))\n return -1\n })\n ?? (() => {\n console.error(chalk.red(`Unexpected Error: ${JSON.stringify(ex, null, 2)}`))\n return -1\n })()\n // This allows us to use a previously set exit code\n process.exit(process.exitCode ?? exitCode)\n}\n","export const withError = <T extends Error = Error>(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ex: any,\n closure: (error: T) => number,\n predicate = (ex: T) => ex.name !== undefined && ex.message !== undefined,\n) => {\n return predicate(ex as T) ? closure(ex as T) : undefined\n}\n","import { withError } from './withError.ts'\n\nexport const withErrnoException = <T extends NodeJS.ErrnoException = NodeJS.ErrnoException>(ex: unknown, closure: (error: T) => number) => {\n return withError<T>(ex, closure, (ex: unknown) => (ex as NodeJS.ErrnoException).errno !== undefined)\n}\n","/** Catch child process a crash and returns the code */\n\nimport { processEx } from './processEx.ts'\n\nconst safeExit = (func: () => number, exitOnFail = true): number => {\n try {\n const result = func()\n if (result && exitOnFail) {\n process.exit(result)\n }\n return result\n } catch (ex) {\n return processEx(ex)\n }\n}\n\nconst safeExitAsync = async (func: () => Promise<number>, exitOnFail = true): Promise<number> => {\n try {\n const result = await func()\n if (result && exitOnFail) {\n process.exit(result)\n }\n return result\n } catch (ex) {\n return processEx(ex)\n }\n}\n\nexport { safeExit, safeExitAsync }\n","import { spawn } from 'node:child_process'\nimport { existsSync } from 'node:fs'\n\nimport chalk from 'chalk'\n\nimport { checkResult } from './checkResult.ts'\nimport { ScriptStep } from './runSteps.ts'\nimport { safeExitAsync } from './safeExit.ts'\n\nexport const runStepAsync = (name: string, step: ScriptStep, exitOnFail = true, message?: string) => {\n return new Promise<number>((resolve) => {\n const [command, args, config] = step\n if (message) {\n console.log(chalk.gray(message))\n }\n const argList = Array.isArray(args) ? args : args.split(' ')\n if (command === 'node' && !existsSync(argList[0])) {\n throw new Error(`File not found [${argList[0]}]`)\n }\n spawn(command, Array.isArray(args) ? args : args.split(' '), {\n ...config,\n env: { FORCE_COLOR: '3', ...process.env },\n shell: true,\n stdio: 'inherit',\n }).on('close', (code) => {\n if (code) {\n console.error(\n chalk.red(\n `Command Exited With Non-Zero Result [${chalk.gray(code)}] | ${chalk.yellow(command)} ${chalk.white(\n Array.isArray(args) ? args.join(' ') : args,\n )}`,\n ),\n )\n checkResult(name, code, 'error', exitOnFail)\n resolve(code)\n } else {\n resolve(0)\n }\n })\n })\n}\n\nexport const runStepsAsync = async (name: string, steps: ScriptStep[], exitOnFail = true, messages?: string[]) => {\n return await safeExitAsync(async () => {\n const pkgName = process.env.npm_package_name\n console.log(chalk.green(`${name} [${pkgName}]`))\n let result = 0\n for (const [i, step] of steps.entries()) {\n result += await runStepAsync(name, step, exitOnFail, messages?.[i])\n }\n return result\n })\n}\n"],"mappings":"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","names":["import_chalk","checkResult","name","result","level","exitOnFail","exiting","chalkFunc","chalk","red","yellow","console","process","exit","import_chalk","withError","ex","closure","predicate","name","undefined","message","withErrnoException","ex","closure","withError","errno","undefined","processEx","ex","error","Error","exitCode","withErrnoException","code","console","chalk","red","path","errno","withError","name","message","JSON","stringify","process","exit","safeExitAsync","func","exitOnFail","result","process","exit","ex","processEx","import_chalk","runStepAsync","name","step","exitOnFail","message","Promise","resolve","command","args","config","console","log","chalk","gray","argList","Array","isArray","split","existsSync","Error","spawn","env","FORCE_COLOR","process","shell","stdio","on","code","error","red","yellow","white","join","checkResult","runStepsAsync","steps","messages","safeExitAsync","pkgName","npm_package_name","green","result","i","entries","build","incremental","jobs","target","verbose","pkg","start","Date","now","pkgOptions","incrementalOptions","verboseOptions","targetOptions","jobsOptions","console","log","chalk","blue","result","runStepsAsync","gray","magenta","toFixed"]}
|