@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,7 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
2
4
|
|
|
3
5
|
// src/bin/package/build.ts
|
|
4
|
-
import
|
|
6
|
+
import chalk8 from "chalk";
|
|
5
7
|
|
|
6
8
|
// src/lib/loadConfig.ts
|
|
7
9
|
import chalk from "chalk";
|
|
@@ -9,27 +11,34 @@ import { cosmiconfig } from "cosmiconfig";
|
|
|
9
11
|
import { TypeScriptLoader } from "cosmiconfig-typescript-loader";
|
|
10
12
|
import deepmerge from "deepmerge";
|
|
11
13
|
var config;
|
|
12
|
-
var loadConfig = async (params) => {
|
|
13
|
-
if (config) {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
14
|
+
var loadConfig = /* @__PURE__ */ __name(async (params) => {
|
|
15
|
+
if (config === void 0) {
|
|
16
|
+
const cosmicConfigResult = await cosmiconfig("xy", {
|
|
17
|
+
cache: true,
|
|
18
|
+
loaders: {
|
|
19
|
+
".ts": TypeScriptLoader()
|
|
20
|
+
}
|
|
21
|
+
}).search();
|
|
22
|
+
config = cosmicConfigResult?.config;
|
|
23
|
+
const configFilePath = cosmicConfigResult?.filepath;
|
|
24
|
+
if (configFilePath !== void 0) {
|
|
25
|
+
console.log(chalk.green(`Loaded config from ${configFilePath}`));
|
|
26
|
+
if (config.verbose) {
|
|
27
|
+
console.log(chalk.gray(`${JSON.stringify(config, null, 2)}`));
|
|
28
|
+
}
|
|
29
|
+
}
|
|
21
30
|
}
|
|
22
31
|
return deepmerge(config, params ?? {});
|
|
23
|
-
};
|
|
32
|
+
}, "loadConfig");
|
|
24
33
|
|
|
25
34
|
// src/actions/package/compile/compile.ts
|
|
26
|
-
import
|
|
35
|
+
import chalk7 from "chalk";
|
|
27
36
|
|
|
28
37
|
// src/actions/package/publint.ts
|
|
29
38
|
import { promises as fs } from "fs";
|
|
30
39
|
import chalk2 from "chalk";
|
|
31
40
|
import sortPackageJson from "sort-package-json";
|
|
32
|
-
var packagePublint = async (params) => {
|
|
41
|
+
var packagePublint = /* @__PURE__ */ __name(async (params) => {
|
|
33
42
|
const pkgDir = process.env.INIT_CWD;
|
|
34
43
|
const sortedPkg = sortPackageJson(await fs.readFile(`${pkgDir}/package.json`, "utf8"));
|
|
35
44
|
await fs.writeFile(`${pkgDir}/package.json`, sortedPkg);
|
|
@@ -43,9 +52,9 @@ var packagePublint = async (params) => {
|
|
|
43
52
|
strict: true
|
|
44
53
|
});
|
|
45
54
|
const { formatMessage } = await import("publint/utils");
|
|
46
|
-
const validMessage = (_message) => {
|
|
55
|
+
const validMessage = /* @__PURE__ */ __name((_message) => {
|
|
47
56
|
return true;
|
|
48
|
-
};
|
|
57
|
+
}, "validMessage");
|
|
49
58
|
const validMessages = messages.filter(validMessage);
|
|
50
59
|
for (const message of validMessages) {
|
|
51
60
|
switch (message.type) {
|
|
@@ -67,27 +76,51 @@ var packagePublint = async (params) => {
|
|
|
67
76
|
console.log(chalk2.gray(`Publint [Finish]: ${pkgDir} [${validMessages.length}]`));
|
|
68
77
|
}
|
|
69
78
|
return validMessages.filter((message) => message.type === "error").length;
|
|
70
|
-
};
|
|
79
|
+
}, "packagePublint");
|
|
71
80
|
|
|
72
81
|
// src/actions/package/compile/packageCompileTsup.ts
|
|
82
|
+
import chalk6 from "chalk";
|
|
73
83
|
import { build, defineConfig } from "tsup";
|
|
74
84
|
|
|
75
85
|
// src/actions/package/compile/inputs.ts
|
|
86
|
+
import chalk3 from "chalk";
|
|
76
87
|
import { glob } from "glob";
|
|
77
|
-
var getAllInputs = (
|
|
78
|
-
return
|
|
79
|
-
}
|
|
88
|
+
var getAllInputs = /* @__PURE__ */ __name((srcDir, verbose = false) => {
|
|
89
|
+
return [
|
|
90
|
+
...glob.sync(`${srcDir}/**/*.ts`, {
|
|
91
|
+
posix: true
|
|
92
|
+
}).map((file) => {
|
|
93
|
+
const result = file.slice(Math.max(0, srcDir.length + 1));
|
|
94
|
+
if (verbose) {
|
|
95
|
+
console.log(chalk3.gray(`getAllInputs: ${JSON.stringify(result, null, 2)}`));
|
|
96
|
+
}
|
|
97
|
+
return result;
|
|
98
|
+
}),
|
|
99
|
+
...glob.sync(`${srcDir}/**/*.tsx`, {
|
|
100
|
+
posix: true
|
|
101
|
+
}).map((file) => {
|
|
102
|
+
const result = file.slice(Math.max(0, srcDir.length + 1));
|
|
103
|
+
if (verbose) {
|
|
104
|
+
console.log(chalk3.gray(`getAllInputs: ${JSON.stringify(result, null, 2)}`));
|
|
105
|
+
}
|
|
106
|
+
return result;
|
|
107
|
+
})
|
|
108
|
+
];
|
|
109
|
+
}, "getAllInputs");
|
|
80
110
|
|
|
81
111
|
// src/actions/package/compile/buildEntries.ts
|
|
82
|
-
var buildEntries = (
|
|
112
|
+
var buildEntries = /* @__PURE__ */ __name((srcDir, entryMode = "single", options, excludeSpecAndStories = true, verbose = false) => {
|
|
83
113
|
let entries = [];
|
|
84
114
|
switch (entryMode) {
|
|
85
115
|
case "platform": {
|
|
86
|
-
entries = [
|
|
116
|
+
entries = [
|
|
117
|
+
"index-node.ts",
|
|
118
|
+
"index-browser.ts"
|
|
119
|
+
];
|
|
87
120
|
break;
|
|
88
121
|
}
|
|
89
122
|
case "all": {
|
|
90
|
-
entries = excludeSpecAndStories ? getAllInputs(
|
|
123
|
+
entries = (excludeSpecAndStories ? getAllInputs(srcDir).filter((entry) => !entry.includes(".spec.") && !entry.includes(".stories.")) : getAllInputs(srcDir)).filter((entry) => !entry.endsWith(".d.ts"));
|
|
91
124
|
break;
|
|
92
125
|
}
|
|
93
126
|
case "custom": {
|
|
@@ -95,7 +128,9 @@ var buildEntries = (folder, entryMode = "single", options, excludeSpecAndStories
|
|
|
95
128
|
break;
|
|
96
129
|
}
|
|
97
130
|
default: {
|
|
98
|
-
entries = [
|
|
131
|
+
entries = [
|
|
132
|
+
"index.ts"
|
|
133
|
+
];
|
|
99
134
|
break;
|
|
100
135
|
}
|
|
101
136
|
}
|
|
@@ -104,7 +139,7 @@ var buildEntries = (folder, entryMode = "single", options, excludeSpecAndStories
|
|
|
104
139
|
}
|
|
105
140
|
if (verbose) console.log(`buildEntries [${entryMode}] ${entries.length}`);
|
|
106
141
|
return entries;
|
|
107
|
-
};
|
|
142
|
+
}, "buildEntries");
|
|
108
143
|
|
|
109
144
|
// src/actions/package/compile/deepMerge.ts
|
|
110
145
|
function deepMerge(target, source) {
|
|
@@ -121,6 +156,7 @@ function deepMerge(target, source) {
|
|
|
121
156
|
}
|
|
122
157
|
return target;
|
|
123
158
|
}
|
|
159
|
+
__name(deepMerge, "deepMerge");
|
|
124
160
|
function deepMergeObjects(objects) {
|
|
125
161
|
const result = {};
|
|
126
162
|
for (const obj of objects) {
|
|
@@ -128,169 +164,335 @@ function deepMergeObjects(objects) {
|
|
|
128
164
|
}
|
|
129
165
|
return result;
|
|
130
166
|
}
|
|
167
|
+
__name(deepMergeObjects, "deepMergeObjects");
|
|
131
168
|
|
|
132
|
-
// src/actions/package/compile/
|
|
169
|
+
// src/actions/package/compile/packageCompileTsc.ts
|
|
170
|
+
import { cwd as cwd2 } from "process";
|
|
171
|
+
import chalk4 from "chalk";
|
|
172
|
+
import { createProgramFromConfig } from "tsc-prog";
|
|
173
|
+
import ts, { DiagnosticCategory, formatDiagnosticsWithColorAndContext, getPreEmitDiagnostics, sys } from "typescript";
|
|
174
|
+
|
|
175
|
+
// src/actions/package/compile/getCompilerOptions.ts
|
|
133
176
|
import { cwd } from "process";
|
|
177
|
+
import deepmerge2 from "deepmerge";
|
|
178
|
+
import { getTsconfig } from "get-tsconfig";
|
|
179
|
+
var getCompilerOptions = /* @__PURE__ */ __name((options = {}, fileName = "tsconfig.json") => {
|
|
180
|
+
const resolvedTsConfigCompilerOptions = getTsconfig(cwd(), fileName)?.config?.compilerOptions ?? {};
|
|
181
|
+
return deepmerge2(resolvedTsConfigCompilerOptions, options);
|
|
182
|
+
}, "getCompilerOptions");
|
|
183
|
+
|
|
184
|
+
// src/actions/package/compile/packageCompileTsc.ts
|
|
185
|
+
var packageCompileTsc = /* @__PURE__ */ __name((platform, entries, srcDir = "src", outDir = "dist", compilerOptionsParam, verbose = false) => {
|
|
186
|
+
const pkg = process.env.INIT_CWD ?? cwd2();
|
|
187
|
+
if (verbose) {
|
|
188
|
+
console.log(chalk4.cyan(`Validating code START: ${entries.length} files to ${outDir} from ${srcDir}`));
|
|
189
|
+
}
|
|
190
|
+
const configFilePath = ts.findConfigFile("./", ts.sys.fileExists, "tsconfig.json");
|
|
191
|
+
if (configFilePath === void 0) {
|
|
192
|
+
throw new Error("Could not find tsconfig.json");
|
|
193
|
+
}
|
|
194
|
+
const compilerOptions = {
|
|
195
|
+
...getCompilerOptions({
|
|
196
|
+
removeComments: false,
|
|
197
|
+
skipDefaultLibCheck: true,
|
|
198
|
+
skipLibCheck: true,
|
|
199
|
+
sourceMap: false
|
|
200
|
+
}),
|
|
201
|
+
...compilerOptionsParam,
|
|
202
|
+
outDir: `${outDir}/${platform}`,
|
|
203
|
+
emitDeclarationOnly: true,
|
|
204
|
+
noEmit: false
|
|
205
|
+
};
|
|
206
|
+
console.log(chalk4.cyan(`Validating Files: ${entries.length}`));
|
|
207
|
+
if (verbose) {
|
|
208
|
+
for (const entry of entries) {
|
|
209
|
+
console.log(chalk4.grey(`Validating: ${entry}`));
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
try {
|
|
213
|
+
if (entries.length > 0) {
|
|
214
|
+
const program = createProgramFromConfig({
|
|
215
|
+
configFilePath,
|
|
216
|
+
basePath: pkg ?? cwd2(),
|
|
217
|
+
compilerOptions,
|
|
218
|
+
files: entries.map((entry) => `${srcDir}/${entry}`),
|
|
219
|
+
include: [
|
|
220
|
+
`${srcDir}/**/*.*`
|
|
221
|
+
]
|
|
222
|
+
});
|
|
223
|
+
const diagnostics = getPreEmitDiagnostics(program);
|
|
224
|
+
if (diagnostics.length > 0) {
|
|
225
|
+
const formattedDiagnostics = formatDiagnosticsWithColorAndContext(diagnostics, {
|
|
226
|
+
getCanonicalFileName: /* @__PURE__ */ __name((fileName) => fileName, "getCanonicalFileName"),
|
|
227
|
+
getCurrentDirectory: /* @__PURE__ */ __name(() => srcDir, "getCurrentDirectory"),
|
|
228
|
+
getNewLine: /* @__PURE__ */ __name(() => sys.newLine, "getNewLine")
|
|
229
|
+
});
|
|
230
|
+
console.error(formattedDiagnostics);
|
|
231
|
+
}
|
|
232
|
+
program.emit();
|
|
233
|
+
return diagnostics.reduce((acc, diag) => acc + (diag.category === DiagnosticCategory.Error ? 1 : 0), 0);
|
|
234
|
+
}
|
|
235
|
+
return 0;
|
|
236
|
+
} finally {
|
|
237
|
+
if (verbose) {
|
|
238
|
+
console.log(chalk4.cyan(`Validating code FINISH: ${entries.length} files to ${outDir} from ${srcDir}`));
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
}, "packageCompileTsc");
|
|
242
|
+
|
|
243
|
+
// src/actions/package/compile/packageCompileTscTypes.ts
|
|
244
|
+
import path from "path";
|
|
245
|
+
import { cwd as cwd3 } from "process";
|
|
246
|
+
import chalk5 from "chalk";
|
|
134
247
|
import { rollup } from "rollup";
|
|
135
248
|
import dts from "rollup-plugin-dts";
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
249
|
+
import nodeExternals from "rollup-plugin-node-externals";
|
|
250
|
+
var ignoredWarningCodes = /* @__PURE__ */ new Set([
|
|
251
|
+
"EMPTY_BUNDLE",
|
|
252
|
+
"UNRESOLVED_IMPORT"
|
|
253
|
+
]);
|
|
254
|
+
async function bundleDts(inputPath, outputPath, platform, options, verbose = false) {
|
|
255
|
+
const pkg = process.env.INIT_CWD ?? cwd3();
|
|
256
|
+
const tsconfigPath = path.resolve(pkg, "tsconfig.json");
|
|
257
|
+
const nodePlugIns = platform === "node" ? [
|
|
258
|
+
nodeExternals()
|
|
259
|
+
] : [];
|
|
260
|
+
try {
|
|
261
|
+
const bundle = await rollup({
|
|
262
|
+
input: inputPath,
|
|
263
|
+
plugins: [
|
|
264
|
+
dts({
|
|
265
|
+
...options,
|
|
266
|
+
tsconfig: tsconfigPath,
|
|
267
|
+
compilerOptions: {
|
|
268
|
+
emitDeclarationOnly: true,
|
|
269
|
+
noEmit: false,
|
|
270
|
+
declarationMap: true
|
|
271
|
+
}
|
|
272
|
+
}),
|
|
273
|
+
...nodePlugIns
|
|
274
|
+
],
|
|
275
|
+
onwarn(warning, warn) {
|
|
276
|
+
if (ignoredWarningCodes.has(warning.code ?? "")) {
|
|
277
|
+
return;
|
|
278
|
+
}
|
|
279
|
+
console.warn(chalk5.yellow(`[${warning.code}] ${warning.message}`));
|
|
280
|
+
console.warn(chalk5.gray(inputPath));
|
|
281
|
+
warn(warning);
|
|
282
|
+
}
|
|
283
|
+
});
|
|
284
|
+
await bundle.write({
|
|
285
|
+
file: outputPath,
|
|
286
|
+
format: "es"
|
|
287
|
+
});
|
|
288
|
+
} catch (ex) {
|
|
289
|
+
const error = ex;
|
|
290
|
+
console.warn(chalk5.red(error));
|
|
291
|
+
console.warn(chalk5.gray(inputPath));
|
|
292
|
+
}
|
|
293
|
+
if (verbose) {
|
|
294
|
+
console.log(`Bundled declarations written to ${outputPath}`);
|
|
295
|
+
}
|
|
150
296
|
}
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
297
|
+
__name(bundleDts, "bundleDts");
|
|
298
|
+
var packageCompileTscTypes = /* @__PURE__ */ __name(async (entries, outDir, platform, srcDir = "build", verbose = false) => {
|
|
299
|
+
if (verbose) {
|
|
300
|
+
console.log(chalk5.cyan(`Compiling Types START [${platform}]: ${entries.length} files to ${outDir} from ${srcDir}`));
|
|
301
|
+
console.log(`Entries: ${entries.join(", ")}`);
|
|
302
|
+
}
|
|
303
|
+
const pkg = process.env.INIT_CWD ?? cwd3();
|
|
304
|
+
const srcRoot = `${pkg}/${srcDir}/${platform}`;
|
|
305
|
+
const entryNameToTypeName = /* @__PURE__ */ __name((entry) => {
|
|
155
306
|
const splitEntryName = entry.split(".");
|
|
156
307
|
const newEntryExtension = "d." + splitEntryName.at(-1);
|
|
157
|
-
return [
|
|
158
|
-
|
|
159
|
-
|
|
308
|
+
return [
|
|
309
|
+
...splitEntryName.slice(0, -1),
|
|
310
|
+
newEntryExtension
|
|
311
|
+
].join(".");
|
|
312
|
+
}, "entryNameToTypeName");
|
|
313
|
+
const compilerOptions = getCompilerOptions({
|
|
314
|
+
removeComments: false,
|
|
315
|
+
skipDefaultLibCheck: true,
|
|
316
|
+
skipLibCheck: true,
|
|
317
|
+
declarationMap: true,
|
|
318
|
+
emitDeclarationOnly: true,
|
|
319
|
+
noEmit: true
|
|
320
|
+
});
|
|
321
|
+
const entryNames = entries.map((entry) => entry.split(`${srcDir}/`).at(-1) ?? entry);
|
|
160
322
|
await Promise.all(entryNames.map(async (entryName) => {
|
|
161
|
-
|
|
323
|
+
const entryTypeName = entryNameToTypeName(entryName);
|
|
324
|
+
await bundleDts(`${srcRoot}/${entryTypeName}`, `${outDir}/${entryTypeName}`, platform, {
|
|
325
|
+
compilerOptions
|
|
326
|
+
}, verbose);
|
|
162
327
|
}));
|
|
328
|
+
if (verbose) {
|
|
329
|
+
console.log(chalk5.cyan(`Compiling Types FINISH: ${entries.length} files to ${outDir} from ${srcDir}`));
|
|
330
|
+
}
|
|
163
331
|
return 0;
|
|
164
|
-
};
|
|
332
|
+
}, "packageCompileTscTypes");
|
|
165
333
|
|
|
166
334
|
// src/actions/package/compile/packageCompileTsup.ts
|
|
167
|
-
var compileFolder =
|
|
335
|
+
var compileFolder = /* @__PURE__ */ __name(async (srcDir, entries, buildDir, options, bundleTypes = false, verbose) => {
|
|
168
336
|
const outDir = options?.outDir ?? "dist";
|
|
169
337
|
if (verbose) {
|
|
170
|
-
console.log(`compileFolder [${
|
|
338
|
+
console.log(`compileFolder [${srcDir}, ${options?.outDir}]`);
|
|
171
339
|
}
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
340
|
+
if (entries.length === 0) {
|
|
341
|
+
console.warn(chalk6.yellow(`No entries found in ${srcDir} to compile`));
|
|
342
|
+
return 0;
|
|
343
|
+
}
|
|
344
|
+
if (verbose) {
|
|
345
|
+
console.log(chalk6.gray(`buildDir [${buildDir}]`));
|
|
346
|
+
}
|
|
347
|
+
const validationResult = packageCompileTsc(options?.platform ?? "neutral", entries, srcDir, buildDir, void 0, verbose);
|
|
348
|
+
if (validationResult !== 0) {
|
|
349
|
+
console.error(chalk6.red(`Compile:Validation had ${validationResult} errors`));
|
|
350
|
+
return validationResult;
|
|
351
|
+
}
|
|
352
|
+
const optionsParams = tsupOptions([
|
|
353
|
+
{
|
|
354
|
+
bundle: true,
|
|
355
|
+
cjsInterop: true,
|
|
356
|
+
clean: false,
|
|
357
|
+
dts: false,
|
|
358
|
+
format: [
|
|
359
|
+
"esm"
|
|
360
|
+
],
|
|
361
|
+
outDir,
|
|
362
|
+
silent: true,
|
|
363
|
+
sourcemap: true,
|
|
364
|
+
splitting: false,
|
|
365
|
+
tsconfig: "tsconfig.json",
|
|
366
|
+
...options,
|
|
367
|
+
entry: entries.map((entry) => `${srcDir}/${entry}`)
|
|
368
|
+
}
|
|
369
|
+
]);
|
|
370
|
+
const optionsResult = defineConfig(optionsParams);
|
|
371
|
+
const optionsList = (await Promise.all((Array.isArray(optionsResult) ? optionsResult : [
|
|
372
|
+
optionsResult
|
|
373
|
+
]).flatMap(async (options2) => {
|
|
374
|
+
const result = typeof options2 === "function" ? await options2({}) : [
|
|
375
|
+
options2
|
|
376
|
+
];
|
|
377
|
+
return Array.isArray(result) ? result : [
|
|
378
|
+
result
|
|
379
|
+
];
|
|
380
|
+
}))).flat();
|
|
193
381
|
if (verbose) {
|
|
194
|
-
console.log(`TSUP:build:start [${
|
|
382
|
+
console.log(chalk6.cyan(`TSUP:build:start [${srcDir}]`));
|
|
383
|
+
console.log(chalk6.gray(`TSUP:build:options [${JSON.stringify(optionsList, null, 2)}]`));
|
|
195
384
|
}
|
|
196
385
|
await Promise.all(optionsList.map((options2) => build(options2)));
|
|
197
386
|
if (verbose) {
|
|
198
|
-
console.log(`TSUP:build:stop [${
|
|
387
|
+
console.log(chalk6.cyan(`TSUP:build:stop [${srcDir}]`));
|
|
388
|
+
}
|
|
389
|
+
if (bundleTypes) {
|
|
390
|
+
await packageCompileTscTypes(entries, outDir, options?.platform ?? "neutral", buildDir, verbose);
|
|
199
391
|
}
|
|
200
|
-
await packageCompileTscTypes(entry, outDir);
|
|
201
392
|
return 0;
|
|
202
|
-
};
|
|
203
|
-
var tsupOptions = (options = []) => {
|
|
393
|
+
}, "compileFolder");
|
|
394
|
+
var tsupOptions = /* @__PURE__ */ __name((options = []) => {
|
|
204
395
|
const standardLoaders = {
|
|
205
396
|
".gif": "copy",
|
|
206
397
|
".html": "copy",
|
|
207
398
|
".jpg": "copy",
|
|
208
399
|
".json": "json",
|
|
209
400
|
".png": "copy",
|
|
210
|
-
".svg": "
|
|
401
|
+
".svg": "text",
|
|
211
402
|
".webp": "copy"
|
|
212
403
|
};
|
|
213
404
|
const standardOptions = {
|
|
214
405
|
bundle: true,
|
|
215
|
-
format: [
|
|
406
|
+
format: [
|
|
407
|
+
"esm"
|
|
408
|
+
],
|
|
216
409
|
loader: standardLoaders,
|
|
217
|
-
outExtension: ({ format }) => format === "esm" ? {
|
|
410
|
+
outExtension: /* @__PURE__ */ __name(({ format }) => format === "esm" ? {
|
|
411
|
+
js: ".mjs"
|
|
412
|
+
} : {
|
|
413
|
+
js: ".cjs"
|
|
414
|
+
}, "outExtension"),
|
|
218
415
|
skipNodeModulesBundle: true,
|
|
219
416
|
sourcemap: true,
|
|
220
417
|
target: "esnext"
|
|
221
418
|
};
|
|
222
|
-
return deepMergeObjects([
|
|
223
|
-
|
|
224
|
-
|
|
419
|
+
return deepMergeObjects([
|
|
420
|
+
standardOptions,
|
|
421
|
+
...options
|
|
422
|
+
]);
|
|
423
|
+
}, "tsupOptions");
|
|
424
|
+
var packageCompileTsup = /* @__PURE__ */ __name(async (config2) => {
|
|
225
425
|
const compile = config2?.compile;
|
|
226
426
|
const verbose = config2?.verbose ?? false;
|
|
427
|
+
const outDirAsBuildDir = compile?.outDirAsBuildDir ?? true;
|
|
428
|
+
const bundleTypes = compile?.bundleTypes ?? false;
|
|
227
429
|
if (verbose) {
|
|
228
|
-
console.log(
|
|
229
|
-
}
|
|
230
|
-
const compileForNode = compile?.node ?? { src: {} };
|
|
231
|
-
const compileForBrowser = compile?.browser ?? { src: {} };
|
|
232
|
-
const compileForNeutral = compile?.neutral ?? { src: {} };
|
|
233
|
-
if (verbose) {
|
|
234
|
-
console.log("Calling packageCompileTscTypes");
|
|
430
|
+
console.log("Compiling with TSUP");
|
|
235
431
|
}
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
432
|
+
const compileForNode = compile?.node ?? {
|
|
433
|
+
src: {}
|
|
434
|
+
};
|
|
435
|
+
const compileForBrowser = compile?.browser ?? {
|
|
436
|
+
src: {}
|
|
437
|
+
};
|
|
438
|
+
const compileForNeutral = compile?.neutral ?? {
|
|
439
|
+
src: {}
|
|
440
|
+
};
|
|
441
|
+
return (await Promise.all(Object.entries(compileForNode).map(async ([srcDir, options]) => {
|
|
442
|
+
const optionsObject = typeof options === "object" ? options : {};
|
|
443
|
+
const inEsBuildOptions = typeof compile?.node?.esbuildOptions === "object" ? compile?.node?.esbuildOptions : {};
|
|
444
|
+
const entry = buildEntries(srcDir, compile?.entryMode, options, true, verbose);
|
|
445
|
+
const platform = "node";
|
|
446
|
+
const rootOutDir = optionsObject.outDir ?? "dist";
|
|
447
|
+
const outDir = rootOutDir + "/" + platform;
|
|
448
|
+
return typeof srcDir === "string" ? await compileFolder(srcDir, entry, outDirAsBuildDir ? rootOutDir : "build", tsupOptions([
|
|
449
|
+
inEsBuildOptions,
|
|
450
|
+
compile?.tsup?.options ?? {},
|
|
451
|
+
typeof options === "object" ? options : {},
|
|
452
|
+
{
|
|
453
|
+
platform: "node",
|
|
454
|
+
outDir
|
|
455
|
+
}
|
|
456
|
+
]), bundleTypes, verbose) : 0;
|
|
457
|
+
}))).reduce((prev, value) => prev + value, 0) + (await Promise.all(Object.entries(compileForBrowser).map(async ([srcDir, options]) => {
|
|
458
|
+
const optionsObject = typeof options === "object" ? options : {};
|
|
459
|
+
const inEsBuildOptions = typeof compile?.browser?.esbuildOptions === "object" ? compile?.browser?.esbuildOptions : {};
|
|
460
|
+
const entry = buildEntries(srcDir, compile?.entryMode, options, true, verbose);
|
|
461
|
+
const platform = "browser";
|
|
462
|
+
const rootOutDir = optionsObject.outDir ?? "dist";
|
|
463
|
+
const outDir = rootOutDir + "/" + platform;
|
|
464
|
+
return typeof srcDir === "string" ? await compileFolder(srcDir, entry, outDirAsBuildDir ? rootOutDir : "build", tsupOptions([
|
|
465
|
+
inEsBuildOptions,
|
|
466
|
+
compile?.tsup?.options ?? {},
|
|
467
|
+
typeof options === "object" ? options : {},
|
|
468
|
+
{
|
|
469
|
+
platform: "browser",
|
|
470
|
+
outDir
|
|
471
|
+
}
|
|
472
|
+
]), bundleTypes, verbose) : 0;
|
|
473
|
+
}))).reduce((prev, value) => prev + value, 0) + (await Promise.all(Object.entries(compileForNeutral).map(async ([srcDir, options]) => {
|
|
474
|
+
const optionsObject = typeof options === "object" ? options : {};
|
|
475
|
+
const inEsBuildOptions = typeof compile?.neutral?.esbuildOptions === "object" ? compile?.neutral?.esbuildOptions : {};
|
|
476
|
+
const entry = buildEntries(srcDir, compile?.entryMode, options, true, verbose);
|
|
477
|
+
const platform = "neutral";
|
|
478
|
+
const rootOutDir = optionsObject.outDir ?? "dist";
|
|
479
|
+
const outDir = rootOutDir + "/" + platform;
|
|
480
|
+
return typeof srcDir === "string" ? await compileFolder(srcDir, entry, outDirAsBuildDir ? rootOutDir : "build", tsupOptions([
|
|
481
|
+
inEsBuildOptions,
|
|
482
|
+
compile?.tsup?.options ?? {},
|
|
483
|
+
typeof options === "object" ? options : {},
|
|
484
|
+
{
|
|
485
|
+
platform: "neutral",
|
|
486
|
+
outDir
|
|
487
|
+
}
|
|
488
|
+
]), bundleTypes, verbose) : 0;
|
|
489
|
+
}))).reduce((prev, value) => prev + value, 0) + 0;
|
|
490
|
+
}, "packageCompileTsup");
|
|
289
491
|
|
|
290
492
|
// src/actions/package/compile/compile.ts
|
|
291
|
-
var packageCompile = async (inConfig = {}) => {
|
|
493
|
+
var packageCompile = /* @__PURE__ */ __name(async (inConfig = {}) => {
|
|
292
494
|
const pkg = process.env.INIT_CWD;
|
|
293
|
-
console.log(
|
|
495
|
+
console.log(chalk7.green(`Compiling ${pkg}`));
|
|
294
496
|
const config2 = await loadConfig(inConfig);
|
|
295
497
|
const publint = config2.publint;
|
|
296
498
|
const tsupResults = await packageCompileTsup(config2);
|
|
@@ -298,15 +500,17 @@ var packageCompile = async (inConfig = {}) => {
|
|
|
298
500
|
return tsupResults;
|
|
299
501
|
}
|
|
300
502
|
return publint ? await packagePublint(config2) : 0;
|
|
301
|
-
};
|
|
503
|
+
}, "packageCompile");
|
|
302
504
|
|
|
303
505
|
// src/bin/package/build.ts
|
|
304
|
-
packageCompile({
|
|
305
|
-
|
|
506
|
+
packageCompile({
|
|
507
|
+
publint: true
|
|
508
|
+
}).then((value) => {
|
|
509
|
+
if (value > 0) {
|
|
306
510
|
process.exit(value);
|
|
307
511
|
}
|
|
308
512
|
}).catch((reason) => {
|
|
309
|
-
console.error(
|
|
513
|
+
console.error(chalk8.red(reason));
|
|
310
514
|
process.exit(-1);
|
|
311
515
|
});
|
|
312
516
|
//# sourceMappingURL=build.mjs.map
|