@xylabs/ts-scripts-yarn3 6.3.4 → 6.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/actions/build.mjs +39 -87
- package/dist/actions/build.mjs.map +1 -1
- package/dist/actions/clean-docs.mjs +8 -22
- package/dist/actions/clean-docs.mjs.map +1 -1
- package/dist/actions/clean-eslint.mjs +5 -11
- package/dist/actions/clean-eslint.mjs.map +1 -1
- package/dist/actions/clean-jest.mjs +16 -29
- package/dist/actions/clean-jest.mjs.map +1 -1
- package/dist/actions/clean.mjs +32 -63
- package/dist/actions/clean.mjs.map +1 -1
- package/dist/actions/compile-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 +191 -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 -50
- 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 +860 -1237
- 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 -44
- 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 +1082 -1233
- package/dist/bin/xy.mjs.map +1 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.mjs +1334 -1579
- 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 +1082 -1234
- 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 +1082 -1234
- 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 +409 -288
- 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 +5 -24
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,243 +650,299 @@ 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
|
+
}) {
|
|
750
|
+
const { prodSourceFiles, devSourceFiles } = findFiles(location);
|
|
751
|
+
const {
|
|
752
|
+
prodImportPaths,
|
|
753
|
+
devImportPaths,
|
|
754
|
+
externalProdImports,
|
|
755
|
+
externalDevImports
|
|
756
|
+
} = getExternalImportsFromFiles({ prodSourceFiles, devSourceFiles });
|
|
757
|
+
const {
|
|
758
|
+
dependencies,
|
|
759
|
+
devDependencies,
|
|
760
|
+
peerDependencies
|
|
761
|
+
} = getDependenciesFromPackageJson(`${location}/package.json`);
|
|
762
|
+
let unlistedDependencies = 0;
|
|
763
|
+
let unlistedDevDependencies = 0;
|
|
764
|
+
for (const imp of externalProdImports) {
|
|
765
|
+
if (!dependencies.includes(imp) && !peerDependencies.includes(imp)) {
|
|
766
|
+
unlistedDependencies++;
|
|
767
|
+
console.log(`[${chalk12.blue(name)}] Missing dependency in package.json: ${chalk12.red(imp)}`);
|
|
768
|
+
console.log(` ${prodImportPaths[imp].join("\n")}`);
|
|
769
|
+
console.log("");
|
|
770
|
+
}
|
|
771
|
+
}
|
|
772
|
+
for (const dep of dependencies) {
|
|
773
|
+
if (!externalProdImports.includes(dep)) {
|
|
774
|
+
unlistedDependencies++;
|
|
775
|
+
console.log(`[${chalk12.blue(name)}] Unused dependency in package.json: ${chalk12.red(dep)}`);
|
|
776
|
+
console.log(` ${location}/package.json
|
|
777
|
+
`);
|
|
778
|
+
console.log("");
|
|
779
|
+
}
|
|
780
|
+
}
|
|
781
|
+
for (const dep of peerDependencies) {
|
|
782
|
+
if (!externalProdImports.includes(dep)) {
|
|
783
|
+
unlistedDependencies++;
|
|
784
|
+
console.log(`[${chalk12.blue(name)}] Unused peerDependency in package.json: ${chalk12.red(dep)}`);
|
|
785
|
+
console.log(` ${location}/package.json
|
|
786
|
+
`);
|
|
787
|
+
console.log("");
|
|
788
|
+
}
|
|
789
|
+
}
|
|
790
|
+
if (devDeps) {
|
|
791
|
+
for (const imp of externalDevImports) {
|
|
792
|
+
if (!devDependencies.includes(imp)) {
|
|
793
|
+
unlistedDevDependencies++;
|
|
794
|
+
console.log(`[${chalk12.blue(name)}] Missing devDependency in package.json: ${chalk12.red(imp)}`);
|
|
795
|
+
console.log(` Found in: ${devImportPaths[imp].join(", ")}`);
|
|
796
|
+
}
|
|
797
|
+
}
|
|
798
|
+
}
|
|
799
|
+
const totalErrors = unlistedDependencies + unlistedDevDependencies;
|
|
800
|
+
return totalErrors;
|
|
801
|
+
}
|
|
802
|
+
var deplint = ({ pkg }) => {
|
|
803
|
+
if (pkg) {
|
|
804
|
+
const { location, name } = yarnWorkspace(pkg);
|
|
805
|
+
console.log(`Running Deplint for ${name}`);
|
|
806
|
+
check({
|
|
807
|
+
name,
|
|
808
|
+
location,
|
|
809
|
+
devDeps: true
|
|
810
|
+
});
|
|
811
|
+
} else {
|
|
812
|
+
const workspaces = yarnWorkspaces();
|
|
813
|
+
console.log("Deplint Started...");
|
|
814
|
+
let totalErrors = 0;
|
|
815
|
+
for (const workspace of workspaces) {
|
|
816
|
+
totalErrors += check(workspace);
|
|
817
|
+
}
|
|
818
|
+
if (totalErrors > 0) {
|
|
819
|
+
console.log(`Found ${chalk12.red(totalErrors)} unlisted imports.`);
|
|
820
|
+
} else {
|
|
821
|
+
console.log(`No unlisted imports found. ${chalk12.green("\u2714")}`);
|
|
822
|
+
}
|
|
823
|
+
}
|
|
824
|
+
return 0;
|
|
825
|
+
};
|
|
845
826
|
|
|
846
827
|
// src/actions/deploy.ts
|
|
847
|
-
var deploy =
|
|
828
|
+
var deploy = () => {
|
|
848
829
|
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
|
-
]
|
|
830
|
+
["yarn", "workspaces foreach --all version patch --deferred"],
|
|
831
|
+
["yarn", "xy clean"],
|
|
832
|
+
["yarn", "xy build"],
|
|
833
|
+
["yarn", "version apply --all"],
|
|
834
|
+
["yarn", "workspaces foreach --all --parallel npm publish"]
|
|
869
835
|
]);
|
|
870
|
-
}
|
|
836
|
+
};
|
|
871
837
|
|
|
872
838
|
// src/actions/deploy-major.ts
|
|
873
|
-
var deployMajor =
|
|
839
|
+
var deployMajor = () => {
|
|
874
840
|
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
|
-
]
|
|
841
|
+
["yarn", "workspaces foreach --all version major --deferred"],
|
|
842
|
+
["yarn", "xy clean"],
|
|
843
|
+
["yarn", "xy build"],
|
|
844
|
+
["yarn", "version apply --all"],
|
|
845
|
+
["yarn", "workspaces foreach --all --parallel npm publish"]
|
|
895
846
|
]);
|
|
896
|
-
}
|
|
847
|
+
};
|
|
897
848
|
|
|
898
849
|
// src/actions/deploy-minor.ts
|
|
899
|
-
var deployMinor =
|
|
850
|
+
var deployMinor = () => {
|
|
900
851
|
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
|
-
]
|
|
852
|
+
["yarn", "workspaces foreach --all version minor --deferred"],
|
|
853
|
+
["yarn", "xy clean"],
|
|
854
|
+
["yarn", "xy build"],
|
|
855
|
+
["yarn", "version apply --all"],
|
|
856
|
+
["yarn", "workspaces foreach --all --parallel npm publish"]
|
|
921
857
|
]);
|
|
922
|
-
}
|
|
858
|
+
};
|
|
923
859
|
|
|
924
860
|
// src/actions/deploy-next.ts
|
|
925
|
-
var deployNext =
|
|
861
|
+
var deployNext = () => {
|
|
926
862
|
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
|
-
]
|
|
863
|
+
["yarn", "workspaces foreach --all version minor --deferred"],
|
|
864
|
+
["yarn", "xy clean"],
|
|
865
|
+
["yarn", "xy build"],
|
|
866
|
+
["yarn", "version apply --all --prerelease"],
|
|
867
|
+
["yarn", "workspaces foreach --all --parallel npm publish --tag next"]
|
|
947
868
|
]);
|
|
948
|
-
}
|
|
869
|
+
};
|
|
949
870
|
|
|
950
871
|
// src/actions/dupdeps.ts
|
|
951
|
-
import
|
|
952
|
-
var dupdeps =
|
|
953
|
-
console.log(
|
|
872
|
+
import chalk13 from "chalk";
|
|
873
|
+
var dupdeps = () => {
|
|
874
|
+
console.log(chalk13.green("Checking all Dependencies for Duplicates"));
|
|
954
875
|
const allDependencies = parsedPackageJSON()?.dependencies;
|
|
955
876
|
const dependencies = Object.entries(allDependencies).map(([k]) => k);
|
|
956
877
|
return detectDuplicateDependencies(dependencies);
|
|
957
|
-
}
|
|
878
|
+
};
|
|
958
879
|
|
|
959
880
|
// src/actions/lint.ts
|
|
960
|
-
import
|
|
961
|
-
var lintPackage =
|
|
962
|
-
console.log(
|
|
881
|
+
import chalk14 from "chalk";
|
|
882
|
+
var lintPackage = ({ pkg, fix: fix2 }) => {
|
|
883
|
+
console.log(chalk14.gray(`${fix2 ? "Fix" : "Lint"} [${pkg}]`));
|
|
963
884
|
const start = Date.now();
|
|
964
885
|
const result = runSteps(`${fix2 ? "Fix" : "Lint"} [${pkg}]`, [
|
|
965
|
-
[
|
|
966
|
-
"
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
fix2 ? "package-fix" : "package-lint"
|
|
972
|
-
]
|
|
973
|
-
]
|
|
886
|
+
["yarn", [
|
|
887
|
+
"workspace",
|
|
888
|
+
pkg,
|
|
889
|
+
"run",
|
|
890
|
+
fix2 ? "package-fix" : "package-lint"
|
|
891
|
+
]]
|
|
974
892
|
]);
|
|
975
|
-
console.log(
|
|
893
|
+
console.log(chalk14.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk14.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk14.gray("seconds")}`));
|
|
976
894
|
return result;
|
|
977
|
-
}
|
|
978
|
-
var lint =
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
895
|
+
};
|
|
896
|
+
var lint = ({
|
|
897
|
+
pkg,
|
|
898
|
+
verbose,
|
|
899
|
+
incremental,
|
|
900
|
+
fix: fix2
|
|
901
|
+
} = {}) => {
|
|
902
|
+
return pkg ? lintPackage({ pkg, fix: fix2 }) : lintAllPackages({
|
|
983
903
|
verbose,
|
|
984
904
|
incremental,
|
|
985
905
|
fix: fix2
|
|
986
906
|
});
|
|
987
|
-
}
|
|
988
|
-
var lintAllPackages =
|
|
989
|
-
console.log(
|
|
907
|
+
};
|
|
908
|
+
var lintAllPackages = ({ fix: fix2 = false } = {}) => {
|
|
909
|
+
console.log(chalk14.gray(`${fix2 ? "Fix" : "Lint"} [All-Packages]`));
|
|
990
910
|
const start = Date.now();
|
|
911
|
+
const fixOptions = fix2 ? ["--fix"] : [];
|
|
991
912
|
const result = runSteps(`${fix2 ? "Fix" : "Lint"} [All-Packages]`, [
|
|
992
|
-
[
|
|
993
|
-
"yarn",
|
|
994
|
-
[
|
|
995
|
-
"eslint"
|
|
996
|
-
]
|
|
997
|
-
]
|
|
913
|
+
["yarn", ["eslint", ...fixOptions]]
|
|
998
914
|
]);
|
|
999
|
-
console.log(
|
|
915
|
+
console.log(chalk14.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk14.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk14.gray("seconds")}`));
|
|
1000
916
|
return result;
|
|
1001
|
-
}
|
|
917
|
+
};
|
|
1002
918
|
|
|
1003
919
|
// src/actions/fix.ts
|
|
1004
|
-
var fix =
|
|
1005
|
-
return lint({
|
|
1006
|
-
|
|
1007
|
-
fix: true
|
|
1008
|
-
});
|
|
1009
|
-
}, "fix");
|
|
920
|
+
var fix = (params) => {
|
|
921
|
+
return lint({ ...params, fix: true });
|
|
922
|
+
};
|
|
1010
923
|
|
|
1011
924
|
// src/actions/gen-docs.ts
|
|
1012
|
-
var genDocs =
|
|
1013
|
-
return pkg ? genDocsPackage({
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
});
|
|
1018
|
-
}
|
|
1019
|
-
var
|
|
1020
|
-
const
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
"workspace",
|
|
1025
|
-
pkg,
|
|
1026
|
-
"run",
|
|
1027
|
-
"package-gen-docs"
|
|
1028
|
-
]
|
|
1029
|
-
]
|
|
1030
|
-
];
|
|
1031
|
-
return runSteps(`GenDocs [${pkg}]`, [
|
|
1032
|
-
...steps
|
|
1033
|
-
]);
|
|
1034
|
-
}, "genDocsPackage");
|
|
1035
|
-
var genDocsAll = /* @__PURE__ */ __name(({ incremental }) => {
|
|
1036
|
-
const incrementalOptions = incremental ? [
|
|
1037
|
-
"--since",
|
|
1038
|
-
"-pA"
|
|
1039
|
-
] : [
|
|
1040
|
-
"-pA"
|
|
1041
|
-
];
|
|
1042
|
-
const steps = [
|
|
1043
|
-
[
|
|
1044
|
-
"yarn",
|
|
1045
|
-
[
|
|
1046
|
-
"workspaces",
|
|
1047
|
-
"foreach",
|
|
1048
|
-
...incrementalOptions,
|
|
1049
|
-
"run",
|
|
1050
|
-
"package-gen-docs"
|
|
1051
|
-
]
|
|
1052
|
-
]
|
|
1053
|
-
];
|
|
1054
|
-
return runSteps(`GenDocs [All${incremental ? "-Incremental" : ""}]`, [
|
|
1055
|
-
...steps
|
|
1056
|
-
]);
|
|
1057
|
-
}, "genDocsAll");
|
|
925
|
+
var genDocs = ({ pkg, incremental }) => {
|
|
926
|
+
return pkg ? genDocsPackage({ pkg }) : genDocsAll({ incremental });
|
|
927
|
+
};
|
|
928
|
+
var genDocsPackage = ({ pkg }) => {
|
|
929
|
+
const steps = [["yarn", ["workspace", pkg, "run", "package-gen-docs"]]];
|
|
930
|
+
return runSteps(`GenDocs [${pkg}]`, [...steps]);
|
|
931
|
+
};
|
|
932
|
+
var genDocsAll = ({ incremental }) => {
|
|
933
|
+
const incrementalOptions = incremental ? ["--since", "-pA"] : ["-pA"];
|
|
934
|
+
const steps = [["yarn", ["workspaces", "foreach", ...incrementalOptions, "run", "package-gen-docs"]]];
|
|
935
|
+
return runSteps(`GenDocs [All${incremental ? "-Incremental" : ""}]`, [...steps]);
|
|
936
|
+
};
|
|
1058
937
|
|
|
1059
938
|
// src/actions/gitignore-gen.ts
|
|
1060
939
|
var filename = ".gitignore";
|
|
1061
|
-
var gitignoreGen =
|
|
940
|
+
var gitignoreGen = (pkg) => generateIgnoreFiles(filename, pkg);
|
|
1062
941
|
|
|
1063
942
|
// src/actions/gitlint.ts
|
|
1064
|
-
import
|
|
943
|
+
import chalk15 from "chalk";
|
|
1065
944
|
import ParseGitConfig from "parse-git-config";
|
|
1066
|
-
var gitlint =
|
|
945
|
+
var gitlint = () => {
|
|
1067
946
|
console.log(`
|
|
1068
947
|
Gitlint Start [${process.cwd()}]
|
|
1069
948
|
`);
|
|
@@ -1071,10 +950,10 @@ Gitlint Start [${process.cwd()}]
|
|
|
1071
950
|
let warnings = 0;
|
|
1072
951
|
const errors = 0;
|
|
1073
952
|
const gitConfig = ParseGitConfig.sync();
|
|
1074
|
-
const warn =
|
|
1075
|
-
console.warn(
|
|
953
|
+
const warn = (message) => {
|
|
954
|
+
console.warn(chalk15.yellow(`Warning: ${message}`));
|
|
1076
955
|
warnings++;
|
|
1077
|
-
}
|
|
956
|
+
};
|
|
1078
957
|
if (gitConfig.core.ignorecase) {
|
|
1079
958
|
warn("Please set core.ignorecase to FALSE in .git/config file [run yarn gitlint-fix]");
|
|
1080
959
|
} else {
|
|
@@ -1092,67 +971,52 @@ Gitlint Start [${process.cwd()}]
|
|
|
1092
971
|
}
|
|
1093
972
|
const resultMessages = [];
|
|
1094
973
|
if (valid > 0) {
|
|
1095
|
-
resultMessages.push(
|
|
974
|
+
resultMessages.push(chalk15.green(`Passed: ${valid}`));
|
|
1096
975
|
}
|
|
1097
976
|
if (warnings > 0) {
|
|
1098
|
-
resultMessages.push(
|
|
977
|
+
resultMessages.push(chalk15.yellow(`Warnings: ${warnings}`));
|
|
1099
978
|
}
|
|
1100
979
|
if (errors > 0) {
|
|
1101
|
-
resultMessages.push(
|
|
980
|
+
resultMessages.push(chalk15.red(` Errors: ${errors}`));
|
|
1102
981
|
}
|
|
1103
982
|
console.warn(`Gitlint Finish [ ${resultMessages.join(" | ")} ]
|
|
1104
983
|
`);
|
|
1105
984
|
return warnings + errors === 0 ? 1 : 0;
|
|
1106
|
-
}
|
|
985
|
+
};
|
|
1107
986
|
|
|
1108
987
|
// src/actions/gitlint-fix.ts
|
|
1109
988
|
import { execSync as execSync2 } from "node:child_process";
|
|
1110
|
-
import
|
|
989
|
+
import chalk16 from "chalk";
|
|
1111
990
|
import ParseGitConfig2 from "parse-git-config";
|
|
1112
|
-
var gitlintFix =
|
|
991
|
+
var gitlintFix = () => {
|
|
1113
992
|
console.log(`
|
|
1114
993
|
Gitlint Fix Start [${process.cwd()}]
|
|
1115
994
|
`);
|
|
1116
995
|
const gitConfig = ParseGitConfig2.sync();
|
|
1117
996
|
if (gitConfig.core.ignorecase) {
|
|
1118
|
-
execSync2("git config core.ignorecase false", {
|
|
1119
|
-
|
|
1120
|
-
});
|
|
1121
|
-
console.warn(chalk15.yellow("\nGitlint Fix: Updated core.ignorecase to be false\n"));
|
|
997
|
+
execSync2("git config core.ignorecase false", { stdio: "inherit" });
|
|
998
|
+
console.warn(chalk16.yellow("\nGitlint Fix: Updated core.ignorecase to be false\n"));
|
|
1122
999
|
}
|
|
1123
1000
|
if (gitConfig.core.autocrlf !== false) {
|
|
1124
|
-
execSync2("git config core.autocrlf false", {
|
|
1125
|
-
|
|
1126
|
-
});
|
|
1127
|
-
console.warn(chalk15.yellow("\nGitlint Fix: Updated core.autocrlf to be false\n"));
|
|
1001
|
+
execSync2("git config core.autocrlf false", { stdio: "inherit" });
|
|
1002
|
+
console.warn(chalk16.yellow("\nGitlint Fix: Updated core.autocrlf to be false\n"));
|
|
1128
1003
|
}
|
|
1129
1004
|
if (gitConfig.core.eol !== "lf") {
|
|
1130
|
-
execSync2("git config core.eol lf", {
|
|
1131
|
-
|
|
1132
|
-
});
|
|
1133
|
-
console.warn(chalk15.yellow('\nGitlint Fix: Updated core.eol to be "lf"\n'));
|
|
1005
|
+
execSync2("git config core.eol lf", { stdio: "inherit" });
|
|
1006
|
+
console.warn(chalk16.yellow('\nGitlint Fix: Updated core.eol to be "lf"\n'));
|
|
1134
1007
|
}
|
|
1135
1008
|
return 1;
|
|
1136
|
-
}
|
|
1009
|
+
};
|
|
1137
1010
|
|
|
1138
1011
|
// src/actions/knip.ts
|
|
1139
|
-
var knip =
|
|
1140
|
-
return runSteps("Knip", [
|
|
1141
|
-
|
|
1142
|
-
"yarn",
|
|
1143
|
-
[
|
|
1144
|
-
"knip",
|
|
1145
|
-
"--dependencies",
|
|
1146
|
-
"--no-exit-code"
|
|
1147
|
-
]
|
|
1148
|
-
]
|
|
1149
|
-
]);
|
|
1150
|
-
}, "knip");
|
|
1012
|
+
var knip = () => {
|
|
1013
|
+
return runSteps("Knip", [["yarn", ["knip", "--dependencies", "--no-exit-code"]]]);
|
|
1014
|
+
};
|
|
1151
1015
|
|
|
1152
1016
|
// src/actions/license.ts
|
|
1153
|
-
import
|
|
1017
|
+
import chalk17 from "chalk";
|
|
1154
1018
|
import { init } from "license-checker";
|
|
1155
|
-
var license =
|
|
1019
|
+
var license = async (pkg) => {
|
|
1156
1020
|
const workspaces = yarnWorkspaces();
|
|
1157
1021
|
const workspaceList = workspaces.filter(({ name }) => {
|
|
1158
1022
|
return pkg === void 0 || name === pkg;
|
|
@@ -1175,114 +1039,79 @@ var license = /* @__PURE__ */ __name(async (pkg) => {
|
|
|
1175
1039
|
"LGPL-3.0-or-later",
|
|
1176
1040
|
"Python-2.0"
|
|
1177
1041
|
]);
|
|
1178
|
-
console.log(
|
|
1179
|
-
return (await Promise.all(
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
production: true,
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
if (
|
|
1204
|
-
|
|
1042
|
+
console.log(chalk17.green("License Checker"));
|
|
1043
|
+
return (await Promise.all(
|
|
1044
|
+
workspaceList.map(({ location, name }) => {
|
|
1045
|
+
return new Promise((resolve) => {
|
|
1046
|
+
init({ production: true, start: location }, (error, packages) => {
|
|
1047
|
+
if (error) {
|
|
1048
|
+
console.error(chalk17.red(`License Checker [${name}] Error`));
|
|
1049
|
+
console.error(chalk17.gray(error));
|
|
1050
|
+
console.log("\n");
|
|
1051
|
+
resolve(1);
|
|
1052
|
+
} else {
|
|
1053
|
+
console.log(chalk17.green(`License Checker [${name}]`));
|
|
1054
|
+
let count = 0;
|
|
1055
|
+
for (const [name2, info] of Object.entries(packages)) {
|
|
1056
|
+
const licenses = Array.isArray(info.licenses) ? info.licenses : [info.licenses];
|
|
1057
|
+
for (let license2 of licenses) {
|
|
1058
|
+
if (license2) {
|
|
1059
|
+
const processedLicense = license2[0] === "(" && license2.at(-1) === ")" ? license2.slice(1, -2) : license2;
|
|
1060
|
+
const orLicenses = processedLicense.split(" OR ");
|
|
1061
|
+
let orLicenseFound = false;
|
|
1062
|
+
for (const orLicense of orLicenses) {
|
|
1063
|
+
if (exclude.has(orLicense)) {
|
|
1064
|
+
orLicenseFound = true;
|
|
1065
|
+
}
|
|
1066
|
+
}
|
|
1067
|
+
if (!orLicenseFound) {
|
|
1068
|
+
count++;
|
|
1069
|
+
console.warn(chalk17.yellow(`${name2}: Package License not allowed [${license2}]`));
|
|
1205
1070
|
}
|
|
1206
|
-
}
|
|
1207
|
-
if (!orLicenseFound) {
|
|
1208
|
-
count++;
|
|
1209
|
-
console.warn(chalk16.yellow(`${name2}: Package License not allowed [${license2}]`));
|
|
1210
1071
|
}
|
|
1211
1072
|
}
|
|
1212
1073
|
}
|
|
1074
|
+
console.log("\n");
|
|
1075
|
+
resolve(count);
|
|
1213
1076
|
}
|
|
1214
|
-
|
|
1215
|
-
resolve(count);
|
|
1216
|
-
}
|
|
1077
|
+
});
|
|
1217
1078
|
});
|
|
1218
|
-
})
|
|
1219
|
-
|
|
1220
|
-
}
|
|
1079
|
+
})
|
|
1080
|
+
)).reduce((prev, value) => prev || value, 0);
|
|
1081
|
+
};
|
|
1221
1082
|
|
|
1222
1083
|
// src/actions/npmignore-gen.ts
|
|
1223
1084
|
var filename2 = ".npmignore";
|
|
1224
|
-
var npmignoreGen =
|
|
1085
|
+
var npmignoreGen = (pkg) => generateIgnoreFiles(filename2, pkg);
|
|
1225
1086
|
|
|
1226
1087
|
// src/actions/publint.ts
|
|
1227
|
-
var publint =
|
|
1228
|
-
return pkg ? await publintPackage({
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
}
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
[
|
|
1238
|
-
"yarn",
|
|
1239
|
-
[
|
|
1240
|
-
"workspace",
|
|
1241
|
-
pkg,
|
|
1242
|
-
"run",
|
|
1243
|
-
"package-publint"
|
|
1244
|
-
]
|
|
1245
|
-
]
|
|
1246
|
-
]);
|
|
1247
|
-
}, "publintPackage");
|
|
1248
|
-
var publintAll = /* @__PURE__ */ __name(({ verbose }) => {
|
|
1249
|
-
const verboseOptions = verbose ? [
|
|
1250
|
-
"--verbose"
|
|
1251
|
-
] : [
|
|
1252
|
-
"--no-verbose"
|
|
1253
|
-
];
|
|
1254
|
-
return runSteps("Publint", [
|
|
1255
|
-
[
|
|
1256
|
-
"yarn",
|
|
1257
|
-
[
|
|
1258
|
-
"workspaces",
|
|
1259
|
-
"foreach",
|
|
1260
|
-
"-pA",
|
|
1261
|
-
...verboseOptions,
|
|
1262
|
-
"run",
|
|
1263
|
-
"package-publint"
|
|
1264
|
-
]
|
|
1265
|
-
]
|
|
1266
|
-
]);
|
|
1267
|
-
}, "publintAll");
|
|
1088
|
+
var publint = async ({ verbose, pkg }) => {
|
|
1089
|
+
return pkg ? await publintPackage({ pkg, verbose }) : publintAll({ verbose });
|
|
1090
|
+
};
|
|
1091
|
+
var publintPackage = ({ pkg }) => {
|
|
1092
|
+
return runStepsAsync(`Publint [${pkg}]`, [["yarn", ["workspace", pkg, "run", "package-publint"]]]);
|
|
1093
|
+
};
|
|
1094
|
+
var publintAll = ({ verbose }) => {
|
|
1095
|
+
const verboseOptions = verbose ? ["--verbose"] : ["--no-verbose"];
|
|
1096
|
+
return runSteps("Publint", [["yarn", ["workspaces", "foreach", "-pA", ...verboseOptions, "run", "package-publint"]]]);
|
|
1097
|
+
};
|
|
1268
1098
|
|
|
1269
1099
|
// src/actions/rebuild.ts
|
|
1270
|
-
var rebuild =
|
|
1100
|
+
var rebuild = ({ target }) => {
|
|
1271
1101
|
return runSteps("Rebuild", [
|
|
1272
|
-
[
|
|
1273
|
-
|
|
1274
|
-
"xy clean"
|
|
1275
|
-
],
|
|
1276
|
-
[
|
|
1277
|
-
"yarn",
|
|
1278
|
-
target ? `xy build -t ${target}` : "xy build"
|
|
1279
|
-
]
|
|
1102
|
+
["yarn", "xy clean"],
|
|
1103
|
+
["yarn", target ? `xy build -t ${target}` : "xy build"]
|
|
1280
1104
|
]);
|
|
1281
|
-
}
|
|
1105
|
+
};
|
|
1282
1106
|
|
|
1283
1107
|
// src/actions/recompile.ts
|
|
1284
|
-
import
|
|
1285
|
-
var recompile =
|
|
1108
|
+
import chalk18 from "chalk";
|
|
1109
|
+
var recompile = async ({
|
|
1110
|
+
verbose,
|
|
1111
|
+
target,
|
|
1112
|
+
pkg,
|
|
1113
|
+
incremental
|
|
1114
|
+
}) => {
|
|
1286
1115
|
return pkg ? await recompilePackage({
|
|
1287
1116
|
pkg,
|
|
1288
1117
|
target,
|
|
@@ -1292,51 +1121,27 @@ var recompile = /* @__PURE__ */ __name(async ({ verbose, target, pkg, incrementa
|
|
|
1292
1121
|
target,
|
|
1293
1122
|
verbose
|
|
1294
1123
|
});
|
|
1295
|
-
}
|
|
1296
|
-
var recompilePackage =
|
|
1297
|
-
const targetOptions = target ? [
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
...targetOptions
|
|
1310
|
-
]
|
|
1311
|
-
]
|
|
1312
|
-
]);
|
|
1313
|
-
}, "recompilePackage");
|
|
1314
|
-
var recompileAll = /* @__PURE__ */ __name(async ({ jobs, verbose, target, incremental }) => {
|
|
1124
|
+
};
|
|
1125
|
+
var recompilePackage = ({ target, pkg }) => {
|
|
1126
|
+
const targetOptions = target ? ["-t", target] : [];
|
|
1127
|
+
return runStepsAsync(
|
|
1128
|
+
`Recompile [${pkg}]`,
|
|
1129
|
+
[["yarn", ["workspace", pkg, "run", "package-recompile", ...targetOptions]]]
|
|
1130
|
+
);
|
|
1131
|
+
};
|
|
1132
|
+
var recompileAll = async ({
|
|
1133
|
+
jobs,
|
|
1134
|
+
verbose,
|
|
1135
|
+
target,
|
|
1136
|
+
incremental
|
|
1137
|
+
}) => {
|
|
1315
1138
|
const start = Date.now();
|
|
1316
|
-
const verboseOptions = verbose ? [
|
|
1317
|
-
|
|
1318
|
-
] : [
|
|
1319
|
-
|
|
1320
|
-
];
|
|
1321
|
-
const targetOptions = target ? [
|
|
1322
|
-
"-t",
|
|
1323
|
-
target
|
|
1324
|
-
] : [];
|
|
1325
|
-
const incrementalOptions = incremental ? [
|
|
1326
|
-
"--since",
|
|
1327
|
-
"-Apt",
|
|
1328
|
-
"--topological-dev"
|
|
1329
|
-
] : [
|
|
1330
|
-
"--parallel",
|
|
1331
|
-
"-Apt",
|
|
1332
|
-
"--topological-dev"
|
|
1333
|
-
];
|
|
1334
|
-
const jobsOptions = jobs ? [
|
|
1335
|
-
"-j",
|
|
1336
|
-
`${jobs}`
|
|
1337
|
-
] : [];
|
|
1139
|
+
const verboseOptions = verbose ? ["--verbose"] : ["--no-verbose"];
|
|
1140
|
+
const targetOptions = target ? ["-t", target] : [];
|
|
1141
|
+
const incrementalOptions = incremental ? ["--since", "-Apt", "--topological-dev"] : ["--parallel", "-Apt", "--topological-dev"];
|
|
1142
|
+
const jobsOptions = jobs ? ["-j", `${jobs}`] : [];
|
|
1338
1143
|
if (jobs) {
|
|
1339
|
-
console.log(
|
|
1144
|
+
console.log(chalk18.blue(`Jobs set to [${jobs}]`));
|
|
1340
1145
|
}
|
|
1341
1146
|
const result = await runStepsAsync(`Recompile${incremental ? "-Incremental" : ""} [All]`, [
|
|
1342
1147
|
[
|
|
@@ -1366,13 +1171,19 @@ var recompileAll = /* @__PURE__ */ __name(async ({ jobs, verbose, target, increm
|
|
|
1366
1171
|
]
|
|
1367
1172
|
]
|
|
1368
1173
|
]);
|
|
1369
|
-
console.log(
|
|
1174
|
+
console.log(
|
|
1175
|
+
`${chalk18.gray("Recompiled in")} [${chalk18.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk18.gray("seconds")}`
|
|
1176
|
+
);
|
|
1370
1177
|
return result;
|
|
1371
|
-
}
|
|
1178
|
+
};
|
|
1372
1179
|
|
|
1373
1180
|
// src/actions/reinstall.ts
|
|
1374
|
-
import {
|
|
1375
|
-
|
|
1181
|
+
import {
|
|
1182
|
+
closeSync,
|
|
1183
|
+
openSync,
|
|
1184
|
+
rmSync
|
|
1185
|
+
} from "node:fs";
|
|
1186
|
+
var reinstall = () => {
|
|
1376
1187
|
console.log("Reinstall [Clear Lock File]");
|
|
1377
1188
|
closeSync(openSync("./yarn.lock", "w"));
|
|
1378
1189
|
console.log("Reinstall [Clear Node Modules]");
|
|
@@ -1380,10 +1191,7 @@ var reinstall = /* @__PURE__ */ __name(() => {
|
|
|
1380
1191
|
const result = workspaces.map(({ location, name }) => {
|
|
1381
1192
|
const dist = `${location}/node_modules`;
|
|
1382
1193
|
try {
|
|
1383
|
-
rmSync(dist, {
|
|
1384
|
-
force: true,
|
|
1385
|
-
recursive: true
|
|
1386
|
-
});
|
|
1194
|
+
rmSync(dist, { force: true, recursive: true });
|
|
1387
1195
|
return 0;
|
|
1388
1196
|
} catch (ex) {
|
|
1389
1197
|
const error = ex;
|
|
@@ -1391,533 +1199,580 @@ var reinstall = /* @__PURE__ */ __name(() => {
|
|
|
1391
1199
|
return 1;
|
|
1392
1200
|
}
|
|
1393
1201
|
}).reduce((prev, result2) => prev || result2, 0);
|
|
1394
|
-
return result || runSteps("Reinstall", [
|
|
1395
|
-
|
|
1396
|
-
"yarn",
|
|
1397
|
-
"install --network-timeout 10000"
|
|
1398
|
-
]
|
|
1399
|
-
]);
|
|
1400
|
-
}, "reinstall");
|
|
1202
|
+
return result || runSteps("Reinstall", [["yarn", "install --network-timeout 10000"]]);
|
|
1203
|
+
};
|
|
1401
1204
|
|
|
1402
1205
|
// src/actions/relint.ts
|
|
1403
|
-
import
|
|
1404
|
-
var relintPackage =
|
|
1405
|
-
console.log(
|
|
1206
|
+
import chalk19 from "chalk";
|
|
1207
|
+
var relintPackage = ({ pkg }) => {
|
|
1208
|
+
console.log(chalk19.gray(`${"Relint"} [All-Packages]`));
|
|
1406
1209
|
const start = Date.now();
|
|
1407
1210
|
const result = runSteps("Relint [All-Packages]", [
|
|
1408
|
-
[
|
|
1409
|
-
"
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
"package-relint"
|
|
1415
|
-
]
|
|
1416
|
-
]
|
|
1211
|
+
["yarn", [
|
|
1212
|
+
"workspace",
|
|
1213
|
+
pkg,
|
|
1214
|
+
"run",
|
|
1215
|
+
"package-relint"
|
|
1216
|
+
]]
|
|
1417
1217
|
]);
|
|
1418
|
-
console.log(
|
|
1218
|
+
console.log(chalk19.gray(`${"Relinted in"} [${chalk19.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk19.gray("seconds")}`));
|
|
1419
1219
|
return result;
|
|
1420
|
-
}
|
|
1421
|
-
var relint =
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
console.log(chalk18.gray(`${"Relint"} [All-Packages]`));
|
|
1220
|
+
};
|
|
1221
|
+
var relint = ({
|
|
1222
|
+
pkg,
|
|
1223
|
+
verbose,
|
|
1224
|
+
incremental
|
|
1225
|
+
} = {}) => {
|
|
1226
|
+
return pkg ? relintPackage({ pkg }) : relintAllPackages({ verbose, incremental });
|
|
1227
|
+
};
|
|
1228
|
+
var relintAllPackages = ({ verbose = true, incremental } = {}) => {
|
|
1229
|
+
console.log(chalk19.gray(`${"Relint"} [All-Packages]`));
|
|
1431
1230
|
const start = Date.now();
|
|
1432
|
-
const verboseOptions = verbose ? [
|
|
1433
|
-
|
|
1434
|
-
] : [
|
|
1435
|
-
"--no-verbose"
|
|
1436
|
-
];
|
|
1437
|
-
const incrementalOptions = incremental ? [
|
|
1438
|
-
"--since",
|
|
1439
|
-
"-Ap"
|
|
1440
|
-
] : [
|
|
1441
|
-
"--parallel",
|
|
1442
|
-
"-Ap"
|
|
1443
|
-
];
|
|
1231
|
+
const verboseOptions = verbose ? ["--verbose"] : ["--no-verbose"];
|
|
1232
|
+
const incrementalOptions = incremental ? ["--since", "-Ap"] : ["--parallel", "-Ap"];
|
|
1444
1233
|
const result = runSteps(`${"Relint"} [All-Packages]`, [
|
|
1445
|
-
[
|
|
1446
|
-
"
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
"package-relint"
|
|
1454
|
-
]
|
|
1455
|
-
]
|
|
1234
|
+
["yarn", [
|
|
1235
|
+
"workspaces",
|
|
1236
|
+
"foreach",
|
|
1237
|
+
...verboseOptions,
|
|
1238
|
+
...incrementalOptions,
|
|
1239
|
+
"run",
|
|
1240
|
+
"package-relint"
|
|
1241
|
+
]]
|
|
1456
1242
|
]);
|
|
1457
|
-
console.log(
|
|
1243
|
+
console.log(chalk19.gray(`Relinted in [${chalk19.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk19.gray("seconds")}`));
|
|
1458
1244
|
return result;
|
|
1459
|
-
}
|
|
1245
|
+
};
|
|
1460
1246
|
|
|
1461
1247
|
// src/actions/retest.ts
|
|
1462
|
-
var retest =
|
|
1248
|
+
var retest = () => {
|
|
1463
1249
|
return runSteps("Test", [
|
|
1464
|
-
[
|
|
1465
|
-
|
|
1466
|
-
[
|
|
1467
|
-
"jest",
|
|
1468
|
-
"--clearCache"
|
|
1469
|
-
]
|
|
1470
|
-
],
|
|
1471
|
-
[
|
|
1472
|
-
"yarn",
|
|
1473
|
-
[
|
|
1474
|
-
"jest",
|
|
1475
|
-
"."
|
|
1476
|
-
]
|
|
1477
|
-
]
|
|
1250
|
+
["yarn", ["jest", "--clearCache"]],
|
|
1251
|
+
["yarn", ["jest", "."]]
|
|
1478
1252
|
]);
|
|
1479
|
-
}
|
|
1253
|
+
};
|
|
1480
1254
|
|
|
1481
1255
|
// src/actions/sonar.ts
|
|
1482
|
-
var sonar =
|
|
1483
|
-
return runSteps("Sonar", [
|
|
1484
|
-
|
|
1485
|
-
"yarn",
|
|
1486
|
-
[
|
|
1487
|
-
"eslint",
|
|
1488
|
-
"-c",
|
|
1489
|
-
"sonar.eslintrc",
|
|
1490
|
-
"."
|
|
1491
|
-
]
|
|
1492
|
-
]
|
|
1493
|
-
]);
|
|
1494
|
-
}, "sonar");
|
|
1256
|
+
var sonar = () => {
|
|
1257
|
+
return runSteps("Sonar", [["yarn", ["eslint", "-c", "sonar.eslintrc", "."]]]);
|
|
1258
|
+
};
|
|
1495
1259
|
|
|
1496
1260
|
// src/actions/statics.ts
|
|
1497
|
-
import
|
|
1498
|
-
var DefaultDependencies = [
|
|
1499
|
-
|
|
1500
|
-
"
|
|
1501
|
-
"react",
|
|
1502
|
-
"graphql",
|
|
1503
|
-
"react-router",
|
|
1504
|
-
"@mui/material",
|
|
1505
|
-
"@mui/system"
|
|
1506
|
-
];
|
|
1507
|
-
var statics = /* @__PURE__ */ __name(() => {
|
|
1508
|
-
console.log(chalk19.green("Check Required Static Dependencies"));
|
|
1261
|
+
import chalk20 from "chalk";
|
|
1262
|
+
var DefaultDependencies = ["axios", "@xylabs/pixel", "react", "graphql", "react-router", "@mui/material", "@mui/system"];
|
|
1263
|
+
var statics = () => {
|
|
1264
|
+
console.log(chalk20.green("Check Required Static Dependencies"));
|
|
1509
1265
|
const statics2 = parsedPackageJSON()?.xy?.deps?.statics;
|
|
1510
1266
|
return detectDuplicateDependencies(statics2, DefaultDependencies);
|
|
1511
|
-
}
|
|
1267
|
+
};
|
|
1512
1268
|
|
|
1513
1269
|
// src/actions/test.ts
|
|
1514
|
-
var test =
|
|
1515
|
-
return runSteps("Test", [
|
|
1516
|
-
|
|
1517
|
-
"yarn",
|
|
1518
|
-
[
|
|
1519
|
-
"vitest",
|
|
1520
|
-
"."
|
|
1521
|
-
]
|
|
1522
|
-
]
|
|
1523
|
-
]);
|
|
1524
|
-
}, "test");
|
|
1270
|
+
var test = () => {
|
|
1271
|
+
return runSteps("Test", [["yarn", ["vitest", "."]]]);
|
|
1272
|
+
};
|
|
1525
1273
|
|
|
1526
1274
|
// src/actions/up.ts
|
|
1527
|
-
var up =
|
|
1528
|
-
return runSteps("Up", [
|
|
1529
|
-
|
|
1530
|
-
"yarn",
|
|
1531
|
-
"outdated"
|
|
1532
|
-
]
|
|
1533
|
-
]);
|
|
1534
|
-
}, "up");
|
|
1275
|
+
var up = () => {
|
|
1276
|
+
return runSteps("Up", [["yarn", "outdated"]]);
|
|
1277
|
+
};
|
|
1535
1278
|
|
|
1536
1279
|
// src/actions/updo.ts
|
|
1537
|
-
var updo =
|
|
1280
|
+
var updo = () => {
|
|
1538
1281
|
return runSteps("Updo", [
|
|
1539
|
-
[
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
],
|
|
1543
|
-
[
|
|
1544
|
-
"yarn",
|
|
1545
|
-
"upgrade-interactive"
|
|
1546
|
-
],
|
|
1547
|
-
[
|
|
1548
|
-
"yarn",
|
|
1549
|
-
"dedupe"
|
|
1550
|
-
]
|
|
1282
|
+
["yarn", "install"],
|
|
1283
|
+
["yarn", "upgrade-interactive"],
|
|
1284
|
+
["yarn", "dedupe"]
|
|
1551
1285
|
]);
|
|
1552
|
-
}
|
|
1286
|
+
};
|
|
1553
1287
|
|
|
1554
1288
|
// src/actions/upplug.ts
|
|
1555
|
-
var updateYarnPlugins =
|
|
1289
|
+
var updateYarnPlugins = () => {
|
|
1556
1290
|
return runSteps("Update Yarn Plugins", [
|
|
1557
|
-
[
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
"import",
|
|
1562
|
-
"https://mskelton.dev/yarn-outdated/v3"
|
|
1563
|
-
]
|
|
1564
|
-
],
|
|
1565
|
-
[
|
|
1566
|
-
"yarn",
|
|
1567
|
-
[
|
|
1568
|
-
"plugin",
|
|
1569
|
-
"import",
|
|
1570
|
-
"version"
|
|
1571
|
-
]
|
|
1572
|
-
],
|
|
1573
|
-
[
|
|
1574
|
-
"yarn",
|
|
1575
|
-
[
|
|
1576
|
-
"plugin",
|
|
1577
|
-
"import",
|
|
1578
|
-
"interactive-tools"
|
|
1579
|
-
]
|
|
1580
|
-
],
|
|
1581
|
-
[
|
|
1582
|
-
"yarn",
|
|
1583
|
-
[
|
|
1584
|
-
"plugin",
|
|
1585
|
-
"import",
|
|
1586
|
-
"workspace-tools"
|
|
1587
|
-
]
|
|
1588
|
-
]
|
|
1291
|
+
["yarn", ["plugin", "import", "https://mskelton.dev/yarn-outdated/v3"]],
|
|
1292
|
+
["yarn", ["plugin", "import", "version"]],
|
|
1293
|
+
["yarn", ["plugin", "import", "interactive-tools"]],
|
|
1294
|
+
["yarn", ["plugin", "import", "workspace-tools"]]
|
|
1589
1295
|
]);
|
|
1590
|
-
}
|
|
1296
|
+
};
|
|
1591
1297
|
|
|
1592
1298
|
// src/actions/upyarn.ts
|
|
1593
|
-
var updateYarnVersion =
|
|
1594
|
-
return runSteps("Update Yarn Version", [
|
|
1595
|
-
|
|
1596
|
-
"yarn",
|
|
1597
|
-
[
|
|
1598
|
-
"set",
|
|
1599
|
-
"version",
|
|
1600
|
-
"latest"
|
|
1601
|
-
]
|
|
1602
|
-
]
|
|
1603
|
-
]);
|
|
1604
|
-
}, "updateYarnVersion");
|
|
1299
|
+
var updateYarnVersion = () => {
|
|
1300
|
+
return runSteps("Update Yarn Version", [["yarn", ["set", "version", "latest"]]]);
|
|
1301
|
+
};
|
|
1605
1302
|
|
|
1606
1303
|
// src/actions/yarn3only.ts
|
|
1607
|
-
var yarn3Only =
|
|
1304
|
+
var yarn3Only = () => {
|
|
1608
1305
|
const [valid, version] = isYarnVersionOrGreater(3);
|
|
1609
1306
|
if (!valid) {
|
|
1610
1307
|
processEx(`Invalid Yarn version [${version}]`);
|
|
1611
1308
|
}
|
|
1612
1309
|
return 0;
|
|
1613
|
-
}
|
|
1310
|
+
};
|
|
1614
1311
|
|
|
1615
1312
|
// src/xy/xyBuildCommands.ts
|
|
1616
|
-
var xyBuildCommands =
|
|
1617
|
-
return args.command(
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1313
|
+
var xyBuildCommands = (args) => {
|
|
1314
|
+
return args.command(
|
|
1315
|
+
"build [package]",
|
|
1316
|
+
"Build - Compile & Lint",
|
|
1317
|
+
(yargs2) => {
|
|
1318
|
+
return yargs2.positional("package", { describe: "Specific package to build" });
|
|
1319
|
+
},
|
|
1320
|
+
async (argv) => {
|
|
1321
|
+
if (argv.verbose) {
|
|
1322
|
+
console.log(`Building: ${argv.package ?? "all"}`);
|
|
1323
|
+
}
|
|
1324
|
+
process.exitCode = await build({
|
|
1325
|
+
incremental: !!argv.incremental,
|
|
1326
|
+
jobs: argv.jobs,
|
|
1327
|
+
pkg: argv.package,
|
|
1328
|
+
target: argv.target,
|
|
1329
|
+
verbose: !!argv.verbose
|
|
1330
|
+
});
|
|
1624
1331
|
}
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1332
|
+
).command(
|
|
1333
|
+
"compile [package]",
|
|
1334
|
+
"Compile with Typescript & Copy Images",
|
|
1335
|
+
(yargs2) => {
|
|
1336
|
+
return yargs2.positional("package", { describe: "Specific package to compile" });
|
|
1337
|
+
},
|
|
1338
|
+
(argv) => {
|
|
1339
|
+
if (argv.verbose) {
|
|
1340
|
+
console.log(`Compiling: ${argv.package ?? "all"}`);
|
|
1341
|
+
}
|
|
1342
|
+
process.exitCode = compile({
|
|
1343
|
+
incremental: !!argv.incremental,
|
|
1344
|
+
jobs: argv.jobs,
|
|
1345
|
+
pkg: argv.package,
|
|
1346
|
+
target: argv.target,
|
|
1347
|
+
verbose: !!argv.verbose
|
|
1348
|
+
});
|
|
1639
1349
|
}
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1350
|
+
).command(
|
|
1351
|
+
"compile-types [package]",
|
|
1352
|
+
"Compile types with Typescript",
|
|
1353
|
+
(yargs2) => {
|
|
1354
|
+
return yargs2.positional("package", { describe: "Specific package to compile" });
|
|
1355
|
+
},
|
|
1356
|
+
(argv) => {
|
|
1357
|
+
if (argv.verbose) {
|
|
1358
|
+
console.log(`Compiling: ${argv.package ?? "all"}`);
|
|
1359
|
+
}
|
|
1360
|
+
process.exitCode = compileTypes({
|
|
1361
|
+
incremental: !!argv.incremental,
|
|
1362
|
+
jobs: argv.jobs,
|
|
1363
|
+
pkg: argv.package,
|
|
1364
|
+
verbose: !!argv.verbose
|
|
1365
|
+
});
|
|
1654
1366
|
}
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
}
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1367
|
+
).command(
|
|
1368
|
+
"compile-only [package]",
|
|
1369
|
+
"Compile with Typescript & Copy Images (No Publint)",
|
|
1370
|
+
(yargs2) => {
|
|
1371
|
+
return yargs2.positional("package", { describe: "Specific package to compile" });
|
|
1372
|
+
},
|
|
1373
|
+
(argv) => {
|
|
1374
|
+
if (argv.verbose) {
|
|
1375
|
+
console.log(`Compiling: ${argv.package ?? "all"}`);
|
|
1376
|
+
}
|
|
1377
|
+
process.exitCode = compile({
|
|
1378
|
+
incremental: !!argv.incremental,
|
|
1379
|
+
jobs: argv.jobs,
|
|
1380
|
+
pkg: argv.package,
|
|
1381
|
+
publint: false,
|
|
1382
|
+
target: argv.target,
|
|
1383
|
+
verbose: !!argv.verbose
|
|
1384
|
+
});
|
|
1668
1385
|
}
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1386
|
+
).command(
|
|
1387
|
+
"recompile [package]",
|
|
1388
|
+
"Re-compile with Typescript & Copy Images",
|
|
1389
|
+
(yargs2) => {
|
|
1390
|
+
return yargs2.positional("package", { describe: "Specific package to re-compile" });
|
|
1391
|
+
},
|
|
1392
|
+
async (argv) => {
|
|
1393
|
+
if (argv.verbose) {
|
|
1394
|
+
console.log(`Re-compiling: ${argv.package ?? "all"}`);
|
|
1395
|
+
}
|
|
1396
|
+
process.exitCode = await recompile({
|
|
1397
|
+
incremental: !!argv.incremental,
|
|
1398
|
+
jobs: argv.jobs,
|
|
1399
|
+
pkg: argv.package,
|
|
1400
|
+
target: argv.target,
|
|
1401
|
+
verbose: !!argv.verbose
|
|
1402
|
+
});
|
|
1684
1403
|
}
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
}
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
}
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
process.exitCode = await copyAssets({
|
|
1708
|
-
target: argv.target
|
|
1709
|
-
});
|
|
1710
|
-
});
|
|
1711
|
-
}, "xyBuildCommands");
|
|
1404
|
+
).command(
|
|
1405
|
+
"rebuild [package]",
|
|
1406
|
+
"Rebuild - Clean, Compile & Lint",
|
|
1407
|
+
(yargs2) => {
|
|
1408
|
+
return yargs2.positional("package", { describe: "Specific package to rebuild" });
|
|
1409
|
+
},
|
|
1410
|
+
(argv) => {
|
|
1411
|
+
if (argv.verbose) console.log(`Rebuilding: ${argv.package ?? "all"}`);
|
|
1412
|
+
process.exitCode = rebuild({ target: argv.target });
|
|
1413
|
+
}
|
|
1414
|
+
).command(
|
|
1415
|
+
"copy-assets [package]",
|
|
1416
|
+
"Copy Assets - Copy the assets from src to dist",
|
|
1417
|
+
(yargs2) => {
|
|
1418
|
+
return yargs2.positional("package", { describe: "Specific package to copy assets" });
|
|
1419
|
+
},
|
|
1420
|
+
async (argv) => {
|
|
1421
|
+
if (argv.verbose) console.log(`Copying Assets: ${argv.package ?? "all"}`);
|
|
1422
|
+
process.exitCode = await copyAssets({ target: argv.target });
|
|
1423
|
+
}
|
|
1424
|
+
);
|
|
1425
|
+
};
|
|
1712
1426
|
|
|
1713
1427
|
// src/xy/param.ts
|
|
1714
|
-
var packagePositionalParam =
|
|
1715
|
-
return yargs2.positional("package", {
|
|
1716
|
-
|
|
1717
|
-
});
|
|
1718
|
-
}, "packagePositionalParam");
|
|
1428
|
+
var packagePositionalParam = (yargs2) => {
|
|
1429
|
+
return yargs2.positional("package", { describe: "Specific package to target" });
|
|
1430
|
+
};
|
|
1719
1431
|
|
|
1720
1432
|
// src/xy/xyCommonCommands.ts
|
|
1721
|
-
var xyCommonCommands =
|
|
1722
|
-
return args.command(
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
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
|
-
|
|
1433
|
+
var xyCommonCommands = (args) => {
|
|
1434
|
+
return args.command(
|
|
1435
|
+
"license [package]",
|
|
1436
|
+
"License - Check licenses of dependencies",
|
|
1437
|
+
(yargs2) => {
|
|
1438
|
+
return packagePositionalParam(yargs2);
|
|
1439
|
+
},
|
|
1440
|
+
async (argv) => {
|
|
1441
|
+
if (argv.verbose) console.log(`License: ${argv.package ?? "all"}`);
|
|
1442
|
+
process.exitCode = await license();
|
|
1443
|
+
}
|
|
1444
|
+
).command(
|
|
1445
|
+
"dead [package]",
|
|
1446
|
+
"Dead - Check for dead code",
|
|
1447
|
+
(yargs2) => {
|
|
1448
|
+
return packagePositionalParam(yargs2);
|
|
1449
|
+
},
|
|
1450
|
+
(argv) => {
|
|
1451
|
+
if (argv.verbose) console.log("Dead");
|
|
1452
|
+
process.exitCode = dead();
|
|
1453
|
+
}
|
|
1454
|
+
).command(
|
|
1455
|
+
"gen-docs [package]",
|
|
1456
|
+
"GenDocs - Generate TypeDocs",
|
|
1457
|
+
(yargs2) => {
|
|
1458
|
+
return packagePositionalParam(yargs2);
|
|
1459
|
+
},
|
|
1460
|
+
(argv) => {
|
|
1461
|
+
if (argv.verbose) console.log(`Generating TypeDocs: ${argv.package ?? "all"}`);
|
|
1462
|
+
process.exitCode = genDocs({ incremental: !!argv.incremental, pkg: argv.package });
|
|
1463
|
+
}
|
|
1464
|
+
).command(
|
|
1465
|
+
"clean-docs",
|
|
1466
|
+
"CleanDocs - Clean TypeDocs",
|
|
1467
|
+
(yargs2) => yargs2,
|
|
1468
|
+
(argv) => {
|
|
1469
|
+
if (argv.verbose) console.log("Cleaning TypeDocs: all");
|
|
1470
|
+
process.exitCode = cleanDocs();
|
|
1471
|
+
}
|
|
1472
|
+
).command(
|
|
1473
|
+
"gitlint [package]",
|
|
1474
|
+
"Gitlint - Lint your git config",
|
|
1475
|
+
(yargs2) => {
|
|
1476
|
+
return yargs2;
|
|
1477
|
+
},
|
|
1478
|
+
(argv) => {
|
|
1479
|
+
if (argv.verbose) console.log("Gitlint");
|
|
1480
|
+
process.exitCode = argv.fix ? gitlintFix() : gitlint();
|
|
1481
|
+
}
|
|
1482
|
+
).command(
|
|
1483
|
+
"gitignore-gen",
|
|
1484
|
+
"GitIgnore Gen - Generate .gitignore files",
|
|
1485
|
+
(yargs2) => {
|
|
1486
|
+
return yargs2;
|
|
1487
|
+
},
|
|
1488
|
+
(argv) => {
|
|
1489
|
+
if (argv.verbose) console.log("GitIgnore Gen");
|
|
1490
|
+
process.exitCode = gitignoreGen();
|
|
1491
|
+
}
|
|
1492
|
+
).command(
|
|
1493
|
+
"npmignore-gen",
|
|
1494
|
+
"NpmIgnore Gen - Generate .npmignore files",
|
|
1495
|
+
(yargs2) => {
|
|
1496
|
+
return yargs2;
|
|
1497
|
+
},
|
|
1498
|
+
(argv) => {
|
|
1499
|
+
if (argv.verbose) console.log("NpmIgnore Gen");
|
|
1500
|
+
process.exitCode = npmignoreGen();
|
|
1501
|
+
}
|
|
1502
|
+
).command(
|
|
1503
|
+
"retest",
|
|
1504
|
+
"Re-Test - Run Jest Tests with cleaned cache",
|
|
1505
|
+
(yargs2) => {
|
|
1506
|
+
return yargs2;
|
|
1507
|
+
},
|
|
1508
|
+
(argv) => {
|
|
1509
|
+
if (argv.verbose) console.log("Re-Testing");
|
|
1510
|
+
process.exitCode = retest();
|
|
1511
|
+
}
|
|
1512
|
+
).command(
|
|
1513
|
+
"test",
|
|
1514
|
+
"Test - Run Jest Tests",
|
|
1515
|
+
(yargs2) => {
|
|
1516
|
+
return yargs2;
|
|
1517
|
+
},
|
|
1518
|
+
(argv) => {
|
|
1519
|
+
if (argv.verbose) console.log("Testing");
|
|
1520
|
+
process.exitCode = test();
|
|
1521
|
+
}
|
|
1522
|
+
).command(
|
|
1523
|
+
"upplug",
|
|
1524
|
+
"UpPlug - Update Yarn Plugins",
|
|
1525
|
+
(yargs2) => {
|
|
1526
|
+
return yargs2;
|
|
1527
|
+
},
|
|
1528
|
+
(argv) => {
|
|
1529
|
+
if (argv.verbose) console.log("UpPlug");
|
|
1530
|
+
process.exitCode = updateYarnPlugins();
|
|
1531
|
+
}
|
|
1532
|
+
).command(
|
|
1533
|
+
"upyarn",
|
|
1534
|
+
"UpYarn - Update Yarn Version",
|
|
1535
|
+
(yargs2) => {
|
|
1536
|
+
return yargs2;
|
|
1537
|
+
},
|
|
1538
|
+
(argv) => {
|
|
1539
|
+
if (argv.verbose) console.log("UpYarn");
|
|
1540
|
+
process.exitCode = updateYarnVersion();
|
|
1541
|
+
}
|
|
1542
|
+
).command(
|
|
1543
|
+
"yarn3only",
|
|
1544
|
+
"Yarn3Only - Check if using Yarn v3",
|
|
1545
|
+
(yargs2) => {
|
|
1546
|
+
return yargs2;
|
|
1547
|
+
},
|
|
1548
|
+
(argv) => {
|
|
1549
|
+
if (argv.verbose) console.log("Yarn 3 Check");
|
|
1550
|
+
process.exitCode = yarn3Only();
|
|
1551
|
+
}
|
|
1552
|
+
);
|
|
1553
|
+
};
|
|
1785
1554
|
|
|
1786
1555
|
// src/xy/xyDeployCommands.ts
|
|
1787
|
-
var xyDeployCommands =
|
|
1788
|
-
return args.command(
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1556
|
+
var xyDeployCommands = (args) => {
|
|
1557
|
+
return args.command(
|
|
1558
|
+
"deploy",
|
|
1559
|
+
"Deploy - Deploy patch",
|
|
1560
|
+
(yargs2) => {
|
|
1561
|
+
return yargs2;
|
|
1562
|
+
},
|
|
1563
|
+
(argv) => {
|
|
1564
|
+
if (argv.verbose) console.log("Deploy patch");
|
|
1565
|
+
process.exitCode = deploy();
|
|
1566
|
+
}
|
|
1567
|
+
).command(
|
|
1568
|
+
"deploy-minor",
|
|
1569
|
+
"Deploy - Deploy minor",
|
|
1570
|
+
(yargs2) => {
|
|
1571
|
+
return yargs2;
|
|
1572
|
+
},
|
|
1573
|
+
(argv) => {
|
|
1574
|
+
if (argv.verbose) console.log("Deploy minor");
|
|
1575
|
+
process.exitCode = deployMinor();
|
|
1576
|
+
}
|
|
1577
|
+
).command(
|
|
1578
|
+
"deploy-major",
|
|
1579
|
+
"Deploy - Deploy major",
|
|
1580
|
+
(yargs2) => {
|
|
1581
|
+
return yargs2;
|
|
1582
|
+
},
|
|
1583
|
+
(argv) => {
|
|
1584
|
+
if (argv.verbose) console.log("Deploy major");
|
|
1585
|
+
process.exitCode = deployMajor();
|
|
1586
|
+
}
|
|
1587
|
+
).command(
|
|
1588
|
+
"deploy-next",
|
|
1589
|
+
"Deploy - Deploy next",
|
|
1590
|
+
(yargs2) => {
|
|
1591
|
+
return yargs2;
|
|
1592
|
+
},
|
|
1593
|
+
(argv) => {
|
|
1594
|
+
if (argv.verbose) console.log("Deploy next");
|
|
1595
|
+
process.exitCode = deployNext();
|
|
1596
|
+
}
|
|
1597
|
+
);
|
|
1598
|
+
};
|
|
1810
1599
|
|
|
1811
1600
|
// src/xy/xyInstallCommands.ts
|
|
1812
|
-
var xyInstallCommands =
|
|
1813
|
-
return args.command(
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1601
|
+
var xyInstallCommands = (args) => {
|
|
1602
|
+
return args.command(
|
|
1603
|
+
"clean [package]",
|
|
1604
|
+
"Clean",
|
|
1605
|
+
(yargs2) => {
|
|
1606
|
+
return yargs2.positional("package", { describe: "Specific package to clean" });
|
|
1607
|
+
},
|
|
1608
|
+
async (argv) => {
|
|
1609
|
+
if (argv.verbose) {
|
|
1610
|
+
console.log(`Cleaning: ${argv.package ?? "all"}`);
|
|
1611
|
+
}
|
|
1612
|
+
process.exitCode = await clean({
|
|
1613
|
+
pkg: argv.package,
|
|
1614
|
+
verbose: !!argv.verbose
|
|
1615
|
+
});
|
|
1820
1616
|
}
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
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
|
-
|
|
1617
|
+
).command(
|
|
1618
|
+
"reinstall",
|
|
1619
|
+
"Reinstall - Clean & Install",
|
|
1620
|
+
(yargs2) => {
|
|
1621
|
+
return yargs2;
|
|
1622
|
+
},
|
|
1623
|
+
(argv) => {
|
|
1624
|
+
if (argv.verbose) console.log("Reinstalling");
|
|
1625
|
+
process.exitCode = reinstall();
|
|
1626
|
+
}
|
|
1627
|
+
).command(
|
|
1628
|
+
"up",
|
|
1629
|
+
"Up - Update dependencies",
|
|
1630
|
+
(yargs2) => {
|
|
1631
|
+
return yargs2;
|
|
1632
|
+
},
|
|
1633
|
+
(argv) => {
|
|
1634
|
+
if (argv.verbose) console.log("Up");
|
|
1635
|
+
process.exitCode = up();
|
|
1636
|
+
}
|
|
1637
|
+
).command(
|
|
1638
|
+
"updo",
|
|
1639
|
+
"Updo - Update dependencies [Interactive]",
|
|
1640
|
+
(yargs2) => {
|
|
1641
|
+
return yargs2;
|
|
1642
|
+
},
|
|
1643
|
+
(argv) => {
|
|
1644
|
+
if (argv.verbose) console.log("Updo");
|
|
1645
|
+
process.exitCode = updo();
|
|
1646
|
+
}
|
|
1647
|
+
).command(
|
|
1648
|
+
"statics",
|
|
1649
|
+
"Statics - Confirming Static Packages",
|
|
1650
|
+
(yargs2) => {
|
|
1651
|
+
return yargs2;
|
|
1652
|
+
},
|
|
1653
|
+
(argv) => {
|
|
1654
|
+
if (argv.verbose) console.log("Statics");
|
|
1655
|
+
process.exitCode = statics();
|
|
1656
|
+
}
|
|
1657
|
+
).command(
|
|
1658
|
+
"dupdeps",
|
|
1659
|
+
"Dupdeps - Duplicate Dependencies in package.json",
|
|
1660
|
+
(yargs2) => {
|
|
1661
|
+
return yargs2;
|
|
1662
|
+
},
|
|
1663
|
+
(argv) => {
|
|
1664
|
+
if (argv.verbose) console.log("Dupdeps");
|
|
1665
|
+
process.exitCode = dupdeps();
|
|
1666
|
+
}
|
|
1667
|
+
);
|
|
1668
|
+
};
|
|
1852
1669
|
|
|
1853
1670
|
// src/xy/xyLintCommands.ts
|
|
1854
|
-
import
|
|
1855
|
-
var xyLintCommands =
|
|
1856
|
-
return args.command(
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
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
|
-
}
|
|
1671
|
+
import chalk21 from "chalk";
|
|
1672
|
+
var xyLintCommands = (args) => {
|
|
1673
|
+
return args.command(
|
|
1674
|
+
"cycle [package]",
|
|
1675
|
+
"Cycle - Check for dependency cycles",
|
|
1676
|
+
(yargs2) => {
|
|
1677
|
+
return packagePositionalParam(yargs2);
|
|
1678
|
+
},
|
|
1679
|
+
async (argv) => {
|
|
1680
|
+
const start = Date.now();
|
|
1681
|
+
if (argv.verbose) console.log("Cycle");
|
|
1682
|
+
process.exitCode = await cycle({ pkg: argv.package });
|
|
1683
|
+
console.log(chalk21.blue(`Finished in ${Date.now() - start}ms`));
|
|
1684
|
+
}
|
|
1685
|
+
).command(
|
|
1686
|
+
"lint [package]",
|
|
1687
|
+
"Lint - Run Eslint",
|
|
1688
|
+
(yargs2) => {
|
|
1689
|
+
return packagePositionalParam(yargs2);
|
|
1690
|
+
},
|
|
1691
|
+
(argv) => {
|
|
1692
|
+
if (argv.verbose) console.log("Lint");
|
|
1693
|
+
const start = Date.now();
|
|
1694
|
+
process.exitCode = argv.fix ? fix({ pkg: argv.package }) : lint({ pkg: argv.package });
|
|
1695
|
+
console.log(chalk21.blue(`Finished in ${Date.now() - start}ms`));
|
|
1696
|
+
}
|
|
1697
|
+
).command(
|
|
1698
|
+
"deplint [package]",
|
|
1699
|
+
"Deplint - Run Deplint",
|
|
1700
|
+
(yargs2) => {
|
|
1701
|
+
return packagePositionalParam(yargs2);
|
|
1702
|
+
},
|
|
1703
|
+
(argv) => {
|
|
1704
|
+
if (argv.verbose) console.log("Deplint");
|
|
1705
|
+
const start = Date.now();
|
|
1706
|
+
process.exitCode = deplint({ pkg: argv.package });
|
|
1707
|
+
console.log(chalk21.blue(`Finished in ${Date.now() - start}ms`));
|
|
1708
|
+
}
|
|
1709
|
+
).command(
|
|
1710
|
+
"fix [package]",
|
|
1711
|
+
"Fix - Run Eslint w/fix",
|
|
1712
|
+
(yargs2) => {
|
|
1713
|
+
return packagePositionalParam(yargs2);
|
|
1714
|
+
},
|
|
1715
|
+
(argv) => {
|
|
1716
|
+
const start = Date.now();
|
|
1717
|
+
if (argv.verbose) console.log("Fix");
|
|
1718
|
+
process.exitCode = fix();
|
|
1719
|
+
console.log(chalk21.blue(`Finished in ${Date.now() - start}ms`));
|
|
1720
|
+
}
|
|
1721
|
+
).command(
|
|
1722
|
+
"relint [package]",
|
|
1723
|
+
"Relint - Clean & Lint",
|
|
1724
|
+
(yargs2) => {
|
|
1725
|
+
return packagePositionalParam(yargs2);
|
|
1726
|
+
},
|
|
1727
|
+
(argv) => {
|
|
1728
|
+
if (argv.verbose) console.log("Relinting");
|
|
1729
|
+
const start = Date.now();
|
|
1730
|
+
process.exitCode = relint();
|
|
1731
|
+
console.log(chalk21.blue(`Finished in ${Date.now() - start}ms`));
|
|
1732
|
+
}
|
|
1733
|
+
).command(
|
|
1734
|
+
"publint [package]",
|
|
1735
|
+
"Publint - Run Publint",
|
|
1736
|
+
(yargs2) => {
|
|
1737
|
+
return packagePositionalParam(yargs2);
|
|
1738
|
+
},
|
|
1739
|
+
async (argv) => {
|
|
1740
|
+
if (argv.verbose) console.log("Publint");
|
|
1741
|
+
const start = Date.now();
|
|
1742
|
+
process.exitCode = await publint({ pkg: argv.package, verbose: !!argv.verbose });
|
|
1743
|
+
console.log(chalk21.blue(`Finished in ${Date.now() - start}ms`));
|
|
1744
|
+
}
|
|
1745
|
+
).command(
|
|
1746
|
+
"knip",
|
|
1747
|
+
"Knip - Run Knip",
|
|
1748
|
+
(yargs2) => {
|
|
1749
|
+
return packagePositionalParam(yargs2);
|
|
1750
|
+
},
|
|
1751
|
+
(argv) => {
|
|
1752
|
+
if (argv.verbose) console.log("Knip");
|
|
1753
|
+
const start = Date.now();
|
|
1754
|
+
process.exitCode = knip();
|
|
1755
|
+
console.log(chalk21.blue(`Knip finished in ${Date.now() - start}ms`));
|
|
1756
|
+
}
|
|
1757
|
+
).command(
|
|
1758
|
+
"sonar",
|
|
1759
|
+
"Sonar - Run Sonar Check",
|
|
1760
|
+
(yargs2) => {
|
|
1761
|
+
return packagePositionalParam(yargs2);
|
|
1762
|
+
},
|
|
1763
|
+
(argv) => {
|
|
1764
|
+
const start = Date.now();
|
|
1765
|
+
if (argv.verbose) console.log("Sonar Check");
|
|
1766
|
+
process.exitCode = sonar();
|
|
1767
|
+
console.log(chalk21.blue(`Finished in ${Date.now() - start}ms`));
|
|
1768
|
+
}
|
|
1769
|
+
);
|
|
1770
|
+
};
|
|
1916
1771
|
|
|
1917
1772
|
// src/xy/xyParseOptions.ts
|
|
1918
1773
|
import yargs from "yargs";
|
|
1919
1774
|
import { hideBin } from "yargs/helpers";
|
|
1920
|
-
var xyParseOptions =
|
|
1775
|
+
var xyParseOptions = () => {
|
|
1921
1776
|
return yargs(hideBin(process.argv)).scriptName("yarn xy").option("jobs", {
|
|
1922
1777
|
alias: "j",
|
|
1923
1778
|
default: void 0,
|
|
@@ -1931,10 +1786,7 @@ var xyParseOptions = /* @__PURE__ */ __name(() => {
|
|
|
1931
1786
|
}).option("target", {
|
|
1932
1787
|
alias: "t",
|
|
1933
1788
|
default: "esm",
|
|
1934
|
-
choices: [
|
|
1935
|
-
"esm",
|
|
1936
|
-
"cjs"
|
|
1937
|
-
],
|
|
1789
|
+
choices: ["esm", "cjs"],
|
|
1938
1790
|
description: "Limit output to specific target",
|
|
1939
1791
|
type: "string"
|
|
1940
1792
|
}).option("incremental", {
|
|
@@ -1959,23 +1811,20 @@ var xyParseOptions = /* @__PURE__ */ __name(() => {
|
|
|
1959
1811
|
type: "boolean"
|
|
1960
1812
|
}).option("types", {
|
|
1961
1813
|
default: "tsc",
|
|
1962
|
-
choices: [
|
|
1963
|
-
"tsc",
|
|
1964
|
-
"tsup"
|
|
1965
|
-
],
|
|
1814
|
+
choices: ["tsc", "tsup"],
|
|
1966
1815
|
description: "Tool to generate Typescript types",
|
|
1967
1816
|
type: "string"
|
|
1968
1817
|
});
|
|
1969
|
-
}
|
|
1818
|
+
};
|
|
1970
1819
|
|
|
1971
1820
|
// src/xy/xy.ts
|
|
1972
|
-
var xy =
|
|
1821
|
+
var xy = async () => {
|
|
1973
1822
|
const options = xyParseOptions();
|
|
1974
1823
|
return await xyBuildCommands(xyCommonCommands(xyInstallCommands(xyDeployCommands(xyLintCommands(options))))).demandCommand(1).command("*", "", () => {
|
|
1975
|
-
console.error(
|
|
1976
|
-
console.log(
|
|
1824
|
+
console.error(chalk22.yellow(`Command not found [${chalk22.magenta(process.argv[2])}]`));
|
|
1825
|
+
console.log(chalk22.gray("Try 'yarn xy --help' for list of commands"));
|
|
1977
1826
|
}).version().help().argv;
|
|
1978
|
-
}
|
|
1827
|
+
};
|
|
1979
1828
|
|
|
1980
1829
|
// src/bin/xy.ts
|
|
1981
1830
|
xy().then(() => {
|