@xylabs/ts-scripts-yarn3 7.0.0-rc.8 → 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 +1481 -901
- 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 +347 -144
- 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 +347 -226
- 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 +95 -24
- package/dist/actions/package/compile/packageCompileTscTypes.mjs.map +1 -1
- package/dist/actions/package/compile/packageCompileTsup.mjs +322 -126
- 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 +467 -304
- 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 +375 -158
- 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 +350 -148
- package/dist/bin/package/build-only.mjs.map +1 -1
- package/dist/bin/package/build.mjs +352 -148
- 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 +349 -147
- package/dist/bin/package/compile-only.mjs.map +1 -1
- package/dist/bin/package/compile-tsup.mjs +324 -129
- package/dist/bin/package/compile-tsup.mjs.map +1 -1
- package/dist/bin/package/compile.mjs +350 -148
- 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 +376 -160
- 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 +1848 -1410
- 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 +11 -9
- package/dist/actions/compile-types.mjs +0 -153
- package/dist/actions/compile-types.mjs.map +0 -1
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
|
|
1
4
|
// src/actions/package/clean-outputs.ts
|
|
2
5
|
import path from "path";
|
|
3
6
|
import chalk2 from "chalk";
|
|
@@ -5,12 +8,15 @@ import chalk2 from "chalk";
|
|
|
5
8
|
// src/lib/deleteGlob.ts
|
|
6
9
|
import fs from "fs";
|
|
7
10
|
import { glob } from "glob";
|
|
8
|
-
var deleteGlob = (globPath) => {
|
|
11
|
+
var deleteGlob = /* @__PURE__ */ __name((globPath) => {
|
|
9
12
|
const files = glob.sync(globPath);
|
|
10
13
|
for (const file of files) {
|
|
11
|
-
fs.rmSync(file, {
|
|
14
|
+
fs.rmSync(file, {
|
|
15
|
+
recursive: true,
|
|
16
|
+
force: true
|
|
17
|
+
});
|
|
12
18
|
}
|
|
13
|
-
};
|
|
19
|
+
}, "deleteGlob");
|
|
14
20
|
|
|
15
21
|
// src/lib/loadConfig.ts
|
|
16
22
|
import chalk from "chalk";
|
|
@@ -18,58 +24,76 @@ import { cosmiconfig } from "cosmiconfig";
|
|
|
18
24
|
import { TypeScriptLoader } from "cosmiconfig-typescript-loader";
|
|
19
25
|
import deepmerge from "deepmerge";
|
|
20
26
|
var config;
|
|
21
|
-
var loadConfig = async (params) => {
|
|
22
|
-
if (config) {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
var loadConfig = /* @__PURE__ */ __name(async (params) => {
|
|
28
|
+
if (config === void 0) {
|
|
29
|
+
const cosmicConfigResult = await cosmiconfig("xy", {
|
|
30
|
+
cache: true,
|
|
31
|
+
loaders: {
|
|
32
|
+
".ts": TypeScriptLoader()
|
|
33
|
+
}
|
|
34
|
+
}).search();
|
|
35
|
+
config = cosmicConfigResult?.config;
|
|
36
|
+
const configFilePath = cosmicConfigResult?.filepath;
|
|
37
|
+
if (configFilePath !== void 0) {
|
|
38
|
+
console.log(chalk.green(`Loaded config from ${configFilePath}`));
|
|
39
|
+
if (config.verbose) {
|
|
40
|
+
console.log(chalk.gray(`${JSON.stringify(config, null, 2)}`));
|
|
41
|
+
}
|
|
42
|
+
}
|
|
30
43
|
}
|
|
31
44
|
return deepmerge(config, params ?? {});
|
|
32
|
-
};
|
|
45
|
+
}, "loadConfig");
|
|
33
46
|
|
|
34
47
|
// src/actions/package/clean-outputs.ts
|
|
35
|
-
var packageCleanOutputs = () => {
|
|
48
|
+
var packageCleanOutputs = /* @__PURE__ */ __name(() => {
|
|
36
49
|
const pkg = process.env.INIT_CWD ?? ".";
|
|
37
50
|
const pkgName = process.env.npm_package_name;
|
|
38
|
-
const folders = [
|
|
51
|
+
const folders = [
|
|
52
|
+
path.join(pkg, "dist"),
|
|
53
|
+
path.join(pkg, "build"),
|
|
54
|
+
path.join(pkg, "docs")
|
|
55
|
+
];
|
|
39
56
|
console.log(chalk2.green(`Cleaning Outputs [${pkgName}]`));
|
|
40
57
|
for (let folder of folders) {
|
|
41
58
|
deleteGlob(folder);
|
|
42
59
|
}
|
|
43
60
|
return 0;
|
|
44
|
-
};
|
|
61
|
+
}, "packageCleanOutputs");
|
|
45
62
|
|
|
46
63
|
// src/actions/package/clean-typescript.ts
|
|
47
64
|
import path2 from "path";
|
|
48
65
|
import chalk3 from "chalk";
|
|
49
|
-
var packageCleanTypescript = () => {
|
|
66
|
+
var packageCleanTypescript = /* @__PURE__ */ __name(() => {
|
|
50
67
|
const pkg = process.env.INIT_CWD ?? ".";
|
|
51
68
|
const pkgName = process.env.npm_package_name;
|
|
52
69
|
console.log(chalk3.green(`Cleaning Typescript [${pkgName}]`));
|
|
53
|
-
const files = [
|
|
70
|
+
const files = [
|
|
71
|
+
path2.join(pkg, "*.tsbuildinfo"),
|
|
72
|
+
path2.join(pkg, ".tsconfig.*"),
|
|
73
|
+
path2.join(pkg, ".eslintcache")
|
|
74
|
+
];
|
|
54
75
|
for (let file of files) {
|
|
55
76
|
deleteGlob(file);
|
|
56
77
|
}
|
|
57
78
|
return 0;
|
|
58
|
-
};
|
|
79
|
+
}, "packageCleanTypescript");
|
|
59
80
|
|
|
60
81
|
// src/actions/package/clean.ts
|
|
61
|
-
var packageClean = async () => {
|
|
62
|
-
return (await Promise.all([
|
|
63
|
-
|
|
82
|
+
var packageClean = /* @__PURE__ */ __name(async () => {
|
|
83
|
+
return (await Promise.all([
|
|
84
|
+
packageCleanOutputs(),
|
|
85
|
+
packageCleanTypescript()
|
|
86
|
+
])).reduce((prev, value) => prev + value, 0);
|
|
87
|
+
}, "packageClean");
|
|
64
88
|
|
|
65
89
|
// src/actions/package/compile/compile.ts
|
|
66
|
-
import
|
|
90
|
+
import chalk9 from "chalk";
|
|
67
91
|
|
|
68
92
|
// src/actions/package/publint.ts
|
|
69
93
|
import { promises as fs2 } from "fs";
|
|
70
94
|
import chalk4 from "chalk";
|
|
71
95
|
import sortPackageJson from "sort-package-json";
|
|
72
|
-
var packagePublint = async (params) => {
|
|
96
|
+
var packagePublint = /* @__PURE__ */ __name(async (params) => {
|
|
73
97
|
const pkgDir = process.env.INIT_CWD;
|
|
74
98
|
const sortedPkg = sortPackageJson(await fs2.readFile(`${pkgDir}/package.json`, "utf8"));
|
|
75
99
|
await fs2.writeFile(`${pkgDir}/package.json`, sortedPkg);
|
|
@@ -83,9 +107,9 @@ var packagePublint = async (params) => {
|
|
|
83
107
|
strict: true
|
|
84
108
|
});
|
|
85
109
|
const { formatMessage } = await import("publint/utils");
|
|
86
|
-
const validMessage = (_message) => {
|
|
110
|
+
const validMessage = /* @__PURE__ */ __name((_message) => {
|
|
87
111
|
return true;
|
|
88
|
-
};
|
|
112
|
+
}, "validMessage");
|
|
89
113
|
const validMessages = messages.filter(validMessage);
|
|
90
114
|
for (const message of validMessages) {
|
|
91
115
|
switch (message.type) {
|
|
@@ -107,27 +131,51 @@ var packagePublint = async (params) => {
|
|
|
107
131
|
console.log(chalk4.gray(`Publint [Finish]: ${pkgDir} [${validMessages.length}]`));
|
|
108
132
|
}
|
|
109
133
|
return validMessages.filter((message) => message.type === "error").length;
|
|
110
|
-
};
|
|
134
|
+
}, "packagePublint");
|
|
111
135
|
|
|
112
136
|
// src/actions/package/compile/packageCompileTsup.ts
|
|
137
|
+
import chalk8 from "chalk";
|
|
113
138
|
import { build, defineConfig } from "tsup";
|
|
114
139
|
|
|
115
140
|
// src/actions/package/compile/inputs.ts
|
|
141
|
+
import chalk5 from "chalk";
|
|
116
142
|
import { glob as glob2 } from "glob";
|
|
117
|
-
var getAllInputs = (
|
|
118
|
-
return
|
|
119
|
-
}
|
|
143
|
+
var getAllInputs = /* @__PURE__ */ __name((srcDir, verbose = false) => {
|
|
144
|
+
return [
|
|
145
|
+
...glob2.sync(`${srcDir}/**/*.ts`, {
|
|
146
|
+
posix: true
|
|
147
|
+
}).map((file) => {
|
|
148
|
+
const result = file.slice(Math.max(0, srcDir.length + 1));
|
|
149
|
+
if (verbose) {
|
|
150
|
+
console.log(chalk5.gray(`getAllInputs: ${JSON.stringify(result, null, 2)}`));
|
|
151
|
+
}
|
|
152
|
+
return result;
|
|
153
|
+
}),
|
|
154
|
+
...glob2.sync(`${srcDir}/**/*.tsx`, {
|
|
155
|
+
posix: true
|
|
156
|
+
}).map((file) => {
|
|
157
|
+
const result = file.slice(Math.max(0, srcDir.length + 1));
|
|
158
|
+
if (verbose) {
|
|
159
|
+
console.log(chalk5.gray(`getAllInputs: ${JSON.stringify(result, null, 2)}`));
|
|
160
|
+
}
|
|
161
|
+
return result;
|
|
162
|
+
})
|
|
163
|
+
];
|
|
164
|
+
}, "getAllInputs");
|
|
120
165
|
|
|
121
166
|
// src/actions/package/compile/buildEntries.ts
|
|
122
|
-
var buildEntries = (
|
|
167
|
+
var buildEntries = /* @__PURE__ */ __name((srcDir, entryMode = "single", options, excludeSpecAndStories = true, verbose = false) => {
|
|
123
168
|
let entries = [];
|
|
124
169
|
switch (entryMode) {
|
|
125
170
|
case "platform": {
|
|
126
|
-
entries = [
|
|
171
|
+
entries = [
|
|
172
|
+
"index-node.ts",
|
|
173
|
+
"index-browser.ts"
|
|
174
|
+
];
|
|
127
175
|
break;
|
|
128
176
|
}
|
|
129
177
|
case "all": {
|
|
130
|
-
entries = excludeSpecAndStories ? getAllInputs(
|
|
178
|
+
entries = (excludeSpecAndStories ? getAllInputs(srcDir).filter((entry) => !entry.includes(".spec.") && !entry.includes(".stories.")) : getAllInputs(srcDir)).filter((entry) => !entry.endsWith(".d.ts"));
|
|
131
179
|
break;
|
|
132
180
|
}
|
|
133
181
|
case "custom": {
|
|
@@ -135,7 +183,9 @@ var buildEntries = (folder, entryMode = "single", options, excludeSpecAndStories
|
|
|
135
183
|
break;
|
|
136
184
|
}
|
|
137
185
|
default: {
|
|
138
|
-
entries = [
|
|
186
|
+
entries = [
|
|
187
|
+
"index.ts"
|
|
188
|
+
];
|
|
139
189
|
break;
|
|
140
190
|
}
|
|
141
191
|
}
|
|
@@ -144,7 +194,7 @@ var buildEntries = (folder, entryMode = "single", options, excludeSpecAndStories
|
|
|
144
194
|
}
|
|
145
195
|
if (verbose) console.log(`buildEntries [${entryMode}] ${entries.length}`);
|
|
146
196
|
return entries;
|
|
147
|
-
};
|
|
197
|
+
}, "buildEntries");
|
|
148
198
|
|
|
149
199
|
// src/actions/package/compile/deepMerge.ts
|
|
150
200
|
function deepMerge(target, source) {
|
|
@@ -161,6 +211,7 @@ function deepMerge(target, source) {
|
|
|
161
211
|
}
|
|
162
212
|
return target;
|
|
163
213
|
}
|
|
214
|
+
__name(deepMerge, "deepMerge");
|
|
164
215
|
function deepMergeObjects(objects) {
|
|
165
216
|
const result = {};
|
|
166
217
|
for (const obj of objects) {
|
|
@@ -168,169 +219,335 @@ function deepMergeObjects(objects) {
|
|
|
168
219
|
}
|
|
169
220
|
return result;
|
|
170
221
|
}
|
|
222
|
+
__name(deepMergeObjects, "deepMergeObjects");
|
|
171
223
|
|
|
172
|
-
// src/actions/package/compile/
|
|
224
|
+
// src/actions/package/compile/packageCompileTsc.ts
|
|
225
|
+
import { cwd as cwd2 } from "process";
|
|
226
|
+
import chalk6 from "chalk";
|
|
227
|
+
import { createProgramFromConfig } from "tsc-prog";
|
|
228
|
+
import ts, { DiagnosticCategory, formatDiagnosticsWithColorAndContext, getPreEmitDiagnostics, sys } from "typescript";
|
|
229
|
+
|
|
230
|
+
// src/actions/package/compile/getCompilerOptions.ts
|
|
173
231
|
import { cwd } from "process";
|
|
232
|
+
import deepmerge2 from "deepmerge";
|
|
233
|
+
import { getTsconfig } from "get-tsconfig";
|
|
234
|
+
var getCompilerOptions = /* @__PURE__ */ __name((options = {}, fileName = "tsconfig.json") => {
|
|
235
|
+
const resolvedTsConfigCompilerOptions = getTsconfig(cwd(), fileName)?.config?.compilerOptions ?? {};
|
|
236
|
+
return deepmerge2(resolvedTsConfigCompilerOptions, options);
|
|
237
|
+
}, "getCompilerOptions");
|
|
238
|
+
|
|
239
|
+
// src/actions/package/compile/packageCompileTsc.ts
|
|
240
|
+
var packageCompileTsc = /* @__PURE__ */ __name((platform, entries, srcDir = "src", outDir = "dist", compilerOptionsParam, verbose = false) => {
|
|
241
|
+
const pkg = process.env.INIT_CWD ?? cwd2();
|
|
242
|
+
if (verbose) {
|
|
243
|
+
console.log(chalk6.cyan(`Validating code START: ${entries.length} files to ${outDir} from ${srcDir}`));
|
|
244
|
+
}
|
|
245
|
+
const configFilePath = ts.findConfigFile("./", ts.sys.fileExists, "tsconfig.json");
|
|
246
|
+
if (configFilePath === void 0) {
|
|
247
|
+
throw new Error("Could not find tsconfig.json");
|
|
248
|
+
}
|
|
249
|
+
const compilerOptions = {
|
|
250
|
+
...getCompilerOptions({
|
|
251
|
+
removeComments: false,
|
|
252
|
+
skipDefaultLibCheck: true,
|
|
253
|
+
skipLibCheck: true,
|
|
254
|
+
sourceMap: false
|
|
255
|
+
}),
|
|
256
|
+
...compilerOptionsParam,
|
|
257
|
+
outDir: `${outDir}/${platform}`,
|
|
258
|
+
emitDeclarationOnly: true,
|
|
259
|
+
noEmit: false
|
|
260
|
+
};
|
|
261
|
+
console.log(chalk6.cyan(`Validating Files: ${entries.length}`));
|
|
262
|
+
if (verbose) {
|
|
263
|
+
for (const entry of entries) {
|
|
264
|
+
console.log(chalk6.grey(`Validating: ${entry}`));
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
try {
|
|
268
|
+
if (entries.length > 0) {
|
|
269
|
+
const program = createProgramFromConfig({
|
|
270
|
+
configFilePath,
|
|
271
|
+
basePath: pkg ?? cwd2(),
|
|
272
|
+
compilerOptions,
|
|
273
|
+
files: entries.map((entry) => `${srcDir}/${entry}`),
|
|
274
|
+
include: [
|
|
275
|
+
`${srcDir}/**/*.*`
|
|
276
|
+
]
|
|
277
|
+
});
|
|
278
|
+
const diagnostics = getPreEmitDiagnostics(program);
|
|
279
|
+
if (diagnostics.length > 0) {
|
|
280
|
+
const formattedDiagnostics = formatDiagnosticsWithColorAndContext(diagnostics, {
|
|
281
|
+
getCanonicalFileName: /* @__PURE__ */ __name((fileName) => fileName, "getCanonicalFileName"),
|
|
282
|
+
getCurrentDirectory: /* @__PURE__ */ __name(() => srcDir, "getCurrentDirectory"),
|
|
283
|
+
getNewLine: /* @__PURE__ */ __name(() => sys.newLine, "getNewLine")
|
|
284
|
+
});
|
|
285
|
+
console.error(formattedDiagnostics);
|
|
286
|
+
}
|
|
287
|
+
program.emit();
|
|
288
|
+
return diagnostics.reduce((acc, diag) => acc + (diag.category === DiagnosticCategory.Error ? 1 : 0), 0);
|
|
289
|
+
}
|
|
290
|
+
return 0;
|
|
291
|
+
} finally {
|
|
292
|
+
if (verbose) {
|
|
293
|
+
console.log(chalk6.cyan(`Validating code FINISH: ${entries.length} files to ${outDir} from ${srcDir}`));
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
}, "packageCompileTsc");
|
|
297
|
+
|
|
298
|
+
// src/actions/package/compile/packageCompileTscTypes.ts
|
|
299
|
+
import path3 from "path";
|
|
300
|
+
import { cwd as cwd3 } from "process";
|
|
301
|
+
import chalk7 from "chalk";
|
|
174
302
|
import { rollup } from "rollup";
|
|
175
303
|
import dts from "rollup-plugin-dts";
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
304
|
+
import nodeExternals from "rollup-plugin-node-externals";
|
|
305
|
+
var ignoredWarningCodes = /* @__PURE__ */ new Set([
|
|
306
|
+
"EMPTY_BUNDLE",
|
|
307
|
+
"UNRESOLVED_IMPORT"
|
|
308
|
+
]);
|
|
309
|
+
async function bundleDts(inputPath, outputPath, platform, options, verbose = false) {
|
|
310
|
+
const pkg = process.env.INIT_CWD ?? cwd3();
|
|
311
|
+
const tsconfigPath = path3.resolve(pkg, "tsconfig.json");
|
|
312
|
+
const nodePlugIns = platform === "node" ? [
|
|
313
|
+
nodeExternals()
|
|
314
|
+
] : [];
|
|
315
|
+
try {
|
|
316
|
+
const bundle = await rollup({
|
|
317
|
+
input: inputPath,
|
|
318
|
+
plugins: [
|
|
319
|
+
dts({
|
|
320
|
+
...options,
|
|
321
|
+
tsconfig: tsconfigPath,
|
|
322
|
+
compilerOptions: {
|
|
323
|
+
emitDeclarationOnly: true,
|
|
324
|
+
noEmit: false,
|
|
325
|
+
declarationMap: true
|
|
326
|
+
}
|
|
327
|
+
}),
|
|
328
|
+
...nodePlugIns
|
|
329
|
+
],
|
|
330
|
+
onwarn(warning, warn) {
|
|
331
|
+
if (ignoredWarningCodes.has(warning.code ?? "")) {
|
|
332
|
+
return;
|
|
333
|
+
}
|
|
334
|
+
console.warn(chalk7.yellow(`[${warning.code}] ${warning.message}`));
|
|
335
|
+
console.warn(chalk7.gray(inputPath));
|
|
336
|
+
warn(warning);
|
|
337
|
+
}
|
|
338
|
+
});
|
|
339
|
+
await bundle.write({
|
|
340
|
+
file: outputPath,
|
|
341
|
+
format: "es"
|
|
342
|
+
});
|
|
343
|
+
} catch (ex) {
|
|
344
|
+
const error = ex;
|
|
345
|
+
console.warn(chalk7.red(error));
|
|
346
|
+
console.warn(chalk7.gray(inputPath));
|
|
347
|
+
}
|
|
348
|
+
if (verbose) {
|
|
349
|
+
console.log(`Bundled declarations written to ${outputPath}`);
|
|
350
|
+
}
|
|
190
351
|
}
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
352
|
+
__name(bundleDts, "bundleDts");
|
|
353
|
+
var packageCompileTscTypes = /* @__PURE__ */ __name(async (entries, outDir, platform, srcDir = "build", verbose = false) => {
|
|
354
|
+
if (verbose) {
|
|
355
|
+
console.log(chalk7.cyan(`Compiling Types START [${platform}]: ${entries.length} files to ${outDir} from ${srcDir}`));
|
|
356
|
+
console.log(`Entries: ${entries.join(", ")}`);
|
|
357
|
+
}
|
|
358
|
+
const pkg = process.env.INIT_CWD ?? cwd3();
|
|
359
|
+
const srcRoot = `${pkg}/${srcDir}/${platform}`;
|
|
360
|
+
const entryNameToTypeName = /* @__PURE__ */ __name((entry) => {
|
|
195
361
|
const splitEntryName = entry.split(".");
|
|
196
362
|
const newEntryExtension = "d." + splitEntryName.at(-1);
|
|
197
|
-
return [
|
|
198
|
-
|
|
199
|
-
|
|
363
|
+
return [
|
|
364
|
+
...splitEntryName.slice(0, -1),
|
|
365
|
+
newEntryExtension
|
|
366
|
+
].join(".");
|
|
367
|
+
}, "entryNameToTypeName");
|
|
368
|
+
const compilerOptions = getCompilerOptions({
|
|
369
|
+
removeComments: false,
|
|
370
|
+
skipDefaultLibCheck: true,
|
|
371
|
+
skipLibCheck: true,
|
|
372
|
+
declarationMap: true,
|
|
373
|
+
emitDeclarationOnly: true,
|
|
374
|
+
noEmit: true
|
|
375
|
+
});
|
|
376
|
+
const entryNames = entries.map((entry) => entry.split(`${srcDir}/`).at(-1) ?? entry);
|
|
200
377
|
await Promise.all(entryNames.map(async (entryName) => {
|
|
201
|
-
|
|
378
|
+
const entryTypeName = entryNameToTypeName(entryName);
|
|
379
|
+
await bundleDts(`${srcRoot}/${entryTypeName}`, `${outDir}/${entryTypeName}`, platform, {
|
|
380
|
+
compilerOptions
|
|
381
|
+
}, verbose);
|
|
202
382
|
}));
|
|
383
|
+
if (verbose) {
|
|
384
|
+
console.log(chalk7.cyan(`Compiling Types FINISH: ${entries.length} files to ${outDir} from ${srcDir}`));
|
|
385
|
+
}
|
|
203
386
|
return 0;
|
|
204
|
-
};
|
|
387
|
+
}, "packageCompileTscTypes");
|
|
205
388
|
|
|
206
389
|
// src/actions/package/compile/packageCompileTsup.ts
|
|
207
|
-
var compileFolder =
|
|
390
|
+
var compileFolder = /* @__PURE__ */ __name(async (srcDir, entries, buildDir, options, bundleTypes = false, verbose) => {
|
|
208
391
|
const outDir = options?.outDir ?? "dist";
|
|
209
392
|
if (verbose) {
|
|
210
|
-
console.log(`compileFolder [${
|
|
393
|
+
console.log(`compileFolder [${srcDir}, ${options?.outDir}]`);
|
|
394
|
+
}
|
|
395
|
+
if (entries.length === 0) {
|
|
396
|
+
console.warn(chalk8.yellow(`No entries found in ${srcDir} to compile`));
|
|
397
|
+
return 0;
|
|
211
398
|
}
|
|
212
|
-
const entry = buildEntries(folder, entryMode, options, true, verbose);
|
|
213
|
-
const optionsResult = defineConfig({
|
|
214
|
-
bundle: true,
|
|
215
|
-
cjsInterop: true,
|
|
216
|
-
clean: true,
|
|
217
|
-
dts: false,
|
|
218
|
-
entry,
|
|
219
|
-
format: ["esm"],
|
|
220
|
-
outDir,
|
|
221
|
-
silent: true,
|
|
222
|
-
sourcemap: true,
|
|
223
|
-
splitting: false,
|
|
224
|
-
tsconfig: "tsconfig.json",
|
|
225
|
-
...options
|
|
226
|
-
});
|
|
227
|
-
const optionsList = (await Promise.all(
|
|
228
|
-
(Array.isArray(optionsResult) ? optionsResult : [optionsResult]).flatMap(async (options2) => {
|
|
229
|
-
const result = typeof options2 === "function" ? await options2({}) : [options2];
|
|
230
|
-
return Array.isArray(result) ? result : [result];
|
|
231
|
-
})
|
|
232
|
-
)).flat();
|
|
233
399
|
if (verbose) {
|
|
234
|
-
console.log(`
|
|
400
|
+
console.log(chalk8.gray(`buildDir [${buildDir}]`));
|
|
401
|
+
}
|
|
402
|
+
const validationResult = packageCompileTsc(options?.platform ?? "neutral", entries, srcDir, buildDir, void 0, verbose);
|
|
403
|
+
if (validationResult !== 0) {
|
|
404
|
+
console.error(chalk8.red(`Compile:Validation had ${validationResult} errors`));
|
|
405
|
+
return validationResult;
|
|
406
|
+
}
|
|
407
|
+
const optionsParams = tsupOptions([
|
|
408
|
+
{
|
|
409
|
+
bundle: true,
|
|
410
|
+
cjsInterop: true,
|
|
411
|
+
clean: false,
|
|
412
|
+
dts: false,
|
|
413
|
+
format: [
|
|
414
|
+
"esm"
|
|
415
|
+
],
|
|
416
|
+
outDir,
|
|
417
|
+
silent: true,
|
|
418
|
+
sourcemap: true,
|
|
419
|
+
splitting: false,
|
|
420
|
+
tsconfig: "tsconfig.json",
|
|
421
|
+
...options,
|
|
422
|
+
entry: entries.map((entry) => `${srcDir}/${entry}`)
|
|
423
|
+
}
|
|
424
|
+
]);
|
|
425
|
+
const optionsResult = defineConfig(optionsParams);
|
|
426
|
+
const optionsList = (await Promise.all((Array.isArray(optionsResult) ? optionsResult : [
|
|
427
|
+
optionsResult
|
|
428
|
+
]).flatMap(async (options2) => {
|
|
429
|
+
const result = typeof options2 === "function" ? await options2({}) : [
|
|
430
|
+
options2
|
|
431
|
+
];
|
|
432
|
+
return Array.isArray(result) ? result : [
|
|
433
|
+
result
|
|
434
|
+
];
|
|
435
|
+
}))).flat();
|
|
436
|
+
if (verbose) {
|
|
437
|
+
console.log(chalk8.cyan(`TSUP:build:start [${srcDir}]`));
|
|
438
|
+
console.log(chalk8.gray(`TSUP:build:options [${JSON.stringify(optionsList, null, 2)}]`));
|
|
235
439
|
}
|
|
236
440
|
await Promise.all(optionsList.map((options2) => build(options2)));
|
|
237
441
|
if (verbose) {
|
|
238
|
-
console.log(`TSUP:build:stop [${
|
|
442
|
+
console.log(chalk8.cyan(`TSUP:build:stop [${srcDir}]`));
|
|
443
|
+
}
|
|
444
|
+
if (bundleTypes) {
|
|
445
|
+
await packageCompileTscTypes(entries, outDir, options?.platform ?? "neutral", buildDir, verbose);
|
|
239
446
|
}
|
|
240
|
-
await packageCompileTscTypes(entry, outDir);
|
|
241
447
|
return 0;
|
|
242
|
-
};
|
|
243
|
-
var tsupOptions = (options = []) => {
|
|
448
|
+
}, "compileFolder");
|
|
449
|
+
var tsupOptions = /* @__PURE__ */ __name((options = []) => {
|
|
244
450
|
const standardLoaders = {
|
|
245
451
|
".gif": "copy",
|
|
246
452
|
".html": "copy",
|
|
247
453
|
".jpg": "copy",
|
|
248
454
|
".json": "json",
|
|
249
455
|
".png": "copy",
|
|
250
|
-
".svg": "
|
|
456
|
+
".svg": "text",
|
|
251
457
|
".webp": "copy"
|
|
252
458
|
};
|
|
253
459
|
const standardOptions = {
|
|
254
460
|
bundle: true,
|
|
255
|
-
format: [
|
|
461
|
+
format: [
|
|
462
|
+
"esm"
|
|
463
|
+
],
|
|
256
464
|
loader: standardLoaders,
|
|
257
|
-
outExtension: ({ format }) => format === "esm" ? {
|
|
465
|
+
outExtension: /* @__PURE__ */ __name(({ format }) => format === "esm" ? {
|
|
466
|
+
js: ".mjs"
|
|
467
|
+
} : {
|
|
468
|
+
js: ".cjs"
|
|
469
|
+
}, "outExtension"),
|
|
258
470
|
skipNodeModulesBundle: true,
|
|
259
471
|
sourcemap: true,
|
|
260
472
|
target: "esnext"
|
|
261
473
|
};
|
|
262
|
-
return deepMergeObjects([
|
|
263
|
-
|
|
264
|
-
|
|
474
|
+
return deepMergeObjects([
|
|
475
|
+
standardOptions,
|
|
476
|
+
...options
|
|
477
|
+
]);
|
|
478
|
+
}, "tsupOptions");
|
|
479
|
+
var packageCompileTsup = /* @__PURE__ */ __name(async (config2) => {
|
|
265
480
|
const compile = config2?.compile;
|
|
266
481
|
const verbose = config2?.verbose ?? false;
|
|
482
|
+
const outDirAsBuildDir = compile?.outDirAsBuildDir ?? true;
|
|
483
|
+
const bundleTypes = compile?.bundleTypes ?? false;
|
|
267
484
|
if (verbose) {
|
|
268
|
-
console.log(
|
|
485
|
+
console.log("Compiling with TSUP");
|
|
269
486
|
}
|
|
270
|
-
const compileForNode = compile?.node ?? {
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
)).reduce((prev, value) => prev + value, 0) + 0;
|
|
328
|
-
};
|
|
487
|
+
const compileForNode = compile?.node ?? {
|
|
488
|
+
src: {}
|
|
489
|
+
};
|
|
490
|
+
const compileForBrowser = compile?.browser ?? {
|
|
491
|
+
src: {}
|
|
492
|
+
};
|
|
493
|
+
const compileForNeutral = compile?.neutral ?? {
|
|
494
|
+
src: {}
|
|
495
|
+
};
|
|
496
|
+
return (await Promise.all(Object.entries(compileForNode).map(async ([srcDir, options]) => {
|
|
497
|
+
const optionsObject = typeof options === "object" ? options : {};
|
|
498
|
+
const inEsBuildOptions = typeof compile?.node?.esbuildOptions === "object" ? compile?.node?.esbuildOptions : {};
|
|
499
|
+
const entry = buildEntries(srcDir, compile?.entryMode, options, true, verbose);
|
|
500
|
+
const platform = "node";
|
|
501
|
+
const rootOutDir = optionsObject.outDir ?? "dist";
|
|
502
|
+
const outDir = rootOutDir + "/" + platform;
|
|
503
|
+
return typeof srcDir === "string" ? await compileFolder(srcDir, entry, outDirAsBuildDir ? rootOutDir : "build", tsupOptions([
|
|
504
|
+
inEsBuildOptions,
|
|
505
|
+
compile?.tsup?.options ?? {},
|
|
506
|
+
typeof options === "object" ? options : {},
|
|
507
|
+
{
|
|
508
|
+
platform: "node",
|
|
509
|
+
outDir
|
|
510
|
+
}
|
|
511
|
+
]), bundleTypes, verbose) : 0;
|
|
512
|
+
}))).reduce((prev, value) => prev + value, 0) + (await Promise.all(Object.entries(compileForBrowser).map(async ([srcDir, options]) => {
|
|
513
|
+
const optionsObject = typeof options === "object" ? options : {};
|
|
514
|
+
const inEsBuildOptions = typeof compile?.browser?.esbuildOptions === "object" ? compile?.browser?.esbuildOptions : {};
|
|
515
|
+
const entry = buildEntries(srcDir, compile?.entryMode, options, true, verbose);
|
|
516
|
+
const platform = "browser";
|
|
517
|
+
const rootOutDir = optionsObject.outDir ?? "dist";
|
|
518
|
+
const outDir = rootOutDir + "/" + platform;
|
|
519
|
+
return typeof srcDir === "string" ? await compileFolder(srcDir, entry, outDirAsBuildDir ? rootOutDir : "build", tsupOptions([
|
|
520
|
+
inEsBuildOptions,
|
|
521
|
+
compile?.tsup?.options ?? {},
|
|
522
|
+
typeof options === "object" ? options : {},
|
|
523
|
+
{
|
|
524
|
+
platform: "browser",
|
|
525
|
+
outDir
|
|
526
|
+
}
|
|
527
|
+
]), bundleTypes, verbose) : 0;
|
|
528
|
+
}))).reduce((prev, value) => prev + value, 0) + (await Promise.all(Object.entries(compileForNeutral).map(async ([srcDir, options]) => {
|
|
529
|
+
const optionsObject = typeof options === "object" ? options : {};
|
|
530
|
+
const inEsBuildOptions = typeof compile?.neutral?.esbuildOptions === "object" ? compile?.neutral?.esbuildOptions : {};
|
|
531
|
+
const entry = buildEntries(srcDir, compile?.entryMode, options, true, verbose);
|
|
532
|
+
const platform = "neutral";
|
|
533
|
+
const rootOutDir = optionsObject.outDir ?? "dist";
|
|
534
|
+
const outDir = rootOutDir + "/" + platform;
|
|
535
|
+
return typeof srcDir === "string" ? await compileFolder(srcDir, entry, outDirAsBuildDir ? rootOutDir : "build", tsupOptions([
|
|
536
|
+
inEsBuildOptions,
|
|
537
|
+
compile?.tsup?.options ?? {},
|
|
538
|
+
typeof options === "object" ? options : {},
|
|
539
|
+
{
|
|
540
|
+
platform: "neutral",
|
|
541
|
+
outDir
|
|
542
|
+
}
|
|
543
|
+
]), bundleTypes, verbose) : 0;
|
|
544
|
+
}))).reduce((prev, value) => prev + value, 0) + 0;
|
|
545
|
+
}, "packageCompileTsup");
|
|
329
546
|
|
|
330
547
|
// src/actions/package/compile/compile.ts
|
|
331
|
-
var packageCompile = async (inConfig = {}) => {
|
|
548
|
+
var packageCompile = /* @__PURE__ */ __name(async (inConfig = {}) => {
|
|
332
549
|
const pkg = process.env.INIT_CWD;
|
|
333
|
-
console.log(
|
|
550
|
+
console.log(chalk9.green(`Compiling ${pkg}`));
|
|
334
551
|
const config2 = await loadConfig(inConfig);
|
|
335
552
|
const publint = config2.publint;
|
|
336
553
|
const tsupResults = await packageCompileTsup(config2);
|
|
@@ -338,106 +555,30 @@ var packageCompile = async (inConfig = {}) => {
|
|
|
338
555
|
return tsupResults;
|
|
339
556
|
}
|
|
340
557
|
return publint ? await packagePublint(config2) : 0;
|
|
341
|
-
};
|
|
342
|
-
|
|
343
|
-
// src/actions/package/compile/packageCompileTsc.ts
|
|
344
|
-
import { cwd as cwd2 } from "process";
|
|
345
|
-
import chalk6 from "chalk";
|
|
346
|
-
import { createProgramFromConfig } from "tsc-prog";
|
|
347
|
-
import {
|
|
348
|
-
DiagnosticCategory,
|
|
349
|
-
formatDiagnosticsWithColorAndContext,
|
|
350
|
-
getPreEmitDiagnostics,
|
|
351
|
-
sys as sys2
|
|
352
|
-
} from "typescript";
|
|
353
|
-
|
|
354
|
-
// src/actions/package/compile/getCompilerOptions.ts
|
|
355
|
-
import { createRequire } from "module";
|
|
356
|
-
import deepmerge2 from "deepmerge";
|
|
357
|
-
import {
|
|
358
|
-
findConfigFile,
|
|
359
|
-
readConfigFile,
|
|
360
|
-
sys
|
|
361
|
-
} from "typescript";
|
|
362
|
-
var getNested = (config2) => {
|
|
363
|
-
if (config2.extends) {
|
|
364
|
-
const require2 = createRequire(import.meta.url);
|
|
365
|
-
const opts = require2(config2.extends);
|
|
366
|
-
return deepmerge2(getNested(opts), config2.compilerOptions ?? {});
|
|
367
|
-
}
|
|
368
|
-
return config2.compilerOptions;
|
|
369
|
-
};
|
|
370
|
-
var getCompilerOptionsJSONFollowExtends = (filename) => {
|
|
371
|
-
const config2 = readConfigFile(filename, sys.readFile).config;
|
|
372
|
-
return getNested(config2);
|
|
373
|
-
};
|
|
374
|
-
var getCompilerOptions = (options = {}, tsconfig = "tsconfig.json") => {
|
|
375
|
-
const configFileName = findConfigFile("./", sys.fileExists, tsconfig);
|
|
376
|
-
const configFileCompilerOptions = (configFileName ? getCompilerOptionsJSONFollowExtends(configFileName) : void 0) ?? {};
|
|
377
|
-
return deepmerge2(configFileCompilerOptions, options);
|
|
378
|
-
};
|
|
379
|
-
|
|
380
|
-
// src/actions/package/compile/packageCompileTsc.ts
|
|
381
|
-
var packageCompileTsc = (folder = "src", config2 = {}, compilerOptionsParam) => {
|
|
382
|
-
const pkg = process.env.INIT_CWD ?? cwd2();
|
|
383
|
-
const verbose = config2?.verbose ?? false;
|
|
384
|
-
const compilerOptions = {
|
|
385
|
-
...getCompilerOptions({
|
|
386
|
-
outDir: "dist/types",
|
|
387
|
-
removeComments: false,
|
|
388
|
-
skipDefaultLibCheck: true,
|
|
389
|
-
skipLibCheck: true,
|
|
390
|
-
sourceMap: false
|
|
391
|
-
}),
|
|
392
|
-
...compilerOptionsParam,
|
|
393
|
-
emitDeclarationOnly: false,
|
|
394
|
-
noEmit: true
|
|
395
|
-
};
|
|
396
|
-
const validTsExt = [".ts", ".tsx", ".d.ts", ".cts", ".d.cts", ".mts", ".d.mts"];
|
|
397
|
-
const includes = [".stories.", ".spec.", ".d.ts", ".d.cts", ".d.mts"];
|
|
398
|
-
const files = buildEntries(folder, "all", {}, true, verbose).filter((file) => validTsExt.find((ext) => file.endsWith(ext)) && includes.find((include) => file.includes(include)));
|
|
399
|
-
console.log(chalk6.green(`Compiling Files ${pkg}: ${files.length}`));
|
|
400
|
-
if (files.length > 0) {
|
|
401
|
-
const program = createProgramFromConfig({
|
|
402
|
-
basePath: pkg ?? cwd2(),
|
|
403
|
-
compilerOptions,
|
|
404
|
-
exclude: ["dist", "docs"],
|
|
405
|
-
files
|
|
406
|
-
});
|
|
407
|
-
const diagnostics = getPreEmitDiagnostics(program);
|
|
408
|
-
if (diagnostics.length > 0) {
|
|
409
|
-
const formattedDiagnostics = formatDiagnosticsWithColorAndContext(
|
|
410
|
-
diagnostics,
|
|
411
|
-
{
|
|
412
|
-
getCanonicalFileName: (fileName) => fileName,
|
|
413
|
-
getCurrentDirectory: () => folder,
|
|
414
|
-
getNewLine: () => sys2.newLine
|
|
415
|
-
}
|
|
416
|
-
);
|
|
417
|
-
console.error(formattedDiagnostics);
|
|
418
|
-
}
|
|
419
|
-
program.emit();
|
|
420
|
-
return diagnostics.reduce((acc, diag) => acc + (diag.category === DiagnosticCategory.Error ? 1 : 0), 0);
|
|
421
|
-
}
|
|
422
|
-
return 0;
|
|
423
|
-
};
|
|
558
|
+
}, "packageCompile");
|
|
424
559
|
|
|
425
560
|
// src/actions/package/copy-assets.ts
|
|
426
|
-
import
|
|
427
|
-
import
|
|
561
|
+
import path4 from "path/posix";
|
|
562
|
+
import chalk10 from "chalk";
|
|
428
563
|
import cpy from "cpy";
|
|
429
|
-
var copyTargetAssets = async (target, name, location) => {
|
|
564
|
+
var copyTargetAssets = /* @__PURE__ */ __name(async (target, name, location) => {
|
|
430
565
|
try {
|
|
431
|
-
const values = await cpy(
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
566
|
+
const values = await cpy([
|
|
567
|
+
"**/*.jpg",
|
|
568
|
+
"**/*.png",
|
|
569
|
+
"**/*.gif",
|
|
570
|
+
"**/*.svg",
|
|
571
|
+
"**/*.webp",
|
|
572
|
+
"**/*.sass",
|
|
573
|
+
"**/*.scss",
|
|
574
|
+
"**/*.gif",
|
|
575
|
+
"**/*.css"
|
|
576
|
+
], `../dist/${target}`, {
|
|
577
|
+
cwd: path4.join(location, "src"),
|
|
578
|
+
flat: false
|
|
579
|
+
});
|
|
439
580
|
if (values.length > 0) {
|
|
440
|
-
console.log(
|
|
581
|
+
console.log(chalk10.green(`Copying Assets [${target.toUpperCase()}] - ${name} - ${location}`));
|
|
441
582
|
}
|
|
442
583
|
for (const value of values) {
|
|
443
584
|
console.log(`${value.split("/").pop()} => ./dist/${target}`);
|
|
@@ -448,8 +589,8 @@ var copyTargetAssets = async (target, name, location) => {
|
|
|
448
589
|
console.log(`Copy Assets Failed: ${name}: ${error.message}`);
|
|
449
590
|
return 1;
|
|
450
591
|
}
|
|
451
|
-
};
|
|
452
|
-
var packageCopyAssets = async ({ target }) => {
|
|
592
|
+
}, "copyTargetAssets");
|
|
593
|
+
var packageCopyAssets = /* @__PURE__ */ __name(async ({ target }) => {
|
|
453
594
|
const pkg = process.env.INIT_CWD ?? "./";
|
|
454
595
|
const pkgName = process.env.npm_package_name ?? "Unknown";
|
|
455
596
|
switch (target) {
|
|
@@ -463,11 +604,11 @@ var packageCopyAssets = async ({ target }) => {
|
|
|
463
604
|
return await copyTargetAssets("esm", pkgName, pkg) || await copyTargetAssets("cjs", pkgName, pkg);
|
|
464
605
|
}
|
|
465
606
|
}
|
|
466
|
-
};
|
|
607
|
+
}, "packageCopyAssets");
|
|
467
608
|
|
|
468
609
|
// src/actions/package/cycle.ts
|
|
469
610
|
import { cruise } from "dependency-cruiser";
|
|
470
|
-
var packageCycle =
|
|
611
|
+
var packageCycle = /* @__PURE__ */ __name(async () => {
|
|
471
612
|
const pkg = process.env.INIT_CWD;
|
|
472
613
|
const pkgName = process.env.npm_package_name;
|
|
473
614
|
const cruiseOptions = {
|
|
@@ -478,41 +619,40 @@ var packageCycle = async ({ verbose = false }) => {
|
|
|
478
619
|
severity: "error",
|
|
479
620
|
comment: "This dependency creates a circular reference",
|
|
480
621
|
from: {},
|
|
481
|
-
to: {
|
|
622
|
+
to: {
|
|
623
|
+
circular: true
|
|
624
|
+
}
|
|
482
625
|
}
|
|
483
626
|
]
|
|
484
627
|
},
|
|
485
628
|
exclude: "node_modules|packages/.*/packages",
|
|
486
629
|
validate: true,
|
|
487
|
-
doNotFollow: {
|
|
630
|
+
doNotFollow: {
|
|
631
|
+
path: "node_modules|packages/.*/packages"
|
|
632
|
+
},
|
|
488
633
|
tsPreCompilationDeps: false,
|
|
489
634
|
combinedDependencies: true,
|
|
490
|
-
outputType:
|
|
635
|
+
outputType: "err"
|
|
491
636
|
};
|
|
492
637
|
const target = `${pkg}/src`;
|
|
493
638
|
console.log(`Checking for circular dependencies in ${target}...`);
|
|
494
|
-
const result = await cruise([
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
639
|
+
const result = await cruise([
|
|
640
|
+
target
|
|
641
|
+
], cruiseOptions);
|
|
642
|
+
console.log(result.output);
|
|
498
643
|
if (result.exitCode === 0) {
|
|
499
644
|
console.log(`${pkgName} \u2705 No dependency violations`);
|
|
500
645
|
} else {
|
|
501
646
|
console.error(`${pkgName} \u274C Dependency violations found`);
|
|
502
647
|
}
|
|
503
648
|
return result.exitCode;
|
|
504
|
-
};
|
|
649
|
+
}, "packageCycle");
|
|
505
650
|
|
|
506
651
|
// src/actions/package/gen-docs.ts
|
|
507
652
|
import { existsSync } from "fs";
|
|
508
|
-
import
|
|
509
|
-
import
|
|
510
|
-
import {
|
|
511
|
-
Application,
|
|
512
|
-
ArgumentsReader,
|
|
513
|
-
TSConfigReader,
|
|
514
|
-
TypeDocReader
|
|
515
|
-
} from "typedoc";
|
|
653
|
+
import path5 from "path";
|
|
654
|
+
import chalk11 from "chalk";
|
|
655
|
+
import { Application, ArgumentsReader, TSConfigReader, TypeDocReader } from "typedoc";
|
|
516
656
|
var ExitCodes = {
|
|
517
657
|
CompileError: 3,
|
|
518
658
|
ExceptionThrown: 6,
|
|
@@ -522,14 +662,17 @@ var ExitCodes = {
|
|
|
522
662
|
OutputError: 5,
|
|
523
663
|
ValidationError: 4
|
|
524
664
|
};
|
|
525
|
-
var packageGenDocs = async () => {
|
|
665
|
+
var packageGenDocs = /* @__PURE__ */ __name(async () => {
|
|
526
666
|
const pkg = process.env.INIT_CWD;
|
|
527
|
-
if (pkg && !existsSync(
|
|
667
|
+
if (pkg && !existsSync(path5.join(pkg, "typedoc.json"))) {
|
|
528
668
|
return;
|
|
529
669
|
}
|
|
530
670
|
const app = await Application.bootstrap({
|
|
531
671
|
entryPointStrategy: "merge",
|
|
532
|
-
entryPoints: [
|
|
672
|
+
entryPoints: [
|
|
673
|
+
`${pkg}/src/**/*.ts`,
|
|
674
|
+
`${pkg}/packages/*/dist/docs.json`
|
|
675
|
+
],
|
|
533
676
|
excludeExternals: true,
|
|
534
677
|
json: `${pkg}/dist/docs.json`,
|
|
535
678
|
logLevel: "Error",
|
|
@@ -540,8 +683,8 @@ var packageGenDocs = async () => {
|
|
|
540
683
|
app.options.addReader(new TSConfigReader());
|
|
541
684
|
app.options.addReader(new ArgumentsReader(300));
|
|
542
685
|
return await runTypeDoc(app);
|
|
543
|
-
};
|
|
544
|
-
var runTypeDoc = async (app) => {
|
|
686
|
+
}, "packageGenDocs");
|
|
687
|
+
var runTypeDoc = /* @__PURE__ */ __name(async (app) => {
|
|
545
688
|
const pkgName = process.env.npm_package_name;
|
|
546
689
|
if (app.options.getValue("version")) {
|
|
547
690
|
console.log(app.toString());
|
|
@@ -610,37 +753,40 @@ var runTypeDoc = async (app) => {
|
|
|
610
753
|
return ExitCodes.OutputError;
|
|
611
754
|
}
|
|
612
755
|
}
|
|
613
|
-
console.log(
|
|
756
|
+
console.log(chalk11.green(`${pkgName} - Ok`));
|
|
614
757
|
return ExitCodes.Ok;
|
|
615
|
-
};
|
|
758
|
+
}, "runTypeDoc");
|
|
616
759
|
|
|
617
760
|
// src/actions/package/lint.ts
|
|
618
761
|
import { readdirSync } from "fs";
|
|
619
|
-
import
|
|
620
|
-
import { cwd as
|
|
762
|
+
import path6 from "path";
|
|
763
|
+
import { cwd as cwd4 } from "process";
|
|
621
764
|
import { pathToFileURL } from "url";
|
|
622
|
-
import
|
|
765
|
+
import chalk12 from "chalk";
|
|
623
766
|
import { ESLint } from "eslint";
|
|
624
767
|
import { findUp } from "find-up";
|
|
625
768
|
import picomatch from "picomatch";
|
|
626
|
-
var dumpMessages = (lintResults) => {
|
|
627
|
-
const colors = [
|
|
628
|
-
|
|
769
|
+
var dumpMessages = /* @__PURE__ */ __name((lintResults) => {
|
|
770
|
+
const colors = [
|
|
771
|
+
"white",
|
|
772
|
+
"yellow",
|
|
773
|
+
"red"
|
|
774
|
+
];
|
|
775
|
+
const severity = [
|
|
776
|
+
"none",
|
|
777
|
+
"warning",
|
|
778
|
+
"error"
|
|
779
|
+
];
|
|
629
780
|
for (const lintResult of lintResults) {
|
|
630
781
|
if (lintResult.messages.length > 0) {
|
|
631
|
-
console.log(
|
|
782
|
+
console.log(chalk12.gray(`
|
|
632
783
|
${lintResult.filePath}`));
|
|
633
784
|
for (const message of lintResult.messages) {
|
|
634
|
-
console.log(
|
|
635
|
-
chalk9.gray(` ${message.line}:${message.column}`),
|
|
636
|
-
chalk9[colors[message.severity]](` ${severity[message.severity]}`),
|
|
637
|
-
chalk9.white(` ${message.message}`),
|
|
638
|
-
chalk9.gray(` ${message.ruleId}`)
|
|
639
|
-
);
|
|
785
|
+
console.log(chalk12.gray(` ${message.line}:${message.column}`), chalk12[colors[message.severity]](` ${severity[message.severity]}`), chalk12.white(` ${message.message}`), chalk12.gray(` ${message.ruleId}`));
|
|
640
786
|
}
|
|
641
787
|
}
|
|
642
788
|
}
|
|
643
|
-
};
|
|
789
|
+
}, "dumpMessages");
|
|
644
790
|
async function getRootESLintConfig() {
|
|
645
791
|
const configPath = await findUp("eslint.config.mjs");
|
|
646
792
|
if (configPath === void 0) {
|
|
@@ -648,33 +794,50 @@ async function getRootESLintConfig() {
|
|
|
648
794
|
}
|
|
649
795
|
return pathToFileURL(configPath);
|
|
650
796
|
}
|
|
797
|
+
__name(getRootESLintConfig, "getRootESLintConfig");
|
|
651
798
|
function getFiles(dir, ignoreFolders) {
|
|
652
|
-
const currentDirectory =
|
|
799
|
+
const currentDirectory = cwd4();
|
|
653
800
|
const subDirectory = dir.split(currentDirectory)[1];
|
|
654
801
|
if (ignoreFolders.includes(subDirectory)) return [];
|
|
655
|
-
return readdirSync(dir, {
|
|
656
|
-
|
|
802
|
+
return readdirSync(dir, {
|
|
803
|
+
withFileTypes: true
|
|
804
|
+
}).flatMap((dirent) => {
|
|
805
|
+
const res = path6.resolve(dir, dirent.name);
|
|
657
806
|
const relativePath = subDirectory === void 0 ? dirent.name : `${subDirectory}/${dirent.name}`;
|
|
658
807
|
const ignoreMatchers = ignoreFolders.map((pattern) => picomatch(pattern));
|
|
659
808
|
if (ignoreMatchers.some((isMatch) => isMatch(relativePath))) return [];
|
|
660
|
-
return dirent.isDirectory() ? getFiles(res, ignoreFolders) : [
|
|
809
|
+
return dirent.isDirectory() ? getFiles(res, ignoreFolders) : [
|
|
810
|
+
res
|
|
811
|
+
];
|
|
661
812
|
});
|
|
662
813
|
}
|
|
663
|
-
|
|
814
|
+
__name(getFiles, "getFiles");
|
|
815
|
+
var packageLint = /* @__PURE__ */ __name(async (fix = false, verbose = false, cache = true) => {
|
|
664
816
|
const pkg = process.env.INIT_CWD;
|
|
665
817
|
const configPath = await getRootESLintConfig();
|
|
666
818
|
const { default: eslintConfig } = await import(configPath.href);
|
|
667
819
|
const start = Date.now();
|
|
668
|
-
const ignoreFolders = [
|
|
820
|
+
const ignoreFolders = [
|
|
821
|
+
"node_modules",
|
|
822
|
+
"dist",
|
|
823
|
+
"packages",
|
|
824
|
+
".git",
|
|
825
|
+
"build",
|
|
826
|
+
".yarn",
|
|
827
|
+
".vscode",
|
|
828
|
+
".github"
|
|
829
|
+
];
|
|
669
830
|
const engine = new ESLint({
|
|
670
|
-
baseConfig: [
|
|
831
|
+
baseConfig: [
|
|
832
|
+
...eslintConfig
|
|
833
|
+
],
|
|
671
834
|
fix,
|
|
672
835
|
warnIgnored: false,
|
|
673
836
|
cache
|
|
674
837
|
});
|
|
675
|
-
const files = getFiles(
|
|
838
|
+
const files = getFiles(cwd4(), ignoreFolders);
|
|
676
839
|
if (verbose) {
|
|
677
|
-
console.log(
|
|
840
|
+
console.log(chalk12.green(`Linting ${pkg} [files = ${files.length}]`));
|
|
678
841
|
}
|
|
679
842
|
const lintResults = await engine.lintFiles(files);
|
|
680
843
|
dumpMessages(lintResults);
|
|
@@ -684,14 +847,14 @@ var packageLint = async (fix = false, verbose = false, cache = true) => {
|
|
|
684
847
|
const filesCountColor = files.length < 100 ? "green" : files.length < 1e3 ? "yellow" : "red";
|
|
685
848
|
const lintTime = Date.now() - start;
|
|
686
849
|
const lintTimeColor = lintTime < 1e3 ? "green" : lintTime < 3e3 ? "yellow" : "red";
|
|
687
|
-
console.log(
|
|
850
|
+
console.log(chalk12.white(`Linted ${chalk12[filesCountColor](files.length)} files in ${chalk12[lintTimeColor](lintTime)}ms`));
|
|
688
851
|
return lintResults.reduce((prev, lintResult) => prev + lintResult.errorCount, 0);
|
|
689
|
-
};
|
|
852
|
+
}, "packageLint");
|
|
690
853
|
|
|
691
854
|
// src/actions/package/recompile.ts
|
|
692
|
-
var packageRecompile = async () => {
|
|
855
|
+
var packageRecompile = /* @__PURE__ */ __name(async () => {
|
|
693
856
|
return await packageClean() || await packageCompile();
|
|
694
|
-
};
|
|
857
|
+
}, "packageRecompile");
|
|
695
858
|
export {
|
|
696
859
|
bundleDts,
|
|
697
860
|
packageClean,
|