@xylabs/ts-scripts-yarn3 3.15.15 → 4.0.0-rc.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/actions/compile.mjs +3 -2
- package/dist/actions/compile.mjs.map +1 -1
- package/dist/actions/index.mjs +96 -287
- package/dist/actions/index.mjs.map +1 -1
- package/dist/actions/package/compile/compile.mjs +57 -259
- package/dist/actions/package/compile/compile.mjs.map +1 -1
- package/dist/actions/package/compile/index.mjs +57 -259
- package/dist/actions/package/compile/index.mjs.map +1 -1
- package/dist/actions/package/compile/packageCompileTsc.mjs +1 -1
- package/dist/actions/package/compile/packageCompileTsc.mjs.map +1 -1
- package/dist/actions/package/compile/packageCompileTscTypes.mjs +2 -36
- package/dist/actions/package/compile/packageCompileTscTypes.mjs.map +1 -1
- package/dist/actions/package/compile/packageCompileTsup.mjs +54 -339
- package/dist/actions/package/compile/packageCompileTsup.mjs.map +1 -1
- package/dist/actions/package/index.mjs +72 -277
- package/dist/actions/package/index.mjs.map +1 -1
- package/dist/actions/package/recompile.mjs +58 -263
- package/dist/actions/package/recompile.mjs.map +1 -1
- package/dist/actions/recompile.mjs +14 -1
- package/dist/actions/recompile.mjs.map +1 -1
- package/dist/bin/package/compile-only.mjs +59 -261
- package/dist/bin/package/compile-only.mjs.map +1 -1
- package/dist/bin/package/compile-tsup.mjs +56 -341
- package/dist/bin/package/compile-tsup.mjs.map +1 -1
- package/dist/bin/package/compile.mjs +59 -261
- package/dist/bin/package/compile.mjs.map +1 -1
- package/dist/bin/package/recompile.mjs +60 -265
- package/dist/bin/package/recompile.mjs.map +1 -1
- package/dist/bin/xy-ts.mjs +17 -3
- package/dist/bin/xy-ts.mjs.map +1 -1
- package/dist/bin/xy.mjs +17 -3
- package/dist/bin/xy.mjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +106 -297
- package/dist/index.mjs.map +1 -1
- package/dist/xy/index.mjs +17 -3
- package/dist/xy/index.mjs.map +1 -1
- package/dist/xy/xy.mjs +17 -3
- package/dist/xy/xy.mjs.map +1 -1
- package/dist/xy/xyBuildCommands.mjs +17 -3
- package/dist/xy/xyBuildCommands.mjs.map +1 -1
- package/package.json +10 -20
- package/src/actions/compile.ts +2 -2
- package/src/actions/package/compile/XyConfig.ts +2 -2
- package/src/actions/package/compile/packageCompileTsc.ts +1 -1
- package/src/actions/package/compile/packageCompileTscTypes.ts +3 -8
- package/src/actions/package/compile/packageCompileTsup.ts +54 -130
- package/src/actions/package/recompile.ts +1 -1
- package/src/actions/recompile.ts +2 -1
- package/tsup.config.ts +1 -1
- package/dist/actions/build.cjs +0 -208
- package/dist/actions/build.cjs.map +0 -1
- package/dist/actions/clean-docs.cjs +0 -74
- package/dist/actions/clean-docs.cjs.map +0 -1
- package/dist/actions/clean-eslint.cjs +0 -53
- package/dist/actions/clean-eslint.cjs.map +0 -1
- package/dist/actions/clean-jest.cjs +0 -147
- package/dist/actions/clean-jest.cjs.map +0 -1
- package/dist/actions/clean.cjs +0 -192
- package/dist/actions/clean.cjs.map +0 -1
- package/dist/actions/compile.cjs +0 -217
- package/dist/actions/compile.cjs.map +0 -1
- package/dist/actions/copy-assets.cjs +0 -121
- package/dist/actions/copy-assets.cjs.map +0 -1
- package/dist/actions/cycle.cjs +0 -156
- package/dist/actions/cycle.cjs.map +0 -1
- package/dist/actions/dead.cjs +0 -148
- package/dist/actions/dead.cjs.map +0 -1
- package/dist/actions/deploy-major.cjs +0 -160
- package/dist/actions/deploy-major.cjs.map +0 -1
- package/dist/actions/deploy-minor.cjs +0 -160
- package/dist/actions/deploy-minor.cjs.map +0 -1
- package/dist/actions/deploy-next.cjs +0 -160
- package/dist/actions/deploy-next.cjs.map +0 -1
- package/dist/actions/deploy.cjs +0 -160
- package/dist/actions/deploy.cjs.map +0 -1
- package/dist/actions/deps.cjs +0 -205
- package/dist/actions/deps.cjs.map +0 -1
- package/dist/actions/dupdeps.cjs +0 -226
- package/dist/actions/dupdeps.cjs.map +0 -1
- package/dist/actions/fix.cjs +0 -149
- package/dist/actions/fix.cjs.map +0 -1
- package/dist/actions/gen-docs.cjs +0 -186
- package/dist/actions/gen-docs.cjs.map +0 -1
- package/dist/actions/gitignore-gen.cjs +0 -138
- package/dist/actions/gitignore-gen.cjs.map +0 -1
- package/dist/actions/gitlint-fix.cjs +0 -69
- package/dist/actions/gitlint-fix.cjs.map +0 -1
- package/dist/actions/gitlint.cjs +0 -84
- package/dist/actions/gitlint.cjs.map +0 -1
- package/dist/actions/index.cjs +0 -2600
- package/dist/actions/index.cjs.map +0 -1
- package/dist/actions/license.cjs +0 -133
- package/dist/actions/license.cjs.map +0 -1
- package/dist/actions/lint-clean.cjs +0 -227
- package/dist/actions/lint-clean.cjs.map +0 -1
- package/dist/actions/lint-profile.cjs +0 -153
- package/dist/actions/lint-profile.cjs.map +0 -1
- package/dist/actions/lint.cjs +0 -217
- package/dist/actions/lint.cjs.map +0 -1
- package/dist/actions/npmignore-gen.cjs +0 -138
- package/dist/actions/npmignore-gen.cjs.map +0 -1
- package/dist/actions/package/clean-outputs.cjs +0 -56
- package/dist/actions/package/clean-outputs.cjs.map +0 -1
- package/dist/actions/package/clean-typescript.cjs +0 -56
- package/dist/actions/package/clean-typescript.cjs.map +0 -1
- package/dist/actions/package/clean.cjs +0 -83
- package/dist/actions/package/clean.cjs.map +0 -1
- package/dist/actions/package/compile/XyConfig.cjs +0 -19
- package/dist/actions/package/compile/XyConfig.cjs.map +0 -1
- package/dist/actions/package/compile/buildEntries.cjs +0 -68
- package/dist/actions/package/compile/buildEntries.cjs.map +0 -1
- package/dist/actions/package/compile/compile.cjs +0 -565
- package/dist/actions/package/compile/compile.cjs.map +0 -1
- package/dist/actions/package/compile/copyTypeFiles.cjs +0 -60
- package/dist/actions/package/compile/copyTypeFiles.cjs.map +0 -1
- package/dist/actions/package/compile/getCompilerOptions.cjs +0 -67
- package/dist/actions/package/compile/getCompilerOptions.cjs.map +0 -1
- package/dist/actions/package/compile/index.cjs +0 -571
- package/dist/actions/package/compile/index.cjs.map +0 -1
- package/dist/actions/package/compile/inputs.cjs +0 -79
- package/dist/actions/package/compile/inputs.cjs.map +0 -1
- package/dist/actions/package/compile/packageCompileTsc.cjs +0 -164
- package/dist/actions/package/compile/packageCompileTsc.cjs.map +0 -1
- package/dist/actions/package/compile/packageCompileTscTypes.cjs +0 -199
- package/dist/actions/package/compile/packageCompileTscTypes.cjs.map +0 -1
- package/dist/actions/package/compile/packageCompileTsup.cjs +0 -521
- package/dist/actions/package/compile/packageCompileTsup.cjs.map +0 -1
- package/dist/actions/package/copy-assets.cjs +0 -88
- package/dist/actions/package/copy-assets.cjs.map +0 -1
- package/dist/actions/package/deps.cjs +0 -214
- package/dist/actions/package/deps.cjs.map +0 -1
- package/dist/actions/package/gen-docs.cjs +0 -148
- package/dist/actions/package/gen-docs.cjs.map +0 -1
- package/dist/actions/package/index.cjs +0 -968
- package/dist/actions/package/index.cjs.map +0 -1
- package/dist/actions/package/publint.cjs +0 -80
- package/dist/actions/package/publint.cjs.map +0 -1
- package/dist/actions/package/recompile.cjs +0 -617
- package/dist/actions/package/recompile.cjs.map +0 -1
- package/dist/actions/publint.cjs +0 -237
- package/dist/actions/publint.cjs.map +0 -1
- package/dist/actions/rebuild.cjs +0 -148
- package/dist/actions/rebuild.cjs.map +0 -1
- package/dist/actions/recompile.cjs +0 -232
- package/dist/actions/recompile.cjs.map +0 -1
- package/dist/actions/reinstall.cjs +0 -183
- package/dist/actions/reinstall.cjs.map +0 -1
- package/dist/actions/relint.cjs +0 -185
- package/dist/actions/relint.cjs.map +0 -1
- package/dist/actions/retest.cjs +0 -154
- package/dist/actions/retest.cjs.map +0 -1
- package/dist/actions/sonar.cjs +0 -149
- package/dist/actions/sonar.cjs.map +0 -1
- package/dist/actions/statics.cjs +0 -234
- package/dist/actions/statics.cjs.map +0 -1
- package/dist/actions/test.cjs +0 -147
- package/dist/actions/test.cjs.map +0 -1
- package/dist/actions/up.cjs +0 -144
- package/dist/actions/up.cjs.map +0 -1
- package/dist/actions/updo.cjs +0 -152
- package/dist/actions/updo.cjs.map +0 -1
- package/dist/actions/upplug.cjs +0 -172
- package/dist/actions/upplug.cjs.map +0 -1
- package/dist/actions/upyarn.cjs +0 -148
- package/dist/actions/upyarn.cjs.map +0 -1
- package/dist/actions/yarn3only.cjs +0 -106
- package/dist/actions/yarn3only.cjs.map +0 -1
- package/dist/bin/build.cjs +0 -39
- package/dist/bin/build.cjs.map +0 -1
- package/dist/bin/clean.cjs +0 -39
- package/dist/bin/clean.cjs.map +0 -1
- package/dist/bin/compile-only.cjs +0 -39
- package/dist/bin/compile-only.cjs.map +0 -1
- package/dist/bin/compile.cjs +0 -39
- package/dist/bin/compile.cjs.map +0 -1
- package/dist/bin/cycle.cjs +0 -39
- package/dist/bin/cycle.cjs.map +0 -1
- package/dist/bin/dead.cjs +0 -39
- package/dist/bin/dead.cjs.map +0 -1
- package/dist/bin/deploy-major.cjs +0 -39
- package/dist/bin/deploy-major.cjs.map +0 -1
- package/dist/bin/deploy-minor.cjs +0 -39
- package/dist/bin/deploy-minor.cjs.map +0 -1
- package/dist/bin/deploy-next.cjs +0 -39
- package/dist/bin/deploy-next.cjs.map +0 -1
- package/dist/bin/deploy.cjs +0 -39
- package/dist/bin/deploy.cjs.map +0 -1
- package/dist/bin/deps.cjs +0 -39
- package/dist/bin/deps.cjs.map +0 -1
- package/dist/bin/fix.cjs +0 -39
- package/dist/bin/fix.cjs.map +0 -1
- package/dist/bin/gen-docs.cjs +0 -39
- package/dist/bin/gen-docs.cjs.map +0 -1
- package/dist/bin/gitlint-fix.cjs +0 -39
- package/dist/bin/gitlint-fix.cjs.map +0 -1
- package/dist/bin/gitlint.cjs +0 -39
- package/dist/bin/gitlint.cjs.map +0 -1
- package/dist/bin/license.cjs +0 -39
- package/dist/bin/license.cjs.map +0 -1
- package/dist/bin/lint-clean.cjs +0 -39
- package/dist/bin/lint-clean.cjs.map +0 -1
- package/dist/bin/lint-fast.cjs +0 -39
- package/dist/bin/lint-fast.cjs.map +0 -1
- package/dist/bin/lint-profile.cjs +0 -39
- package/dist/bin/lint-profile.cjs.map +0 -1
- package/dist/bin/lint.cjs +0 -39
- package/dist/bin/lint.cjs.map +0 -1
- package/dist/bin/package/clean-outputs.cjs +0 -51
- package/dist/bin/package/clean-outputs.cjs.map +0 -1
- package/dist/bin/package/clean-typescript.cjs +0 -51
- package/dist/bin/package/clean-typescript.cjs.map +0 -1
- package/dist/bin/package/clean.cjs +0 -76
- package/dist/bin/package/clean.cjs.map +0 -1
- package/dist/bin/package/compile-only.cjs +0 -564
- package/dist/bin/package/compile-only.cjs.map +0 -1
- package/dist/bin/package/compile-tsup.cjs +0 -519
- package/dist/bin/package/compile-tsup.cjs.map +0 -1
- package/dist/bin/package/compile.cjs +0 -567
- package/dist/bin/package/compile.cjs.map +0 -1
- package/dist/bin/package/copy-assets-cjs.cjs +0 -86
- package/dist/bin/package/copy-assets-cjs.cjs.map +0 -1
- package/dist/bin/package/copy-assets-esm.cjs +0 -86
- package/dist/bin/package/copy-assets-esm.cjs.map +0 -1
- package/dist/bin/package/deps.cjs +0 -208
- package/dist/bin/package/deps.cjs.map +0 -1
- package/dist/bin/package/gen-docs.cjs +0 -143
- package/dist/bin/package/gen-docs.cjs.map +0 -1
- package/dist/bin/package/publint.cjs +0 -77
- package/dist/bin/package/publint.cjs.map +0 -1
- package/dist/bin/package/recompile.cjs +0 -611
- package/dist/bin/package/recompile.cjs.map +0 -1
- package/dist/bin/publint.cjs +0 -39
- package/dist/bin/publint.cjs.map +0 -1
- package/dist/bin/rebuild.cjs +0 -39
- package/dist/bin/rebuild.cjs.map +0 -1
- package/dist/bin/recompile.cjs +0 -39
- package/dist/bin/recompile.cjs.map +0 -1
- package/dist/bin/reinstall.cjs +0 -39
- package/dist/bin/reinstall.cjs.map +0 -1
- package/dist/bin/relint.cjs +0 -39
- package/dist/bin/relint.cjs.map +0 -1
- package/dist/bin/sonar.cjs +0 -39
- package/dist/bin/sonar.cjs.map +0 -1
- package/dist/bin/test.cjs +0 -39
- package/dist/bin/test.cjs.map +0 -1
- package/dist/bin/up.cjs +0 -39
- package/dist/bin/up.cjs.map +0 -1
- package/dist/bin/updo.cjs +0 -39
- package/dist/bin/updo.cjs.map +0 -1
- package/dist/bin/upplug.cjs +0 -39
- package/dist/bin/upplug.cjs.map +0 -1
- package/dist/bin/upyarn.cjs +0 -39
- package/dist/bin/upyarn.cjs.map +0 -1
- package/dist/bin/xy-ts.cjs +0 -1890
- package/dist/bin/xy-ts.cjs.map +0 -1
- package/dist/bin/xy.cjs +0 -1890
- package/dist/bin/xy.cjs.map +0 -1
- package/dist/bin/yarn3only.cjs +0 -39
- package/dist/bin/yarn3only.cjs.map +0 -1
- package/dist/index.cjs +0 -3129
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.cts +0 -359
- package/dist/lib/checkResult.cjs +0 -52
- package/dist/lib/checkResult.cjs.map +0 -1
- package/dist/lib/createBuildConfig.cjs +0 -93
- package/dist/lib/createBuildConfig.cjs.map +0 -1
- package/dist/lib/defaultBuildConfig.cjs +0 -52
- package/dist/lib/defaultBuildConfig.cjs.map +0 -1
- package/dist/lib/dependencies/DuplicateDetector.cjs +0 -124
- package/dist/lib/dependencies/DuplicateDetector.cjs.map +0 -1
- package/dist/lib/dependencies/detectDuplicateDependencies.cjs +0 -207
- package/dist/lib/dependencies/detectDuplicateDependencies.cjs.map +0 -1
- package/dist/lib/dependencies/index.cjs +0 -211
- package/dist/lib/dependencies/index.cjs.map +0 -1
- package/dist/lib/file/ReadFileSyncOptions.cjs +0 -33
- package/dist/lib/file/ReadFileSyncOptions.cjs.map +0 -1
- package/dist/lib/file/constants.cjs +0 -34
- package/dist/lib/file/constants.cjs.map +0 -1
- package/dist/lib/file/fileLines.cjs +0 -58
- package/dist/lib/file/fileLines.cjs.map +0 -1
- package/dist/lib/file/index.cjs +0 -74
- package/dist/lib/file/index.cjs.map +0 -1
- package/dist/lib/file/tryReadFileSync.cjs +0 -42
- package/dist/lib/file/tryReadFileSync.cjs.map +0 -1
- package/dist/lib/generateIgnoreFiles.cjs +0 -132
- package/dist/lib/generateIgnoreFiles.cjs.map +0 -1
- package/dist/lib/index.cjs +0 -614
- package/dist/lib/index.cjs.map +0 -1
- package/dist/lib/jsonFormatters.cjs +0 -37
- package/dist/lib/jsonFormatters.cjs.map +0 -1
- package/dist/lib/loadConfig.cjs +0 -59
- package/dist/lib/loadConfig.cjs.map +0 -1
- package/dist/lib/parsedPackageJSON.cjs +0 -37
- package/dist/lib/parsedPackageJSON.cjs.map +0 -1
- package/dist/lib/processEx.cjs +0 -72
- package/dist/lib/processEx.cjs.map +0 -1
- package/dist/lib/runSteps.cjs +0 -134
- package/dist/lib/runSteps.cjs.map +0 -1
- package/dist/lib/runStepsAsync.cjs +0 -147
- package/dist/lib/runStepsAsync.cjs.map +0 -1
- package/dist/lib/runXy.cjs +0 -150
- package/dist/lib/runXy.cjs.map +0 -1
- package/dist/lib/runXyWithWarning.cjs +0 -49
- package/dist/lib/runXyWithWarning.cjs.map +0 -1
- package/dist/lib/safeExit.cjs +0 -100
- package/dist/lib/safeExit.cjs.map +0 -1
- package/dist/lib/string/empty.cjs +0 -35
- package/dist/lib/string/empty.cjs.map +0 -1
- package/dist/lib/string/index.cjs +0 -45
- package/dist/lib/string/index.cjs.map +0 -1
- package/dist/lib/string/union.cjs +0 -35
- package/dist/lib/string/union.cjs.map +0 -1
- package/dist/lib/withErrnoException.cjs +0 -41
- package/dist/lib/withErrnoException.cjs.map +0 -1
- package/dist/lib/withError.cjs +0 -34
- package/dist/lib/withError.cjs.map +0 -1
- package/dist/lib/yarn/index.cjs +0 -93
- package/dist/lib/yarn/index.cjs.map +0 -1
- package/dist/lib/yarn/isYarnVersionOrGreater.cjs +0 -52
- package/dist/lib/yarn/isYarnVersionOrGreater.cjs.map +0 -1
- package/dist/lib/yarn/workspace/Workspace.cjs +0 -19
- package/dist/lib/yarn/workspace/Workspace.cjs.map +0 -1
- package/dist/lib/yarn/workspace/index.cjs +0 -60
- package/dist/lib/yarn/workspace/index.cjs.map +0 -1
- package/dist/lib/yarn/workspace/yarnWorkspace.cjs +0 -58
- package/dist/lib/yarn/workspace/yarnWorkspace.cjs.map +0 -1
- package/dist/lib/yarn/workspace/yarnWorkspaces.cjs +0 -49
- package/dist/lib/yarn/workspace/yarnWorkspaces.cjs.map +0 -1
- package/dist/lib/yarn/yarnInitCwd.cjs +0 -35
- package/dist/lib/yarn/yarnInitCwd.cjs.map +0 -1
- package/dist/loadPackageConfig.cjs +0 -39
- package/dist/loadPackageConfig.cjs.map +0 -1
- package/dist/types.d.cjs +0 -2
- package/dist/types.d.cjs.map +0 -1
- package/dist/xy/index.cjs +0 -1909
- package/dist/xy/index.cjs.map +0 -1
- package/dist/xy/param.cjs +0 -36
- package/dist/xy/param.cjs.map +0 -1
- package/dist/xy/xy.cjs +0 -1895
- package/dist/xy/xy.cjs.map +0 -1
- package/dist/xy/xyBuildCommands.cjs +0 -595
- package/dist/xy/xyBuildCommands.cjs.map +0 -1
- package/dist/xy/xyCommonCommands.cjs +0 -723
- package/dist/xy/xyCommonCommands.cjs.map +0 -1
- package/dist/xy/xyDeployCommands.cjs +0 -263
- package/dist/xy/xyDeployCommands.cjs.map +0 -1
- package/dist/xy/xyInstallCommands.cjs +0 -508
- package/dist/xy/xyInstallCommands.cjs.map +0 -1
- package/dist/xy/xyLintCommands.cjs +0 -466
- package/dist/xy/xyLintCommands.cjs.map +0 -1
- package/dist/xy/xyParseOptions.cjs +0 -84
- package/dist/xy/xyParseOptions.cjs.map +0 -1
package/dist/actions/index.cjs
DELETED
|
@@ -1,2600 +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/index.ts
|
|
32
|
-
var actions_exports = {};
|
|
33
|
-
__export(actions_exports, {
|
|
34
|
-
build: () => build,
|
|
35
|
-
clean: () => clean,
|
|
36
|
-
cleanAll: () => cleanAll,
|
|
37
|
-
cleanDocs: () => cleanDocs,
|
|
38
|
-
cleanPackage: () => cleanPackage,
|
|
39
|
-
compile: () => compile,
|
|
40
|
-
compileAll: () => compileAll,
|
|
41
|
-
compilePackage: () => compilePackage,
|
|
42
|
-
copyAssets: () => copyAssets,
|
|
43
|
-
cycle: () => cycle,
|
|
44
|
-
dead: () => dead,
|
|
45
|
-
deploy: () => deploy,
|
|
46
|
-
deployMajor: () => deployMajor,
|
|
47
|
-
deployMinor: () => deployMinor,
|
|
48
|
-
deployNext: () => deployNext,
|
|
49
|
-
deps: () => deps,
|
|
50
|
-
depsAll: () => depsAll,
|
|
51
|
-
depsPackage: () => depsPackage,
|
|
52
|
-
dupdeps: () => dupdeps,
|
|
53
|
-
fix: () => fix,
|
|
54
|
-
genDocs: () => genDocs,
|
|
55
|
-
genDocsAll: () => genDocsAll,
|
|
56
|
-
genDocsPackage: () => genDocsPackage,
|
|
57
|
-
gitignoreGen: () => gitignoreGen,
|
|
58
|
-
gitlint: () => gitlint,
|
|
59
|
-
gitlintFix: () => gitlintFix,
|
|
60
|
-
license: () => license,
|
|
61
|
-
lint: () => lint,
|
|
62
|
-
lintAll: () => lintAll,
|
|
63
|
-
lintClean: () => lintClean,
|
|
64
|
-
lintPackage: () => lintPackage,
|
|
65
|
-
lintProfile: () => lintProfile,
|
|
66
|
-
npmignoreGen: () => npmignoreGen,
|
|
67
|
-
packageClean: () => packageClean,
|
|
68
|
-
packageCleanOutputs: () => packageCleanOutputs,
|
|
69
|
-
packageCleanTypescript: () => packageCleanTypescript,
|
|
70
|
-
packageCompile: () => packageCompile,
|
|
71
|
-
packageCompileTsc: () => packageCompileTsc,
|
|
72
|
-
packageCompileTsup: () => packageCompileTsup,
|
|
73
|
-
packageCopyAssets: () => packageCopyAssets,
|
|
74
|
-
packageDeps: () => packageDeps,
|
|
75
|
-
packageGenDocs: () => packageGenDocs,
|
|
76
|
-
packagePublint: () => packagePublint,
|
|
77
|
-
packageRecompile: () => packageRecompile,
|
|
78
|
-
publint: () => publint,
|
|
79
|
-
publintAll: () => publintAll,
|
|
80
|
-
publintPackage: () => publintPackage,
|
|
81
|
-
rebuild: () => rebuild,
|
|
82
|
-
recompile: () => recompile,
|
|
83
|
-
recompileAll: () => recompileAll,
|
|
84
|
-
recompilePackage: () => recompilePackage,
|
|
85
|
-
reinstall: () => reinstall,
|
|
86
|
-
relint: () => relint,
|
|
87
|
-
retest: () => retest,
|
|
88
|
-
sonar: () => sonar,
|
|
89
|
-
statics: () => statics,
|
|
90
|
-
test: () => test,
|
|
91
|
-
up: () => up,
|
|
92
|
-
updateYarnPlugins: () => updateYarnPlugins,
|
|
93
|
-
updateYarnVersion: () => updateYarnVersion,
|
|
94
|
-
updo: () => updo,
|
|
95
|
-
yarn3Only: () => yarn3Only
|
|
96
|
-
});
|
|
97
|
-
module.exports = __toCommonJS(actions_exports);
|
|
98
|
-
|
|
99
|
-
// src/actions/build.ts
|
|
100
|
-
var import_chalk8 = __toESM(require("chalk"), 1);
|
|
101
|
-
|
|
102
|
-
// src/lib/checkResult.ts
|
|
103
|
-
var import_chalk = __toESM(require("chalk"), 1);
|
|
104
|
-
var checkResult = /* @__PURE__ */ __name((name, result, level = "error", exitOnFail = false) => {
|
|
105
|
-
if (result) {
|
|
106
|
-
const exiting = exitOnFail ? "[Exiting Process]" : "[Continuing]";
|
|
107
|
-
const chalkFunc = level === "error" ? import_chalk.default.red : import_chalk.default.yellow;
|
|
108
|
-
console[level](chalkFunc(`${name} had ${result} failures ${exiting}`));
|
|
109
|
-
if (exitOnFail) {
|
|
110
|
-
process.exit(result);
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
}, "checkResult");
|
|
114
|
-
|
|
115
|
-
// src/lib/dependencies/detectDuplicateDependencies.ts
|
|
116
|
-
var import_node_child_process = require("child_process");
|
|
117
|
-
|
|
118
|
-
// src/lib/processEx.ts
|
|
119
|
-
var import_chalk2 = __toESM(require("chalk"), 1);
|
|
120
|
-
|
|
121
|
-
// src/lib/withError.ts
|
|
122
|
-
var withError = /* @__PURE__ */ __name((ex, closure, predicate = (ex2) => ex2.name !== void 0 && ex2.message !== void 0) => {
|
|
123
|
-
return predicate(ex) ? closure(ex) : void 0;
|
|
124
|
-
}, "withError");
|
|
125
|
-
|
|
126
|
-
// src/lib/withErrnoException.ts
|
|
127
|
-
var withErrnoException = /* @__PURE__ */ __name((ex, closure) => {
|
|
128
|
-
return withError(ex, closure, (ex2) => ex2.errno !== void 0);
|
|
129
|
-
}, "withErrnoException");
|
|
130
|
-
|
|
131
|
-
// src/lib/processEx.ts
|
|
132
|
-
var processEx = /* @__PURE__ */ __name((ex) => {
|
|
133
|
-
const error = typeof ex === "string" ? new Error(ex) : ex;
|
|
134
|
-
const exitCode = withErrnoException(error, (error2) => {
|
|
135
|
-
if (error2.code === "ENOENT") {
|
|
136
|
-
console.error(import_chalk2.default.red(`'${error2.path}' not found.`));
|
|
137
|
-
} else {
|
|
138
|
-
console.error(import_chalk2.default.red(`Errno: ${error2.code}`));
|
|
139
|
-
}
|
|
140
|
-
return error2.errno ?? -1;
|
|
141
|
-
}) ?? withError(error, (error2) => {
|
|
142
|
-
console.error(import_chalk2.default.red(`${error2.name}: ${error2.message}`));
|
|
143
|
-
return -1;
|
|
144
|
-
}) ?? (() => {
|
|
145
|
-
console.error(import_chalk2.default.red(`Unexpected Error: ${JSON.stringify(ex, null, 2)}`));
|
|
146
|
-
return -1;
|
|
147
|
-
})();
|
|
148
|
-
process.exit(process.exitCode ?? exitCode);
|
|
149
|
-
}, "processEx");
|
|
150
|
-
|
|
151
|
-
// src/lib/safeExit.ts
|
|
152
|
-
var safeExit = /* @__PURE__ */ __name((func, exitOnFail = true) => {
|
|
153
|
-
try {
|
|
154
|
-
const result = func();
|
|
155
|
-
if (result && exitOnFail) {
|
|
156
|
-
process.exit(result);
|
|
157
|
-
}
|
|
158
|
-
return result;
|
|
159
|
-
} catch (ex) {
|
|
160
|
-
return processEx(ex);
|
|
161
|
-
}
|
|
162
|
-
}, "safeExit");
|
|
163
|
-
var safeExitAsync = /* @__PURE__ */ __name(async (func, exitOnFail = true) => {
|
|
164
|
-
try {
|
|
165
|
-
const result = await func();
|
|
166
|
-
if (result && exitOnFail) {
|
|
167
|
-
process.exit(result);
|
|
168
|
-
}
|
|
169
|
-
return result;
|
|
170
|
-
} catch (ex) {
|
|
171
|
-
return processEx(ex);
|
|
172
|
-
}
|
|
173
|
-
}, "safeExitAsync");
|
|
174
|
-
|
|
175
|
-
// src/lib/dependencies/DuplicateDetector.ts
|
|
176
|
-
var import_node_os = require("os");
|
|
177
|
-
var import_chalk3 = __toESM(require("chalk"), 1);
|
|
178
|
-
var import_uniq = __toESM(require("lodash/uniq.js"), 1);
|
|
179
|
-
|
|
180
|
-
// src/lib/jsonFormatters.ts
|
|
181
|
-
var multiLineToJSONArray = /* @__PURE__ */ __name((output) => {
|
|
182
|
-
const withCommas = output.replaceAll("\r\n", "").replaceAll("\n", ",");
|
|
183
|
-
const cleanCollection = withCommas.slice(0, Math.max(0, withCommas.length - 1));
|
|
184
|
-
const collection = `[${cleanCollection}]`;
|
|
185
|
-
return JSON.parse(collection);
|
|
186
|
-
}, "multiLineToJSONArray");
|
|
187
|
-
|
|
188
|
-
// src/lib/dependencies/DuplicateDetector.ts
|
|
189
|
-
var trimVirtualMeta = /* @__PURE__ */ __name((value) => {
|
|
190
|
-
const virtualParts = value.split("virtual:");
|
|
191
|
-
if (virtualParts.length > 1) {
|
|
192
|
-
const hashParts = virtualParts[1].split("#");
|
|
193
|
-
return virtualParts[0] + hashParts[1];
|
|
194
|
-
} else {
|
|
195
|
-
return value;
|
|
196
|
-
}
|
|
197
|
-
}, "trimVirtualMeta");
|
|
198
|
-
var trimObjectDependencyVirtualMeta = /* @__PURE__ */ __name((obj) => {
|
|
199
|
-
const resultObj = {};
|
|
200
|
-
for (const [key, value] of Object.entries(obj)) {
|
|
201
|
-
resultObj[trimVirtualMeta(key)] = {
|
|
202
|
-
descriptor: trimVirtualMeta(value.descriptor),
|
|
203
|
-
locator: trimVirtualMeta(value.locator)
|
|
204
|
-
};
|
|
205
|
-
}
|
|
206
|
-
return resultObj;
|
|
207
|
-
}, "trimObjectDependencyVirtualMeta");
|
|
208
|
-
var trimDependencyVirtualMeta = /* @__PURE__ */ __name((dependencies) => {
|
|
209
|
-
return dependencies.map((dependency) => {
|
|
210
|
-
return {
|
|
211
|
-
children: trimObjectDependencyVirtualMeta(dependency.children),
|
|
212
|
-
value: trimVirtualMeta(dependency.value)
|
|
213
|
-
};
|
|
214
|
-
});
|
|
215
|
-
}, "trimDependencyVirtualMeta");
|
|
216
|
-
var DuplicateDetector = class {
|
|
217
|
-
static {
|
|
218
|
-
__name(this, "DuplicateDetector");
|
|
219
|
-
}
|
|
220
|
-
dependency;
|
|
221
|
-
dependencyEntries;
|
|
222
|
-
constructor(output, dependency) {
|
|
223
|
-
this.dependency = dependency;
|
|
224
|
-
this.dependencyEntries = trimDependencyVirtualMeta(multiLineToJSONArray(output));
|
|
225
|
-
}
|
|
226
|
-
detect() {
|
|
227
|
-
const result = this.dependencyEntries.reduce(this.detectReducer, this.resultsFactory(this.dependency));
|
|
228
|
-
if (result.duplicateVersions.length > 0) {
|
|
229
|
-
console.log(import_chalk3.default.yellow(`${import_node_os.EOL}Duplicates found for: ${this.dependency}`));
|
|
230
|
-
const duplicateVersions = result.duplicateVersions.toString().replaceAll(",", `${import_node_os.EOL} `);
|
|
231
|
-
console.log(import_chalk3.default.grey(` ${duplicateVersions}`, import_node_os.EOL));
|
|
232
|
-
return 1;
|
|
233
|
-
} else {
|
|
234
|
-
console.log(`${this.dependency} - OK`);
|
|
235
|
-
return 0;
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
detectReducer(acc, entry) {
|
|
239
|
-
const version = Object.entries(entry.children).map(([k]) => k)[0];
|
|
240
|
-
if (!acc.currentVersion) {
|
|
241
|
-
acc.currentVersion = version;
|
|
242
|
-
return acc;
|
|
243
|
-
}
|
|
244
|
-
if (acc.currentVersion && acc.currentVersion !== version && !version.includes("@virtual:")) {
|
|
245
|
-
if (acc.duplicateVersions.length === 0) {
|
|
246
|
-
acc.duplicateVersions.push(acc.currentVersion);
|
|
247
|
-
}
|
|
248
|
-
acc.duplicateVersions.push(version);
|
|
249
|
-
acc.duplicateVersions = (0, import_uniq.default)(acc.duplicateVersions);
|
|
250
|
-
}
|
|
251
|
-
return acc;
|
|
252
|
-
}
|
|
253
|
-
resultsFactory = /* @__PURE__ */ __name((dependency) => ({
|
|
254
|
-
currentVersion: void 0,
|
|
255
|
-
dependency,
|
|
256
|
-
duplicateVersions: []
|
|
257
|
-
}), "resultsFactory");
|
|
258
|
-
};
|
|
259
|
-
|
|
260
|
-
// src/lib/dependencies/detectDuplicateDependencies.ts
|
|
261
|
-
var detectDuplicateDependencies = /* @__PURE__ */ __name((depsFromPackageJSON, DefaultDependencies2) => {
|
|
262
|
-
let exitCode = 0;
|
|
263
|
-
const dependencies = depsFromPackageJSON?.length ? depsFromPackageJSON : DefaultDependencies2;
|
|
264
|
-
return safeExit(() => {
|
|
265
|
-
if (dependencies) {
|
|
266
|
-
for (const dependency of dependencies) {
|
|
267
|
-
let output;
|
|
268
|
-
try {
|
|
269
|
-
const cmd = `yarn why ${dependency} --json`;
|
|
270
|
-
output = (0, import_node_child_process.execSync)(cmd).toString();
|
|
271
|
-
} catch (e) {
|
|
272
|
-
console.error(`Error running yarn why: ${e}`);
|
|
273
|
-
exitCode = 1;
|
|
274
|
-
continue;
|
|
275
|
-
}
|
|
276
|
-
if (output) {
|
|
277
|
-
exitCode = new DuplicateDetector(output, dependency).detect();
|
|
278
|
-
} else {
|
|
279
|
-
console.log(`${dependency} - N/A`);
|
|
280
|
-
if (depsFromPackageJSON) {
|
|
281
|
-
exitCode = 1;
|
|
282
|
-
console.log(`\u{1F6A8} Library ${dependency} was requested in package.json but not found`);
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
return exitCode;
|
|
287
|
-
} else {
|
|
288
|
-
console.log("\u{1F6A8} No dependencies where passed");
|
|
289
|
-
return exitCode;
|
|
290
|
-
}
|
|
291
|
-
});
|
|
292
|
-
}, "detectDuplicateDependencies");
|
|
293
|
-
|
|
294
|
-
// src/lib/file/constants.ts
|
|
295
|
-
var WINDOWS_NEWLINE_REGEX = /\r\n/g;
|
|
296
|
-
var CROSS_PLATFORM_NEWLINE = "\n";
|
|
297
|
-
|
|
298
|
-
// src/lib/file/fileLines.ts
|
|
299
|
-
var import_node_fs = require("fs");
|
|
300
|
-
|
|
301
|
-
// src/lib/string/empty.ts
|
|
302
|
-
var empty = /* @__PURE__ */ __name((value) => value?.trim().length === 0, "empty");
|
|
303
|
-
var notEmpty = /* @__PURE__ */ __name((value) => !empty(value), "notEmpty");
|
|
304
|
-
|
|
305
|
-
// src/lib/string/union.ts
|
|
306
|
-
var union = /* @__PURE__ */ __name((a, b) => /* @__PURE__ */ new Set([
|
|
307
|
-
...new Set(a),
|
|
308
|
-
...new Set(b)
|
|
309
|
-
]), "union");
|
|
310
|
-
|
|
311
|
-
// src/lib/file/ReadFileSyncOptions.ts
|
|
312
|
-
var defaultReadFileSyncOptions = {
|
|
313
|
-
encoding: "utf8"
|
|
314
|
-
};
|
|
315
|
-
|
|
316
|
-
// src/lib/file/fileLines.ts
|
|
317
|
-
var readLines = /* @__PURE__ */ __name((uri, options = defaultReadFileSyncOptions) => (0, import_node_fs.existsSync)(uri) ? (0, import_node_fs.readFileSync)(uri, options).replace(WINDOWS_NEWLINE_REGEX, CROSS_PLATFORM_NEWLINE).split(CROSS_PLATFORM_NEWLINE) : [], "readLines");
|
|
318
|
-
var readNonEmptyLines = /* @__PURE__ */ __name((uri, options = defaultReadFileSyncOptions) => readLines(uri, options).filter(notEmpty), "readNonEmptyLines");
|
|
319
|
-
var writeLines = /* @__PURE__ */ __name((uri, lines, options = defaultReadFileSyncOptions) => {
|
|
320
|
-
const existing = (0, import_node_fs.existsSync)(uri) ? (0, import_node_fs.readFileSync)(uri, options) : void 0;
|
|
321
|
-
const desired = lines.join(CROSS_PLATFORM_NEWLINE);
|
|
322
|
-
if (existing !== desired) (0, import_node_fs.writeFileSync)(uri, desired, options);
|
|
323
|
-
}, "writeLines");
|
|
324
|
-
|
|
325
|
-
// src/lib/generateIgnoreFiles.ts
|
|
326
|
-
var import_chalk4 = __toESM(require("chalk"), 1);
|
|
327
|
-
|
|
328
|
-
// src/lib/yarn/isYarnVersionOrGreater.ts
|
|
329
|
-
var import_node_child_process2 = require("child_process");
|
|
330
|
-
var isYarnVersionOrGreater = /* @__PURE__ */ __name((major, minor, patch) => {
|
|
331
|
-
const result = (0, import_node_child_process2.spawnSync)("yarn", [
|
|
332
|
-
"-v"
|
|
333
|
-
], {
|
|
334
|
-
encoding: "utf8",
|
|
335
|
-
shell: true
|
|
336
|
-
});
|
|
337
|
-
const version = result.stdout.toString().replaceAll("\n", "");
|
|
338
|
-
const versionNumbers = version.split(".").map((ver) => Number.parseInt(ver));
|
|
339
|
-
const majorDelta = versionNumbers[0] - major;
|
|
340
|
-
const minorDelta = versionNumbers[1] - (minor ?? versionNumbers[1]);
|
|
341
|
-
const patchDelta = versionNumbers[2] - (patch ?? versionNumbers[2]);
|
|
342
|
-
const majorOk = majorDelta >= 0;
|
|
343
|
-
const minorOk = majorDelta > 0 || minorDelta >= 0;
|
|
344
|
-
const patchOk = majorDelta > 0 || minorDelta > 0 || patchDelta >= 0;
|
|
345
|
-
return [
|
|
346
|
-
majorOk && minorOk && patchOk,
|
|
347
|
-
version
|
|
348
|
-
];
|
|
349
|
-
}, "isYarnVersionOrGreater");
|
|
350
|
-
|
|
351
|
-
// src/lib/yarn/workspace/yarnWorkspaces.ts
|
|
352
|
-
var import_node_child_process3 = require("child_process");
|
|
353
|
-
var yarnWorkspaces = /* @__PURE__ */ __name(() => {
|
|
354
|
-
const result = (0, import_node_child_process3.spawnSync)("yarn", [
|
|
355
|
-
"workspaces",
|
|
356
|
-
"list",
|
|
357
|
-
"--json",
|
|
358
|
-
"--recursive"
|
|
359
|
-
], {
|
|
360
|
-
encoding: "utf8",
|
|
361
|
-
shell: true
|
|
362
|
-
});
|
|
363
|
-
if (result.error) {
|
|
364
|
-
throw result.error;
|
|
365
|
-
}
|
|
366
|
-
return result.stdout.toString().split("\n").slice(0, -1).map((item) => {
|
|
367
|
-
return JSON.parse(item);
|
|
368
|
-
});
|
|
369
|
-
}, "yarnWorkspaces");
|
|
370
|
-
|
|
371
|
-
// src/lib/yarn/workspace/yarnWorkspace.ts
|
|
372
|
-
var yarnWorkspace = /* @__PURE__ */ __name((pkg) => {
|
|
373
|
-
const workspace = yarnWorkspaces().find(({ name }) => name === pkg);
|
|
374
|
-
if (!workspace) throw new Error(`Workspace ${pkg} not found`);
|
|
375
|
-
return workspace;
|
|
376
|
-
}, "yarnWorkspace");
|
|
377
|
-
|
|
378
|
-
// src/lib/yarn/yarnInitCwd.ts
|
|
379
|
-
var INIT_CWD = /* @__PURE__ */ __name(() => {
|
|
380
|
-
if (!process.env.INIT_CWD) console.error("Missing INIT_CWD");
|
|
381
|
-
return process.env.INIT_CWD;
|
|
382
|
-
}, "INIT_CWD");
|
|
383
|
-
|
|
384
|
-
// src/lib/generateIgnoreFiles.ts
|
|
385
|
-
var mergeEntries = /* @__PURE__ */ __name((a, b) => [
|
|
386
|
-
...union(a, b)
|
|
387
|
-
].sort(), "mergeEntries");
|
|
388
|
-
var generateIgnoreFiles = /* @__PURE__ */ __name((filename3, pkg) => {
|
|
389
|
-
console.log(import_chalk4.default.green(`Generate ${filename3} Files`));
|
|
390
|
-
const cwd4 = INIT_CWD() ?? ".";
|
|
391
|
-
const workspaces = pkg ? [
|
|
392
|
-
yarnWorkspace(pkg)
|
|
393
|
-
] : yarnWorkspaces();
|
|
394
|
-
const readEntries = /* @__PURE__ */ __name((location) => readNonEmptyLines(`${location}/${filename3}`), "readEntries");
|
|
395
|
-
const writeEntries = /* @__PURE__ */ __name((location, entries) => writeLines(`${location}/${filename3}`, entries), "writeEntries");
|
|
396
|
-
const results = workspaces.map(({ location, name }) => {
|
|
397
|
-
try {
|
|
398
|
-
writeEntries(location, mergeEntries(readEntries(cwd4), readEntries(location)));
|
|
399
|
-
return 0;
|
|
400
|
-
} catch (ex) {
|
|
401
|
-
const error = ex;
|
|
402
|
-
console.error(`Generate ${filename3} Files [${name}] [${error.message}]`);
|
|
403
|
-
return 1;
|
|
404
|
-
}
|
|
405
|
-
});
|
|
406
|
-
const succeeded = results.every((result) => result === 0);
|
|
407
|
-
return succeeded ? 0 : 1;
|
|
408
|
-
}, "generateIgnoreFiles");
|
|
409
|
-
|
|
410
|
-
// src/lib/loadConfig.ts
|
|
411
|
-
var import_chalk5 = __toESM(require("chalk"), 1);
|
|
412
|
-
var import_cosmiconfig = require("cosmiconfig");
|
|
413
|
-
var import_merge = __toESM(require("lodash/merge.js"), 1);
|
|
414
|
-
var config;
|
|
415
|
-
var loadConfig = /* @__PURE__ */ __name(async (params) => {
|
|
416
|
-
if (config) {
|
|
417
|
-
return (0, import_merge.default)({}, config, params);
|
|
418
|
-
}
|
|
419
|
-
const cosmicConfigResult = await (0, import_cosmiconfig.cosmiconfig)("xy", {
|
|
420
|
-
cache: true
|
|
421
|
-
}).search();
|
|
422
|
-
config = cosmicConfigResult?.config;
|
|
423
|
-
const configFilePath = cosmicConfigResult?.filepath;
|
|
424
|
-
if (configFilePath) {
|
|
425
|
-
console.log(import_chalk5.default.gray(`Loading config from ${configFilePath}`));
|
|
426
|
-
}
|
|
427
|
-
return (0, import_merge.default)({}, config, params);
|
|
428
|
-
}, "loadConfig");
|
|
429
|
-
|
|
430
|
-
// src/lib/parsedPackageJSON.ts
|
|
431
|
-
var import_node_fs2 = require("fs");
|
|
432
|
-
var parsedPackageJSON = /* @__PURE__ */ __name((path7) => {
|
|
433
|
-
const pathToPackageJSON = path7 ?? process.env.npm_package_json ?? "";
|
|
434
|
-
const packageJSON = (0, import_node_fs2.readFileSync)(pathToPackageJSON).toString();
|
|
435
|
-
return JSON.parse(packageJSON);
|
|
436
|
-
}, "parsedPackageJSON");
|
|
437
|
-
|
|
438
|
-
// src/lib/runSteps.ts
|
|
439
|
-
var import_node_child_process4 = require("child_process");
|
|
440
|
-
var import_node_fs3 = require("fs");
|
|
441
|
-
var import_chalk6 = __toESM(require("chalk"), 1);
|
|
442
|
-
var runSteps = /* @__PURE__ */ __name((name, steps, exitOnFail = true, messages) => {
|
|
443
|
-
return safeExit(() => {
|
|
444
|
-
const pkgName = process.env.npm_package_name;
|
|
445
|
-
console.log(import_chalk6.default.green(`${name} [${pkgName}]`));
|
|
446
|
-
let totalStatus = 0;
|
|
447
|
-
for (const [i, [command, args, config2]] of steps.entries()) {
|
|
448
|
-
if (messages?.[i]) {
|
|
449
|
-
console.log(import_chalk6.default.gray(messages?.[i]));
|
|
450
|
-
}
|
|
451
|
-
const argList = Array.isArray(args) ? args : args.split(" ");
|
|
452
|
-
if (command === "node" && !(0, import_node_fs3.existsSync)(argList[0])) {
|
|
453
|
-
throw new Error(`File not found [${argList[0]}]`);
|
|
454
|
-
}
|
|
455
|
-
const status = (0, import_node_child_process4.spawnSync)(command, Array.isArray(args) ? args : args.split(" "), {
|
|
456
|
-
...config2,
|
|
457
|
-
encoding: "utf8",
|
|
458
|
-
env: {
|
|
459
|
-
FORCE_COLOR: "3",
|
|
460
|
-
...process.env
|
|
461
|
-
},
|
|
462
|
-
shell: true,
|
|
463
|
-
stdio: "inherit"
|
|
464
|
-
}).status ?? 0;
|
|
465
|
-
checkResult(name, status, "error", exitOnFail);
|
|
466
|
-
totalStatus += status ?? 0;
|
|
467
|
-
}
|
|
468
|
-
return totalStatus;
|
|
469
|
-
}, !!exitOnFail);
|
|
470
|
-
}, "runSteps");
|
|
471
|
-
|
|
472
|
-
// src/lib/runStepsAsync.ts
|
|
473
|
-
var import_node_child_process5 = require("child_process");
|
|
474
|
-
var import_node_fs4 = require("fs");
|
|
475
|
-
var import_chalk7 = __toESM(require("chalk"), 1);
|
|
476
|
-
var runStepAsync = /* @__PURE__ */ __name((name, step, exitOnFail = true, message) => {
|
|
477
|
-
return new Promise((resolve) => {
|
|
478
|
-
const [command, args, config2] = step;
|
|
479
|
-
if (message) {
|
|
480
|
-
console.log(import_chalk7.default.gray(message));
|
|
481
|
-
}
|
|
482
|
-
const argList = Array.isArray(args) ? args : args.split(" ");
|
|
483
|
-
if (command === "node" && !(0, import_node_fs4.existsSync)(argList[0])) {
|
|
484
|
-
throw new Error(`File not found [${argList[0]}]`);
|
|
485
|
-
}
|
|
486
|
-
(0, import_node_child_process5.spawn)(command, Array.isArray(args) ? args : args.split(" "), {
|
|
487
|
-
...config2,
|
|
488
|
-
env: {
|
|
489
|
-
FORCE_COLOR: "3",
|
|
490
|
-
...process.env
|
|
491
|
-
},
|
|
492
|
-
shell: true,
|
|
493
|
-
stdio: "inherit"
|
|
494
|
-
}).on("close", (code) => {
|
|
495
|
-
if (code) {
|
|
496
|
-
console.error(import_chalk7.default.red(`Command Exited With Non-Zero Result [${import_chalk7.default.gray(code)}] | ${import_chalk7.default.yellow(command)} ${import_chalk7.default.white(Array.isArray(args) ? args.join(" ") : args)}`));
|
|
497
|
-
checkResult(name, code, "error", exitOnFail);
|
|
498
|
-
resolve(code);
|
|
499
|
-
} else {
|
|
500
|
-
resolve(0);
|
|
501
|
-
}
|
|
502
|
-
});
|
|
503
|
-
});
|
|
504
|
-
}, "runStepAsync");
|
|
505
|
-
var runStepsAsync = /* @__PURE__ */ __name(async (name, steps, exitOnFail = true, messages) => {
|
|
506
|
-
return await safeExitAsync(async () => {
|
|
507
|
-
const pkgName = process.env.npm_package_name;
|
|
508
|
-
console.log(import_chalk7.default.green(`${name} [${pkgName}]`));
|
|
509
|
-
let result = 0;
|
|
510
|
-
for (const [i, step] of steps.entries()) {
|
|
511
|
-
result += await runStepAsync(name, step, exitOnFail, messages?.[i]);
|
|
512
|
-
}
|
|
513
|
-
return result;
|
|
514
|
-
});
|
|
515
|
-
}, "runStepsAsync");
|
|
516
|
-
|
|
517
|
-
// src/actions/build.ts
|
|
518
|
-
var build = /* @__PURE__ */ __name(async ({ incremental, jobs, target, verbose, pkg }) => {
|
|
519
|
-
const start = Date.now();
|
|
520
|
-
const pkgOptions = pkg ? [
|
|
521
|
-
pkg
|
|
522
|
-
] : [];
|
|
523
|
-
const incrementalOptions = incremental ? [
|
|
524
|
-
"-i"
|
|
525
|
-
] : [];
|
|
526
|
-
const verboseOptions = verbose ? [
|
|
527
|
-
"-v"
|
|
528
|
-
] : [];
|
|
529
|
-
const targetOptions = target ? [
|
|
530
|
-
"-t",
|
|
531
|
-
target
|
|
532
|
-
] : [];
|
|
533
|
-
const jobsOptions = jobs ? [
|
|
534
|
-
"-j",
|
|
535
|
-
`${jobs}`
|
|
536
|
-
] : [];
|
|
537
|
-
if (jobs) {
|
|
538
|
-
console.log(import_chalk8.default.blue(`Jobs set to [${jobs}]`));
|
|
539
|
-
}
|
|
540
|
-
const result = await runStepsAsync(`Build${incremental ? "-Incremental" : ""} [${pkg ?? "All"}]`, [
|
|
541
|
-
[
|
|
542
|
-
"yarn",
|
|
543
|
-
[
|
|
544
|
-
"xy",
|
|
545
|
-
"compile",
|
|
546
|
-
...pkgOptions,
|
|
547
|
-
...targetOptions,
|
|
548
|
-
...verboseOptions,
|
|
549
|
-
...jobsOptions,
|
|
550
|
-
...incrementalOptions
|
|
551
|
-
]
|
|
552
|
-
],
|
|
553
|
-
[
|
|
554
|
-
"yarn",
|
|
555
|
-
[
|
|
556
|
-
"xy",
|
|
557
|
-
"lint",
|
|
558
|
-
...pkgOptions,
|
|
559
|
-
...verboseOptions,
|
|
560
|
-
...incrementalOptions
|
|
561
|
-
]
|
|
562
|
-
],
|
|
563
|
-
[
|
|
564
|
-
"yarn",
|
|
565
|
-
[
|
|
566
|
-
"xy",
|
|
567
|
-
"deps",
|
|
568
|
-
...pkgOptions,
|
|
569
|
-
...verboseOptions,
|
|
570
|
-
...jobsOptions,
|
|
571
|
-
...incrementalOptions
|
|
572
|
-
]
|
|
573
|
-
]
|
|
574
|
-
]);
|
|
575
|
-
console.log(`${import_chalk8.default.gray("Built in")} [${import_chalk8.default.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${import_chalk8.default.gray("seconds")}`);
|
|
576
|
-
return result;
|
|
577
|
-
}, "build");
|
|
578
|
-
|
|
579
|
-
// src/actions/clean.ts
|
|
580
|
-
var clean = /* @__PURE__ */ __name(async ({ verbose, pkg }) => {
|
|
581
|
-
return pkg ? await cleanPackage({
|
|
582
|
-
pkg,
|
|
583
|
-
verbose
|
|
584
|
-
}) : cleanAll({
|
|
585
|
-
verbose
|
|
586
|
-
});
|
|
587
|
-
}, "clean");
|
|
588
|
-
var cleanPackage = /* @__PURE__ */ __name(({ pkg }) => {
|
|
589
|
-
return runStepsAsync(`Clean [${pkg}]`, [
|
|
590
|
-
[
|
|
591
|
-
"yarn",
|
|
592
|
-
[
|
|
593
|
-
"workspace",
|
|
594
|
-
pkg,
|
|
595
|
-
"run",
|
|
596
|
-
"package-clean"
|
|
597
|
-
]
|
|
598
|
-
]
|
|
599
|
-
]);
|
|
600
|
-
}, "cleanPackage");
|
|
601
|
-
var cleanAll = /* @__PURE__ */ __name(({ verbose }) => {
|
|
602
|
-
const verboseOptions = verbose ? [
|
|
603
|
-
"--verbose"
|
|
604
|
-
] : [
|
|
605
|
-
"--no-verbose"
|
|
606
|
-
];
|
|
607
|
-
return runStepsAsync("Clean", [
|
|
608
|
-
[
|
|
609
|
-
"yarn",
|
|
610
|
-
[
|
|
611
|
-
"workspaces foreach",
|
|
612
|
-
"-pA",
|
|
613
|
-
"--jobs 64",
|
|
614
|
-
...verboseOptions,
|
|
615
|
-
"run",
|
|
616
|
-
"package-clean"
|
|
617
|
-
]
|
|
618
|
-
]
|
|
619
|
-
]);
|
|
620
|
-
}, "cleanAll");
|
|
621
|
-
|
|
622
|
-
// src/actions/clean-docs.ts
|
|
623
|
-
var import_node_path = __toESM(require("path"), 1);
|
|
624
|
-
var import_chalk9 = __toESM(require("chalk"), 1);
|
|
625
|
-
var import_rimraf = require("rimraf");
|
|
626
|
-
var cleanDocs = /* @__PURE__ */ __name(() => {
|
|
627
|
-
const pkgName = process.env.npm_package_name;
|
|
628
|
-
console.log(import_chalk9.default.green(`Cleaning Docs [${pkgName}]`));
|
|
629
|
-
for (const { location } of yarnWorkspaces()) (0, import_rimraf.rimrafSync)(import_node_path.default.join(location, "docs"), {
|
|
630
|
-
glob: true
|
|
631
|
-
});
|
|
632
|
-
return 0;
|
|
633
|
-
}, "cleanDocs");
|
|
634
|
-
|
|
635
|
-
// src/actions/compile.ts
|
|
636
|
-
var import_chalk10 = __toESM(require("chalk"), 1);
|
|
637
|
-
var compile = /* @__PURE__ */ __name(({ verbose, target, pkg, incremental, publint: publint2 }) => {
|
|
638
|
-
return pkg ? compilePackage({
|
|
639
|
-
pkg,
|
|
640
|
-
publint: publint2,
|
|
641
|
-
target,
|
|
642
|
-
verbose
|
|
643
|
-
}) : compileAll({
|
|
644
|
-
incremental,
|
|
645
|
-
publint: publint2,
|
|
646
|
-
target,
|
|
647
|
-
verbose
|
|
648
|
-
});
|
|
649
|
-
}, "compile");
|
|
650
|
-
var compilePackage = /* @__PURE__ */ __name(({ target, pkg }) => {
|
|
651
|
-
const targetOptions = target ? [
|
|
652
|
-
"-t",
|
|
653
|
-
target
|
|
654
|
-
] : [];
|
|
655
|
-
return runSteps(`Compile [${pkg}]`, [
|
|
656
|
-
[
|
|
657
|
-
"yarn",
|
|
658
|
-
[
|
|
659
|
-
"workspace",
|
|
660
|
-
pkg,
|
|
661
|
-
"run",
|
|
662
|
-
"package-compile",
|
|
663
|
-
...targetOptions
|
|
664
|
-
]
|
|
665
|
-
]
|
|
666
|
-
]);
|
|
667
|
-
}, "compilePackage");
|
|
668
|
-
var compileAll = /* @__PURE__ */ __name(({ jobs, verbose, target, incremental }) => {
|
|
669
|
-
const start = Date.now();
|
|
670
|
-
const verboseOptions = verbose ? [
|
|
671
|
-
"--verbose"
|
|
672
|
-
] : [
|
|
673
|
-
"--no-verbose"
|
|
674
|
-
];
|
|
675
|
-
const targetOptions = target ? [
|
|
676
|
-
"-t",
|
|
677
|
-
target
|
|
678
|
-
] : [];
|
|
679
|
-
const incrementalOptions = incremental ? [
|
|
680
|
-
"--since",
|
|
681
|
-
"-Apt",
|
|
682
|
-
"--topological-dev"
|
|
683
|
-
] : [
|
|
684
|
-
"--parallel",
|
|
685
|
-
"-Apt",
|
|
686
|
-
"--topological-dev"
|
|
687
|
-
];
|
|
688
|
-
const jobsOptions = jobs ? [
|
|
689
|
-
"-j",
|
|
690
|
-
`${jobs}`
|
|
691
|
-
] : [];
|
|
692
|
-
if (jobs) {
|
|
693
|
-
console.log(import_chalk10.default.blue(`Jobs set to [${jobs}]`));
|
|
694
|
-
}
|
|
695
|
-
const result = runSteps(`Compile${incremental ? "-Incremental" : ""} [All]`, [
|
|
696
|
-
[
|
|
697
|
-
"yarn",
|
|
698
|
-
[
|
|
699
|
-
"workspaces",
|
|
700
|
-
"foreach",
|
|
701
|
-
...incrementalOptions,
|
|
702
|
-
...jobsOptions,
|
|
703
|
-
...verboseOptions,
|
|
704
|
-
"run",
|
|
705
|
-
"package-compile",
|
|
706
|
-
...targetOptions
|
|
707
|
-
]
|
|
708
|
-
]
|
|
709
|
-
]);
|
|
710
|
-
console.log(`${import_chalk10.default.gray("Compiled in")} [${import_chalk10.default.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${import_chalk10.default.gray("seconds")}`);
|
|
711
|
-
return result;
|
|
712
|
-
}, "compileAll");
|
|
713
|
-
|
|
714
|
-
// src/actions/copy-assets.ts
|
|
715
|
-
var import_posix = __toESM(require("path/posix"), 1);
|
|
716
|
-
var import_chalk11 = __toESM(require("chalk"), 1);
|
|
717
|
-
var import_cpy = __toESM(require("cpy"), 1);
|
|
718
|
-
var copyPackageTargetAssets = /* @__PURE__ */ __name(async (target, name, location) => {
|
|
719
|
-
try {
|
|
720
|
-
const values = await (0, import_cpy.default)([
|
|
721
|
-
"**/*.jpg",
|
|
722
|
-
"**/*.png",
|
|
723
|
-
"**/*.gif",
|
|
724
|
-
"**/*.svg",
|
|
725
|
-
"**/*.webp",
|
|
726
|
-
"**/*.sass",
|
|
727
|
-
"**/*.scss",
|
|
728
|
-
"**/*.gif",
|
|
729
|
-
"**/*.css"
|
|
730
|
-
], `../dist/${target}`, {
|
|
731
|
-
cwd: import_posix.default.join(process.cwd(), location, "src"),
|
|
732
|
-
flat: false
|
|
733
|
-
});
|
|
734
|
-
for (const value of values) {
|
|
735
|
-
console.log(`${value.split("/").pop()} => ./dist/${target}`);
|
|
736
|
-
}
|
|
737
|
-
return 0;
|
|
738
|
-
} catch (reason) {
|
|
739
|
-
console.log(`Copy Failed: ${name}: ${reason}`);
|
|
740
|
-
return 1;
|
|
741
|
-
}
|
|
742
|
-
}, "copyPackageTargetAssets");
|
|
743
|
-
var copyTargetAssets = /* @__PURE__ */ __name(async (target, pkg) => {
|
|
744
|
-
const workspaces = yarnWorkspaces();
|
|
745
|
-
console.log(import_chalk11.default.green(`Copying Assets [${target.toUpperCase()}]`));
|
|
746
|
-
const workspaceList = workspaces.filter(({ name }) => {
|
|
747
|
-
return pkg === void 0 || name === pkg;
|
|
748
|
-
});
|
|
749
|
-
if (workspaceList.length === 0) {
|
|
750
|
-
console.error(`Package not found [${pkg}]`);
|
|
751
|
-
} else {
|
|
752
|
-
const results = await Promise.all(workspaceList.map(async (workspace) => {
|
|
753
|
-
const { location, name } = workspace;
|
|
754
|
-
return await copyPackageTargetAssets(target, name, location);
|
|
755
|
-
}));
|
|
756
|
-
return results.reduce((prev, result) => prev || result, 0);
|
|
757
|
-
}
|
|
758
|
-
return 0;
|
|
759
|
-
}, "copyTargetAssets");
|
|
760
|
-
var copyAssets = /* @__PURE__ */ __name(async ({ target, pkg }) => {
|
|
761
|
-
switch (target) {
|
|
762
|
-
case "esm": {
|
|
763
|
-
return await copyTargetAssets("esm", pkg);
|
|
764
|
-
}
|
|
765
|
-
case "cjs": {
|
|
766
|
-
return await copyTargetAssets("cjs", pkg);
|
|
767
|
-
}
|
|
768
|
-
default: {
|
|
769
|
-
return await copyTargetAssets("esm", pkg) || await copyTargetAssets("cjs", pkg);
|
|
770
|
-
}
|
|
771
|
-
}
|
|
772
|
-
}, "copyAssets");
|
|
773
|
-
|
|
774
|
-
// src/actions/cycle.ts
|
|
775
|
-
var cycle = /* @__PURE__ */ __name(() => {
|
|
776
|
-
const rules = [
|
|
777
|
-
`"'import/no-cycle': [1, { maxDepth: 6 }]"`,
|
|
778
|
-
`"'import/no-internal-modules': ['off']"`
|
|
779
|
-
];
|
|
780
|
-
return runSteps("Cycle", [
|
|
781
|
-
[
|
|
782
|
-
"yarn",
|
|
783
|
-
[
|
|
784
|
-
"eslint",
|
|
785
|
-
...rules.flatMap((rule) => [
|
|
786
|
-
"--rule",
|
|
787
|
-
rule
|
|
788
|
-
]),
|
|
789
|
-
"--cache",
|
|
790
|
-
"."
|
|
791
|
-
]
|
|
792
|
-
]
|
|
793
|
-
]);
|
|
794
|
-
}, "cycle");
|
|
795
|
-
|
|
796
|
-
// src/actions/dead.ts
|
|
797
|
-
var dead = /* @__PURE__ */ __name(() => {
|
|
798
|
-
return runSteps("Dead", [
|
|
799
|
-
[
|
|
800
|
-
"yarn",
|
|
801
|
-
[
|
|
802
|
-
"ts-prune",
|
|
803
|
-
"-p",
|
|
804
|
-
"tsconfig.json"
|
|
805
|
-
]
|
|
806
|
-
]
|
|
807
|
-
]);
|
|
808
|
-
}, "dead");
|
|
809
|
-
|
|
810
|
-
// src/actions/deploy.ts
|
|
811
|
-
var deploy = /* @__PURE__ */ __name(() => {
|
|
812
|
-
return runSteps("Deploy [Patch]", [
|
|
813
|
-
[
|
|
814
|
-
"yarn",
|
|
815
|
-
"workspaces foreach --all version patch --deferred"
|
|
816
|
-
],
|
|
817
|
-
[
|
|
818
|
-
"yarn",
|
|
819
|
-
"xy clean"
|
|
820
|
-
],
|
|
821
|
-
[
|
|
822
|
-
"yarn",
|
|
823
|
-
"xy build"
|
|
824
|
-
],
|
|
825
|
-
[
|
|
826
|
-
"yarn",
|
|
827
|
-
"version apply --all"
|
|
828
|
-
],
|
|
829
|
-
[
|
|
830
|
-
"yarn",
|
|
831
|
-
"workspaces foreach --all --parallel npm publish"
|
|
832
|
-
]
|
|
833
|
-
]);
|
|
834
|
-
}, "deploy");
|
|
835
|
-
|
|
836
|
-
// src/actions/deploy-major.ts
|
|
837
|
-
var deployMajor = /* @__PURE__ */ __name(() => {
|
|
838
|
-
return runSteps("Deploy [Major]", [
|
|
839
|
-
[
|
|
840
|
-
"yarn",
|
|
841
|
-
"workspaces foreach --all version major --deferred"
|
|
842
|
-
],
|
|
843
|
-
[
|
|
844
|
-
"yarn",
|
|
845
|
-
"xy clean"
|
|
846
|
-
],
|
|
847
|
-
[
|
|
848
|
-
"yarn",
|
|
849
|
-
"xy build"
|
|
850
|
-
],
|
|
851
|
-
[
|
|
852
|
-
"yarn",
|
|
853
|
-
"version apply --all"
|
|
854
|
-
],
|
|
855
|
-
[
|
|
856
|
-
"yarn",
|
|
857
|
-
"workspaces foreach --all --parallel npm publish"
|
|
858
|
-
]
|
|
859
|
-
]);
|
|
860
|
-
}, "deployMajor");
|
|
861
|
-
|
|
862
|
-
// src/actions/deploy-minor.ts
|
|
863
|
-
var deployMinor = /* @__PURE__ */ __name(() => {
|
|
864
|
-
return runSteps("Deploy [Minor]", [
|
|
865
|
-
[
|
|
866
|
-
"yarn",
|
|
867
|
-
"workspaces foreach --all version minor --deferred"
|
|
868
|
-
],
|
|
869
|
-
[
|
|
870
|
-
"yarn",
|
|
871
|
-
"xy clean"
|
|
872
|
-
],
|
|
873
|
-
[
|
|
874
|
-
"yarn",
|
|
875
|
-
"xy build"
|
|
876
|
-
],
|
|
877
|
-
[
|
|
878
|
-
"yarn",
|
|
879
|
-
"version apply --all"
|
|
880
|
-
],
|
|
881
|
-
[
|
|
882
|
-
"yarn",
|
|
883
|
-
"workspaces foreach --all --parallel npm publish"
|
|
884
|
-
]
|
|
885
|
-
]);
|
|
886
|
-
}, "deployMinor");
|
|
887
|
-
|
|
888
|
-
// src/actions/deploy-next.ts
|
|
889
|
-
var deployNext = /* @__PURE__ */ __name(() => {
|
|
890
|
-
return runSteps("Deploy [Next]", [
|
|
891
|
-
[
|
|
892
|
-
"yarn",
|
|
893
|
-
"workspaces foreach --all version minor --deferred"
|
|
894
|
-
],
|
|
895
|
-
[
|
|
896
|
-
"yarn",
|
|
897
|
-
"xy clean"
|
|
898
|
-
],
|
|
899
|
-
[
|
|
900
|
-
"yarn",
|
|
901
|
-
"xy build"
|
|
902
|
-
],
|
|
903
|
-
[
|
|
904
|
-
"yarn",
|
|
905
|
-
"version apply --all --prerelease"
|
|
906
|
-
],
|
|
907
|
-
[
|
|
908
|
-
"yarn",
|
|
909
|
-
"workspaces foreach --all --parallel npm publish --tag next"
|
|
910
|
-
]
|
|
911
|
-
]);
|
|
912
|
-
}, "deployNext");
|
|
913
|
-
|
|
914
|
-
// src/actions/deps.ts
|
|
915
|
-
var import_chalk12 = __toESM(require("chalk"), 1);
|
|
916
|
-
var deps = /* @__PURE__ */ __name(({ pkg, incremental }) => {
|
|
917
|
-
pkg ? depsPackage({
|
|
918
|
-
pkg
|
|
919
|
-
}) : depsAll({
|
|
920
|
-
incremental
|
|
921
|
-
});
|
|
922
|
-
return 0;
|
|
923
|
-
}, "deps");
|
|
924
|
-
var depsPackage = /* @__PURE__ */ __name(({ pkg }) => {
|
|
925
|
-
const steps = [
|
|
926
|
-
[
|
|
927
|
-
"yarn",
|
|
928
|
-
[
|
|
929
|
-
"workspace",
|
|
930
|
-
pkg,
|
|
931
|
-
"run",
|
|
932
|
-
"package-deps"
|
|
933
|
-
]
|
|
934
|
-
]
|
|
935
|
-
];
|
|
936
|
-
return runSteps(`Deps [${pkg}]`, [
|
|
937
|
-
...steps
|
|
938
|
-
]);
|
|
939
|
-
}, "depsPackage");
|
|
940
|
-
var depsAll = /* @__PURE__ */ __name(({ incremental, jobs, verbose }) => {
|
|
941
|
-
const start = Date.now();
|
|
942
|
-
const jobsOptions = jobs ? [
|
|
943
|
-
"-j",
|
|
944
|
-
`${jobs}`
|
|
945
|
-
] : [];
|
|
946
|
-
const verboseOptions = verbose ? [
|
|
947
|
-
"--verbose"
|
|
948
|
-
] : [
|
|
949
|
-
"--no-verbose"
|
|
950
|
-
];
|
|
951
|
-
if (jobs) {
|
|
952
|
-
console.log(import_chalk12.default.blue(`Jobs set to [${jobs}]`));
|
|
953
|
-
}
|
|
954
|
-
const incrementalOptions = incremental ? [
|
|
955
|
-
"--since",
|
|
956
|
-
"-pA"
|
|
957
|
-
] : [
|
|
958
|
-
"-pA"
|
|
959
|
-
];
|
|
960
|
-
const steps = [
|
|
961
|
-
[
|
|
962
|
-
"yarn",
|
|
963
|
-
[
|
|
964
|
-
"workspaces",
|
|
965
|
-
"foreach",
|
|
966
|
-
...jobsOptions,
|
|
967
|
-
...incrementalOptions,
|
|
968
|
-
...verboseOptions,
|
|
969
|
-
"run",
|
|
970
|
-
"package-deps"
|
|
971
|
-
]
|
|
972
|
-
]
|
|
973
|
-
];
|
|
974
|
-
const result = runSteps(`Deps${incremental ? "-Incremental" : ""} [All]`, [
|
|
975
|
-
...steps
|
|
976
|
-
]);
|
|
977
|
-
console.log(`${import_chalk12.default.gray("Dep checked in")} [${import_chalk12.default.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${import_chalk12.default.gray("seconds")}`);
|
|
978
|
-
return result;
|
|
979
|
-
}, "depsAll");
|
|
980
|
-
|
|
981
|
-
// src/actions/dupdeps.ts
|
|
982
|
-
var import_chalk13 = __toESM(require("chalk"), 1);
|
|
983
|
-
var dupdeps = /* @__PURE__ */ __name(() => {
|
|
984
|
-
console.log(import_chalk13.default.green("Checking all Dependencies for Duplicates"));
|
|
985
|
-
const allDependencies = parsedPackageJSON()?.dependencies;
|
|
986
|
-
const dependencies = Object.entries(allDependencies).map(([k]) => k);
|
|
987
|
-
return detectDuplicateDependencies(dependencies);
|
|
988
|
-
}, "dupdeps");
|
|
989
|
-
|
|
990
|
-
// src/actions/fix.ts
|
|
991
|
-
var fix = /* @__PURE__ */ __name(() => {
|
|
992
|
-
return runSteps("Fix", [
|
|
993
|
-
[
|
|
994
|
-
"yarn",
|
|
995
|
-
[
|
|
996
|
-
"eslint",
|
|
997
|
-
".",
|
|
998
|
-
"--fix",
|
|
999
|
-
"--cache"
|
|
1000
|
-
]
|
|
1001
|
-
]
|
|
1002
|
-
]);
|
|
1003
|
-
}, "fix");
|
|
1004
|
-
|
|
1005
|
-
// src/actions/gen-docs.ts
|
|
1006
|
-
var genDocs = /* @__PURE__ */ __name(({ pkg, incremental }) => {
|
|
1007
|
-
return pkg ? genDocsPackage({
|
|
1008
|
-
pkg
|
|
1009
|
-
}) : genDocsAll({
|
|
1010
|
-
incremental
|
|
1011
|
-
});
|
|
1012
|
-
}, "genDocs");
|
|
1013
|
-
var genDocsPackage = /* @__PURE__ */ __name(({ pkg }) => {
|
|
1014
|
-
const steps = [
|
|
1015
|
-
[
|
|
1016
|
-
"yarn",
|
|
1017
|
-
[
|
|
1018
|
-
"workspace",
|
|
1019
|
-
pkg,
|
|
1020
|
-
"run",
|
|
1021
|
-
"package-gen-docs"
|
|
1022
|
-
]
|
|
1023
|
-
]
|
|
1024
|
-
];
|
|
1025
|
-
return runSteps(`GenDocs [${pkg}]`, [
|
|
1026
|
-
...steps
|
|
1027
|
-
]);
|
|
1028
|
-
}, "genDocsPackage");
|
|
1029
|
-
var genDocsAll = /* @__PURE__ */ __name(({ incremental }) => {
|
|
1030
|
-
const incrementalOptions = incremental ? [
|
|
1031
|
-
"--since",
|
|
1032
|
-
"-pA"
|
|
1033
|
-
] : [
|
|
1034
|
-
"-pA"
|
|
1035
|
-
];
|
|
1036
|
-
const steps = [
|
|
1037
|
-
[
|
|
1038
|
-
"yarn",
|
|
1039
|
-
[
|
|
1040
|
-
"workspaces",
|
|
1041
|
-
"foreach",
|
|
1042
|
-
...incrementalOptions,
|
|
1043
|
-
"run",
|
|
1044
|
-
"package-gen-docs"
|
|
1045
|
-
]
|
|
1046
|
-
]
|
|
1047
|
-
];
|
|
1048
|
-
return runSteps(`GenDocs [All${incremental ? "-Incremental" : ""}]`, [
|
|
1049
|
-
...steps
|
|
1050
|
-
]);
|
|
1051
|
-
}, "genDocsAll");
|
|
1052
|
-
|
|
1053
|
-
// src/actions/gitignore-gen.ts
|
|
1054
|
-
var filename = ".gitignore";
|
|
1055
|
-
var gitignoreGen = /* @__PURE__ */ __name((pkg) => generateIgnoreFiles(filename, pkg), "gitignoreGen");
|
|
1056
|
-
|
|
1057
|
-
// src/actions/gitlint.ts
|
|
1058
|
-
var import_chalk14 = __toESM(require("chalk"), 1);
|
|
1059
|
-
var import_parse_git_config = __toESM(require("parse-git-config"), 1);
|
|
1060
|
-
var gitlint = /* @__PURE__ */ __name(() => {
|
|
1061
|
-
console.log(`
|
|
1062
|
-
Gitlint Start [${process.cwd()}]
|
|
1063
|
-
`);
|
|
1064
|
-
let valid = 0;
|
|
1065
|
-
let warnings = 0;
|
|
1066
|
-
const errors = 0;
|
|
1067
|
-
const gitConfig = import_parse_git_config.default.sync();
|
|
1068
|
-
const warn = /* @__PURE__ */ __name((message) => {
|
|
1069
|
-
console.warn(import_chalk14.default.yellow(`Warning: ${message}`));
|
|
1070
|
-
warnings++;
|
|
1071
|
-
}, "warn");
|
|
1072
|
-
if (gitConfig.core.ignorecase) {
|
|
1073
|
-
warn("Please set core.ignorecase to FALSE in .git/config file [run yarn gitlint-fix]");
|
|
1074
|
-
} else {
|
|
1075
|
-
valid++;
|
|
1076
|
-
}
|
|
1077
|
-
if (gitConfig.core.autocrlf === false) {
|
|
1078
|
-
valid++;
|
|
1079
|
-
} else {
|
|
1080
|
-
warn("Please set core.autocrlf to FALSE in .git/config file [run yarn gitlint-fix]");
|
|
1081
|
-
}
|
|
1082
|
-
if (gitConfig.core.eol === "lf") {
|
|
1083
|
-
valid++;
|
|
1084
|
-
} else {
|
|
1085
|
-
warn('Please set core.eol to "lf" in .git/config file [run yarn gitlint-fix]');
|
|
1086
|
-
}
|
|
1087
|
-
const resultMessages = [];
|
|
1088
|
-
if (valid > 0) {
|
|
1089
|
-
resultMessages.push(import_chalk14.default.green(`Passed: ${valid}`));
|
|
1090
|
-
}
|
|
1091
|
-
if (warnings > 0) {
|
|
1092
|
-
resultMessages.push(import_chalk14.default.yellow(`Warnings: ${warnings}`));
|
|
1093
|
-
}
|
|
1094
|
-
if (errors > 0) {
|
|
1095
|
-
resultMessages.push(import_chalk14.default.red(` Errors: ${errors}`));
|
|
1096
|
-
}
|
|
1097
|
-
console.warn(`Gitlint Finish [ ${resultMessages.join(" | ")} ]
|
|
1098
|
-
`);
|
|
1099
|
-
return warnings + errors === 0 ? 1 : 0;
|
|
1100
|
-
}, "gitlint");
|
|
1101
|
-
|
|
1102
|
-
// src/actions/gitlint-fix.ts
|
|
1103
|
-
var import_node_child_process6 = require("child_process");
|
|
1104
|
-
var import_chalk15 = __toESM(require("chalk"), 1);
|
|
1105
|
-
var import_parse_git_config2 = __toESM(require("parse-git-config"), 1);
|
|
1106
|
-
var gitlintFix = /* @__PURE__ */ __name(() => {
|
|
1107
|
-
console.log(`
|
|
1108
|
-
Gitlint Fix Start [${process.cwd()}]
|
|
1109
|
-
`);
|
|
1110
|
-
const gitConfig = import_parse_git_config2.default.sync();
|
|
1111
|
-
if (gitConfig.core.ignorecase) {
|
|
1112
|
-
(0, import_node_child_process6.execSync)("git config core.ignorecase false", {
|
|
1113
|
-
stdio: "inherit"
|
|
1114
|
-
});
|
|
1115
|
-
console.warn(import_chalk15.default.yellow("\nGitlint Fix: Updated core.ignorecase to be false\n"));
|
|
1116
|
-
}
|
|
1117
|
-
if (gitConfig.core.autocrlf !== false) {
|
|
1118
|
-
(0, import_node_child_process6.execSync)("git config core.autocrlf false", {
|
|
1119
|
-
stdio: "inherit"
|
|
1120
|
-
});
|
|
1121
|
-
console.warn(import_chalk15.default.yellow("\nGitlint Fix: Updated core.autocrlf to be false\n"));
|
|
1122
|
-
}
|
|
1123
|
-
if (gitConfig.core.eol !== "lf") {
|
|
1124
|
-
(0, import_node_child_process6.execSync)("git config core.eol lf", {
|
|
1125
|
-
stdio: "inherit"
|
|
1126
|
-
});
|
|
1127
|
-
console.warn(import_chalk15.default.yellow('\nGitlint Fix: Updated core.eol to be "lf"\n'));
|
|
1128
|
-
}
|
|
1129
|
-
return 1;
|
|
1130
|
-
}, "gitlintFix");
|
|
1131
|
-
|
|
1132
|
-
// src/actions/license.ts
|
|
1133
|
-
var import_chalk16 = __toESM(require("chalk"), 1);
|
|
1134
|
-
var import_license_checker = require("license-checker");
|
|
1135
|
-
var license = /* @__PURE__ */ __name(async (pkg) => {
|
|
1136
|
-
const workspaces = yarnWorkspaces();
|
|
1137
|
-
const workspaceList = workspaces.filter(({ name }) => {
|
|
1138
|
-
return pkg === void 0 || name === pkg;
|
|
1139
|
-
});
|
|
1140
|
-
const exclude = /* @__PURE__ */ new Set([
|
|
1141
|
-
"MIT",
|
|
1142
|
-
"MIT*",
|
|
1143
|
-
"ISC",
|
|
1144
|
-
"Apache-2.0",
|
|
1145
|
-
"BSD",
|
|
1146
|
-
"BSD*",
|
|
1147
|
-
"BSD-2-Clause",
|
|
1148
|
-
"BSD-3-Clause",
|
|
1149
|
-
"CC-BY-4.0",
|
|
1150
|
-
"Unlicense",
|
|
1151
|
-
"CC-BY-3.0",
|
|
1152
|
-
"CC0-1.0",
|
|
1153
|
-
"LGPL-3.0-only",
|
|
1154
|
-
"LGPL-3.0",
|
|
1155
|
-
"LGPL-3.0-or-later",
|
|
1156
|
-
"Python-2.0"
|
|
1157
|
-
]);
|
|
1158
|
-
console.log(import_chalk16.default.green("License Checker"));
|
|
1159
|
-
return (await Promise.all(workspaceList.map(({ location, name }) => {
|
|
1160
|
-
return new Promise((resolve) => {
|
|
1161
|
-
(0, import_license_checker.init)({
|
|
1162
|
-
production: true,
|
|
1163
|
-
start: location
|
|
1164
|
-
}, (error, packages) => {
|
|
1165
|
-
if (error) {
|
|
1166
|
-
console.error(import_chalk16.default.red(`License Checker [${name}] Error`));
|
|
1167
|
-
console.error(import_chalk16.default.gray(error));
|
|
1168
|
-
console.log("\n");
|
|
1169
|
-
resolve(1);
|
|
1170
|
-
} else {
|
|
1171
|
-
console.log(import_chalk16.default.green(`License Checker [${name}]`));
|
|
1172
|
-
let count = 0;
|
|
1173
|
-
for (const [name2, info] of Object.entries(packages)) {
|
|
1174
|
-
const licenses = Array.isArray(info.licenses) ? info.licenses : [
|
|
1175
|
-
info.licenses
|
|
1176
|
-
];
|
|
1177
|
-
for (let license2 of licenses) {
|
|
1178
|
-
if (license2) {
|
|
1179
|
-
if (license2[0] === "(" && license2.at(-1) === ")") {
|
|
1180
|
-
license2 = license2.slice(1, -2);
|
|
1181
|
-
}
|
|
1182
|
-
const orLicenses = license2.split(" OR ");
|
|
1183
|
-
let orLicenseFound = false;
|
|
1184
|
-
for (const orLicense of orLicenses) {
|
|
1185
|
-
if (exclude.has(orLicense)) {
|
|
1186
|
-
orLicenseFound = true;
|
|
1187
|
-
}
|
|
1188
|
-
}
|
|
1189
|
-
if (!orLicenseFound) {
|
|
1190
|
-
count++;
|
|
1191
|
-
console.warn(import_chalk16.default.yellow(`${name2}: Package License not allowed [${license2}]`));
|
|
1192
|
-
}
|
|
1193
|
-
}
|
|
1194
|
-
}
|
|
1195
|
-
}
|
|
1196
|
-
console.log("\n");
|
|
1197
|
-
resolve(count);
|
|
1198
|
-
}
|
|
1199
|
-
});
|
|
1200
|
-
});
|
|
1201
|
-
}))).reduce((prev, value) => prev || value, 0);
|
|
1202
|
-
}, "license");
|
|
1203
|
-
|
|
1204
|
-
// src/actions/lint.ts
|
|
1205
|
-
var import_chalk17 = __toESM(require("chalk"), 1);
|
|
1206
|
-
var import_eslint = require("eslint");
|
|
1207
|
-
var dumpMessages = /* @__PURE__ */ __name((lintResults) => {
|
|
1208
|
-
const colors = [
|
|
1209
|
-
"white",
|
|
1210
|
-
"yellow",
|
|
1211
|
-
"red"
|
|
1212
|
-
];
|
|
1213
|
-
const severity = [
|
|
1214
|
-
"none",
|
|
1215
|
-
"warning",
|
|
1216
|
-
"error"
|
|
1217
|
-
];
|
|
1218
|
-
for (const lintResult of lintResults) {
|
|
1219
|
-
if (lintResult.messages.length > 0) {
|
|
1220
|
-
console.log(import_chalk17.default.gray(`${lintResult.filePath}`));
|
|
1221
|
-
for (const message of lintResult.messages) {
|
|
1222
|
-
console.log(import_chalk17.default.gray(` ${message.line}:${message.column}`), import_chalk17.default[colors[message.severity]](` ${severity[message.severity]}`), import_chalk17.default.white(` ${message.message}`), import_chalk17.default.gray(` ${message.ruleId}`));
|
|
1223
|
-
}
|
|
1224
|
-
}
|
|
1225
|
-
}
|
|
1226
|
-
}, "dumpMessages");
|
|
1227
|
-
var lintPackage = /* @__PURE__ */ __name(async ({ pkg }) => {
|
|
1228
|
-
const workspace = yarnWorkspaces().find((workspace2) => workspace2.name === pkg);
|
|
1229
|
-
if (!workspace) {
|
|
1230
|
-
console.error(import_chalk17.default.red(`Unable to locate package [${import_chalk17.default.magenta(pkg)}]`));
|
|
1231
|
-
process.exit(1);
|
|
1232
|
-
}
|
|
1233
|
-
const engine = new import_eslint.ESLint({
|
|
1234
|
-
cache: true
|
|
1235
|
-
});
|
|
1236
|
-
const lintResults = await engine.lintFiles(workspace.location);
|
|
1237
|
-
dumpMessages(lintResults);
|
|
1238
|
-
return lintResults.reduce((prev, lintResult) => prev + lintResult.errorCount, 0);
|
|
1239
|
-
}, "lintPackage");
|
|
1240
|
-
var lintAll = /* @__PURE__ */ __name(async () => {
|
|
1241
|
-
const engine = new import_eslint.ESLint({
|
|
1242
|
-
cache: true
|
|
1243
|
-
});
|
|
1244
|
-
const lintResults = await engine.lintFiles("./**/*.*");
|
|
1245
|
-
dumpMessages(lintResults);
|
|
1246
|
-
return lintResults.reduce((prev, lintResult) => prev + lintResult.errorCount, 0);
|
|
1247
|
-
}, "lintAll");
|
|
1248
|
-
var lint = /* @__PURE__ */ __name(async ({ pkg } = {}) => {
|
|
1249
|
-
return pkg ? await lintPackage({
|
|
1250
|
-
pkg
|
|
1251
|
-
}) : runSteps("Lint-Caching [All]", [
|
|
1252
|
-
[
|
|
1253
|
-
"yarn",
|
|
1254
|
-
[
|
|
1255
|
-
"eslint",
|
|
1256
|
-
".",
|
|
1257
|
-
"--cache"
|
|
1258
|
-
]
|
|
1259
|
-
]
|
|
1260
|
-
]);
|
|
1261
|
-
}, "lint");
|
|
1262
|
-
|
|
1263
|
-
// src/actions/lint-clean.ts
|
|
1264
|
-
var import_node_fs5 = require("fs");
|
|
1265
|
-
var lintClean = /* @__PURE__ */ __name(() => {
|
|
1266
|
-
console.log("Lint Clean [.eslintcache]");
|
|
1267
|
-
const workspaces = yarnWorkspaces();
|
|
1268
|
-
const result = workspaces.map(({ location, name }) => {
|
|
1269
|
-
const dist = `${location}/.eslintcache`;
|
|
1270
|
-
try {
|
|
1271
|
-
(0, import_node_fs5.rmSync)(dist, {
|
|
1272
|
-
force: true,
|
|
1273
|
-
recursive: true
|
|
1274
|
-
});
|
|
1275
|
-
return 0;
|
|
1276
|
-
} catch (ex) {
|
|
1277
|
-
const error = ex;
|
|
1278
|
-
console.error(`Lint Clean [.eslintcache] Failed [${name}, ${error.message}]`);
|
|
1279
|
-
return 1;
|
|
1280
|
-
}
|
|
1281
|
-
}).reduce((prev, result2) => prev || result2, 0);
|
|
1282
|
-
return result || lint();
|
|
1283
|
-
}, "lintClean");
|
|
1284
|
-
|
|
1285
|
-
// src/actions/lint-profile.ts
|
|
1286
|
-
var lintProfile = /* @__PURE__ */ __name(() => {
|
|
1287
|
-
return runSteps("Lint Profile", [
|
|
1288
|
-
[
|
|
1289
|
-
"yarn",
|
|
1290
|
-
[
|
|
1291
|
-
"xy",
|
|
1292
|
-
"lint"
|
|
1293
|
-
],
|
|
1294
|
-
{
|
|
1295
|
-
env: {
|
|
1296
|
-
...process.env,
|
|
1297
|
-
TIMING: "1"
|
|
1298
|
-
}
|
|
1299
|
-
}
|
|
1300
|
-
]
|
|
1301
|
-
]);
|
|
1302
|
-
}, "lintProfile");
|
|
1303
|
-
|
|
1304
|
-
// src/actions/npmignore-gen.ts
|
|
1305
|
-
var filename2 = ".npmignore";
|
|
1306
|
-
var npmignoreGen = /* @__PURE__ */ __name((pkg) => generateIgnoreFiles(filename2, pkg), "npmignoreGen");
|
|
1307
|
-
|
|
1308
|
-
// src/actions/package/clean-outputs.ts
|
|
1309
|
-
var import_node_path2 = __toESM(require("path"), 1);
|
|
1310
|
-
var import_chalk18 = __toESM(require("chalk"), 1);
|
|
1311
|
-
var import_rimraf2 = require("rimraf");
|
|
1312
|
-
var packageCleanOutputs = /* @__PURE__ */ __name(async () => {
|
|
1313
|
-
const pkg = process.env.INIT_CWD ?? ".";
|
|
1314
|
-
const pkgName = process.env.npm_package_name;
|
|
1315
|
-
const folders = [
|
|
1316
|
-
import_node_path2.default.join(pkg, "dist"),
|
|
1317
|
-
import_node_path2.default.join(pkg, "build"),
|
|
1318
|
-
import_node_path2.default.join(pkg, "docs")
|
|
1319
|
-
];
|
|
1320
|
-
console.log(import_chalk18.default.green(`Cleaning Outputs [${pkgName}]`));
|
|
1321
|
-
await Promise.all(folders.map((folder) => (0, import_rimraf2.rimraf)(folder)));
|
|
1322
|
-
return 0;
|
|
1323
|
-
}, "packageCleanOutputs");
|
|
1324
|
-
|
|
1325
|
-
// src/actions/package/clean-typescript.ts
|
|
1326
|
-
var import_node_path3 = __toESM(require("path"), 1);
|
|
1327
|
-
var import_chalk19 = __toESM(require("chalk"), 1);
|
|
1328
|
-
var import_rimraf3 = require("rimraf");
|
|
1329
|
-
var packageCleanTypescript = /* @__PURE__ */ __name(async () => {
|
|
1330
|
-
const pkg = process.env.INIT_CWD ?? ".";
|
|
1331
|
-
const pkgName = process.env.npm_package_name;
|
|
1332
|
-
console.log(import_chalk19.default.green(`Cleaning Typescript [${pkgName}]`));
|
|
1333
|
-
const files = [
|
|
1334
|
-
import_node_path3.default.join(pkg, "*.tsbuildinfo"),
|
|
1335
|
-
import_node_path3.default.join(pkg, ".tsconfig.*"),
|
|
1336
|
-
import_node_path3.default.join(pkg, ".eslintcache")
|
|
1337
|
-
];
|
|
1338
|
-
await Promise.all(files.map((file) => (0, import_rimraf3.rimraf)(file)));
|
|
1339
|
-
return 0;
|
|
1340
|
-
}, "packageCleanTypescript");
|
|
1341
|
-
|
|
1342
|
-
// src/actions/package/clean.ts
|
|
1343
|
-
var packageClean = /* @__PURE__ */ __name(async () => {
|
|
1344
|
-
return (await Promise.all([
|
|
1345
|
-
packageCleanOutputs(),
|
|
1346
|
-
packageCleanTypescript()
|
|
1347
|
-
])).reduce((prev, value) => prev + value, 0);
|
|
1348
|
-
}, "packageClean");
|
|
1349
|
-
|
|
1350
|
-
// src/actions/package/compile/compile.ts
|
|
1351
|
-
var import_chalk23 = __toESM(require("chalk"), 1);
|
|
1352
|
-
|
|
1353
|
-
// src/actions/package/publint.ts
|
|
1354
|
-
var import_node_fs6 = require("fs");
|
|
1355
|
-
var import_chalk20 = __toESM(require("chalk"), 1);
|
|
1356
|
-
var packagePublint = /* @__PURE__ */ __name(async (params) => {
|
|
1357
|
-
const pkgDir = process.env.INIT_CWD;
|
|
1358
|
-
const pkg = JSON.parse(await import_node_fs6.promises.readFile(`${pkgDir}/package.json`, "utf8"));
|
|
1359
|
-
console.log(import_chalk20.default.green(`Publint: ${pkg.name}`));
|
|
1360
|
-
console.log(import_chalk20.default.gray(pkgDir));
|
|
1361
|
-
const { publint: publint2 } = await import("publint");
|
|
1362
|
-
const { messages } = await publint2({
|
|
1363
|
-
level: "suggestion",
|
|
1364
|
-
pkgDir,
|
|
1365
|
-
strict: true
|
|
1366
|
-
});
|
|
1367
|
-
const { formatMessage } = await import("publint/utils");
|
|
1368
|
-
const validMessage = /* @__PURE__ */ __name((_message) => {
|
|
1369
|
-
return true;
|
|
1370
|
-
}, "validMessage");
|
|
1371
|
-
const validMessages = messages.filter(validMessage);
|
|
1372
|
-
for (const message of validMessages) {
|
|
1373
|
-
switch (message.type) {
|
|
1374
|
-
case "error": {
|
|
1375
|
-
console.error(import_chalk20.default.red(`[${message.code}] ${formatMessage(message, pkg)}`));
|
|
1376
|
-
break;
|
|
1377
|
-
}
|
|
1378
|
-
case "warning": {
|
|
1379
|
-
console.warn(import_chalk20.default.yellow(`[${message.code}] ${formatMessage(message, pkg)}`));
|
|
1380
|
-
break;
|
|
1381
|
-
}
|
|
1382
|
-
default: {
|
|
1383
|
-
console.log(import_chalk20.default.white(`[${message.code}] ${formatMessage(message, pkg)}`));
|
|
1384
|
-
break;
|
|
1385
|
-
}
|
|
1386
|
-
}
|
|
1387
|
-
}
|
|
1388
|
-
if (params?.verbose) {
|
|
1389
|
-
console.log(import_chalk20.default.gray(`Publint [Finish]: ${pkgDir} [${validMessages.length}]`));
|
|
1390
|
-
}
|
|
1391
|
-
return validMessages.filter((message) => message.type === "error").length;
|
|
1392
|
-
}, "packagePublint");
|
|
1393
|
-
|
|
1394
|
-
// src/actions/package/compile/packageCompileTsc.ts
|
|
1395
|
-
var import_node_process = require("process");
|
|
1396
|
-
var import_chalk21 = __toESM(require("chalk"), 1);
|
|
1397
|
-
var import_tsc_prog = require("tsc-prog");
|
|
1398
|
-
var import_typescript2 = require("typescript");
|
|
1399
|
-
|
|
1400
|
-
// src/actions/package/compile/getCompilerOptions.ts
|
|
1401
|
-
var import_node_module = require("module");
|
|
1402
|
-
var import_merge2 = __toESM(require("lodash/merge.js"), 1);
|
|
1403
|
-
var import_typescript = require("typescript");
|
|
1404
|
-
var import_meta = {};
|
|
1405
|
-
var getNested = /* @__PURE__ */ __name((config2) => {
|
|
1406
|
-
if (config2.extends) {
|
|
1407
|
-
const require2 = (0, import_node_module.createRequire)(import_meta.url);
|
|
1408
|
-
const opts = require2(config2.extends);
|
|
1409
|
-
return {
|
|
1410
|
-
...getNested(opts),
|
|
1411
|
-
...config2.compilerOptions
|
|
1412
|
-
};
|
|
1413
|
-
}
|
|
1414
|
-
return config2.compilerOptions;
|
|
1415
|
-
}, "getNested");
|
|
1416
|
-
var getCompilerOptionsJSONFollowExtends = /* @__PURE__ */ __name((filename3) => {
|
|
1417
|
-
const config2 = (0, import_typescript.readConfigFile)(filename3, import_typescript.sys.readFile).config;
|
|
1418
|
-
return getNested(config2);
|
|
1419
|
-
}, "getCompilerOptionsJSONFollowExtends");
|
|
1420
|
-
var getCompilerOptions = /* @__PURE__ */ __name((options, tsconfig = "tsconfig.json") => {
|
|
1421
|
-
const configFileName = (0, import_typescript.findConfigFile)("./", import_typescript.sys.fileExists, tsconfig);
|
|
1422
|
-
const configFileCompilerOptions = configFileName ? getCompilerOptionsJSONFollowExtends(configFileName) : void 0;
|
|
1423
|
-
return (0, import_merge2.default)({}, configFileCompilerOptions, options);
|
|
1424
|
-
}, "getCompilerOptions");
|
|
1425
|
-
|
|
1426
|
-
// src/actions/package/compile/packageCompileTsc.ts
|
|
1427
|
-
var packageCompileTsc = /* @__PURE__ */ __name(async (noEmit, config2, compilerOptionsParam) => {
|
|
1428
|
-
const pkg = process.env.INIT_CWD ?? (0, import_node_process.cwd)();
|
|
1429
|
-
const publint2 = config2?.publint ?? true;
|
|
1430
|
-
const verbose = config2?.verbose ?? false;
|
|
1431
|
-
const formatHost = {
|
|
1432
|
-
getCanonicalFileName: /* @__PURE__ */ __name((fileName) => fileName, "getCanonicalFileName"),
|
|
1433
|
-
getCurrentDirectory: /* @__PURE__ */ __name(() => pkg, "getCurrentDirectory"),
|
|
1434
|
-
getNewLine: /* @__PURE__ */ __name(() => "\n", "getNewLine")
|
|
1435
|
-
};
|
|
1436
|
-
if (verbose) {
|
|
1437
|
-
console.log(`Compiling with NoEmit TSC [${pkg}]`);
|
|
1438
|
-
}
|
|
1439
|
-
const compilerOptions = {
|
|
1440
|
-
...await getCompilerOptions({
|
|
1441
|
-
outDir: "dist",
|
|
1442
|
-
removeComments: true,
|
|
1443
|
-
rootDir: "src"
|
|
1444
|
-
}),
|
|
1445
|
-
...compilerOptionsParam,
|
|
1446
|
-
...noEmit === void 0 ? {} : {
|
|
1447
|
-
noEmit
|
|
1448
|
-
}
|
|
1449
|
-
};
|
|
1450
|
-
const program = (0, import_tsc_prog.createProgramFromConfig)({
|
|
1451
|
-
basePath: pkg ?? (0, import_node_process.cwd)(),
|
|
1452
|
-
compilerOptions,
|
|
1453
|
-
exclude: [
|
|
1454
|
-
"dist",
|
|
1455
|
-
"docs",
|
|
1456
|
-
"**/*.spec.*",
|
|
1457
|
-
"**/*.stories.*",
|
|
1458
|
-
"src/**/spec/**/*"
|
|
1459
|
-
],
|
|
1460
|
-
include: [
|
|
1461
|
-
"src"
|
|
1462
|
-
]
|
|
1463
|
-
});
|
|
1464
|
-
const results = (0, import_typescript2.getPreEmitDiagnostics)(program);
|
|
1465
|
-
for (const diag of results) {
|
|
1466
|
-
const lineAndChar = diag.file ? (0, import_typescript2.getLineAndCharacterOfPosition)(diag.file, diag.start ?? 0) : {
|
|
1467
|
-
character: 0,
|
|
1468
|
-
line: 0
|
|
1469
|
-
};
|
|
1470
|
-
console.log(import_chalk21.default.cyan(`${diag.file?.fileName}:${lineAndChar.line + 1}:${lineAndChar.character + 1}`));
|
|
1471
|
-
console.log((0, import_typescript2.formatDiagnosticsWithColorAndContext)([
|
|
1472
|
-
diag
|
|
1473
|
-
], formatHost));
|
|
1474
|
-
}
|
|
1475
|
-
return results.reduce((prev, diag) => prev + diag.category === import_typescript2.DiagnosticCategory.Error ? 1 : 0, 0) || (publint2 ? await packagePublint() : 0);
|
|
1476
|
-
}, "packageCompileTsc");
|
|
1477
|
-
|
|
1478
|
-
// src/actions/package/compile/packageCompileTsup.ts
|
|
1479
|
-
var import_merge3 = __toESM(require("lodash/merge.js"), 1);
|
|
1480
|
-
var import_tsup = require("tsup");
|
|
1481
|
-
|
|
1482
|
-
// src/actions/package/compile/inputs.ts
|
|
1483
|
-
var import_promises = require("fs/promises");
|
|
1484
|
-
var import_glob = require("glob");
|
|
1485
|
-
var getAllInputs2 = /* @__PURE__ */ __name((folder) => {
|
|
1486
|
-
return import_glob.glob.sync(`${folder}/**/*.*`, {
|
|
1487
|
-
ignore: [
|
|
1488
|
-
"**/*.spec.*",
|
|
1489
|
-
"**/*.stories.*",
|
|
1490
|
-
"**/spec/**/*"
|
|
1491
|
-
],
|
|
1492
|
-
posix: true
|
|
1493
|
-
});
|
|
1494
|
-
}, "getAllInputs2");
|
|
1495
|
-
|
|
1496
|
-
// src/actions/package/compile/buildEntries.ts
|
|
1497
|
-
var buildEntries = /* @__PURE__ */ __name((folder, entryMode, verbose = false) => {
|
|
1498
|
-
switch (entryMode) {
|
|
1499
|
-
case "platform": {
|
|
1500
|
-
if (verbose) console.log("buildEntries [platform]");
|
|
1501
|
-
return [
|
|
1502
|
-
`${folder}/index-node.ts`,
|
|
1503
|
-
`${folder}/index-browser.ts`
|
|
1504
|
-
];
|
|
1505
|
-
}
|
|
1506
|
-
case "all": {
|
|
1507
|
-
if (verbose) console.log("buildEntries [all]");
|
|
1508
|
-
return getAllInputs2(folder).filter((entry) => !entry.includes(".spec.") && !entry.includes(".story."));
|
|
1509
|
-
}
|
|
1510
|
-
default: {
|
|
1511
|
-
if (verbose) console.log("buildEntries [single]");
|
|
1512
|
-
return [
|
|
1513
|
-
`${folder}/index.ts`
|
|
1514
|
-
];
|
|
1515
|
-
}
|
|
1516
|
-
}
|
|
1517
|
-
}, "buildEntries");
|
|
1518
|
-
|
|
1519
|
-
// src/actions/package/compile/packageCompileTscTypes.ts
|
|
1520
|
-
var import_node_process2 = require("process");
|
|
1521
|
-
var import_chalk22 = __toESM(require("chalk"), 1);
|
|
1522
|
-
var import_tsc_prog2 = require("tsc-prog");
|
|
1523
|
-
var import_typescript3 = require("typescript");
|
|
1524
|
-
|
|
1525
|
-
// src/actions/package/compile/copyTypeFiles.ts
|
|
1526
|
-
var import_promises2 = require("fs/promises");
|
|
1527
|
-
var import_async_mutex = require("async-mutex");
|
|
1528
|
-
var copyFileMutex = new import_async_mutex.Mutex();
|
|
1529
|
-
var getDistTypeFiles = /* @__PURE__ */ __name(async (compilerOptions) => {
|
|
1530
|
-
const outDir = compilerOptions.outDir ?? "dist";
|
|
1531
|
-
return (await (0, import_promises2.readdir)(outDir, {
|
|
1532
|
-
recursive: true
|
|
1533
|
-
})).filter((file) => file.endsWith("d.ts")).map((file) => `${outDir}/${file}`);
|
|
1534
|
-
}, "getDistTypeFiles");
|
|
1535
|
-
var getDistTypeMapFiles = /* @__PURE__ */ __name(async (compilerOptions) => {
|
|
1536
|
-
const outDir = compilerOptions.outDir ?? "dist";
|
|
1537
|
-
return (await (0, import_promises2.readdir)(outDir, {
|
|
1538
|
-
recursive: true
|
|
1539
|
-
})).filter((file) => file.endsWith("d.ts.map")).map((file) => `${outDir}/${file}`);
|
|
1540
|
-
}, "getDistTypeMapFiles");
|
|
1541
|
-
var copyTypeFiles = /* @__PURE__ */ __name(async (compilerOptions) => {
|
|
1542
|
-
await copyFileMutex.runExclusive(async () => {
|
|
1543
|
-
const distTypeFiles = await getDistTypeFiles(compilerOptions);
|
|
1544
|
-
await Promise.all(distTypeFiles.map(async (file) => {
|
|
1545
|
-
await (0, import_promises2.copyFile)(file, file.replace("d.ts", "d.mts"));
|
|
1546
|
-
await (0, import_promises2.copyFile)(file, file.replace("d.ts", "d.cts"));
|
|
1547
|
-
}));
|
|
1548
|
-
const distTypeMapFiles = await getDistTypeMapFiles(compilerOptions);
|
|
1549
|
-
await Promise.all(distTypeMapFiles.map(async (file) => {
|
|
1550
|
-
await (0, import_promises2.copyFile)(file, file.replace("d.ts.map", "d.mts.map"));
|
|
1551
|
-
await (0, import_promises2.copyFile)(file, file.replace("d.ts.map", "d.cts.map"));
|
|
1552
|
-
}));
|
|
1553
|
-
});
|
|
1554
|
-
}, "copyTypeFiles");
|
|
1555
|
-
|
|
1556
|
-
// src/actions/package/compile/packageCompileTscTypes.ts
|
|
1557
|
-
var packageCompileTscTypes = /* @__PURE__ */ __name(async (folder = "src", { verbose } = {}, compilerOptionsParam, generateMts = true) => {
|
|
1558
|
-
const pkg = process.env.INIT_CWD ?? (0, import_node_process2.cwd)();
|
|
1559
|
-
if (verbose) {
|
|
1560
|
-
console.log(`Compiling types with TSC [${pkg}]`);
|
|
1561
|
-
}
|
|
1562
|
-
const compilerOptions = {
|
|
1563
|
-
...await getCompilerOptions({
|
|
1564
|
-
declaration: true,
|
|
1565
|
-
emitDeclarationOnly: true,
|
|
1566
|
-
outDir: "dist",
|
|
1567
|
-
removeComments: true,
|
|
1568
|
-
skipDefaultLibCheck: true,
|
|
1569
|
-
skipLibCheck: true,
|
|
1570
|
-
sourceMap: true
|
|
1571
|
-
}),
|
|
1572
|
-
...compilerOptionsParam
|
|
1573
|
-
};
|
|
1574
|
-
const files = buildEntries(folder, "all");
|
|
1575
|
-
const result = (0, import_tsc_prog2.createProgramFromConfig)({
|
|
1576
|
-
basePath: pkg ?? (0, import_node_process2.cwd)(),
|
|
1577
|
-
compilerOptions,
|
|
1578
|
-
exclude: [
|
|
1579
|
-
"dist",
|
|
1580
|
-
"docs",
|
|
1581
|
-
"**/*.spec.*",
|
|
1582
|
-
"**/*.stories.*",
|
|
1583
|
-
"src/**/spec/**/*"
|
|
1584
|
-
],
|
|
1585
|
-
files
|
|
1586
|
-
}).emit();
|
|
1587
|
-
const diagResults = result.diagnostics.length;
|
|
1588
|
-
for (const diag of result.diagnostics) {
|
|
1589
|
-
switch (diag.category) {
|
|
1590
|
-
case import_typescript3.DiagnosticCategory.Error: {
|
|
1591
|
-
console.error(import_chalk22.default.red(diag.messageText));
|
|
1592
|
-
console.error(import_chalk22.default.grey(pkg));
|
|
1593
|
-
console.error(import_chalk22.default.blue(diag.file?.fileName));
|
|
1594
|
-
break;
|
|
1595
|
-
}
|
|
1596
|
-
case import_typescript3.DiagnosticCategory.Warning: {
|
|
1597
|
-
console.error(import_chalk22.default.yellow(diag.messageText));
|
|
1598
|
-
console.error(import_chalk22.default.grey(pkg));
|
|
1599
|
-
console.error(import_chalk22.default.blue(diag.file?.fileName));
|
|
1600
|
-
break;
|
|
1601
|
-
}
|
|
1602
|
-
case import_typescript3.DiagnosticCategory.Suggestion: {
|
|
1603
|
-
console.error(import_chalk22.default.white(diag.messageText));
|
|
1604
|
-
console.error(import_chalk22.default.grey(pkg));
|
|
1605
|
-
console.error(import_chalk22.default.blue(diag.file?.fileName));
|
|
1606
|
-
break;
|
|
1607
|
-
}
|
|
1608
|
-
}
|
|
1609
|
-
}
|
|
1610
|
-
if (generateMts) {
|
|
1611
|
-
await copyTypeFiles(compilerOptions);
|
|
1612
|
-
}
|
|
1613
|
-
return diagResults;
|
|
1614
|
-
}, "packageCompileTscTypes");
|
|
1615
|
-
|
|
1616
|
-
// src/actions/package/compile/packageCompileTsup.ts
|
|
1617
|
-
var compileFolder = /* @__PURE__ */ __name(async (folder, entryMode = "single", options, verbose) => {
|
|
1618
|
-
const outDir = options?.outDir ?? "dist";
|
|
1619
|
-
const entry = buildEntries(folder, entryMode);
|
|
1620
|
-
const optionsResult = (0, import_tsup.defineConfig)({
|
|
1621
|
-
bundle: true,
|
|
1622
|
-
cjsInterop: true,
|
|
1623
|
-
clean: true,
|
|
1624
|
-
dts: false,
|
|
1625
|
-
entry,
|
|
1626
|
-
format: [
|
|
1627
|
-
"cjs",
|
|
1628
|
-
"esm"
|
|
1629
|
-
],
|
|
1630
|
-
// minify: true,
|
|
1631
|
-
outDir,
|
|
1632
|
-
silent: true,
|
|
1633
|
-
sourcemap: true,
|
|
1634
|
-
splitting: false,
|
|
1635
|
-
// terserOptions: { format: { comments: false } },
|
|
1636
|
-
tsconfig: "tsconfig.json",
|
|
1637
|
-
...options
|
|
1638
|
-
});
|
|
1639
|
-
const optionsList = (await Promise.all((Array.isArray(optionsResult) ? optionsResult : [
|
|
1640
|
-
optionsResult
|
|
1641
|
-
]).flatMap(async (options2) => {
|
|
1642
|
-
const result = typeof options2 === "function" ? await options2({}) : [
|
|
1643
|
-
options2
|
|
1644
|
-
];
|
|
1645
|
-
return Array.isArray(result) ? result : [
|
|
1646
|
-
result
|
|
1647
|
-
];
|
|
1648
|
-
}))).flat();
|
|
1649
|
-
await Promise.all(optionsList.map((options2) => (0, import_tsup.build)(options2)));
|
|
1650
|
-
await packageCompileTscTypes(folder, {
|
|
1651
|
-
verbose
|
|
1652
|
-
}, {
|
|
1653
|
-
outDir
|
|
1654
|
-
});
|
|
1655
|
-
return 0;
|
|
1656
|
-
}, "compileFolder");
|
|
1657
|
-
var packageCompileTsup = /* @__PURE__ */ __name(async (config2) => {
|
|
1658
|
-
const compile2 = config2?.compile;
|
|
1659
|
-
const publint2 = config2?.publint ?? true;
|
|
1660
|
-
const verbose = config2?.verbose ?? false;
|
|
1661
|
-
if (verbose) {
|
|
1662
|
-
console.log(`Compiling with TSUP [Depth: ${compile2?.depth}]`);
|
|
1663
|
-
}
|
|
1664
|
-
const compileForNode = compile2?.node ?? {
|
|
1665
|
-
src: {}
|
|
1666
|
-
};
|
|
1667
|
-
const compileForBrowser = compile2?.browser ?? {
|
|
1668
|
-
src: {}
|
|
1669
|
-
};
|
|
1670
|
-
const compileForNeutral = compile2?.neutral ?? {
|
|
1671
|
-
src: {}
|
|
1672
|
-
};
|
|
1673
|
-
return await packageCompileTsc(true, {
|
|
1674
|
-
publint: false,
|
|
1675
|
-
verbose
|
|
1676
|
-
}) || (await Promise.all(Object.entries(compileForNode).map(async ([folder, options]) => {
|
|
1677
|
-
const inEsBuildOptions = typeof compile2?.node?.esbuildOptions === "object" ? compile2?.node?.esbuildOptions : {};
|
|
1678
|
-
return folder ? await compileFolder(folder, compile2?.entryMode, {
|
|
1679
|
-
bundle: true,
|
|
1680
|
-
format: [
|
|
1681
|
-
"cjs",
|
|
1682
|
-
"esm"
|
|
1683
|
-
],
|
|
1684
|
-
loader: (0, import_merge3.default)({}, {
|
|
1685
|
-
".gif": "copy",
|
|
1686
|
-
".html": "copy",
|
|
1687
|
-
".jpg": "copy",
|
|
1688
|
-
".json": "json",
|
|
1689
|
-
".png": "copy",
|
|
1690
|
-
".svg": "copy",
|
|
1691
|
-
".webp": "copy"
|
|
1692
|
-
}, inEsBuildOptions?.loader),
|
|
1693
|
-
// minify: true,
|
|
1694
|
-
outDir: "dist/node",
|
|
1695
|
-
outExtension: /* @__PURE__ */ __name(({ format }) => format === "esm" ? {
|
|
1696
|
-
js: ".mjs"
|
|
1697
|
-
} : {
|
|
1698
|
-
js: ".cjs"
|
|
1699
|
-
}, "outExtension"),
|
|
1700
|
-
platform: "node",
|
|
1701
|
-
skipNodeModulesBundle: true,
|
|
1702
|
-
sourcemap: true,
|
|
1703
|
-
target: "node16",
|
|
1704
|
-
// terserOptions: { format: { comments: false } },
|
|
1705
|
-
...compile2?.tsup?.options,
|
|
1706
|
-
...typeof options === "object" ? options : {}
|
|
1707
|
-
}, verbose) : 0;
|
|
1708
|
-
}))).reduce((prev, value) => prev + value, 0) || (await Promise.all(Object.entries(compileForBrowser).map(async ([folder, options]) => {
|
|
1709
|
-
const inEsBuildOptions = typeof compile2?.browser?.esbuildOptions === "object" ? compile2?.browser?.esbuildOptions : {};
|
|
1710
|
-
return folder ? (await Promise.all([
|
|
1711
|
-
compileFolder(folder, compile2?.entryMode, {
|
|
1712
|
-
bundle: true,
|
|
1713
|
-
format: [
|
|
1714
|
-
"cjs"
|
|
1715
|
-
],
|
|
1716
|
-
loader: (0, import_merge3.default)({}, {
|
|
1717
|
-
".gif": "copy",
|
|
1718
|
-
".html": "copy",
|
|
1719
|
-
".jpg": "copy",
|
|
1720
|
-
".json": "json",
|
|
1721
|
-
".png": "copy",
|
|
1722
|
-
".svg": "copy",
|
|
1723
|
-
".webp": "copy"
|
|
1724
|
-
}, inEsBuildOptions?.loader),
|
|
1725
|
-
// minify: true,
|
|
1726
|
-
outDir: "dist/browser",
|
|
1727
|
-
outExtension: /* @__PURE__ */ __name(({ format }) => format === "esm" ? {
|
|
1728
|
-
js: ".mjs"
|
|
1729
|
-
} : {
|
|
1730
|
-
js: ".cjs"
|
|
1731
|
-
}, "outExtension"),
|
|
1732
|
-
platform: "browser",
|
|
1733
|
-
skipNodeModulesBundle: true,
|
|
1734
|
-
sourcemap: true,
|
|
1735
|
-
target: "esnext",
|
|
1736
|
-
// terserOptions: { format: { comments: false } },
|
|
1737
|
-
...compile2?.tsup?.options,
|
|
1738
|
-
...typeof options === "object" ? options : {}
|
|
1739
|
-
}, verbose),
|
|
1740
|
-
compileFolder(folder, compile2?.entryMode, {
|
|
1741
|
-
bundle: true,
|
|
1742
|
-
format: [
|
|
1743
|
-
"esm"
|
|
1744
|
-
],
|
|
1745
|
-
loader: (0, import_merge3.default)({}, {
|
|
1746
|
-
".gif": "copy",
|
|
1747
|
-
".html": "copy",
|
|
1748
|
-
".jpg": "copy",
|
|
1749
|
-
".json": "json",
|
|
1750
|
-
".png": "copy",
|
|
1751
|
-
".svg": "copy",
|
|
1752
|
-
".webp": "copy"
|
|
1753
|
-
}, inEsBuildOptions?.loader),
|
|
1754
|
-
// minify: true,
|
|
1755
|
-
outDir: "dist/browser",
|
|
1756
|
-
outExtension: /* @__PURE__ */ __name(({ format }) => format === "esm" ? {
|
|
1757
|
-
js: ".mjs"
|
|
1758
|
-
} : {
|
|
1759
|
-
js: ".cjs"
|
|
1760
|
-
}, "outExtension"),
|
|
1761
|
-
platform: "browser",
|
|
1762
|
-
skipNodeModulesBundle: true,
|
|
1763
|
-
sourcemap: true,
|
|
1764
|
-
target: "esnext",
|
|
1765
|
-
// terserOptions: { format: { comments: false } },
|
|
1766
|
-
...compile2?.tsup?.options,
|
|
1767
|
-
...typeof options === "object" ? options : {}
|
|
1768
|
-
}, verbose)
|
|
1769
|
-
])).reduce((prev, value) => prev + value, 0) : 0;
|
|
1770
|
-
}))).reduce((prev, value) => prev + value, 0) || (await Promise.all(Object.entries(compileForNeutral).map(async ([folder, options]) => {
|
|
1771
|
-
const inEsBuildOptions = typeof compile2?.neutral?.esbuildOptions === "object" ? compile2?.neutral?.esbuildOptions : {};
|
|
1772
|
-
return folder ? (await Promise.all([
|
|
1773
|
-
compileFolder(folder, compile2?.entryMode, {
|
|
1774
|
-
bundle: true,
|
|
1775
|
-
format: [
|
|
1776
|
-
"cjs"
|
|
1777
|
-
],
|
|
1778
|
-
loader: (0, import_merge3.default)({}, {
|
|
1779
|
-
".gif": "copy",
|
|
1780
|
-
".html": "copy",
|
|
1781
|
-
".jpg": "copy",
|
|
1782
|
-
".json": "json",
|
|
1783
|
-
".png": "copy",
|
|
1784
|
-
".svg": "copy",
|
|
1785
|
-
".webp": "copy"
|
|
1786
|
-
}, inEsBuildOptions?.loader),
|
|
1787
|
-
// minify: true,
|
|
1788
|
-
outDir: "dist/neutral",
|
|
1789
|
-
outExtension: /* @__PURE__ */ __name(({ format }) => format === "esm" ? {
|
|
1790
|
-
js: ".mjs"
|
|
1791
|
-
} : {
|
|
1792
|
-
js: ".cjs"
|
|
1793
|
-
}, "outExtension"),
|
|
1794
|
-
platform: "neutral",
|
|
1795
|
-
skipNodeModulesBundle: true,
|
|
1796
|
-
sourcemap: true,
|
|
1797
|
-
target: "esnext",
|
|
1798
|
-
// terserOptions: { format: { comments: false } },
|
|
1799
|
-
...compile2?.tsup?.options,
|
|
1800
|
-
...typeof options === "object" ? options : {}
|
|
1801
|
-
}, verbose),
|
|
1802
|
-
compileFolder(folder, compile2?.entryMode, {
|
|
1803
|
-
bundle: true,
|
|
1804
|
-
format: [
|
|
1805
|
-
"esm"
|
|
1806
|
-
],
|
|
1807
|
-
loader: (0, import_merge3.default)({}, {
|
|
1808
|
-
".gif": "copy",
|
|
1809
|
-
".html": "copy",
|
|
1810
|
-
".jpg": "copy",
|
|
1811
|
-
".json": "json",
|
|
1812
|
-
".png": "copy",
|
|
1813
|
-
".svg": "copy",
|
|
1814
|
-
".webp": "copy"
|
|
1815
|
-
}, inEsBuildOptions?.loader),
|
|
1816
|
-
// minify: true,
|
|
1817
|
-
outDir: "dist/neutral",
|
|
1818
|
-
outExtension: /* @__PURE__ */ __name(({ format }) => format === "esm" ? {
|
|
1819
|
-
js: ".mjs"
|
|
1820
|
-
} : {
|
|
1821
|
-
js: ".cjs"
|
|
1822
|
-
}, "outExtension"),
|
|
1823
|
-
platform: "neutral",
|
|
1824
|
-
skipNodeModulesBundle: true,
|
|
1825
|
-
sourcemap: true,
|
|
1826
|
-
target: "esnext",
|
|
1827
|
-
// terserOptions: { format: { comments: false } },
|
|
1828
|
-
...compile2?.tsup?.options,
|
|
1829
|
-
...typeof options === "object" ? options : {}
|
|
1830
|
-
}, verbose)
|
|
1831
|
-
])).reduce((prev, value) => prev + value, 0) : 0;
|
|
1832
|
-
}))).reduce((prev, value) => prev + value, 0) || (publint2 ? await packagePublint() : 0);
|
|
1833
|
-
}, "packageCompileTsup");
|
|
1834
|
-
|
|
1835
|
-
// src/actions/package/compile/compile.ts
|
|
1836
|
-
var packageCompile = /* @__PURE__ */ __name(async (inConfig = {}) => {
|
|
1837
|
-
const pkg = process.env.INIT_CWD;
|
|
1838
|
-
console.log(import_chalk23.default.green(`Compiling ${pkg}`));
|
|
1839
|
-
const config2 = await loadConfig(inConfig);
|
|
1840
|
-
const publint2 = config2.publint;
|
|
1841
|
-
const mode = config2.compile?.mode ?? "tsup";
|
|
1842
|
-
let result = 0;
|
|
1843
|
-
switch (mode) {
|
|
1844
|
-
case "tsc": {
|
|
1845
|
-
result += await packageCompileTsc(void 0, config2);
|
|
1846
|
-
break;
|
|
1847
|
-
}
|
|
1848
|
-
case "tsup": {
|
|
1849
|
-
result += await packageCompileTsup(config2);
|
|
1850
|
-
break;
|
|
1851
|
-
}
|
|
1852
|
-
}
|
|
1853
|
-
return result + (publint2 ? await packagePublint(config2) : 0);
|
|
1854
|
-
}, "packageCompile");
|
|
1855
|
-
|
|
1856
|
-
// src/actions/package/copy-assets.ts
|
|
1857
|
-
var import_posix2 = __toESM(require("path/posix"), 1);
|
|
1858
|
-
var import_chalk24 = __toESM(require("chalk"), 1);
|
|
1859
|
-
var import_cpy2 = __toESM(require("cpy"), 1);
|
|
1860
|
-
var copyTargetAssets2 = /* @__PURE__ */ __name(async (target, name, location) => {
|
|
1861
|
-
try {
|
|
1862
|
-
const values = await (0, import_cpy2.default)([
|
|
1863
|
-
"**/*.jpg",
|
|
1864
|
-
"**/*.png",
|
|
1865
|
-
"**/*.gif",
|
|
1866
|
-
"**/*.svg",
|
|
1867
|
-
"**/*.webp",
|
|
1868
|
-
"**/*.sass",
|
|
1869
|
-
"**/*.scss",
|
|
1870
|
-
"**/*.gif",
|
|
1871
|
-
"**/*.css"
|
|
1872
|
-
], `../dist/${target}`, {
|
|
1873
|
-
cwd: import_posix2.default.join(location, "src"),
|
|
1874
|
-
flat: false
|
|
1875
|
-
});
|
|
1876
|
-
if (values.length > 0) {
|
|
1877
|
-
console.log(import_chalk24.default.green(`Copying Assets [${target.toUpperCase()}] - ${name} - ${location}`));
|
|
1878
|
-
}
|
|
1879
|
-
for (const value of values) {
|
|
1880
|
-
console.log(`${value.split("/").pop()} => ./dist/${target}`);
|
|
1881
|
-
}
|
|
1882
|
-
return 0;
|
|
1883
|
-
} catch (ex) {
|
|
1884
|
-
const error = ex;
|
|
1885
|
-
console.log(`Copy Assets Failed: ${name}: ${error.message}`);
|
|
1886
|
-
return 1;
|
|
1887
|
-
}
|
|
1888
|
-
}, "copyTargetAssets");
|
|
1889
|
-
var packageCopyAssets = /* @__PURE__ */ __name(async ({ target }) => {
|
|
1890
|
-
const pkg = process.env.INIT_CWD ?? "./";
|
|
1891
|
-
const pkgName = process.env.npm_package_name ?? "Unknown";
|
|
1892
|
-
switch (target) {
|
|
1893
|
-
case "esm": {
|
|
1894
|
-
return await copyTargetAssets2("esm", pkgName, pkg);
|
|
1895
|
-
}
|
|
1896
|
-
case "cjs": {
|
|
1897
|
-
return await copyTargetAssets2("cjs", pkgName, pkg);
|
|
1898
|
-
}
|
|
1899
|
-
default: {
|
|
1900
|
-
return await copyTargetAssets2("esm", pkgName, pkg) || await copyTargetAssets2("cjs", pkgName, pkg);
|
|
1901
|
-
}
|
|
1902
|
-
}
|
|
1903
|
-
}, "packageCopyAssets");
|
|
1904
|
-
|
|
1905
|
-
// src/actions/package/deps.ts
|
|
1906
|
-
var import_node_fs7 = require("fs");
|
|
1907
|
-
var import_node_process3 = require("process");
|
|
1908
|
-
var import_chalk25 = __toESM(require("chalk"), 1);
|
|
1909
|
-
var import_depcheck = __toESM(require("depcheck"), 1);
|
|
1910
|
-
var special = import_depcheck.default.special;
|
|
1911
|
-
var defaultIgnorePatterns = [
|
|
1912
|
-
"*.d.ts",
|
|
1913
|
-
"dist",
|
|
1914
|
-
".*",
|
|
1915
|
-
"node_modules"
|
|
1916
|
-
];
|
|
1917
|
-
var defaultIgnoreDevDeps = [
|
|
1918
|
-
"@xylabs/ts-scripts-yarn3",
|
|
1919
|
-
"@xylabs/tsconfig",
|
|
1920
|
-
"@xylabs/tsconfig-dom",
|
|
1921
|
-
"@xylabs/tsconfig-react",
|
|
1922
|
-
"@xylabs/tsconfig-jest",
|
|
1923
|
-
"typescript"
|
|
1924
|
-
];
|
|
1925
|
-
var defaultIgnoreDevPatterns = [
|
|
1926
|
-
"*.stories.*",
|
|
1927
|
-
"*.spec.*",
|
|
1928
|
-
"spec",
|
|
1929
|
-
"stories",
|
|
1930
|
-
"tsconfig.json"
|
|
1931
|
-
];
|
|
1932
|
-
var reportUnused = /* @__PURE__ */ __name((name, unused) => {
|
|
1933
|
-
if (unused.length > 0) {
|
|
1934
|
-
const message = [
|
|
1935
|
-
import_chalk25.default.yellow(`${unused.length} Unused ${name}`)
|
|
1936
|
-
];
|
|
1937
|
-
for (const value of unused) message.push(import_chalk25.default.gray(` ${value}`));
|
|
1938
|
-
console.log(message.join("\n"));
|
|
1939
|
-
}
|
|
1940
|
-
}, "reportUnused");
|
|
1941
|
-
var reportMissing = /* @__PURE__ */ __name((name, missing) => {
|
|
1942
|
-
if (Object.keys(missing).length > 0) {
|
|
1943
|
-
const message = [
|
|
1944
|
-
import_chalk25.default.yellow(`${Object.entries(missing).length} Missing ${name}`)
|
|
1945
|
-
];
|
|
1946
|
-
for (const [key, value] of Object.entries(missing)) {
|
|
1947
|
-
message.push(`${key}`, import_chalk25.default.gray(` ${value.at(0)}`));
|
|
1948
|
-
}
|
|
1949
|
-
console.log(import_chalk25.default.yellow(message.join("\n")));
|
|
1950
|
-
}
|
|
1951
|
-
}, "reportMissing");
|
|
1952
|
-
var analyzeDeps = /* @__PURE__ */ __name(async (pkg, ignoreMatches) => {
|
|
1953
|
-
const packageContent = (0, import_node_fs7.existsSync)(`${pkg}/package.json`) ? JSON.parse((0, import_node_fs7.readFileSync)(`${pkg}/package.json`, {
|
|
1954
|
-
encoding: "utf8"
|
|
1955
|
-
})) : void 0;
|
|
1956
|
-
const [srcUnused, allUnused] = await Promise.all([
|
|
1957
|
-
(0, import_depcheck.default)(`${pkg}/src`, {
|
|
1958
|
-
ignoreMatches,
|
|
1959
|
-
ignorePatterns: [
|
|
1960
|
-
...defaultIgnoreDevPatterns,
|
|
1961
|
-
...defaultIgnorePatterns
|
|
1962
|
-
],
|
|
1963
|
-
package: packageContent
|
|
1964
|
-
}),
|
|
1965
|
-
(0, import_depcheck.default)(`${pkg}/.`, {
|
|
1966
|
-
ignoreMatches: [
|
|
1967
|
-
...ignoreMatches,
|
|
1968
|
-
...defaultIgnoreDevDeps
|
|
1969
|
-
],
|
|
1970
|
-
ignorePatterns: [
|
|
1971
|
-
...defaultIgnorePatterns
|
|
1972
|
-
],
|
|
1973
|
-
package: packageContent,
|
|
1974
|
-
specials: [
|
|
1975
|
-
special.eslint,
|
|
1976
|
-
special.babel,
|
|
1977
|
-
special.bin,
|
|
1978
|
-
special.prettier,
|
|
1979
|
-
special.jest,
|
|
1980
|
-
special.mocha
|
|
1981
|
-
]
|
|
1982
|
-
})
|
|
1983
|
-
]);
|
|
1984
|
-
const unusedDeps = srcUnused.dependencies;
|
|
1985
|
-
const unusedDevDeps = allUnused.devDependencies;
|
|
1986
|
-
const usedDeps = srcUnused.using;
|
|
1987
|
-
const usedDevDeps = allUnused.using;
|
|
1988
|
-
const missing = {
|
|
1989
|
-
...srcUnused.missing,
|
|
1990
|
-
...allUnused.missing
|
|
1991
|
-
};
|
|
1992
|
-
const { invalidDirs, invalidFiles } = allUnused;
|
|
1993
|
-
return {
|
|
1994
|
-
invalidDirs,
|
|
1995
|
-
invalidFiles,
|
|
1996
|
-
missing,
|
|
1997
|
-
unusedDeps,
|
|
1998
|
-
unusedDevDeps,
|
|
1999
|
-
usedDeps,
|
|
2000
|
-
usedDevDeps
|
|
2001
|
-
};
|
|
2002
|
-
}, "analyzeDeps");
|
|
2003
|
-
var packageDeps = /* @__PURE__ */ __name(async () => {
|
|
2004
|
-
const pkg = process.env.INIT_CWD ?? (0, import_node_process3.cwd)();
|
|
2005
|
-
const pkgName = process.env.npm_package_name;
|
|
2006
|
-
const packageContent = (0, import_node_fs7.existsSync)(`${pkg}/package.json`) ? JSON.parse((0, import_node_fs7.readFileSync)(`${pkg}/package.json`, {
|
|
2007
|
-
encoding: "utf8"
|
|
2008
|
-
})) : void 0;
|
|
2009
|
-
const rawIgnore = (0, import_node_fs7.existsSync)(`${pkg}/.depcheckrc`) ? (0, import_node_fs7.readFileSync)(`${pkg}/.depcheckrc`, {
|
|
2010
|
-
encoding: "utf8"
|
|
2011
|
-
}).replace("ignores:", '"ignores":') : void 0;
|
|
2012
|
-
let ignoreMatches = [];
|
|
2013
|
-
try {
|
|
2014
|
-
ignoreMatches = rawIgnore ? JSON.parse(`{${rawIgnore}}`).ignores : [];
|
|
2015
|
-
} catch (ex) {
|
|
2016
|
-
const error = ex;
|
|
2017
|
-
console.log(`${pkgName} [${error.message}] Failed to parse .depcheckrc [${rawIgnore}]`);
|
|
2018
|
-
}
|
|
2019
|
-
const { invalidDirs, invalidFiles, unusedDeps, unusedDevDeps, usedDeps, usedDevDeps, missing } = await analyzeDeps(pkg, ignoreMatches);
|
|
2020
|
-
const declaredDeps = Object.keys(packageContent.dependencies ?? {});
|
|
2021
|
-
const declaredPeerDeps = Object.keys(packageContent.peerDependencies ?? {});
|
|
2022
|
-
const declaredDevDeps = Object.keys(packageContent.devDependencies ?? {});
|
|
2023
|
-
const missingDeps = Object.keys(usedDeps).filter((key) => !declaredDeps.includes(key) && !declaredPeerDeps.includes(key) && !key.startsWith("@types/"));
|
|
2024
|
-
const missingDevDeps = Object.keys(usedDevDeps).filter((key) => !declaredDevDeps.includes(key) && !declaredDeps.includes(key));
|
|
2025
|
-
const missingDepsObject = {};
|
|
2026
|
-
for (const key of missingDeps) {
|
|
2027
|
-
missingDepsObject[key] = missing[key] ?? [
|
|
2028
|
-
`devDep should be dep [${key}]`
|
|
2029
|
-
];
|
|
2030
|
-
}
|
|
2031
|
-
const missingDevDepsObject = {};
|
|
2032
|
-
for (const key of missingDevDeps) {
|
|
2033
|
-
if (missing[key]) {
|
|
2034
|
-
missingDevDepsObject[key] = missing[key];
|
|
2035
|
-
}
|
|
2036
|
-
}
|
|
2037
|
-
const errorCounts = [
|
|
2038
|
-
unusedDeps.length,
|
|
2039
|
-
unusedDevDeps.length,
|
|
2040
|
-
Object.entries(invalidDirs).length,
|
|
2041
|
-
Object.entries(invalidFiles).length,
|
|
2042
|
-
Object.entries(missingDepsObject).length,
|
|
2043
|
-
Object.entries(missingDevDepsObject).length
|
|
2044
|
-
];
|
|
2045
|
-
const errorCount = errorCounts.reduce((prev, count) => prev + count, 0);
|
|
2046
|
-
if (errorCount > 0) {
|
|
2047
|
-
console.log(`Deps [${pkgName}] = (${JSON.stringify(errorCounts)})`);
|
|
2048
|
-
} else {
|
|
2049
|
-
console.log(`Deps [${pkgName}] - Ok`);
|
|
2050
|
-
}
|
|
2051
|
-
reportUnused("dependencies", unusedDeps);
|
|
2052
|
-
reportUnused("devDependencies", unusedDevDeps);
|
|
2053
|
-
if (Object.entries(invalidDirs).length > 0) {
|
|
2054
|
-
for (const [key, value] of Object.entries(invalidDirs)) console.warn(import_chalk25.default.gray(`Invalid Dir: ${key}: ${value}`));
|
|
2055
|
-
}
|
|
2056
|
-
if (Object.entries(invalidFiles).length > 0) {
|
|
2057
|
-
for (const [key, value] of Object.entries(invalidFiles)) console.warn(import_chalk25.default.gray(`Invalid File: ${key}: ${value}`));
|
|
2058
|
-
}
|
|
2059
|
-
reportMissing("dependencies", missingDepsObject);
|
|
2060
|
-
reportMissing("devDependencies", missingDevDepsObject);
|
|
2061
|
-
checkResult(`Deps [${pkgName}]`, errorCount, "warn", false);
|
|
2062
|
-
return 0;
|
|
2063
|
-
}, "packageDeps");
|
|
2064
|
-
|
|
2065
|
-
// src/actions/package/gen-docs.ts
|
|
2066
|
-
var import_node_fs8 = require("fs");
|
|
2067
|
-
var import_node_path4 = __toESM(require("path"), 1);
|
|
2068
|
-
var import_chalk26 = __toESM(require("chalk"), 1);
|
|
2069
|
-
var import_typedoc = require("typedoc");
|
|
2070
|
-
var ExitCodes = {
|
|
2071
|
-
CompileError: 3,
|
|
2072
|
-
ExceptionThrown: 6,
|
|
2073
|
-
NoEntryPoints: 2,
|
|
2074
|
-
Ok: 0,
|
|
2075
|
-
OptionError: 1,
|
|
2076
|
-
OutputError: 5,
|
|
2077
|
-
ValidationError: 4
|
|
2078
|
-
};
|
|
2079
|
-
var packageGenDocs = /* @__PURE__ */ __name(async () => {
|
|
2080
|
-
const pkg = process.env.INIT_CWD;
|
|
2081
|
-
if (pkg && !(0, import_node_fs8.existsSync)(import_node_path4.default.join(pkg, "typedoc.json"))) {
|
|
2082
|
-
return;
|
|
2083
|
-
}
|
|
2084
|
-
const app = await import_typedoc.Application.bootstrap({
|
|
2085
|
-
entryPointStrategy: "merge",
|
|
2086
|
-
entryPoints: [
|
|
2087
|
-
`${pkg}/src/**/*.ts`,
|
|
2088
|
-
`${pkg}/packages/*/dist/docs.json`
|
|
2089
|
-
],
|
|
2090
|
-
excludeExternals: true,
|
|
2091
|
-
json: `${pkg}/dist/docs.json`,
|
|
2092
|
-
logLevel: "Error",
|
|
2093
|
-
tsconfig: `${pkg}/tsconfig.json`
|
|
2094
|
-
});
|
|
2095
|
-
app.options.addReader(new import_typedoc.ArgumentsReader(0));
|
|
2096
|
-
app.options.addReader(new import_typedoc.TypeDocReader());
|
|
2097
|
-
app.options.addReader(new import_typedoc.TSConfigReader());
|
|
2098
|
-
app.options.addReader(new import_typedoc.ArgumentsReader(300));
|
|
2099
|
-
return await runTypeDoc(app);
|
|
2100
|
-
}, "packageGenDocs");
|
|
2101
|
-
var runTypeDoc = /* @__PURE__ */ __name(async (app) => {
|
|
2102
|
-
const pkgName = process.env.npm_package_name;
|
|
2103
|
-
if (app.options.getValue("version")) {
|
|
2104
|
-
console.log(app.toString());
|
|
2105
|
-
return ExitCodes.Ok;
|
|
2106
|
-
}
|
|
2107
|
-
if (app.options.getValue("showConfig")) {
|
|
2108
|
-
console.log(app.options.getRawValues());
|
|
2109
|
-
return ExitCodes.Ok;
|
|
2110
|
-
}
|
|
2111
|
-
if (app.logger.hasErrors()) {
|
|
2112
|
-
return ExitCodes.OptionError;
|
|
2113
|
-
}
|
|
2114
|
-
if (app.options.getValue("treatWarningsAsErrors") && app.logger.hasWarnings()) {
|
|
2115
|
-
return ExitCodes.OptionError;
|
|
2116
|
-
}
|
|
2117
|
-
if (app.options.getValue("entryPoints").length === 0) {
|
|
2118
|
-
app.logger.error("No entry points provided");
|
|
2119
|
-
return ExitCodes.NoEntryPoints;
|
|
2120
|
-
}
|
|
2121
|
-
if (app.options.getValue("watch")) {
|
|
2122
|
-
app.convertAndWatch(async (project2) => {
|
|
2123
|
-
const out = app.options.getValue("out");
|
|
2124
|
-
if (out) {
|
|
2125
|
-
await app.generateDocs(project2, out);
|
|
2126
|
-
}
|
|
2127
|
-
const json = app.options.getValue("json");
|
|
2128
|
-
if (json) {
|
|
2129
|
-
await app.generateJson(project2, json);
|
|
2130
|
-
}
|
|
2131
|
-
if (!out && !json) {
|
|
2132
|
-
await app.generateDocs(project2, "./docs");
|
|
2133
|
-
}
|
|
2134
|
-
});
|
|
2135
|
-
return ExitCodes.Ok;
|
|
2136
|
-
}
|
|
2137
|
-
const project = await app.convert();
|
|
2138
|
-
if (!project) {
|
|
2139
|
-
return ExitCodes.CompileError;
|
|
2140
|
-
}
|
|
2141
|
-
if (app.options.getValue("treatWarningsAsErrors") && app.logger.hasWarnings()) {
|
|
2142
|
-
return ExitCodes.CompileError;
|
|
2143
|
-
}
|
|
2144
|
-
app.validate(project);
|
|
2145
|
-
if (app.logger.hasErrors()) {
|
|
2146
|
-
return ExitCodes.ValidationError;
|
|
2147
|
-
}
|
|
2148
|
-
if (app.options.getValue("treatWarningsAsErrors") && app.logger.hasWarnings()) {
|
|
2149
|
-
return ExitCodes.ValidationError;
|
|
2150
|
-
}
|
|
2151
|
-
if (app.options.getValue("emit") !== "none") {
|
|
2152
|
-
const out = app.options.getValue("out");
|
|
2153
|
-
if (out) {
|
|
2154
|
-
await app.generateDocs(project, out);
|
|
2155
|
-
}
|
|
2156
|
-
const json = app.options.getValue("json");
|
|
2157
|
-
if (json) {
|
|
2158
|
-
await app.generateJson(project, json);
|
|
2159
|
-
}
|
|
2160
|
-
if (!out && !json) {
|
|
2161
|
-
await app.generateDocs(project, "./docs");
|
|
2162
|
-
}
|
|
2163
|
-
if (app.logger.hasErrors()) {
|
|
2164
|
-
return ExitCodes.OutputError;
|
|
2165
|
-
}
|
|
2166
|
-
if (app.options.getValue("treatWarningsAsErrors") && app.logger.hasWarnings()) {
|
|
2167
|
-
return ExitCodes.OutputError;
|
|
2168
|
-
}
|
|
2169
|
-
}
|
|
2170
|
-
console.log(import_chalk26.default.green(`${pkgName} - Ok`));
|
|
2171
|
-
return ExitCodes.Ok;
|
|
2172
|
-
}, "runTypeDoc");
|
|
2173
|
-
|
|
2174
|
-
// src/actions/package/recompile.ts
|
|
2175
|
-
var packageRecompile = /* @__PURE__ */ __name(async () => {
|
|
2176
|
-
return (await Promise.all([
|
|
2177
|
-
packageClean(),
|
|
2178
|
-
packageCompile()
|
|
2179
|
-
])).reduce((prev, value) => prev + value, 0);
|
|
2180
|
-
}, "packageRecompile");
|
|
2181
|
-
|
|
2182
|
-
// src/actions/publint.ts
|
|
2183
|
-
var publint = /* @__PURE__ */ __name(async ({ verbose, pkg }) => {
|
|
2184
|
-
return pkg ? await publintPackage({
|
|
2185
|
-
pkg,
|
|
2186
|
-
verbose
|
|
2187
|
-
}) : publintAll({
|
|
2188
|
-
verbose
|
|
2189
|
-
});
|
|
2190
|
-
}, "publint");
|
|
2191
|
-
var publintPackage = /* @__PURE__ */ __name(({ pkg }) => {
|
|
2192
|
-
return runStepsAsync(`Publint [${pkg}]`, [
|
|
2193
|
-
[
|
|
2194
|
-
"yarn",
|
|
2195
|
-
[
|
|
2196
|
-
"workspace",
|
|
2197
|
-
pkg,
|
|
2198
|
-
"run",
|
|
2199
|
-
"package-publint"
|
|
2200
|
-
]
|
|
2201
|
-
]
|
|
2202
|
-
]);
|
|
2203
|
-
}, "publintPackage");
|
|
2204
|
-
var publintAll = /* @__PURE__ */ __name(({ verbose }) => {
|
|
2205
|
-
const verboseOptions = verbose ? [
|
|
2206
|
-
"--verbose"
|
|
2207
|
-
] : [
|
|
2208
|
-
"--no-verbose"
|
|
2209
|
-
];
|
|
2210
|
-
return runSteps("Publint", [
|
|
2211
|
-
[
|
|
2212
|
-
"yarn",
|
|
2213
|
-
[
|
|
2214
|
-
"workspaces",
|
|
2215
|
-
"foreach",
|
|
2216
|
-
"-pA",
|
|
2217
|
-
...verboseOptions,
|
|
2218
|
-
"run",
|
|
2219
|
-
"package-publint"
|
|
2220
|
-
]
|
|
2221
|
-
]
|
|
2222
|
-
]);
|
|
2223
|
-
}, "publintAll");
|
|
2224
|
-
|
|
2225
|
-
// src/actions/rebuild.ts
|
|
2226
|
-
var rebuild = /* @__PURE__ */ __name(({ target }) => {
|
|
2227
|
-
return runSteps("Rebuild", [
|
|
2228
|
-
[
|
|
2229
|
-
"yarn",
|
|
2230
|
-
"xy clean"
|
|
2231
|
-
],
|
|
2232
|
-
[
|
|
2233
|
-
"yarn",
|
|
2234
|
-
target ? `xy build -t ${target}` : "xy build"
|
|
2235
|
-
]
|
|
2236
|
-
]);
|
|
2237
|
-
}, "rebuild");
|
|
2238
|
-
|
|
2239
|
-
// src/actions/recompile.ts
|
|
2240
|
-
var import_chalk27 = __toESM(require("chalk"), 1);
|
|
2241
|
-
var recompile = /* @__PURE__ */ __name(async ({ verbose, target, pkg, incremental }) => {
|
|
2242
|
-
return pkg ? await recompilePackage({
|
|
2243
|
-
pkg,
|
|
2244
|
-
target,
|
|
2245
|
-
verbose
|
|
2246
|
-
}) : await recompileAll({
|
|
2247
|
-
incremental,
|
|
2248
|
-
target,
|
|
2249
|
-
verbose
|
|
2250
|
-
});
|
|
2251
|
-
}, "recompile");
|
|
2252
|
-
var recompilePackage = /* @__PURE__ */ __name(({ verbose, target, pkg }) => {
|
|
2253
|
-
const targetOptions = target ? [
|
|
2254
|
-
"-t",
|
|
2255
|
-
target
|
|
2256
|
-
] : [];
|
|
2257
|
-
const verboseOptions = verbose ? [
|
|
2258
|
-
"--verbose"
|
|
2259
|
-
] : [
|
|
2260
|
-
"--no-verbose"
|
|
2261
|
-
];
|
|
2262
|
-
return runStepsAsync(`Recompile [${pkg}]`, [
|
|
2263
|
-
[
|
|
2264
|
-
"yarn",
|
|
2265
|
-
[
|
|
2266
|
-
"workspace",
|
|
2267
|
-
pkg,
|
|
2268
|
-
...verboseOptions,
|
|
2269
|
-
"run",
|
|
2270
|
-
"package-recompile",
|
|
2271
|
-
...targetOptions
|
|
2272
|
-
]
|
|
2273
|
-
]
|
|
2274
|
-
]);
|
|
2275
|
-
}, "recompilePackage");
|
|
2276
|
-
var recompileAll = /* @__PURE__ */ __name(async ({ jobs, verbose, target, incremental }) => {
|
|
2277
|
-
const start = Date.now();
|
|
2278
|
-
const verboseOptions = verbose ? [
|
|
2279
|
-
"--verbose"
|
|
2280
|
-
] : [
|
|
2281
|
-
"--no-verbose"
|
|
2282
|
-
];
|
|
2283
|
-
const targetOptions = target ? [
|
|
2284
|
-
"-t",
|
|
2285
|
-
target
|
|
2286
|
-
] : [];
|
|
2287
|
-
const incrementalOptions = incremental ? [
|
|
2288
|
-
"--since",
|
|
2289
|
-
"-Apt",
|
|
2290
|
-
"--topological-dev"
|
|
2291
|
-
] : [
|
|
2292
|
-
"--parallel",
|
|
2293
|
-
"-Apt",
|
|
2294
|
-
"--topological-dev"
|
|
2295
|
-
];
|
|
2296
|
-
const jobsOptions = jobs ? [
|
|
2297
|
-
"-j",
|
|
2298
|
-
`${jobs}`
|
|
2299
|
-
] : [];
|
|
2300
|
-
if (jobs) {
|
|
2301
|
-
console.log(import_chalk27.default.blue(`Jobs set to [${jobs}]`));
|
|
2302
|
-
}
|
|
2303
|
-
const result = await runStepsAsync(`Recompile${incremental ? "-Incremental" : ""} [All]`, [
|
|
2304
|
-
[
|
|
2305
|
-
"yarn",
|
|
2306
|
-
[
|
|
2307
|
-
"workspaces",
|
|
2308
|
-
"foreach",
|
|
2309
|
-
...incrementalOptions,
|
|
2310
|
-
...jobsOptions,
|
|
2311
|
-
...verboseOptions,
|
|
2312
|
-
"run",
|
|
2313
|
-
"package-recompile",
|
|
2314
|
-
...targetOptions
|
|
2315
|
-
]
|
|
2316
|
-
]
|
|
2317
|
-
]);
|
|
2318
|
-
console.log(`${import_chalk27.default.gray("Recompiled in")} [${import_chalk27.default.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${import_chalk27.default.gray("seconds")}`);
|
|
2319
|
-
return result;
|
|
2320
|
-
}, "recompileAll");
|
|
2321
|
-
|
|
2322
|
-
// src/actions/reinstall.ts
|
|
2323
|
-
var import_node_fs9 = require("fs");
|
|
2324
|
-
var reinstall = /* @__PURE__ */ __name(() => {
|
|
2325
|
-
console.log("Reinstall [Clear Lock File]");
|
|
2326
|
-
(0, import_node_fs9.closeSync)((0, import_node_fs9.openSync)("./yarn.lock", "w"));
|
|
2327
|
-
console.log("Reinstall [Clear Node Modules]");
|
|
2328
|
-
const workspaces = yarnWorkspaces();
|
|
2329
|
-
const result = workspaces.map(({ location, name }) => {
|
|
2330
|
-
const dist = `${location}/node_modules`;
|
|
2331
|
-
try {
|
|
2332
|
-
(0, import_node_fs9.rmSync)(dist, {
|
|
2333
|
-
force: true,
|
|
2334
|
-
recursive: true
|
|
2335
|
-
});
|
|
2336
|
-
return 0;
|
|
2337
|
-
} catch (ex) {
|
|
2338
|
-
const error = ex;
|
|
2339
|
-
console.error(`Reinstall [Clear Node Modules] Failed [${name}, ${error.message}]`);
|
|
2340
|
-
return 1;
|
|
2341
|
-
}
|
|
2342
|
-
}).reduce((prev, result2) => prev || result2, 0);
|
|
2343
|
-
return result || runSteps("Reinstall", [
|
|
2344
|
-
[
|
|
2345
|
-
"yarn",
|
|
2346
|
-
"install --network-timeout 10000"
|
|
2347
|
-
]
|
|
2348
|
-
]);
|
|
2349
|
-
}, "reinstall");
|
|
2350
|
-
|
|
2351
|
-
// src/actions/relint.ts
|
|
2352
|
-
var import_node_fs10 = require("fs");
|
|
2353
|
-
var relint = /* @__PURE__ */ __name(() => {
|
|
2354
|
-
console.log("Relint - Cleaning [.eslintcache]");
|
|
2355
|
-
const workspaces = yarnWorkspaces();
|
|
2356
|
-
const result = workspaces.map(({ location, name }) => {
|
|
2357
|
-
const dist = `${location}/.eslintcache`;
|
|
2358
|
-
try {
|
|
2359
|
-
(0, import_node_fs10.rmSync)(dist, {
|
|
2360
|
-
force: true,
|
|
2361
|
-
recursive: true
|
|
2362
|
-
});
|
|
2363
|
-
return 0;
|
|
2364
|
-
} catch (ex) {
|
|
2365
|
-
const error = ex;
|
|
2366
|
-
console.error(`Relint - Cleaning [.eslintcache] Failed [${name}, ${error.message}]`);
|
|
2367
|
-
return 1;
|
|
2368
|
-
}
|
|
2369
|
-
}).reduce((prev, result2) => prev || result2, 0);
|
|
2370
|
-
return result || runSteps("Relint", [
|
|
2371
|
-
[
|
|
2372
|
-
"yarn",
|
|
2373
|
-
[
|
|
2374
|
-
"eslint",
|
|
2375
|
-
".",
|
|
2376
|
-
"--cache"
|
|
2377
|
-
]
|
|
2378
|
-
]
|
|
2379
|
-
]);
|
|
2380
|
-
}, "relint");
|
|
2381
|
-
|
|
2382
|
-
// src/actions/retest.ts
|
|
2383
|
-
var retest = /* @__PURE__ */ __name(() => {
|
|
2384
|
-
return runSteps("Test", [
|
|
2385
|
-
[
|
|
2386
|
-
"yarn",
|
|
2387
|
-
[
|
|
2388
|
-
"jest",
|
|
2389
|
-
"--clearCache"
|
|
2390
|
-
]
|
|
2391
|
-
],
|
|
2392
|
-
[
|
|
2393
|
-
"yarn",
|
|
2394
|
-
[
|
|
2395
|
-
"jest",
|
|
2396
|
-
"."
|
|
2397
|
-
]
|
|
2398
|
-
]
|
|
2399
|
-
]);
|
|
2400
|
-
}, "retest");
|
|
2401
|
-
|
|
2402
|
-
// src/actions/sonar.ts
|
|
2403
|
-
var sonar = /* @__PURE__ */ __name(() => {
|
|
2404
|
-
return runSteps("Sonar", [
|
|
2405
|
-
[
|
|
2406
|
-
"yarn",
|
|
2407
|
-
[
|
|
2408
|
-
"eslint",
|
|
2409
|
-
"-c",
|
|
2410
|
-
"sonar.eslintrc",
|
|
2411
|
-
"."
|
|
2412
|
-
]
|
|
2413
|
-
]
|
|
2414
|
-
]);
|
|
2415
|
-
}, "sonar");
|
|
2416
|
-
|
|
2417
|
-
// src/actions/statics.ts
|
|
2418
|
-
var import_chalk28 = __toESM(require("chalk"), 1);
|
|
2419
|
-
var DefaultDependencies = [
|
|
2420
|
-
"axios",
|
|
2421
|
-
"@xylabs/pixel",
|
|
2422
|
-
"react",
|
|
2423
|
-
"graphql",
|
|
2424
|
-
"react-router",
|
|
2425
|
-
"@mui/material",
|
|
2426
|
-
"@mui/system"
|
|
2427
|
-
];
|
|
2428
|
-
var statics = /* @__PURE__ */ __name(() => {
|
|
2429
|
-
console.log(import_chalk28.default.green("Check Required Static Dependencies"));
|
|
2430
|
-
const statics2 = parsedPackageJSON()?.xy?.deps?.statics;
|
|
2431
|
-
return detectDuplicateDependencies(statics2, DefaultDependencies);
|
|
2432
|
-
}, "statics");
|
|
2433
|
-
|
|
2434
|
-
// src/actions/test.ts
|
|
2435
|
-
var test = /* @__PURE__ */ __name(() => {
|
|
2436
|
-
return runSteps("Test", [
|
|
2437
|
-
[
|
|
2438
|
-
"yarn",
|
|
2439
|
-
[
|
|
2440
|
-
"jest",
|
|
2441
|
-
"."
|
|
2442
|
-
]
|
|
2443
|
-
]
|
|
2444
|
-
]);
|
|
2445
|
-
}, "test");
|
|
2446
|
-
|
|
2447
|
-
// src/actions/up.ts
|
|
2448
|
-
var up = /* @__PURE__ */ __name(() => {
|
|
2449
|
-
return runSteps("Up", [
|
|
2450
|
-
[
|
|
2451
|
-
"yarn",
|
|
2452
|
-
"outdated"
|
|
2453
|
-
]
|
|
2454
|
-
]);
|
|
2455
|
-
}, "up");
|
|
2456
|
-
|
|
2457
|
-
// src/actions/updo.ts
|
|
2458
|
-
var updo = /* @__PURE__ */ __name(() => {
|
|
2459
|
-
return runSteps("Updo", [
|
|
2460
|
-
[
|
|
2461
|
-
"yarn",
|
|
2462
|
-
"install"
|
|
2463
|
-
],
|
|
2464
|
-
[
|
|
2465
|
-
"yarn",
|
|
2466
|
-
"upgrade-interactive"
|
|
2467
|
-
],
|
|
2468
|
-
[
|
|
2469
|
-
"yarn",
|
|
2470
|
-
"dedupe"
|
|
2471
|
-
]
|
|
2472
|
-
]);
|
|
2473
|
-
}, "updo");
|
|
2474
|
-
|
|
2475
|
-
// src/actions/upplug.ts
|
|
2476
|
-
var updateYarnPlugins = /* @__PURE__ */ __name(() => {
|
|
2477
|
-
return runSteps("Update Yarn Plugins", [
|
|
2478
|
-
[
|
|
2479
|
-
"yarn",
|
|
2480
|
-
[
|
|
2481
|
-
"plugin",
|
|
2482
|
-
"import",
|
|
2483
|
-
"https://mskelton.dev/yarn-outdated/v3"
|
|
2484
|
-
]
|
|
2485
|
-
],
|
|
2486
|
-
[
|
|
2487
|
-
"yarn",
|
|
2488
|
-
[
|
|
2489
|
-
"plugin",
|
|
2490
|
-
"import",
|
|
2491
|
-
"version"
|
|
2492
|
-
]
|
|
2493
|
-
],
|
|
2494
|
-
[
|
|
2495
|
-
"yarn",
|
|
2496
|
-
[
|
|
2497
|
-
"plugin",
|
|
2498
|
-
"import",
|
|
2499
|
-
"interactive-tools"
|
|
2500
|
-
]
|
|
2501
|
-
],
|
|
2502
|
-
[
|
|
2503
|
-
"yarn",
|
|
2504
|
-
[
|
|
2505
|
-
"plugin",
|
|
2506
|
-
"import",
|
|
2507
|
-
"workspace-tools"
|
|
2508
|
-
]
|
|
2509
|
-
]
|
|
2510
|
-
]);
|
|
2511
|
-
}, "updateYarnPlugins");
|
|
2512
|
-
|
|
2513
|
-
// src/actions/upyarn.ts
|
|
2514
|
-
var updateYarnVersion = /* @__PURE__ */ __name(() => {
|
|
2515
|
-
return runSteps("Update Yarn Version", [
|
|
2516
|
-
[
|
|
2517
|
-
"yarn",
|
|
2518
|
-
[
|
|
2519
|
-
"set",
|
|
2520
|
-
"version",
|
|
2521
|
-
"latest"
|
|
2522
|
-
]
|
|
2523
|
-
]
|
|
2524
|
-
]);
|
|
2525
|
-
}, "updateYarnVersion");
|
|
2526
|
-
|
|
2527
|
-
// src/actions/yarn3only.ts
|
|
2528
|
-
var yarn3Only = /* @__PURE__ */ __name(() => {
|
|
2529
|
-
const [valid, version] = isYarnVersionOrGreater(3);
|
|
2530
|
-
if (!valid) {
|
|
2531
|
-
processEx(`Invalid Yarn version [${version}]`);
|
|
2532
|
-
}
|
|
2533
|
-
return 0;
|
|
2534
|
-
}, "yarn3Only");
|
|
2535
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
2536
|
-
0 && (module.exports = {
|
|
2537
|
-
build,
|
|
2538
|
-
clean,
|
|
2539
|
-
cleanAll,
|
|
2540
|
-
cleanDocs,
|
|
2541
|
-
cleanPackage,
|
|
2542
|
-
compile,
|
|
2543
|
-
compileAll,
|
|
2544
|
-
compilePackage,
|
|
2545
|
-
copyAssets,
|
|
2546
|
-
cycle,
|
|
2547
|
-
dead,
|
|
2548
|
-
deploy,
|
|
2549
|
-
deployMajor,
|
|
2550
|
-
deployMinor,
|
|
2551
|
-
deployNext,
|
|
2552
|
-
deps,
|
|
2553
|
-
depsAll,
|
|
2554
|
-
depsPackage,
|
|
2555
|
-
dupdeps,
|
|
2556
|
-
fix,
|
|
2557
|
-
genDocs,
|
|
2558
|
-
genDocsAll,
|
|
2559
|
-
genDocsPackage,
|
|
2560
|
-
gitignoreGen,
|
|
2561
|
-
gitlint,
|
|
2562
|
-
gitlintFix,
|
|
2563
|
-
license,
|
|
2564
|
-
lint,
|
|
2565
|
-
lintAll,
|
|
2566
|
-
lintClean,
|
|
2567
|
-
lintPackage,
|
|
2568
|
-
lintProfile,
|
|
2569
|
-
npmignoreGen,
|
|
2570
|
-
packageClean,
|
|
2571
|
-
packageCleanOutputs,
|
|
2572
|
-
packageCleanTypescript,
|
|
2573
|
-
packageCompile,
|
|
2574
|
-
packageCompileTsc,
|
|
2575
|
-
packageCompileTsup,
|
|
2576
|
-
packageCopyAssets,
|
|
2577
|
-
packageDeps,
|
|
2578
|
-
packageGenDocs,
|
|
2579
|
-
packagePublint,
|
|
2580
|
-
packageRecompile,
|
|
2581
|
-
publint,
|
|
2582
|
-
publintAll,
|
|
2583
|
-
publintPackage,
|
|
2584
|
-
rebuild,
|
|
2585
|
-
recompile,
|
|
2586
|
-
recompileAll,
|
|
2587
|
-
recompilePackage,
|
|
2588
|
-
reinstall,
|
|
2589
|
-
relint,
|
|
2590
|
-
retest,
|
|
2591
|
-
sonar,
|
|
2592
|
-
statics,
|
|
2593
|
-
test,
|
|
2594
|
-
up,
|
|
2595
|
-
updateYarnPlugins,
|
|
2596
|
-
updateYarnVersion,
|
|
2597
|
-
updo,
|
|
2598
|
-
yarn3Only
|
|
2599
|
-
});
|
|
2600
|
-
//# sourceMappingURL=index.cjs.map
|