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