@xylabs/ts-scripts-yarn3 7.0.2 → 7.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/actions/build.mjs +39 -87
- package/dist/actions/build.mjs.map +1 -1
- package/dist/actions/clean-docs.mjs +8 -22
- package/dist/actions/clean-docs.mjs.map +1 -1
- package/dist/actions/clean-eslint.mjs +5 -11
- package/dist/actions/clean-eslint.mjs.map +1 -1
- package/dist/actions/clean-jest.mjs +16 -29
- package/dist/actions/clean-jest.mjs.map +1 -1
- package/dist/actions/clean.mjs +32 -63
- package/dist/actions/clean.mjs.map +1 -1
- package/dist/actions/compile.mjs +50 -76
- package/dist/actions/compile.mjs.map +1 -1
- package/dist/actions/copy-assets.mjs +23 -38
- package/dist/actions/copy-assets.mjs.map +1 -1
- package/dist/actions/cycle.mjs +28 -57
- package/dist/actions/cycle.mjs.map +1 -1
- package/dist/actions/dead.mjs +16 -31
- package/dist/actions/dead.mjs.map +1 -1
- package/dist/actions/deplint/checkPackage/checkPackage.mjs +48 -71
- package/dist/actions/deplint/checkPackage/checkPackage.mjs.map +1 -1
- package/dist/actions/deplint/checkPackage/getUnlistedDependencies.mjs +5 -5
- package/dist/actions/deplint/checkPackage/getUnlistedDependencies.mjs.map +1 -1
- package/dist/actions/deplint/checkPackage/getUnlistedDevDependencies.mjs +9 -5
- package/dist/actions/deplint/checkPackage/getUnlistedDevDependencies.mjs.map +1 -1
- package/dist/actions/deplint/checkPackage/getUnusedDependencies.mjs +5 -5
- package/dist/actions/deplint/checkPackage/getUnusedDependencies.mjs.map +1 -1
- package/dist/actions/deplint/checkPackage/getUnusedPeerDependencies.mjs +0 -4
- package/dist/actions/deplint/checkPackage/getUnusedPeerDependencies.mjs.map +1 -1
- package/dist/actions/deplint/checkPackage/index.mjs +48 -71
- package/dist/actions/deplint/checkPackage/index.mjs.map +1 -1
- package/dist/actions/deplint/deplint.mjs +61 -86
- package/dist/actions/deplint/deplint.mjs.map +1 -1
- package/dist/actions/deplint/findFiles.mjs +4 -20
- package/dist/actions/deplint/findFiles.mjs.map +1 -1
- package/dist/actions/deplint/findFilesByGlob.mjs +1 -8
- package/dist/actions/deplint/findFilesByGlob.mjs.map +1 -1
- package/dist/actions/deplint/getBasePackageName.mjs +0 -4
- package/dist/actions/deplint/getBasePackageName.mjs.map +1 -1
- package/dist/actions/deplint/getDependenciesFromPackageJson.mjs +0 -4
- package/dist/actions/deplint/getDependenciesFromPackageJson.mjs.map +1 -1
- package/dist/actions/deplint/getExternalImportsFromFiles.mjs +12 -24
- package/dist/actions/deplint/getExternalImportsFromFiles.mjs.map +1 -1
- package/dist/actions/deplint/getImportsFromFile.mjs +9 -16
- package/dist/actions/deplint/getImportsFromFile.mjs.map +1 -1
- package/dist/actions/deplint/index.mjs +61 -86
- package/dist/actions/deplint/index.mjs.map +1 -1
- package/dist/actions/deploy-major.mjs +26 -57
- package/dist/actions/deploy-major.mjs.map +1 -1
- package/dist/actions/deploy-minor.mjs +26 -57
- package/dist/actions/deploy-minor.mjs.map +1 -1
- package/dist/actions/deploy-next.mjs +26 -57
- package/dist/actions/deploy-next.mjs.map +1 -1
- package/dist/actions/deploy.mjs +26 -57
- package/dist/actions/deploy.mjs.map +1 -1
- package/dist/actions/dupdeps.mjs +26 -37
- package/dist/actions/dupdeps.mjs.map +1 -1
- package/dist/actions/fix.mjs +36 -54
- package/dist/actions/fix.mjs.map +1 -1
- package/dist/actions/gen-docs.mjs +25 -65
- package/dist/actions/gen-docs.mjs.map +1 -1
- package/dist/actions/gitignore-gen.mjs +28 -44
- package/dist/actions/gitignore-gen.mjs.map +1 -1
- package/dist/actions/gitlint-fix.mjs +5 -14
- package/dist/actions/gitlint-fix.mjs.map +1 -1
- package/dist/actions/gitlint.mjs +4 -7
- package/dist/actions/gitlint.mjs.map +1 -1
- package/dist/actions/index.mjs +705 -1251
- package/dist/actions/index.mjs.map +1 -1
- package/dist/actions/knip.mjs +16 -31
- package/dist/actions/knip.mjs.map +1 -1
- package/dist/actions/license.mjs +37 -51
- package/dist/actions/license.mjs.map +1 -1
- package/dist/actions/lint.mjs +33 -48
- package/dist/actions/lint.mjs.map +1 -1
- package/dist/actions/npmignore-gen.mjs +28 -44
- package/dist/actions/npmignore-gen.mjs.map +1 -1
- package/dist/actions/package/clean-outputs.mjs +6 -16
- package/dist/actions/package/clean-outputs.mjs.map +1 -1
- package/dist/actions/package/clean-typescript.mjs +6 -16
- package/dist/actions/package/clean-typescript.mjs.map +1 -1
- package/dist/actions/package/clean.mjs +12 -29
- package/dist/actions/package/clean.mjs.map +1 -1
- package/dist/actions/package/compile/buildEntries.mjs +19 -34
- package/dist/actions/package/compile/buildEntries.mjs.map +1 -1
- package/dist/actions/package/compile/compile.mjs +165 -195
- package/dist/actions/package/compile/compile.mjs.map +1 -1
- package/dist/actions/package/compile/copyTypeFiles.mjs +20 -23
- package/dist/actions/package/compile/copyTypeFiles.mjs.map +1 -1
- package/dist/actions/package/compile/deepMerge.mjs +0 -5
- package/dist/actions/package/compile/deepMerge.mjs.map +1 -1
- package/dist/actions/package/compile/getCompilerOptions.mjs +2 -5
- package/dist/actions/package/compile/getCompilerOptions.mjs.map +1 -1
- package/dist/actions/package/compile/index.mjs +165 -195
- package/dist/actions/package/compile/index.mjs.map +1 -1
- package/dist/actions/package/compile/inputs.mjs +15 -25
- package/dist/actions/package/compile/inputs.mjs.map +1 -1
- package/dist/actions/package/compile/packageCompileTsc.mjs +25 -17
- package/dist/actions/package/compile/packageCompileTsc.mjs.map +1 -1
- package/dist/actions/package/compile/packageCompileTscTypes.mjs +19 -36
- package/dist/actions/package/compile/packageCompileTscTypes.mjs.map +1 -1
- package/dist/actions/package/compile/packageCompileTsup.mjs +160 -185
- package/dist/actions/package/compile/packageCompileTsup.mjs.map +1 -1
- package/dist/actions/package/copy-assets.mjs +12 -21
- package/dist/actions/package/copy-assets.mjs.map +1 -1
- package/dist/actions/package/cycle.mjs +5 -14
- package/dist/actions/package/cycle.mjs.map +1 -1
- package/dist/actions/package/gen-docs.mjs +11 -12
- package/dist/actions/package/gen-docs.mjs.map +1 -1
- package/dist/actions/package/index.mjs +236 -308
- package/dist/actions/package/index.mjs.map +1 -1
- package/dist/actions/package/lint.mjs +16 -39
- package/dist/actions/package/lint.mjs.map +1 -1
- package/dist/actions/package/publint.mjs +13 -14
- package/dist/actions/package/publint.mjs.map +1 -1
- package/dist/actions/package/recompile.mjs +179 -223
- package/dist/actions/package/recompile.mjs.map +1 -1
- package/dist/actions/publint.mjs +37 -71
- package/dist/actions/publint.mjs.map +1 -1
- package/dist/actions/rebuild.mjs +17 -29
- package/dist/actions/rebuild.mjs.map +1 -1
- package/dist/actions/recompile.mjs +50 -67
- package/dist/actions/recompile.mjs.map +1 -1
- package/dist/actions/reinstall.mjs +25 -43
- package/dist/actions/reinstall.mjs.map +1 -1
- package/dist/actions/relint.mjs +40 -63
- package/dist/actions/relint.mjs.map +1 -1
- package/dist/actions/retest.mjs +17 -35
- package/dist/actions/retest.mjs.map +1 -1
- package/dist/actions/sonar.mjs +16 -32
- package/dist/actions/sonar.mjs.map +1 -1
- package/dist/actions/statics.mjs +27 -46
- package/dist/actions/statics.mjs.map +1 -1
- package/dist/actions/test.mjs +16 -30
- package/dist/actions/test.mjs.map +1 -1
- package/dist/actions/up.mjs +16 -27
- package/dist/actions/up.mjs.map +1 -1
- package/dist/actions/updo.mjs +18 -33
- package/dist/actions/updo.mjs.map +1 -1
- package/dist/actions/upplug.mjs +19 -53
- package/dist/actions/upplug.mjs.map +1 -1
- package/dist/actions/upyarn.mjs +16 -31
- package/dist/actions/upyarn.mjs.map +1 -1
- package/dist/actions/yarn3only.mjs +12 -23
- package/dist/actions/yarn3only.mjs.map +1 -1
- package/dist/bin/package/build-only.mjs +165 -194
- package/dist/bin/package/build-only.mjs.map +1 -1
- package/dist/bin/package/build.mjs +166 -197
- package/dist/bin/package/build.mjs.map +1 -1
- package/dist/bin/package/clean-outputs.mjs +6 -15
- package/dist/bin/package/clean-outputs.mjs.map +1 -1
- package/dist/bin/package/clean-typescript.mjs +6 -15
- package/dist/bin/package/clean-typescript.mjs.map +1 -1
- package/dist/bin/package/clean.mjs +12 -28
- package/dist/bin/package/clean.mjs.map +1 -1
- package/dist/bin/package/compile-only.mjs +165 -194
- package/dist/bin/package/compile-only.mjs.map +1 -1
- package/dist/bin/package/compile-tsup.mjs +160 -184
- package/dist/bin/package/compile-tsup.mjs.map +1 -1
- package/dist/bin/package/compile.mjs +165 -194
- package/dist/bin/package/compile.mjs.map +1 -1
- package/dist/bin/package/copy-assets-cjs.mjs +13 -23
- package/dist/bin/package/copy-assets-cjs.mjs.map +1 -1
- package/dist/bin/package/copy-assets-esm.mjs +13 -23
- package/dist/bin/package/copy-assets-esm.mjs.map +1 -1
- package/dist/bin/package/cycle.mjs +5 -13
- package/dist/bin/package/cycle.mjs.map +1 -1
- package/dist/bin/package/fix.mjs +16 -38
- package/dist/bin/package/fix.mjs.map +1 -1
- package/dist/bin/package/gen-docs.mjs +11 -11
- package/dist/bin/package/gen-docs.mjs.map +1 -1
- package/dist/bin/package/lint.mjs +16 -38
- package/dist/bin/package/lint.mjs.map +1 -1
- package/dist/bin/package/publint.mjs +13 -13
- package/dist/bin/package/publint.mjs.map +1 -1
- package/dist/bin/package/recompile.mjs +179 -222
- package/dist/bin/package/recompile.mjs.map +1 -1
- package/dist/bin/package/relint.mjs +16 -38
- package/dist/bin/package/relint.mjs.map +1 -1
- package/dist/bin/xy.mjs +932 -1266
- package/dist/bin/xy.mjs.map +1 -1
- package/dist/index.mjs +1191 -1612
- package/dist/index.mjs.map +1 -1
- package/dist/lib/checkResult.mjs +2 -5
- package/dist/lib/checkResult.mjs.map +1 -1
- package/dist/lib/createBuildConfig.mjs +9 -24
- package/dist/lib/createBuildConfig.mjs.map +1 -1
- package/dist/lib/defaultBuildConfig.mjs +2 -6
- package/dist/lib/defaultBuildConfig.mjs.map +1 -1
- package/dist/lib/deleteGlob.mjs +3 -9
- package/dist/lib/deleteGlob.mjs.map +1 -1
- package/dist/lib/dependencies/DuplicateDetector.mjs +12 -23
- package/dist/lib/dependencies/DuplicateDetector.mjs.map +1 -1
- package/dist/lib/dependencies/detectDuplicateDependencies.mjs +22 -33
- package/dist/lib/dependencies/detectDuplicateDependencies.mjs.map +1 -1
- package/dist/lib/dependencies/index.mjs +22 -33
- package/dist/lib/dependencies/index.mjs.map +1 -1
- package/dist/lib/file/ReadFileSyncOptions.mjs +1 -3
- package/dist/lib/file/ReadFileSyncOptions.mjs.map +1 -1
- package/dist/lib/file/constants.mjs.map +1 -1
- package/dist/lib/file/fileLines.mjs +12 -13
- package/dist/lib/file/fileLines.mjs.map +1 -1
- package/dist/lib/file/index.mjs +14 -15
- package/dist/lib/file/index.mjs.map +1 -1
- package/dist/lib/file/tryReadFileSync.mjs +3 -8
- package/dist/lib/file/tryReadFileSync.mjs.map +1 -1
- package/dist/lib/generateIgnoreFiles.mjs +27 -43
- package/dist/lib/generateIgnoreFiles.mjs.map +1 -1
- package/dist/lib/index.mjs +99 -157
- package/dist/lib/index.mjs.map +1 -1
- package/dist/lib/jsonFormatters.mjs +2 -5
- package/dist/lib/jsonFormatters.mjs.map +1 -1
- package/dist/lib/loadConfig.mjs +3 -11
- package/dist/lib/loadConfig.mjs.map +1 -1
- package/dist/lib/parsedPackageJSON.mjs +2 -5
- package/dist/lib/parsedPackageJSON.mjs.map +1 -1
- package/dist/lib/processEx.mjs +6 -9
- package/dist/lib/processEx.mjs.map +1 -1
- package/dist/lib/runSteps.mjs +13 -19
- package/dist/lib/runSteps.mjs.map +1 -1
- package/dist/lib/runStepsAsync.mjs +22 -22
- package/dist/lib/runStepsAsync.mjs.map +1 -1
- package/dist/lib/runXy.mjs +19 -31
- package/dist/lib/runXy.mjs.map +1 -1
- package/dist/lib/runXyWithWarning.mjs +2 -5
- package/dist/lib/runXyWithWarning.mjs.map +1 -1
- package/dist/lib/safeExit.mjs +10 -13
- package/dist/lib/safeExit.mjs.map +1 -1
- package/dist/lib/string/empty.mjs +2 -5
- package/dist/lib/string/empty.mjs.map +1 -1
- package/dist/lib/string/index.mjs +3 -9
- package/dist/lib/string/index.mjs.map +1 -1
- package/dist/lib/string/union.mjs +1 -7
- package/dist/lib/string/union.mjs.map +1 -1
- package/dist/lib/withErrnoException.mjs +4 -7
- package/dist/lib/withErrnoException.mjs.map +1 -1
- package/dist/lib/withError.mjs +2 -5
- package/dist/lib/withError.mjs.map +1 -1
- package/dist/lib/yarn/index.mjs +11 -30
- package/dist/lib/yarn/index.mjs.map +1 -1
- package/dist/lib/yarn/isYarnVersionOrGreater.mjs +4 -15
- package/dist/lib/yarn/isYarnVersionOrGreater.mjs.map +1 -1
- package/dist/lib/yarn/workspace/index.mjs +5 -16
- package/dist/lib/yarn/workspace/index.mjs.map +1 -1
- package/dist/lib/yarn/workspace/yarnWorkspace.mjs +5 -16
- package/dist/lib/yarn/workspace/yarnWorkspace.mjs.map +1 -1
- package/dist/lib/yarn/workspace/yarnWorkspaces.mjs +3 -14
- package/dist/lib/yarn/workspace/yarnWorkspaces.mjs.map +1 -1
- package/dist/lib/yarn/yarnInitCwd.mjs +2 -5
- package/dist/lib/yarn/yarnInitCwd.mjs.map +1 -1
- package/dist/loadPackageConfig.mjs +3 -8
- package/dist/loadPackageConfig.mjs.map +1 -1
- package/dist/xy/index.mjs +932 -1267
- package/dist/xy/index.mjs.map +1 -1
- package/dist/xy/param.mjs +3 -9
- package/dist/xy/param.mjs.map +1 -1
- package/dist/xy/xy.mjs +932 -1267
- package/dist/xy/xy.mjs.map +1 -1
- package/dist/xy/xyBuildCommands.mjs +228 -320
- package/dist/xy/xyBuildCommands.mjs.map +1 -1
- package/dist/xy/xyCommonCommands.mjs +251 -336
- package/dist/xy/xyCommonCommands.mjs.map +1 -1
- package/dist/xy/xyDeployCommands.mjs +99 -161
- package/dist/xy/xyDeployCommands.mjs.map +1 -1
- package/dist/xy/xyInstallCommands.mjs +145 -193
- package/dist/xy/xyInstallCommands.mjs.map +1 -1
- package/dist/xy/xyLintCommands.mjs +302 -403
- package/dist/xy/xyLintCommands.mjs.map +1 -1
- package/dist/xy/xyParseOptions.mjs +2 -5
- package/dist/xy/xyParseOptions.mjs.map +1 -1
- package/package.json +8 -9
package/dist/xy/index.mjs
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
-
|
|
4
1
|
// src/xy/xy.ts
|
|
5
2
|
import chalk25 from "chalk";
|
|
6
3
|
|
|
@@ -9,7 +6,7 @@ import chalk7 from "chalk";
|
|
|
9
6
|
|
|
10
7
|
// src/lib/checkResult.ts
|
|
11
8
|
import chalk from "chalk";
|
|
12
|
-
var checkResult =
|
|
9
|
+
var checkResult = (name, result, level = "error", exitOnFail = false) => {
|
|
13
10
|
if (result) {
|
|
14
11
|
const exiting = exitOnFail ? "[Exiting Process]" : "[Continuing]";
|
|
15
12
|
const chalkFunc = level === "error" ? chalk.red : chalk.yellow;
|
|
@@ -18,20 +15,17 @@ var checkResult = /* @__PURE__ */ __name((name, result, level = "error", exitOnF
|
|
|
18
15
|
process.exit(result);
|
|
19
16
|
}
|
|
20
17
|
}
|
|
21
|
-
}
|
|
18
|
+
};
|
|
22
19
|
|
|
23
20
|
// src/lib/deleteGlob.ts
|
|
24
21
|
import fs from "fs";
|
|
25
22
|
import { glob } from "glob";
|
|
26
|
-
var deleteGlob =
|
|
23
|
+
var deleteGlob = (globPath) => {
|
|
27
24
|
const files = glob.sync(globPath);
|
|
28
25
|
for (const file of files) {
|
|
29
|
-
fs.rmSync(file, {
|
|
30
|
-
recursive: true,
|
|
31
|
-
force: true
|
|
32
|
-
});
|
|
26
|
+
fs.rmSync(file, { recursive: true, force: true });
|
|
33
27
|
}
|
|
34
|
-
}
|
|
28
|
+
};
|
|
35
29
|
|
|
36
30
|
// src/lib/dependencies/detectDuplicateDependencies.ts
|
|
37
31
|
import { execSync } from "child_process";
|
|
@@ -40,17 +34,17 @@ import { execSync } from "child_process";
|
|
|
40
34
|
import chalk2 from "chalk";
|
|
41
35
|
|
|
42
36
|
// src/lib/withError.ts
|
|
43
|
-
var withError =
|
|
37
|
+
var withError = (ex, closure, predicate = (ex2) => !!ex2.name && !!ex2.message) => {
|
|
44
38
|
return predicate(ex) ? closure(ex) : void 0;
|
|
45
|
-
}
|
|
39
|
+
};
|
|
46
40
|
|
|
47
41
|
// src/lib/withErrnoException.ts
|
|
48
|
-
var withErrnoException =
|
|
42
|
+
var withErrnoException = (ex, closure) => {
|
|
49
43
|
return withError(ex, closure, (ex2) => ex2.errno !== void 0);
|
|
50
|
-
}
|
|
44
|
+
};
|
|
51
45
|
|
|
52
46
|
// src/lib/processEx.ts
|
|
53
|
-
var processEx =
|
|
47
|
+
var processEx = (ex) => {
|
|
54
48
|
const error = typeof ex === "string" ? new Error(ex) : ex;
|
|
55
49
|
const exitCode = withErrnoException(error, (error2) => {
|
|
56
50
|
if (error2.code === "ENOENT") {
|
|
@@ -67,10 +61,10 @@ var processEx = /* @__PURE__ */ __name((ex) => {
|
|
|
67
61
|
return -1;
|
|
68
62
|
})();
|
|
69
63
|
process.exit(process.exitCode ?? exitCode);
|
|
70
|
-
}
|
|
64
|
+
};
|
|
71
65
|
|
|
72
66
|
// src/lib/safeExit.ts
|
|
73
|
-
var safeExit =
|
|
67
|
+
var safeExit = (func, exitOnFail = true) => {
|
|
74
68
|
try {
|
|
75
69
|
const result = func();
|
|
76
70
|
if (result && exitOnFail) {
|
|
@@ -80,8 +74,8 @@ var safeExit = /* @__PURE__ */ __name((func, exitOnFail = true) => {
|
|
|
80
74
|
} catch (ex) {
|
|
81
75
|
return processEx(ex);
|
|
82
76
|
}
|
|
83
|
-
}
|
|
84
|
-
var safeExitAsync =
|
|
77
|
+
};
|
|
78
|
+
var safeExitAsync = async (func, exitOnFail = true) => {
|
|
85
79
|
try {
|
|
86
80
|
const result = await func();
|
|
87
81
|
if (result && exitOnFail) {
|
|
@@ -91,22 +85,22 @@ var safeExitAsync = /* @__PURE__ */ __name(async (func, exitOnFail = true) => {
|
|
|
91
85
|
} catch (ex) {
|
|
92
86
|
return processEx(ex);
|
|
93
87
|
}
|
|
94
|
-
}
|
|
88
|
+
};
|
|
95
89
|
|
|
96
90
|
// src/lib/dependencies/DuplicateDetector.ts
|
|
97
91
|
import { EOL } from "os";
|
|
98
92
|
import chalk3 from "chalk";
|
|
99
93
|
|
|
100
94
|
// src/lib/jsonFormatters.ts
|
|
101
|
-
var multiLineToJSONArray =
|
|
95
|
+
var multiLineToJSONArray = (output) => {
|
|
102
96
|
const withCommas = output.replaceAll("\r\n", "").replaceAll("\n", ",");
|
|
103
97
|
const cleanCollection = withCommas.slice(0, Math.max(0, withCommas.length - 1));
|
|
104
98
|
const collection = `[${cleanCollection}]`;
|
|
105
99
|
return JSON.parse(collection);
|
|
106
|
-
}
|
|
100
|
+
};
|
|
107
101
|
|
|
108
102
|
// src/lib/dependencies/DuplicateDetector.ts
|
|
109
|
-
var trimVirtualMeta =
|
|
103
|
+
var trimVirtualMeta = (value) => {
|
|
110
104
|
const virtualParts = value.split("virtual:");
|
|
111
105
|
if (virtualParts.length > 1) {
|
|
112
106
|
const hashParts = virtualParts[1].split("#");
|
|
@@ -114,8 +108,8 @@ var trimVirtualMeta = /* @__PURE__ */ __name((value) => {
|
|
|
114
108
|
} else {
|
|
115
109
|
return value;
|
|
116
110
|
}
|
|
117
|
-
}
|
|
118
|
-
var trimObjectDependencyVirtualMeta =
|
|
111
|
+
};
|
|
112
|
+
var trimObjectDependencyVirtualMeta = (obj) => {
|
|
119
113
|
const resultObj = {};
|
|
120
114
|
for (const [key, value] of Object.entries(obj)) {
|
|
121
115
|
resultObj[trimVirtualMeta(key)] = {
|
|
@@ -124,19 +118,13 @@ var trimObjectDependencyVirtualMeta = /* @__PURE__ */ __name((obj) => {
|
|
|
124
118
|
};
|
|
125
119
|
}
|
|
126
120
|
return resultObj;
|
|
127
|
-
}
|
|
128
|
-
var trimDependencyVirtualMeta =
|
|
121
|
+
};
|
|
122
|
+
var trimDependencyVirtualMeta = (dependencies) => {
|
|
129
123
|
return dependencies.map((dependency) => {
|
|
130
|
-
return {
|
|
131
|
-
children: trimObjectDependencyVirtualMeta(dependency.children),
|
|
132
|
-
value: trimVirtualMeta(dependency.value)
|
|
133
|
-
};
|
|
124
|
+
return { children: trimObjectDependencyVirtualMeta(dependency.children), value: trimVirtualMeta(dependency.value) };
|
|
134
125
|
});
|
|
135
|
-
}
|
|
126
|
+
};
|
|
136
127
|
var DuplicateDetector = class {
|
|
137
|
-
static {
|
|
138
|
-
__name(this, "DuplicateDetector");
|
|
139
|
-
}
|
|
140
128
|
dependency;
|
|
141
129
|
dependencyEntries;
|
|
142
130
|
constructor(output, dependency) {
|
|
@@ -166,21 +154,19 @@ var DuplicateDetector = class {
|
|
|
166
154
|
acc.duplicateVersions.push(acc.currentVersion);
|
|
167
155
|
}
|
|
168
156
|
acc.duplicateVersions.push(version);
|
|
169
|
-
acc.duplicateVersions = [
|
|
170
|
-
...new Set(acc.duplicateVersions)
|
|
171
|
-
];
|
|
157
|
+
acc.duplicateVersions = [...new Set(acc.duplicateVersions)];
|
|
172
158
|
}
|
|
173
159
|
return acc;
|
|
174
160
|
}
|
|
175
|
-
resultsFactory =
|
|
161
|
+
resultsFactory = (dependency) => ({
|
|
176
162
|
currentVersion: void 0,
|
|
177
163
|
dependency,
|
|
178
164
|
duplicateVersions: []
|
|
179
|
-
})
|
|
165
|
+
});
|
|
180
166
|
};
|
|
181
167
|
|
|
182
168
|
// src/lib/dependencies/detectDuplicateDependencies.ts
|
|
183
|
-
var detectDuplicateDependencies =
|
|
169
|
+
var detectDuplicateDependencies = (depsFromPackageJSON, DefaultDependencies2) => {
|
|
184
170
|
let exitCode = 0;
|
|
185
171
|
const dependencies = depsFromPackageJSON?.length ? depsFromPackageJSON : DefaultDependencies2;
|
|
186
172
|
return safeExit(() => {
|
|
@@ -211,51 +197,45 @@ var detectDuplicateDependencies = /* @__PURE__ */ __name((depsFromPackageJSON, D
|
|
|
211
197
|
return exitCode;
|
|
212
198
|
}
|
|
213
199
|
});
|
|
214
|
-
}
|
|
200
|
+
};
|
|
215
201
|
|
|
216
202
|
// src/lib/file/constants.ts
|
|
217
203
|
var WINDOWS_NEWLINE_REGEX = /\r\n/g;
|
|
218
204
|
var CROSS_PLATFORM_NEWLINE = "\n";
|
|
219
205
|
|
|
220
206
|
// src/lib/file/fileLines.ts
|
|
221
|
-
import {
|
|
207
|
+
import {
|
|
208
|
+
existsSync,
|
|
209
|
+
readFileSync,
|
|
210
|
+
writeFileSync
|
|
211
|
+
} from "fs";
|
|
222
212
|
|
|
223
213
|
// src/lib/string/empty.ts
|
|
224
|
-
var empty =
|
|
225
|
-
var notEmpty =
|
|
214
|
+
var empty = (value) => value?.trim().length === 0;
|
|
215
|
+
var notEmpty = (value) => !empty(value);
|
|
226
216
|
|
|
227
217
|
// src/lib/string/union.ts
|
|
228
|
-
var union =
|
|
229
|
-
...new Set(a),
|
|
230
|
-
...new Set(b)
|
|
231
|
-
]), "union");
|
|
218
|
+
var union = (a, b) => /* @__PURE__ */ new Set([...new Set(a), ...new Set(b)]);
|
|
232
219
|
|
|
233
220
|
// src/lib/file/ReadFileSyncOptions.ts
|
|
234
|
-
var defaultReadFileSyncOptions = {
|
|
235
|
-
encoding: "utf8"
|
|
236
|
-
};
|
|
221
|
+
var defaultReadFileSyncOptions = { encoding: "utf8" };
|
|
237
222
|
|
|
238
223
|
// src/lib/file/fileLines.ts
|
|
239
|
-
var readLines =
|
|
240
|
-
var readNonEmptyLines =
|
|
241
|
-
var writeLines =
|
|
224
|
+
var readLines = (uri, options = defaultReadFileSyncOptions) => existsSync(uri) ? readFileSync(uri, options).replace(WINDOWS_NEWLINE_REGEX, CROSS_PLATFORM_NEWLINE).split(CROSS_PLATFORM_NEWLINE) : [];
|
|
225
|
+
var readNonEmptyLines = (uri, options = defaultReadFileSyncOptions) => readLines(uri, options).filter(notEmpty);
|
|
226
|
+
var writeLines = (uri, lines, options = defaultReadFileSyncOptions) => {
|
|
242
227
|
const existing = existsSync(uri) ? readFileSync(uri, options) : void 0;
|
|
243
228
|
const desired = lines.join(CROSS_PLATFORM_NEWLINE);
|
|
244
229
|
if (existing !== desired) writeFileSync(uri, desired, options);
|
|
245
|
-
}
|
|
230
|
+
};
|
|
246
231
|
|
|
247
232
|
// src/lib/generateIgnoreFiles.ts
|
|
248
233
|
import chalk4 from "chalk";
|
|
249
234
|
|
|
250
235
|
// src/lib/yarn/isYarnVersionOrGreater.ts
|
|
251
236
|
import { spawnSync } from "child_process";
|
|
252
|
-
var isYarnVersionOrGreater =
|
|
253
|
-
const result = spawnSync("yarn", [
|
|
254
|
-
"-v"
|
|
255
|
-
], {
|
|
256
|
-
encoding: "utf8",
|
|
257
|
-
shell: true
|
|
258
|
-
});
|
|
237
|
+
var isYarnVersionOrGreater = (major, minor, patch) => {
|
|
238
|
+
const result = spawnSync("yarn", ["-v"], { encoding: "utf8", shell: true });
|
|
259
239
|
const version = result.stdout.toString().replaceAll("\n", "");
|
|
260
240
|
const versionNumbers = version.split(".").map((ver) => Number.parseInt(ver));
|
|
261
241
|
const majorDelta = versionNumbers[0] - major;
|
|
@@ -264,58 +244,43 @@ var isYarnVersionOrGreater = /* @__PURE__ */ __name((major, minor, patch) => {
|
|
|
264
244
|
const majorOk = majorDelta >= 0;
|
|
265
245
|
const minorOk = majorDelta > 0 || minorDelta >= 0;
|
|
266
246
|
const patchOk = majorDelta > 0 || minorDelta > 0 || patchDelta >= 0;
|
|
267
|
-
return [
|
|
268
|
-
|
|
269
|
-
version
|
|
270
|
-
];
|
|
271
|
-
}, "isYarnVersionOrGreater");
|
|
247
|
+
return [majorOk && minorOk && patchOk, version];
|
|
248
|
+
};
|
|
272
249
|
|
|
273
250
|
// src/lib/yarn/workspace/yarnWorkspaces.ts
|
|
274
251
|
import { spawnSync as spawnSync2 } from "child_process";
|
|
275
|
-
var yarnWorkspaces =
|
|
276
|
-
const result = spawnSync2("yarn", [
|
|
277
|
-
"workspaces",
|
|
278
|
-
"list",
|
|
279
|
-
"--json",
|
|
280
|
-
"--recursive"
|
|
281
|
-
], {
|
|
282
|
-
encoding: "utf8",
|
|
283
|
-
shell: true
|
|
284
|
-
});
|
|
252
|
+
var yarnWorkspaces = () => {
|
|
253
|
+
const result = spawnSync2("yarn", ["workspaces", "list", "--json", "--recursive"], { encoding: "utf8", shell: true });
|
|
285
254
|
if (result.error) {
|
|
286
255
|
throw result.error;
|
|
287
256
|
}
|
|
288
257
|
return result.stdout.toString().split("\n").slice(0, -1).map((item) => {
|
|
289
258
|
return JSON.parse(item);
|
|
290
259
|
});
|
|
291
|
-
}
|
|
260
|
+
};
|
|
292
261
|
|
|
293
262
|
// src/lib/yarn/workspace/yarnWorkspace.ts
|
|
294
|
-
var yarnWorkspace =
|
|
263
|
+
var yarnWorkspace = (pkg) => {
|
|
295
264
|
const workspace = yarnWorkspaces().find(({ name }) => name === pkg);
|
|
296
265
|
if (!workspace) throw new Error(`Workspace ${pkg} not found`);
|
|
297
266
|
return workspace;
|
|
298
|
-
}
|
|
267
|
+
};
|
|
299
268
|
|
|
300
269
|
// src/lib/yarn/yarnInitCwd.ts
|
|
301
|
-
var INIT_CWD =
|
|
270
|
+
var INIT_CWD = () => {
|
|
302
271
|
if (!process.env.INIT_CWD) console.error("Missing INIT_CWD");
|
|
303
272
|
return process.env.INIT_CWD;
|
|
304
|
-
}
|
|
273
|
+
};
|
|
305
274
|
|
|
306
275
|
// src/lib/generateIgnoreFiles.ts
|
|
307
|
-
var localeCompare =
|
|
308
|
-
var mergeEntries =
|
|
309
|
-
|
|
310
|
-
].sort(localeCompare), "mergeEntries");
|
|
311
|
-
var generateIgnoreFiles = /* @__PURE__ */ __name((filename3, pkg) => {
|
|
276
|
+
var localeCompare = (a, b) => a.localeCompare(b);
|
|
277
|
+
var mergeEntries = (a, b) => [...union(a, b)].sort(localeCompare);
|
|
278
|
+
var generateIgnoreFiles = (filename3, pkg) => {
|
|
312
279
|
console.log(chalk4.green(`Generate ${filename3} Files`));
|
|
313
280
|
const cwd = INIT_CWD() ?? ".";
|
|
314
|
-
const workspaces = pkg ? [
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
const readEntries = /* @__PURE__ */ __name((location) => readNonEmptyLines(`${location}/${filename3}`), "readEntries");
|
|
318
|
-
const writeEntries = /* @__PURE__ */ __name((location, entries) => writeLines(`${location}/${filename3}`, entries), "writeEntries");
|
|
281
|
+
const workspaces = pkg ? [yarnWorkspace(pkg)] : yarnWorkspaces();
|
|
282
|
+
const readEntries = (location) => readNonEmptyLines(`${location}/${filename3}`);
|
|
283
|
+
const writeEntries = (location, entries) => writeLines(`${location}/${filename3}`, entries);
|
|
319
284
|
const results = workspaces.map(({ location, name }) => {
|
|
320
285
|
try {
|
|
321
286
|
writeEntries(location, mergeEntries(readEntries(cwd), readEntries(location)));
|
|
@@ -328,21 +293,21 @@ var generateIgnoreFiles = /* @__PURE__ */ __name((filename3, pkg) => {
|
|
|
328
293
|
});
|
|
329
294
|
const succeeded = results.every((result) => result === 0);
|
|
330
295
|
return succeeded ? 0 : 1;
|
|
331
|
-
}
|
|
296
|
+
};
|
|
332
297
|
|
|
333
298
|
// src/lib/parsedPackageJSON.ts
|
|
334
299
|
import { readFileSync as readFileSync2 } from "fs";
|
|
335
|
-
var parsedPackageJSON =
|
|
300
|
+
var parsedPackageJSON = (path5) => {
|
|
336
301
|
const pathToPackageJSON = path5 ?? process.env.npm_package_json ?? "";
|
|
337
302
|
const packageJSON = readFileSync2(pathToPackageJSON).toString();
|
|
338
303
|
return JSON.parse(packageJSON);
|
|
339
|
-
}
|
|
304
|
+
};
|
|
340
305
|
|
|
341
306
|
// src/lib/runSteps.ts
|
|
342
307
|
import { spawnSync as spawnSync3 } from "child_process";
|
|
343
308
|
import { existsSync as existsSync2 } from "fs";
|
|
344
309
|
import chalk5 from "chalk";
|
|
345
|
-
var runSteps =
|
|
310
|
+
var runSteps = (name, steps, exitOnFail = true, messages) => {
|
|
346
311
|
return safeExit(() => {
|
|
347
312
|
const pkgName = process.env.npm_package_name;
|
|
348
313
|
console.log(chalk5.green(`${name} [${pkgName}]`));
|
|
@@ -358,10 +323,7 @@ var runSteps = /* @__PURE__ */ __name((name, steps, exitOnFail = true, messages)
|
|
|
358
323
|
const status = spawnSync3(command, Array.isArray(args) ? args : args.split(" "), {
|
|
359
324
|
...config,
|
|
360
325
|
encoding: "utf8",
|
|
361
|
-
env: {
|
|
362
|
-
FORCE_COLOR: "3",
|
|
363
|
-
...process.env
|
|
364
|
-
},
|
|
326
|
+
env: { FORCE_COLOR: "3", ...process.env },
|
|
365
327
|
shell: true,
|
|
366
328
|
stdio: "inherit"
|
|
367
329
|
}).status ?? 0;
|
|
@@ -370,13 +332,13 @@ var runSteps = /* @__PURE__ */ __name((name, steps, exitOnFail = true, messages)
|
|
|
370
332
|
}
|
|
371
333
|
return totalStatus;
|
|
372
334
|
}, !!exitOnFail);
|
|
373
|
-
}
|
|
335
|
+
};
|
|
374
336
|
|
|
375
337
|
// src/lib/runStepsAsync.ts
|
|
376
338
|
import { spawn } from "child_process";
|
|
377
339
|
import { existsSync as existsSync3 } from "fs";
|
|
378
340
|
import chalk6 from "chalk";
|
|
379
|
-
var runStepAsync =
|
|
341
|
+
var runStepAsync = (name, step, exitOnFail = true, message) => {
|
|
380
342
|
return new Promise((resolve) => {
|
|
381
343
|
const [command, args, config] = step;
|
|
382
344
|
if (message) {
|
|
@@ -388,15 +350,18 @@ var runStepAsync = /* @__PURE__ */ __name((name, step, exitOnFail = true, messag
|
|
|
388
350
|
}
|
|
389
351
|
spawn(command, Array.isArray(args) ? args : args.split(" "), {
|
|
390
352
|
...config,
|
|
391
|
-
env: {
|
|
392
|
-
FORCE_COLOR: "3",
|
|
393
|
-
...process.env
|
|
394
|
-
},
|
|
353
|
+
env: { FORCE_COLOR: "3", ...process.env },
|
|
395
354
|
shell: true,
|
|
396
355
|
stdio: "inherit"
|
|
397
356
|
}).on("close", (code) => {
|
|
398
357
|
if (code) {
|
|
399
|
-
console.error(
|
|
358
|
+
console.error(
|
|
359
|
+
chalk6.red(
|
|
360
|
+
`Command Exited With Non-Zero Result [${chalk6.gray(code)}] | ${chalk6.yellow(command)} ${chalk6.white(
|
|
361
|
+
Array.isArray(args) ? args.join(" ") : args
|
|
362
|
+
)}`
|
|
363
|
+
)
|
|
364
|
+
);
|
|
400
365
|
checkResult(name, code, "error", exitOnFail);
|
|
401
366
|
resolve(code);
|
|
402
367
|
} else {
|
|
@@ -404,8 +369,8 @@ var runStepAsync = /* @__PURE__ */ __name((name, step, exitOnFail = true, messag
|
|
|
404
369
|
}
|
|
405
370
|
});
|
|
406
371
|
});
|
|
407
|
-
}
|
|
408
|
-
var runStepsAsync =
|
|
372
|
+
};
|
|
373
|
+
var runStepsAsync = async (name, steps, exitOnFail = true, messages) => {
|
|
409
374
|
return await safeExitAsync(async () => {
|
|
410
375
|
const pkgName = process.env.npm_package_name;
|
|
411
376
|
console.log(chalk6.green(`${name} [${pkgName}]`));
|
|
@@ -415,139 +380,67 @@ var runStepsAsync = /* @__PURE__ */ __name(async (name, steps, exitOnFail = true
|
|
|
415
380
|
}
|
|
416
381
|
return result;
|
|
417
382
|
});
|
|
418
|
-
}
|
|
383
|
+
};
|
|
419
384
|
|
|
420
385
|
// src/actions/build.ts
|
|
421
|
-
var build =
|
|
386
|
+
var build = async ({
|
|
387
|
+
incremental,
|
|
388
|
+
jobs,
|
|
389
|
+
target,
|
|
390
|
+
verbose,
|
|
391
|
+
pkg
|
|
392
|
+
}) => {
|
|
422
393
|
const start = Date.now();
|
|
423
|
-
const pkgOptions = pkg === void 0 ? [] : [
|
|
424
|
-
|
|
425
|
-
];
|
|
426
|
-
const
|
|
427
|
-
|
|
428
|
-
] : [];
|
|
429
|
-
const verboseOptions = verbose ? [
|
|
430
|
-
"-v"
|
|
431
|
-
] : [];
|
|
432
|
-
const targetOptions = target === void 0 ? [] : [
|
|
433
|
-
"-t",
|
|
434
|
-
target
|
|
435
|
-
];
|
|
436
|
-
const jobsOptions = jobs === void 0 ? [] : [
|
|
437
|
-
"-j",
|
|
438
|
-
`${jobs}`
|
|
439
|
-
];
|
|
394
|
+
const pkgOptions = pkg === void 0 ? [] : [pkg];
|
|
395
|
+
const incrementalOptions = incremental ? ["-i"] : [];
|
|
396
|
+
const verboseOptions = verbose ? ["-v"] : [];
|
|
397
|
+
const targetOptions = target === void 0 ? [] : ["-t", target];
|
|
398
|
+
const jobsOptions = jobs === void 0 ? [] : ["-j", `${jobs}`];
|
|
440
399
|
if (jobs !== void 0) {
|
|
441
400
|
console.log(chalk7.blue(`Jobs set to [${jobs}]`));
|
|
442
401
|
}
|
|
443
402
|
const result = await runStepsAsync(`Build${incremental ? "-Incremental" : ""} [${pkg ?? "All"}]`, [
|
|
444
|
-
[
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
"compile",
|
|
449
|
-
...pkgOptions,
|
|
450
|
-
...targetOptions,
|
|
451
|
-
...verboseOptions,
|
|
452
|
-
...jobsOptions,
|
|
453
|
-
...incrementalOptions,
|
|
454
|
-
"--types",
|
|
455
|
-
"tsup"
|
|
456
|
-
]
|
|
457
|
-
],
|
|
458
|
-
[
|
|
459
|
-
"yarn",
|
|
460
|
-
[
|
|
461
|
-
"xy",
|
|
462
|
-
"publint",
|
|
463
|
-
...pkgOptions,
|
|
464
|
-
...verboseOptions,
|
|
465
|
-
...jobsOptions,
|
|
466
|
-
...incrementalOptions
|
|
467
|
-
]
|
|
468
|
-
],
|
|
469
|
-
[
|
|
470
|
-
"yarn",
|
|
471
|
-
[
|
|
472
|
-
"xy",
|
|
473
|
-
"deplint",
|
|
474
|
-
...pkgOptions,
|
|
475
|
-
...verboseOptions,
|
|
476
|
-
...jobsOptions,
|
|
477
|
-
...incrementalOptions
|
|
478
|
-
]
|
|
479
|
-
],
|
|
480
|
-
[
|
|
481
|
-
"yarn",
|
|
482
|
-
[
|
|
483
|
-
"xy",
|
|
484
|
-
"lint",
|
|
485
|
-
...pkgOptions,
|
|
486
|
-
...verboseOptions,
|
|
487
|
-
...incrementalOptions
|
|
488
|
-
]
|
|
489
|
-
]
|
|
403
|
+
["yarn", ["xy", "compile", ...pkgOptions, ...targetOptions, ...verboseOptions, ...jobsOptions, ...incrementalOptions, "--types", "tsup"]],
|
|
404
|
+
["yarn", ["xy", "publint", ...pkgOptions, ...verboseOptions, ...jobsOptions, ...incrementalOptions]],
|
|
405
|
+
["yarn", ["xy", "deplint", ...pkgOptions, ...verboseOptions, ...jobsOptions, ...incrementalOptions]],
|
|
406
|
+
["yarn", ["xy", "lint", ...pkgOptions, ...verboseOptions, ...incrementalOptions]]
|
|
490
407
|
]);
|
|
491
408
|
console.log(`${chalk7.gray("Built in")} [${chalk7.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk7.gray("seconds")}`);
|
|
492
409
|
return result;
|
|
493
|
-
}
|
|
410
|
+
};
|
|
494
411
|
|
|
495
412
|
// src/actions/clean.ts
|
|
496
|
-
var clean =
|
|
497
|
-
return pkg ? await cleanPackage({
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
}
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
[
|
|
507
|
-
"yarn",
|
|
508
|
-
[
|
|
509
|
-
"workspace",
|
|
510
|
-
pkg,
|
|
511
|
-
"run",
|
|
512
|
-
"package-clean"
|
|
513
|
-
]
|
|
514
|
-
]
|
|
515
|
-
]);
|
|
516
|
-
}, "cleanPackage");
|
|
517
|
-
var cleanAll = /* @__PURE__ */ __name(({ verbose }) => {
|
|
518
|
-
const verboseOptions = verbose ? [
|
|
519
|
-
"--verbose"
|
|
520
|
-
] : [
|
|
521
|
-
"--no-verbose"
|
|
522
|
-
];
|
|
523
|
-
return runStepsAsync("Clean", [
|
|
524
|
-
[
|
|
525
|
-
"yarn",
|
|
526
|
-
[
|
|
527
|
-
"workspaces foreach",
|
|
528
|
-
"-pA",
|
|
529
|
-
"--jobs 64",
|
|
530
|
-
...verboseOptions,
|
|
531
|
-
"run",
|
|
532
|
-
"package-clean"
|
|
533
|
-
]
|
|
534
|
-
]
|
|
535
|
-
]);
|
|
536
|
-
}, "cleanAll");
|
|
413
|
+
var clean = async ({ verbose, pkg }) => {
|
|
414
|
+
return pkg ? await cleanPackage({ pkg, verbose }) : cleanAll({ verbose });
|
|
415
|
+
};
|
|
416
|
+
var cleanPackage = ({ pkg }) => {
|
|
417
|
+
return runStepsAsync(`Clean [${pkg}]`, [["yarn", ["workspace", pkg, "run", "package-clean"]]]);
|
|
418
|
+
};
|
|
419
|
+
var cleanAll = ({ verbose }) => {
|
|
420
|
+
const verboseOptions = verbose ? ["--verbose"] : ["--no-verbose"];
|
|
421
|
+
return runStepsAsync("Clean", [["yarn", ["workspaces foreach", "-pA", "--jobs 64", ...verboseOptions, "run", "package-clean"]]]);
|
|
422
|
+
};
|
|
537
423
|
|
|
538
424
|
// src/actions/clean-docs.ts
|
|
539
425
|
import path from "path";
|
|
540
426
|
import chalk8 from "chalk";
|
|
541
|
-
var cleanDocs =
|
|
427
|
+
var cleanDocs = () => {
|
|
542
428
|
const pkgName = process.env.npm_package_name;
|
|
543
429
|
console.log(chalk8.green(`Cleaning Docs [${pkgName}]`));
|
|
544
430
|
for (const { location } of yarnWorkspaces()) deleteGlob(path.join(location, "docs"));
|
|
545
431
|
return 0;
|
|
546
|
-
}
|
|
432
|
+
};
|
|
547
433
|
|
|
548
434
|
// src/actions/compile.ts
|
|
549
435
|
import chalk9 from "chalk";
|
|
550
|
-
var compile =
|
|
436
|
+
var compile = ({
|
|
437
|
+
verbose,
|
|
438
|
+
target,
|
|
439
|
+
pkg,
|
|
440
|
+
incremental,
|
|
441
|
+
publint: publint2,
|
|
442
|
+
jobs
|
|
443
|
+
}) => {
|
|
551
444
|
return pkg ? compilePackage({
|
|
552
445
|
pkg,
|
|
553
446
|
publint: publint2,
|
|
@@ -560,91 +453,58 @@ var compile = /* @__PURE__ */ __name(({ verbose, target, pkg, incremental, publi
|
|
|
560
453
|
verbose,
|
|
561
454
|
jobs
|
|
562
455
|
});
|
|
563
|
-
}
|
|
564
|
-
var compilePackage =
|
|
565
|
-
const targetOptions = target ? [
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
...targetOptions
|
|
578
|
-
]
|
|
579
|
-
]
|
|
580
|
-
]);
|
|
581
|
-
}, "compilePackage");
|
|
582
|
-
var compileAll = /* @__PURE__ */ __name(({ jobs, verbose, target, incremental }) => {
|
|
456
|
+
};
|
|
457
|
+
var compilePackage = ({ target, pkg }) => {
|
|
458
|
+
const targetOptions = target ? ["-t", target] : [];
|
|
459
|
+
return runSteps(
|
|
460
|
+
`Compile [${pkg}]`,
|
|
461
|
+
[["yarn", ["workspace", pkg, "run", "package-compile", ...targetOptions]]]
|
|
462
|
+
);
|
|
463
|
+
};
|
|
464
|
+
var compileAll = ({
|
|
465
|
+
jobs,
|
|
466
|
+
verbose,
|
|
467
|
+
target,
|
|
468
|
+
incremental
|
|
469
|
+
}) => {
|
|
583
470
|
const start = Date.now();
|
|
584
|
-
const verboseOptions = verbose ? [
|
|
585
|
-
|
|
586
|
-
] : [
|
|
587
|
-
|
|
588
|
-
];
|
|
589
|
-
const targetOptions = target ? [
|
|
590
|
-
"-t",
|
|
591
|
-
target
|
|
592
|
-
] : [];
|
|
593
|
-
const incrementalOptions = incremental ? [
|
|
594
|
-
"--since",
|
|
595
|
-
"-Apt",
|
|
596
|
-
"--topological-dev"
|
|
597
|
-
] : [
|
|
598
|
-
"--parallel",
|
|
599
|
-
"-Apt",
|
|
600
|
-
"--topological-dev"
|
|
601
|
-
];
|
|
602
|
-
const jobsOptions = jobs ? [
|
|
603
|
-
"-j",
|
|
604
|
-
`${jobs}`
|
|
605
|
-
] : [];
|
|
471
|
+
const verboseOptions = verbose ? ["--verbose"] : ["--no-verbose"];
|
|
472
|
+
const targetOptions = target ? ["-t", target] : [];
|
|
473
|
+
const incrementalOptions = incremental ? ["--since", "-Apt", "--topological-dev"] : ["--parallel", "-Apt", "--topological-dev"];
|
|
474
|
+
const jobsOptions = jobs ? ["-j", `${jobs}`] : [];
|
|
606
475
|
if (jobs) {
|
|
607
476
|
console.log(chalk9.blue(`Jobs set to [${jobs}]`));
|
|
608
477
|
}
|
|
609
478
|
const result = runSteps(`Compile${incremental ? "-Incremental" : ""} [All]`, [
|
|
610
|
-
[
|
|
611
|
-
"
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
...targetOptions
|
|
621
|
-
]
|
|
622
|
-
]
|
|
479
|
+
["yarn", [
|
|
480
|
+
"workspaces",
|
|
481
|
+
"foreach",
|
|
482
|
+
...incrementalOptions,
|
|
483
|
+
...jobsOptions,
|
|
484
|
+
...verboseOptions,
|
|
485
|
+
"run",
|
|
486
|
+
"package-compile",
|
|
487
|
+
...targetOptions
|
|
488
|
+
]]
|
|
623
489
|
]);
|
|
624
490
|
console.log(`${chalk9.gray("Compiled in")} [${chalk9.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk9.gray("seconds")}`);
|
|
625
491
|
return result;
|
|
626
|
-
}
|
|
492
|
+
};
|
|
627
493
|
|
|
628
494
|
// src/actions/copy-assets.ts
|
|
629
495
|
import path2 from "path/posix";
|
|
630
496
|
import chalk10 from "chalk";
|
|
631
497
|
import cpy from "cpy";
|
|
632
|
-
var copyPackageTargetAssets =
|
|
498
|
+
var copyPackageTargetAssets = async (target, name, location) => {
|
|
633
499
|
try {
|
|
634
|
-
const values = await cpy(
|
|
635
|
-
"**/*.jpg",
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
"**/*.gif",
|
|
643
|
-
"**/*.css"
|
|
644
|
-
], `../dist/${target}`, {
|
|
645
|
-
cwd: path2.join(process.cwd(), location, "src"),
|
|
646
|
-
flat: false
|
|
647
|
-
});
|
|
500
|
+
const values = await cpy(
|
|
501
|
+
["**/*.jpg", "**/*.png", "**/*.gif", "**/*.svg", "**/*.webp", "**/*.sass", "**/*.scss", "**/*.gif", "**/*.css"],
|
|
502
|
+
`../dist/${target}`,
|
|
503
|
+
{
|
|
504
|
+
cwd: path2.join(process.cwd(), location, "src"),
|
|
505
|
+
flat: false
|
|
506
|
+
}
|
|
507
|
+
);
|
|
648
508
|
for (const value of values) {
|
|
649
509
|
console.log(`${value.split("/").pop()} => ./dist/${target}`);
|
|
650
510
|
}
|
|
@@ -653,8 +513,8 @@ var copyPackageTargetAssets = /* @__PURE__ */ __name(async (target, name, locati
|
|
|
653
513
|
console.log(`Copy Failed: ${name}: ${reason}`);
|
|
654
514
|
return 1;
|
|
655
515
|
}
|
|
656
|
-
}
|
|
657
|
-
var copyTargetAssets =
|
|
516
|
+
};
|
|
517
|
+
var copyTargetAssets = async (target, pkg) => {
|
|
658
518
|
const workspaces = yarnWorkspaces();
|
|
659
519
|
console.log(chalk10.green(`Copying Assets [${target.toUpperCase()}]`));
|
|
660
520
|
const workspaceList = workspaces.filter(({ name }) => {
|
|
@@ -663,15 +523,17 @@ var copyTargetAssets = /* @__PURE__ */ __name(async (target, pkg) => {
|
|
|
663
523
|
if (workspaceList.length === 0) {
|
|
664
524
|
console.error(`Package not found [${pkg}]`);
|
|
665
525
|
} else {
|
|
666
|
-
const results = await Promise.all(
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
526
|
+
const results = await Promise.all(
|
|
527
|
+
workspaceList.map(async (workspace) => {
|
|
528
|
+
const { location, name } = workspace;
|
|
529
|
+
return await copyPackageTargetAssets(target, name, location);
|
|
530
|
+
})
|
|
531
|
+
);
|
|
670
532
|
return results.reduce((prev, result) => prev || result, 0);
|
|
671
533
|
}
|
|
672
534
|
return 0;
|
|
673
|
-
}
|
|
674
|
-
var copyAssets =
|
|
535
|
+
};
|
|
536
|
+
var copyAssets = async ({ target, pkg }) => {
|
|
675
537
|
switch (target) {
|
|
676
538
|
case "esm": {
|
|
677
539
|
return await copyTargetAssets("esm", pkg);
|
|
@@ -683,38 +545,21 @@ var copyAssets = /* @__PURE__ */ __name(async ({ target, pkg }) => {
|
|
|
683
545
|
return await copyTargetAssets("esm", pkg) || await copyTargetAssets("cjs", pkg);
|
|
684
546
|
}
|
|
685
547
|
}
|
|
686
|
-
}
|
|
548
|
+
};
|
|
687
549
|
|
|
688
550
|
// src/actions/cycle.ts
|
|
689
551
|
import { cruise } from "dependency-cruiser";
|
|
690
|
-
var cycle =
|
|
691
|
-
return pkg ? cyclePackage({
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
] : [
|
|
702
|
-
"--no-verbose"
|
|
703
|
-
];
|
|
704
|
-
return runSteps(`Cycle [${pkg}]`, [
|
|
705
|
-
[
|
|
706
|
-
"yarn",
|
|
707
|
-
[
|
|
708
|
-
"workspace",
|
|
709
|
-
pkg,
|
|
710
|
-
"run",
|
|
711
|
-
"package-cycle",
|
|
712
|
-
...verboseOptions
|
|
713
|
-
]
|
|
714
|
-
]
|
|
715
|
-
]);
|
|
716
|
-
}, "cyclePackage");
|
|
717
|
-
var cycleAll = /* @__PURE__ */ __name(async ({ verbose = false }) => {
|
|
552
|
+
var cycle = async ({ verbose, pkg } = {}) => {
|
|
553
|
+
return pkg ? cyclePackage({ pkg, verbose }) : await cycleAll({ verbose });
|
|
554
|
+
};
|
|
555
|
+
var cyclePackage = ({ pkg, verbose }) => {
|
|
556
|
+
const verboseOptions = verbose ? ["--verbose"] : ["--no-verbose"];
|
|
557
|
+
return runSteps(
|
|
558
|
+
`Cycle [${pkg}]`,
|
|
559
|
+
[["yarn", ["workspace", pkg, "run", "package-cycle", ...verboseOptions]]]
|
|
560
|
+
);
|
|
561
|
+
};
|
|
562
|
+
var cycleAll = async ({ verbose = false }) => {
|
|
718
563
|
const pkgName = process.env.npm_package_name;
|
|
719
564
|
const cruiseOptions = {
|
|
720
565
|
ruleSet: {
|
|
@@ -724,26 +569,20 @@ var cycleAll = /* @__PURE__ */ __name(async ({ verbose = false }) => {
|
|
|
724
569
|
severity: "error",
|
|
725
570
|
comment: "This dependency creates a circular reference",
|
|
726
571
|
from: {},
|
|
727
|
-
to: {
|
|
728
|
-
circular: true
|
|
729
|
-
}
|
|
572
|
+
to: { circular: true }
|
|
730
573
|
}
|
|
731
574
|
]
|
|
732
575
|
},
|
|
733
576
|
exclude: "node_modules|packages/.*/packages",
|
|
734
577
|
validate: true,
|
|
735
|
-
doNotFollow: {
|
|
736
|
-
path: "node_modules|packages/.*/packages"
|
|
737
|
-
},
|
|
578
|
+
doNotFollow: { path: "node_modules|packages/.*/packages" },
|
|
738
579
|
tsPreCompilationDeps: false,
|
|
739
580
|
combinedDependencies: true,
|
|
740
581
|
outputType: verbose ? "text" : "err"
|
|
741
582
|
};
|
|
742
583
|
const target = "**/src";
|
|
743
584
|
console.log(`Checking for circular dependencies in ${target}...`);
|
|
744
|
-
const result = await cruise([
|
|
745
|
-
target
|
|
746
|
-
], cruiseOptions);
|
|
585
|
+
const result = await cruise([target], cruiseOptions);
|
|
747
586
|
if (result.output) {
|
|
748
587
|
console.log(result.output);
|
|
749
588
|
}
|
|
@@ -753,21 +592,12 @@ var cycleAll = /* @__PURE__ */ __name(async ({ verbose = false }) => {
|
|
|
753
592
|
console.error(`${pkgName} \u274C Dependency violations found`);
|
|
754
593
|
}
|
|
755
594
|
return result.exitCode;
|
|
756
|
-
}
|
|
595
|
+
};
|
|
757
596
|
|
|
758
597
|
// src/actions/dead.ts
|
|
759
|
-
var dead =
|
|
760
|
-
return runSteps("Dead", [
|
|
761
|
-
|
|
762
|
-
"yarn",
|
|
763
|
-
[
|
|
764
|
-
"ts-prune",
|
|
765
|
-
"-p",
|
|
766
|
-
"tsconfig.json"
|
|
767
|
-
]
|
|
768
|
-
]
|
|
769
|
-
]);
|
|
770
|
-
}, "dead");
|
|
598
|
+
var dead = () => {
|
|
599
|
+
return runSteps("Dead", [["yarn", ["ts-prune", "-p", "tsconfig.json"]]]);
|
|
600
|
+
};
|
|
771
601
|
|
|
772
602
|
// src/actions/deplint/deplint.ts
|
|
773
603
|
import chalk15 from "chalk";
|
|
@@ -775,30 +605,17 @@ import chalk15 from "chalk";
|
|
|
775
605
|
// src/actions/deplint/findFilesByGlob.ts
|
|
776
606
|
import { globSync } from "glob";
|
|
777
607
|
function findFilesByGlob(cwd, pattern) {
|
|
778
|
-
return globSync(pattern, {
|
|
779
|
-
cwd,
|
|
780
|
-
absolute: true
|
|
781
|
-
});
|
|
608
|
+
return globSync(pattern, { cwd, absolute: true });
|
|
782
609
|
}
|
|
783
|
-
__name(findFilesByGlob, "findFilesByGlob");
|
|
784
610
|
|
|
785
611
|
// src/actions/deplint/findFiles.ts
|
|
786
612
|
function findFiles(path5) {
|
|
787
|
-
const allSourceInclude = [
|
|
788
|
-
|
|
789
|
-
];
|
|
790
|
-
const allDistInclude = [
|
|
791
|
-
"./dist/**/*.d.ts",
|
|
792
|
-
"./dist/**/*.{mjs,js,cjs}"
|
|
793
|
-
];
|
|
613
|
+
const allSourceInclude = ["./src/**/*.{ts,tsx}"];
|
|
614
|
+
const allDistInclude = ["./dist/**/*.d.ts", "./dist/**/*.{mjs,js,cjs}"];
|
|
794
615
|
const srcFiles = allSourceInclude.flatMap((pattern) => findFilesByGlob(path5, pattern));
|
|
795
616
|
const distFiles = allDistInclude.flatMap((pattern) => findFilesByGlob(path5, pattern));
|
|
796
|
-
return {
|
|
797
|
-
srcFiles,
|
|
798
|
-
distFiles
|
|
799
|
-
};
|
|
617
|
+
return { srcFiles, distFiles };
|
|
800
618
|
}
|
|
801
|
-
__name(findFiles, "findFiles");
|
|
802
619
|
|
|
803
620
|
// src/actions/deplint/getDependenciesFromPackageJson.ts
|
|
804
621
|
import fs2 from "fs";
|
|
@@ -816,7 +633,6 @@ function getDependenciesFromPackageJson(packageJsonPath) {
|
|
|
816
633
|
peerDependencies
|
|
817
634
|
};
|
|
818
635
|
}
|
|
819
|
-
__name(getDependenciesFromPackageJson, "getDependenciesFromPackageJson");
|
|
820
636
|
|
|
821
637
|
// src/actions/deplint/getImportsFromFile.ts
|
|
822
638
|
import fs3 from "fs";
|
|
@@ -832,13 +648,18 @@ function getBasePackageName(importName) {
|
|
|
832
648
|
}
|
|
833
649
|
return importNameScrubbed.split("/")[0];
|
|
834
650
|
}
|
|
835
|
-
__name(getBasePackageName, "getBasePackageName");
|
|
836
651
|
|
|
837
652
|
// src/actions/deplint/getImportsFromFile.ts
|
|
838
653
|
function getImportsFromFile(filePath, importPaths, typeImportPaths) {
|
|
839
654
|
const sourceCode = fs3.readFileSync(filePath, "utf8");
|
|
840
655
|
const isMjsFile = filePath.endsWith(".mjs");
|
|
841
|
-
const sourceFile = ts.createSourceFile(
|
|
656
|
+
const sourceFile = ts.createSourceFile(
|
|
657
|
+
path4.basename(filePath),
|
|
658
|
+
sourceCode,
|
|
659
|
+
ts.ScriptTarget.Latest,
|
|
660
|
+
true,
|
|
661
|
+
isMjsFile ? ts.ScriptKind.JS : void 0
|
|
662
|
+
);
|
|
842
663
|
const imports = [];
|
|
843
664
|
const typeImports = [];
|
|
844
665
|
const isDeclarationFile = filePath.endsWith(".d.ts");
|
|
@@ -863,13 +684,8 @@ function getImportsFromFile(filePath, importPaths, typeImportPaths) {
|
|
|
863
684
|
}
|
|
864
685
|
ts.forEachChild(node, visit);
|
|
865
686
|
}
|
|
866
|
-
__name(visit, "visit");
|
|
867
687
|
visit(sourceFile);
|
|
868
|
-
const importsStartsWithExcludes = [
|
|
869
|
-
".",
|
|
870
|
-
"#",
|
|
871
|
-
"node:"
|
|
872
|
-
];
|
|
688
|
+
const importsStartsWithExcludes = [".", "#", "node:"];
|
|
873
689
|
const cleanedImports = imports.filter((imp) => !importsStartsWithExcludes.some((exc) => imp.startsWith(exc))).map(getBasePackageName);
|
|
874
690
|
const cleanedTypeImports = typeImports.filter((imp) => !importsStartsWithExcludes.some((exc) => imp.startsWith(exc))).map(getBasePackageName);
|
|
875
691
|
for (const imp of cleanedImports) {
|
|
@@ -880,22 +696,14 @@ function getImportsFromFile(filePath, importPaths, typeImportPaths) {
|
|
|
880
696
|
typeImportPaths[imp] = typeImportPaths[imp] ?? [];
|
|
881
697
|
typeImportPaths[imp].push(filePath);
|
|
882
698
|
}
|
|
883
|
-
return [
|
|
884
|
-
cleanedImports,
|
|
885
|
-
cleanedTypeImports
|
|
886
|
-
];
|
|
699
|
+
return [cleanedImports, cleanedTypeImports];
|
|
887
700
|
}
|
|
888
|
-
__name(getImportsFromFile, "getImportsFromFile");
|
|
889
701
|
|
|
890
702
|
// src/actions/deplint/getExternalImportsFromFiles.ts
|
|
891
|
-
var internalImportPrefixes = [
|
|
892
|
-
|
|
893
|
-
"#",
|
|
894
|
-
"node:"
|
|
895
|
-
];
|
|
896
|
-
var removeInternalImports = /* @__PURE__ */ __name((imports) => {
|
|
703
|
+
var internalImportPrefixes = [".", "#", "node:"];
|
|
704
|
+
var removeInternalImports = (imports) => {
|
|
897
705
|
return imports.filter((imp) => !internalImportPrefixes.some((prefix) => imp.startsWith(prefix)));
|
|
898
|
-
}
|
|
706
|
+
};
|
|
899
707
|
function getExternalImportsFromFiles({ srcFiles, distFiles }) {
|
|
900
708
|
const srcImportPaths = {};
|
|
901
709
|
const distImportPaths = {};
|
|
@@ -921,12 +729,15 @@ function getExternalImportsFromFiles({ srcFiles, distFiles }) {
|
|
|
921
729
|
externalDistTypeImports
|
|
922
730
|
};
|
|
923
731
|
}
|
|
924
|
-
__name(getExternalImportsFromFiles, "getExternalImportsFromFiles");
|
|
925
732
|
|
|
926
733
|
// src/actions/deplint/checkPackage/getUnlistedDependencies.ts
|
|
927
734
|
import { builtinModules } from "module";
|
|
928
735
|
import chalk11 from "chalk";
|
|
929
|
-
function getUnlistedDependencies({ name, location }, { dependencies, peerDependencies }, {
|
|
736
|
+
function getUnlistedDependencies({ name, location }, { dependencies, peerDependencies }, {
|
|
737
|
+
externalDistImports,
|
|
738
|
+
externalDistTypeImports,
|
|
739
|
+
distImportPaths
|
|
740
|
+
}) {
|
|
930
741
|
let unlistedDependencies = 0;
|
|
931
742
|
for (const imp of externalDistImports) {
|
|
932
743
|
if (!dependencies.includes(imp) && imp !== name && !dependencies.includes(`@types/${imp}`) && !peerDependencies.includes(imp) && !peerDependencies.includes(`@types/${imp}`) && !builtinModules.includes(imp) && !builtinModules.includes(`@types/${imp}`)) {
|
|
@@ -949,12 +760,19 @@ function getUnlistedDependencies({ name, location }, { dependencies, peerDepende
|
|
|
949
760
|
}
|
|
950
761
|
return unlistedDependencies;
|
|
951
762
|
}
|
|
952
|
-
__name(getUnlistedDependencies, "getUnlistedDependencies");
|
|
953
763
|
|
|
954
764
|
// src/actions/deplint/checkPackage/getUnlistedDevDependencies.ts
|
|
955
765
|
import { builtinModules as builtinModules2 } from "module";
|
|
956
766
|
import chalk12 from "chalk";
|
|
957
|
-
function getUnlistedDevDependencies({ name, location }, {
|
|
767
|
+
function getUnlistedDevDependencies({ name, location }, {
|
|
768
|
+
devDependencies,
|
|
769
|
+
dependencies,
|
|
770
|
+
peerDependencies
|
|
771
|
+
}, {
|
|
772
|
+
srcImportPaths,
|
|
773
|
+
externalSrcImports,
|
|
774
|
+
distImports
|
|
775
|
+
}) {
|
|
958
776
|
let unlistedDevDependencies = 0;
|
|
959
777
|
for (const imp of externalSrcImports) {
|
|
960
778
|
if (!distImports.includes(imp) && imp !== name && !dependencies.includes(imp) && !dependencies.includes(`@types/${imp}`) && !peerDependencies.includes(imp) && !peerDependencies.includes(`@types/${imp}`) && !devDependencies.includes(imp) && !devDependencies.includes(`@types/${imp}`) && !builtinModules2.includes(imp)) {
|
|
@@ -970,11 +788,14 @@ function getUnlistedDevDependencies({ name, location }, { devDependencies, depen
|
|
|
970
788
|
}
|
|
971
789
|
return unlistedDevDependencies;
|
|
972
790
|
}
|
|
973
|
-
__name(getUnlistedDevDependencies, "getUnlistedDevDependencies");
|
|
974
791
|
|
|
975
792
|
// src/actions/deplint/checkPackage/getUnusedDependencies.ts
|
|
976
793
|
import chalk13 from "chalk";
|
|
977
|
-
function getUnusedDependencies({ name, location }, { dependencies }, {
|
|
794
|
+
function getUnusedDependencies({ name, location }, { dependencies }, {
|
|
795
|
+
externalDistImports,
|
|
796
|
+
externalDistTypeImports,
|
|
797
|
+
externalSrcImports
|
|
798
|
+
}) {
|
|
978
799
|
let unusedDependencies = 0;
|
|
979
800
|
for (const dep of dependencies) {
|
|
980
801
|
if (!externalDistImports.includes(dep) && !externalDistImports.includes(dep.replace(/^@types\//, "")) && !externalDistTypeImports.includes(dep) && !externalDistTypeImports.includes(dep.replace(/^@types\//, ""))) {
|
|
@@ -993,7 +814,6 @@ function getUnusedDependencies({ name, location }, { dependencies }, { externalD
|
|
|
993
814
|
}
|
|
994
815
|
return unusedDependencies;
|
|
995
816
|
}
|
|
996
|
-
__name(getUnusedDependencies, "getUnusedDependencies");
|
|
997
817
|
|
|
998
818
|
// src/actions/deplint/checkPackage/getUnusedPeerDependencies.ts
|
|
999
819
|
import chalk14 from "chalk";
|
|
@@ -1016,10 +836,16 @@ function getUnusedPeerDependencies({ name, location }, { peerDependencies, depen
|
|
|
1016
836
|
}
|
|
1017
837
|
return unusedDependencies;
|
|
1018
838
|
}
|
|
1019
|
-
__name(getUnusedPeerDependencies, "getUnusedPeerDependencies");
|
|
1020
839
|
|
|
1021
840
|
// src/actions/deplint/checkPackage/checkPackage.ts
|
|
1022
|
-
function checkPackage({
|
|
841
|
+
function checkPackage({
|
|
842
|
+
name,
|
|
843
|
+
location,
|
|
844
|
+
deps = false,
|
|
845
|
+
devDeps = false,
|
|
846
|
+
peerDeps = false,
|
|
847
|
+
verbose = false
|
|
848
|
+
}) {
|
|
1023
849
|
const { srcFiles, distFiles } = findFiles(location);
|
|
1024
850
|
if (verbose) {
|
|
1025
851
|
console.info(`Checking package: ${name} at ${location}`);
|
|
@@ -1034,34 +860,24 @@ function checkPackage({ name, location, deps = false, devDeps = false, peerDeps
|
|
|
1034
860
|
const checkDeps = deps || !(deps || devDeps || peerDeps);
|
|
1035
861
|
const checkDevDeps = devDeps || !(deps || devDeps || peerDeps);
|
|
1036
862
|
const checkPeerDeps = peerDeps;
|
|
1037
|
-
const sourceParams = getExternalImportsFromFiles({
|
|
1038
|
-
srcFiles,
|
|
1039
|
-
distFiles
|
|
1040
|
-
});
|
|
863
|
+
const sourceParams = getExternalImportsFromFiles({ srcFiles, distFiles });
|
|
1041
864
|
const packageParams = getDependenciesFromPackageJson(`${location}/package.json`);
|
|
1042
|
-
const unlistedDependencies = checkDeps ? getUnlistedDependencies({
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
}, packageParams, sourceParams) : 0;
|
|
1046
|
-
const unusedDependencies = checkDeps ? getUnusedDependencies({
|
|
1047
|
-
name,
|
|
1048
|
-
location
|
|
1049
|
-
}, packageParams, sourceParams) : 0;
|
|
1050
|
-
const unlistedDevDependencies = checkDevDeps ? getUnlistedDevDependencies({
|
|
1051
|
-
name,
|
|
1052
|
-
location
|
|
1053
|
-
}, packageParams, sourceParams) : 0;
|
|
1054
|
-
const unusedPeerDependencies = checkPeerDeps ? getUnusedPeerDependencies({
|
|
1055
|
-
name,
|
|
1056
|
-
location
|
|
1057
|
-
}, packageParams, sourceParams) : 0;
|
|
865
|
+
const unlistedDependencies = checkDeps ? getUnlistedDependencies({ name, location }, packageParams, sourceParams) : 0;
|
|
866
|
+
const unusedDependencies = checkDeps ? getUnusedDependencies({ name, location }, packageParams, sourceParams) : 0;
|
|
867
|
+
const unlistedDevDependencies = checkDevDeps ? getUnlistedDevDependencies({ name, location }, packageParams, sourceParams) : 0;
|
|
868
|
+
const unusedPeerDependencies = checkPeerDeps ? getUnusedPeerDependencies({ name, location }, packageParams, sourceParams) : 0;
|
|
1058
869
|
const totalErrors = unlistedDependencies + unlistedDevDependencies + unusedDependencies + unusedPeerDependencies;
|
|
1059
870
|
return totalErrors;
|
|
1060
871
|
}
|
|
1061
|
-
__name(checkPackage, "checkPackage");
|
|
1062
872
|
|
|
1063
873
|
// src/actions/deplint/deplint.ts
|
|
1064
|
-
var deplint =
|
|
874
|
+
var deplint = ({
|
|
875
|
+
pkg,
|
|
876
|
+
deps,
|
|
877
|
+
devDeps,
|
|
878
|
+
peerDeps,
|
|
879
|
+
verbose
|
|
880
|
+
}) => {
|
|
1065
881
|
let totalErrors = 0;
|
|
1066
882
|
if (pkg === void 0) {
|
|
1067
883
|
const workspaces = yarnWorkspaces();
|
|
@@ -1093,297 +909,183 @@ var deplint = /* @__PURE__ */ __name(({ pkg, deps, devDeps, peerDeps, verbose })
|
|
|
1093
909
|
console.info(`Deplint: Found no dependency problems. ${chalk15.green("\u2714")}`);
|
|
1094
910
|
}
|
|
1095
911
|
return 0;
|
|
1096
|
-
}
|
|
912
|
+
};
|
|
1097
913
|
|
|
1098
914
|
// src/actions/deploy.ts
|
|
1099
915
|
import { readFileSync as readFileSync3 } from "fs";
|
|
1100
|
-
var privatePackageExcludeList =
|
|
916
|
+
var privatePackageExcludeList = () => {
|
|
1101
917
|
const possibleDeployablePackages = yarnWorkspaces().map((workspace) => [
|
|
1102
918
|
workspace,
|
|
1103
|
-
JSON.parse(readFileSync3(`${workspace.location}/package.json`, {
|
|
1104
|
-
encoding: "utf8"
|
|
1105
|
-
}))
|
|
919
|
+
JSON.parse(readFileSync3(`${workspace.location}/package.json`, { encoding: "utf8" }))
|
|
1106
920
|
]);
|
|
1107
921
|
const privatePackages = possibleDeployablePackages.filter(([_, pkg]) => pkg.private).map(([workspace]) => workspace);
|
|
1108
922
|
const excludeList = privatePackages.map((workspace) => `--exclude ${workspace.name}`);
|
|
1109
923
|
return excludeList;
|
|
1110
|
-
}
|
|
1111
|
-
var deploy =
|
|
924
|
+
};
|
|
925
|
+
var deploy = () => {
|
|
1112
926
|
const excludeList = privatePackageExcludeList();
|
|
1113
927
|
if (excludeList.length > 0) {
|
|
1114
928
|
console.log("Excluding private packages from deployment:", excludeList);
|
|
1115
929
|
}
|
|
1116
930
|
return runSteps("Deploy [Patch]", [
|
|
1117
|
-
[
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
],
|
|
1121
|
-
[
|
|
1122
|
-
"yarn",
|
|
1123
|
-
"xy clean"
|
|
1124
|
-
],
|
|
1125
|
-
[
|
|
1126
|
-
"yarn",
|
|
1127
|
-
"xy build"
|
|
1128
|
-
],
|
|
1129
|
-
[
|
|
1130
|
-
"yarn",
|
|
1131
|
-
"version apply --all"
|
|
1132
|
-
],
|
|
1133
|
-
[
|
|
1134
|
-
"yarn",
|
|
1135
|
-
`workspaces foreach --all ${excludeList.join(" ")} --parallel npm publish`
|
|
1136
|
-
]
|
|
931
|
+
["yarn", "workspaces foreach --all version patch --deferred"],
|
|
932
|
+
["yarn", "xy clean"],
|
|
933
|
+
["yarn", "xy build"],
|
|
934
|
+
["yarn", "version apply --all"],
|
|
935
|
+
["yarn", `workspaces foreach --all ${excludeList.join(" ")} --parallel npm publish`]
|
|
1137
936
|
]);
|
|
1138
|
-
}
|
|
937
|
+
};
|
|
1139
938
|
|
|
1140
939
|
// src/actions/deploy-major.ts
|
|
1141
940
|
import { readFileSync as readFileSync4 } from "fs";
|
|
1142
|
-
var privatePackageExcludeList2 =
|
|
941
|
+
var privatePackageExcludeList2 = () => {
|
|
1143
942
|
const possibleDeployablePackages = yarnWorkspaces().map((workspace) => [
|
|
1144
943
|
workspace,
|
|
1145
|
-
JSON.parse(readFileSync4(`${workspace.location}/package.json`, {
|
|
1146
|
-
encoding: "utf8"
|
|
1147
|
-
}))
|
|
944
|
+
JSON.parse(readFileSync4(`${workspace.location}/package.json`, { encoding: "utf8" }))
|
|
1148
945
|
]);
|
|
1149
946
|
const privatePackages = possibleDeployablePackages.filter(([_, pkg]) => pkg.private).map(([workspace]) => workspace);
|
|
1150
947
|
const excludeList = privatePackages.map((workspace) => `--exclude ${workspace.name}`);
|
|
1151
948
|
return excludeList;
|
|
1152
|
-
}
|
|
1153
|
-
var deployMajor =
|
|
949
|
+
};
|
|
950
|
+
var deployMajor = () => {
|
|
1154
951
|
const excludeList = privatePackageExcludeList2();
|
|
1155
952
|
if (excludeList.length > 0) {
|
|
1156
953
|
console.log("Excluding private packages from deployment:", excludeList);
|
|
1157
954
|
}
|
|
1158
955
|
return runSteps("Deploy [Major]", [
|
|
1159
|
-
[
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
],
|
|
1163
|
-
[
|
|
1164
|
-
"yarn",
|
|
1165
|
-
"xy clean"
|
|
1166
|
-
],
|
|
1167
|
-
[
|
|
1168
|
-
"yarn",
|
|
1169
|
-
"xy build"
|
|
1170
|
-
],
|
|
1171
|
-
[
|
|
1172
|
-
"yarn",
|
|
1173
|
-
"version apply --all"
|
|
1174
|
-
],
|
|
1175
|
-
[
|
|
1176
|
-
"yarn",
|
|
1177
|
-
`workspaces foreach --all ${excludeList.join(" ")} --parallel npm publish`
|
|
1178
|
-
]
|
|
956
|
+
["yarn", "workspaces foreach --all version major --deferred"],
|
|
957
|
+
["yarn", "xy clean"],
|
|
958
|
+
["yarn", "xy build"],
|
|
959
|
+
["yarn", "version apply --all"],
|
|
960
|
+
["yarn", `workspaces foreach --all ${excludeList.join(" ")} --parallel npm publish`]
|
|
1179
961
|
]);
|
|
1180
|
-
}
|
|
962
|
+
};
|
|
1181
963
|
|
|
1182
964
|
// src/actions/deploy-minor.ts
|
|
1183
965
|
import { readFileSync as readFileSync5 } from "fs";
|
|
1184
|
-
var privatePackageExcludeList3 =
|
|
966
|
+
var privatePackageExcludeList3 = () => {
|
|
1185
967
|
const possibleDeployablePackages = yarnWorkspaces().map((workspace) => [
|
|
1186
968
|
workspace,
|
|
1187
|
-
JSON.parse(readFileSync5(`${workspace.location}/package.json`, {
|
|
1188
|
-
encoding: "utf8"
|
|
1189
|
-
}))
|
|
969
|
+
JSON.parse(readFileSync5(`${workspace.location}/package.json`, { encoding: "utf8" }))
|
|
1190
970
|
]);
|
|
1191
971
|
const privatePackages = possibleDeployablePackages.filter(([_, pkg]) => pkg.private).map(([workspace]) => workspace);
|
|
1192
972
|
const excludeList = privatePackages.map((workspace) => `--exclude ${workspace.name}`);
|
|
1193
973
|
return excludeList;
|
|
1194
|
-
}
|
|
1195
|
-
var deployMinor =
|
|
974
|
+
};
|
|
975
|
+
var deployMinor = () => {
|
|
1196
976
|
const excludeList = privatePackageExcludeList3();
|
|
1197
977
|
if (excludeList.length > 0) {
|
|
1198
978
|
console.log("Excluding private packages from deployment:", excludeList);
|
|
1199
979
|
}
|
|
1200
980
|
return runSteps("Deploy [Minor]", [
|
|
1201
|
-
[
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
],
|
|
1205
|
-
[
|
|
1206
|
-
"yarn",
|
|
1207
|
-
"xy clean"
|
|
1208
|
-
],
|
|
1209
|
-
[
|
|
1210
|
-
"yarn",
|
|
1211
|
-
"xy build"
|
|
1212
|
-
],
|
|
1213
|
-
[
|
|
1214
|
-
"yarn",
|
|
1215
|
-
"version apply --all"
|
|
1216
|
-
],
|
|
1217
|
-
[
|
|
1218
|
-
"yarn",
|
|
1219
|
-
`workspaces foreach --all ${excludeList.join(" ")} --parallel npm publish`
|
|
1220
|
-
]
|
|
981
|
+
["yarn", "workspaces foreach --all version minor --deferred"],
|
|
982
|
+
["yarn", "xy clean"],
|
|
983
|
+
["yarn", "xy build"],
|
|
984
|
+
["yarn", "version apply --all"],
|
|
985
|
+
["yarn", `workspaces foreach --all ${excludeList.join(" ")} --parallel npm publish`]
|
|
1221
986
|
]);
|
|
1222
|
-
}
|
|
987
|
+
};
|
|
1223
988
|
|
|
1224
989
|
// src/actions/deploy-next.ts
|
|
1225
990
|
import { readFileSync as readFileSync6 } from "fs";
|
|
1226
|
-
var privatePackageExcludeList4 =
|
|
991
|
+
var privatePackageExcludeList4 = () => {
|
|
1227
992
|
const possibleDeployablePackages = yarnWorkspaces().map((workspace) => [
|
|
1228
993
|
workspace,
|
|
1229
|
-
JSON.parse(readFileSync6(`${workspace.location}/package.json`, {
|
|
1230
|
-
encoding: "utf8"
|
|
1231
|
-
}))
|
|
994
|
+
JSON.parse(readFileSync6(`${workspace.location}/package.json`, { encoding: "utf8" }))
|
|
1232
995
|
]);
|
|
1233
996
|
const privatePackages = possibleDeployablePackages.filter(([_, pkg]) => pkg.private).map(([workspace]) => workspace);
|
|
1234
997
|
const excludeList = privatePackages.map((workspace) => `--exclude ${workspace.name}`);
|
|
1235
998
|
return excludeList;
|
|
1236
|
-
}
|
|
1237
|
-
var deployNext =
|
|
999
|
+
};
|
|
1000
|
+
var deployNext = () => {
|
|
1238
1001
|
const excludeList = privatePackageExcludeList4();
|
|
1239
1002
|
if (excludeList.length > 0) {
|
|
1240
1003
|
console.log("Excluding private packages from deployment:", excludeList);
|
|
1241
1004
|
}
|
|
1242
1005
|
return runSteps("Deploy [Next]", [
|
|
1243
|
-
[
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
],
|
|
1247
|
-
[
|
|
1248
|
-
"yarn",
|
|
1249
|
-
"xy clean"
|
|
1250
|
-
],
|
|
1251
|
-
[
|
|
1252
|
-
"yarn",
|
|
1253
|
-
"xy build"
|
|
1254
|
-
],
|
|
1255
|
-
[
|
|
1256
|
-
"yarn",
|
|
1257
|
-
"version apply --all --prerelease"
|
|
1258
|
-
],
|
|
1259
|
-
[
|
|
1260
|
-
"yarn",
|
|
1261
|
-
`workspaces foreach --all ${excludeList.join(" ")} --parallel npm publish --tag next`
|
|
1262
|
-
]
|
|
1006
|
+
["yarn", "workspaces foreach --all version minor --deferred"],
|
|
1007
|
+
["yarn", "xy clean"],
|
|
1008
|
+
["yarn", "xy build"],
|
|
1009
|
+
["yarn", "version apply --all --prerelease"],
|
|
1010
|
+
["yarn", `workspaces foreach --all ${excludeList.join(" ")} --parallel npm publish --tag next`]
|
|
1263
1011
|
]);
|
|
1264
|
-
}
|
|
1012
|
+
};
|
|
1265
1013
|
|
|
1266
1014
|
// src/actions/dupdeps.ts
|
|
1267
1015
|
import chalk16 from "chalk";
|
|
1268
|
-
var dupdeps =
|
|
1016
|
+
var dupdeps = () => {
|
|
1269
1017
|
console.log(chalk16.green("Checking all Dependencies for Duplicates"));
|
|
1270
1018
|
const allDependencies = parsedPackageJSON()?.dependencies;
|
|
1271
1019
|
const dependencies = Object.entries(allDependencies).map(([k]) => k);
|
|
1272
1020
|
return detectDuplicateDependencies(dependencies);
|
|
1273
|
-
}
|
|
1021
|
+
};
|
|
1274
1022
|
|
|
1275
1023
|
// src/actions/lint.ts
|
|
1276
1024
|
import chalk17 from "chalk";
|
|
1277
|
-
var lintPackage =
|
|
1025
|
+
var lintPackage = ({ pkg, fix: fix2 }) => {
|
|
1278
1026
|
console.log(chalk17.gray(`${fix2 ? "Fix" : "Lint"} [${pkg}]`));
|
|
1279
1027
|
const start = Date.now();
|
|
1280
1028
|
const result = runSteps(`${fix2 ? "Fix" : "Lint"} [${pkg}]`, [
|
|
1281
|
-
[
|
|
1282
|
-
"
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
fix2 ? "package-fix" : "package-lint"
|
|
1288
|
-
]
|
|
1289
|
-
]
|
|
1029
|
+
["yarn", [
|
|
1030
|
+
"workspace",
|
|
1031
|
+
pkg,
|
|
1032
|
+
"run",
|
|
1033
|
+
fix2 ? "package-fix" : "package-lint"
|
|
1034
|
+
]]
|
|
1290
1035
|
]);
|
|
1291
1036
|
console.log(chalk17.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk17.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk17.gray("seconds")}`));
|
|
1292
1037
|
return result;
|
|
1293
|
-
}
|
|
1294
|
-
var lint =
|
|
1038
|
+
};
|
|
1039
|
+
var lint = ({
|
|
1040
|
+
pkg,
|
|
1041
|
+
verbose,
|
|
1042
|
+
incremental,
|
|
1043
|
+
fix: fix2
|
|
1044
|
+
} = {}) => {
|
|
1295
1045
|
return pkg === void 0 ? lintAllPackages({
|
|
1296
1046
|
verbose,
|
|
1297
1047
|
incremental,
|
|
1298
1048
|
fix: fix2
|
|
1299
|
-
}) : lintPackage({
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
});
|
|
1303
|
-
}, "lint");
|
|
1304
|
-
var lintAllPackages = /* @__PURE__ */ __name(({ fix: fix2 = false } = {}) => {
|
|
1049
|
+
}) : lintPackage({ pkg, fix: fix2 });
|
|
1050
|
+
};
|
|
1051
|
+
var lintAllPackages = ({ fix: fix2 = false } = {}) => {
|
|
1305
1052
|
console.log(chalk17.gray(`${fix2 ? "Fix" : "Lint"} [All-Packages]`));
|
|
1306
1053
|
const start = Date.now();
|
|
1307
|
-
const fixOptions = fix2 ? [
|
|
1308
|
-
"--fix"
|
|
1309
|
-
] : [];
|
|
1054
|
+
const fixOptions = fix2 ? ["--fix"] : [];
|
|
1310
1055
|
const result = runSteps(`${fix2 ? "Fix" : "Lint"} [All-Packages]`, [
|
|
1311
|
-
[
|
|
1312
|
-
"yarn",
|
|
1313
|
-
[
|
|
1314
|
-
"eslint",
|
|
1315
|
-
...fixOptions
|
|
1316
|
-
]
|
|
1317
|
-
]
|
|
1056
|
+
["yarn", ["eslint", ...fixOptions]]
|
|
1318
1057
|
]);
|
|
1319
1058
|
console.log(chalk17.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk17.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk17.gray("seconds")}`));
|
|
1320
1059
|
return result;
|
|
1321
|
-
}
|
|
1060
|
+
};
|
|
1322
1061
|
|
|
1323
1062
|
// src/actions/fix.ts
|
|
1324
|
-
var fix =
|
|
1325
|
-
return lint({
|
|
1326
|
-
|
|
1327
|
-
fix: true
|
|
1328
|
-
});
|
|
1329
|
-
}, "fix");
|
|
1063
|
+
var fix = (params) => {
|
|
1064
|
+
return lint({ ...params, fix: true });
|
|
1065
|
+
};
|
|
1330
1066
|
|
|
1331
1067
|
// src/actions/gen-docs.ts
|
|
1332
|
-
var genDocs =
|
|
1333
|
-
return pkg ? genDocsPackage({
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
});
|
|
1338
|
-
}
|
|
1339
|
-
var
|
|
1340
|
-
const
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
"workspace",
|
|
1345
|
-
pkg,
|
|
1346
|
-
"run",
|
|
1347
|
-
"package-gen-docs"
|
|
1348
|
-
]
|
|
1349
|
-
]
|
|
1350
|
-
];
|
|
1351
|
-
return runSteps(`GenDocs [${pkg}]`, [
|
|
1352
|
-
...steps
|
|
1353
|
-
]);
|
|
1354
|
-
}, "genDocsPackage");
|
|
1355
|
-
var genDocsAll = /* @__PURE__ */ __name(({ incremental }) => {
|
|
1356
|
-
const incrementalOptions = incremental ? [
|
|
1357
|
-
"--since",
|
|
1358
|
-
"-pA"
|
|
1359
|
-
] : [
|
|
1360
|
-
"-pA"
|
|
1361
|
-
];
|
|
1362
|
-
const steps = [
|
|
1363
|
-
[
|
|
1364
|
-
"yarn",
|
|
1365
|
-
[
|
|
1366
|
-
"workspaces",
|
|
1367
|
-
"foreach",
|
|
1368
|
-
...incrementalOptions,
|
|
1369
|
-
"run",
|
|
1370
|
-
"package-gen-docs"
|
|
1371
|
-
]
|
|
1372
|
-
]
|
|
1373
|
-
];
|
|
1374
|
-
return runSteps(`GenDocs [All${incremental ? "-Incremental" : ""}]`, [
|
|
1375
|
-
...steps
|
|
1376
|
-
]);
|
|
1377
|
-
}, "genDocsAll");
|
|
1068
|
+
var genDocs = ({ pkg, incremental }) => {
|
|
1069
|
+
return pkg ? genDocsPackage({ pkg }) : genDocsAll({ incremental });
|
|
1070
|
+
};
|
|
1071
|
+
var genDocsPackage = ({ pkg }) => {
|
|
1072
|
+
const steps = [["yarn", ["workspace", pkg, "run", "package-gen-docs"]]];
|
|
1073
|
+
return runSteps(`GenDocs [${pkg}]`, [...steps]);
|
|
1074
|
+
};
|
|
1075
|
+
var genDocsAll = ({ incremental }) => {
|
|
1076
|
+
const incrementalOptions = incremental ? ["--since", "-pA"] : ["-pA"];
|
|
1077
|
+
const steps = [["yarn", ["workspaces", "foreach", ...incrementalOptions, "run", "package-gen-docs"]]];
|
|
1078
|
+
return runSteps(`GenDocs [All${incremental ? "-Incremental" : ""}]`, [...steps]);
|
|
1079
|
+
};
|
|
1378
1080
|
|
|
1379
1081
|
// src/actions/gitignore-gen.ts
|
|
1380
1082
|
var filename = ".gitignore";
|
|
1381
|
-
var gitignoreGen =
|
|
1083
|
+
var gitignoreGen = (pkg) => generateIgnoreFiles(filename, pkg);
|
|
1382
1084
|
|
|
1383
1085
|
// src/actions/gitlint.ts
|
|
1384
1086
|
import chalk18 from "chalk";
|
|
1385
1087
|
import ParseGitConfig from "parse-git-config";
|
|
1386
|
-
var gitlint =
|
|
1088
|
+
var gitlint = () => {
|
|
1387
1089
|
console.log(`
|
|
1388
1090
|
Gitlint Start [${process.cwd()}]
|
|
1389
1091
|
`);
|
|
@@ -1391,10 +1093,10 @@ Gitlint Start [${process.cwd()}]
|
|
|
1391
1093
|
let warnings = 0;
|
|
1392
1094
|
const errors = 0;
|
|
1393
1095
|
const gitConfig = ParseGitConfig.sync();
|
|
1394
|
-
const warn =
|
|
1096
|
+
const warn = (message) => {
|
|
1395
1097
|
console.warn(chalk18.yellow(`Warning: ${message}`));
|
|
1396
1098
|
warnings++;
|
|
1397
|
-
}
|
|
1099
|
+
};
|
|
1398
1100
|
if (gitConfig.core.ignorecase) {
|
|
1399
1101
|
warn("Please set core.ignorecase to FALSE in .git/config file [run yarn gitlint-fix]");
|
|
1400
1102
|
} else {
|
|
@@ -1423,56 +1125,41 @@ Gitlint Start [${process.cwd()}]
|
|
|
1423
1125
|
console.warn(`Gitlint Finish [ ${resultMessages.join(" | ")} ]
|
|
1424
1126
|
`);
|
|
1425
1127
|
return warnings + errors === 0 ? 1 : 0;
|
|
1426
|
-
}
|
|
1128
|
+
};
|
|
1427
1129
|
|
|
1428
1130
|
// src/actions/gitlint-fix.ts
|
|
1429
1131
|
import { execSync as execSync2 } from "child_process";
|
|
1430
1132
|
import chalk19 from "chalk";
|
|
1431
1133
|
import ParseGitConfig2 from "parse-git-config";
|
|
1432
|
-
var gitlintFix =
|
|
1134
|
+
var gitlintFix = () => {
|
|
1433
1135
|
console.log(`
|
|
1434
1136
|
Gitlint Fix Start [${process.cwd()}]
|
|
1435
1137
|
`);
|
|
1436
1138
|
const gitConfig = ParseGitConfig2.sync();
|
|
1437
1139
|
if (gitConfig.core.ignorecase) {
|
|
1438
|
-
execSync2("git config core.ignorecase false", {
|
|
1439
|
-
stdio: "inherit"
|
|
1440
|
-
});
|
|
1140
|
+
execSync2("git config core.ignorecase false", { stdio: "inherit" });
|
|
1441
1141
|
console.warn(chalk19.yellow("\nGitlint Fix: Updated core.ignorecase to be false\n"));
|
|
1442
1142
|
}
|
|
1443
1143
|
if (gitConfig.core.autocrlf !== false) {
|
|
1444
|
-
execSync2("git config core.autocrlf false", {
|
|
1445
|
-
stdio: "inherit"
|
|
1446
|
-
});
|
|
1144
|
+
execSync2("git config core.autocrlf false", { stdio: "inherit" });
|
|
1447
1145
|
console.warn(chalk19.yellow("\nGitlint Fix: Updated core.autocrlf to be false\n"));
|
|
1448
1146
|
}
|
|
1449
1147
|
if (gitConfig.core.eol !== "lf") {
|
|
1450
|
-
execSync2("git config core.eol lf", {
|
|
1451
|
-
stdio: "inherit"
|
|
1452
|
-
});
|
|
1148
|
+
execSync2("git config core.eol lf", { stdio: "inherit" });
|
|
1453
1149
|
console.warn(chalk19.yellow('\nGitlint Fix: Updated core.eol to be "lf"\n'));
|
|
1454
1150
|
}
|
|
1455
1151
|
return 1;
|
|
1456
|
-
}
|
|
1152
|
+
};
|
|
1457
1153
|
|
|
1458
1154
|
// src/actions/knip.ts
|
|
1459
|
-
var knip =
|
|
1460
|
-
return runSteps("Knip", [
|
|
1461
|
-
|
|
1462
|
-
"yarn",
|
|
1463
|
-
[
|
|
1464
|
-
"knip",
|
|
1465
|
-
"--dependencies",
|
|
1466
|
-
"--no-exit-code"
|
|
1467
|
-
]
|
|
1468
|
-
]
|
|
1469
|
-
]);
|
|
1470
|
-
}, "knip");
|
|
1155
|
+
var knip = () => {
|
|
1156
|
+
return runSteps("Knip", [["yarn", ["knip", "--dependencies", "--no-exit-code"]]]);
|
|
1157
|
+
};
|
|
1471
1158
|
|
|
1472
1159
|
// src/actions/license.ts
|
|
1473
1160
|
import chalk20 from "chalk";
|
|
1474
1161
|
import { init } from "license-checker";
|
|
1475
|
-
var license =
|
|
1162
|
+
var license = async (pkg) => {
|
|
1476
1163
|
const workspaces = yarnWorkspaces();
|
|
1477
1164
|
const workspaceList = workspaces.filter(({ name }) => {
|
|
1478
1165
|
return pkg === void 0 || name === pkg;
|
|
@@ -1496,113 +1183,78 @@ var license = /* @__PURE__ */ __name(async (pkg) => {
|
|
|
1496
1183
|
"Python-2.0"
|
|
1497
1184
|
]);
|
|
1498
1185
|
console.log(chalk20.green("License Checker"));
|
|
1499
|
-
return (await Promise.all(
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
production: true,
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
if (
|
|
1524
|
-
|
|
1186
|
+
return (await Promise.all(
|
|
1187
|
+
workspaceList.map(({ location, name }) => {
|
|
1188
|
+
return new Promise((resolve) => {
|
|
1189
|
+
init({ production: true, start: location }, (error, packages) => {
|
|
1190
|
+
if (error) {
|
|
1191
|
+
console.error(chalk20.red(`License Checker [${name}] Error`));
|
|
1192
|
+
console.error(chalk20.gray(error));
|
|
1193
|
+
console.log("\n");
|
|
1194
|
+
resolve(1);
|
|
1195
|
+
} else {
|
|
1196
|
+
console.log(chalk20.green(`License Checker [${name}]`));
|
|
1197
|
+
let count = 0;
|
|
1198
|
+
for (const [name2, info] of Object.entries(packages)) {
|
|
1199
|
+
const licenses = Array.isArray(info.licenses) ? info.licenses : [info.licenses];
|
|
1200
|
+
for (let license2 of licenses) {
|
|
1201
|
+
if (license2) {
|
|
1202
|
+
const processedLicense = license2[0] === "(" && license2.at(-1) === ")" ? license2.slice(1, -2) : license2;
|
|
1203
|
+
const orLicenses = processedLicense.split(" OR ");
|
|
1204
|
+
let orLicenseFound = false;
|
|
1205
|
+
for (const orLicense of orLicenses) {
|
|
1206
|
+
if (exclude.has(orLicense)) {
|
|
1207
|
+
orLicenseFound = true;
|
|
1208
|
+
}
|
|
1209
|
+
}
|
|
1210
|
+
if (!orLicenseFound) {
|
|
1211
|
+
count++;
|
|
1212
|
+
console.warn(chalk20.yellow(`${name2}: Package License not allowed [${license2}]`));
|
|
1525
1213
|
}
|
|
1526
|
-
}
|
|
1527
|
-
if (!orLicenseFound) {
|
|
1528
|
-
count++;
|
|
1529
|
-
console.warn(chalk20.yellow(`${name2}: Package License not allowed [${license2}]`));
|
|
1530
1214
|
}
|
|
1531
1215
|
}
|
|
1532
1216
|
}
|
|
1217
|
+
console.log("\n");
|
|
1218
|
+
resolve(count);
|
|
1533
1219
|
}
|
|
1534
|
-
|
|
1535
|
-
resolve(count);
|
|
1536
|
-
}
|
|
1220
|
+
});
|
|
1537
1221
|
});
|
|
1538
|
-
})
|
|
1539
|
-
|
|
1540
|
-
}
|
|
1222
|
+
})
|
|
1223
|
+
)).reduce((prev, value) => prev || value, 0);
|
|
1224
|
+
};
|
|
1541
1225
|
|
|
1542
1226
|
// src/actions/npmignore-gen.ts
|
|
1543
1227
|
var filename2 = ".npmignore";
|
|
1544
|
-
var npmignoreGen =
|
|
1228
|
+
var npmignoreGen = (pkg) => generateIgnoreFiles(filename2, pkg);
|
|
1545
1229
|
|
|
1546
1230
|
// src/actions/publint.ts
|
|
1547
|
-
var publint =
|
|
1548
|
-
return pkg === void 0 ? publintAll({
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
[
|
|
1558
|
-
"yarn",
|
|
1559
|
-
[
|
|
1560
|
-
"workspace",
|
|
1561
|
-
pkg,
|
|
1562
|
-
"run",
|
|
1563
|
-
"package-publint"
|
|
1564
|
-
]
|
|
1565
|
-
]
|
|
1566
|
-
]);
|
|
1567
|
-
}, "publintPackage");
|
|
1568
|
-
var publintAll = /* @__PURE__ */ __name(({ verbose }) => {
|
|
1569
|
-
const verboseOptions = verbose ? [
|
|
1570
|
-
"--verbose"
|
|
1571
|
-
] : [
|
|
1572
|
-
"--no-verbose"
|
|
1573
|
-
];
|
|
1574
|
-
return runSteps("Publint", [
|
|
1575
|
-
[
|
|
1576
|
-
"yarn",
|
|
1577
|
-
[
|
|
1578
|
-
"workspaces",
|
|
1579
|
-
"foreach",
|
|
1580
|
-
"-pA",
|
|
1581
|
-
...verboseOptions,
|
|
1582
|
-
"run",
|
|
1583
|
-
"package-publint"
|
|
1584
|
-
]
|
|
1585
|
-
]
|
|
1586
|
-
]);
|
|
1587
|
-
}, "publintAll");
|
|
1231
|
+
var publint = async ({ verbose, pkg }) => {
|
|
1232
|
+
return pkg === void 0 ? publintAll({ verbose }) : await publintPackage({ pkg, verbose });
|
|
1233
|
+
};
|
|
1234
|
+
var publintPackage = ({ pkg }) => {
|
|
1235
|
+
return runStepsAsync(`Publint [${pkg}]`, [["yarn", ["workspace", pkg, "run", "package-publint"]]]);
|
|
1236
|
+
};
|
|
1237
|
+
var publintAll = ({ verbose }) => {
|
|
1238
|
+
const verboseOptions = verbose ? ["--verbose"] : ["--no-verbose"];
|
|
1239
|
+
return runSteps("Publint", [["yarn", ["workspaces", "foreach", "-pA", ...verboseOptions, "run", "package-publint"]]]);
|
|
1240
|
+
};
|
|
1588
1241
|
|
|
1589
1242
|
// src/actions/rebuild.ts
|
|
1590
|
-
var rebuild =
|
|
1243
|
+
var rebuild = ({ target }) => {
|
|
1591
1244
|
return runSteps("Rebuild", [
|
|
1592
|
-
[
|
|
1593
|
-
|
|
1594
|
-
"xy clean"
|
|
1595
|
-
],
|
|
1596
|
-
[
|
|
1597
|
-
"yarn",
|
|
1598
|
-
target ? `xy build -t ${target}` : "xy build"
|
|
1599
|
-
]
|
|
1245
|
+
["yarn", "xy clean"],
|
|
1246
|
+
["yarn", target ? `xy build -t ${target}` : "xy build"]
|
|
1600
1247
|
]);
|
|
1601
|
-
}
|
|
1248
|
+
};
|
|
1602
1249
|
|
|
1603
1250
|
// src/actions/recompile.ts
|
|
1604
1251
|
import chalk21 from "chalk";
|
|
1605
|
-
var recompile =
|
|
1252
|
+
var recompile = async ({
|
|
1253
|
+
verbose,
|
|
1254
|
+
target,
|
|
1255
|
+
pkg,
|
|
1256
|
+
incremental
|
|
1257
|
+
}) => {
|
|
1606
1258
|
return pkg ? await recompilePackage({
|
|
1607
1259
|
pkg,
|
|
1608
1260
|
target,
|
|
@@ -1612,49 +1264,25 @@ var recompile = /* @__PURE__ */ __name(async ({ verbose, target, pkg, incrementa
|
|
|
1612
1264
|
target,
|
|
1613
1265
|
verbose
|
|
1614
1266
|
});
|
|
1615
|
-
}
|
|
1616
|
-
var recompilePackage =
|
|
1617
|
-
const targetOptions = target ? [
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
...targetOptions
|
|
1630
|
-
]
|
|
1631
|
-
]
|
|
1632
|
-
]);
|
|
1633
|
-
}, "recompilePackage");
|
|
1634
|
-
var recompileAll = /* @__PURE__ */ __name(async ({ jobs, verbose, target, incremental }) => {
|
|
1267
|
+
};
|
|
1268
|
+
var recompilePackage = ({ target, pkg }) => {
|
|
1269
|
+
const targetOptions = target ? ["-t", target] : [];
|
|
1270
|
+
return runStepsAsync(
|
|
1271
|
+
`Recompile [${pkg}]`,
|
|
1272
|
+
[["yarn", ["workspace", pkg, "run", "package-recompile", ...targetOptions]]]
|
|
1273
|
+
);
|
|
1274
|
+
};
|
|
1275
|
+
var recompileAll = async ({
|
|
1276
|
+
jobs,
|
|
1277
|
+
verbose,
|
|
1278
|
+
target,
|
|
1279
|
+
incremental
|
|
1280
|
+
}) => {
|
|
1635
1281
|
const start = Date.now();
|
|
1636
|
-
const verboseOptions = verbose ? [
|
|
1637
|
-
|
|
1638
|
-
] : [
|
|
1639
|
-
|
|
1640
|
-
];
|
|
1641
|
-
const targetOptions = target ? [
|
|
1642
|
-
"-t",
|
|
1643
|
-
target
|
|
1644
|
-
] : [];
|
|
1645
|
-
const incrementalOptions = incremental ? [
|
|
1646
|
-
"--since",
|
|
1647
|
-
"-Apt",
|
|
1648
|
-
"--topological-dev"
|
|
1649
|
-
] : [
|
|
1650
|
-
"--parallel",
|
|
1651
|
-
"-Apt",
|
|
1652
|
-
"--topological-dev"
|
|
1653
|
-
];
|
|
1654
|
-
const jobsOptions = jobs ? [
|
|
1655
|
-
"-j",
|
|
1656
|
-
`${jobs}`
|
|
1657
|
-
] : [];
|
|
1282
|
+
const verboseOptions = verbose ? ["--verbose"] : ["--no-verbose"];
|
|
1283
|
+
const targetOptions = target ? ["-t", target] : [];
|
|
1284
|
+
const incrementalOptions = incremental ? ["--since", "-Apt", "--topological-dev"] : ["--parallel", "-Apt", "--topological-dev"];
|
|
1285
|
+
const jobsOptions = jobs ? ["-j", `${jobs}`] : [];
|
|
1658
1286
|
if (jobs) {
|
|
1659
1287
|
console.log(chalk21.blue(`Jobs set to [${jobs}]`));
|
|
1660
1288
|
}
|
|
@@ -1686,13 +1314,19 @@ var recompileAll = /* @__PURE__ */ __name(async ({ jobs, verbose, target, increm
|
|
|
1686
1314
|
]
|
|
1687
1315
|
]
|
|
1688
1316
|
]);
|
|
1689
|
-
console.log(
|
|
1317
|
+
console.log(
|
|
1318
|
+
`${chalk21.gray("Recompiled in")} [${chalk21.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk21.gray("seconds")}`
|
|
1319
|
+
);
|
|
1690
1320
|
return result;
|
|
1691
|
-
}
|
|
1321
|
+
};
|
|
1692
1322
|
|
|
1693
1323
|
// src/actions/reinstall.ts
|
|
1694
|
-
import {
|
|
1695
|
-
|
|
1324
|
+
import {
|
|
1325
|
+
closeSync,
|
|
1326
|
+
openSync,
|
|
1327
|
+
rmSync
|
|
1328
|
+
} from "fs";
|
|
1329
|
+
var reinstall = () => {
|
|
1696
1330
|
console.log("Reinstall [Clear Lock File]");
|
|
1697
1331
|
closeSync(openSync("./yarn.lock", "w"));
|
|
1698
1332
|
console.log("Reinstall [Clear Node Modules]");
|
|
@@ -1700,10 +1334,7 @@ var reinstall = /* @__PURE__ */ __name(() => {
|
|
|
1700
1334
|
const result = workspaces.map(({ location, name }) => {
|
|
1701
1335
|
const dist = `${location}/node_modules`;
|
|
1702
1336
|
try {
|
|
1703
|
-
rmSync(dist, {
|
|
1704
|
-
force: true,
|
|
1705
|
-
recursive: true
|
|
1706
|
-
});
|
|
1337
|
+
rmSync(dist, { force: true, recursive: true });
|
|
1707
1338
|
return 0;
|
|
1708
1339
|
} catch (ex) {
|
|
1709
1340
|
const error = ex;
|
|
@@ -1711,560 +1342,594 @@ var reinstall = /* @__PURE__ */ __name(() => {
|
|
|
1711
1342
|
return 1;
|
|
1712
1343
|
}
|
|
1713
1344
|
}).reduce((prev, result2) => prev || result2, 0);
|
|
1714
|
-
return result || runSteps("Reinstall", [
|
|
1715
|
-
|
|
1716
|
-
"yarn",
|
|
1717
|
-
"install --network-timeout 10000"
|
|
1718
|
-
]
|
|
1719
|
-
]);
|
|
1720
|
-
}, "reinstall");
|
|
1345
|
+
return result || runSteps("Reinstall", [["yarn", "install --network-timeout 10000"]]);
|
|
1346
|
+
};
|
|
1721
1347
|
|
|
1722
1348
|
// src/actions/relint.ts
|
|
1723
1349
|
import chalk22 from "chalk";
|
|
1724
|
-
var relintPackage =
|
|
1350
|
+
var relintPackage = ({ pkg }) => {
|
|
1725
1351
|
console.log(chalk22.gray(`${"Relint"} [All-Packages]`));
|
|
1726
1352
|
const start = Date.now();
|
|
1727
1353
|
const result = runSteps("Relint [All-Packages]", [
|
|
1728
|
-
[
|
|
1729
|
-
"
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
"package-relint"
|
|
1735
|
-
]
|
|
1736
|
-
]
|
|
1354
|
+
["yarn", [
|
|
1355
|
+
"workspace",
|
|
1356
|
+
pkg,
|
|
1357
|
+
"run",
|
|
1358
|
+
"package-relint"
|
|
1359
|
+
]]
|
|
1737
1360
|
]);
|
|
1738
1361
|
console.log(chalk22.gray(`${"Relinted in"} [${chalk22.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk22.gray("seconds")}`));
|
|
1739
1362
|
return result;
|
|
1740
|
-
}
|
|
1741
|
-
var relint =
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
var relintAllPackages = /* @__PURE__ */ __name(({ verbose = false, incremental } = {}) => {
|
|
1363
|
+
};
|
|
1364
|
+
var relint = ({
|
|
1365
|
+
pkg,
|
|
1366
|
+
verbose,
|
|
1367
|
+
incremental
|
|
1368
|
+
} = {}) => {
|
|
1369
|
+
return pkg ? relintPackage({ pkg }) : relintAllPackages({ verbose, incremental });
|
|
1370
|
+
};
|
|
1371
|
+
var relintAllPackages = ({ verbose = false, incremental } = {}) => {
|
|
1750
1372
|
console.log(chalk22.gray(`${"Relint"} [All-Packages]`));
|
|
1751
1373
|
const start = Date.now();
|
|
1752
|
-
const verboseOptions = verbose ? [
|
|
1753
|
-
|
|
1754
|
-
] : [
|
|
1755
|
-
"--no-verbose"
|
|
1756
|
-
];
|
|
1757
|
-
const incrementalOptions = incremental ? [
|
|
1758
|
-
"--since",
|
|
1759
|
-
"-Ap"
|
|
1760
|
-
] : [
|
|
1761
|
-
"--parallel",
|
|
1762
|
-
"-Ap"
|
|
1763
|
-
];
|
|
1374
|
+
const verboseOptions = verbose ? ["--verbose"] : ["--no-verbose"];
|
|
1375
|
+
const incrementalOptions = incremental ? ["--since", "-Ap"] : ["--parallel", "-Ap"];
|
|
1764
1376
|
const result = runSteps(`${"Relint"} [All-Packages]`, [
|
|
1765
|
-
[
|
|
1766
|
-
"
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
"package-relint"
|
|
1774
|
-
]
|
|
1775
|
-
]
|
|
1377
|
+
["yarn", [
|
|
1378
|
+
"workspaces",
|
|
1379
|
+
"foreach",
|
|
1380
|
+
...verboseOptions,
|
|
1381
|
+
...incrementalOptions,
|
|
1382
|
+
"run",
|
|
1383
|
+
"package-relint"
|
|
1384
|
+
]]
|
|
1776
1385
|
]);
|
|
1777
1386
|
console.log(chalk22.gray(`Relinted in [${chalk22.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk22.gray("seconds")}`));
|
|
1778
1387
|
return result;
|
|
1779
|
-
}
|
|
1388
|
+
};
|
|
1780
1389
|
|
|
1781
1390
|
// src/actions/retest.ts
|
|
1782
|
-
var retest =
|
|
1391
|
+
var retest = () => {
|
|
1783
1392
|
return runSteps("Test", [
|
|
1784
|
-
[
|
|
1785
|
-
|
|
1786
|
-
[
|
|
1787
|
-
"jest",
|
|
1788
|
-
"--clearCache"
|
|
1789
|
-
]
|
|
1790
|
-
],
|
|
1791
|
-
[
|
|
1792
|
-
"yarn",
|
|
1793
|
-
[
|
|
1794
|
-
"jest",
|
|
1795
|
-
"."
|
|
1796
|
-
]
|
|
1797
|
-
]
|
|
1393
|
+
["yarn", ["jest", "--clearCache"]],
|
|
1394
|
+
["yarn", ["jest", "."]]
|
|
1798
1395
|
]);
|
|
1799
|
-
}
|
|
1396
|
+
};
|
|
1800
1397
|
|
|
1801
1398
|
// src/actions/sonar.ts
|
|
1802
|
-
var sonar =
|
|
1803
|
-
return runSteps("Sonar", [
|
|
1804
|
-
|
|
1805
|
-
"yarn",
|
|
1806
|
-
[
|
|
1807
|
-
"eslint",
|
|
1808
|
-
"-c",
|
|
1809
|
-
"sonar.eslintrc",
|
|
1810
|
-
"."
|
|
1811
|
-
]
|
|
1812
|
-
]
|
|
1813
|
-
]);
|
|
1814
|
-
}, "sonar");
|
|
1399
|
+
var sonar = () => {
|
|
1400
|
+
return runSteps("Sonar", [["yarn", ["eslint", "-c", "sonar.eslintrc", "."]]]);
|
|
1401
|
+
};
|
|
1815
1402
|
|
|
1816
1403
|
// src/actions/statics.ts
|
|
1817
1404
|
import chalk23 from "chalk";
|
|
1818
|
-
var DefaultDependencies = [
|
|
1819
|
-
|
|
1820
|
-
"@xylabs/pixel",
|
|
1821
|
-
"react",
|
|
1822
|
-
"graphql",
|
|
1823
|
-
"react-router",
|
|
1824
|
-
"@mui/material",
|
|
1825
|
-
"@mui/system"
|
|
1826
|
-
];
|
|
1827
|
-
var statics = /* @__PURE__ */ __name(() => {
|
|
1405
|
+
var DefaultDependencies = ["axios", "@xylabs/pixel", "react", "graphql", "react-router", "@mui/material", "@mui/system"];
|
|
1406
|
+
var statics = () => {
|
|
1828
1407
|
console.log(chalk23.green("Check Required Static Dependencies"));
|
|
1829
1408
|
const statics2 = parsedPackageJSON()?.xy?.deps?.statics;
|
|
1830
1409
|
return detectDuplicateDependencies(statics2, DefaultDependencies);
|
|
1831
|
-
}
|
|
1410
|
+
};
|
|
1832
1411
|
|
|
1833
1412
|
// src/actions/test.ts
|
|
1834
|
-
var test =
|
|
1835
|
-
return runSteps("Test", [
|
|
1836
|
-
|
|
1837
|
-
"yarn",
|
|
1838
|
-
[
|
|
1839
|
-
"vitest",
|
|
1840
|
-
"."
|
|
1841
|
-
]
|
|
1842
|
-
]
|
|
1843
|
-
]);
|
|
1844
|
-
}, "test");
|
|
1413
|
+
var test = () => {
|
|
1414
|
+
return runSteps("Test", [["yarn", ["vitest", "."]]]);
|
|
1415
|
+
};
|
|
1845
1416
|
|
|
1846
1417
|
// src/actions/up.ts
|
|
1847
|
-
var up =
|
|
1848
|
-
return runSteps("Up", [
|
|
1849
|
-
|
|
1850
|
-
"yarn",
|
|
1851
|
-
"outdated"
|
|
1852
|
-
]
|
|
1853
|
-
]);
|
|
1854
|
-
}, "up");
|
|
1418
|
+
var up = () => {
|
|
1419
|
+
return runSteps("Up", [["yarn", "outdated"]]);
|
|
1420
|
+
};
|
|
1855
1421
|
|
|
1856
1422
|
// src/actions/updo.ts
|
|
1857
|
-
var updo =
|
|
1423
|
+
var updo = () => {
|
|
1858
1424
|
return runSteps("Updo", [
|
|
1859
|
-
[
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
],
|
|
1863
|
-
[
|
|
1864
|
-
"yarn",
|
|
1865
|
-
"upgrade-interactive"
|
|
1866
|
-
],
|
|
1867
|
-
[
|
|
1868
|
-
"yarn",
|
|
1869
|
-
"dedupe"
|
|
1870
|
-
]
|
|
1425
|
+
["yarn", "install"],
|
|
1426
|
+
["yarn", "upgrade-interactive"],
|
|
1427
|
+
["yarn", "dedupe"]
|
|
1871
1428
|
]);
|
|
1872
|
-
}
|
|
1429
|
+
};
|
|
1873
1430
|
|
|
1874
1431
|
// src/actions/upplug.ts
|
|
1875
|
-
var updateYarnPlugins =
|
|
1432
|
+
var updateYarnPlugins = () => {
|
|
1876
1433
|
return runSteps("Update Yarn Plugins", [
|
|
1877
|
-
[
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
"import",
|
|
1882
|
-
"https://mskelton.dev/yarn-outdated/v3"
|
|
1883
|
-
]
|
|
1884
|
-
],
|
|
1885
|
-
[
|
|
1886
|
-
"yarn",
|
|
1887
|
-
[
|
|
1888
|
-
"plugin",
|
|
1889
|
-
"import",
|
|
1890
|
-
"version"
|
|
1891
|
-
]
|
|
1892
|
-
],
|
|
1893
|
-
[
|
|
1894
|
-
"yarn",
|
|
1895
|
-
[
|
|
1896
|
-
"plugin",
|
|
1897
|
-
"import",
|
|
1898
|
-
"interactive-tools"
|
|
1899
|
-
]
|
|
1900
|
-
],
|
|
1901
|
-
[
|
|
1902
|
-
"yarn",
|
|
1903
|
-
[
|
|
1904
|
-
"plugin",
|
|
1905
|
-
"import",
|
|
1906
|
-
"workspace-tools"
|
|
1907
|
-
]
|
|
1908
|
-
]
|
|
1434
|
+
["yarn", ["plugin", "import", "https://mskelton.dev/yarn-outdated/v3"]],
|
|
1435
|
+
["yarn", ["plugin", "import", "version"]],
|
|
1436
|
+
["yarn", ["plugin", "import", "interactive-tools"]],
|
|
1437
|
+
["yarn", ["plugin", "import", "workspace-tools"]]
|
|
1909
1438
|
]);
|
|
1910
|
-
}
|
|
1439
|
+
};
|
|
1911
1440
|
|
|
1912
1441
|
// src/actions/upyarn.ts
|
|
1913
|
-
var updateYarnVersion =
|
|
1914
|
-
return runSteps("Update Yarn Version", [
|
|
1915
|
-
|
|
1916
|
-
"yarn",
|
|
1917
|
-
[
|
|
1918
|
-
"set",
|
|
1919
|
-
"version",
|
|
1920
|
-
"latest"
|
|
1921
|
-
]
|
|
1922
|
-
]
|
|
1923
|
-
]);
|
|
1924
|
-
}, "updateYarnVersion");
|
|
1442
|
+
var updateYarnVersion = () => {
|
|
1443
|
+
return runSteps("Update Yarn Version", [["yarn", ["set", "version", "latest"]]]);
|
|
1444
|
+
};
|
|
1925
1445
|
|
|
1926
1446
|
// src/actions/yarn3only.ts
|
|
1927
|
-
var yarn3Only =
|
|
1447
|
+
var yarn3Only = () => {
|
|
1928
1448
|
const [valid, version] = isYarnVersionOrGreater(3);
|
|
1929
1449
|
if (!valid) {
|
|
1930
1450
|
processEx(`Invalid Yarn version [${version}]`);
|
|
1931
1451
|
}
|
|
1932
1452
|
return 0;
|
|
1933
|
-
}
|
|
1453
|
+
};
|
|
1934
1454
|
|
|
1935
1455
|
// src/xy/xyBuildCommands.ts
|
|
1936
|
-
var xyBuildCommands =
|
|
1937
|
-
return args.command(
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1456
|
+
var xyBuildCommands = (args) => {
|
|
1457
|
+
return args.command(
|
|
1458
|
+
"build [package]",
|
|
1459
|
+
"Build - Compile & Lint",
|
|
1460
|
+
(yargs2) => {
|
|
1461
|
+
return yargs2.positional("package", { describe: "Specific package to build" });
|
|
1462
|
+
},
|
|
1463
|
+
async (argv) => {
|
|
1464
|
+
if (argv.verbose) {
|
|
1465
|
+
console.log(`Building: ${argv.package ?? "all"}`);
|
|
1466
|
+
}
|
|
1467
|
+
process.exitCode = await build({
|
|
1468
|
+
incremental: !!argv.incremental,
|
|
1469
|
+
jobs: argv.jobs,
|
|
1470
|
+
pkg: argv.package,
|
|
1471
|
+
target: argv.target,
|
|
1472
|
+
verbose: !!argv.verbose
|
|
1473
|
+
});
|
|
1944
1474
|
}
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1475
|
+
).command(
|
|
1476
|
+
"compile [package]",
|
|
1477
|
+
"Compile with Typescript & Copy Images",
|
|
1478
|
+
(yargs2) => {
|
|
1479
|
+
return yargs2.positional("package", { describe: "Specific package to compile" });
|
|
1480
|
+
},
|
|
1481
|
+
(argv) => {
|
|
1482
|
+
if (argv.verbose) {
|
|
1483
|
+
console.log(`Compiling: ${argv.package ?? "all"}`);
|
|
1484
|
+
}
|
|
1485
|
+
process.exitCode = compile({
|
|
1486
|
+
incremental: !!argv.incremental,
|
|
1487
|
+
jobs: argv.jobs,
|
|
1488
|
+
pkg: argv.package,
|
|
1489
|
+
target: argv.target,
|
|
1490
|
+
verbose: !!argv.verbose
|
|
1491
|
+
});
|
|
1959
1492
|
}
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1493
|
+
).command(
|
|
1494
|
+
"compile-only [package]",
|
|
1495
|
+
"Compile with Typescript & Copy Images (No Publint)",
|
|
1496
|
+
(yargs2) => {
|
|
1497
|
+
return yargs2.positional("package", { describe: "Specific package to compile" });
|
|
1498
|
+
},
|
|
1499
|
+
(argv) => {
|
|
1500
|
+
if (argv.verbose) {
|
|
1501
|
+
console.log(`Compiling: ${argv.package ?? "all"}`);
|
|
1502
|
+
}
|
|
1503
|
+
process.exitCode = compile({
|
|
1504
|
+
incremental: !!argv.incremental,
|
|
1505
|
+
jobs: argv.jobs,
|
|
1506
|
+
pkg: argv.package,
|
|
1507
|
+
publint: false,
|
|
1508
|
+
target: argv.target,
|
|
1509
|
+
verbose: !!argv.verbose
|
|
1510
|
+
});
|
|
1974
1511
|
}
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1512
|
+
).command(
|
|
1513
|
+
"recompile [package]",
|
|
1514
|
+
"Re-compile with Typescript & Copy Images",
|
|
1515
|
+
(yargs2) => {
|
|
1516
|
+
return yargs2.positional("package", { describe: "Specific package to re-compile" });
|
|
1517
|
+
},
|
|
1518
|
+
async (argv) => {
|
|
1519
|
+
if (argv.verbose) {
|
|
1520
|
+
console.log(`Re-compiling: ${argv.package ?? "all"}`);
|
|
1521
|
+
}
|
|
1522
|
+
process.exitCode = await recompile({
|
|
1523
|
+
incremental: !!argv.incremental,
|
|
1524
|
+
jobs: argv.jobs,
|
|
1525
|
+
pkg: argv.package,
|
|
1526
|
+
target: argv.target,
|
|
1527
|
+
verbose: !!argv.verbose
|
|
1528
|
+
});
|
|
1990
1529
|
}
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
}
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
}
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
process.exitCode = await copyAssets({
|
|
2014
|
-
target: argv.target
|
|
2015
|
-
});
|
|
2016
|
-
});
|
|
2017
|
-
}, "xyBuildCommands");
|
|
1530
|
+
).command(
|
|
1531
|
+
"rebuild [package]",
|
|
1532
|
+
"Rebuild - Clean, Compile & Lint",
|
|
1533
|
+
(yargs2) => {
|
|
1534
|
+
return yargs2.positional("package", { describe: "Specific package to rebuild" });
|
|
1535
|
+
},
|
|
1536
|
+
(argv) => {
|
|
1537
|
+
if (argv.verbose) console.log(`Rebuilding: ${argv.package ?? "all"}`);
|
|
1538
|
+
process.exitCode = rebuild({ target: argv.target });
|
|
1539
|
+
}
|
|
1540
|
+
).command(
|
|
1541
|
+
"copy-assets [package]",
|
|
1542
|
+
"Copy Assets - Copy the assets from src to dist",
|
|
1543
|
+
(yargs2) => {
|
|
1544
|
+
return yargs2.positional("package", { describe: "Specific package to copy assets" });
|
|
1545
|
+
},
|
|
1546
|
+
async (argv) => {
|
|
1547
|
+
if (argv.verbose) console.log(`Copying Assets: ${argv.package ?? "all"}`);
|
|
1548
|
+
process.exitCode = await copyAssets({ target: argv.target });
|
|
1549
|
+
}
|
|
1550
|
+
);
|
|
1551
|
+
};
|
|
2018
1552
|
|
|
2019
1553
|
// src/xy/param.ts
|
|
2020
|
-
var packagePositionalParam =
|
|
2021
|
-
return yargs2.positional("package", {
|
|
2022
|
-
|
|
2023
|
-
type: "string"
|
|
2024
|
-
});
|
|
2025
|
-
}, "packagePositionalParam");
|
|
1554
|
+
var packagePositionalParam = (yargs2) => {
|
|
1555
|
+
return yargs2.positional("package", { describe: "Specific package to target", type: "string" });
|
|
1556
|
+
};
|
|
2026
1557
|
|
|
2027
1558
|
// src/xy/xyCommonCommands.ts
|
|
2028
|
-
var xyCommonCommands =
|
|
2029
|
-
return args.command(
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
1559
|
+
var xyCommonCommands = (args) => {
|
|
1560
|
+
return args.command(
|
|
1561
|
+
"license [package]",
|
|
1562
|
+
"License - Check licenses of dependencies",
|
|
1563
|
+
(yargs2) => {
|
|
1564
|
+
return packagePositionalParam(yargs2);
|
|
1565
|
+
},
|
|
1566
|
+
async (argv) => {
|
|
1567
|
+
if (argv.verbose) console.log(`License: ${argv.package ?? "all"}`);
|
|
1568
|
+
process.exitCode = await license();
|
|
1569
|
+
}
|
|
1570
|
+
).command(
|
|
1571
|
+
"dead [package]",
|
|
1572
|
+
"Dead - Check for dead code",
|
|
1573
|
+
(yargs2) => {
|
|
1574
|
+
return packagePositionalParam(yargs2);
|
|
1575
|
+
},
|
|
1576
|
+
(argv) => {
|
|
1577
|
+
if (argv.verbose) console.log("Dead");
|
|
1578
|
+
process.exitCode = dead();
|
|
1579
|
+
}
|
|
1580
|
+
).command(
|
|
1581
|
+
"gen-docs [package]",
|
|
1582
|
+
"GenDocs - Generate TypeDocs",
|
|
1583
|
+
(yargs2) => {
|
|
1584
|
+
return packagePositionalParam(yargs2);
|
|
1585
|
+
},
|
|
1586
|
+
(argv) => {
|
|
1587
|
+
if (argv.verbose) console.log(`Generating TypeDocs: ${argv.package ?? "all"}`);
|
|
1588
|
+
process.exitCode = genDocs({ incremental: !!argv.incremental, pkg: argv.package });
|
|
1589
|
+
}
|
|
1590
|
+
).command(
|
|
1591
|
+
"clean-docs",
|
|
1592
|
+
"CleanDocs - Clean TypeDocs",
|
|
1593
|
+
(yargs2) => yargs2,
|
|
1594
|
+
(argv) => {
|
|
1595
|
+
if (argv.verbose) console.log("Cleaning TypeDocs: all");
|
|
1596
|
+
process.exitCode = cleanDocs();
|
|
1597
|
+
}
|
|
1598
|
+
).command(
|
|
1599
|
+
"gitlint [package]",
|
|
1600
|
+
"Gitlint - Lint your git config",
|
|
1601
|
+
(yargs2) => {
|
|
1602
|
+
return yargs2;
|
|
1603
|
+
},
|
|
1604
|
+
(argv) => {
|
|
1605
|
+
if (argv.verbose) console.log("Gitlint");
|
|
1606
|
+
process.exitCode = argv.fix ? gitlintFix() : gitlint();
|
|
1607
|
+
}
|
|
1608
|
+
).command(
|
|
1609
|
+
"gitignore-gen",
|
|
1610
|
+
"GitIgnore Gen - Generate .gitignore files",
|
|
1611
|
+
(yargs2) => {
|
|
1612
|
+
return yargs2;
|
|
1613
|
+
},
|
|
1614
|
+
(argv) => {
|
|
1615
|
+
if (argv.verbose) console.log("GitIgnore Gen");
|
|
1616
|
+
process.exitCode = gitignoreGen();
|
|
1617
|
+
}
|
|
1618
|
+
).command(
|
|
1619
|
+
"npmignore-gen",
|
|
1620
|
+
"NpmIgnore Gen - Generate .npmignore files",
|
|
1621
|
+
(yargs2) => {
|
|
1622
|
+
return yargs2;
|
|
1623
|
+
},
|
|
1624
|
+
(argv) => {
|
|
1625
|
+
if (argv.verbose) console.log("NpmIgnore Gen");
|
|
1626
|
+
process.exitCode = npmignoreGen();
|
|
1627
|
+
}
|
|
1628
|
+
).command(
|
|
1629
|
+
"retest",
|
|
1630
|
+
"Re-Test - Run Jest Tests with cleaned cache",
|
|
1631
|
+
(yargs2) => {
|
|
1632
|
+
return yargs2;
|
|
1633
|
+
},
|
|
1634
|
+
(argv) => {
|
|
1635
|
+
if (argv.verbose) console.log("Re-Testing");
|
|
1636
|
+
process.exitCode = retest();
|
|
1637
|
+
}
|
|
1638
|
+
).command(
|
|
1639
|
+
"test",
|
|
1640
|
+
"Test - Run Jest Tests",
|
|
1641
|
+
(yargs2) => {
|
|
1642
|
+
return yargs2;
|
|
1643
|
+
},
|
|
1644
|
+
(argv) => {
|
|
1645
|
+
if (argv.verbose) console.log("Testing");
|
|
1646
|
+
process.exitCode = test();
|
|
1647
|
+
}
|
|
1648
|
+
).command(
|
|
1649
|
+
"upplug",
|
|
1650
|
+
"UpPlug - Update Yarn Plugins",
|
|
1651
|
+
(yargs2) => {
|
|
1652
|
+
return yargs2;
|
|
1653
|
+
},
|
|
1654
|
+
(argv) => {
|
|
1655
|
+
if (argv.verbose) console.log("UpPlug");
|
|
1656
|
+
process.exitCode = updateYarnPlugins();
|
|
1657
|
+
}
|
|
1658
|
+
).command(
|
|
1659
|
+
"upyarn",
|
|
1660
|
+
"UpYarn - Update Yarn Version",
|
|
1661
|
+
(yargs2) => {
|
|
1662
|
+
return yargs2;
|
|
1663
|
+
},
|
|
1664
|
+
(argv) => {
|
|
1665
|
+
if (argv.verbose) console.log("UpYarn");
|
|
1666
|
+
process.exitCode = updateYarnVersion();
|
|
1667
|
+
}
|
|
1668
|
+
).command(
|
|
1669
|
+
"yarn3only",
|
|
1670
|
+
"Yarn3Only - Check if using Yarn v3",
|
|
1671
|
+
(yargs2) => {
|
|
1672
|
+
return yargs2;
|
|
1673
|
+
},
|
|
1674
|
+
(argv) => {
|
|
1675
|
+
if (argv.verbose) console.log("Yarn 3 Check");
|
|
1676
|
+
process.exitCode = yarn3Only();
|
|
1677
|
+
}
|
|
1678
|
+
);
|
|
1679
|
+
};
|
|
2092
1680
|
|
|
2093
1681
|
// src/xy/xyDeployCommands.ts
|
|
2094
|
-
var xyDeployCommands =
|
|
2095
|
-
return args.command(
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
1682
|
+
var xyDeployCommands = (args) => {
|
|
1683
|
+
return args.command(
|
|
1684
|
+
"deploy",
|
|
1685
|
+
"Deploy - Deploy patch",
|
|
1686
|
+
(yargs2) => {
|
|
1687
|
+
return yargs2;
|
|
1688
|
+
},
|
|
1689
|
+
(argv) => {
|
|
1690
|
+
if (argv.verbose) console.log("Deploy patch");
|
|
1691
|
+
process.exitCode = deploy();
|
|
1692
|
+
}
|
|
1693
|
+
).command(
|
|
1694
|
+
"deploy-minor",
|
|
1695
|
+
"Deploy - Deploy minor",
|
|
1696
|
+
(yargs2) => {
|
|
1697
|
+
return yargs2;
|
|
1698
|
+
},
|
|
1699
|
+
(argv) => {
|
|
1700
|
+
if (argv.verbose) console.log("Deploy minor");
|
|
1701
|
+
process.exitCode = deployMinor();
|
|
1702
|
+
}
|
|
1703
|
+
).command(
|
|
1704
|
+
"deploy-major",
|
|
1705
|
+
"Deploy - Deploy major",
|
|
1706
|
+
(yargs2) => {
|
|
1707
|
+
return yargs2;
|
|
1708
|
+
},
|
|
1709
|
+
(argv) => {
|
|
1710
|
+
if (argv.verbose) console.log("Deploy major");
|
|
1711
|
+
process.exitCode = deployMajor();
|
|
1712
|
+
}
|
|
1713
|
+
).command(
|
|
1714
|
+
"deploy-next",
|
|
1715
|
+
"Deploy - Deploy next",
|
|
1716
|
+
(yargs2) => {
|
|
1717
|
+
return yargs2;
|
|
1718
|
+
},
|
|
1719
|
+
(argv) => {
|
|
1720
|
+
if (argv.verbose) console.log("Deploy next");
|
|
1721
|
+
process.exitCode = deployNext();
|
|
1722
|
+
}
|
|
1723
|
+
);
|
|
1724
|
+
};
|
|
2117
1725
|
|
|
2118
1726
|
// src/xy/xyInstallCommands.ts
|
|
2119
|
-
var xyInstallCommands =
|
|
2120
|
-
return args.command(
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
1727
|
+
var xyInstallCommands = (args) => {
|
|
1728
|
+
return args.command(
|
|
1729
|
+
"clean [package]",
|
|
1730
|
+
"Clean",
|
|
1731
|
+
(yargs2) => {
|
|
1732
|
+
return yargs2.positional("package", { describe: "Specific package to clean" });
|
|
1733
|
+
},
|
|
1734
|
+
async (argv) => {
|
|
1735
|
+
if (argv.verbose) {
|
|
1736
|
+
console.log(`Cleaning: ${argv.package ?? "all"}`);
|
|
1737
|
+
}
|
|
1738
|
+
process.exitCode = await clean({
|
|
1739
|
+
pkg: argv.package,
|
|
1740
|
+
verbose: !!argv.verbose
|
|
1741
|
+
});
|
|
2127
1742
|
}
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
1743
|
+
).command(
|
|
1744
|
+
"reinstall",
|
|
1745
|
+
"Reinstall - Clean & Install",
|
|
1746
|
+
(yargs2) => {
|
|
1747
|
+
return yargs2;
|
|
1748
|
+
},
|
|
1749
|
+
(argv) => {
|
|
1750
|
+
if (argv.verbose) console.log("Reinstalling");
|
|
1751
|
+
process.exitCode = reinstall();
|
|
1752
|
+
}
|
|
1753
|
+
).command(
|
|
1754
|
+
"up",
|
|
1755
|
+
"Up - Update dependencies",
|
|
1756
|
+
(yargs2) => {
|
|
1757
|
+
return yargs2;
|
|
1758
|
+
},
|
|
1759
|
+
(argv) => {
|
|
1760
|
+
if (argv.verbose) console.log("Up");
|
|
1761
|
+
process.exitCode = up();
|
|
1762
|
+
}
|
|
1763
|
+
).command(
|
|
1764
|
+
"updo",
|
|
1765
|
+
"Updo - Update dependencies [Interactive]",
|
|
1766
|
+
(yargs2) => {
|
|
1767
|
+
return yargs2;
|
|
1768
|
+
},
|
|
1769
|
+
(argv) => {
|
|
1770
|
+
if (argv.verbose) console.log("Updo");
|
|
1771
|
+
process.exitCode = updo();
|
|
1772
|
+
}
|
|
1773
|
+
).command(
|
|
1774
|
+
"statics",
|
|
1775
|
+
"Statics - Confirming Static Packages",
|
|
1776
|
+
(yargs2) => {
|
|
1777
|
+
return yargs2;
|
|
1778
|
+
},
|
|
1779
|
+
(argv) => {
|
|
1780
|
+
if (argv.verbose) console.log("Statics");
|
|
1781
|
+
process.exitCode = statics();
|
|
1782
|
+
}
|
|
1783
|
+
).command(
|
|
1784
|
+
"dupdeps",
|
|
1785
|
+
"Dupdeps - Duplicate Dependencies in package.json",
|
|
1786
|
+
(yargs2) => {
|
|
1787
|
+
return yargs2;
|
|
1788
|
+
},
|
|
1789
|
+
(argv) => {
|
|
1790
|
+
if (argv.verbose) console.log("Dupdeps");
|
|
1791
|
+
process.exitCode = dupdeps();
|
|
1792
|
+
}
|
|
1793
|
+
);
|
|
1794
|
+
};
|
|
2159
1795
|
|
|
2160
1796
|
// src/xy/xyLintCommands.ts
|
|
2161
1797
|
import chalk24 from "chalk";
|
|
2162
|
-
var xyLintCommands =
|
|
2163
|
-
return args.command(
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
}
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
1798
|
+
var xyLintCommands = (args) => {
|
|
1799
|
+
return args.command(
|
|
1800
|
+
"cycle [package]",
|
|
1801
|
+
"Cycle - Check for dependency cycles",
|
|
1802
|
+
(yargs2) => {
|
|
1803
|
+
return packagePositionalParam(yargs2);
|
|
1804
|
+
},
|
|
1805
|
+
async (argv) => {
|
|
1806
|
+
const start = Date.now();
|
|
1807
|
+
if (argv.verbose) console.log("Cycle");
|
|
1808
|
+
process.exitCode = await cycle({ pkg: argv.package });
|
|
1809
|
+
console.log(chalk24.blue(`Finished in ${Date.now() - start}ms`));
|
|
1810
|
+
}
|
|
1811
|
+
).command(
|
|
1812
|
+
"lint [package]",
|
|
1813
|
+
"Lint - Run Eslint",
|
|
1814
|
+
(yargs2) => {
|
|
1815
|
+
return packagePositionalParam(yargs2).option("fix", {
|
|
1816
|
+
alias: "f",
|
|
1817
|
+
default: false,
|
|
1818
|
+
description: "Fix fixable issues",
|
|
1819
|
+
type: "boolean"
|
|
1820
|
+
}).option("cache", {
|
|
1821
|
+
alias: "c",
|
|
1822
|
+
default: false,
|
|
1823
|
+
description: "Use caching for performance",
|
|
1824
|
+
type: "boolean"
|
|
1825
|
+
});
|
|
1826
|
+
},
|
|
1827
|
+
(argv) => {
|
|
1828
|
+
if (argv.verbose) console.log("Lint");
|
|
1829
|
+
const start = Date.now();
|
|
1830
|
+
process.exitCode = argv.fix ? fix({ pkg: argv.package, cache: argv.cache }) : lint({ pkg: argv.package, cache: argv.cache });
|
|
1831
|
+
console.log(chalk24.blue(`Finished in ${Date.now() - start}ms`));
|
|
1832
|
+
}
|
|
1833
|
+
).command(
|
|
1834
|
+
"deplint [package]",
|
|
1835
|
+
"Deplint - Run Deplint",
|
|
1836
|
+
(yargs2) => {
|
|
1837
|
+
return packagePositionalParam(yargs2).option("deps", {
|
|
1838
|
+
alias: "d",
|
|
1839
|
+
default: false,
|
|
1840
|
+
description: "Check dependencies",
|
|
1841
|
+
type: "boolean"
|
|
1842
|
+
}).option("devDeps", {
|
|
1843
|
+
alias: "v",
|
|
1844
|
+
default: false,
|
|
1845
|
+
description: "Check devDependencies",
|
|
1846
|
+
type: "boolean"
|
|
1847
|
+
}).option("peerDeps", {
|
|
1848
|
+
alias: "p",
|
|
1849
|
+
default: false,
|
|
1850
|
+
description: "Check peerDependencies",
|
|
1851
|
+
type: "boolean"
|
|
1852
|
+
});
|
|
1853
|
+
},
|
|
1854
|
+
(argv) => {
|
|
1855
|
+
if (argv.verbose) console.log("Deplint");
|
|
1856
|
+
const start = Date.now();
|
|
1857
|
+
process.exitCode = deplint({
|
|
1858
|
+
pkg: argv.package,
|
|
1859
|
+
deps: !!argv.deps,
|
|
1860
|
+
devDeps: !!argv.devDeps,
|
|
1861
|
+
peerDeps: !!argv.peerDeps,
|
|
1862
|
+
verbose: !!argv.verbose
|
|
1863
|
+
});
|
|
1864
|
+
console.log(chalk24.blue(`Finished in ${Date.now() - start}ms`));
|
|
1865
|
+
}
|
|
1866
|
+
).command(
|
|
1867
|
+
"fix [package]",
|
|
1868
|
+
"Fix - Run Eslint w/fix",
|
|
1869
|
+
(yargs2) => {
|
|
1870
|
+
return packagePositionalParam(yargs2);
|
|
1871
|
+
},
|
|
1872
|
+
(argv) => {
|
|
1873
|
+
const start = Date.now();
|
|
1874
|
+
if (argv.verbose) console.log("Fix");
|
|
1875
|
+
process.exitCode = fix();
|
|
1876
|
+
console.log(chalk24.blue(`Finished in ${Date.now() - start}ms`));
|
|
1877
|
+
}
|
|
1878
|
+
).command(
|
|
1879
|
+
"relint [package]",
|
|
1880
|
+
"Relint - Clean & Lint",
|
|
1881
|
+
(yargs2) => {
|
|
1882
|
+
return packagePositionalParam(yargs2);
|
|
1883
|
+
},
|
|
1884
|
+
(argv) => {
|
|
1885
|
+
if (argv.verbose) console.log("Relinting");
|
|
1886
|
+
const start = Date.now();
|
|
1887
|
+
process.exitCode = relint();
|
|
1888
|
+
console.log(chalk24.blue(`Finished in ${Date.now() - start}ms`));
|
|
1889
|
+
}
|
|
1890
|
+
).command(
|
|
1891
|
+
"publint [package]",
|
|
1892
|
+
"Publint - Run Publint",
|
|
1893
|
+
(yargs2) => {
|
|
1894
|
+
return packagePositionalParam(yargs2);
|
|
1895
|
+
},
|
|
1896
|
+
async (argv) => {
|
|
1897
|
+
if (argv.verbose) console.log("Publint");
|
|
1898
|
+
const start = Date.now();
|
|
1899
|
+
process.exitCode = await publint({ pkg: argv.package, verbose: !!argv.verbose });
|
|
1900
|
+
console.log(chalk24.blue(`Finished in ${Date.now() - start}ms`));
|
|
1901
|
+
}
|
|
1902
|
+
).command(
|
|
1903
|
+
"knip",
|
|
1904
|
+
"Knip - Run Knip",
|
|
1905
|
+
(yargs2) => {
|
|
1906
|
+
return packagePositionalParam(yargs2);
|
|
1907
|
+
},
|
|
1908
|
+
(argv) => {
|
|
1909
|
+
if (argv.verbose) console.log("Knip");
|
|
1910
|
+
const start = Date.now();
|
|
1911
|
+
process.exitCode = knip();
|
|
1912
|
+
console.log(chalk24.blue(`Knip finished in ${Date.now() - start}ms`));
|
|
1913
|
+
}
|
|
1914
|
+
).command(
|
|
1915
|
+
"sonar",
|
|
1916
|
+
"Sonar - Run Sonar Check",
|
|
1917
|
+
(yargs2) => {
|
|
1918
|
+
return packagePositionalParam(yargs2);
|
|
1919
|
+
},
|
|
1920
|
+
(argv) => {
|
|
1921
|
+
const start = Date.now();
|
|
1922
|
+
if (argv.verbose) console.log("Sonar Check");
|
|
1923
|
+
process.exitCode = sonar();
|
|
1924
|
+
console.log(chalk24.blue(`Finished in ${Date.now() - start}ms`));
|
|
1925
|
+
}
|
|
1926
|
+
);
|
|
1927
|
+
};
|
|
2263
1928
|
|
|
2264
1929
|
// src/xy/xyParseOptions.ts
|
|
2265
1930
|
import yargs from "yargs";
|
|
2266
1931
|
import { hideBin } from "yargs/helpers";
|
|
2267
|
-
var xyParseOptions =
|
|
1932
|
+
var xyParseOptions = () => {
|
|
2268
1933
|
return yargs(hideBin(process.argv)).scriptName("yarn xy").option("jobs", {
|
|
2269
1934
|
alias: "j",
|
|
2270
1935
|
default: void 0,
|
|
@@ -2286,16 +1951,16 @@ var xyParseOptions = /* @__PURE__ */ __name(() => {
|
|
|
2286
1951
|
description: "Profile action",
|
|
2287
1952
|
type: "boolean"
|
|
2288
1953
|
});
|
|
2289
|
-
}
|
|
1954
|
+
};
|
|
2290
1955
|
|
|
2291
1956
|
// src/xy/xy.ts
|
|
2292
|
-
var xy =
|
|
1957
|
+
var xy = async () => {
|
|
2293
1958
|
const options = xyParseOptions();
|
|
2294
1959
|
return await xyBuildCommands(xyCommonCommands(xyInstallCommands(xyDeployCommands(xyLintCommands(options))))).demandCommand(1).command("*", "", () => {
|
|
2295
1960
|
console.error(chalk25.yellow(`Command not found [${chalk25.magenta(process.argv[2])}]`));
|
|
2296
1961
|
console.log(chalk25.gray("Try 'yarn xy --help' for list of commands"));
|
|
2297
1962
|
}).version().help().argv;
|
|
2298
|
-
}
|
|
1963
|
+
};
|
|
2299
1964
|
export {
|
|
2300
1965
|
xy,
|
|
2301
1966
|
xyBuildCommands,
|