@xylabs/ts-scripts-yarn3 7.0.0-rc.9 → 7.0.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 +87 -39
- package/dist/actions/build.mjs.map +1 -1
- package/dist/actions/clean-docs.mjs +22 -8
- package/dist/actions/clean-docs.mjs.map +1 -1
- package/dist/actions/clean-eslint.mjs +11 -5
- package/dist/actions/clean-eslint.mjs.map +1 -1
- package/dist/actions/clean-jest.mjs +29 -16
- package/dist/actions/clean-jest.mjs.map +1 -1
- package/dist/actions/clean.mjs +63 -32
- package/dist/actions/clean.mjs.map +1 -1
- package/dist/actions/compile.mjs +76 -50
- package/dist/actions/compile.mjs.map +1 -1
- package/dist/actions/copy-assets.mjs +38 -23
- package/dist/actions/copy-assets.mjs.map +1 -1
- package/dist/actions/cycle.mjs +57 -28
- package/dist/actions/cycle.mjs.map +1 -1
- package/dist/actions/dead.mjs +31 -16
- package/dist/actions/dead.mjs.map +1 -1
- package/dist/actions/deplint/checkPackage/checkPackage.mjs +74 -50
- package/dist/actions/deplint/checkPackage/checkPackage.mjs.map +1 -1
- package/dist/actions/deplint/checkPackage/getUnlistedDependencies.mjs +7 -7
- package/dist/actions/deplint/checkPackage/getUnlistedDependencies.mjs.map +1 -1
- package/dist/actions/deplint/checkPackage/getUnlistedDevDependencies.mjs +6 -10
- package/dist/actions/deplint/checkPackage/getUnlistedDevDependencies.mjs.map +1 -1
- package/dist/actions/deplint/checkPackage/getUnusedDependencies.mjs +5 -5
- package/dist/actions/deplint/checkPackage/getUnusedDependencies.mjs.map +1 -1
- package/dist/actions/deplint/checkPackage/getUnusedPeerDependencies.mjs +4 -0
- package/dist/actions/deplint/checkPackage/getUnusedPeerDependencies.mjs.map +1 -1
- package/dist/actions/deplint/checkPackage/index.mjs +74 -50
- package/dist/actions/deplint/checkPackage/index.mjs.map +1 -1
- package/dist/actions/deplint/deplint.mjs +89 -62
- package/dist/actions/deplint/deplint.mjs.map +1 -1
- package/dist/actions/deplint/findFiles.mjs +20 -4
- package/dist/actions/deplint/findFiles.mjs.map +1 -1
- package/dist/actions/deplint/findFilesByGlob.mjs +8 -1
- package/dist/actions/deplint/findFilesByGlob.mjs.map +1 -1
- package/dist/actions/deplint/getBasePackageName.mjs +4 -0
- package/dist/actions/deplint/getBasePackageName.mjs.map +1 -1
- package/dist/actions/deplint/getDependenciesFromPackageJson.mjs +4 -0
- package/dist/actions/deplint/getDependenciesFromPackageJson.mjs.map +1 -1
- package/dist/actions/deplint/getExternalImportsFromFiles.mjs +24 -12
- package/dist/actions/deplint/getExternalImportsFromFiles.mjs.map +1 -1
- package/dist/actions/deplint/getImportsFromFile.mjs +16 -9
- package/dist/actions/deplint/getImportsFromFile.mjs.map +1 -1
- package/dist/actions/deplint/index.mjs +89 -62
- package/dist/actions/deplint/index.mjs.map +1 -1
- package/dist/actions/deploy-major.mjs +57 -26
- package/dist/actions/deploy-major.mjs.map +1 -1
- package/dist/actions/deploy-minor.mjs +57 -26
- package/dist/actions/deploy-minor.mjs.map +1 -1
- package/dist/actions/deploy-next.mjs +57 -26
- package/dist/actions/deploy-next.mjs.map +1 -1
- package/dist/actions/deploy.mjs +57 -26
- package/dist/actions/deploy.mjs.map +1 -1
- package/dist/actions/dupdeps.mjs +37 -26
- package/dist/actions/dupdeps.mjs.map +1 -1
- package/dist/actions/fix.mjs +54 -36
- package/dist/actions/fix.mjs.map +1 -1
- package/dist/actions/gen-docs.mjs +65 -25
- package/dist/actions/gen-docs.mjs.map +1 -1
- package/dist/actions/gitignore-gen.mjs +44 -28
- package/dist/actions/gitignore-gen.mjs.map +1 -1
- package/dist/actions/gitlint-fix.mjs +14 -5
- package/dist/actions/gitlint-fix.mjs.map +1 -1
- package/dist/actions/gitlint.mjs +7 -4
- package/dist/actions/gitlint.mjs.map +1 -1
- package/dist/actions/index.mjs +1480 -898
- package/dist/actions/index.mjs.map +1 -1
- package/dist/actions/knip.mjs +31 -16
- package/dist/actions/knip.mjs.map +1 -1
- package/dist/actions/license.mjs +51 -37
- package/dist/actions/license.mjs.map +1 -1
- package/dist/actions/lint.mjs +48 -33
- package/dist/actions/lint.mjs.map +1 -1
- package/dist/actions/npmignore-gen.mjs +44 -28
- package/dist/actions/npmignore-gen.mjs.map +1 -1
- package/dist/actions/package/clean-outputs.mjs +16 -6
- package/dist/actions/package/clean-outputs.mjs.map +1 -1
- package/dist/actions/package/clean-typescript.mjs +16 -6
- package/dist/actions/package/clean-typescript.mjs.map +1 -1
- package/dist/actions/package/clean.mjs +29 -12
- package/dist/actions/package/clean.mjs.map +1 -1
- package/dist/actions/package/compile/buildEntries.mjs +36 -8
- package/dist/actions/package/compile/buildEntries.mjs.map +1 -1
- package/dist/actions/package/compile/compile.mjs +346 -141
- package/dist/actions/package/compile/compile.mjs.map +1 -1
- package/dist/actions/package/compile/copyTypeFiles.mjs +23 -20
- package/dist/actions/package/compile/copyTypeFiles.mjs.map +1 -1
- package/dist/actions/package/compile/deepMerge.mjs +5 -0
- package/dist/actions/package/compile/deepMerge.mjs.map +1 -1
- package/dist/actions/package/compile/getCompilerOptions.mjs +9 -23
- package/dist/actions/package/compile/getCompilerOptions.mjs.map +1 -1
- package/dist/actions/package/compile/index.mjs +346 -223
- package/dist/actions/package/compile/index.mjs.map +1 -1
- package/dist/actions/package/compile/inputs.mjs +26 -3
- package/dist/actions/package/compile/inputs.mjs.map +1 -1
- package/dist/actions/package/compile/packageCompileTsc.mjs +57 -96
- package/dist/actions/package/compile/packageCompileTsc.mjs.map +1 -1
- package/dist/actions/package/compile/packageCompileTscTypes.mjs +94 -25
- package/dist/actions/package/compile/packageCompileTscTypes.mjs.map +1 -1
- package/dist/actions/package/compile/packageCompileTsup.mjs +321 -123
- package/dist/actions/package/compile/packageCompileTsup.mjs.map +1 -1
- package/dist/actions/package/copy-assets.mjs +21 -12
- package/dist/actions/package/copy-assets.mjs.map +1 -1
- package/dist/actions/package/cycle.mjs +16 -9
- package/dist/actions/package/cycle.mjs.map +1 -1
- package/dist/actions/package/gen-docs.mjs +12 -11
- package/dist/actions/package/gen-docs.mjs.map +1 -1
- package/dist/actions/package/index.mjs +466 -301
- package/dist/actions/package/index.mjs.map +1 -1
- package/dist/actions/package/lint.mjs +39 -16
- package/dist/actions/package/lint.mjs.map +1 -1
- package/dist/actions/package/publint.mjs +7 -4
- package/dist/actions/package/publint.mjs.map +1 -1
- package/dist/actions/package/recompile.mjs +374 -155
- package/dist/actions/package/recompile.mjs.map +1 -1
- package/dist/actions/publint.mjs +71 -37
- package/dist/actions/publint.mjs.map +1 -1
- package/dist/actions/rebuild.mjs +29 -17
- package/dist/actions/rebuild.mjs.map +1 -1
- package/dist/actions/recompile.mjs +67 -50
- package/dist/actions/recompile.mjs.map +1 -1
- package/dist/actions/reinstall.mjs +43 -25
- package/dist/actions/reinstall.mjs.map +1 -1
- package/dist/actions/relint.mjs +63 -40
- package/dist/actions/relint.mjs.map +1 -1
- package/dist/actions/retest.mjs +35 -17
- package/dist/actions/retest.mjs.map +1 -1
- package/dist/actions/sonar.mjs +32 -16
- package/dist/actions/sonar.mjs.map +1 -1
- package/dist/actions/statics.mjs +46 -27
- package/dist/actions/statics.mjs.map +1 -1
- package/dist/actions/test.mjs +30 -16
- package/dist/actions/test.mjs.map +1 -1
- package/dist/actions/up.mjs +27 -16
- package/dist/actions/up.mjs.map +1 -1
- package/dist/actions/updo.mjs +33 -18
- package/dist/actions/updo.mjs.map +1 -1
- package/dist/actions/upplug.mjs +53 -19
- package/dist/actions/upplug.mjs.map +1 -1
- package/dist/actions/upyarn.mjs +31 -16
- package/dist/actions/upyarn.mjs.map +1 -1
- package/dist/actions/yarn3only.mjs +23 -12
- package/dist/actions/yarn3only.mjs.map +1 -1
- package/dist/bin/package/build-only.mjs +349 -145
- package/dist/bin/package/build-only.mjs.map +1 -1
- package/dist/bin/package/build.mjs +351 -145
- package/dist/bin/package/build.mjs.map +1 -1
- package/dist/bin/package/clean-outputs.mjs +15 -6
- package/dist/bin/package/clean-outputs.mjs.map +1 -1
- package/dist/bin/package/clean-typescript.mjs +15 -6
- package/dist/bin/package/clean-typescript.mjs.map +1 -1
- package/dist/bin/package/clean.mjs +28 -12
- package/dist/bin/package/clean.mjs.map +1 -1
- package/dist/bin/package/compile-only.mjs +348 -144
- package/dist/bin/package/compile-only.mjs.map +1 -1
- package/dist/bin/package/compile-tsup.mjs +323 -126
- package/dist/bin/package/compile-tsup.mjs.map +1 -1
- package/dist/bin/package/compile.mjs +349 -145
- package/dist/bin/package/compile.mjs.map +1 -1
- package/dist/bin/package/copy-assets-cjs.mjs +23 -13
- package/dist/bin/package/copy-assets-cjs.mjs.map +1 -1
- package/dist/bin/package/copy-assets-esm.mjs +23 -13
- package/dist/bin/package/copy-assets-esm.mjs.map +1 -1
- package/dist/bin/package/cycle.mjs +17 -11
- package/dist/bin/package/cycle.mjs.map +1 -1
- package/dist/bin/package/fix.mjs +38 -16
- package/dist/bin/package/fix.mjs.map +1 -1
- package/dist/bin/package/gen-docs.mjs +11 -11
- package/dist/bin/package/gen-docs.mjs.map +1 -1
- package/dist/bin/package/lint.mjs +38 -16
- package/dist/bin/package/lint.mjs.map +1 -1
- package/dist/bin/package/publint.mjs +6 -4
- package/dist/bin/package/publint.mjs.map +1 -1
- package/dist/bin/package/recompile.mjs +375 -157
- package/dist/bin/package/recompile.mjs.map +1 -1
- package/dist/bin/package/relint.mjs +38 -16
- package/dist/bin/package/relint.mjs.map +1 -1
- package/dist/bin/xy.mjs +1319 -1056
- package/dist/bin/xy.mjs.map +1 -1
- package/dist/index.d.ts +9 -26
- package/dist/index.mjs +1847 -1407
- package/dist/index.mjs.map +1 -1
- package/dist/lib/checkResult.mjs +5 -2
- package/dist/lib/checkResult.mjs.map +1 -1
- package/dist/lib/createBuildConfig.mjs +24 -9
- package/dist/lib/createBuildConfig.mjs.map +1 -1
- package/dist/lib/defaultBuildConfig.mjs +6 -2
- package/dist/lib/defaultBuildConfig.mjs.map +1 -1
- package/dist/lib/deleteGlob.mjs +9 -3
- package/dist/lib/deleteGlob.mjs.map +1 -1
- package/dist/lib/dependencies/DuplicateDetector.mjs +23 -12
- package/dist/lib/dependencies/DuplicateDetector.mjs.map +1 -1
- package/dist/lib/dependencies/detectDuplicateDependencies.mjs +33 -22
- package/dist/lib/dependencies/detectDuplicateDependencies.mjs.map +1 -1
- package/dist/lib/dependencies/index.mjs +33 -22
- package/dist/lib/dependencies/index.mjs.map +1 -1
- package/dist/lib/file/ReadFileSyncOptions.mjs +3 -1
- package/dist/lib/file/ReadFileSyncOptions.mjs.map +1 -1
- package/dist/lib/file/constants.mjs.map +1 -1
- package/dist/lib/file/fileLines.mjs +13 -12
- package/dist/lib/file/fileLines.mjs.map +1 -1
- package/dist/lib/file/index.mjs +15 -14
- package/dist/lib/file/index.mjs.map +1 -1
- package/dist/lib/file/tryReadFileSync.mjs +8 -3
- package/dist/lib/file/tryReadFileSync.mjs.map +1 -1
- package/dist/lib/generateIgnoreFiles.mjs +43 -27
- package/dist/lib/generateIgnoreFiles.mjs.map +1 -1
- package/dist/lib/index.mjs +166 -106
- package/dist/lib/index.mjs.map +1 -1
- package/dist/lib/jsonFormatters.mjs +5 -2
- package/dist/lib/jsonFormatters.mjs.map +1 -1
- package/dist/lib/loadConfig.mjs +20 -10
- package/dist/lib/loadConfig.mjs.map +1 -1
- package/dist/lib/parsedPackageJSON.mjs +5 -2
- package/dist/lib/parsedPackageJSON.mjs.map +1 -1
- package/dist/lib/processEx.mjs +9 -6
- package/dist/lib/processEx.mjs.map +1 -1
- package/dist/lib/runSteps.mjs +19 -13
- package/dist/lib/runSteps.mjs.map +1 -1
- package/dist/lib/runStepsAsync.mjs +22 -22
- package/dist/lib/runStepsAsync.mjs.map +1 -1
- package/dist/lib/runXy.mjs +31 -19
- package/dist/lib/runXy.mjs.map +1 -1
- package/dist/lib/runXyWithWarning.mjs +5 -2
- package/dist/lib/runXyWithWarning.mjs.map +1 -1
- package/dist/lib/safeExit.mjs +13 -10
- package/dist/lib/safeExit.mjs.map +1 -1
- package/dist/lib/string/empty.mjs +5 -2
- package/dist/lib/string/empty.mjs.map +1 -1
- package/dist/lib/string/index.mjs +9 -3
- package/dist/lib/string/index.mjs.map +1 -1
- package/dist/lib/string/union.mjs +7 -1
- package/dist/lib/string/union.mjs.map +1 -1
- package/dist/lib/withErrnoException.mjs +7 -4
- package/dist/lib/withErrnoException.mjs.map +1 -1
- package/dist/lib/withError.mjs +5 -2
- package/dist/lib/withError.mjs.map +1 -1
- package/dist/lib/yarn/index.mjs +30 -11
- package/dist/lib/yarn/index.mjs.map +1 -1
- package/dist/lib/yarn/isYarnVersionOrGreater.mjs +15 -4
- package/dist/lib/yarn/isYarnVersionOrGreater.mjs.map +1 -1
- package/dist/lib/yarn/workspace/index.mjs +16 -5
- package/dist/lib/yarn/workspace/index.mjs.map +1 -1
- package/dist/lib/yarn/workspace/yarnWorkspace.mjs +16 -5
- package/dist/lib/yarn/workspace/yarnWorkspace.mjs.map +1 -1
- package/dist/lib/yarn/workspace/yarnWorkspaces.mjs +14 -3
- package/dist/lib/yarn/workspace/yarnWorkspaces.mjs.map +1 -1
- package/dist/lib/yarn/yarnInitCwd.mjs +5 -2
- package/dist/lib/yarn/yarnInitCwd.mjs.map +1 -1
- package/dist/loadPackageConfig.mjs +8 -3
- package/dist/loadPackageConfig.mjs.map +1 -1
- package/dist/xy/index.mjs +1320 -1056
- package/dist/xy/index.mjs.map +1 -1
- package/dist/xy/param.mjs +9 -3
- package/dist/xy/param.mjs.map +1 -1
- package/dist/xy/xy.mjs +1320 -1056
- package/dist/xy/xy.mjs.map +1 -1
- package/dist/xy/xyBuildCommands.mjs +324 -305
- package/dist/xy/xyBuildCommands.mjs.map +1 -1
- package/dist/xy/xyCommonCommands.mjs +336 -251
- package/dist/xy/xyCommonCommands.mjs.map +1 -1
- package/dist/xy/xyDeployCommands.mjs +161 -99
- package/dist/xy/xyDeployCommands.mjs.map +1 -1
- package/dist/xy/xyInstallCommands.mjs +193 -145
- package/dist/xy/xyInstallCommands.mjs.map +1 -1
- package/dist/xy/xyLintCommands.mjs +405 -302
- package/dist/xy/xyLintCommands.mjs.map +1 -1
- package/dist/xy/xyParseOptions.mjs +5 -2
- package/dist/xy/xyParseOptions.mjs.map +1 -1
- package/package.json +10 -9
- package/dist/actions/compile-types.mjs +0 -153
- package/dist/actions/compile-types.mjs.map +0 -1
package/dist/index.mjs
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
|
|
1
4
|
// src/actions/build.ts
|
|
2
5
|
import chalk9 from "chalk";
|
|
3
6
|
|
|
4
7
|
// src/lib/checkResult.ts
|
|
5
8
|
import chalk from "chalk";
|
|
6
|
-
var checkResult = (name, result, level = "error", exitOnFail = false) => {
|
|
9
|
+
var checkResult = /* @__PURE__ */ __name((name, result, level = "error", exitOnFail = false) => {
|
|
7
10
|
if (result) {
|
|
8
11
|
const exiting = exitOnFail ? "[Exiting Process]" : "[Continuing]";
|
|
9
12
|
const chalkFunc = level === "error" ? chalk.red : chalk.yellow;
|
|
@@ -12,7 +15,7 @@ var checkResult = (name, result, level = "error", exitOnFail = false) => {
|
|
|
12
15
|
process.exit(result);
|
|
13
16
|
}
|
|
14
17
|
}
|
|
15
|
-
};
|
|
18
|
+
}, "checkResult");
|
|
16
19
|
|
|
17
20
|
// src/lib/createBuildConfig.ts
|
|
18
21
|
import { readFileSync } from "fs";
|
|
@@ -21,7 +24,9 @@ import { readFileSync } from "fs";
|
|
|
21
24
|
var defaultBuildConfig = {
|
|
22
25
|
compilerOptions: {
|
|
23
26
|
rootDir: "src",
|
|
24
|
-
rootDirs: [
|
|
27
|
+
rootDirs: [
|
|
28
|
+
"package.json"
|
|
29
|
+
]
|
|
25
30
|
},
|
|
26
31
|
exclude: [
|
|
27
32
|
"**/build",
|
|
@@ -34,20 +39,24 @@ var defaultBuildConfig = {
|
|
|
34
39
|
"**/spec/*",
|
|
35
40
|
"**/stories/*"
|
|
36
41
|
],
|
|
37
|
-
include: [
|
|
42
|
+
include: [
|
|
43
|
+
"src"
|
|
44
|
+
]
|
|
38
45
|
};
|
|
39
46
|
|
|
40
47
|
// src/lib/createBuildConfig.ts
|
|
41
|
-
var getGeneralTypescriptConfig = (location) => {
|
|
48
|
+
var getGeneralTypescriptConfig = /* @__PURE__ */ __name((location) => {
|
|
42
49
|
let generalConfig;
|
|
43
50
|
try {
|
|
44
|
-
generalConfig = readFileSync(`${location}/tsconfig.json`, {
|
|
51
|
+
generalConfig = readFileSync(`${location}/tsconfig.json`, {
|
|
52
|
+
encoding: "utf8"
|
|
53
|
+
});
|
|
45
54
|
} catch {
|
|
46
55
|
return false;
|
|
47
56
|
}
|
|
48
57
|
return JSON.parse(generalConfig);
|
|
49
|
-
};
|
|
50
|
-
var createBuildConfig = (location, module, target, outDirSuffix) => {
|
|
58
|
+
}, "getGeneralTypescriptConfig");
|
|
59
|
+
var createBuildConfig = /* @__PURE__ */ __name((location, module, target, outDirSuffix) => {
|
|
51
60
|
const generalConfigObject = getGeneralTypescriptConfig(location);
|
|
52
61
|
if (generalConfigObject === false) {
|
|
53
62
|
return void 0;
|
|
@@ -61,20 +70,29 @@ var createBuildConfig = (location, module, target, outDirSuffix) => {
|
|
|
61
70
|
outDir: `./${generalConfigObject.compilerOptions?.outDir ?? "dist"}/${outDirSuffix}`,
|
|
62
71
|
target
|
|
63
72
|
},
|
|
64
|
-
exclude: [
|
|
65
|
-
|
|
73
|
+
exclude: [
|
|
74
|
+
...generalConfigObject.exclude ?? [],
|
|
75
|
+
...defaultBuildConfig.exclude
|
|
76
|
+
],
|
|
77
|
+
include: [
|
|
78
|
+
...generalConfigObject.include ?? [],
|
|
79
|
+
...defaultBuildConfig.include
|
|
80
|
+
]
|
|
66
81
|
};
|
|
67
|
-
};
|
|
82
|
+
}, "createBuildConfig");
|
|
68
83
|
|
|
69
84
|
// src/lib/deleteGlob.ts
|
|
70
85
|
import fs from "fs";
|
|
71
86
|
import { glob } from "glob";
|
|
72
|
-
var deleteGlob = (globPath) => {
|
|
87
|
+
var deleteGlob = /* @__PURE__ */ __name((globPath) => {
|
|
73
88
|
const files = glob.sync(globPath);
|
|
74
89
|
for (const file of files) {
|
|
75
|
-
fs.rmSync(file, {
|
|
90
|
+
fs.rmSync(file, {
|
|
91
|
+
recursive: true,
|
|
92
|
+
force: true
|
|
93
|
+
});
|
|
76
94
|
}
|
|
77
|
-
};
|
|
95
|
+
}, "deleteGlob");
|
|
78
96
|
|
|
79
97
|
// src/lib/dependencies/detectDuplicateDependencies.ts
|
|
80
98
|
import { execSync } from "child_process";
|
|
@@ -83,17 +101,17 @@ import { execSync } from "child_process";
|
|
|
83
101
|
import chalk2 from "chalk";
|
|
84
102
|
|
|
85
103
|
// src/lib/withError.ts
|
|
86
|
-
var withError = (ex, closure, predicate = (ex2) => !!ex2.name && !!ex2.message) => {
|
|
104
|
+
var withError = /* @__PURE__ */ __name((ex, closure, predicate = (ex2) => !!ex2.name && !!ex2.message) => {
|
|
87
105
|
return predicate(ex) ? closure(ex) : void 0;
|
|
88
|
-
};
|
|
106
|
+
}, "withError");
|
|
89
107
|
|
|
90
108
|
// src/lib/withErrnoException.ts
|
|
91
|
-
var withErrnoException = (ex, closure) => {
|
|
109
|
+
var withErrnoException = /* @__PURE__ */ __name((ex, closure) => {
|
|
92
110
|
return withError(ex, closure, (ex2) => ex2.errno !== void 0);
|
|
93
|
-
};
|
|
111
|
+
}, "withErrnoException");
|
|
94
112
|
|
|
95
113
|
// src/lib/processEx.ts
|
|
96
|
-
var processEx = (ex) => {
|
|
114
|
+
var processEx = /* @__PURE__ */ __name((ex) => {
|
|
97
115
|
const error = typeof ex === "string" ? new Error(ex) : ex;
|
|
98
116
|
const exitCode = withErrnoException(error, (error2) => {
|
|
99
117
|
if (error2.code === "ENOENT") {
|
|
@@ -110,10 +128,10 @@ var processEx = (ex) => {
|
|
|
110
128
|
return -1;
|
|
111
129
|
})();
|
|
112
130
|
process.exit(process.exitCode ?? exitCode);
|
|
113
|
-
};
|
|
131
|
+
}, "processEx");
|
|
114
132
|
|
|
115
133
|
// src/lib/safeExit.ts
|
|
116
|
-
var safeExit = (func, exitOnFail = true) => {
|
|
134
|
+
var safeExit = /* @__PURE__ */ __name((func, exitOnFail = true) => {
|
|
117
135
|
try {
|
|
118
136
|
const result = func();
|
|
119
137
|
if (result && exitOnFail) {
|
|
@@ -123,8 +141,8 @@ var safeExit = (func, exitOnFail = true) => {
|
|
|
123
141
|
} catch (ex) {
|
|
124
142
|
return processEx(ex);
|
|
125
143
|
}
|
|
126
|
-
};
|
|
127
|
-
var safeExitAsync = async (func, exitOnFail = true) => {
|
|
144
|
+
}, "safeExit");
|
|
145
|
+
var safeExitAsync = /* @__PURE__ */ __name(async (func, exitOnFail = true) => {
|
|
128
146
|
try {
|
|
129
147
|
const result = await func();
|
|
130
148
|
if (result && exitOnFail) {
|
|
@@ -134,22 +152,22 @@ var safeExitAsync = async (func, exitOnFail = true) => {
|
|
|
134
152
|
} catch (ex) {
|
|
135
153
|
return processEx(ex);
|
|
136
154
|
}
|
|
137
|
-
};
|
|
155
|
+
}, "safeExitAsync");
|
|
138
156
|
|
|
139
157
|
// src/lib/dependencies/DuplicateDetector.ts
|
|
140
158
|
import { EOL } from "os";
|
|
141
159
|
import chalk3 from "chalk";
|
|
142
160
|
|
|
143
161
|
// src/lib/jsonFormatters.ts
|
|
144
|
-
var multiLineToJSONArray = (output) => {
|
|
162
|
+
var multiLineToJSONArray = /* @__PURE__ */ __name((output) => {
|
|
145
163
|
const withCommas = output.replaceAll("\r\n", "").replaceAll("\n", ",");
|
|
146
164
|
const cleanCollection = withCommas.slice(0, Math.max(0, withCommas.length - 1));
|
|
147
165
|
const collection = `[${cleanCollection}]`;
|
|
148
166
|
return JSON.parse(collection);
|
|
149
|
-
};
|
|
167
|
+
}, "multiLineToJSONArray");
|
|
150
168
|
|
|
151
169
|
// src/lib/dependencies/DuplicateDetector.ts
|
|
152
|
-
var trimVirtualMeta = (value) => {
|
|
170
|
+
var trimVirtualMeta = /* @__PURE__ */ __name((value) => {
|
|
153
171
|
const virtualParts = value.split("virtual:");
|
|
154
172
|
if (virtualParts.length > 1) {
|
|
155
173
|
const hashParts = virtualParts[1].split("#");
|
|
@@ -157,8 +175,8 @@ var trimVirtualMeta = (value) => {
|
|
|
157
175
|
} else {
|
|
158
176
|
return value;
|
|
159
177
|
}
|
|
160
|
-
};
|
|
161
|
-
var trimObjectDependencyVirtualMeta = (obj) => {
|
|
178
|
+
}, "trimVirtualMeta");
|
|
179
|
+
var trimObjectDependencyVirtualMeta = /* @__PURE__ */ __name((obj) => {
|
|
162
180
|
const resultObj = {};
|
|
163
181
|
for (const [key, value] of Object.entries(obj)) {
|
|
164
182
|
resultObj[trimVirtualMeta(key)] = {
|
|
@@ -167,13 +185,19 @@ var trimObjectDependencyVirtualMeta = (obj) => {
|
|
|
167
185
|
};
|
|
168
186
|
}
|
|
169
187
|
return resultObj;
|
|
170
|
-
};
|
|
171
|
-
var trimDependencyVirtualMeta = (dependencies) => {
|
|
188
|
+
}, "trimObjectDependencyVirtualMeta");
|
|
189
|
+
var trimDependencyVirtualMeta = /* @__PURE__ */ __name((dependencies) => {
|
|
172
190
|
return dependencies.map((dependency) => {
|
|
173
|
-
return {
|
|
191
|
+
return {
|
|
192
|
+
children: trimObjectDependencyVirtualMeta(dependency.children),
|
|
193
|
+
value: trimVirtualMeta(dependency.value)
|
|
194
|
+
};
|
|
174
195
|
});
|
|
175
|
-
};
|
|
196
|
+
}, "trimDependencyVirtualMeta");
|
|
176
197
|
var DuplicateDetector = class {
|
|
198
|
+
static {
|
|
199
|
+
__name(this, "DuplicateDetector");
|
|
200
|
+
}
|
|
177
201
|
dependency;
|
|
178
202
|
dependencyEntries;
|
|
179
203
|
constructor(output, dependency) {
|
|
@@ -203,19 +227,21 @@ var DuplicateDetector = class {
|
|
|
203
227
|
acc.duplicateVersions.push(acc.currentVersion);
|
|
204
228
|
}
|
|
205
229
|
acc.duplicateVersions.push(version);
|
|
206
|
-
acc.duplicateVersions = [
|
|
230
|
+
acc.duplicateVersions = [
|
|
231
|
+
...new Set(acc.duplicateVersions)
|
|
232
|
+
];
|
|
207
233
|
}
|
|
208
234
|
return acc;
|
|
209
235
|
}
|
|
210
|
-
resultsFactory = (dependency) => ({
|
|
236
|
+
resultsFactory = /* @__PURE__ */ __name((dependency) => ({
|
|
211
237
|
currentVersion: void 0,
|
|
212
238
|
dependency,
|
|
213
239
|
duplicateVersions: []
|
|
214
|
-
});
|
|
240
|
+
}), "resultsFactory");
|
|
215
241
|
};
|
|
216
242
|
|
|
217
243
|
// src/lib/dependencies/detectDuplicateDependencies.ts
|
|
218
|
-
var detectDuplicateDependencies = (depsFromPackageJSON, DefaultDependencies2) => {
|
|
244
|
+
var detectDuplicateDependencies = /* @__PURE__ */ __name((depsFromPackageJSON, DefaultDependencies2) => {
|
|
219
245
|
let exitCode = 0;
|
|
220
246
|
const dependencies = depsFromPackageJSON?.length ? depsFromPackageJSON : DefaultDependencies2;
|
|
221
247
|
return safeExit(() => {
|
|
@@ -246,51 +272,57 @@ var detectDuplicateDependencies = (depsFromPackageJSON, DefaultDependencies2) =>
|
|
|
246
272
|
return exitCode;
|
|
247
273
|
}
|
|
248
274
|
});
|
|
249
|
-
};
|
|
275
|
+
}, "detectDuplicateDependencies");
|
|
250
276
|
|
|
251
277
|
// src/lib/file/constants.ts
|
|
252
278
|
var WINDOWS_NEWLINE_REGEX = /\r\n/g;
|
|
253
279
|
var CROSS_PLATFORM_NEWLINE = "\n";
|
|
254
280
|
|
|
255
281
|
// src/lib/file/fileLines.ts
|
|
256
|
-
import {
|
|
257
|
-
existsSync,
|
|
258
|
-
readFileSync as readFileSync2,
|
|
259
|
-
writeFileSync
|
|
260
|
-
} from "fs";
|
|
282
|
+
import { existsSync, readFileSync as readFileSync2, writeFileSync } from "fs";
|
|
261
283
|
|
|
262
284
|
// src/lib/string/empty.ts
|
|
263
|
-
var empty = (value) => value?.trim().length === 0;
|
|
264
|
-
var notEmpty = (value) => !empty(value);
|
|
285
|
+
var empty = /* @__PURE__ */ __name((value) => value?.trim().length === 0, "empty");
|
|
286
|
+
var notEmpty = /* @__PURE__ */ __name((value) => !empty(value), "notEmpty");
|
|
265
287
|
|
|
266
288
|
// src/lib/string/union.ts
|
|
267
|
-
var union = (a, b) => /* @__PURE__ */ new Set([
|
|
289
|
+
var union = /* @__PURE__ */ __name((a, b) => /* @__PURE__ */ new Set([
|
|
290
|
+
...new Set(a),
|
|
291
|
+
...new Set(b)
|
|
292
|
+
]), "union");
|
|
268
293
|
|
|
269
294
|
// src/lib/file/ReadFileSyncOptions.ts
|
|
270
|
-
var defaultReadFileSyncOptions = {
|
|
295
|
+
var defaultReadFileSyncOptions = {
|
|
296
|
+
encoding: "utf8"
|
|
297
|
+
};
|
|
271
298
|
|
|
272
299
|
// src/lib/file/fileLines.ts
|
|
273
|
-
var readLines = (uri, options = defaultReadFileSyncOptions) => existsSync(uri) ? readFileSync2(uri, options).replace(WINDOWS_NEWLINE_REGEX, CROSS_PLATFORM_NEWLINE).split(CROSS_PLATFORM_NEWLINE) : [];
|
|
274
|
-
var readNonEmptyLines = (uri, options = defaultReadFileSyncOptions) => readLines(uri, options).filter(notEmpty);
|
|
275
|
-
var writeLines = (uri, lines, options = defaultReadFileSyncOptions) => {
|
|
300
|
+
var readLines = /* @__PURE__ */ __name((uri, options = defaultReadFileSyncOptions) => existsSync(uri) ? readFileSync2(uri, options).replace(WINDOWS_NEWLINE_REGEX, CROSS_PLATFORM_NEWLINE).split(CROSS_PLATFORM_NEWLINE) : [], "readLines");
|
|
301
|
+
var readNonEmptyLines = /* @__PURE__ */ __name((uri, options = defaultReadFileSyncOptions) => readLines(uri, options).filter(notEmpty), "readNonEmptyLines");
|
|
302
|
+
var writeLines = /* @__PURE__ */ __name((uri, lines, options = defaultReadFileSyncOptions) => {
|
|
276
303
|
const existing = existsSync(uri) ? readFileSync2(uri, options) : void 0;
|
|
277
304
|
const desired = lines.join(CROSS_PLATFORM_NEWLINE);
|
|
278
305
|
if (existing !== desired) writeFileSync(uri, desired, options);
|
|
279
|
-
};
|
|
306
|
+
}, "writeLines");
|
|
280
307
|
|
|
281
308
|
// src/lib/file/tryReadFileSync.ts
|
|
282
309
|
import { existsSync as existsSync2, readFileSync as readFileSync3 } from "fs";
|
|
283
|
-
var tryReadFileSync = (uri, options = defaultReadFileSyncOptions) => {
|
|
310
|
+
var tryReadFileSync = /* @__PURE__ */ __name((uri, options = defaultReadFileSyncOptions) => {
|
|
284
311
|
return existsSync2(uri) ? readFileSync3(uri, options) : void 0;
|
|
285
|
-
};
|
|
312
|
+
}, "tryReadFileSync");
|
|
286
313
|
|
|
287
314
|
// src/lib/generateIgnoreFiles.ts
|
|
288
315
|
import chalk4 from "chalk";
|
|
289
316
|
|
|
290
317
|
// src/lib/yarn/isYarnVersionOrGreater.ts
|
|
291
318
|
import { spawnSync } from "child_process";
|
|
292
|
-
var isYarnVersionOrGreater = (major, minor, patch) => {
|
|
293
|
-
const result = spawnSync("yarn", [
|
|
319
|
+
var isYarnVersionOrGreater = /* @__PURE__ */ __name((major, minor, patch) => {
|
|
320
|
+
const result = spawnSync("yarn", [
|
|
321
|
+
"-v"
|
|
322
|
+
], {
|
|
323
|
+
encoding: "utf8",
|
|
324
|
+
shell: true
|
|
325
|
+
});
|
|
294
326
|
const version = result.stdout.toString().replaceAll("\n", "");
|
|
295
327
|
const versionNumbers = version.split(".").map((ver) => Number.parseInt(ver));
|
|
296
328
|
const majorDelta = versionNumbers[0] - major;
|
|
@@ -299,46 +331,61 @@ var isYarnVersionOrGreater = (major, minor, patch) => {
|
|
|
299
331
|
const majorOk = majorDelta >= 0;
|
|
300
332
|
const minorOk = majorDelta > 0 || minorDelta >= 0;
|
|
301
333
|
const patchOk = majorDelta > 0 || minorDelta > 0 || patchDelta >= 0;
|
|
302
|
-
return [
|
|
303
|
-
|
|
334
|
+
return [
|
|
335
|
+
majorOk && minorOk && patchOk,
|
|
336
|
+
version
|
|
337
|
+
];
|
|
338
|
+
}, "isYarnVersionOrGreater");
|
|
304
339
|
|
|
305
340
|
// src/lib/yarn/workspace/yarnWorkspaces.ts
|
|
306
341
|
import { spawnSync as spawnSync2 } from "child_process";
|
|
307
|
-
var yarnWorkspaces = () => {
|
|
308
|
-
const result = spawnSync2("yarn", [
|
|
342
|
+
var yarnWorkspaces = /* @__PURE__ */ __name(() => {
|
|
343
|
+
const result = spawnSync2("yarn", [
|
|
344
|
+
"workspaces",
|
|
345
|
+
"list",
|
|
346
|
+
"--json",
|
|
347
|
+
"--recursive"
|
|
348
|
+
], {
|
|
349
|
+
encoding: "utf8",
|
|
350
|
+
shell: true
|
|
351
|
+
});
|
|
309
352
|
if (result.error) {
|
|
310
353
|
throw result.error;
|
|
311
354
|
}
|
|
312
355
|
return result.stdout.toString().split("\n").slice(0, -1).map((item) => {
|
|
313
356
|
return JSON.parse(item);
|
|
314
357
|
});
|
|
315
|
-
};
|
|
358
|
+
}, "yarnWorkspaces");
|
|
316
359
|
|
|
317
360
|
// src/lib/yarn/workspace/yarnWorkspace.ts
|
|
318
|
-
var yarnWorkspace = (pkg) => {
|
|
361
|
+
var yarnWorkspace = /* @__PURE__ */ __name((pkg) => {
|
|
319
362
|
const workspace = yarnWorkspaces().find(({ name }) => name === pkg);
|
|
320
363
|
if (!workspace) throw new Error(`Workspace ${pkg} not found`);
|
|
321
364
|
return workspace;
|
|
322
|
-
};
|
|
365
|
+
}, "yarnWorkspace");
|
|
323
366
|
|
|
324
367
|
// src/lib/yarn/yarnInitCwd.ts
|
|
325
|
-
var INIT_CWD = () => {
|
|
368
|
+
var INIT_CWD = /* @__PURE__ */ __name(() => {
|
|
326
369
|
if (!process.env.INIT_CWD) console.error("Missing INIT_CWD");
|
|
327
370
|
return process.env.INIT_CWD;
|
|
328
|
-
};
|
|
371
|
+
}, "INIT_CWD");
|
|
329
372
|
|
|
330
373
|
// src/lib/generateIgnoreFiles.ts
|
|
331
|
-
var localeCompare = (a, b) => a.localeCompare(b);
|
|
332
|
-
var mergeEntries = (a, b) => [
|
|
333
|
-
|
|
374
|
+
var localeCompare = /* @__PURE__ */ __name((a, b) => a.localeCompare(b), "localeCompare");
|
|
375
|
+
var mergeEntries = /* @__PURE__ */ __name((a, b) => [
|
|
376
|
+
...union(a, b)
|
|
377
|
+
].sort(localeCompare), "mergeEntries");
|
|
378
|
+
var generateIgnoreFiles = /* @__PURE__ */ __name((filename3, pkg) => {
|
|
334
379
|
console.log(chalk4.green(`Generate ${filename3} Files`));
|
|
335
|
-
const
|
|
336
|
-
const workspaces = pkg ? [
|
|
337
|
-
|
|
338
|
-
|
|
380
|
+
const cwd5 = INIT_CWD() ?? ".";
|
|
381
|
+
const workspaces = pkg ? [
|
|
382
|
+
yarnWorkspace(pkg)
|
|
383
|
+
] : yarnWorkspaces();
|
|
384
|
+
const readEntries = /* @__PURE__ */ __name((location) => readNonEmptyLines(`${location}/${filename3}`), "readEntries");
|
|
385
|
+
const writeEntries = /* @__PURE__ */ __name((location, entries) => writeLines(`${location}/${filename3}`, entries), "writeEntries");
|
|
339
386
|
const results = workspaces.map(({ location, name }) => {
|
|
340
387
|
try {
|
|
341
|
-
writeEntries(location, mergeEntries(readEntries(
|
|
388
|
+
writeEntries(location, mergeEntries(readEntries(cwd5), readEntries(location)));
|
|
342
389
|
return 0;
|
|
343
390
|
} catch (ex) {
|
|
344
391
|
const error = ex;
|
|
@@ -348,7 +395,7 @@ var generateIgnoreFiles = (filename3, pkg) => {
|
|
|
348
395
|
});
|
|
349
396
|
const succeeded = results.every((result) => result === 0);
|
|
350
397
|
return succeeded ? 0 : 1;
|
|
351
|
-
};
|
|
398
|
+
}, "generateIgnoreFiles");
|
|
352
399
|
|
|
353
400
|
// src/lib/loadConfig.ts
|
|
354
401
|
import chalk5 from "chalk";
|
|
@@ -356,32 +403,39 @@ import { cosmiconfig } from "cosmiconfig";
|
|
|
356
403
|
import { TypeScriptLoader } from "cosmiconfig-typescript-loader";
|
|
357
404
|
import deepmerge from "deepmerge";
|
|
358
405
|
var config;
|
|
359
|
-
var loadConfig = async (params) => {
|
|
360
|
-
if (config) {
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
406
|
+
var loadConfig = /* @__PURE__ */ __name(async (params) => {
|
|
407
|
+
if (config === void 0) {
|
|
408
|
+
const cosmicConfigResult = await cosmiconfig("xy", {
|
|
409
|
+
cache: true,
|
|
410
|
+
loaders: {
|
|
411
|
+
".ts": TypeScriptLoader()
|
|
412
|
+
}
|
|
413
|
+
}).search();
|
|
414
|
+
config = cosmicConfigResult?.config;
|
|
415
|
+
const configFilePath = cosmicConfigResult?.filepath;
|
|
416
|
+
if (configFilePath !== void 0) {
|
|
417
|
+
console.log(chalk5.green(`Loaded config from ${configFilePath}`));
|
|
418
|
+
if (config.verbose) {
|
|
419
|
+
console.log(chalk5.gray(`${JSON.stringify(config, null, 2)}`));
|
|
420
|
+
}
|
|
421
|
+
}
|
|
368
422
|
}
|
|
369
423
|
return deepmerge(config, params ?? {});
|
|
370
|
-
};
|
|
424
|
+
}, "loadConfig");
|
|
371
425
|
|
|
372
426
|
// src/lib/parsedPackageJSON.ts
|
|
373
427
|
import { readFileSync as readFileSync4 } from "fs";
|
|
374
|
-
var parsedPackageJSON = (
|
|
375
|
-
const pathToPackageJSON =
|
|
428
|
+
var parsedPackageJSON = /* @__PURE__ */ __name((path11) => {
|
|
429
|
+
const pathToPackageJSON = path11 ?? process.env.npm_package_json ?? "";
|
|
376
430
|
const packageJSON = readFileSync4(pathToPackageJSON).toString();
|
|
377
431
|
return JSON.parse(packageJSON);
|
|
378
|
-
};
|
|
432
|
+
}, "parsedPackageJSON");
|
|
379
433
|
|
|
380
434
|
// src/lib/runSteps.ts
|
|
381
435
|
import { spawnSync as spawnSync3 } from "child_process";
|
|
382
436
|
import { existsSync as existsSync3 } from "fs";
|
|
383
437
|
import chalk6 from "chalk";
|
|
384
|
-
var runSteps = (name, steps, exitOnFail = true, messages) => {
|
|
438
|
+
var runSteps = /* @__PURE__ */ __name((name, steps, exitOnFail = true, messages) => {
|
|
385
439
|
return safeExit(() => {
|
|
386
440
|
const pkgName = process.env.npm_package_name;
|
|
387
441
|
console.log(chalk6.green(`${name} [${pkgName}]`));
|
|
@@ -397,7 +451,10 @@ var runSteps = (name, steps, exitOnFail = true, messages) => {
|
|
|
397
451
|
const status = spawnSync3(command, Array.isArray(args) ? args : args.split(" "), {
|
|
398
452
|
...config2,
|
|
399
453
|
encoding: "utf8",
|
|
400
|
-
env: {
|
|
454
|
+
env: {
|
|
455
|
+
FORCE_COLOR: "3",
|
|
456
|
+
...process.env
|
|
457
|
+
},
|
|
401
458
|
shell: true,
|
|
402
459
|
stdio: "inherit"
|
|
403
460
|
}).status ?? 0;
|
|
@@ -406,13 +463,13 @@ var runSteps = (name, steps, exitOnFail = true, messages) => {
|
|
|
406
463
|
}
|
|
407
464
|
return totalStatus;
|
|
408
465
|
}, !!exitOnFail);
|
|
409
|
-
};
|
|
466
|
+
}, "runSteps");
|
|
410
467
|
|
|
411
468
|
// src/lib/runStepsAsync.ts
|
|
412
469
|
import { spawn } from "child_process";
|
|
413
470
|
import { existsSync as existsSync4 } from "fs";
|
|
414
471
|
import chalk7 from "chalk";
|
|
415
|
-
var runStepAsync = (name, step, exitOnFail = true, message) => {
|
|
472
|
+
var runStepAsync = /* @__PURE__ */ __name((name, step, exitOnFail = true, message) => {
|
|
416
473
|
return new Promise((resolve) => {
|
|
417
474
|
const [command, args, config2] = step;
|
|
418
475
|
if (message) {
|
|
@@ -424,18 +481,15 @@ var runStepAsync = (name, step, exitOnFail = true, message) => {
|
|
|
424
481
|
}
|
|
425
482
|
spawn(command, Array.isArray(args) ? args : args.split(" "), {
|
|
426
483
|
...config2,
|
|
427
|
-
env: {
|
|
484
|
+
env: {
|
|
485
|
+
FORCE_COLOR: "3",
|
|
486
|
+
...process.env
|
|
487
|
+
},
|
|
428
488
|
shell: true,
|
|
429
489
|
stdio: "inherit"
|
|
430
490
|
}).on("close", (code) => {
|
|
431
491
|
if (code) {
|
|
432
|
-
console.error(
|
|
433
|
-
chalk7.red(
|
|
434
|
-
`Command Exited With Non-Zero Result [${chalk7.gray(code)}] | ${chalk7.yellow(command)} ${chalk7.white(
|
|
435
|
-
Array.isArray(args) ? args.join(" ") : args
|
|
436
|
-
)}`
|
|
437
|
-
)
|
|
438
|
-
);
|
|
492
|
+
console.error(chalk7.red(`Command Exited With Non-Zero Result [${chalk7.gray(code)}] | ${chalk7.yellow(command)} ${chalk7.white(Array.isArray(args) ? args.join(" ") : args)}`));
|
|
439
493
|
checkResult(name, code, "error", exitOnFail);
|
|
440
494
|
resolve(code);
|
|
441
495
|
} else {
|
|
@@ -443,8 +497,8 @@ var runStepAsync = (name, step, exitOnFail = true, message) => {
|
|
|
443
497
|
}
|
|
444
498
|
});
|
|
445
499
|
});
|
|
446
|
-
};
|
|
447
|
-
var runStepsAsync = async (name, steps, exitOnFail = true, messages) => {
|
|
500
|
+
}, "runStepAsync");
|
|
501
|
+
var runStepsAsync = /* @__PURE__ */ __name(async (name, steps, exitOnFail = true, messages) => {
|
|
448
502
|
return await safeExitAsync(async () => {
|
|
449
503
|
const pkgName = process.env.npm_package_name;
|
|
450
504
|
console.log(chalk7.green(`${name} [${pkgName}]`));
|
|
@@ -454,85 +508,163 @@ var runStepsAsync = async (name, steps, exitOnFail = true, messages) => {
|
|
|
454
508
|
}
|
|
455
509
|
return result;
|
|
456
510
|
});
|
|
457
|
-
};
|
|
511
|
+
}, "runStepsAsync");
|
|
458
512
|
|
|
459
513
|
// src/lib/runXy.ts
|
|
460
|
-
var runXy = (command) => {
|
|
461
|
-
return runSteps(
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
514
|
+
var runXy = /* @__PURE__ */ __name((command) => {
|
|
515
|
+
return runSteps(`XY [${command}]`, [
|
|
516
|
+
[
|
|
517
|
+
"yarn",
|
|
518
|
+
[
|
|
519
|
+
"xy",
|
|
520
|
+
command,
|
|
521
|
+
...process.argv.filter((value, index) => index > 1 ? value : void 0)
|
|
522
|
+
]
|
|
523
|
+
]
|
|
524
|
+
]);
|
|
525
|
+
}, "runXy");
|
|
466
526
|
|
|
467
527
|
// src/lib/runXyWithWarning.ts
|
|
468
528
|
import chalk8 from "chalk";
|
|
469
|
-
var runXyWithWarning = (command) => {
|
|
529
|
+
var runXyWithWarning = /* @__PURE__ */ __name((command) => {
|
|
470
530
|
const commandString = `yarn ${command}`;
|
|
471
531
|
const commandXyString = `yarn xy ${command}`;
|
|
472
532
|
console.warn(chalk8.yellow(`WARNING: [${chalk8.white(commandString)}] is deprecated for XY Labs Scripts.`));
|
|
473
533
|
console.warn(chalk8.gray(`Did you mean [${chalk8.magenta(commandXyString)}]?`));
|
|
474
534
|
return 1;
|
|
475
|
-
};
|
|
535
|
+
}, "runXyWithWarning");
|
|
476
536
|
|
|
477
537
|
// src/actions/build.ts
|
|
478
|
-
var build = async ({
|
|
479
|
-
incremental,
|
|
480
|
-
jobs,
|
|
481
|
-
target,
|
|
482
|
-
verbose,
|
|
483
|
-
pkg
|
|
484
|
-
}) => {
|
|
538
|
+
var build = /* @__PURE__ */ __name(async ({ incremental, jobs, target, verbose, pkg }) => {
|
|
485
539
|
const start = Date.now();
|
|
486
|
-
const pkgOptions = pkg === void 0 ? [] : [
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
const
|
|
490
|
-
|
|
540
|
+
const pkgOptions = pkg === void 0 ? [] : [
|
|
541
|
+
pkg
|
|
542
|
+
];
|
|
543
|
+
const incrementalOptions = incremental ? [
|
|
544
|
+
"-i"
|
|
545
|
+
] : [];
|
|
546
|
+
const verboseOptions = verbose ? [
|
|
547
|
+
"-v"
|
|
548
|
+
] : [];
|
|
549
|
+
const targetOptions = target === void 0 ? [] : [
|
|
550
|
+
"-t",
|
|
551
|
+
target
|
|
552
|
+
];
|
|
553
|
+
const jobsOptions = jobs === void 0 ? [] : [
|
|
554
|
+
"-j",
|
|
555
|
+
`${jobs}`
|
|
556
|
+
];
|
|
491
557
|
if (jobs !== void 0) {
|
|
492
558
|
console.log(chalk9.blue(`Jobs set to [${jobs}]`));
|
|
493
559
|
}
|
|
494
560
|
const result = await runStepsAsync(`Build${incremental ? "-Incremental" : ""} [${pkg ?? "All"}]`, [
|
|
495
|
-
[
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
561
|
+
[
|
|
562
|
+
"yarn",
|
|
563
|
+
[
|
|
564
|
+
"xy",
|
|
565
|
+
"compile",
|
|
566
|
+
...pkgOptions,
|
|
567
|
+
...targetOptions,
|
|
568
|
+
...verboseOptions,
|
|
569
|
+
...jobsOptions,
|
|
570
|
+
...incrementalOptions,
|
|
571
|
+
"--types",
|
|
572
|
+
"tsup"
|
|
573
|
+
]
|
|
574
|
+
],
|
|
575
|
+
[
|
|
576
|
+
"yarn",
|
|
577
|
+
[
|
|
578
|
+
"xy",
|
|
579
|
+
"publint",
|
|
580
|
+
...pkgOptions,
|
|
581
|
+
...verboseOptions,
|
|
582
|
+
...jobsOptions,
|
|
583
|
+
...incrementalOptions
|
|
584
|
+
]
|
|
585
|
+
],
|
|
586
|
+
[
|
|
587
|
+
"yarn",
|
|
588
|
+
[
|
|
589
|
+
"xy",
|
|
590
|
+
"deplint",
|
|
591
|
+
...pkgOptions,
|
|
592
|
+
...verboseOptions,
|
|
593
|
+
...jobsOptions,
|
|
594
|
+
...incrementalOptions
|
|
595
|
+
]
|
|
596
|
+
],
|
|
597
|
+
[
|
|
598
|
+
"yarn",
|
|
599
|
+
[
|
|
600
|
+
"xy",
|
|
601
|
+
"lint",
|
|
602
|
+
...pkgOptions,
|
|
603
|
+
...verboseOptions,
|
|
604
|
+
...incrementalOptions
|
|
605
|
+
]
|
|
606
|
+
]
|
|
499
607
|
]);
|
|
500
608
|
console.log(`${chalk9.gray("Built in")} [${chalk9.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk9.gray("seconds")}`);
|
|
501
609
|
return result;
|
|
502
|
-
};
|
|
610
|
+
}, "build");
|
|
503
611
|
|
|
504
612
|
// src/actions/clean.ts
|
|
505
|
-
var clean = async ({ verbose, pkg }) => {
|
|
506
|
-
return pkg ? await cleanPackage({
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
}
|
|
613
|
+
var clean = /* @__PURE__ */ __name(async ({ verbose, pkg }) => {
|
|
614
|
+
return pkg ? await cleanPackage({
|
|
615
|
+
pkg,
|
|
616
|
+
verbose
|
|
617
|
+
}) : cleanAll({
|
|
618
|
+
verbose
|
|
619
|
+
});
|
|
620
|
+
}, "clean");
|
|
621
|
+
var cleanPackage = /* @__PURE__ */ __name(({ pkg }) => {
|
|
622
|
+
return runStepsAsync(`Clean [${pkg}]`, [
|
|
623
|
+
[
|
|
624
|
+
"yarn",
|
|
625
|
+
[
|
|
626
|
+
"workspace",
|
|
627
|
+
pkg,
|
|
628
|
+
"run",
|
|
629
|
+
"package-clean"
|
|
630
|
+
]
|
|
631
|
+
]
|
|
632
|
+
]);
|
|
633
|
+
}, "cleanPackage");
|
|
634
|
+
var cleanAll = /* @__PURE__ */ __name(({ verbose }) => {
|
|
635
|
+
const verboseOptions = verbose ? [
|
|
636
|
+
"--verbose"
|
|
637
|
+
] : [
|
|
638
|
+
"--no-verbose"
|
|
639
|
+
];
|
|
640
|
+
return runStepsAsync("Clean", [
|
|
641
|
+
[
|
|
642
|
+
"yarn",
|
|
643
|
+
[
|
|
644
|
+
"workspaces foreach",
|
|
645
|
+
"-pA",
|
|
646
|
+
"--jobs 64",
|
|
647
|
+
...verboseOptions,
|
|
648
|
+
"run",
|
|
649
|
+
"package-clean"
|
|
650
|
+
]
|
|
651
|
+
]
|
|
652
|
+
]);
|
|
653
|
+
}, "cleanAll");
|
|
515
654
|
|
|
516
655
|
// src/actions/clean-docs.ts
|
|
517
656
|
import path from "path";
|
|
518
657
|
import chalk10 from "chalk";
|
|
519
|
-
var cleanDocs = () => {
|
|
658
|
+
var cleanDocs = /* @__PURE__ */ __name(() => {
|
|
520
659
|
const pkgName = process.env.npm_package_name;
|
|
521
660
|
console.log(chalk10.green(`Cleaning Docs [${pkgName}]`));
|
|
522
661
|
for (const { location } of yarnWorkspaces()) deleteGlob(path.join(location, "docs"));
|
|
523
662
|
return 0;
|
|
524
|
-
};
|
|
663
|
+
}, "cleanDocs");
|
|
525
664
|
|
|
526
665
|
// src/actions/compile.ts
|
|
527
666
|
import chalk11 from "chalk";
|
|
528
|
-
var compile = ({
|
|
529
|
-
verbose,
|
|
530
|
-
target,
|
|
531
|
-
pkg,
|
|
532
|
-
incremental,
|
|
533
|
-
publint: publint2,
|
|
534
|
-
jobs
|
|
535
|
-
}) => {
|
|
667
|
+
var compile = /* @__PURE__ */ __name(({ verbose, target, pkg, incremental, publint: publint2, jobs }) => {
|
|
536
668
|
return pkg ? compilePackage({
|
|
537
669
|
pkg,
|
|
538
670
|
publint: publint2,
|
|
@@ -545,114 +677,91 @@ var compile = ({
|
|
|
545
677
|
verbose,
|
|
546
678
|
jobs
|
|
547
679
|
});
|
|
548
|
-
};
|
|
549
|
-
var compilePackage = ({ target, pkg }) => {
|
|
550
|
-
const targetOptions = target ? [
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
680
|
+
}, "compile");
|
|
681
|
+
var compilePackage = /* @__PURE__ */ __name(({ target, pkg }) => {
|
|
682
|
+
const targetOptions = target ? [
|
|
683
|
+
"-t",
|
|
684
|
+
target
|
|
685
|
+
] : [];
|
|
686
|
+
return runSteps(`Compile [${pkg}]`, [
|
|
687
|
+
[
|
|
688
|
+
"yarn",
|
|
689
|
+
[
|
|
690
|
+
"workspace",
|
|
691
|
+
pkg,
|
|
692
|
+
"run",
|
|
693
|
+
"package-compile",
|
|
694
|
+
...targetOptions
|
|
695
|
+
]
|
|
696
|
+
]
|
|
697
|
+
]);
|
|
698
|
+
}, "compilePackage");
|
|
699
|
+
var compileAll = /* @__PURE__ */ __name(({ jobs, verbose, target, incremental }) => {
|
|
562
700
|
const start = Date.now();
|
|
563
|
-
const verboseOptions = verbose ? [
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
701
|
+
const verboseOptions = verbose ? [
|
|
702
|
+
"--verbose"
|
|
703
|
+
] : [
|
|
704
|
+
"--no-verbose"
|
|
705
|
+
];
|
|
706
|
+
const targetOptions = target ? [
|
|
707
|
+
"-t",
|
|
708
|
+
target
|
|
709
|
+
] : [];
|
|
710
|
+
const incrementalOptions = incremental ? [
|
|
711
|
+
"--since",
|
|
712
|
+
"-Apt",
|
|
713
|
+
"--topological-dev"
|
|
714
|
+
] : [
|
|
715
|
+
"--parallel",
|
|
716
|
+
"-Apt",
|
|
717
|
+
"--topological-dev"
|
|
718
|
+
];
|
|
719
|
+
const jobsOptions = jobs ? [
|
|
720
|
+
"-j",
|
|
721
|
+
`${jobs}`
|
|
722
|
+
] : [];
|
|
567
723
|
if (jobs) {
|
|
568
724
|
console.log(chalk11.blue(`Jobs set to [${jobs}]`));
|
|
569
725
|
}
|
|
570
726
|
const result = runSteps(`Compile${incremental ? "-Incremental" : ""} [All]`, [
|
|
571
|
-
[
|
|
572
|
-
"
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
727
|
+
[
|
|
728
|
+
"yarn",
|
|
729
|
+
[
|
|
730
|
+
"workspaces",
|
|
731
|
+
"foreach",
|
|
732
|
+
...incrementalOptions,
|
|
733
|
+
...jobsOptions,
|
|
734
|
+
...verboseOptions,
|
|
735
|
+
"run",
|
|
736
|
+
"package-compile",
|
|
737
|
+
...targetOptions
|
|
738
|
+
]
|
|
739
|
+
]
|
|
581
740
|
]);
|
|
582
741
|
console.log(`${chalk11.gray("Compiled in")} [${chalk11.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk11.gray("seconds")}`);
|
|
583
742
|
return result;
|
|
584
|
-
};
|
|
585
|
-
|
|
586
|
-
// src/actions/compile-types.ts
|
|
587
|
-
import chalk12 from "chalk";
|
|
588
|
-
var compileTypes = ({
|
|
589
|
-
verbose,
|
|
590
|
-
pkg,
|
|
591
|
-
incremental,
|
|
592
|
-
jobs
|
|
593
|
-
}) => {
|
|
594
|
-
if (verbose) {
|
|
595
|
-
console.log(chalk12.gray("Compiling Types"));
|
|
596
|
-
}
|
|
597
|
-
return pkg ? compileTypesPackage({ pkg, verbose }) : compileTypesAll({
|
|
598
|
-
incremental,
|
|
599
|
-
verbose,
|
|
600
|
-
jobs
|
|
601
|
-
});
|
|
602
|
-
};
|
|
603
|
-
var compileTypesPackage = ({ verbose, pkg }) => {
|
|
604
|
-
if (verbose) {
|
|
605
|
-
console.log(chalk12.gray("Compiling Types [Package]"));
|
|
606
|
-
}
|
|
607
|
-
return runSteps(
|
|
608
|
-
`Compile [${pkg}]`,
|
|
609
|
-
[["yarn", ["workspace", pkg, "run", "package-compile-types"]]]
|
|
610
|
-
);
|
|
611
|
-
};
|
|
612
|
-
var compileTypesAll = ({
|
|
613
|
-
jobs,
|
|
614
|
-
verbose,
|
|
615
|
-
incremental
|
|
616
|
-
}) => {
|
|
617
|
-
if (verbose) {
|
|
618
|
-
console.log(chalk12.gray("Compiling Types [All]"));
|
|
619
|
-
}
|
|
620
|
-
const start = Date.now();
|
|
621
|
-
const verboseOptions = verbose ? ["--verbose"] : ["--no-verbose"];
|
|
622
|
-
const incrementalOptions = incremental ? ["--since", "-Apt"] : ["--parallel", "-Apt"];
|
|
623
|
-
const jobsOptions = jobs ? ["-j", `${jobs}`] : [];
|
|
624
|
-
if (jobs) {
|
|
625
|
-
console.log(chalk12.blue(`Jobs set to [${jobs}]`));
|
|
626
|
-
}
|
|
627
|
-
const result = runSteps(`Compile Types ${incremental ? "[Incremental]" : ""} [All]`, [
|
|
628
|
-
["yarn", [
|
|
629
|
-
"workspaces",
|
|
630
|
-
"foreach",
|
|
631
|
-
...incrementalOptions,
|
|
632
|
-
...jobsOptions,
|
|
633
|
-
...verboseOptions,
|
|
634
|
-
"run",
|
|
635
|
-
"package-compile-types"
|
|
636
|
-
]]
|
|
637
|
-
]);
|
|
638
|
-
console.log(`${chalk12.gray("Types Compiled in")} [${chalk12.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk12.gray("seconds")}`);
|
|
639
|
-
return result;
|
|
640
|
-
};
|
|
743
|
+
}, "compileAll");
|
|
641
744
|
|
|
642
745
|
// src/actions/copy-assets.ts
|
|
643
746
|
import path2 from "path/posix";
|
|
644
|
-
import
|
|
747
|
+
import chalk12 from "chalk";
|
|
645
748
|
import cpy from "cpy";
|
|
646
|
-
var copyPackageTargetAssets = async (target, name, location) => {
|
|
749
|
+
var copyPackageTargetAssets = /* @__PURE__ */ __name(async (target, name, location) => {
|
|
647
750
|
try {
|
|
648
|
-
const values = await cpy(
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
751
|
+
const values = await cpy([
|
|
752
|
+
"**/*.jpg",
|
|
753
|
+
"**/*.png",
|
|
754
|
+
"**/*.gif",
|
|
755
|
+
"**/*.svg",
|
|
756
|
+
"**/*.webp",
|
|
757
|
+
"**/*.sass",
|
|
758
|
+
"**/*.scss",
|
|
759
|
+
"**/*.gif",
|
|
760
|
+
"**/*.css"
|
|
761
|
+
], `../dist/${target}`, {
|
|
762
|
+
cwd: path2.join(process.cwd(), location, "src"),
|
|
763
|
+
flat: false
|
|
764
|
+
});
|
|
656
765
|
for (const value of values) {
|
|
657
766
|
console.log(`${value.split("/").pop()} => ./dist/${target}`);
|
|
658
767
|
}
|
|
@@ -661,27 +770,25 @@ var copyPackageTargetAssets = async (target, name, location) => {
|
|
|
661
770
|
console.log(`Copy Failed: ${name}: ${reason}`);
|
|
662
771
|
return 1;
|
|
663
772
|
}
|
|
664
|
-
};
|
|
665
|
-
var copyTargetAssets = async (target, pkg) => {
|
|
773
|
+
}, "copyPackageTargetAssets");
|
|
774
|
+
var copyTargetAssets = /* @__PURE__ */ __name(async (target, pkg) => {
|
|
666
775
|
const workspaces = yarnWorkspaces();
|
|
667
|
-
console.log(
|
|
776
|
+
console.log(chalk12.green(`Copying Assets [${target.toUpperCase()}]`));
|
|
668
777
|
const workspaceList = workspaces.filter(({ name }) => {
|
|
669
778
|
return pkg === void 0 || name === pkg;
|
|
670
779
|
});
|
|
671
780
|
if (workspaceList.length === 0) {
|
|
672
781
|
console.error(`Package not found [${pkg}]`);
|
|
673
782
|
} else {
|
|
674
|
-
const results = await Promise.all(
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
})
|
|
679
|
-
);
|
|
783
|
+
const results = await Promise.all(workspaceList.map(async (workspace) => {
|
|
784
|
+
const { location, name } = workspace;
|
|
785
|
+
return await copyPackageTargetAssets(target, name, location);
|
|
786
|
+
}));
|
|
680
787
|
return results.reduce((prev, result) => prev || result, 0);
|
|
681
788
|
}
|
|
682
789
|
return 0;
|
|
683
|
-
};
|
|
684
|
-
var copyAssets = async ({ target, pkg }) => {
|
|
790
|
+
}, "copyTargetAssets");
|
|
791
|
+
var copyAssets = /* @__PURE__ */ __name(async ({ target, pkg }) => {
|
|
685
792
|
switch (target) {
|
|
686
793
|
case "esm": {
|
|
687
794
|
return await copyTargetAssets("esm", pkg);
|
|
@@ -693,21 +800,38 @@ var copyAssets = async ({ target, pkg }) => {
|
|
|
693
800
|
return await copyTargetAssets("esm", pkg) || await copyTargetAssets("cjs", pkg);
|
|
694
801
|
}
|
|
695
802
|
}
|
|
696
|
-
};
|
|
803
|
+
}, "copyAssets");
|
|
697
804
|
|
|
698
805
|
// src/actions/cycle.ts
|
|
699
806
|
import { cruise } from "dependency-cruiser";
|
|
700
|
-
var cycle = async ({ verbose, pkg } = {}) => {
|
|
701
|
-
return pkg ? cyclePackage({
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
807
|
+
var cycle = /* @__PURE__ */ __name(async ({ verbose, pkg } = {}) => {
|
|
808
|
+
return pkg ? cyclePackage({
|
|
809
|
+
pkg,
|
|
810
|
+
verbose
|
|
811
|
+
}) : await cycleAll({
|
|
812
|
+
verbose
|
|
813
|
+
});
|
|
814
|
+
}, "cycle");
|
|
815
|
+
var cyclePackage = /* @__PURE__ */ __name(({ pkg, verbose }) => {
|
|
816
|
+
const verboseOptions = verbose ? [
|
|
817
|
+
"--verbose"
|
|
818
|
+
] : [
|
|
819
|
+
"--no-verbose"
|
|
820
|
+
];
|
|
821
|
+
return runSteps(`Cycle [${pkg}]`, [
|
|
822
|
+
[
|
|
823
|
+
"yarn",
|
|
824
|
+
[
|
|
825
|
+
"workspace",
|
|
826
|
+
pkg,
|
|
827
|
+
"run",
|
|
828
|
+
"package-cycle",
|
|
829
|
+
...verboseOptions
|
|
830
|
+
]
|
|
831
|
+
]
|
|
832
|
+
]);
|
|
833
|
+
}, "cyclePackage");
|
|
834
|
+
var cycleAll = /* @__PURE__ */ __name(async ({ verbose = false }) => {
|
|
711
835
|
const pkgName = process.env.npm_package_name;
|
|
712
836
|
const cruiseOptions = {
|
|
713
837
|
ruleSet: {
|
|
@@ -717,20 +841,26 @@ var cycleAll = async ({ verbose = false }) => {
|
|
|
717
841
|
severity: "error",
|
|
718
842
|
comment: "This dependency creates a circular reference",
|
|
719
843
|
from: {},
|
|
720
|
-
to: {
|
|
844
|
+
to: {
|
|
845
|
+
circular: true
|
|
846
|
+
}
|
|
721
847
|
}
|
|
722
848
|
]
|
|
723
849
|
},
|
|
724
850
|
exclude: "node_modules|packages/.*/packages",
|
|
725
851
|
validate: true,
|
|
726
|
-
doNotFollow: {
|
|
852
|
+
doNotFollow: {
|
|
853
|
+
path: "node_modules|packages/.*/packages"
|
|
854
|
+
},
|
|
727
855
|
tsPreCompilationDeps: false,
|
|
728
856
|
combinedDependencies: true,
|
|
729
857
|
outputType: verbose ? "text" : "err"
|
|
730
858
|
};
|
|
731
859
|
const target = "**/src";
|
|
732
860
|
console.log(`Checking for circular dependencies in ${target}...`);
|
|
733
|
-
const result = await cruise([
|
|
861
|
+
const result = await cruise([
|
|
862
|
+
target
|
|
863
|
+
], cruiseOptions);
|
|
734
864
|
if (result.output) {
|
|
735
865
|
console.log(result.output);
|
|
736
866
|
}
|
|
@@ -740,30 +870,52 @@ var cycleAll = async ({ verbose = false }) => {
|
|
|
740
870
|
console.error(`${pkgName} \u274C Dependency violations found`);
|
|
741
871
|
}
|
|
742
872
|
return result.exitCode;
|
|
743
|
-
};
|
|
873
|
+
}, "cycleAll");
|
|
744
874
|
|
|
745
875
|
// src/actions/dead.ts
|
|
746
|
-
var dead = () => {
|
|
747
|
-
return runSteps("Dead", [
|
|
748
|
-
|
|
876
|
+
var dead = /* @__PURE__ */ __name(() => {
|
|
877
|
+
return runSteps("Dead", [
|
|
878
|
+
[
|
|
879
|
+
"yarn",
|
|
880
|
+
[
|
|
881
|
+
"ts-prune",
|
|
882
|
+
"-p",
|
|
883
|
+
"tsconfig.json"
|
|
884
|
+
]
|
|
885
|
+
]
|
|
886
|
+
]);
|
|
887
|
+
}, "dead");
|
|
749
888
|
|
|
750
889
|
// src/actions/deplint/deplint.ts
|
|
751
|
-
import
|
|
890
|
+
import chalk17 from "chalk";
|
|
752
891
|
|
|
753
892
|
// src/actions/deplint/findFilesByGlob.ts
|
|
754
893
|
import { globSync } from "glob";
|
|
755
|
-
function findFilesByGlob(
|
|
756
|
-
return globSync(pattern, {
|
|
894
|
+
function findFilesByGlob(cwd5, pattern) {
|
|
895
|
+
return globSync(pattern, {
|
|
896
|
+
cwd: cwd5,
|
|
897
|
+
absolute: true
|
|
898
|
+
});
|
|
757
899
|
}
|
|
900
|
+
__name(findFilesByGlob, "findFilesByGlob");
|
|
758
901
|
|
|
759
902
|
// src/actions/deplint/findFiles.ts
|
|
760
|
-
function findFiles(
|
|
761
|
-
const allSourceInclude = [
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
const
|
|
765
|
-
|
|
903
|
+
function findFiles(path11) {
|
|
904
|
+
const allSourceInclude = [
|
|
905
|
+
"./src/**/*.{ts,tsx}"
|
|
906
|
+
];
|
|
907
|
+
const allDistInclude = [
|
|
908
|
+
"./dist/**/*.d.ts",
|
|
909
|
+
"./dist/**/*.{mjs,js,cjs}"
|
|
910
|
+
];
|
|
911
|
+
const srcFiles = allSourceInclude.flatMap((pattern) => findFilesByGlob(path11, pattern));
|
|
912
|
+
const distFiles = allDistInclude.flatMap((pattern) => findFilesByGlob(path11, pattern));
|
|
913
|
+
return {
|
|
914
|
+
srcFiles,
|
|
915
|
+
distFiles
|
|
916
|
+
};
|
|
766
917
|
}
|
|
918
|
+
__name(findFiles, "findFiles");
|
|
767
919
|
|
|
768
920
|
// src/actions/deplint/getDependenciesFromPackageJson.ts
|
|
769
921
|
import fs2 from "fs";
|
|
@@ -781,6 +933,7 @@ function getDependenciesFromPackageJson(packageJsonPath) {
|
|
|
781
933
|
peerDependencies
|
|
782
934
|
};
|
|
783
935
|
}
|
|
936
|
+
__name(getDependenciesFromPackageJson, "getDependenciesFromPackageJson");
|
|
784
937
|
|
|
785
938
|
// src/actions/deplint/getImportsFromFile.ts
|
|
786
939
|
import fs3 from "fs";
|
|
@@ -796,18 +949,13 @@ function getBasePackageName(importName) {
|
|
|
796
949
|
}
|
|
797
950
|
return importNameScrubbed.split("/")[0];
|
|
798
951
|
}
|
|
952
|
+
__name(getBasePackageName, "getBasePackageName");
|
|
799
953
|
|
|
800
954
|
// src/actions/deplint/getImportsFromFile.ts
|
|
801
955
|
function getImportsFromFile(filePath, importPaths, typeImportPaths) {
|
|
802
956
|
const sourceCode = fs3.readFileSync(filePath, "utf8");
|
|
803
957
|
const isMjsFile = filePath.endsWith(".mjs");
|
|
804
|
-
const sourceFile = ts.createSourceFile(
|
|
805
|
-
path4.basename(filePath),
|
|
806
|
-
sourceCode,
|
|
807
|
-
ts.ScriptTarget.Latest,
|
|
808
|
-
true,
|
|
809
|
-
isMjsFile ? ts.ScriptKind.JS : void 0
|
|
810
|
-
);
|
|
958
|
+
const sourceFile = ts.createSourceFile(path4.basename(filePath), sourceCode, ts.ScriptTarget.Latest, true, isMjsFile ? ts.ScriptKind.JS : void 0);
|
|
811
959
|
const imports = [];
|
|
812
960
|
const typeImports = [];
|
|
813
961
|
const isDeclarationFile = filePath.endsWith(".d.ts");
|
|
@@ -832,8 +980,13 @@ function getImportsFromFile(filePath, importPaths, typeImportPaths) {
|
|
|
832
980
|
}
|
|
833
981
|
ts.forEachChild(node, visit);
|
|
834
982
|
}
|
|
983
|
+
__name(visit, "visit");
|
|
835
984
|
visit(sourceFile);
|
|
836
|
-
const importsStartsWithExcludes = [
|
|
985
|
+
const importsStartsWithExcludes = [
|
|
986
|
+
".",
|
|
987
|
+
"#",
|
|
988
|
+
"node:"
|
|
989
|
+
];
|
|
837
990
|
const cleanedImports = imports.filter((imp) => !importsStartsWithExcludes.some((exc) => imp.startsWith(exc))).map(getBasePackageName);
|
|
838
991
|
const cleanedTypeImports = typeImports.filter((imp) => !importsStartsWithExcludes.some((exc) => imp.startsWith(exc))).map(getBasePackageName);
|
|
839
992
|
for (const imp of cleanedImports) {
|
|
@@ -844,23 +997,31 @@ function getImportsFromFile(filePath, importPaths, typeImportPaths) {
|
|
|
844
997
|
typeImportPaths[imp] = typeImportPaths[imp] ?? [];
|
|
845
998
|
typeImportPaths[imp].push(filePath);
|
|
846
999
|
}
|
|
847
|
-
return [
|
|
1000
|
+
return [
|
|
1001
|
+
cleanedImports,
|
|
1002
|
+
cleanedTypeImports
|
|
1003
|
+
];
|
|
848
1004
|
}
|
|
1005
|
+
__name(getImportsFromFile, "getImportsFromFile");
|
|
849
1006
|
|
|
850
1007
|
// src/actions/deplint/getExternalImportsFromFiles.ts
|
|
851
|
-
var internalImportPrefixes = [
|
|
852
|
-
|
|
1008
|
+
var internalImportPrefixes = [
|
|
1009
|
+
".",
|
|
1010
|
+
"#",
|
|
1011
|
+
"node:"
|
|
1012
|
+
];
|
|
1013
|
+
var removeInternalImports = /* @__PURE__ */ __name((imports) => {
|
|
853
1014
|
return imports.filter((imp) => !internalImportPrefixes.some((prefix) => imp.startsWith(prefix)));
|
|
854
|
-
};
|
|
1015
|
+
}, "removeInternalImports");
|
|
855
1016
|
function getExternalImportsFromFiles({ srcFiles, distFiles }) {
|
|
856
1017
|
const srcImportPaths = {};
|
|
857
1018
|
const distImportPaths = {};
|
|
858
1019
|
const distTypeImportPaths = {};
|
|
859
|
-
for (const
|
|
1020
|
+
for (const path11 of srcFiles) getImportsFromFile(path11, srcImportPaths, srcImportPaths).flat();
|
|
860
1021
|
const distTypeFiles = distFiles.filter((file) => file.endsWith(".d.ts") || file.endsWith(".d.cts") || file.endsWith(".d.mts"));
|
|
861
1022
|
const distCodeFiles = distFiles.filter((file) => !(file.endsWith(".d.ts") || file.endsWith(".d.cts") || file.endsWith(".d.mts")));
|
|
862
|
-
for (const
|
|
863
|
-
for (const
|
|
1023
|
+
for (const path11 of distCodeFiles) getImportsFromFile(path11, distImportPaths, distImportPaths).flat();
|
|
1024
|
+
for (const path11 of distTypeFiles) getImportsFromFile(path11, distTypeImportPaths, distTypeImportPaths).flat();
|
|
864
1025
|
const srcImports = Object.keys(srcImportPaths);
|
|
865
1026
|
const distImports = Object.keys(distImportPaths);
|
|
866
1027
|
const distTypeImports = Object.keys(distTypeImportPaths);
|
|
@@ -877,143 +1038,137 @@ function getExternalImportsFromFiles({ srcFiles, distFiles }) {
|
|
|
877
1038
|
externalDistTypeImports
|
|
878
1039
|
};
|
|
879
1040
|
}
|
|
1041
|
+
__name(getExternalImportsFromFiles, "getExternalImportsFromFiles");
|
|
880
1042
|
|
|
881
1043
|
// src/actions/deplint/checkPackage/getUnlistedDependencies.ts
|
|
882
1044
|
import { builtinModules } from "module";
|
|
883
|
-
import
|
|
884
|
-
function getUnlistedDependencies({ name, location }, { dependencies, peerDependencies }, {
|
|
885
|
-
externalDistImports,
|
|
886
|
-
externalDistTypeImports,
|
|
887
|
-
distImportPaths
|
|
888
|
-
}) {
|
|
1045
|
+
import chalk13 from "chalk";
|
|
1046
|
+
function getUnlistedDependencies({ name, location }, { dependencies, peerDependencies }, { externalDistImports, externalDistTypeImports, distImportPaths }) {
|
|
889
1047
|
let unlistedDependencies = 0;
|
|
890
1048
|
for (const imp of externalDistImports) {
|
|
891
|
-
if (!dependencies.includes(imp) && !dependencies.includes(`@types/${imp}`) && !peerDependencies.includes(imp) && !peerDependencies.includes(`@types/${imp}`) && !builtinModules.includes(imp) && !builtinModules.includes(`@types/${imp}`)) {
|
|
1049
|
+
if (!dependencies.includes(imp) && imp !== name && !dependencies.includes(`@types/${imp}`) && !peerDependencies.includes(imp) && !peerDependencies.includes(`@types/${imp}`) && !builtinModules.includes(imp) && !builtinModules.includes(`@types/${imp}`)) {
|
|
892
1050
|
unlistedDependencies++;
|
|
893
|
-
console.log(`[${
|
|
1051
|
+
console.log(`[${chalk13.blue(name)}] Missing dependency in package.json: ${chalk13.red(imp)}`);
|
|
894
1052
|
console.log(` ${distImportPaths[imp].join("\n ")}`);
|
|
895
1053
|
}
|
|
896
1054
|
}
|
|
897
1055
|
for (const imp of externalDistTypeImports) {
|
|
898
|
-
if (!dependencies.includes(imp) && dependencies.includes(`@types/${imp}`) && !peerDependencies.includes(imp) && peerDependencies.includes(`@types/${imp}`) && !builtinModules.includes(imp) && builtinModules.includes(`@types/${imp}`)) {
|
|
1056
|
+
if (!dependencies.includes(imp) && imp !== name && dependencies.includes(`@types/${imp}`) && !peerDependencies.includes(imp) && peerDependencies.includes(`@types/${imp}`) && !builtinModules.includes(imp) && builtinModules.includes(`@types/${imp}`)) {
|
|
899
1057
|
unlistedDependencies++;
|
|
900
|
-
console.log(`[${
|
|
1058
|
+
console.log(`[${chalk13.blue(name)}] Missing dependency in package.json: ${chalk13.red(imp)}`);
|
|
901
1059
|
console.log(` ${distImportPaths[imp].join("\n ")}`);
|
|
902
1060
|
}
|
|
903
1061
|
}
|
|
904
1062
|
if (unlistedDependencies > 0) {
|
|
905
1063
|
const packageLocation = `${location}/package.json`;
|
|
906
|
-
console.log(` ${
|
|
1064
|
+
console.log(` ${chalk13.yellow(packageLocation)}
|
|
907
1065
|
`);
|
|
908
1066
|
}
|
|
909
1067
|
return unlistedDependencies;
|
|
910
1068
|
}
|
|
1069
|
+
__name(getUnlistedDependencies, "getUnlistedDependencies");
|
|
911
1070
|
|
|
912
1071
|
// src/actions/deplint/checkPackage/getUnlistedDevDependencies.ts
|
|
913
1072
|
import { builtinModules as builtinModules2 } from "module";
|
|
914
|
-
import
|
|
915
|
-
function getUnlistedDevDependencies({ name, location }, {
|
|
916
|
-
devDependencies,
|
|
917
|
-
dependencies,
|
|
918
|
-
peerDependencies
|
|
919
|
-
}, {
|
|
920
|
-
srcImportPaths,
|
|
921
|
-
externalSrcImports,
|
|
922
|
-
distImports
|
|
923
|
-
}) {
|
|
1073
|
+
import chalk14 from "chalk";
|
|
1074
|
+
function getUnlistedDevDependencies({ name, location }, { devDependencies, dependencies, peerDependencies }, { srcImportPaths, externalSrcImports, distImports }) {
|
|
924
1075
|
let unlistedDevDependencies = 0;
|
|
925
1076
|
for (const imp of externalSrcImports) {
|
|
926
|
-
if (!distImports.includes(imp) && !dependencies.includes(imp) && !dependencies.includes(`@types/${imp}`) && !peerDependencies.includes(imp) && !peerDependencies.includes(`@types/${imp}`) && !devDependencies.includes(imp) && !devDependencies.includes(`@types/${imp}`) && !builtinModules2.includes(imp)) {
|
|
1077
|
+
if (!distImports.includes(imp) && imp !== name && !dependencies.includes(imp) && !dependencies.includes(`@types/${imp}`) && !peerDependencies.includes(imp) && !peerDependencies.includes(`@types/${imp}`) && !devDependencies.includes(imp) && !devDependencies.includes(`@types/${imp}`) && !builtinModules2.includes(imp)) {
|
|
927
1078
|
unlistedDevDependencies++;
|
|
928
|
-
console.log(`[${
|
|
1079
|
+
console.log(`[${chalk14.blue(name)}] Missing devDependency in package.json: ${chalk14.red(imp)}`);
|
|
929
1080
|
console.log(` ${srcImportPaths[imp].join("\n ")}`);
|
|
930
1081
|
}
|
|
931
1082
|
}
|
|
932
1083
|
if (unlistedDevDependencies > 0) {
|
|
933
1084
|
const packageLocation = `${location}/package.json`;
|
|
934
|
-
console.log(` ${
|
|
1085
|
+
console.log(` ${chalk14.yellow(packageLocation)}
|
|
935
1086
|
`);
|
|
936
1087
|
}
|
|
937
1088
|
return unlistedDevDependencies;
|
|
938
1089
|
}
|
|
1090
|
+
__name(getUnlistedDevDependencies, "getUnlistedDevDependencies");
|
|
939
1091
|
|
|
940
1092
|
// src/actions/deplint/checkPackage/getUnusedDependencies.ts
|
|
941
|
-
import
|
|
942
|
-
function getUnusedDependencies({ name, location }, { dependencies }, {
|
|
943
|
-
externalDistImports,
|
|
944
|
-
externalDistTypeImports,
|
|
945
|
-
externalSrcImports
|
|
946
|
-
}) {
|
|
1093
|
+
import chalk15 from "chalk";
|
|
1094
|
+
function getUnusedDependencies({ name, location }, { dependencies }, { externalDistImports, externalDistTypeImports, externalSrcImports }) {
|
|
947
1095
|
let unusedDependencies = 0;
|
|
948
1096
|
for (const dep of dependencies) {
|
|
949
1097
|
if (!externalDistImports.includes(dep) && !externalDistImports.includes(dep.replace(/^@types\//, "")) && !externalDistTypeImports.includes(dep) && !externalDistTypeImports.includes(dep.replace(/^@types\//, ""))) {
|
|
950
1098
|
unusedDependencies++;
|
|
951
1099
|
if (externalSrcImports.includes(dep)) {
|
|
952
|
-
console.log(`[${
|
|
1100
|
+
console.log(`[${chalk15.blue(name)}] dependency should be devDependency in package.json: ${chalk15.red(dep)}`);
|
|
953
1101
|
} else {
|
|
954
|
-
console.log(`[${
|
|
1102
|
+
console.log(`[${chalk15.blue(name)}] Unused dependency in package.json: ${chalk15.red(dep)}`);
|
|
955
1103
|
}
|
|
956
1104
|
}
|
|
957
1105
|
}
|
|
958
1106
|
if (unusedDependencies > 0) {
|
|
959
1107
|
const packageLocation = `${location}/package.json`;
|
|
960
|
-
console.log(` ${
|
|
1108
|
+
console.log(` ${chalk15.yellow(packageLocation)}
|
|
961
1109
|
`);
|
|
962
1110
|
}
|
|
963
1111
|
return unusedDependencies;
|
|
964
1112
|
}
|
|
1113
|
+
__name(getUnusedDependencies, "getUnusedDependencies");
|
|
965
1114
|
|
|
966
1115
|
// src/actions/deplint/checkPackage/getUnusedPeerDependencies.ts
|
|
967
|
-
import
|
|
1116
|
+
import chalk16 from "chalk";
|
|
968
1117
|
function getUnusedPeerDependencies({ name, location }, { peerDependencies, dependencies }, { externalDistImports, externalDistTypeImports }) {
|
|
969
1118
|
let unusedDependencies = 0;
|
|
970
1119
|
for (const dep of peerDependencies) {
|
|
971
1120
|
if (!externalDistImports.includes(dep) && !externalDistImports.includes(dep.replace(/^@types\//, "")) && !externalDistTypeImports.includes(dep) && !externalDistTypeImports.includes(dep.replace(/^@types\//, ""))) {
|
|
972
1121
|
unusedDependencies++;
|
|
973
1122
|
if (dependencies.includes(dep)) {
|
|
974
|
-
console.log(`[${
|
|
1123
|
+
console.log(`[${chalk16.blue(name)}] Unused peerDependency [already a dependency] in package.json: ${chalk16.red(dep)}`);
|
|
975
1124
|
} else {
|
|
976
|
-
console.log(`[${
|
|
1125
|
+
console.log(`[${chalk16.blue(name)}] Unused peerDependency in package.json: ${chalk16.red(dep)}`);
|
|
977
1126
|
}
|
|
978
1127
|
}
|
|
979
1128
|
}
|
|
980
1129
|
if (unusedDependencies > 0) {
|
|
981
1130
|
const packageLocation = `${location}/package.json`;
|
|
982
|
-
console.log(` ${
|
|
1131
|
+
console.log(` ${chalk16.yellow(packageLocation)}
|
|
983
1132
|
`);
|
|
984
1133
|
}
|
|
985
1134
|
return unusedDependencies;
|
|
986
1135
|
}
|
|
1136
|
+
__name(getUnusedPeerDependencies, "getUnusedPeerDependencies");
|
|
987
1137
|
|
|
988
1138
|
// src/actions/deplint/checkPackage/checkPackage.ts
|
|
989
|
-
function checkPackage({
|
|
990
|
-
name,
|
|
991
|
-
location,
|
|
992
|
-
deps = false,
|
|
993
|
-
devDeps = false,
|
|
994
|
-
peerDeps = false
|
|
995
|
-
}) {
|
|
1139
|
+
function checkPackage({ name, location, deps = false, devDeps = false, peerDeps = false }) {
|
|
996
1140
|
const { srcFiles, distFiles } = findFiles(location);
|
|
997
1141
|
const checkDeps = deps || !(deps || devDeps || peerDeps);
|
|
998
1142
|
const checkDevDeps = devDeps || !(deps || devDeps || peerDeps);
|
|
999
1143
|
const checkPeerDeps = peerDeps;
|
|
1000
|
-
const sourceParams = getExternalImportsFromFiles({
|
|
1144
|
+
const sourceParams = getExternalImportsFromFiles({
|
|
1145
|
+
srcFiles,
|
|
1146
|
+
distFiles
|
|
1147
|
+
});
|
|
1001
1148
|
const packageParams = getDependenciesFromPackageJson(`${location}/package.json`);
|
|
1002
|
-
const unlistedDependencies = checkDeps ? getUnlistedDependencies({
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1149
|
+
const unlistedDependencies = checkDeps ? getUnlistedDependencies({
|
|
1150
|
+
name,
|
|
1151
|
+
location
|
|
1152
|
+
}, packageParams, sourceParams) : 0;
|
|
1153
|
+
const unusedDependencies = checkDeps ? getUnusedDependencies({
|
|
1154
|
+
name,
|
|
1155
|
+
location
|
|
1156
|
+
}, packageParams, sourceParams) : 0;
|
|
1157
|
+
const unlistedDevDependencies = checkDevDeps ? getUnlistedDevDependencies({
|
|
1158
|
+
name,
|
|
1159
|
+
location
|
|
1160
|
+
}, packageParams, sourceParams) : 0;
|
|
1161
|
+
const unusedPeerDependencies = checkPeerDeps ? getUnusedPeerDependencies({
|
|
1162
|
+
name,
|
|
1163
|
+
location
|
|
1164
|
+
}, packageParams, sourceParams) : 0;
|
|
1006
1165
|
const totalErrors = unlistedDependencies + unlistedDevDependencies + unusedDependencies + unusedPeerDependencies;
|
|
1007
1166
|
return totalErrors;
|
|
1008
1167
|
}
|
|
1168
|
+
__name(checkPackage, "checkPackage");
|
|
1009
1169
|
|
|
1010
1170
|
// src/actions/deplint/deplint.ts
|
|
1011
|
-
var deplint = ({
|
|
1012
|
-
pkg,
|
|
1013
|
-
deps,
|
|
1014
|
-
devDeps,
|
|
1015
|
-
peerDeps
|
|
1016
|
-
}) => {
|
|
1171
|
+
var deplint = /* @__PURE__ */ __name(({ pkg, deps, devDeps, peerDeps }) => {
|
|
1017
1172
|
if (pkg) {
|
|
1018
1173
|
const { location, name } = yarnWorkspace(pkg);
|
|
1019
1174
|
console.log(`Running Deplint for ${name}`);
|
|
@@ -1037,189 +1192,303 @@ var deplint = ({
|
|
|
1037
1192
|
});
|
|
1038
1193
|
}
|
|
1039
1194
|
if (totalErrors > 0) {
|
|
1040
|
-
console.log(`Deplint: Found ${
|
|
1195
|
+
console.log(`Deplint: Found ${chalk17.red(totalErrors)} dependency problems. ${chalk17.red("\u2716")}`);
|
|
1041
1196
|
} else {
|
|
1042
|
-
console.log(`Deplint: Found no dependency problems. ${
|
|
1197
|
+
console.log(`Deplint: Found no dependency problems. ${chalk17.green("\u2714")}`);
|
|
1043
1198
|
}
|
|
1044
1199
|
}
|
|
1045
1200
|
return 0;
|
|
1046
|
-
};
|
|
1201
|
+
}, "deplint");
|
|
1047
1202
|
|
|
1048
1203
|
// src/actions/deploy.ts
|
|
1049
1204
|
import { readFileSync as readFileSync5 } from "fs";
|
|
1050
|
-
var privatePackageExcludeList = () => {
|
|
1205
|
+
var privatePackageExcludeList = /* @__PURE__ */ __name(() => {
|
|
1051
1206
|
const possibleDeployablePackages = yarnWorkspaces().map((workspace) => [
|
|
1052
1207
|
workspace,
|
|
1053
|
-
JSON.parse(readFileSync5(`${workspace.location}/package.json`, {
|
|
1208
|
+
JSON.parse(readFileSync5(`${workspace.location}/package.json`, {
|
|
1209
|
+
encoding: "utf8"
|
|
1210
|
+
}))
|
|
1054
1211
|
]);
|
|
1055
1212
|
const privatePackages = possibleDeployablePackages.filter(([_, pkg]) => pkg.private).map(([workspace]) => workspace);
|
|
1056
1213
|
const excludeList = privatePackages.map((workspace) => `--exclude ${workspace.name}`);
|
|
1057
1214
|
return excludeList;
|
|
1058
|
-
};
|
|
1059
|
-
var deploy = () => {
|
|
1215
|
+
}, "privatePackageExcludeList");
|
|
1216
|
+
var deploy = /* @__PURE__ */ __name(() => {
|
|
1060
1217
|
const excludeList = privatePackageExcludeList();
|
|
1061
1218
|
if (excludeList.length > 0) {
|
|
1062
1219
|
console.log("Excluding private packages from deployment:", excludeList);
|
|
1063
1220
|
}
|
|
1064
1221
|
return runSteps("Deploy [Patch]", [
|
|
1065
|
-
[
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
[
|
|
1222
|
+
[
|
|
1223
|
+
"yarn",
|
|
1224
|
+
"workspaces foreach --all version patch --deferred"
|
|
1225
|
+
],
|
|
1226
|
+
[
|
|
1227
|
+
"yarn",
|
|
1228
|
+
"xy clean"
|
|
1229
|
+
],
|
|
1230
|
+
[
|
|
1231
|
+
"yarn",
|
|
1232
|
+
"xy build"
|
|
1233
|
+
],
|
|
1234
|
+
[
|
|
1235
|
+
"yarn",
|
|
1236
|
+
"version apply --all"
|
|
1237
|
+
],
|
|
1238
|
+
[
|
|
1239
|
+
"yarn",
|
|
1240
|
+
`workspaces foreach --all ${excludeList.join(" ")} --parallel npm publish`
|
|
1241
|
+
]
|
|
1070
1242
|
]);
|
|
1071
|
-
};
|
|
1243
|
+
}, "deploy");
|
|
1072
1244
|
|
|
1073
1245
|
// src/actions/deploy-major.ts
|
|
1074
1246
|
import { readFileSync as readFileSync6 } from "fs";
|
|
1075
|
-
var privatePackageExcludeList2 = () => {
|
|
1247
|
+
var privatePackageExcludeList2 = /* @__PURE__ */ __name(() => {
|
|
1076
1248
|
const possibleDeployablePackages = yarnWorkspaces().map((workspace) => [
|
|
1077
1249
|
workspace,
|
|
1078
|
-
JSON.parse(readFileSync6(`${workspace.location}/package.json`, {
|
|
1250
|
+
JSON.parse(readFileSync6(`${workspace.location}/package.json`, {
|
|
1251
|
+
encoding: "utf8"
|
|
1252
|
+
}))
|
|
1079
1253
|
]);
|
|
1080
1254
|
const privatePackages = possibleDeployablePackages.filter(([_, pkg]) => pkg.private).map(([workspace]) => workspace);
|
|
1081
1255
|
const excludeList = privatePackages.map((workspace) => `--exclude ${workspace.name}`);
|
|
1082
1256
|
return excludeList;
|
|
1083
|
-
};
|
|
1084
|
-
var deployMajor = () => {
|
|
1257
|
+
}, "privatePackageExcludeList");
|
|
1258
|
+
var deployMajor = /* @__PURE__ */ __name(() => {
|
|
1085
1259
|
const excludeList = privatePackageExcludeList2();
|
|
1086
1260
|
if (excludeList.length > 0) {
|
|
1087
1261
|
console.log("Excluding private packages from deployment:", excludeList);
|
|
1088
1262
|
}
|
|
1089
1263
|
return runSteps("Deploy [Major]", [
|
|
1090
|
-
[
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
[
|
|
1264
|
+
[
|
|
1265
|
+
"yarn",
|
|
1266
|
+
"workspaces foreach --all version major --deferred"
|
|
1267
|
+
],
|
|
1268
|
+
[
|
|
1269
|
+
"yarn",
|
|
1270
|
+
"xy clean"
|
|
1271
|
+
],
|
|
1272
|
+
[
|
|
1273
|
+
"yarn",
|
|
1274
|
+
"xy build"
|
|
1275
|
+
],
|
|
1276
|
+
[
|
|
1277
|
+
"yarn",
|
|
1278
|
+
"version apply --all"
|
|
1279
|
+
],
|
|
1280
|
+
[
|
|
1281
|
+
"yarn",
|
|
1282
|
+
`workspaces foreach --all ${excludeList.join(" ")} --parallel npm publish`
|
|
1283
|
+
]
|
|
1095
1284
|
]);
|
|
1096
|
-
};
|
|
1285
|
+
}, "deployMajor");
|
|
1097
1286
|
|
|
1098
1287
|
// src/actions/deploy-minor.ts
|
|
1099
1288
|
import { readFileSync as readFileSync7 } from "fs";
|
|
1100
|
-
var privatePackageExcludeList3 = () => {
|
|
1289
|
+
var privatePackageExcludeList3 = /* @__PURE__ */ __name(() => {
|
|
1101
1290
|
const possibleDeployablePackages = yarnWorkspaces().map((workspace) => [
|
|
1102
1291
|
workspace,
|
|
1103
|
-
JSON.parse(readFileSync7(`${workspace.location}/package.json`, {
|
|
1292
|
+
JSON.parse(readFileSync7(`${workspace.location}/package.json`, {
|
|
1293
|
+
encoding: "utf8"
|
|
1294
|
+
}))
|
|
1104
1295
|
]);
|
|
1105
1296
|
const privatePackages = possibleDeployablePackages.filter(([_, pkg]) => pkg.private).map(([workspace]) => workspace);
|
|
1106
1297
|
const excludeList = privatePackages.map((workspace) => `--exclude ${workspace.name}`);
|
|
1107
1298
|
return excludeList;
|
|
1108
|
-
};
|
|
1109
|
-
var deployMinor = () => {
|
|
1299
|
+
}, "privatePackageExcludeList");
|
|
1300
|
+
var deployMinor = /* @__PURE__ */ __name(() => {
|
|
1110
1301
|
const excludeList = privatePackageExcludeList3();
|
|
1111
1302
|
if (excludeList.length > 0) {
|
|
1112
1303
|
console.log("Excluding private packages from deployment:", excludeList);
|
|
1113
1304
|
}
|
|
1114
1305
|
return runSteps("Deploy [Minor]", [
|
|
1115
|
-
[
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
[
|
|
1306
|
+
[
|
|
1307
|
+
"yarn",
|
|
1308
|
+
"workspaces foreach --all version minor --deferred"
|
|
1309
|
+
],
|
|
1310
|
+
[
|
|
1311
|
+
"yarn",
|
|
1312
|
+
"xy clean"
|
|
1313
|
+
],
|
|
1314
|
+
[
|
|
1315
|
+
"yarn",
|
|
1316
|
+
"xy build"
|
|
1317
|
+
],
|
|
1318
|
+
[
|
|
1319
|
+
"yarn",
|
|
1320
|
+
"version apply --all"
|
|
1321
|
+
],
|
|
1322
|
+
[
|
|
1323
|
+
"yarn",
|
|
1324
|
+
`workspaces foreach --all ${excludeList.join(" ")} --parallel npm publish`
|
|
1325
|
+
]
|
|
1120
1326
|
]);
|
|
1121
|
-
};
|
|
1327
|
+
}, "deployMinor");
|
|
1122
1328
|
|
|
1123
1329
|
// src/actions/deploy-next.ts
|
|
1124
1330
|
import { readFileSync as readFileSync8 } from "fs";
|
|
1125
|
-
var privatePackageExcludeList4 = () => {
|
|
1331
|
+
var privatePackageExcludeList4 = /* @__PURE__ */ __name(() => {
|
|
1126
1332
|
const possibleDeployablePackages = yarnWorkspaces().map((workspace) => [
|
|
1127
1333
|
workspace,
|
|
1128
|
-
JSON.parse(readFileSync8(`${workspace.location}/package.json`, {
|
|
1334
|
+
JSON.parse(readFileSync8(`${workspace.location}/package.json`, {
|
|
1335
|
+
encoding: "utf8"
|
|
1336
|
+
}))
|
|
1129
1337
|
]);
|
|
1130
1338
|
const privatePackages = possibleDeployablePackages.filter(([_, pkg]) => pkg.private).map(([workspace]) => workspace);
|
|
1131
1339
|
const excludeList = privatePackages.map((workspace) => `--exclude ${workspace.name}`);
|
|
1132
1340
|
return excludeList;
|
|
1133
|
-
};
|
|
1134
|
-
var deployNext = () => {
|
|
1341
|
+
}, "privatePackageExcludeList");
|
|
1342
|
+
var deployNext = /* @__PURE__ */ __name(() => {
|
|
1135
1343
|
const excludeList = privatePackageExcludeList4();
|
|
1136
1344
|
if (excludeList.length > 0) {
|
|
1137
1345
|
console.log("Excluding private packages from deployment:", excludeList);
|
|
1138
1346
|
}
|
|
1139
1347
|
return runSteps("Deploy [Next]", [
|
|
1140
|
-
[
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
[
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1348
|
+
[
|
|
1349
|
+
"yarn",
|
|
1350
|
+
"workspaces foreach --all version minor --deferred"
|
|
1351
|
+
],
|
|
1352
|
+
[
|
|
1353
|
+
"yarn",
|
|
1354
|
+
"xy clean"
|
|
1355
|
+
],
|
|
1356
|
+
[
|
|
1357
|
+
"yarn",
|
|
1358
|
+
"xy build"
|
|
1359
|
+
],
|
|
1360
|
+
[
|
|
1361
|
+
"yarn",
|
|
1362
|
+
"version apply --all --prerelease"
|
|
1363
|
+
],
|
|
1364
|
+
[
|
|
1365
|
+
"yarn",
|
|
1366
|
+
`workspaces foreach --all ${excludeList.join(" ")} --parallel npm publish --tag next`
|
|
1367
|
+
]
|
|
1368
|
+
]);
|
|
1369
|
+
}, "deployNext");
|
|
1370
|
+
|
|
1371
|
+
// src/actions/dupdeps.ts
|
|
1372
|
+
import chalk18 from "chalk";
|
|
1373
|
+
var dupdeps = /* @__PURE__ */ __name(() => {
|
|
1374
|
+
console.log(chalk18.green("Checking all Dependencies for Duplicates"));
|
|
1152
1375
|
const allDependencies = parsedPackageJSON()?.dependencies;
|
|
1153
1376
|
const dependencies = Object.entries(allDependencies).map(([k]) => k);
|
|
1154
1377
|
return detectDuplicateDependencies(dependencies);
|
|
1155
|
-
};
|
|
1378
|
+
}, "dupdeps");
|
|
1156
1379
|
|
|
1157
1380
|
// src/actions/lint.ts
|
|
1158
|
-
import
|
|
1159
|
-
var lintPackage = ({ pkg, fix: fix2 }) => {
|
|
1160
|
-
console.log(
|
|
1381
|
+
import chalk19 from "chalk";
|
|
1382
|
+
var lintPackage = /* @__PURE__ */ __name(({ pkg, fix: fix2 }) => {
|
|
1383
|
+
console.log(chalk19.gray(`${fix2 ? "Fix" : "Lint"} [${pkg}]`));
|
|
1161
1384
|
const start = Date.now();
|
|
1162
1385
|
const result = runSteps(`${fix2 ? "Fix" : "Lint"} [${pkg}]`, [
|
|
1163
|
-
[
|
|
1164
|
-
"
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1386
|
+
[
|
|
1387
|
+
"yarn",
|
|
1388
|
+
[
|
|
1389
|
+
"workspace",
|
|
1390
|
+
pkg,
|
|
1391
|
+
"run",
|
|
1392
|
+
fix2 ? "package-fix" : "package-lint"
|
|
1393
|
+
]
|
|
1394
|
+
]
|
|
1169
1395
|
]);
|
|
1170
|
-
console.log(
|
|
1396
|
+
console.log(chalk19.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk19.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk19.gray("seconds")}`));
|
|
1171
1397
|
return result;
|
|
1172
|
-
};
|
|
1173
|
-
var lint = ({
|
|
1174
|
-
pkg,
|
|
1175
|
-
verbose,
|
|
1176
|
-
incremental,
|
|
1177
|
-
fix: fix2
|
|
1178
|
-
} = {}) => {
|
|
1398
|
+
}, "lintPackage");
|
|
1399
|
+
var lint = /* @__PURE__ */ __name(({ pkg, verbose, incremental, fix: fix2 } = {}) => {
|
|
1179
1400
|
return pkg === void 0 ? lintAllPackages({
|
|
1180
1401
|
verbose,
|
|
1181
1402
|
incremental,
|
|
1182
1403
|
fix: fix2
|
|
1183
|
-
}) : lintPackage({
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1404
|
+
}) : lintPackage({
|
|
1405
|
+
pkg,
|
|
1406
|
+
fix: fix2
|
|
1407
|
+
});
|
|
1408
|
+
}, "lint");
|
|
1409
|
+
var lintAllPackages = /* @__PURE__ */ __name(({ fix: fix2 = false } = {}) => {
|
|
1410
|
+
console.log(chalk19.gray(`${fix2 ? "Fix" : "Lint"} [All-Packages]`));
|
|
1187
1411
|
const start = Date.now();
|
|
1188
|
-
const fixOptions = fix2 ? [
|
|
1412
|
+
const fixOptions = fix2 ? [
|
|
1413
|
+
"--fix"
|
|
1414
|
+
] : [];
|
|
1189
1415
|
const result = runSteps(`${fix2 ? "Fix" : "Lint"} [All-Packages]`, [
|
|
1190
|
-
[
|
|
1416
|
+
[
|
|
1417
|
+
"yarn",
|
|
1418
|
+
[
|
|
1419
|
+
"eslint",
|
|
1420
|
+
...fixOptions
|
|
1421
|
+
]
|
|
1422
|
+
]
|
|
1191
1423
|
]);
|
|
1192
|
-
console.log(
|
|
1424
|
+
console.log(chalk19.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk19.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk19.gray("seconds")}`));
|
|
1193
1425
|
return result;
|
|
1194
|
-
};
|
|
1426
|
+
}, "lintAllPackages");
|
|
1195
1427
|
|
|
1196
1428
|
// src/actions/fix.ts
|
|
1197
|
-
var fix = (params) => {
|
|
1198
|
-
return lint({
|
|
1199
|
-
|
|
1429
|
+
var fix = /* @__PURE__ */ __name((params) => {
|
|
1430
|
+
return lint({
|
|
1431
|
+
...params,
|
|
1432
|
+
fix: true
|
|
1433
|
+
});
|
|
1434
|
+
}, "fix");
|
|
1200
1435
|
|
|
1201
1436
|
// src/actions/gen-docs.ts
|
|
1202
|
-
var genDocs = ({ pkg, incremental }) => {
|
|
1203
|
-
return pkg ? genDocsPackage({
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
};
|
|
1209
|
-
var
|
|
1210
|
-
const
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1437
|
+
var genDocs = /* @__PURE__ */ __name(({ pkg, incremental }) => {
|
|
1438
|
+
return pkg ? genDocsPackage({
|
|
1439
|
+
pkg
|
|
1440
|
+
}) : genDocsAll({
|
|
1441
|
+
incremental
|
|
1442
|
+
});
|
|
1443
|
+
}, "genDocs");
|
|
1444
|
+
var genDocsPackage = /* @__PURE__ */ __name(({ pkg }) => {
|
|
1445
|
+
const steps = [
|
|
1446
|
+
[
|
|
1447
|
+
"yarn",
|
|
1448
|
+
[
|
|
1449
|
+
"workspace",
|
|
1450
|
+
pkg,
|
|
1451
|
+
"run",
|
|
1452
|
+
"package-gen-docs"
|
|
1453
|
+
]
|
|
1454
|
+
]
|
|
1455
|
+
];
|
|
1456
|
+
return runSteps(`GenDocs [${pkg}]`, [
|
|
1457
|
+
...steps
|
|
1458
|
+
]);
|
|
1459
|
+
}, "genDocsPackage");
|
|
1460
|
+
var genDocsAll = /* @__PURE__ */ __name(({ incremental }) => {
|
|
1461
|
+
const incrementalOptions = incremental ? [
|
|
1462
|
+
"--since",
|
|
1463
|
+
"-pA"
|
|
1464
|
+
] : [
|
|
1465
|
+
"-pA"
|
|
1466
|
+
];
|
|
1467
|
+
const steps = [
|
|
1468
|
+
[
|
|
1469
|
+
"yarn",
|
|
1470
|
+
[
|
|
1471
|
+
"workspaces",
|
|
1472
|
+
"foreach",
|
|
1473
|
+
...incrementalOptions,
|
|
1474
|
+
"run",
|
|
1475
|
+
"package-gen-docs"
|
|
1476
|
+
]
|
|
1477
|
+
]
|
|
1478
|
+
];
|
|
1479
|
+
return runSteps(`GenDocs [All${incremental ? "-Incremental" : ""}]`, [
|
|
1480
|
+
...steps
|
|
1481
|
+
]);
|
|
1482
|
+
}, "genDocsAll");
|
|
1214
1483
|
|
|
1215
1484
|
// src/actions/gitignore-gen.ts
|
|
1216
1485
|
var filename = ".gitignore";
|
|
1217
|
-
var gitignoreGen = (pkg) => generateIgnoreFiles(filename, pkg);
|
|
1486
|
+
var gitignoreGen = /* @__PURE__ */ __name((pkg) => generateIgnoreFiles(filename, pkg), "gitignoreGen");
|
|
1218
1487
|
|
|
1219
1488
|
// src/actions/gitlint.ts
|
|
1220
|
-
import
|
|
1489
|
+
import chalk20 from "chalk";
|
|
1221
1490
|
import ParseGitConfig from "parse-git-config";
|
|
1222
|
-
var gitlint = () => {
|
|
1491
|
+
var gitlint = /* @__PURE__ */ __name(() => {
|
|
1223
1492
|
console.log(`
|
|
1224
1493
|
Gitlint Start [${process.cwd()}]
|
|
1225
1494
|
`);
|
|
@@ -1227,10 +1496,10 @@ Gitlint Start [${process.cwd()}]
|
|
|
1227
1496
|
let warnings = 0;
|
|
1228
1497
|
const errors = 0;
|
|
1229
1498
|
const gitConfig = ParseGitConfig.sync();
|
|
1230
|
-
const warn = (message) => {
|
|
1231
|
-
console.warn(
|
|
1499
|
+
const warn = /* @__PURE__ */ __name((message) => {
|
|
1500
|
+
console.warn(chalk20.yellow(`Warning: ${message}`));
|
|
1232
1501
|
warnings++;
|
|
1233
|
-
};
|
|
1502
|
+
}, "warn");
|
|
1234
1503
|
if (gitConfig.core.ignorecase) {
|
|
1235
1504
|
warn("Please set core.ignorecase to FALSE in .git/config file [run yarn gitlint-fix]");
|
|
1236
1505
|
} else {
|
|
@@ -1248,52 +1517,67 @@ Gitlint Start [${process.cwd()}]
|
|
|
1248
1517
|
}
|
|
1249
1518
|
const resultMessages = [];
|
|
1250
1519
|
if (valid > 0) {
|
|
1251
|
-
resultMessages.push(
|
|
1520
|
+
resultMessages.push(chalk20.green(`Passed: ${valid}`));
|
|
1252
1521
|
}
|
|
1253
1522
|
if (warnings > 0) {
|
|
1254
|
-
resultMessages.push(
|
|
1523
|
+
resultMessages.push(chalk20.yellow(`Warnings: ${warnings}`));
|
|
1255
1524
|
}
|
|
1256
1525
|
if (errors > 0) {
|
|
1257
|
-
resultMessages.push(
|
|
1526
|
+
resultMessages.push(chalk20.red(` Errors: ${errors}`));
|
|
1258
1527
|
}
|
|
1259
1528
|
console.warn(`Gitlint Finish [ ${resultMessages.join(" | ")} ]
|
|
1260
1529
|
`);
|
|
1261
1530
|
return warnings + errors === 0 ? 1 : 0;
|
|
1262
|
-
};
|
|
1531
|
+
}, "gitlint");
|
|
1263
1532
|
|
|
1264
1533
|
// src/actions/gitlint-fix.ts
|
|
1265
1534
|
import { execSync as execSync2 } from "child_process";
|
|
1266
|
-
import
|
|
1535
|
+
import chalk21 from "chalk";
|
|
1267
1536
|
import ParseGitConfig2 from "parse-git-config";
|
|
1268
|
-
var gitlintFix = () => {
|
|
1537
|
+
var gitlintFix = /* @__PURE__ */ __name(() => {
|
|
1269
1538
|
console.log(`
|
|
1270
1539
|
Gitlint Fix Start [${process.cwd()}]
|
|
1271
1540
|
`);
|
|
1272
1541
|
const gitConfig = ParseGitConfig2.sync();
|
|
1273
1542
|
if (gitConfig.core.ignorecase) {
|
|
1274
|
-
execSync2("git config core.ignorecase false", {
|
|
1275
|
-
|
|
1543
|
+
execSync2("git config core.ignorecase false", {
|
|
1544
|
+
stdio: "inherit"
|
|
1545
|
+
});
|
|
1546
|
+
console.warn(chalk21.yellow("\nGitlint Fix: Updated core.ignorecase to be false\n"));
|
|
1276
1547
|
}
|
|
1277
1548
|
if (gitConfig.core.autocrlf !== false) {
|
|
1278
|
-
execSync2("git config core.autocrlf false", {
|
|
1279
|
-
|
|
1549
|
+
execSync2("git config core.autocrlf false", {
|
|
1550
|
+
stdio: "inherit"
|
|
1551
|
+
});
|
|
1552
|
+
console.warn(chalk21.yellow("\nGitlint Fix: Updated core.autocrlf to be false\n"));
|
|
1280
1553
|
}
|
|
1281
1554
|
if (gitConfig.core.eol !== "lf") {
|
|
1282
|
-
execSync2("git config core.eol lf", {
|
|
1283
|
-
|
|
1555
|
+
execSync2("git config core.eol lf", {
|
|
1556
|
+
stdio: "inherit"
|
|
1557
|
+
});
|
|
1558
|
+
console.warn(chalk21.yellow('\nGitlint Fix: Updated core.eol to be "lf"\n'));
|
|
1284
1559
|
}
|
|
1285
1560
|
return 1;
|
|
1286
|
-
};
|
|
1561
|
+
}, "gitlintFix");
|
|
1287
1562
|
|
|
1288
1563
|
// src/actions/knip.ts
|
|
1289
|
-
var knip = () => {
|
|
1290
|
-
return runSteps("Knip", [
|
|
1291
|
-
|
|
1564
|
+
var knip = /* @__PURE__ */ __name(() => {
|
|
1565
|
+
return runSteps("Knip", [
|
|
1566
|
+
[
|
|
1567
|
+
"yarn",
|
|
1568
|
+
[
|
|
1569
|
+
"knip",
|
|
1570
|
+
"--dependencies",
|
|
1571
|
+
"--no-exit-code"
|
|
1572
|
+
]
|
|
1573
|
+
]
|
|
1574
|
+
]);
|
|
1575
|
+
}, "knip");
|
|
1292
1576
|
|
|
1293
1577
|
// src/actions/license.ts
|
|
1294
|
-
import
|
|
1578
|
+
import chalk22 from "chalk";
|
|
1295
1579
|
import { init } from "license-checker";
|
|
1296
|
-
var license = async (pkg) => {
|
|
1580
|
+
var license = /* @__PURE__ */ __name(async (pkg) => {
|
|
1297
1581
|
const workspaces = yarnWorkspaces();
|
|
1298
1582
|
const workspaceList = workspaces.filter(({ name }) => {
|
|
1299
1583
|
return pkg === void 0 || name === pkg;
|
|
@@ -1316,98 +1600,112 @@ var license = async (pkg) => {
|
|
|
1316
1600
|
"LGPL-3.0-or-later",
|
|
1317
1601
|
"Python-2.0"
|
|
1318
1602
|
]);
|
|
1319
|
-
console.log(
|
|
1320
|
-
return (await Promise.all(
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
if (
|
|
1345
|
-
|
|
1346
|
-
console.warn(chalk23.yellow(`${name2}: Package License not allowed [${license2}]`));
|
|
1603
|
+
console.log(chalk22.green("License Checker"));
|
|
1604
|
+
return (await Promise.all(workspaceList.map(({ location, name }) => {
|
|
1605
|
+
return new Promise((resolve) => {
|
|
1606
|
+
init({
|
|
1607
|
+
production: true,
|
|
1608
|
+
start: location
|
|
1609
|
+
}, (error, packages) => {
|
|
1610
|
+
if (error) {
|
|
1611
|
+
console.error(chalk22.red(`License Checker [${name}] Error`));
|
|
1612
|
+
console.error(chalk22.gray(error));
|
|
1613
|
+
console.log("\n");
|
|
1614
|
+
resolve(1);
|
|
1615
|
+
} else {
|
|
1616
|
+
console.log(chalk22.green(`License Checker [${name}]`));
|
|
1617
|
+
let count = 0;
|
|
1618
|
+
for (const [name2, info] of Object.entries(packages)) {
|
|
1619
|
+
const licenses = Array.isArray(info.licenses) ? info.licenses : [
|
|
1620
|
+
info.licenses
|
|
1621
|
+
];
|
|
1622
|
+
for (let license2 of licenses) {
|
|
1623
|
+
if (license2) {
|
|
1624
|
+
const processedLicense = license2[0] === "(" && license2.at(-1) === ")" ? license2.slice(1, -2) : license2;
|
|
1625
|
+
const orLicenses = processedLicense.split(" OR ");
|
|
1626
|
+
let orLicenseFound = false;
|
|
1627
|
+
for (const orLicense of orLicenses) {
|
|
1628
|
+
if (exclude.has(orLicense)) {
|
|
1629
|
+
orLicenseFound = true;
|
|
1347
1630
|
}
|
|
1348
1631
|
}
|
|
1632
|
+
if (!orLicenseFound) {
|
|
1633
|
+
count++;
|
|
1634
|
+
console.warn(chalk22.yellow(`${name2}: Package License not allowed [${license2}]`));
|
|
1635
|
+
}
|
|
1349
1636
|
}
|
|
1350
1637
|
}
|
|
1351
|
-
console.log("\n");
|
|
1352
|
-
resolve(count);
|
|
1353
1638
|
}
|
|
1354
|
-
|
|
1639
|
+
console.log("\n");
|
|
1640
|
+
resolve(count);
|
|
1641
|
+
}
|
|
1355
1642
|
});
|
|
1356
|
-
})
|
|
1357
|
-
)).reduce((prev, value) => prev || value, 0);
|
|
1358
|
-
};
|
|
1643
|
+
});
|
|
1644
|
+
}))).reduce((prev, value) => prev || value, 0);
|
|
1645
|
+
}, "license");
|
|
1359
1646
|
|
|
1360
1647
|
// src/actions/npmignore-gen.ts
|
|
1361
1648
|
var filename2 = ".npmignore";
|
|
1362
|
-
var npmignoreGen = (pkg) => generateIgnoreFiles(filename2, pkg);
|
|
1649
|
+
var npmignoreGen = /* @__PURE__ */ __name((pkg) => generateIgnoreFiles(filename2, pkg), "npmignoreGen");
|
|
1363
1650
|
|
|
1364
1651
|
// src/actions/package/clean-outputs.ts
|
|
1365
1652
|
import path5 from "path";
|
|
1366
|
-
import
|
|
1367
|
-
var packageCleanOutputs = () => {
|
|
1653
|
+
import chalk23 from "chalk";
|
|
1654
|
+
var packageCleanOutputs = /* @__PURE__ */ __name(() => {
|
|
1368
1655
|
const pkg = process.env.INIT_CWD ?? ".";
|
|
1369
1656
|
const pkgName = process.env.npm_package_name;
|
|
1370
|
-
const folders = [
|
|
1371
|
-
|
|
1657
|
+
const folders = [
|
|
1658
|
+
path5.join(pkg, "dist"),
|
|
1659
|
+
path5.join(pkg, "build"),
|
|
1660
|
+
path5.join(pkg, "docs")
|
|
1661
|
+
];
|
|
1662
|
+
console.log(chalk23.green(`Cleaning Outputs [${pkgName}]`));
|
|
1372
1663
|
for (let folder of folders) {
|
|
1373
1664
|
deleteGlob(folder);
|
|
1374
1665
|
}
|
|
1375
1666
|
return 0;
|
|
1376
|
-
};
|
|
1667
|
+
}, "packageCleanOutputs");
|
|
1377
1668
|
|
|
1378
1669
|
// src/actions/package/clean-typescript.ts
|
|
1379
1670
|
import path6 from "path";
|
|
1380
|
-
import
|
|
1381
|
-
var packageCleanTypescript = () => {
|
|
1671
|
+
import chalk24 from "chalk";
|
|
1672
|
+
var packageCleanTypescript = /* @__PURE__ */ __name(() => {
|
|
1382
1673
|
const pkg = process.env.INIT_CWD ?? ".";
|
|
1383
1674
|
const pkgName = process.env.npm_package_name;
|
|
1384
|
-
console.log(
|
|
1385
|
-
const files = [
|
|
1675
|
+
console.log(chalk24.green(`Cleaning Typescript [${pkgName}]`));
|
|
1676
|
+
const files = [
|
|
1677
|
+
path6.join(pkg, "*.tsbuildinfo"),
|
|
1678
|
+
path6.join(pkg, ".tsconfig.*"),
|
|
1679
|
+
path6.join(pkg, ".eslintcache")
|
|
1680
|
+
];
|
|
1386
1681
|
for (let file of files) {
|
|
1387
1682
|
deleteGlob(file);
|
|
1388
1683
|
}
|
|
1389
1684
|
return 0;
|
|
1390
|
-
};
|
|
1685
|
+
}, "packageCleanTypescript");
|
|
1391
1686
|
|
|
1392
1687
|
// src/actions/package/clean.ts
|
|
1393
|
-
var packageClean = async () => {
|
|
1394
|
-
return (await Promise.all([
|
|
1395
|
-
|
|
1688
|
+
var packageClean = /* @__PURE__ */ __name(async () => {
|
|
1689
|
+
return (await Promise.all([
|
|
1690
|
+
packageCleanOutputs(),
|
|
1691
|
+
packageCleanTypescript()
|
|
1692
|
+
])).reduce((prev, value) => prev + value, 0);
|
|
1693
|
+
}, "packageClean");
|
|
1396
1694
|
|
|
1397
1695
|
// src/actions/package/compile/compile.ts
|
|
1398
|
-
import
|
|
1696
|
+
import chalk30 from "chalk";
|
|
1399
1697
|
|
|
1400
1698
|
// src/actions/package/publint.ts
|
|
1401
1699
|
import { promises as fs4 } from "fs";
|
|
1402
|
-
import
|
|
1700
|
+
import chalk25 from "chalk";
|
|
1403
1701
|
import sortPackageJson from "sort-package-json";
|
|
1404
|
-
var packagePublint = async (params) => {
|
|
1702
|
+
var packagePublint = /* @__PURE__ */ __name(async (params) => {
|
|
1405
1703
|
const pkgDir = process.env.INIT_CWD;
|
|
1406
1704
|
const sortedPkg = sortPackageJson(await fs4.readFile(`${pkgDir}/package.json`, "utf8"));
|
|
1407
1705
|
await fs4.writeFile(`${pkgDir}/package.json`, sortedPkg);
|
|
1408
1706
|
const pkg = JSON.parse(await fs4.readFile(`${pkgDir}/package.json`, "utf8"));
|
|
1409
|
-
console.log(
|
|
1410
|
-
console.log(
|
|
1707
|
+
console.log(chalk25.green(`Publint: ${pkg.name}`));
|
|
1708
|
+
console.log(chalk25.gray(pkgDir));
|
|
1411
1709
|
const { publint: publint2 } = await import("publint");
|
|
1412
1710
|
const { messages } = await publint2({
|
|
1413
1711
|
level: "suggestion",
|
|
@@ -1415,51 +1713,75 @@ var packagePublint = async (params) => {
|
|
|
1415
1713
|
strict: true
|
|
1416
1714
|
});
|
|
1417
1715
|
const { formatMessage } = await import("publint/utils");
|
|
1418
|
-
const validMessage = (_message) => {
|
|
1716
|
+
const validMessage = /* @__PURE__ */ __name((_message) => {
|
|
1419
1717
|
return true;
|
|
1420
|
-
};
|
|
1718
|
+
}, "validMessage");
|
|
1421
1719
|
const validMessages = messages.filter(validMessage);
|
|
1422
1720
|
for (const message of validMessages) {
|
|
1423
1721
|
switch (message.type) {
|
|
1424
1722
|
case "error": {
|
|
1425
|
-
console.error(
|
|
1723
|
+
console.error(chalk25.red(`[${message.code}] ${formatMessage(message, pkg)}`));
|
|
1426
1724
|
break;
|
|
1427
1725
|
}
|
|
1428
1726
|
case "warning": {
|
|
1429
|
-
console.warn(
|
|
1727
|
+
console.warn(chalk25.yellow(`[${message.code}] ${formatMessage(message, pkg)}`));
|
|
1430
1728
|
break;
|
|
1431
1729
|
}
|
|
1432
1730
|
default: {
|
|
1433
|
-
console.log(
|
|
1731
|
+
console.log(chalk25.white(`[${message.code}] ${formatMessage(message, pkg)}`));
|
|
1434
1732
|
break;
|
|
1435
1733
|
}
|
|
1436
1734
|
}
|
|
1437
1735
|
}
|
|
1438
1736
|
if (params?.verbose) {
|
|
1439
|
-
console.log(
|
|
1737
|
+
console.log(chalk25.gray(`Publint [Finish]: ${pkgDir} [${validMessages.length}]`));
|
|
1440
1738
|
}
|
|
1441
1739
|
return validMessages.filter((message) => message.type === "error").length;
|
|
1442
|
-
};
|
|
1740
|
+
}, "packagePublint");
|
|
1443
1741
|
|
|
1444
1742
|
// src/actions/package/compile/packageCompileTsup.ts
|
|
1743
|
+
import chalk29 from "chalk";
|
|
1445
1744
|
import { build as build2, defineConfig } from "tsup";
|
|
1446
1745
|
|
|
1447
1746
|
// src/actions/package/compile/inputs.ts
|
|
1747
|
+
import chalk26 from "chalk";
|
|
1448
1748
|
import { glob as glob2 } from "glob";
|
|
1449
|
-
var getAllInputs = (
|
|
1450
|
-
return
|
|
1451
|
-
}
|
|
1749
|
+
var getAllInputs = /* @__PURE__ */ __name((srcDir, verbose = false) => {
|
|
1750
|
+
return [
|
|
1751
|
+
...glob2.sync(`${srcDir}/**/*.ts`, {
|
|
1752
|
+
posix: true
|
|
1753
|
+
}).map((file) => {
|
|
1754
|
+
const result = file.slice(Math.max(0, srcDir.length + 1));
|
|
1755
|
+
if (verbose) {
|
|
1756
|
+
console.log(chalk26.gray(`getAllInputs: ${JSON.stringify(result, null, 2)}`));
|
|
1757
|
+
}
|
|
1758
|
+
return result;
|
|
1759
|
+
}),
|
|
1760
|
+
...glob2.sync(`${srcDir}/**/*.tsx`, {
|
|
1761
|
+
posix: true
|
|
1762
|
+
}).map((file) => {
|
|
1763
|
+
const result = file.slice(Math.max(0, srcDir.length + 1));
|
|
1764
|
+
if (verbose) {
|
|
1765
|
+
console.log(chalk26.gray(`getAllInputs: ${JSON.stringify(result, null, 2)}`));
|
|
1766
|
+
}
|
|
1767
|
+
return result;
|
|
1768
|
+
})
|
|
1769
|
+
];
|
|
1770
|
+
}, "getAllInputs");
|
|
1452
1771
|
|
|
1453
1772
|
// src/actions/package/compile/buildEntries.ts
|
|
1454
|
-
var buildEntries = (
|
|
1773
|
+
var buildEntries = /* @__PURE__ */ __name((srcDir, entryMode = "single", options, excludeSpecAndStories = true, verbose = false) => {
|
|
1455
1774
|
let entries = [];
|
|
1456
1775
|
switch (entryMode) {
|
|
1457
1776
|
case "platform": {
|
|
1458
|
-
entries = [
|
|
1777
|
+
entries = [
|
|
1778
|
+
"index-node.ts",
|
|
1779
|
+
"index-browser.ts"
|
|
1780
|
+
];
|
|
1459
1781
|
break;
|
|
1460
1782
|
}
|
|
1461
1783
|
case "all": {
|
|
1462
|
-
entries = excludeSpecAndStories ? getAllInputs(
|
|
1784
|
+
entries = (excludeSpecAndStories ? getAllInputs(srcDir).filter((entry) => !entry.includes(".spec.") && !entry.includes(".stories.")) : getAllInputs(srcDir)).filter((entry) => !entry.endsWith(".d.ts"));
|
|
1463
1785
|
break;
|
|
1464
1786
|
}
|
|
1465
1787
|
case "custom": {
|
|
@@ -1467,7 +1789,9 @@ var buildEntries = (folder, entryMode = "single", options, excludeSpecAndStories
|
|
|
1467
1789
|
break;
|
|
1468
1790
|
}
|
|
1469
1791
|
default: {
|
|
1470
|
-
entries = [
|
|
1792
|
+
entries = [
|
|
1793
|
+
"index.ts"
|
|
1794
|
+
];
|
|
1471
1795
|
break;
|
|
1472
1796
|
}
|
|
1473
1797
|
}
|
|
@@ -1476,7 +1800,7 @@ var buildEntries = (folder, entryMode = "single", options, excludeSpecAndStories
|
|
|
1476
1800
|
}
|
|
1477
1801
|
if (verbose) console.log(`buildEntries [${entryMode}] ${entries.length}`);
|
|
1478
1802
|
return entries;
|
|
1479
|
-
};
|
|
1803
|
+
}, "buildEntries");
|
|
1480
1804
|
|
|
1481
1805
|
// src/actions/package/compile/deepMerge.ts
|
|
1482
1806
|
function deepMerge(target, source) {
|
|
@@ -1493,6 +1817,7 @@ function deepMerge(target, source) {
|
|
|
1493
1817
|
}
|
|
1494
1818
|
return target;
|
|
1495
1819
|
}
|
|
1820
|
+
__name(deepMerge, "deepMerge");
|
|
1496
1821
|
function deepMergeObjects(objects) {
|
|
1497
1822
|
const result = {};
|
|
1498
1823
|
for (const obj of objects) {
|
|
@@ -1500,167 +1825,335 @@ function deepMergeObjects(objects) {
|
|
|
1500
1825
|
}
|
|
1501
1826
|
return result;
|
|
1502
1827
|
}
|
|
1828
|
+
__name(deepMergeObjects, "deepMergeObjects");
|
|
1503
1829
|
|
|
1504
|
-
// src/actions/package/compile/
|
|
1830
|
+
// src/actions/package/compile/packageCompileTsc.ts
|
|
1831
|
+
import { cwd as cwd2 } from "process";
|
|
1832
|
+
import chalk27 from "chalk";
|
|
1833
|
+
import { createProgramFromConfig } from "tsc-prog";
|
|
1834
|
+
import ts2, { DiagnosticCategory, formatDiagnosticsWithColorAndContext, getPreEmitDiagnostics, sys } from "typescript";
|
|
1835
|
+
|
|
1836
|
+
// src/actions/package/compile/getCompilerOptions.ts
|
|
1505
1837
|
import { cwd } from "process";
|
|
1838
|
+
import deepmerge2 from "deepmerge";
|
|
1839
|
+
import { getTsconfig } from "get-tsconfig";
|
|
1840
|
+
var getCompilerOptions = /* @__PURE__ */ __name((options = {}, fileName = "tsconfig.json") => {
|
|
1841
|
+
const resolvedTsConfigCompilerOptions = getTsconfig(cwd(), fileName)?.config?.compilerOptions ?? {};
|
|
1842
|
+
return deepmerge2(resolvedTsConfigCompilerOptions, options);
|
|
1843
|
+
}, "getCompilerOptions");
|
|
1844
|
+
|
|
1845
|
+
// src/actions/package/compile/packageCompileTsc.ts
|
|
1846
|
+
var packageCompileTsc = /* @__PURE__ */ __name((platform, entries, srcDir = "src", outDir = "dist", compilerOptionsParam, verbose = false) => {
|
|
1847
|
+
const pkg = process.env.INIT_CWD ?? cwd2();
|
|
1848
|
+
if (verbose) {
|
|
1849
|
+
console.log(chalk27.cyan(`Validating code START: ${entries.length} files to ${outDir} from ${srcDir}`));
|
|
1850
|
+
}
|
|
1851
|
+
const configFilePath = ts2.findConfigFile("./", ts2.sys.fileExists, "tsconfig.json");
|
|
1852
|
+
if (configFilePath === void 0) {
|
|
1853
|
+
throw new Error("Could not find tsconfig.json");
|
|
1854
|
+
}
|
|
1855
|
+
const compilerOptions = {
|
|
1856
|
+
...getCompilerOptions({
|
|
1857
|
+
removeComments: false,
|
|
1858
|
+
skipDefaultLibCheck: true,
|
|
1859
|
+
skipLibCheck: true,
|
|
1860
|
+
sourceMap: false
|
|
1861
|
+
}),
|
|
1862
|
+
...compilerOptionsParam,
|
|
1863
|
+
outDir: `${outDir}/${platform}`,
|
|
1864
|
+
emitDeclarationOnly: true,
|
|
1865
|
+
noEmit: false
|
|
1866
|
+
};
|
|
1867
|
+
console.log(chalk27.cyan(`Validating Files: ${entries.length}`));
|
|
1868
|
+
if (verbose) {
|
|
1869
|
+
for (const entry of entries) {
|
|
1870
|
+
console.log(chalk27.grey(`Validating: ${entry}`));
|
|
1871
|
+
}
|
|
1872
|
+
}
|
|
1873
|
+
try {
|
|
1874
|
+
if (entries.length > 0) {
|
|
1875
|
+
const program = createProgramFromConfig({
|
|
1876
|
+
configFilePath,
|
|
1877
|
+
basePath: pkg ?? cwd2(),
|
|
1878
|
+
compilerOptions,
|
|
1879
|
+
files: entries.map((entry) => `${srcDir}/${entry}`),
|
|
1880
|
+
include: [
|
|
1881
|
+
`${srcDir}/**/*.*`
|
|
1882
|
+
]
|
|
1883
|
+
});
|
|
1884
|
+
const diagnostics = getPreEmitDiagnostics(program);
|
|
1885
|
+
if (diagnostics.length > 0) {
|
|
1886
|
+
const formattedDiagnostics = formatDiagnosticsWithColorAndContext(diagnostics, {
|
|
1887
|
+
getCanonicalFileName: /* @__PURE__ */ __name((fileName) => fileName, "getCanonicalFileName"),
|
|
1888
|
+
getCurrentDirectory: /* @__PURE__ */ __name(() => srcDir, "getCurrentDirectory"),
|
|
1889
|
+
getNewLine: /* @__PURE__ */ __name(() => sys.newLine, "getNewLine")
|
|
1890
|
+
});
|
|
1891
|
+
console.error(formattedDiagnostics);
|
|
1892
|
+
}
|
|
1893
|
+
program.emit();
|
|
1894
|
+
return diagnostics.reduce((acc, diag) => acc + (diag.category === DiagnosticCategory.Error ? 1 : 0), 0);
|
|
1895
|
+
}
|
|
1896
|
+
return 0;
|
|
1897
|
+
} finally {
|
|
1898
|
+
if (verbose) {
|
|
1899
|
+
console.log(chalk27.cyan(`Validating code FINISH: ${entries.length} files to ${outDir} from ${srcDir}`));
|
|
1900
|
+
}
|
|
1901
|
+
}
|
|
1902
|
+
}, "packageCompileTsc");
|
|
1903
|
+
|
|
1904
|
+
// src/actions/package/compile/packageCompileTscTypes.ts
|
|
1905
|
+
import path7 from "path";
|
|
1906
|
+
import { cwd as cwd3 } from "process";
|
|
1907
|
+
import chalk28 from "chalk";
|
|
1506
1908
|
import { rollup } from "rollup";
|
|
1507
1909
|
import dts from "rollup-plugin-dts";
|
|
1508
1910
|
import nodeExternals from "rollup-plugin-node-externals";
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1911
|
+
var ignoredWarningCodes = /* @__PURE__ */ new Set([
|
|
1912
|
+
"EMPTY_BUNDLE",
|
|
1913
|
+
"UNRESOLVED_IMPORT"
|
|
1914
|
+
]);
|
|
1915
|
+
async function bundleDts(inputPath, outputPath, platform, options, verbose = false) {
|
|
1916
|
+
const pkg = process.env.INIT_CWD ?? cwd3();
|
|
1917
|
+
const tsconfigPath = path7.resolve(pkg, "tsconfig.json");
|
|
1918
|
+
const nodePlugIns = platform === "node" ? [
|
|
1919
|
+
nodeExternals()
|
|
1920
|
+
] : [];
|
|
1921
|
+
try {
|
|
1922
|
+
const bundle = await rollup({
|
|
1923
|
+
input: inputPath,
|
|
1924
|
+
plugins: [
|
|
1925
|
+
dts({
|
|
1926
|
+
...options,
|
|
1927
|
+
tsconfig: tsconfigPath,
|
|
1928
|
+
compilerOptions: {
|
|
1929
|
+
emitDeclarationOnly: true,
|
|
1930
|
+
noEmit: false,
|
|
1931
|
+
declarationMap: true
|
|
1932
|
+
}
|
|
1933
|
+
}),
|
|
1934
|
+
...nodePlugIns
|
|
1935
|
+
],
|
|
1936
|
+
onwarn(warning, warn) {
|
|
1937
|
+
if (ignoredWarningCodes.has(warning.code ?? "")) {
|
|
1938
|
+
return;
|
|
1939
|
+
}
|
|
1940
|
+
console.warn(chalk28.yellow(`[${warning.code}] ${warning.message}`));
|
|
1941
|
+
console.warn(chalk28.gray(inputPath));
|
|
1942
|
+
warn(warning);
|
|
1943
|
+
}
|
|
1944
|
+
});
|
|
1945
|
+
await bundle.write({
|
|
1946
|
+
file: outputPath,
|
|
1947
|
+
format: "es"
|
|
1948
|
+
});
|
|
1949
|
+
} catch (ex) {
|
|
1950
|
+
const error = ex;
|
|
1951
|
+
console.warn(chalk28.red(error));
|
|
1952
|
+
console.warn(chalk28.gray(inputPath));
|
|
1953
|
+
}
|
|
1954
|
+
if (verbose) {
|
|
1955
|
+
console.log(`Bundled declarations written to ${outputPath}`);
|
|
1956
|
+
}
|
|
1524
1957
|
}
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1958
|
+
__name(bundleDts, "bundleDts");
|
|
1959
|
+
var packageCompileTscTypes = /* @__PURE__ */ __name(async (entries, outDir, platform, srcDir = "build", verbose = false) => {
|
|
1960
|
+
if (verbose) {
|
|
1961
|
+
console.log(chalk28.cyan(`Compiling Types START [${platform}]: ${entries.length} files to ${outDir} from ${srcDir}`));
|
|
1962
|
+
console.log(`Entries: ${entries.join(", ")}`);
|
|
1963
|
+
}
|
|
1964
|
+
const pkg = process.env.INIT_CWD ?? cwd3();
|
|
1965
|
+
const srcRoot = `${pkg}/${srcDir}/${platform}`;
|
|
1966
|
+
const entryNameToTypeName = /* @__PURE__ */ __name((entry) => {
|
|
1529
1967
|
const splitEntryName = entry.split(".");
|
|
1530
1968
|
const newEntryExtension = "d." + splitEntryName.at(-1);
|
|
1531
|
-
return [
|
|
1532
|
-
|
|
1533
|
-
|
|
1969
|
+
return [
|
|
1970
|
+
...splitEntryName.slice(0, -1),
|
|
1971
|
+
newEntryExtension
|
|
1972
|
+
].join(".");
|
|
1973
|
+
}, "entryNameToTypeName");
|
|
1974
|
+
const compilerOptions = getCompilerOptions({
|
|
1975
|
+
removeComments: false,
|
|
1976
|
+
skipDefaultLibCheck: true,
|
|
1977
|
+
skipLibCheck: true,
|
|
1978
|
+
declarationMap: true,
|
|
1979
|
+
emitDeclarationOnly: true,
|
|
1980
|
+
noEmit: true
|
|
1981
|
+
});
|
|
1982
|
+
const entryNames = entries.map((entry) => entry.split(`${srcDir}/`).at(-1) ?? entry);
|
|
1534
1983
|
await Promise.all(entryNames.map(async (entryName) => {
|
|
1535
|
-
|
|
1984
|
+
const entryTypeName = entryNameToTypeName(entryName);
|
|
1985
|
+
await bundleDts(`${srcRoot}/${entryTypeName}`, `${outDir}/${entryTypeName}`, platform, {
|
|
1986
|
+
compilerOptions
|
|
1987
|
+
}, verbose);
|
|
1536
1988
|
}));
|
|
1989
|
+
if (verbose) {
|
|
1990
|
+
console.log(chalk28.cyan(`Compiling Types FINISH: ${entries.length} files to ${outDir} from ${srcDir}`));
|
|
1991
|
+
}
|
|
1537
1992
|
return 0;
|
|
1538
|
-
};
|
|
1993
|
+
}, "packageCompileTscTypes");
|
|
1539
1994
|
|
|
1540
1995
|
// src/actions/package/compile/packageCompileTsup.ts
|
|
1541
|
-
var compileFolder = async (
|
|
1996
|
+
var compileFolder = /* @__PURE__ */ __name(async (srcDir, entries, buildDir, options, bundleTypes = false, verbose) => {
|
|
1542
1997
|
const outDir = options?.outDir ?? "dist";
|
|
1543
1998
|
if (verbose) {
|
|
1544
|
-
console.log(`compileFolder [${
|
|
1999
|
+
console.log(`compileFolder [${srcDir}, ${options?.outDir}]`);
|
|
2000
|
+
}
|
|
2001
|
+
if (entries.length === 0) {
|
|
2002
|
+
console.warn(chalk29.yellow(`No entries found in ${srcDir} to compile`));
|
|
2003
|
+
return 0;
|
|
1545
2004
|
}
|
|
1546
|
-
const optionsResult = defineConfig({
|
|
1547
|
-
bundle: true,
|
|
1548
|
-
cjsInterop: true,
|
|
1549
|
-
clean: true,
|
|
1550
|
-
dts: false,
|
|
1551
|
-
entry: entries,
|
|
1552
|
-
format: ["esm"],
|
|
1553
|
-
outDir,
|
|
1554
|
-
silent: true,
|
|
1555
|
-
sourcemap: true,
|
|
1556
|
-
splitting: false,
|
|
1557
|
-
tsconfig: "tsconfig.json",
|
|
1558
|
-
...options
|
|
1559
|
-
});
|
|
1560
|
-
const optionsList = (await Promise.all(
|
|
1561
|
-
(Array.isArray(optionsResult) ? optionsResult : [optionsResult]).flatMap(async (options2) => {
|
|
1562
|
-
const result = typeof options2 === "function" ? await options2({}) : [options2];
|
|
1563
|
-
return Array.isArray(result) ? result : [result];
|
|
1564
|
-
})
|
|
1565
|
-
)).flat();
|
|
1566
2005
|
if (verbose) {
|
|
1567
|
-
console.log(`
|
|
2006
|
+
console.log(chalk29.gray(`buildDir [${buildDir}]`));
|
|
2007
|
+
}
|
|
2008
|
+
const validationResult = packageCompileTsc(options?.platform ?? "neutral", entries, srcDir, buildDir, void 0, verbose);
|
|
2009
|
+
if (validationResult !== 0) {
|
|
2010
|
+
console.error(chalk29.red(`Compile:Validation had ${validationResult} errors`));
|
|
2011
|
+
return validationResult;
|
|
2012
|
+
}
|
|
2013
|
+
const optionsParams = tsupOptions([
|
|
2014
|
+
{
|
|
2015
|
+
bundle: true,
|
|
2016
|
+
cjsInterop: true,
|
|
2017
|
+
clean: false,
|
|
2018
|
+
dts: false,
|
|
2019
|
+
format: [
|
|
2020
|
+
"esm"
|
|
2021
|
+
],
|
|
2022
|
+
outDir,
|
|
2023
|
+
silent: true,
|
|
2024
|
+
sourcemap: true,
|
|
2025
|
+
splitting: false,
|
|
2026
|
+
tsconfig: "tsconfig.json",
|
|
2027
|
+
...options,
|
|
2028
|
+
entry: entries.map((entry) => `${srcDir}/${entry}`)
|
|
2029
|
+
}
|
|
2030
|
+
]);
|
|
2031
|
+
const optionsResult = defineConfig(optionsParams);
|
|
2032
|
+
const optionsList = (await Promise.all((Array.isArray(optionsResult) ? optionsResult : [
|
|
2033
|
+
optionsResult
|
|
2034
|
+
]).flatMap(async (options2) => {
|
|
2035
|
+
const result = typeof options2 === "function" ? await options2({}) : [
|
|
2036
|
+
options2
|
|
2037
|
+
];
|
|
2038
|
+
return Array.isArray(result) ? result : [
|
|
2039
|
+
result
|
|
2040
|
+
];
|
|
2041
|
+
}))).flat();
|
|
2042
|
+
if (verbose) {
|
|
2043
|
+
console.log(chalk29.cyan(`TSUP:build:start [${srcDir}]`));
|
|
2044
|
+
console.log(chalk29.gray(`TSUP:build:options [${JSON.stringify(optionsList, null, 2)}]`));
|
|
1568
2045
|
}
|
|
1569
2046
|
await Promise.all(optionsList.map((options2) => build2(options2)));
|
|
1570
2047
|
if (verbose) {
|
|
1571
|
-
console.log(`TSUP:build:stop [${
|
|
2048
|
+
console.log(chalk29.cyan(`TSUP:build:stop [${srcDir}]`));
|
|
2049
|
+
}
|
|
2050
|
+
if (bundleTypes) {
|
|
2051
|
+
await packageCompileTscTypes(entries, outDir, options?.platform ?? "neutral", buildDir, verbose);
|
|
1572
2052
|
}
|
|
1573
|
-
await packageCompileTscTypes(entries, outDir, options?.platform ?? "neutral", folder);
|
|
1574
2053
|
return 0;
|
|
1575
|
-
};
|
|
1576
|
-
var tsupOptions = (options = []) => {
|
|
2054
|
+
}, "compileFolder");
|
|
2055
|
+
var tsupOptions = /* @__PURE__ */ __name((options = []) => {
|
|
1577
2056
|
const standardLoaders = {
|
|
1578
2057
|
".gif": "copy",
|
|
1579
2058
|
".html": "copy",
|
|
1580
2059
|
".jpg": "copy",
|
|
1581
2060
|
".json": "json",
|
|
1582
2061
|
".png": "copy",
|
|
1583
|
-
".svg": "
|
|
2062
|
+
".svg": "text",
|
|
1584
2063
|
".webp": "copy"
|
|
1585
2064
|
};
|
|
1586
2065
|
const standardOptions = {
|
|
1587
2066
|
bundle: true,
|
|
1588
|
-
format: [
|
|
2067
|
+
format: [
|
|
2068
|
+
"esm"
|
|
2069
|
+
],
|
|
1589
2070
|
loader: standardLoaders,
|
|
1590
|
-
outExtension: ({ format }) => format === "esm" ? {
|
|
2071
|
+
outExtension: /* @__PURE__ */ __name(({ format }) => format === "esm" ? {
|
|
2072
|
+
js: ".mjs"
|
|
2073
|
+
} : {
|
|
2074
|
+
js: ".cjs"
|
|
2075
|
+
}, "outExtension"),
|
|
1591
2076
|
skipNodeModulesBundle: true,
|
|
1592
2077
|
sourcemap: true,
|
|
1593
2078
|
target: "esnext"
|
|
1594
2079
|
};
|
|
1595
|
-
return deepMergeObjects([
|
|
1596
|
-
|
|
1597
|
-
|
|
2080
|
+
return deepMergeObjects([
|
|
2081
|
+
standardOptions,
|
|
2082
|
+
...options
|
|
2083
|
+
]);
|
|
2084
|
+
}, "tsupOptions");
|
|
2085
|
+
var packageCompileTsup = /* @__PURE__ */ __name(async (config2) => {
|
|
1598
2086
|
const compile2 = config2?.compile;
|
|
1599
2087
|
const verbose = config2?.verbose ?? false;
|
|
2088
|
+
const outDirAsBuildDir = compile2?.outDirAsBuildDir ?? true;
|
|
2089
|
+
const bundleTypes = compile2?.bundleTypes ?? false;
|
|
1600
2090
|
if (verbose) {
|
|
1601
|
-
console.log(
|
|
2091
|
+
console.log("Compiling with TSUP");
|
|
1602
2092
|
}
|
|
1603
|
-
const compileForNode = compile2?.node ?? {
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
}
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
}
|
|
2093
|
+
const compileForNode = compile2?.node ?? {
|
|
2094
|
+
src: {}
|
|
2095
|
+
};
|
|
2096
|
+
const compileForBrowser = compile2?.browser ?? {
|
|
2097
|
+
src: {}
|
|
2098
|
+
};
|
|
2099
|
+
const compileForNeutral = compile2?.neutral ?? {
|
|
2100
|
+
src: {}
|
|
2101
|
+
};
|
|
2102
|
+
return (await Promise.all(Object.entries(compileForNode).map(async ([srcDir, options]) => {
|
|
2103
|
+
const optionsObject = typeof options === "object" ? options : {};
|
|
2104
|
+
const inEsBuildOptions = typeof compile2?.node?.esbuildOptions === "object" ? compile2?.node?.esbuildOptions : {};
|
|
2105
|
+
const entry = buildEntries(srcDir, compile2?.entryMode, options, true, verbose);
|
|
2106
|
+
const platform = "node";
|
|
2107
|
+
const rootOutDir = optionsObject.outDir ?? "dist";
|
|
2108
|
+
const outDir = rootOutDir + "/" + platform;
|
|
2109
|
+
return typeof srcDir === "string" ? await compileFolder(srcDir, entry, outDirAsBuildDir ? rootOutDir : "build", tsupOptions([
|
|
2110
|
+
inEsBuildOptions,
|
|
2111
|
+
compile2?.tsup?.options ?? {},
|
|
2112
|
+
typeof options === "object" ? options : {},
|
|
2113
|
+
{
|
|
2114
|
+
platform: "node",
|
|
2115
|
+
outDir
|
|
2116
|
+
}
|
|
2117
|
+
]), bundleTypes, verbose) : 0;
|
|
2118
|
+
}))).reduce((prev, value) => prev + value, 0) + (await Promise.all(Object.entries(compileForBrowser).map(async ([srcDir, options]) => {
|
|
2119
|
+
const optionsObject = typeof options === "object" ? options : {};
|
|
2120
|
+
const inEsBuildOptions = typeof compile2?.browser?.esbuildOptions === "object" ? compile2?.browser?.esbuildOptions : {};
|
|
2121
|
+
const entry = buildEntries(srcDir, compile2?.entryMode, options, true, verbose);
|
|
2122
|
+
const platform = "browser";
|
|
2123
|
+
const rootOutDir = optionsObject.outDir ?? "dist";
|
|
2124
|
+
const outDir = rootOutDir + "/" + platform;
|
|
2125
|
+
return typeof srcDir === "string" ? await compileFolder(srcDir, entry, outDirAsBuildDir ? rootOutDir : "build", tsupOptions([
|
|
2126
|
+
inEsBuildOptions,
|
|
2127
|
+
compile2?.tsup?.options ?? {},
|
|
2128
|
+
typeof options === "object" ? options : {},
|
|
2129
|
+
{
|
|
2130
|
+
platform: "browser",
|
|
2131
|
+
outDir
|
|
2132
|
+
}
|
|
2133
|
+
]), bundleTypes, verbose) : 0;
|
|
2134
|
+
}))).reduce((prev, value) => prev + value, 0) + (await Promise.all(Object.entries(compileForNeutral).map(async ([srcDir, options]) => {
|
|
2135
|
+
const optionsObject = typeof options === "object" ? options : {};
|
|
2136
|
+
const inEsBuildOptions = typeof compile2?.neutral?.esbuildOptions === "object" ? compile2?.neutral?.esbuildOptions : {};
|
|
2137
|
+
const entry = buildEntries(srcDir, compile2?.entryMode, options, true, verbose);
|
|
2138
|
+
const platform = "neutral";
|
|
2139
|
+
const rootOutDir = optionsObject.outDir ?? "dist";
|
|
2140
|
+
const outDir = rootOutDir + "/" + platform;
|
|
2141
|
+
return typeof srcDir === "string" ? await compileFolder(srcDir, entry, outDirAsBuildDir ? rootOutDir : "build", tsupOptions([
|
|
2142
|
+
inEsBuildOptions,
|
|
2143
|
+
compile2?.tsup?.options ?? {},
|
|
2144
|
+
typeof options === "object" ? options : {},
|
|
2145
|
+
{
|
|
2146
|
+
platform: "neutral",
|
|
2147
|
+
outDir
|
|
2148
|
+
}
|
|
2149
|
+
]), bundleTypes, verbose) : 0;
|
|
2150
|
+
}))).reduce((prev, value) => prev + value, 0) + 0;
|
|
2151
|
+
}, "packageCompileTsup");
|
|
1659
2152
|
|
|
1660
2153
|
// src/actions/package/compile/compile.ts
|
|
1661
|
-
var packageCompile = async (inConfig = {}) => {
|
|
2154
|
+
var packageCompile = /* @__PURE__ */ __name(async (inConfig = {}) => {
|
|
1662
2155
|
const pkg = process.env.INIT_CWD;
|
|
1663
|
-
console.log(
|
|
2156
|
+
console.log(chalk30.green(`Compiling ${pkg}`));
|
|
1664
2157
|
const config2 = await loadConfig(inConfig);
|
|
1665
2158
|
const publint2 = config2.publint;
|
|
1666
2159
|
const tsupResults = await packageCompileTsup(config2);
|
|
@@ -1668,106 +2161,30 @@ var packageCompile = async (inConfig = {}) => {
|
|
|
1668
2161
|
return tsupResults;
|
|
1669
2162
|
}
|
|
1670
2163
|
return publint2 ? await packagePublint(config2) : 0;
|
|
1671
|
-
};
|
|
1672
|
-
|
|
1673
|
-
// src/actions/package/compile/packageCompileTsc.ts
|
|
1674
|
-
import { cwd as cwd2 } from "process";
|
|
1675
|
-
import chalk28 from "chalk";
|
|
1676
|
-
import { createProgramFromConfig } from "tsc-prog";
|
|
1677
|
-
import {
|
|
1678
|
-
DiagnosticCategory,
|
|
1679
|
-
formatDiagnosticsWithColorAndContext,
|
|
1680
|
-
getPreEmitDiagnostics,
|
|
1681
|
-
sys as sys2
|
|
1682
|
-
} from "typescript";
|
|
1683
|
-
|
|
1684
|
-
// src/actions/package/compile/getCompilerOptions.ts
|
|
1685
|
-
import { createRequire } from "module";
|
|
1686
|
-
import deepmerge2 from "deepmerge";
|
|
1687
|
-
import {
|
|
1688
|
-
findConfigFile,
|
|
1689
|
-
readConfigFile,
|
|
1690
|
-
sys
|
|
1691
|
-
} from "typescript";
|
|
1692
|
-
var getNested = (config2) => {
|
|
1693
|
-
if (config2.extends) {
|
|
1694
|
-
const require2 = createRequire(import.meta.url);
|
|
1695
|
-
const opts = require2(config2.extends);
|
|
1696
|
-
return deepmerge2(getNested(opts), config2.compilerOptions ?? {});
|
|
1697
|
-
}
|
|
1698
|
-
return config2.compilerOptions;
|
|
1699
|
-
};
|
|
1700
|
-
var getCompilerOptionsJSONFollowExtends = (filename3) => {
|
|
1701
|
-
const config2 = readConfigFile(filename3, sys.readFile).config;
|
|
1702
|
-
return getNested(config2);
|
|
1703
|
-
};
|
|
1704
|
-
var getCompilerOptions = (options = {}, tsconfig = "tsconfig.json") => {
|
|
1705
|
-
const configFileName = findConfigFile("./", sys.fileExists, tsconfig);
|
|
1706
|
-
const configFileCompilerOptions = (configFileName ? getCompilerOptionsJSONFollowExtends(configFileName) : void 0) ?? {};
|
|
1707
|
-
return deepmerge2(configFileCompilerOptions, options);
|
|
1708
|
-
};
|
|
1709
|
-
|
|
1710
|
-
// src/actions/package/compile/packageCompileTsc.ts
|
|
1711
|
-
var packageCompileTsc = (folder = "src", config2 = {}, compilerOptionsParam) => {
|
|
1712
|
-
const pkg = process.env.INIT_CWD ?? cwd2();
|
|
1713
|
-
const verbose = config2?.verbose ?? false;
|
|
1714
|
-
const compilerOptions = {
|
|
1715
|
-
...getCompilerOptions({
|
|
1716
|
-
outDir: "dist/types",
|
|
1717
|
-
removeComments: false,
|
|
1718
|
-
skipDefaultLibCheck: true,
|
|
1719
|
-
skipLibCheck: true,
|
|
1720
|
-
sourceMap: false
|
|
1721
|
-
}),
|
|
1722
|
-
...compilerOptionsParam,
|
|
1723
|
-
emitDeclarationOnly: false,
|
|
1724
|
-
noEmit: true
|
|
1725
|
-
};
|
|
1726
|
-
const validTsExt = [".ts", ".tsx", ".d.ts", ".cts", ".d.cts", ".mts", ".d.mts"];
|
|
1727
|
-
const includes = [".stories.", ".spec.", ".d.ts", ".d.cts", ".d.mts"];
|
|
1728
|
-
const files = buildEntries(folder, "all", {}, true, verbose).filter((file) => validTsExt.find((ext) => file.endsWith(ext)) && includes.find((include) => file.includes(include)));
|
|
1729
|
-
console.log(chalk28.green(`Compiling Files ${pkg}: ${files.length}`));
|
|
1730
|
-
if (files.length > 0) {
|
|
1731
|
-
const program = createProgramFromConfig({
|
|
1732
|
-
basePath: pkg ?? cwd2(),
|
|
1733
|
-
compilerOptions,
|
|
1734
|
-
exclude: ["dist", "docs"],
|
|
1735
|
-
files
|
|
1736
|
-
});
|
|
1737
|
-
const diagnostics = getPreEmitDiagnostics(program);
|
|
1738
|
-
if (diagnostics.length > 0) {
|
|
1739
|
-
const formattedDiagnostics = formatDiagnosticsWithColorAndContext(
|
|
1740
|
-
diagnostics,
|
|
1741
|
-
{
|
|
1742
|
-
getCanonicalFileName: (fileName) => fileName,
|
|
1743
|
-
getCurrentDirectory: () => folder,
|
|
1744
|
-
getNewLine: () => sys2.newLine
|
|
1745
|
-
}
|
|
1746
|
-
);
|
|
1747
|
-
console.error(formattedDiagnostics);
|
|
1748
|
-
}
|
|
1749
|
-
program.emit();
|
|
1750
|
-
return diagnostics.reduce((acc, diag) => acc + (diag.category === DiagnosticCategory.Error ? 1 : 0), 0);
|
|
1751
|
-
}
|
|
1752
|
-
return 0;
|
|
1753
|
-
};
|
|
2164
|
+
}, "packageCompile");
|
|
1754
2165
|
|
|
1755
2166
|
// src/actions/package/copy-assets.ts
|
|
1756
|
-
import
|
|
1757
|
-
import
|
|
2167
|
+
import path8 from "path/posix";
|
|
2168
|
+
import chalk31 from "chalk";
|
|
1758
2169
|
import cpy2 from "cpy";
|
|
1759
|
-
var copyTargetAssets2 = async (target, name, location) => {
|
|
2170
|
+
var copyTargetAssets2 = /* @__PURE__ */ __name(async (target, name, location) => {
|
|
1760
2171
|
try {
|
|
1761
|
-
const values = await cpy2(
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
2172
|
+
const values = await cpy2([
|
|
2173
|
+
"**/*.jpg",
|
|
2174
|
+
"**/*.png",
|
|
2175
|
+
"**/*.gif",
|
|
2176
|
+
"**/*.svg",
|
|
2177
|
+
"**/*.webp",
|
|
2178
|
+
"**/*.sass",
|
|
2179
|
+
"**/*.scss",
|
|
2180
|
+
"**/*.gif",
|
|
2181
|
+
"**/*.css"
|
|
2182
|
+
], `../dist/${target}`, {
|
|
2183
|
+
cwd: path8.join(location, "src"),
|
|
2184
|
+
flat: false
|
|
2185
|
+
});
|
|
1769
2186
|
if (values.length > 0) {
|
|
1770
|
-
console.log(
|
|
2187
|
+
console.log(chalk31.green(`Copying Assets [${target.toUpperCase()}] - ${name} - ${location}`));
|
|
1771
2188
|
}
|
|
1772
2189
|
for (const value of values) {
|
|
1773
2190
|
console.log(`${value.split("/").pop()} => ./dist/${target}`);
|
|
@@ -1778,8 +2195,8 @@ var copyTargetAssets2 = async (target, name, location) => {
|
|
|
1778
2195
|
console.log(`Copy Assets Failed: ${name}: ${error.message}`);
|
|
1779
2196
|
return 1;
|
|
1780
2197
|
}
|
|
1781
|
-
};
|
|
1782
|
-
var packageCopyAssets = async ({ target }) => {
|
|
2198
|
+
}, "copyTargetAssets");
|
|
2199
|
+
var packageCopyAssets = /* @__PURE__ */ __name(async ({ target }) => {
|
|
1783
2200
|
const pkg = process.env.INIT_CWD ?? "./";
|
|
1784
2201
|
const pkgName = process.env.npm_package_name ?? "Unknown";
|
|
1785
2202
|
switch (target) {
|
|
@@ -1793,11 +2210,11 @@ var packageCopyAssets = async ({ target }) => {
|
|
|
1793
2210
|
return await copyTargetAssets2("esm", pkgName, pkg) || await copyTargetAssets2("cjs", pkgName, pkg);
|
|
1794
2211
|
}
|
|
1795
2212
|
}
|
|
1796
|
-
};
|
|
2213
|
+
}, "packageCopyAssets");
|
|
1797
2214
|
|
|
1798
2215
|
// src/actions/package/cycle.ts
|
|
1799
2216
|
import { cruise as cruise2 } from "dependency-cruiser";
|
|
1800
|
-
var packageCycle =
|
|
2217
|
+
var packageCycle = /* @__PURE__ */ __name(async () => {
|
|
1801
2218
|
const pkg = process.env.INIT_CWD;
|
|
1802
2219
|
const pkgName = process.env.npm_package_name;
|
|
1803
2220
|
const cruiseOptions = {
|
|
@@ -1808,41 +2225,40 @@ var packageCycle = async ({ verbose = false }) => {
|
|
|
1808
2225
|
severity: "error",
|
|
1809
2226
|
comment: "This dependency creates a circular reference",
|
|
1810
2227
|
from: {},
|
|
1811
|
-
to: {
|
|
2228
|
+
to: {
|
|
2229
|
+
circular: true
|
|
2230
|
+
}
|
|
1812
2231
|
}
|
|
1813
2232
|
]
|
|
1814
2233
|
},
|
|
1815
2234
|
exclude: "node_modules|packages/.*/packages",
|
|
1816
2235
|
validate: true,
|
|
1817
|
-
doNotFollow: {
|
|
2236
|
+
doNotFollow: {
|
|
2237
|
+
path: "node_modules|packages/.*/packages"
|
|
2238
|
+
},
|
|
1818
2239
|
tsPreCompilationDeps: false,
|
|
1819
2240
|
combinedDependencies: true,
|
|
1820
|
-
outputType:
|
|
2241
|
+
outputType: "err"
|
|
1821
2242
|
};
|
|
1822
2243
|
const target = `${pkg}/src`;
|
|
1823
2244
|
console.log(`Checking for circular dependencies in ${target}...`);
|
|
1824
|
-
const result = await cruise2([
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
2245
|
+
const result = await cruise2([
|
|
2246
|
+
target
|
|
2247
|
+
], cruiseOptions);
|
|
2248
|
+
console.log(result.output);
|
|
1828
2249
|
if (result.exitCode === 0) {
|
|
1829
2250
|
console.log(`${pkgName} \u2705 No dependency violations`);
|
|
1830
2251
|
} else {
|
|
1831
2252
|
console.error(`${pkgName} \u274C Dependency violations found`);
|
|
1832
2253
|
}
|
|
1833
2254
|
return result.exitCode;
|
|
1834
|
-
};
|
|
2255
|
+
}, "packageCycle");
|
|
1835
2256
|
|
|
1836
2257
|
// src/actions/package/gen-docs.ts
|
|
1837
2258
|
import { existsSync as existsSync5 } from "fs";
|
|
1838
|
-
import
|
|
1839
|
-
import
|
|
1840
|
-
import {
|
|
1841
|
-
Application,
|
|
1842
|
-
ArgumentsReader,
|
|
1843
|
-
TSConfigReader,
|
|
1844
|
-
TypeDocReader
|
|
1845
|
-
} from "typedoc";
|
|
2259
|
+
import path9 from "path";
|
|
2260
|
+
import chalk32 from "chalk";
|
|
2261
|
+
import { Application, ArgumentsReader, TSConfigReader, TypeDocReader } from "typedoc";
|
|
1846
2262
|
var ExitCodes = {
|
|
1847
2263
|
CompileError: 3,
|
|
1848
2264
|
ExceptionThrown: 6,
|
|
@@ -1852,14 +2268,17 @@ var ExitCodes = {
|
|
|
1852
2268
|
OutputError: 5,
|
|
1853
2269
|
ValidationError: 4
|
|
1854
2270
|
};
|
|
1855
|
-
var packageGenDocs = async () => {
|
|
2271
|
+
var packageGenDocs = /* @__PURE__ */ __name(async () => {
|
|
1856
2272
|
const pkg = process.env.INIT_CWD;
|
|
1857
|
-
if (pkg && !existsSync5(
|
|
2273
|
+
if (pkg && !existsSync5(path9.join(pkg, "typedoc.json"))) {
|
|
1858
2274
|
return;
|
|
1859
2275
|
}
|
|
1860
2276
|
const app = await Application.bootstrap({
|
|
1861
2277
|
entryPointStrategy: "merge",
|
|
1862
|
-
entryPoints: [
|
|
2278
|
+
entryPoints: [
|
|
2279
|
+
`${pkg}/src/**/*.ts`,
|
|
2280
|
+
`${pkg}/packages/*/dist/docs.json`
|
|
2281
|
+
],
|
|
1863
2282
|
excludeExternals: true,
|
|
1864
2283
|
json: `${pkg}/dist/docs.json`,
|
|
1865
2284
|
logLevel: "Error",
|
|
@@ -1870,8 +2289,8 @@ var packageGenDocs = async () => {
|
|
|
1870
2289
|
app.options.addReader(new TSConfigReader());
|
|
1871
2290
|
app.options.addReader(new ArgumentsReader(300));
|
|
1872
2291
|
return await runTypeDoc(app);
|
|
1873
|
-
};
|
|
1874
|
-
var runTypeDoc = async (app) => {
|
|
2292
|
+
}, "packageGenDocs");
|
|
2293
|
+
var runTypeDoc = /* @__PURE__ */ __name(async (app) => {
|
|
1875
2294
|
const pkgName = process.env.npm_package_name;
|
|
1876
2295
|
if (app.options.getValue("version")) {
|
|
1877
2296
|
console.log(app.toString());
|
|
@@ -1940,37 +2359,40 @@ var runTypeDoc = async (app) => {
|
|
|
1940
2359
|
return ExitCodes.OutputError;
|
|
1941
2360
|
}
|
|
1942
2361
|
}
|
|
1943
|
-
console.log(
|
|
2362
|
+
console.log(chalk32.green(`${pkgName} - Ok`));
|
|
1944
2363
|
return ExitCodes.Ok;
|
|
1945
|
-
};
|
|
2364
|
+
}, "runTypeDoc");
|
|
1946
2365
|
|
|
1947
2366
|
// src/actions/package/lint.ts
|
|
1948
2367
|
import { readdirSync } from "fs";
|
|
1949
|
-
import
|
|
1950
|
-
import { cwd as
|
|
2368
|
+
import path10 from "path";
|
|
2369
|
+
import { cwd as cwd4 } from "process";
|
|
1951
2370
|
import { pathToFileURL } from "url";
|
|
1952
|
-
import
|
|
2371
|
+
import chalk33 from "chalk";
|
|
1953
2372
|
import { ESLint } from "eslint";
|
|
1954
2373
|
import { findUp } from "find-up";
|
|
1955
2374
|
import picomatch from "picomatch";
|
|
1956
|
-
var dumpMessages = (lintResults) => {
|
|
1957
|
-
const colors = [
|
|
1958
|
-
|
|
2375
|
+
var dumpMessages = /* @__PURE__ */ __name((lintResults) => {
|
|
2376
|
+
const colors = [
|
|
2377
|
+
"white",
|
|
2378
|
+
"yellow",
|
|
2379
|
+
"red"
|
|
2380
|
+
];
|
|
2381
|
+
const severity = [
|
|
2382
|
+
"none",
|
|
2383
|
+
"warning",
|
|
2384
|
+
"error"
|
|
2385
|
+
];
|
|
1959
2386
|
for (const lintResult of lintResults) {
|
|
1960
2387
|
if (lintResult.messages.length > 0) {
|
|
1961
|
-
console.log(
|
|
2388
|
+
console.log(chalk33.gray(`
|
|
1962
2389
|
${lintResult.filePath}`));
|
|
1963
2390
|
for (const message of lintResult.messages) {
|
|
1964
|
-
console.log(
|
|
1965
|
-
chalk31.gray(` ${message.line}:${message.column}`),
|
|
1966
|
-
chalk31[colors[message.severity]](` ${severity[message.severity]}`),
|
|
1967
|
-
chalk31.white(` ${message.message}`),
|
|
1968
|
-
chalk31.gray(` ${message.ruleId}`)
|
|
1969
|
-
);
|
|
2391
|
+
console.log(chalk33.gray(` ${message.line}:${message.column}`), chalk33[colors[message.severity]](` ${severity[message.severity]}`), chalk33.white(` ${message.message}`), chalk33.gray(` ${message.ruleId}`));
|
|
1970
2392
|
}
|
|
1971
2393
|
}
|
|
1972
2394
|
}
|
|
1973
|
-
};
|
|
2395
|
+
}, "dumpMessages");
|
|
1974
2396
|
async function getRootESLintConfig() {
|
|
1975
2397
|
const configPath = await findUp("eslint.config.mjs");
|
|
1976
2398
|
if (configPath === void 0) {
|
|
@@ -1978,33 +2400,50 @@ async function getRootESLintConfig() {
|
|
|
1978
2400
|
}
|
|
1979
2401
|
return pathToFileURL(configPath);
|
|
1980
2402
|
}
|
|
2403
|
+
__name(getRootESLintConfig, "getRootESLintConfig");
|
|
1981
2404
|
function getFiles(dir, ignoreFolders) {
|
|
1982
|
-
const currentDirectory =
|
|
2405
|
+
const currentDirectory = cwd4();
|
|
1983
2406
|
const subDirectory = dir.split(currentDirectory)[1];
|
|
1984
2407
|
if (ignoreFolders.includes(subDirectory)) return [];
|
|
1985
|
-
return readdirSync(dir, {
|
|
1986
|
-
|
|
2408
|
+
return readdirSync(dir, {
|
|
2409
|
+
withFileTypes: true
|
|
2410
|
+
}).flatMap((dirent) => {
|
|
2411
|
+
const res = path10.resolve(dir, dirent.name);
|
|
1987
2412
|
const relativePath = subDirectory === void 0 ? dirent.name : `${subDirectory}/${dirent.name}`;
|
|
1988
2413
|
const ignoreMatchers = ignoreFolders.map((pattern) => picomatch(pattern));
|
|
1989
2414
|
if (ignoreMatchers.some((isMatch) => isMatch(relativePath))) return [];
|
|
1990
|
-
return dirent.isDirectory() ? getFiles(res, ignoreFolders) : [
|
|
2415
|
+
return dirent.isDirectory() ? getFiles(res, ignoreFolders) : [
|
|
2416
|
+
res
|
|
2417
|
+
];
|
|
1991
2418
|
});
|
|
1992
2419
|
}
|
|
1993
|
-
|
|
2420
|
+
__name(getFiles, "getFiles");
|
|
2421
|
+
var packageLint = /* @__PURE__ */ __name(async (fix2 = false, verbose = false, cache = true) => {
|
|
1994
2422
|
const pkg = process.env.INIT_CWD;
|
|
1995
2423
|
const configPath = await getRootESLintConfig();
|
|
1996
2424
|
const { default: eslintConfig } = await import(configPath.href);
|
|
1997
2425
|
const start = Date.now();
|
|
1998
|
-
const ignoreFolders = [
|
|
2426
|
+
const ignoreFolders = [
|
|
2427
|
+
"node_modules",
|
|
2428
|
+
"dist",
|
|
2429
|
+
"packages",
|
|
2430
|
+
".git",
|
|
2431
|
+
"build",
|
|
2432
|
+
".yarn",
|
|
2433
|
+
".vscode",
|
|
2434
|
+
".github"
|
|
2435
|
+
];
|
|
1999
2436
|
const engine = new ESLint({
|
|
2000
|
-
baseConfig: [
|
|
2437
|
+
baseConfig: [
|
|
2438
|
+
...eslintConfig
|
|
2439
|
+
],
|
|
2001
2440
|
fix: fix2,
|
|
2002
2441
|
warnIgnored: false,
|
|
2003
2442
|
cache
|
|
2004
2443
|
});
|
|
2005
|
-
const files = getFiles(
|
|
2444
|
+
const files = getFiles(cwd4(), ignoreFolders);
|
|
2006
2445
|
if (verbose) {
|
|
2007
|
-
console.log(
|
|
2446
|
+
console.log(chalk33.green(`Linting ${pkg} [files = ${files.length}]`));
|
|
2008
2447
|
}
|
|
2009
2448
|
const lintResults = await engine.lintFiles(files);
|
|
2010
2449
|
dumpMessages(lintResults);
|
|
@@ -2014,43 +2453,75 @@ var packageLint = async (fix2 = false, verbose = false, cache = true) => {
|
|
|
2014
2453
|
const filesCountColor = files.length < 100 ? "green" : files.length < 1e3 ? "yellow" : "red";
|
|
2015
2454
|
const lintTime = Date.now() - start;
|
|
2016
2455
|
const lintTimeColor = lintTime < 1e3 ? "green" : lintTime < 3e3 ? "yellow" : "red";
|
|
2017
|
-
console.log(
|
|
2456
|
+
console.log(chalk33.white(`Linted ${chalk33[filesCountColor](files.length)} files in ${chalk33[lintTimeColor](lintTime)}ms`));
|
|
2018
2457
|
return lintResults.reduce((prev, lintResult) => prev + lintResult.errorCount, 0);
|
|
2019
|
-
};
|
|
2458
|
+
}, "packageLint");
|
|
2020
2459
|
|
|
2021
2460
|
// src/actions/package/recompile.ts
|
|
2022
|
-
var packageRecompile = async () => {
|
|
2461
|
+
var packageRecompile = /* @__PURE__ */ __name(async () => {
|
|
2023
2462
|
return await packageClean() || await packageCompile();
|
|
2024
|
-
};
|
|
2463
|
+
}, "packageRecompile");
|
|
2025
2464
|
|
|
2026
2465
|
// src/actions/publint.ts
|
|
2027
|
-
var publint = async ({ verbose, pkg }) => {
|
|
2028
|
-
return pkg ? await publintPackage({
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
}
|
|
2466
|
+
var publint = /* @__PURE__ */ __name(async ({ verbose, pkg }) => {
|
|
2467
|
+
return pkg ? await publintPackage({
|
|
2468
|
+
pkg,
|
|
2469
|
+
verbose
|
|
2470
|
+
}) : publintAll({
|
|
2471
|
+
verbose
|
|
2472
|
+
});
|
|
2473
|
+
}, "publint");
|
|
2474
|
+
var publintPackage = /* @__PURE__ */ __name(({ pkg }) => {
|
|
2475
|
+
return runStepsAsync(`Publint [${pkg}]`, [
|
|
2476
|
+
[
|
|
2477
|
+
"yarn",
|
|
2478
|
+
[
|
|
2479
|
+
"workspace",
|
|
2480
|
+
pkg,
|
|
2481
|
+
"run",
|
|
2482
|
+
"package-publint"
|
|
2483
|
+
]
|
|
2484
|
+
]
|
|
2485
|
+
]);
|
|
2486
|
+
}, "publintPackage");
|
|
2487
|
+
var publintAll = /* @__PURE__ */ __name(({ verbose }) => {
|
|
2488
|
+
const verboseOptions = verbose ? [
|
|
2489
|
+
"--verbose"
|
|
2490
|
+
] : [
|
|
2491
|
+
"--no-verbose"
|
|
2492
|
+
];
|
|
2493
|
+
return runSteps("Publint", [
|
|
2494
|
+
[
|
|
2495
|
+
"yarn",
|
|
2496
|
+
[
|
|
2497
|
+
"workspaces",
|
|
2498
|
+
"foreach",
|
|
2499
|
+
"-pA",
|
|
2500
|
+
...verboseOptions,
|
|
2501
|
+
"run",
|
|
2502
|
+
"package-publint"
|
|
2503
|
+
]
|
|
2504
|
+
]
|
|
2505
|
+
]);
|
|
2506
|
+
}, "publintAll");
|
|
2037
2507
|
|
|
2038
2508
|
// src/actions/rebuild.ts
|
|
2039
|
-
var rebuild = ({ target }) => {
|
|
2509
|
+
var rebuild = /* @__PURE__ */ __name(({ target }) => {
|
|
2040
2510
|
return runSteps("Rebuild", [
|
|
2041
|
-
[
|
|
2042
|
-
|
|
2511
|
+
[
|
|
2512
|
+
"yarn",
|
|
2513
|
+
"xy clean"
|
|
2514
|
+
],
|
|
2515
|
+
[
|
|
2516
|
+
"yarn",
|
|
2517
|
+
target ? `xy build -t ${target}` : "xy build"
|
|
2518
|
+
]
|
|
2043
2519
|
]);
|
|
2044
|
-
};
|
|
2520
|
+
}, "rebuild");
|
|
2045
2521
|
|
|
2046
2522
|
// src/actions/recompile.ts
|
|
2047
|
-
import
|
|
2048
|
-
var recompile = async ({
|
|
2049
|
-
verbose,
|
|
2050
|
-
target,
|
|
2051
|
-
pkg,
|
|
2052
|
-
incremental
|
|
2053
|
-
}) => {
|
|
2523
|
+
import chalk34 from "chalk";
|
|
2524
|
+
var recompile = /* @__PURE__ */ __name(async ({ verbose, target, pkg, incremental }) => {
|
|
2054
2525
|
return pkg ? await recompilePackage({
|
|
2055
2526
|
pkg,
|
|
2056
2527
|
target,
|
|
@@ -2060,27 +2531,51 @@ var recompile = async ({
|
|
|
2060
2531
|
target,
|
|
2061
2532
|
verbose
|
|
2062
2533
|
});
|
|
2063
|
-
};
|
|
2064
|
-
var recompilePackage = ({ target, pkg }) => {
|
|
2065
|
-
const targetOptions = target ? [
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2534
|
+
}, "recompile");
|
|
2535
|
+
var recompilePackage = /* @__PURE__ */ __name(({ target, pkg }) => {
|
|
2536
|
+
const targetOptions = target ? [
|
|
2537
|
+
"-t",
|
|
2538
|
+
target
|
|
2539
|
+
] : [];
|
|
2540
|
+
return runStepsAsync(`Recompile [${pkg}]`, [
|
|
2541
|
+
[
|
|
2542
|
+
"yarn",
|
|
2543
|
+
[
|
|
2544
|
+
"workspace",
|
|
2545
|
+
pkg,
|
|
2546
|
+
"run",
|
|
2547
|
+
"package-recompile",
|
|
2548
|
+
...targetOptions
|
|
2549
|
+
]
|
|
2550
|
+
]
|
|
2551
|
+
]);
|
|
2552
|
+
}, "recompilePackage");
|
|
2553
|
+
var recompileAll = /* @__PURE__ */ __name(async ({ jobs, verbose, target, incremental }) => {
|
|
2077
2554
|
const start = Date.now();
|
|
2078
|
-
const verboseOptions = verbose ? [
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2555
|
+
const verboseOptions = verbose ? [
|
|
2556
|
+
"--verbose"
|
|
2557
|
+
] : [
|
|
2558
|
+
"--no-verbose"
|
|
2559
|
+
];
|
|
2560
|
+
const targetOptions = target ? [
|
|
2561
|
+
"-t",
|
|
2562
|
+
target
|
|
2563
|
+
] : [];
|
|
2564
|
+
const incrementalOptions = incremental ? [
|
|
2565
|
+
"--since",
|
|
2566
|
+
"-Apt",
|
|
2567
|
+
"--topological-dev"
|
|
2568
|
+
] : [
|
|
2569
|
+
"--parallel",
|
|
2570
|
+
"-Apt",
|
|
2571
|
+
"--topological-dev"
|
|
2572
|
+
];
|
|
2573
|
+
const jobsOptions = jobs ? [
|
|
2574
|
+
"-j",
|
|
2575
|
+
`${jobs}`
|
|
2576
|
+
] : [];
|
|
2082
2577
|
if (jobs) {
|
|
2083
|
-
console.log(
|
|
2578
|
+
console.log(chalk34.blue(`Jobs set to [${jobs}]`));
|
|
2084
2579
|
}
|
|
2085
2580
|
const result = await runStepsAsync(`Recompile${incremental ? "-Incremental" : ""} [All]`, [
|
|
2086
2581
|
[
|
|
@@ -2110,19 +2605,13 @@ var recompileAll = async ({
|
|
|
2110
2605
|
]
|
|
2111
2606
|
]
|
|
2112
2607
|
]);
|
|
2113
|
-
console.log(
|
|
2114
|
-
`${chalk32.gray("Recompiled in")} [${chalk32.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk32.gray("seconds")}`
|
|
2115
|
-
);
|
|
2608
|
+
console.log(`${chalk34.gray("Recompiled in")} [${chalk34.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk34.gray("seconds")}`);
|
|
2116
2609
|
return result;
|
|
2117
|
-
};
|
|
2610
|
+
}, "recompileAll");
|
|
2118
2611
|
|
|
2119
2612
|
// src/actions/reinstall.ts
|
|
2120
|
-
import {
|
|
2121
|
-
|
|
2122
|
-
openSync,
|
|
2123
|
-
rmSync
|
|
2124
|
-
} from "fs";
|
|
2125
|
-
var reinstall = () => {
|
|
2613
|
+
import { closeSync, openSync, rmSync } from "fs";
|
|
2614
|
+
var reinstall = /* @__PURE__ */ __name(() => {
|
|
2126
2615
|
console.log("Reinstall [Clear Lock File]");
|
|
2127
2616
|
closeSync(openSync("./yarn.lock", "w"));
|
|
2128
2617
|
console.log("Reinstall [Clear Node Modules]");
|
|
@@ -2130,7 +2619,10 @@ var reinstall = () => {
|
|
|
2130
2619
|
const result = workspaces.map(({ location, name }) => {
|
|
2131
2620
|
const dist = `${location}/node_modules`;
|
|
2132
2621
|
try {
|
|
2133
|
-
rmSync(dist, {
|
|
2622
|
+
rmSync(dist, {
|
|
2623
|
+
force: true,
|
|
2624
|
+
recursive: true
|
|
2625
|
+
});
|
|
2134
2626
|
return 0;
|
|
2135
2627
|
} catch (ex) {
|
|
2136
2628
|
const error = ex;
|
|
@@ -2138,621 +2630,572 @@ var reinstall = () => {
|
|
|
2138
2630
|
return 1;
|
|
2139
2631
|
}
|
|
2140
2632
|
}).reduce((prev, result2) => prev || result2, 0);
|
|
2141
|
-
return result || runSteps("Reinstall", [
|
|
2142
|
-
|
|
2633
|
+
return result || runSteps("Reinstall", [
|
|
2634
|
+
[
|
|
2635
|
+
"yarn",
|
|
2636
|
+
"install --network-timeout 10000"
|
|
2637
|
+
]
|
|
2638
|
+
]);
|
|
2639
|
+
}, "reinstall");
|
|
2143
2640
|
|
|
2144
2641
|
// src/actions/relint.ts
|
|
2145
|
-
import
|
|
2146
|
-
var relintPackage = ({ pkg }) => {
|
|
2147
|
-
console.log(
|
|
2642
|
+
import chalk35 from "chalk";
|
|
2643
|
+
var relintPackage = /* @__PURE__ */ __name(({ pkg }) => {
|
|
2644
|
+
console.log(chalk35.gray(`${"Relint"} [All-Packages]`));
|
|
2148
2645
|
const start = Date.now();
|
|
2149
2646
|
const result = runSteps("Relint [All-Packages]", [
|
|
2150
|
-
[
|
|
2151
|
-
"
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2647
|
+
[
|
|
2648
|
+
"yarn",
|
|
2649
|
+
[
|
|
2650
|
+
"workspace",
|
|
2651
|
+
pkg,
|
|
2652
|
+
"run",
|
|
2653
|
+
"package-relint"
|
|
2654
|
+
]
|
|
2655
|
+
]
|
|
2156
2656
|
]);
|
|
2157
|
-
console.log(
|
|
2657
|
+
console.log(chalk35.gray(`${"Relinted in"} [${chalk35.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk35.gray("seconds")}`));
|
|
2158
2658
|
return result;
|
|
2159
|
-
};
|
|
2160
|
-
var relint = ({
|
|
2161
|
-
pkg
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
};
|
|
2167
|
-
|
|
2168
|
-
|
|
2659
|
+
}, "relintPackage");
|
|
2660
|
+
var relint = /* @__PURE__ */ __name(({ pkg, verbose, incremental } = {}) => {
|
|
2661
|
+
return pkg ? relintPackage({
|
|
2662
|
+
pkg
|
|
2663
|
+
}) : relintAllPackages({
|
|
2664
|
+
verbose,
|
|
2665
|
+
incremental
|
|
2666
|
+
});
|
|
2667
|
+
}, "relint");
|
|
2668
|
+
var relintAllPackages = /* @__PURE__ */ __name(({ verbose = false, incremental } = {}) => {
|
|
2669
|
+
console.log(chalk35.gray(`${"Relint"} [All-Packages]`));
|
|
2169
2670
|
const start = Date.now();
|
|
2170
|
-
const verboseOptions = verbose ? [
|
|
2171
|
-
|
|
2671
|
+
const verboseOptions = verbose ? [
|
|
2672
|
+
"--verbose"
|
|
2673
|
+
] : [
|
|
2674
|
+
"--no-verbose"
|
|
2675
|
+
];
|
|
2676
|
+
const incrementalOptions = incremental ? [
|
|
2677
|
+
"--since",
|
|
2678
|
+
"-Ap"
|
|
2679
|
+
] : [
|
|
2680
|
+
"--parallel",
|
|
2681
|
+
"-Ap"
|
|
2682
|
+
];
|
|
2172
2683
|
const result = runSteps(`${"Relint"} [All-Packages]`, [
|
|
2173
|
-
[
|
|
2174
|
-
"
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2684
|
+
[
|
|
2685
|
+
"yarn",
|
|
2686
|
+
[
|
|
2687
|
+
"workspaces",
|
|
2688
|
+
"foreach",
|
|
2689
|
+
...verboseOptions,
|
|
2690
|
+
...incrementalOptions,
|
|
2691
|
+
"run",
|
|
2692
|
+
"package-relint"
|
|
2693
|
+
]
|
|
2694
|
+
]
|
|
2181
2695
|
]);
|
|
2182
|
-
console.log(
|
|
2696
|
+
console.log(chalk35.gray(`Relinted in [${chalk35.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk35.gray("seconds")}`));
|
|
2183
2697
|
return result;
|
|
2184
|
-
};
|
|
2698
|
+
}, "relintAllPackages");
|
|
2185
2699
|
|
|
2186
2700
|
// src/actions/retest.ts
|
|
2187
|
-
var retest = () => {
|
|
2701
|
+
var retest = /* @__PURE__ */ __name(() => {
|
|
2188
2702
|
return runSteps("Test", [
|
|
2189
|
-
[
|
|
2190
|
-
|
|
2703
|
+
[
|
|
2704
|
+
"yarn",
|
|
2705
|
+
[
|
|
2706
|
+
"jest",
|
|
2707
|
+
"--clearCache"
|
|
2708
|
+
]
|
|
2709
|
+
],
|
|
2710
|
+
[
|
|
2711
|
+
"yarn",
|
|
2712
|
+
[
|
|
2713
|
+
"jest",
|
|
2714
|
+
"."
|
|
2715
|
+
]
|
|
2716
|
+
]
|
|
2191
2717
|
]);
|
|
2192
|
-
};
|
|
2718
|
+
}, "retest");
|
|
2193
2719
|
|
|
2194
2720
|
// src/actions/sonar.ts
|
|
2195
|
-
var sonar = () => {
|
|
2196
|
-
return runSteps("Sonar", [
|
|
2197
|
-
|
|
2721
|
+
var sonar = /* @__PURE__ */ __name(() => {
|
|
2722
|
+
return runSteps("Sonar", [
|
|
2723
|
+
[
|
|
2724
|
+
"yarn",
|
|
2725
|
+
[
|
|
2726
|
+
"eslint",
|
|
2727
|
+
"-c",
|
|
2728
|
+
"sonar.eslintrc",
|
|
2729
|
+
"."
|
|
2730
|
+
]
|
|
2731
|
+
]
|
|
2732
|
+
]);
|
|
2733
|
+
}, "sonar");
|
|
2198
2734
|
|
|
2199
2735
|
// src/actions/statics.ts
|
|
2200
|
-
import
|
|
2201
|
-
var DefaultDependencies = [
|
|
2202
|
-
|
|
2203
|
-
|
|
2736
|
+
import chalk36 from "chalk";
|
|
2737
|
+
var DefaultDependencies = [
|
|
2738
|
+
"axios",
|
|
2739
|
+
"@xylabs/pixel",
|
|
2740
|
+
"react",
|
|
2741
|
+
"graphql",
|
|
2742
|
+
"react-router",
|
|
2743
|
+
"@mui/material",
|
|
2744
|
+
"@mui/system"
|
|
2745
|
+
];
|
|
2746
|
+
var statics = /* @__PURE__ */ __name(() => {
|
|
2747
|
+
console.log(chalk36.green("Check Required Static Dependencies"));
|
|
2204
2748
|
const statics2 = parsedPackageJSON()?.xy?.deps?.statics;
|
|
2205
2749
|
return detectDuplicateDependencies(statics2, DefaultDependencies);
|
|
2206
|
-
};
|
|
2750
|
+
}, "statics");
|
|
2207
2751
|
|
|
2208
2752
|
// src/actions/test.ts
|
|
2209
|
-
var test = () => {
|
|
2210
|
-
return runSteps("Test", [
|
|
2211
|
-
|
|
2753
|
+
var test = /* @__PURE__ */ __name(() => {
|
|
2754
|
+
return runSteps("Test", [
|
|
2755
|
+
[
|
|
2756
|
+
"yarn",
|
|
2757
|
+
[
|
|
2758
|
+
"vitest",
|
|
2759
|
+
"."
|
|
2760
|
+
]
|
|
2761
|
+
]
|
|
2762
|
+
]);
|
|
2763
|
+
}, "test");
|
|
2212
2764
|
|
|
2213
2765
|
// src/actions/up.ts
|
|
2214
|
-
var up = () => {
|
|
2215
|
-
return runSteps("Up", [
|
|
2216
|
-
|
|
2766
|
+
var up = /* @__PURE__ */ __name(() => {
|
|
2767
|
+
return runSteps("Up", [
|
|
2768
|
+
[
|
|
2769
|
+
"yarn",
|
|
2770
|
+
"outdated"
|
|
2771
|
+
]
|
|
2772
|
+
]);
|
|
2773
|
+
}, "up");
|
|
2217
2774
|
|
|
2218
2775
|
// src/actions/updo.ts
|
|
2219
|
-
var updo = () => {
|
|
2776
|
+
var updo = /* @__PURE__ */ __name(() => {
|
|
2220
2777
|
return runSteps("Updo", [
|
|
2221
|
-
[
|
|
2222
|
-
|
|
2223
|
-
|
|
2778
|
+
[
|
|
2779
|
+
"yarn",
|
|
2780
|
+
"install"
|
|
2781
|
+
],
|
|
2782
|
+
[
|
|
2783
|
+
"yarn",
|
|
2784
|
+
"upgrade-interactive"
|
|
2785
|
+
],
|
|
2786
|
+
[
|
|
2787
|
+
"yarn",
|
|
2788
|
+
"dedupe"
|
|
2789
|
+
]
|
|
2224
2790
|
]);
|
|
2225
|
-
};
|
|
2791
|
+
}, "updo");
|
|
2226
2792
|
|
|
2227
2793
|
// src/actions/upplug.ts
|
|
2228
|
-
var updateYarnPlugins = () => {
|
|
2794
|
+
var updateYarnPlugins = /* @__PURE__ */ __name(() => {
|
|
2229
2795
|
return runSteps("Update Yarn Plugins", [
|
|
2230
|
-
[
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2796
|
+
[
|
|
2797
|
+
"yarn",
|
|
2798
|
+
[
|
|
2799
|
+
"plugin",
|
|
2800
|
+
"import",
|
|
2801
|
+
"https://mskelton.dev/yarn-outdated/v3"
|
|
2802
|
+
]
|
|
2803
|
+
],
|
|
2804
|
+
[
|
|
2805
|
+
"yarn",
|
|
2806
|
+
[
|
|
2807
|
+
"plugin",
|
|
2808
|
+
"import",
|
|
2809
|
+
"version"
|
|
2810
|
+
]
|
|
2811
|
+
],
|
|
2812
|
+
[
|
|
2813
|
+
"yarn",
|
|
2814
|
+
[
|
|
2815
|
+
"plugin",
|
|
2816
|
+
"import",
|
|
2817
|
+
"interactive-tools"
|
|
2818
|
+
]
|
|
2819
|
+
],
|
|
2820
|
+
[
|
|
2821
|
+
"yarn",
|
|
2822
|
+
[
|
|
2823
|
+
"plugin",
|
|
2824
|
+
"import",
|
|
2825
|
+
"workspace-tools"
|
|
2826
|
+
]
|
|
2827
|
+
]
|
|
2234
2828
|
]);
|
|
2235
|
-
};
|
|
2829
|
+
}, "updateYarnPlugins");
|
|
2236
2830
|
|
|
2237
2831
|
// src/actions/upyarn.ts
|
|
2238
|
-
var updateYarnVersion = () => {
|
|
2239
|
-
return runSteps("Update Yarn Version", [
|
|
2240
|
-
|
|
2832
|
+
var updateYarnVersion = /* @__PURE__ */ __name(() => {
|
|
2833
|
+
return runSteps("Update Yarn Version", [
|
|
2834
|
+
[
|
|
2835
|
+
"yarn",
|
|
2836
|
+
[
|
|
2837
|
+
"set",
|
|
2838
|
+
"version",
|
|
2839
|
+
"latest"
|
|
2840
|
+
]
|
|
2841
|
+
]
|
|
2842
|
+
]);
|
|
2843
|
+
}, "updateYarnVersion");
|
|
2241
2844
|
|
|
2242
2845
|
// src/actions/yarn3only.ts
|
|
2243
|
-
var yarn3Only = () => {
|
|
2846
|
+
var yarn3Only = /* @__PURE__ */ __name(() => {
|
|
2244
2847
|
const [valid, version] = isYarnVersionOrGreater(3);
|
|
2245
2848
|
if (!valid) {
|
|
2246
2849
|
processEx(`Invalid Yarn version [${version}]`);
|
|
2247
2850
|
}
|
|
2248
2851
|
return 0;
|
|
2249
|
-
};
|
|
2852
|
+
}, "yarn3Only");
|
|
2250
2853
|
|
|
2251
2854
|
// src/loadPackageConfig.ts
|
|
2252
2855
|
import { readFile } from "fs/promises";
|
|
2253
|
-
var loadPackageConfig = async () => {
|
|
2856
|
+
var loadPackageConfig = /* @__PURE__ */ __name(async () => {
|
|
2254
2857
|
const pkg = process.env.INIT_CWD;
|
|
2255
|
-
const pkgConfig = await readFile(`${pkg}/package.json`, {
|
|
2858
|
+
const pkgConfig = await readFile(`${pkg}/package.json`, {
|
|
2859
|
+
encoding: "utf8"
|
|
2860
|
+
});
|
|
2256
2861
|
return JSON.parse(pkgConfig);
|
|
2257
|
-
};
|
|
2862
|
+
}, "loadPackageConfig");
|
|
2258
2863
|
|
|
2259
2864
|
// src/xy/xy.ts
|
|
2260
|
-
import
|
|
2865
|
+
import chalk38 from "chalk";
|
|
2261
2866
|
|
|
2262
2867
|
// src/xy/xyBuildCommands.ts
|
|
2263
|
-
var xyBuildCommands = (args) => {
|
|
2264
|
-
return args.command(
|
|
2265
|
-
"
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
(
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
}
|
|
2346
|
-
process.exitCode = await recompile({
|
|
2347
|
-
incremental: !!argv.incremental,
|
|
2348
|
-
jobs: argv.jobs,
|
|
2349
|
-
pkg: argv.package,
|
|
2350
|
-
target: argv.target,
|
|
2351
|
-
verbose: !!argv.verbose
|
|
2352
|
-
});
|
|
2353
|
-
}
|
|
2354
|
-
).command(
|
|
2355
|
-
"rebuild [package]",
|
|
2356
|
-
"Rebuild - Clean, Compile & Lint",
|
|
2357
|
-
(yargs2) => {
|
|
2358
|
-
return yargs2.positional("package", { describe: "Specific package to rebuild" });
|
|
2359
|
-
},
|
|
2360
|
-
(argv) => {
|
|
2361
|
-
if (argv.verbose) console.log(`Rebuilding: ${argv.package ?? "all"}`);
|
|
2362
|
-
process.exitCode = rebuild({ target: argv.target });
|
|
2363
|
-
}
|
|
2364
|
-
).command(
|
|
2365
|
-
"copy-assets [package]",
|
|
2366
|
-
"Copy Assets - Copy the assets from src to dist",
|
|
2367
|
-
(yargs2) => {
|
|
2368
|
-
return yargs2.positional("package", { describe: "Specific package to copy assets" });
|
|
2369
|
-
},
|
|
2370
|
-
async (argv) => {
|
|
2371
|
-
if (argv.verbose) console.log(`Copying Assets: ${argv.package ?? "all"}`);
|
|
2372
|
-
process.exitCode = await copyAssets({ target: argv.target });
|
|
2373
|
-
}
|
|
2374
|
-
);
|
|
2375
|
-
};
|
|
2868
|
+
var xyBuildCommands = /* @__PURE__ */ __name((args) => {
|
|
2869
|
+
return args.command("build [package]", "Build - Compile & Lint", (yargs2) => {
|
|
2870
|
+
return yargs2.positional("package", {
|
|
2871
|
+
describe: "Specific package to build"
|
|
2872
|
+
});
|
|
2873
|
+
}, async (argv) => {
|
|
2874
|
+
if (argv.verbose) {
|
|
2875
|
+
console.log(`Building: ${argv.package ?? "all"}`);
|
|
2876
|
+
}
|
|
2877
|
+
process.exitCode = await build({
|
|
2878
|
+
incremental: !!argv.incremental,
|
|
2879
|
+
jobs: argv.jobs,
|
|
2880
|
+
pkg: argv.package,
|
|
2881
|
+
target: argv.target,
|
|
2882
|
+
verbose: !!argv.verbose
|
|
2883
|
+
});
|
|
2884
|
+
}).command("compile [package]", "Compile with Typescript & Copy Images", (yargs2) => {
|
|
2885
|
+
return yargs2.positional("package", {
|
|
2886
|
+
describe: "Specific package to compile"
|
|
2887
|
+
});
|
|
2888
|
+
}, (argv) => {
|
|
2889
|
+
if (argv.verbose) {
|
|
2890
|
+
console.log(`Compiling: ${argv.package ?? "all"}`);
|
|
2891
|
+
}
|
|
2892
|
+
process.exitCode = compile({
|
|
2893
|
+
incremental: !!argv.incremental,
|
|
2894
|
+
jobs: argv.jobs,
|
|
2895
|
+
pkg: argv.package,
|
|
2896
|
+
target: argv.target,
|
|
2897
|
+
verbose: !!argv.verbose
|
|
2898
|
+
});
|
|
2899
|
+
}).command("compile-only [package]", "Compile with Typescript & Copy Images (No Publint)", (yargs2) => {
|
|
2900
|
+
return yargs2.positional("package", {
|
|
2901
|
+
describe: "Specific package to compile"
|
|
2902
|
+
});
|
|
2903
|
+
}, (argv) => {
|
|
2904
|
+
if (argv.verbose) {
|
|
2905
|
+
console.log(`Compiling: ${argv.package ?? "all"}`);
|
|
2906
|
+
}
|
|
2907
|
+
process.exitCode = compile({
|
|
2908
|
+
incremental: !!argv.incremental,
|
|
2909
|
+
jobs: argv.jobs,
|
|
2910
|
+
pkg: argv.package,
|
|
2911
|
+
publint: false,
|
|
2912
|
+
target: argv.target,
|
|
2913
|
+
verbose: !!argv.verbose
|
|
2914
|
+
});
|
|
2915
|
+
}).command("recompile [package]", "Re-compile with Typescript & Copy Images", (yargs2) => {
|
|
2916
|
+
return yargs2.positional("package", {
|
|
2917
|
+
describe: "Specific package to re-compile"
|
|
2918
|
+
});
|
|
2919
|
+
}, async (argv) => {
|
|
2920
|
+
if (argv.verbose) {
|
|
2921
|
+
console.log(`Re-compiling: ${argv.package ?? "all"}`);
|
|
2922
|
+
}
|
|
2923
|
+
process.exitCode = await recompile({
|
|
2924
|
+
incremental: !!argv.incremental,
|
|
2925
|
+
jobs: argv.jobs,
|
|
2926
|
+
pkg: argv.package,
|
|
2927
|
+
target: argv.target,
|
|
2928
|
+
verbose: !!argv.verbose
|
|
2929
|
+
});
|
|
2930
|
+
}).command("rebuild [package]", "Rebuild - Clean, Compile & Lint", (yargs2) => {
|
|
2931
|
+
return yargs2.positional("package", {
|
|
2932
|
+
describe: "Specific package to rebuild"
|
|
2933
|
+
});
|
|
2934
|
+
}, (argv) => {
|
|
2935
|
+
if (argv.verbose) console.log(`Rebuilding: ${argv.package ?? "all"}`);
|
|
2936
|
+
process.exitCode = rebuild({
|
|
2937
|
+
target: argv.target
|
|
2938
|
+
});
|
|
2939
|
+
}).command("copy-assets [package]", "Copy Assets - Copy the assets from src to dist", (yargs2) => {
|
|
2940
|
+
return yargs2.positional("package", {
|
|
2941
|
+
describe: "Specific package to copy assets"
|
|
2942
|
+
});
|
|
2943
|
+
}, async (argv) => {
|
|
2944
|
+
if (argv.verbose) console.log(`Copying Assets: ${argv.package ?? "all"}`);
|
|
2945
|
+
process.exitCode = await copyAssets({
|
|
2946
|
+
target: argv.target
|
|
2947
|
+
});
|
|
2948
|
+
});
|
|
2949
|
+
}, "xyBuildCommands");
|
|
2376
2950
|
|
|
2377
2951
|
// src/xy/param.ts
|
|
2378
|
-
var packagePositionalParam = (yargs2) => {
|
|
2379
|
-
return yargs2.positional("package", {
|
|
2380
|
-
|
|
2952
|
+
var packagePositionalParam = /* @__PURE__ */ __name((yargs2) => {
|
|
2953
|
+
return yargs2.positional("package", {
|
|
2954
|
+
describe: "Specific package to target",
|
|
2955
|
+
type: "string"
|
|
2956
|
+
});
|
|
2957
|
+
}, "packagePositionalParam");
|
|
2381
2958
|
|
|
2382
2959
|
// src/xy/xyCommonCommands.ts
|
|
2383
|
-
var xyCommonCommands = (args) => {
|
|
2384
|
-
return args.command(
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
(
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
).command(
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
(
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
(argv)
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
)
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
(argv)
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
)
|
|
2433
|
-
"
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
(argv)
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
)
|
|
2443
|
-
"
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
},
|
|
2448
|
-
(argv) => {
|
|
2449
|
-
if (argv.verbose) console.log("NpmIgnore Gen");
|
|
2450
|
-
process.exitCode = npmignoreGen();
|
|
2451
|
-
}
|
|
2452
|
-
).command(
|
|
2453
|
-
"retest",
|
|
2454
|
-
"Re-Test - Run Jest Tests with cleaned cache",
|
|
2455
|
-
(yargs2) => {
|
|
2456
|
-
return yargs2;
|
|
2457
|
-
},
|
|
2458
|
-
(argv) => {
|
|
2459
|
-
if (argv.verbose) console.log("Re-Testing");
|
|
2460
|
-
process.exitCode = retest();
|
|
2461
|
-
}
|
|
2462
|
-
).command(
|
|
2463
|
-
"test",
|
|
2464
|
-
"Test - Run Jest Tests",
|
|
2465
|
-
(yargs2) => {
|
|
2466
|
-
return yargs2;
|
|
2467
|
-
},
|
|
2468
|
-
(argv) => {
|
|
2469
|
-
if (argv.verbose) console.log("Testing");
|
|
2470
|
-
process.exitCode = test();
|
|
2471
|
-
}
|
|
2472
|
-
).command(
|
|
2473
|
-
"upplug",
|
|
2474
|
-
"UpPlug - Update Yarn Plugins",
|
|
2475
|
-
(yargs2) => {
|
|
2476
|
-
return yargs2;
|
|
2477
|
-
},
|
|
2478
|
-
(argv) => {
|
|
2479
|
-
if (argv.verbose) console.log("UpPlug");
|
|
2480
|
-
process.exitCode = updateYarnPlugins();
|
|
2481
|
-
}
|
|
2482
|
-
).command(
|
|
2483
|
-
"upyarn",
|
|
2484
|
-
"UpYarn - Update Yarn Version",
|
|
2485
|
-
(yargs2) => {
|
|
2486
|
-
return yargs2;
|
|
2487
|
-
},
|
|
2488
|
-
(argv) => {
|
|
2489
|
-
if (argv.verbose) console.log("UpYarn");
|
|
2490
|
-
process.exitCode = updateYarnVersion();
|
|
2491
|
-
}
|
|
2492
|
-
).command(
|
|
2493
|
-
"yarn3only",
|
|
2494
|
-
"Yarn3Only - Check if using Yarn v3",
|
|
2495
|
-
(yargs2) => {
|
|
2496
|
-
return yargs2;
|
|
2497
|
-
},
|
|
2498
|
-
(argv) => {
|
|
2499
|
-
if (argv.verbose) console.log("Yarn 3 Check");
|
|
2500
|
-
process.exitCode = yarn3Only();
|
|
2501
|
-
}
|
|
2502
|
-
);
|
|
2503
|
-
};
|
|
2960
|
+
var xyCommonCommands = /* @__PURE__ */ __name((args) => {
|
|
2961
|
+
return args.command("license [package]", "License - Check licenses of dependencies", (yargs2) => {
|
|
2962
|
+
return packagePositionalParam(yargs2);
|
|
2963
|
+
}, async (argv) => {
|
|
2964
|
+
if (argv.verbose) console.log(`License: ${argv.package ?? "all"}`);
|
|
2965
|
+
process.exitCode = await license();
|
|
2966
|
+
}).command("dead [package]", "Dead - Check for dead code", (yargs2) => {
|
|
2967
|
+
return packagePositionalParam(yargs2);
|
|
2968
|
+
}, (argv) => {
|
|
2969
|
+
if (argv.verbose) console.log("Dead");
|
|
2970
|
+
process.exitCode = dead();
|
|
2971
|
+
}).command("gen-docs [package]", "GenDocs - Generate TypeDocs", (yargs2) => {
|
|
2972
|
+
return packagePositionalParam(yargs2);
|
|
2973
|
+
}, (argv) => {
|
|
2974
|
+
if (argv.verbose) console.log(`Generating TypeDocs: ${argv.package ?? "all"}`);
|
|
2975
|
+
process.exitCode = genDocs({
|
|
2976
|
+
incremental: !!argv.incremental,
|
|
2977
|
+
pkg: argv.package
|
|
2978
|
+
});
|
|
2979
|
+
}).command("clean-docs", "CleanDocs - Clean TypeDocs", (yargs2) => yargs2, (argv) => {
|
|
2980
|
+
if (argv.verbose) console.log("Cleaning TypeDocs: all");
|
|
2981
|
+
process.exitCode = cleanDocs();
|
|
2982
|
+
}).command("gitlint [package]", "Gitlint - Lint your git config", (yargs2) => {
|
|
2983
|
+
return yargs2;
|
|
2984
|
+
}, (argv) => {
|
|
2985
|
+
if (argv.verbose) console.log("Gitlint");
|
|
2986
|
+
process.exitCode = argv.fix ? gitlintFix() : gitlint();
|
|
2987
|
+
}).command("gitignore-gen", "GitIgnore Gen - Generate .gitignore files", (yargs2) => {
|
|
2988
|
+
return yargs2;
|
|
2989
|
+
}, (argv) => {
|
|
2990
|
+
if (argv.verbose) console.log("GitIgnore Gen");
|
|
2991
|
+
process.exitCode = gitignoreGen();
|
|
2992
|
+
}).command("npmignore-gen", "NpmIgnore Gen - Generate .npmignore files", (yargs2) => {
|
|
2993
|
+
return yargs2;
|
|
2994
|
+
}, (argv) => {
|
|
2995
|
+
if (argv.verbose) console.log("NpmIgnore Gen");
|
|
2996
|
+
process.exitCode = npmignoreGen();
|
|
2997
|
+
}).command("retest", "Re-Test - Run Jest Tests with cleaned cache", (yargs2) => {
|
|
2998
|
+
return yargs2;
|
|
2999
|
+
}, (argv) => {
|
|
3000
|
+
if (argv.verbose) console.log("Re-Testing");
|
|
3001
|
+
process.exitCode = retest();
|
|
3002
|
+
}).command("test", "Test - Run Jest Tests", (yargs2) => {
|
|
3003
|
+
return yargs2;
|
|
3004
|
+
}, (argv) => {
|
|
3005
|
+
if (argv.verbose) console.log("Testing");
|
|
3006
|
+
process.exitCode = test();
|
|
3007
|
+
}).command("upplug", "UpPlug - Update Yarn Plugins", (yargs2) => {
|
|
3008
|
+
return yargs2;
|
|
3009
|
+
}, (argv) => {
|
|
3010
|
+
if (argv.verbose) console.log("UpPlug");
|
|
3011
|
+
process.exitCode = updateYarnPlugins();
|
|
3012
|
+
}).command("upyarn", "UpYarn - Update Yarn Version", (yargs2) => {
|
|
3013
|
+
return yargs2;
|
|
3014
|
+
}, (argv) => {
|
|
3015
|
+
if (argv.verbose) console.log("UpYarn");
|
|
3016
|
+
process.exitCode = updateYarnVersion();
|
|
3017
|
+
}).command("yarn3only", "Yarn3Only - Check if using Yarn v3", (yargs2) => {
|
|
3018
|
+
return yargs2;
|
|
3019
|
+
}, (argv) => {
|
|
3020
|
+
if (argv.verbose) console.log("Yarn 3 Check");
|
|
3021
|
+
process.exitCode = yarn3Only();
|
|
3022
|
+
});
|
|
3023
|
+
}, "xyCommonCommands");
|
|
2504
3024
|
|
|
2505
3025
|
// src/xy/xyDeployCommands.ts
|
|
2506
|
-
var xyDeployCommands = (args) => {
|
|
2507
|
-
return args.command(
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
(
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
).command(
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
(
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
)
|
|
2528
|
-
|
|
2529
|
-
"Deploy - Deploy major",
|
|
2530
|
-
(yargs2) => {
|
|
2531
|
-
return yargs2;
|
|
2532
|
-
},
|
|
2533
|
-
(argv) => {
|
|
2534
|
-
if (argv.verbose) console.log("Deploy major");
|
|
2535
|
-
process.exitCode = deployMajor();
|
|
2536
|
-
}
|
|
2537
|
-
).command(
|
|
2538
|
-
"deploy-next",
|
|
2539
|
-
"Deploy - Deploy next",
|
|
2540
|
-
(yargs2) => {
|
|
2541
|
-
return yargs2;
|
|
2542
|
-
},
|
|
2543
|
-
(argv) => {
|
|
2544
|
-
if (argv.verbose) console.log("Deploy next");
|
|
2545
|
-
process.exitCode = deployNext();
|
|
2546
|
-
}
|
|
2547
|
-
);
|
|
2548
|
-
};
|
|
3026
|
+
var xyDeployCommands = /* @__PURE__ */ __name((args) => {
|
|
3027
|
+
return args.command("deploy", "Deploy - Deploy patch", (yargs2) => {
|
|
3028
|
+
return yargs2;
|
|
3029
|
+
}, (argv) => {
|
|
3030
|
+
if (argv.verbose) console.log("Deploy patch");
|
|
3031
|
+
process.exitCode = deploy();
|
|
3032
|
+
}).command("deploy-minor", "Deploy - Deploy minor", (yargs2) => {
|
|
3033
|
+
return yargs2;
|
|
3034
|
+
}, (argv) => {
|
|
3035
|
+
if (argv.verbose) console.log("Deploy minor");
|
|
3036
|
+
process.exitCode = deployMinor();
|
|
3037
|
+
}).command("deploy-major", "Deploy - Deploy major", (yargs2) => {
|
|
3038
|
+
return yargs2;
|
|
3039
|
+
}, (argv) => {
|
|
3040
|
+
if (argv.verbose) console.log("Deploy major");
|
|
3041
|
+
process.exitCode = deployMajor();
|
|
3042
|
+
}).command("deploy-next", "Deploy - Deploy next", (yargs2) => {
|
|
3043
|
+
return yargs2;
|
|
3044
|
+
}, (argv) => {
|
|
3045
|
+
if (argv.verbose) console.log("Deploy next");
|
|
3046
|
+
process.exitCode = deployNext();
|
|
3047
|
+
});
|
|
3048
|
+
}, "xyDeployCommands");
|
|
2549
3049
|
|
|
2550
3050
|
// src/xy/xyInstallCommands.ts
|
|
2551
|
-
var xyInstallCommands = (args) => {
|
|
2552
|
-
return args.command(
|
|
2553
|
-
"
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
if (argv.verbose) {
|
|
2560
|
-
console.log(`Cleaning: ${argv.package ?? "all"}`);
|
|
2561
|
-
}
|
|
2562
|
-
process.exitCode = await clean({
|
|
2563
|
-
pkg: argv.package,
|
|
2564
|
-
verbose: !!argv.verbose
|
|
2565
|
-
});
|
|
2566
|
-
}
|
|
2567
|
-
).command(
|
|
2568
|
-
"reinstall",
|
|
2569
|
-
"Reinstall - Clean & Install",
|
|
2570
|
-
(yargs2) => {
|
|
2571
|
-
return yargs2;
|
|
2572
|
-
},
|
|
2573
|
-
(argv) => {
|
|
2574
|
-
if (argv.verbose) console.log("Reinstalling");
|
|
2575
|
-
process.exitCode = reinstall();
|
|
2576
|
-
}
|
|
2577
|
-
).command(
|
|
2578
|
-
"up",
|
|
2579
|
-
"Up - Update dependencies",
|
|
2580
|
-
(yargs2) => {
|
|
2581
|
-
return yargs2;
|
|
2582
|
-
},
|
|
2583
|
-
(argv) => {
|
|
2584
|
-
if (argv.verbose) console.log("Up");
|
|
2585
|
-
process.exitCode = up();
|
|
2586
|
-
}
|
|
2587
|
-
).command(
|
|
2588
|
-
"updo",
|
|
2589
|
-
"Updo - Update dependencies [Interactive]",
|
|
2590
|
-
(yargs2) => {
|
|
2591
|
-
return yargs2;
|
|
2592
|
-
},
|
|
2593
|
-
(argv) => {
|
|
2594
|
-
if (argv.verbose) console.log("Updo");
|
|
2595
|
-
process.exitCode = updo();
|
|
2596
|
-
}
|
|
2597
|
-
).command(
|
|
2598
|
-
"statics",
|
|
2599
|
-
"Statics - Confirming Static Packages",
|
|
2600
|
-
(yargs2) => {
|
|
2601
|
-
return yargs2;
|
|
2602
|
-
},
|
|
2603
|
-
(argv) => {
|
|
2604
|
-
if (argv.verbose) console.log("Statics");
|
|
2605
|
-
process.exitCode = statics();
|
|
2606
|
-
}
|
|
2607
|
-
).command(
|
|
2608
|
-
"dupdeps",
|
|
2609
|
-
"Dupdeps - Duplicate Dependencies in package.json",
|
|
2610
|
-
(yargs2) => {
|
|
2611
|
-
return yargs2;
|
|
2612
|
-
},
|
|
2613
|
-
(argv) => {
|
|
2614
|
-
if (argv.verbose) console.log("Dupdeps");
|
|
2615
|
-
process.exitCode = dupdeps();
|
|
3051
|
+
var xyInstallCommands = /* @__PURE__ */ __name((args) => {
|
|
3052
|
+
return args.command("clean [package]", "Clean", (yargs2) => {
|
|
3053
|
+
return yargs2.positional("package", {
|
|
3054
|
+
describe: "Specific package to clean"
|
|
3055
|
+
});
|
|
3056
|
+
}, async (argv) => {
|
|
3057
|
+
if (argv.verbose) {
|
|
3058
|
+
console.log(`Cleaning: ${argv.package ?? "all"}`);
|
|
2616
3059
|
}
|
|
2617
|
-
|
|
2618
|
-
|
|
3060
|
+
process.exitCode = await clean({
|
|
3061
|
+
pkg: argv.package,
|
|
3062
|
+
verbose: !!argv.verbose
|
|
3063
|
+
});
|
|
3064
|
+
}).command("reinstall", "Reinstall - Clean & Install", (yargs2) => {
|
|
3065
|
+
return yargs2;
|
|
3066
|
+
}, (argv) => {
|
|
3067
|
+
if (argv.verbose) console.log("Reinstalling");
|
|
3068
|
+
process.exitCode = reinstall();
|
|
3069
|
+
}).command("up", "Up - Update dependencies", (yargs2) => {
|
|
3070
|
+
return yargs2;
|
|
3071
|
+
}, (argv) => {
|
|
3072
|
+
if (argv.verbose) console.log("Up");
|
|
3073
|
+
process.exitCode = up();
|
|
3074
|
+
}).command("updo", "Updo - Update dependencies [Interactive]", (yargs2) => {
|
|
3075
|
+
return yargs2;
|
|
3076
|
+
}, (argv) => {
|
|
3077
|
+
if (argv.verbose) console.log("Updo");
|
|
3078
|
+
process.exitCode = updo();
|
|
3079
|
+
}).command("statics", "Statics - Confirming Static Packages", (yargs2) => {
|
|
3080
|
+
return yargs2;
|
|
3081
|
+
}, (argv) => {
|
|
3082
|
+
if (argv.verbose) console.log("Statics");
|
|
3083
|
+
process.exitCode = statics();
|
|
3084
|
+
}).command("dupdeps", "Dupdeps - Duplicate Dependencies in package.json", (yargs2) => {
|
|
3085
|
+
return yargs2;
|
|
3086
|
+
}, (argv) => {
|
|
3087
|
+
if (argv.verbose) console.log("Dupdeps");
|
|
3088
|
+
process.exitCode = dupdeps();
|
|
3089
|
+
});
|
|
3090
|
+
}, "xyInstallCommands");
|
|
2619
3091
|
|
|
2620
3092
|
// src/xy/xyLintCommands.ts
|
|
2621
|
-
import
|
|
2622
|
-
var xyLintCommands = (args) => {
|
|
2623
|
-
return args.command(
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
(
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
(
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
}
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
|
|
2659
|
-
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
|
|
2665
|
-
|
|
2666
|
-
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
}
|
|
2689
|
-
).command(
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
(
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
(
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
(
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
}
|
|
2713
|
-
).command(
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
(
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
process.exitCode = await publint({ pkg: argv.package, verbose: !!argv.verbose });
|
|
2723
|
-
console.log(chalk35.blue(`Finished in ${Date.now() - start}ms`));
|
|
2724
|
-
}
|
|
2725
|
-
).command(
|
|
2726
|
-
"knip",
|
|
2727
|
-
"Knip - Run Knip",
|
|
2728
|
-
(yargs2) => {
|
|
2729
|
-
return packagePositionalParam(yargs2);
|
|
2730
|
-
},
|
|
2731
|
-
(argv) => {
|
|
2732
|
-
if (argv.verbose) console.log("Knip");
|
|
2733
|
-
const start = Date.now();
|
|
2734
|
-
process.exitCode = knip();
|
|
2735
|
-
console.log(chalk35.blue(`Knip finished in ${Date.now() - start}ms`));
|
|
2736
|
-
}
|
|
2737
|
-
).command(
|
|
2738
|
-
"sonar",
|
|
2739
|
-
"Sonar - Run Sonar Check",
|
|
2740
|
-
(yargs2) => {
|
|
2741
|
-
return packagePositionalParam(yargs2);
|
|
2742
|
-
},
|
|
2743
|
-
(argv) => {
|
|
2744
|
-
const start = Date.now();
|
|
2745
|
-
if (argv.verbose) console.log("Sonar Check");
|
|
2746
|
-
process.exitCode = sonar();
|
|
2747
|
-
console.log(chalk35.blue(`Finished in ${Date.now() - start}ms`));
|
|
2748
|
-
}
|
|
2749
|
-
);
|
|
2750
|
-
};
|
|
3093
|
+
import chalk37 from "chalk";
|
|
3094
|
+
var xyLintCommands = /* @__PURE__ */ __name((args) => {
|
|
3095
|
+
return args.command("cycle [package]", "Cycle - Check for dependency cycles", (yargs2) => {
|
|
3096
|
+
return packagePositionalParam(yargs2);
|
|
3097
|
+
}, async (argv) => {
|
|
3098
|
+
const start = Date.now();
|
|
3099
|
+
if (argv.verbose) console.log("Cycle");
|
|
3100
|
+
process.exitCode = await cycle({
|
|
3101
|
+
pkg: argv.package
|
|
3102
|
+
});
|
|
3103
|
+
console.log(chalk37.blue(`Finished in ${Date.now() - start}ms`));
|
|
3104
|
+
}).command("lint [package]", "Lint - Run Eslint", (yargs2) => {
|
|
3105
|
+
return packagePositionalParam(yargs2).option("fix", {
|
|
3106
|
+
alias: "f",
|
|
3107
|
+
default: false,
|
|
3108
|
+
description: "Fix fixable issues",
|
|
3109
|
+
type: "boolean"
|
|
3110
|
+
}).option("cache", {
|
|
3111
|
+
alias: "c",
|
|
3112
|
+
default: false,
|
|
3113
|
+
description: "Use caching for performance",
|
|
3114
|
+
type: "boolean"
|
|
3115
|
+
});
|
|
3116
|
+
}, (argv) => {
|
|
3117
|
+
if (argv.verbose) console.log("Lint");
|
|
3118
|
+
const start = Date.now();
|
|
3119
|
+
process.exitCode = argv.fix ? fix({
|
|
3120
|
+
pkg: argv.package,
|
|
3121
|
+
cache: argv.cache
|
|
3122
|
+
}) : lint({
|
|
3123
|
+
pkg: argv.package,
|
|
3124
|
+
cache: argv.cache
|
|
3125
|
+
});
|
|
3126
|
+
console.log(chalk37.blue(`Finished in ${Date.now() - start}ms`));
|
|
3127
|
+
}).command("deplint [package]", "Deplint - Run Deplint", (yargs2) => {
|
|
3128
|
+
return packagePositionalParam(yargs2).option("deps", {
|
|
3129
|
+
alias: "d",
|
|
3130
|
+
default: false,
|
|
3131
|
+
description: "Check dependencies",
|
|
3132
|
+
type: "boolean"
|
|
3133
|
+
}).option("devDeps", {
|
|
3134
|
+
alias: "v",
|
|
3135
|
+
default: false,
|
|
3136
|
+
description: "Check devDependencies",
|
|
3137
|
+
type: "boolean"
|
|
3138
|
+
}).option("peerDeps", {
|
|
3139
|
+
alias: "p",
|
|
3140
|
+
default: false,
|
|
3141
|
+
description: "Check peerDependencies",
|
|
3142
|
+
type: "boolean"
|
|
3143
|
+
});
|
|
3144
|
+
}, (argv) => {
|
|
3145
|
+
if (argv.verbose) console.log("Deplint");
|
|
3146
|
+
const start = Date.now();
|
|
3147
|
+
process.exitCode = deplint({
|
|
3148
|
+
pkg: argv.package,
|
|
3149
|
+
deps: !!argv.deps,
|
|
3150
|
+
devDeps: !!argv.devDeps,
|
|
3151
|
+
peerDeps: !!argv.peerDeps
|
|
3152
|
+
});
|
|
3153
|
+
console.log(chalk37.blue(`Finished in ${Date.now() - start}ms`));
|
|
3154
|
+
}).command("fix [package]", "Fix - Run Eslint w/fix", (yargs2) => {
|
|
3155
|
+
return packagePositionalParam(yargs2);
|
|
3156
|
+
}, (argv) => {
|
|
3157
|
+
const start = Date.now();
|
|
3158
|
+
if (argv.verbose) console.log("Fix");
|
|
3159
|
+
process.exitCode = fix();
|
|
3160
|
+
console.log(chalk37.blue(`Finished in ${Date.now() - start}ms`));
|
|
3161
|
+
}).command("relint [package]", "Relint - Clean & Lint", (yargs2) => {
|
|
3162
|
+
return packagePositionalParam(yargs2);
|
|
3163
|
+
}, (argv) => {
|
|
3164
|
+
if (argv.verbose) console.log("Relinting");
|
|
3165
|
+
const start = Date.now();
|
|
3166
|
+
process.exitCode = relint();
|
|
3167
|
+
console.log(chalk37.blue(`Finished in ${Date.now() - start}ms`));
|
|
3168
|
+
}).command("publint [package]", "Publint - Run Publint", (yargs2) => {
|
|
3169
|
+
return packagePositionalParam(yargs2);
|
|
3170
|
+
}, async (argv) => {
|
|
3171
|
+
if (argv.verbose) console.log("Publint");
|
|
3172
|
+
const start = Date.now();
|
|
3173
|
+
process.exitCode = await publint({
|
|
3174
|
+
pkg: argv.package,
|
|
3175
|
+
verbose: !!argv.verbose
|
|
3176
|
+
});
|
|
3177
|
+
console.log(chalk37.blue(`Finished in ${Date.now() - start}ms`));
|
|
3178
|
+
}).command("knip", "Knip - Run Knip", (yargs2) => {
|
|
3179
|
+
return packagePositionalParam(yargs2);
|
|
3180
|
+
}, (argv) => {
|
|
3181
|
+
if (argv.verbose) console.log("Knip");
|
|
3182
|
+
const start = Date.now();
|
|
3183
|
+
process.exitCode = knip();
|
|
3184
|
+
console.log(chalk37.blue(`Knip finished in ${Date.now() - start}ms`));
|
|
3185
|
+
}).command("sonar", "Sonar - Run Sonar Check", (yargs2) => {
|
|
3186
|
+
return packagePositionalParam(yargs2);
|
|
3187
|
+
}, (argv) => {
|
|
3188
|
+
const start = Date.now();
|
|
3189
|
+
if (argv.verbose) console.log("Sonar Check");
|
|
3190
|
+
process.exitCode = sonar();
|
|
3191
|
+
console.log(chalk37.blue(`Finished in ${Date.now() - start}ms`));
|
|
3192
|
+
});
|
|
3193
|
+
}, "xyLintCommands");
|
|
2751
3194
|
|
|
2752
3195
|
// src/xy/xyParseOptions.ts
|
|
2753
3196
|
import yargs from "yargs";
|
|
2754
3197
|
import { hideBin } from "yargs/helpers";
|
|
2755
|
-
var xyParseOptions = () => {
|
|
3198
|
+
var xyParseOptions = /* @__PURE__ */ __name(() => {
|
|
2756
3199
|
return yargs(hideBin(process.argv)).scriptName("yarn xy").option("jobs", {
|
|
2757
3200
|
alias: "j",
|
|
2758
3201
|
default: void 0,
|
|
@@ -2774,16 +3217,16 @@ var xyParseOptions = () => {
|
|
|
2774
3217
|
description: "Profile action",
|
|
2775
3218
|
type: "boolean"
|
|
2776
3219
|
});
|
|
2777
|
-
};
|
|
3220
|
+
}, "xyParseOptions");
|
|
2778
3221
|
|
|
2779
3222
|
// src/xy/xy.ts
|
|
2780
|
-
var xy = async () => {
|
|
3223
|
+
var xy = /* @__PURE__ */ __name(async () => {
|
|
2781
3224
|
const options = xyParseOptions();
|
|
2782
3225
|
return await xyBuildCommands(xyCommonCommands(xyInstallCommands(xyDeployCommands(xyLintCommands(options))))).demandCommand(1).command("*", "", () => {
|
|
2783
|
-
console.error(
|
|
2784
|
-
console.log(
|
|
3226
|
+
console.error(chalk38.yellow(`Command not found [${chalk38.magenta(process.argv[2])}]`));
|
|
3227
|
+
console.log(chalk38.gray("Try 'yarn xy --help' for list of commands"));
|
|
2785
3228
|
}).version().help().argv;
|
|
2786
|
-
};
|
|
3229
|
+
}, "xy");
|
|
2787
3230
|
export {
|
|
2788
3231
|
CROSS_PLATFORM_NEWLINE,
|
|
2789
3232
|
DuplicateDetector,
|
|
@@ -2799,9 +3242,6 @@ export {
|
|
|
2799
3242
|
compile,
|
|
2800
3243
|
compileAll,
|
|
2801
3244
|
compilePackage,
|
|
2802
|
-
compileTypes,
|
|
2803
|
-
compileTypesAll,
|
|
2804
|
-
compileTypesPackage,
|
|
2805
3245
|
copyAssets,
|
|
2806
3246
|
createBuildConfig,
|
|
2807
3247
|
cycle,
|