@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
|
@@ -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,167 +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
304
|
import nodeExternals from "rollup-plugin-node-externals";
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
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
|
+
}
|
|
192
351
|
}
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
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) => {
|
|
197
361
|
const splitEntryName = entry.split(".");
|
|
198
362
|
const newEntryExtension = "d." + splitEntryName.at(-1);
|
|
199
|
-
return [
|
|
200
|
-
|
|
201
|
-
|
|
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);
|
|
202
377
|
await Promise.all(entryNames.map(async (entryName) => {
|
|
203
|
-
|
|
378
|
+
const entryTypeName = entryNameToTypeName(entryName);
|
|
379
|
+
await bundleDts(`${srcRoot}/${entryTypeName}`, `${outDir}/${entryTypeName}`, platform, {
|
|
380
|
+
compilerOptions
|
|
381
|
+
}, verbose);
|
|
204
382
|
}));
|
|
383
|
+
if (verbose) {
|
|
384
|
+
console.log(chalk7.cyan(`Compiling Types FINISH: ${entries.length} files to ${outDir} from ${srcDir}`));
|
|
385
|
+
}
|
|
205
386
|
return 0;
|
|
206
|
-
};
|
|
387
|
+
}, "packageCompileTscTypes");
|
|
207
388
|
|
|
208
389
|
// src/actions/package/compile/packageCompileTsup.ts
|
|
209
|
-
var compileFolder = async (
|
|
390
|
+
var compileFolder = /* @__PURE__ */ __name(async (srcDir, entries, buildDir, options, bundleTypes = false, verbose) => {
|
|
210
391
|
const outDir = options?.outDir ?? "dist";
|
|
211
392
|
if (verbose) {
|
|
212
|
-
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;
|
|
213
398
|
}
|
|
214
|
-
const optionsResult = defineConfig({
|
|
215
|
-
bundle: true,
|
|
216
|
-
cjsInterop: true,
|
|
217
|
-
clean: true,
|
|
218
|
-
dts: false,
|
|
219
|
-
entry: entries,
|
|
220
|
-
format: ["esm"],
|
|
221
|
-
outDir,
|
|
222
|
-
silent: true,
|
|
223
|
-
sourcemap: true,
|
|
224
|
-
splitting: false,
|
|
225
|
-
tsconfig: "tsconfig.json",
|
|
226
|
-
...options
|
|
227
|
-
});
|
|
228
|
-
const optionsList = (await Promise.all(
|
|
229
|
-
(Array.isArray(optionsResult) ? optionsResult : [optionsResult]).flatMap(async (options2) => {
|
|
230
|
-
const result = typeof options2 === "function" ? await options2({}) : [options2];
|
|
231
|
-
return Array.isArray(result) ? result : [result];
|
|
232
|
-
})
|
|
233
|
-
)).flat();
|
|
234
399
|
if (verbose) {
|
|
235
|
-
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)}]`));
|
|
236
439
|
}
|
|
237
440
|
await Promise.all(optionsList.map((options2) => build(options2)));
|
|
238
441
|
if (verbose) {
|
|
239
|
-
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);
|
|
240
446
|
}
|
|
241
|
-
await packageCompileTscTypes(entries, outDir, options?.platform ?? "neutral", folder);
|
|
242
447
|
return 0;
|
|
243
|
-
};
|
|
244
|
-
var tsupOptions = (options = []) => {
|
|
448
|
+
}, "compileFolder");
|
|
449
|
+
var tsupOptions = /* @__PURE__ */ __name((options = []) => {
|
|
245
450
|
const standardLoaders = {
|
|
246
451
|
".gif": "copy",
|
|
247
452
|
".html": "copy",
|
|
248
453
|
".jpg": "copy",
|
|
249
454
|
".json": "json",
|
|
250
455
|
".png": "copy",
|
|
251
|
-
".svg": "
|
|
456
|
+
".svg": "text",
|
|
252
457
|
".webp": "copy"
|
|
253
458
|
};
|
|
254
459
|
const standardOptions = {
|
|
255
460
|
bundle: true,
|
|
256
|
-
format: [
|
|
461
|
+
format: [
|
|
462
|
+
"esm"
|
|
463
|
+
],
|
|
257
464
|
loader: standardLoaders,
|
|
258
|
-
outExtension: ({ format }) => format === "esm" ? {
|
|
465
|
+
outExtension: /* @__PURE__ */ __name(({ format }) => format === "esm" ? {
|
|
466
|
+
js: ".mjs"
|
|
467
|
+
} : {
|
|
468
|
+
js: ".cjs"
|
|
469
|
+
}, "outExtension"),
|
|
259
470
|
skipNodeModulesBundle: true,
|
|
260
471
|
sourcemap: true,
|
|
261
472
|
target: "esnext"
|
|
262
473
|
};
|
|
263
|
-
return deepMergeObjects([
|
|
264
|
-
|
|
265
|
-
|
|
474
|
+
return deepMergeObjects([
|
|
475
|
+
standardOptions,
|
|
476
|
+
...options
|
|
477
|
+
]);
|
|
478
|
+
}, "tsupOptions");
|
|
479
|
+
var packageCompileTsup = /* @__PURE__ */ __name(async (config2) => {
|
|
266
480
|
const compile = config2?.compile;
|
|
267
481
|
const verbose = config2?.verbose ?? false;
|
|
482
|
+
const outDirAsBuildDir = compile?.outDirAsBuildDir ?? true;
|
|
483
|
+
const bundleTypes = compile?.bundleTypes ?? false;
|
|
268
484
|
if (verbose) {
|
|
269
|
-
console.log(
|
|
485
|
+
console.log("Compiling with TSUP");
|
|
270
486
|
}
|
|
271
|
-
const compileForNode = compile?.node ?? {
|
|
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
|
-
}
|
|
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");
|
|
327
546
|
|
|
328
547
|
// src/actions/package/compile/compile.ts
|
|
329
|
-
var packageCompile = async (inConfig = {}) => {
|
|
548
|
+
var packageCompile = /* @__PURE__ */ __name(async (inConfig = {}) => {
|
|
330
549
|
const pkg = process.env.INIT_CWD;
|
|
331
|
-
console.log(
|
|
550
|
+
console.log(chalk9.green(`Compiling ${pkg}`));
|
|
332
551
|
const config2 = await loadConfig(inConfig);
|
|
333
552
|
const publint = config2.publint;
|
|
334
553
|
const tsupResults = await packageCompileTsup(config2);
|
|
@@ -336,106 +555,30 @@ var packageCompile = async (inConfig = {}) => {
|
|
|
336
555
|
return tsupResults;
|
|
337
556
|
}
|
|
338
557
|
return publint ? await packagePublint(config2) : 0;
|
|
339
|
-
};
|
|
340
|
-
|
|
341
|
-
// src/actions/package/compile/packageCompileTsc.ts
|
|
342
|
-
import { cwd as cwd2 } from "process";
|
|
343
|
-
import chalk6 from "chalk";
|
|
344
|
-
import { createProgramFromConfig } from "tsc-prog";
|
|
345
|
-
import {
|
|
346
|
-
DiagnosticCategory,
|
|
347
|
-
formatDiagnosticsWithColorAndContext,
|
|
348
|
-
getPreEmitDiagnostics,
|
|
349
|
-
sys as sys2
|
|
350
|
-
} from "typescript";
|
|
351
|
-
|
|
352
|
-
// src/actions/package/compile/getCompilerOptions.ts
|
|
353
|
-
import { createRequire } from "module";
|
|
354
|
-
import deepmerge2 from "deepmerge";
|
|
355
|
-
import {
|
|
356
|
-
findConfigFile,
|
|
357
|
-
readConfigFile,
|
|
358
|
-
sys
|
|
359
|
-
} from "typescript";
|
|
360
|
-
var getNested = (config2) => {
|
|
361
|
-
if (config2.extends) {
|
|
362
|
-
const require2 = createRequire(import.meta.url);
|
|
363
|
-
const opts = require2(config2.extends);
|
|
364
|
-
return deepmerge2(getNested(opts), config2.compilerOptions ?? {});
|
|
365
|
-
}
|
|
366
|
-
return config2.compilerOptions;
|
|
367
|
-
};
|
|
368
|
-
var getCompilerOptionsJSONFollowExtends = (filename) => {
|
|
369
|
-
const config2 = readConfigFile(filename, sys.readFile).config;
|
|
370
|
-
return getNested(config2);
|
|
371
|
-
};
|
|
372
|
-
var getCompilerOptions = (options = {}, tsconfig = "tsconfig.json") => {
|
|
373
|
-
const configFileName = findConfigFile("./", sys.fileExists, tsconfig);
|
|
374
|
-
const configFileCompilerOptions = (configFileName ? getCompilerOptionsJSONFollowExtends(configFileName) : void 0) ?? {};
|
|
375
|
-
return deepmerge2(configFileCompilerOptions, options);
|
|
376
|
-
};
|
|
377
|
-
|
|
378
|
-
// src/actions/package/compile/packageCompileTsc.ts
|
|
379
|
-
var packageCompileTsc = (folder = "src", config2 = {}, compilerOptionsParam) => {
|
|
380
|
-
const pkg = process.env.INIT_CWD ?? cwd2();
|
|
381
|
-
const verbose = config2?.verbose ?? false;
|
|
382
|
-
const compilerOptions = {
|
|
383
|
-
...getCompilerOptions({
|
|
384
|
-
outDir: "dist/types",
|
|
385
|
-
removeComments: false,
|
|
386
|
-
skipDefaultLibCheck: true,
|
|
387
|
-
skipLibCheck: true,
|
|
388
|
-
sourceMap: false
|
|
389
|
-
}),
|
|
390
|
-
...compilerOptionsParam,
|
|
391
|
-
emitDeclarationOnly: false,
|
|
392
|
-
noEmit: true
|
|
393
|
-
};
|
|
394
|
-
const validTsExt = [".ts", ".tsx", ".d.ts", ".cts", ".d.cts", ".mts", ".d.mts"];
|
|
395
|
-
const includes = [".stories.", ".spec.", ".d.ts", ".d.cts", ".d.mts"];
|
|
396
|
-
const files = buildEntries(folder, "all", {}, true, verbose).filter((file) => validTsExt.find((ext) => file.endsWith(ext)) && includes.find((include) => file.includes(include)));
|
|
397
|
-
console.log(chalk6.green(`Compiling Files ${pkg}: ${files.length}`));
|
|
398
|
-
if (files.length > 0) {
|
|
399
|
-
const program = createProgramFromConfig({
|
|
400
|
-
basePath: pkg ?? cwd2(),
|
|
401
|
-
compilerOptions,
|
|
402
|
-
exclude: ["dist", "docs"],
|
|
403
|
-
files
|
|
404
|
-
});
|
|
405
|
-
const diagnostics = getPreEmitDiagnostics(program);
|
|
406
|
-
if (diagnostics.length > 0) {
|
|
407
|
-
const formattedDiagnostics = formatDiagnosticsWithColorAndContext(
|
|
408
|
-
diagnostics,
|
|
409
|
-
{
|
|
410
|
-
getCanonicalFileName: (fileName) => fileName,
|
|
411
|
-
getCurrentDirectory: () => folder,
|
|
412
|
-
getNewLine: () => sys2.newLine
|
|
413
|
-
}
|
|
414
|
-
);
|
|
415
|
-
console.error(formattedDiagnostics);
|
|
416
|
-
}
|
|
417
|
-
program.emit();
|
|
418
|
-
return diagnostics.reduce((acc, diag) => acc + (diag.category === DiagnosticCategory.Error ? 1 : 0), 0);
|
|
419
|
-
}
|
|
420
|
-
return 0;
|
|
421
|
-
};
|
|
558
|
+
}, "packageCompile");
|
|
422
559
|
|
|
423
560
|
// src/actions/package/copy-assets.ts
|
|
424
|
-
import
|
|
425
|
-
import
|
|
561
|
+
import path4 from "path/posix";
|
|
562
|
+
import chalk10 from "chalk";
|
|
426
563
|
import cpy from "cpy";
|
|
427
|
-
var copyTargetAssets = async (target, name, location) => {
|
|
564
|
+
var copyTargetAssets = /* @__PURE__ */ __name(async (target, name, location) => {
|
|
428
565
|
try {
|
|
429
|
-
const values = await cpy(
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
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
|
+
});
|
|
437
580
|
if (values.length > 0) {
|
|
438
|
-
console.log(
|
|
581
|
+
console.log(chalk10.green(`Copying Assets [${target.toUpperCase()}] - ${name} - ${location}`));
|
|
439
582
|
}
|
|
440
583
|
for (const value of values) {
|
|
441
584
|
console.log(`${value.split("/").pop()} => ./dist/${target}`);
|
|
@@ -446,8 +589,8 @@ var copyTargetAssets = async (target, name, location) => {
|
|
|
446
589
|
console.log(`Copy Assets Failed: ${name}: ${error.message}`);
|
|
447
590
|
return 1;
|
|
448
591
|
}
|
|
449
|
-
};
|
|
450
|
-
var packageCopyAssets = async ({ target }) => {
|
|
592
|
+
}, "copyTargetAssets");
|
|
593
|
+
var packageCopyAssets = /* @__PURE__ */ __name(async ({ target }) => {
|
|
451
594
|
const pkg = process.env.INIT_CWD ?? "./";
|
|
452
595
|
const pkgName = process.env.npm_package_name ?? "Unknown";
|
|
453
596
|
switch (target) {
|
|
@@ -461,11 +604,11 @@ var packageCopyAssets = async ({ target }) => {
|
|
|
461
604
|
return await copyTargetAssets("esm", pkgName, pkg) || await copyTargetAssets("cjs", pkgName, pkg);
|
|
462
605
|
}
|
|
463
606
|
}
|
|
464
|
-
};
|
|
607
|
+
}, "packageCopyAssets");
|
|
465
608
|
|
|
466
609
|
// src/actions/package/cycle.ts
|
|
467
610
|
import { cruise } from "dependency-cruiser";
|
|
468
|
-
var packageCycle =
|
|
611
|
+
var packageCycle = /* @__PURE__ */ __name(async () => {
|
|
469
612
|
const pkg = process.env.INIT_CWD;
|
|
470
613
|
const pkgName = process.env.npm_package_name;
|
|
471
614
|
const cruiseOptions = {
|
|
@@ -476,41 +619,40 @@ var packageCycle = async ({ verbose = false }) => {
|
|
|
476
619
|
severity: "error",
|
|
477
620
|
comment: "This dependency creates a circular reference",
|
|
478
621
|
from: {},
|
|
479
|
-
to: {
|
|
622
|
+
to: {
|
|
623
|
+
circular: true
|
|
624
|
+
}
|
|
480
625
|
}
|
|
481
626
|
]
|
|
482
627
|
},
|
|
483
628
|
exclude: "node_modules|packages/.*/packages",
|
|
484
629
|
validate: true,
|
|
485
|
-
doNotFollow: {
|
|
630
|
+
doNotFollow: {
|
|
631
|
+
path: "node_modules|packages/.*/packages"
|
|
632
|
+
},
|
|
486
633
|
tsPreCompilationDeps: false,
|
|
487
634
|
combinedDependencies: true,
|
|
488
|
-
outputType:
|
|
635
|
+
outputType: "err"
|
|
489
636
|
};
|
|
490
637
|
const target = `${pkg}/src`;
|
|
491
638
|
console.log(`Checking for circular dependencies in ${target}...`);
|
|
492
|
-
const result = await cruise([
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
639
|
+
const result = await cruise([
|
|
640
|
+
target
|
|
641
|
+
], cruiseOptions);
|
|
642
|
+
console.log(result.output);
|
|
496
643
|
if (result.exitCode === 0) {
|
|
497
644
|
console.log(`${pkgName} \u2705 No dependency violations`);
|
|
498
645
|
} else {
|
|
499
646
|
console.error(`${pkgName} \u274C Dependency violations found`);
|
|
500
647
|
}
|
|
501
648
|
return result.exitCode;
|
|
502
|
-
};
|
|
649
|
+
}, "packageCycle");
|
|
503
650
|
|
|
504
651
|
// src/actions/package/gen-docs.ts
|
|
505
652
|
import { existsSync } from "fs";
|
|
506
|
-
import
|
|
507
|
-
import
|
|
508
|
-
import {
|
|
509
|
-
Application,
|
|
510
|
-
ArgumentsReader,
|
|
511
|
-
TSConfigReader,
|
|
512
|
-
TypeDocReader
|
|
513
|
-
} from "typedoc";
|
|
653
|
+
import path5 from "path";
|
|
654
|
+
import chalk11 from "chalk";
|
|
655
|
+
import { Application, ArgumentsReader, TSConfigReader, TypeDocReader } from "typedoc";
|
|
514
656
|
var ExitCodes = {
|
|
515
657
|
CompileError: 3,
|
|
516
658
|
ExceptionThrown: 6,
|
|
@@ -520,14 +662,17 @@ var ExitCodes = {
|
|
|
520
662
|
OutputError: 5,
|
|
521
663
|
ValidationError: 4
|
|
522
664
|
};
|
|
523
|
-
var packageGenDocs = async () => {
|
|
665
|
+
var packageGenDocs = /* @__PURE__ */ __name(async () => {
|
|
524
666
|
const pkg = process.env.INIT_CWD;
|
|
525
|
-
if (pkg && !existsSync(
|
|
667
|
+
if (pkg && !existsSync(path5.join(pkg, "typedoc.json"))) {
|
|
526
668
|
return;
|
|
527
669
|
}
|
|
528
670
|
const app = await Application.bootstrap({
|
|
529
671
|
entryPointStrategy: "merge",
|
|
530
|
-
entryPoints: [
|
|
672
|
+
entryPoints: [
|
|
673
|
+
`${pkg}/src/**/*.ts`,
|
|
674
|
+
`${pkg}/packages/*/dist/docs.json`
|
|
675
|
+
],
|
|
531
676
|
excludeExternals: true,
|
|
532
677
|
json: `${pkg}/dist/docs.json`,
|
|
533
678
|
logLevel: "Error",
|
|
@@ -538,8 +683,8 @@ var packageGenDocs = async () => {
|
|
|
538
683
|
app.options.addReader(new TSConfigReader());
|
|
539
684
|
app.options.addReader(new ArgumentsReader(300));
|
|
540
685
|
return await runTypeDoc(app);
|
|
541
|
-
};
|
|
542
|
-
var runTypeDoc = async (app) => {
|
|
686
|
+
}, "packageGenDocs");
|
|
687
|
+
var runTypeDoc = /* @__PURE__ */ __name(async (app) => {
|
|
543
688
|
const pkgName = process.env.npm_package_name;
|
|
544
689
|
if (app.options.getValue("version")) {
|
|
545
690
|
console.log(app.toString());
|
|
@@ -608,37 +753,40 @@ var runTypeDoc = async (app) => {
|
|
|
608
753
|
return ExitCodes.OutputError;
|
|
609
754
|
}
|
|
610
755
|
}
|
|
611
|
-
console.log(
|
|
756
|
+
console.log(chalk11.green(`${pkgName} - Ok`));
|
|
612
757
|
return ExitCodes.Ok;
|
|
613
|
-
};
|
|
758
|
+
}, "runTypeDoc");
|
|
614
759
|
|
|
615
760
|
// src/actions/package/lint.ts
|
|
616
761
|
import { readdirSync } from "fs";
|
|
617
|
-
import
|
|
618
|
-
import { cwd as
|
|
762
|
+
import path6 from "path";
|
|
763
|
+
import { cwd as cwd4 } from "process";
|
|
619
764
|
import { pathToFileURL } from "url";
|
|
620
|
-
import
|
|
765
|
+
import chalk12 from "chalk";
|
|
621
766
|
import { ESLint } from "eslint";
|
|
622
767
|
import { findUp } from "find-up";
|
|
623
768
|
import picomatch from "picomatch";
|
|
624
|
-
var dumpMessages = (lintResults) => {
|
|
625
|
-
const colors = [
|
|
626
|
-
|
|
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
|
+
];
|
|
627
780
|
for (const lintResult of lintResults) {
|
|
628
781
|
if (lintResult.messages.length > 0) {
|
|
629
|
-
console.log(
|
|
782
|
+
console.log(chalk12.gray(`
|
|
630
783
|
${lintResult.filePath}`));
|
|
631
784
|
for (const message of lintResult.messages) {
|
|
632
|
-
console.log(
|
|
633
|
-
chalk9.gray(` ${message.line}:${message.column}`),
|
|
634
|
-
chalk9[colors[message.severity]](` ${severity[message.severity]}`),
|
|
635
|
-
chalk9.white(` ${message.message}`),
|
|
636
|
-
chalk9.gray(` ${message.ruleId}`)
|
|
637
|
-
);
|
|
785
|
+
console.log(chalk12.gray(` ${message.line}:${message.column}`), chalk12[colors[message.severity]](` ${severity[message.severity]}`), chalk12.white(` ${message.message}`), chalk12.gray(` ${message.ruleId}`));
|
|
638
786
|
}
|
|
639
787
|
}
|
|
640
788
|
}
|
|
641
|
-
};
|
|
789
|
+
}, "dumpMessages");
|
|
642
790
|
async function getRootESLintConfig() {
|
|
643
791
|
const configPath = await findUp("eslint.config.mjs");
|
|
644
792
|
if (configPath === void 0) {
|
|
@@ -646,33 +794,50 @@ async function getRootESLintConfig() {
|
|
|
646
794
|
}
|
|
647
795
|
return pathToFileURL(configPath);
|
|
648
796
|
}
|
|
797
|
+
__name(getRootESLintConfig, "getRootESLintConfig");
|
|
649
798
|
function getFiles(dir, ignoreFolders) {
|
|
650
|
-
const currentDirectory =
|
|
799
|
+
const currentDirectory = cwd4();
|
|
651
800
|
const subDirectory = dir.split(currentDirectory)[1];
|
|
652
801
|
if (ignoreFolders.includes(subDirectory)) return [];
|
|
653
|
-
return readdirSync(dir, {
|
|
654
|
-
|
|
802
|
+
return readdirSync(dir, {
|
|
803
|
+
withFileTypes: true
|
|
804
|
+
}).flatMap((dirent) => {
|
|
805
|
+
const res = path6.resolve(dir, dirent.name);
|
|
655
806
|
const relativePath = subDirectory === void 0 ? dirent.name : `${subDirectory}/${dirent.name}`;
|
|
656
807
|
const ignoreMatchers = ignoreFolders.map((pattern) => picomatch(pattern));
|
|
657
808
|
if (ignoreMatchers.some((isMatch) => isMatch(relativePath))) return [];
|
|
658
|
-
return dirent.isDirectory() ? getFiles(res, ignoreFolders) : [
|
|
809
|
+
return dirent.isDirectory() ? getFiles(res, ignoreFolders) : [
|
|
810
|
+
res
|
|
811
|
+
];
|
|
659
812
|
});
|
|
660
813
|
}
|
|
661
|
-
|
|
814
|
+
__name(getFiles, "getFiles");
|
|
815
|
+
var packageLint = /* @__PURE__ */ __name(async (fix = false, verbose = false, cache = true) => {
|
|
662
816
|
const pkg = process.env.INIT_CWD;
|
|
663
817
|
const configPath = await getRootESLintConfig();
|
|
664
818
|
const { default: eslintConfig } = await import(configPath.href);
|
|
665
819
|
const start = Date.now();
|
|
666
|
-
const ignoreFolders = [
|
|
820
|
+
const ignoreFolders = [
|
|
821
|
+
"node_modules",
|
|
822
|
+
"dist",
|
|
823
|
+
"packages",
|
|
824
|
+
".git",
|
|
825
|
+
"build",
|
|
826
|
+
".yarn",
|
|
827
|
+
".vscode",
|
|
828
|
+
".github"
|
|
829
|
+
];
|
|
667
830
|
const engine = new ESLint({
|
|
668
|
-
baseConfig: [
|
|
831
|
+
baseConfig: [
|
|
832
|
+
...eslintConfig
|
|
833
|
+
],
|
|
669
834
|
fix,
|
|
670
835
|
warnIgnored: false,
|
|
671
836
|
cache
|
|
672
837
|
});
|
|
673
|
-
const files = getFiles(
|
|
838
|
+
const files = getFiles(cwd4(), ignoreFolders);
|
|
674
839
|
if (verbose) {
|
|
675
|
-
console.log(
|
|
840
|
+
console.log(chalk12.green(`Linting ${pkg} [files = ${files.length}]`));
|
|
676
841
|
}
|
|
677
842
|
const lintResults = await engine.lintFiles(files);
|
|
678
843
|
dumpMessages(lintResults);
|
|
@@ -682,14 +847,14 @@ var packageLint = async (fix = false, verbose = false, cache = true) => {
|
|
|
682
847
|
const filesCountColor = files.length < 100 ? "green" : files.length < 1e3 ? "yellow" : "red";
|
|
683
848
|
const lintTime = Date.now() - start;
|
|
684
849
|
const lintTimeColor = lintTime < 1e3 ? "green" : lintTime < 3e3 ? "yellow" : "red";
|
|
685
|
-
console.log(
|
|
850
|
+
console.log(chalk12.white(`Linted ${chalk12[filesCountColor](files.length)} files in ${chalk12[lintTimeColor](lintTime)}ms`));
|
|
686
851
|
return lintResults.reduce((prev, lintResult) => prev + lintResult.errorCount, 0);
|
|
687
|
-
};
|
|
852
|
+
}, "packageLint");
|
|
688
853
|
|
|
689
854
|
// src/actions/package/recompile.ts
|
|
690
|
-
var packageRecompile = async () => {
|
|
855
|
+
var packageRecompile = /* @__PURE__ */ __name(async () => {
|
|
691
856
|
return await packageClean() || await packageCompile();
|
|
692
|
-
};
|
|
857
|
+
}, "packageRecompile");
|
|
693
858
|
export {
|
|
694
859
|
bundleDts,
|
|
695
860
|
packageClean,
|