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