@xylabs/ts-scripts-yarn3 6.1.5 → 6.1.7
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/index.mjs +67 -75
- package/dist/actions/index.mjs.map +1 -1
- package/dist/actions/package/compile/buildEntries.mjs +8 -8
- package/dist/actions/package/compile/buildEntries.mjs.map +1 -1
- package/dist/actions/package/compile/compile.mjs +67 -19
- package/dist/actions/package/compile/compile.mjs.map +1 -1
- package/dist/actions/package/compile/compileTypes.mjs +10 -15
- package/dist/actions/package/compile/compileTypes.mjs.map +1 -1
- package/dist/actions/package/compile/index.mjs +67 -75
- package/dist/actions/package/compile/index.mjs.map +1 -1
- package/dist/actions/package/compile/inputs.mjs +6 -6
- package/dist/actions/package/compile/inputs.mjs.map +1 -1
- package/dist/actions/package/compile/packageCompileTsc.mjs +68 -76
- package/dist/actions/package/compile/packageCompileTsc.mjs.map +1 -1
- package/dist/actions/package/compile/packageCompileTscTypes.mjs +10 -11
- package/dist/actions/package/compile/packageCompileTscTypes.mjs.map +1 -1
- package/dist/actions/package/compile/packageCompileTsup.mjs +65 -17
- package/dist/actions/package/compile/packageCompileTsup.mjs.map +1 -1
- package/dist/actions/package/index.mjs +67 -75
- package/dist/actions/package/index.mjs.map +1 -1
- package/dist/actions/package/recompile.mjs +67 -19
- package/dist/actions/package/recompile.mjs.map +1 -1
- package/dist/bin/package/build-only.mjs +69 -21
- package/dist/bin/package/build-only.mjs.map +1 -1
- package/dist/bin/package/build.mjs +69 -21
- package/dist/bin/package/build.mjs.map +1 -1
- package/dist/bin/package/compile-only.mjs +69 -21
- package/dist/bin/package/compile-only.mjs.map +1 -1
- package/dist/bin/package/compile-tsup.mjs +67 -19
- package/dist/bin/package/compile-tsup.mjs.map +1 -1
- package/dist/bin/package/compile-types.mjs +10 -15
- package/dist/bin/package/compile-types.mjs.map +1 -1
- package/dist/bin/package/compile.mjs +69 -21
- package/dist/bin/package/compile.mjs.map +1 -1
- package/dist/bin/package/recompile.mjs +69 -21
- package/dist/bin/package/recompile.mjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +67 -75
- package/dist/index.mjs.map +1 -1
- package/package.json +10 -10
- package/dist/types/actions/build.d.ts +0 -9
- package/dist/types/actions/build.d.ts.map +0 -1
- package/dist/types/actions/clean-docs.d.ts +0 -2
- package/dist/types/actions/clean-docs.d.ts.map +0 -1
- package/dist/types/actions/clean-eslint.d.ts +0 -2
- package/dist/types/actions/clean-eslint.d.ts.map +0 -1
- package/dist/types/actions/clean-jest.d.ts +0 -2
- package/dist/types/actions/clean-jest.d.ts.map +0 -1
- package/dist/types/actions/clean.d.ts +0 -12
- package/dist/types/actions/clean.d.ts.map +0 -1
- package/dist/types/actions/compile-types.d.ts +0 -16
- package/dist/types/actions/compile-types.d.ts.map +0 -1
- package/dist/types/actions/compile.d.ts +0 -19
- package/dist/types/actions/compile.d.ts.map +0 -1
- package/dist/types/actions/copy-assets.d.ts +0 -6
- package/dist/types/actions/copy-assets.d.ts.map +0 -1
- package/dist/types/actions/cycle.d.ts +0 -2
- package/dist/types/actions/cycle.d.ts.map +0 -1
- package/dist/types/actions/dead.d.ts +0 -2
- package/dist/types/actions/dead.d.ts.map +0 -1
- package/dist/types/actions/deploy-major.d.ts +0 -2
- package/dist/types/actions/deploy-major.d.ts.map +0 -1
- package/dist/types/actions/deploy-minor.d.ts +0 -2
- package/dist/types/actions/deploy-minor.d.ts.map +0 -1
- package/dist/types/actions/deploy-next.d.ts +0 -2
- package/dist/types/actions/deploy-next.d.ts.map +0 -1
- package/dist/types/actions/deploy.d.ts +0 -2
- package/dist/types/actions/deploy.d.ts.map +0 -1
- package/dist/types/actions/deps.d.ts +0 -13
- package/dist/types/actions/deps.d.ts.map +0 -1
- package/dist/types/actions/dupdeps.d.ts +0 -2
- package/dist/types/actions/dupdeps.d.ts.map +0 -1
- package/dist/types/actions/fix.d.ts +0 -3
- package/dist/types/actions/fix.d.ts.map +0 -1
- package/dist/types/actions/gen-docs.d.ts +0 -11
- package/dist/types/actions/gen-docs.d.ts.map +0 -1
- package/dist/types/actions/gitignore-gen.d.ts +0 -2
- package/dist/types/actions/gitignore-gen.d.ts.map +0 -1
- package/dist/types/actions/gitlint-fix.d.ts +0 -2
- package/dist/types/actions/gitlint-fix.d.ts.map +0 -1
- package/dist/types/actions/gitlint.d.ts +0 -2
- package/dist/types/actions/gitlint.d.ts.map +0 -1
- package/dist/types/actions/index.d.ts +0 -39
- package/dist/types/actions/index.d.ts.map +0 -1
- package/dist/types/actions/knip.d.ts +0 -2
- package/dist/types/actions/knip.d.ts.map +0 -1
- package/dist/types/actions/license.d.ts +0 -2
- package/dist/types/actions/license.d.ts.map +0 -1
- package/dist/types/actions/lint.d.ts +0 -14
- package/dist/types/actions/lint.d.ts.map +0 -1
- package/dist/types/actions/npmignore-gen.d.ts +0 -2
- package/dist/types/actions/npmignore-gen.d.ts.map +0 -1
- package/dist/types/actions/package/clean-outputs.d.ts +0 -2
- package/dist/types/actions/package/clean-outputs.d.ts.map +0 -1
- package/dist/types/actions/package/clean-typescript.d.ts +0 -2
- package/dist/types/actions/package/clean-typescript.d.ts.map +0 -1
- package/dist/types/actions/package/clean.d.ts +0 -2
- package/dist/types/actions/package/clean.d.ts.map +0 -1
- package/dist/types/actions/package/compile/XyConfig.d.ts +0 -58
- package/dist/types/actions/package/compile/XyConfig.d.ts.map +0 -1
- package/dist/types/actions/package/compile/buildEntries.d.ts +0 -3
- package/dist/types/actions/package/compile/buildEntries.d.ts.map +0 -1
- package/dist/types/actions/package/compile/compile.d.ts +0 -3
- package/dist/types/actions/package/compile/compile.d.ts.map +0 -1
- package/dist/types/actions/package/compile/compileTypes.d.ts +0 -3
- package/dist/types/actions/package/compile/compileTypes.d.ts.map +0 -1
- package/dist/types/actions/package/compile/copyTypeFiles.d.ts +0 -3
- package/dist/types/actions/package/compile/copyTypeFiles.d.ts.map +0 -1
- package/dist/types/actions/package/compile/deepMerge.d.ts +0 -4
- package/dist/types/actions/package/compile/deepMerge.d.ts.map +0 -1
- package/dist/types/actions/package/compile/getCompilerOptions.d.ts +0 -3
- package/dist/types/actions/package/compile/getCompilerOptions.d.ts.map +0 -1
- package/dist/types/actions/package/compile/index.d.ts +0 -7
- package/dist/types/actions/package/compile/index.d.ts.map +0 -1
- package/dist/types/actions/package/compile/inputs.d.ts +0 -2
- package/dist/types/actions/package/compile/inputs.d.ts.map +0 -1
- package/dist/types/actions/package/compile/packageCompileTsc.d.ts +0 -4
- package/dist/types/actions/package/compile/packageCompileTsc.d.ts.map +0 -1
- package/dist/types/actions/package/compile/packageCompileTscTypes.d.ts +0 -4
- package/dist/types/actions/package/compile/packageCompileTscTypes.d.ts.map +0 -1
- package/dist/types/actions/package/compile/packageCompileTsup.d.ts +0 -5
- package/dist/types/actions/package/compile/packageCompileTsup.d.ts.map +0 -1
- package/dist/types/actions/package/copy-assets.d.ts +0 -5
- package/dist/types/actions/package/copy-assets.d.ts.map +0 -1
- package/dist/types/actions/package/deps.d.ts +0 -2
- package/dist/types/actions/package/deps.d.ts.map +0 -1
- package/dist/types/actions/package/gen-docs.d.ts +0 -2
- package/dist/types/actions/package/gen-docs.d.ts.map +0 -1
- package/dist/types/actions/package/index.d.ts +0 -11
- package/dist/types/actions/package/index.d.ts.map +0 -1
- package/dist/types/actions/package/lint.d.ts +0 -2
- package/dist/types/actions/package/lint.d.ts.map +0 -1
- package/dist/types/actions/package/publint.d.ts +0 -5
- package/dist/types/actions/package/publint.d.ts.map +0 -1
- package/dist/types/actions/package/recompile.d.ts +0 -2
- package/dist/types/actions/package/recompile.d.ts.map +0 -1
- package/dist/types/actions/publint.d.ts +0 -12
- package/dist/types/actions/publint.d.ts.map +0 -1
- package/dist/types/actions/rebuild.d.ts +0 -6
- package/dist/types/actions/rebuild.d.ts.map +0 -1
- package/dist/types/actions/recompile.d.ts +0 -16
- package/dist/types/actions/recompile.d.ts.map +0 -1
- package/dist/types/actions/reinstall.d.ts +0 -2
- package/dist/types/actions/reinstall.d.ts.map +0 -1
- package/dist/types/actions/relint.d.ts +0 -13
- package/dist/types/actions/relint.d.ts.map +0 -1
- package/dist/types/actions/retest.d.ts +0 -2
- package/dist/types/actions/retest.d.ts.map +0 -1
- package/dist/types/actions/sonar.d.ts +0 -2
- package/dist/types/actions/sonar.d.ts.map +0 -1
- package/dist/types/actions/statics.d.ts +0 -2
- package/dist/types/actions/statics.d.ts.map +0 -1
- package/dist/types/actions/test.d.ts +0 -2
- package/dist/types/actions/test.d.ts.map +0 -1
- package/dist/types/actions/up.d.ts +0 -2
- package/dist/types/actions/up.d.ts.map +0 -1
- package/dist/types/actions/updo.d.ts +0 -2
- package/dist/types/actions/updo.d.ts.map +0 -1
- package/dist/types/actions/upplug.d.ts +0 -2
- package/dist/types/actions/upplug.d.ts.map +0 -1
- package/dist/types/actions/upyarn.d.ts +0 -2
- package/dist/types/actions/upyarn.d.ts.map +0 -1
- package/dist/types/actions/yarn3only.d.ts +0 -2
- package/dist/types/actions/yarn3only.d.ts.map +0 -1
- package/dist/types/bin/package/build-only.d.ts +0 -3
- package/dist/types/bin/package/build-only.d.ts.map +0 -1
- package/dist/types/bin/package/build.d.ts +0 -3
- package/dist/types/bin/package/build.d.ts.map +0 -1
- package/dist/types/bin/package/clean-outputs.d.ts +0 -3
- package/dist/types/bin/package/clean-outputs.d.ts.map +0 -1
- package/dist/types/bin/package/clean-typescript.d.ts +0 -3
- package/dist/types/bin/package/clean-typescript.d.ts.map +0 -1
- package/dist/types/bin/package/clean.d.ts +0 -3
- package/dist/types/bin/package/clean.d.ts.map +0 -1
- package/dist/types/bin/package/compile-only.d.ts +0 -3
- package/dist/types/bin/package/compile-only.d.ts.map +0 -1
- package/dist/types/bin/package/compile-tsup.d.ts +0 -3
- package/dist/types/bin/package/compile-tsup.d.ts.map +0 -1
- package/dist/types/bin/package/compile-types.d.ts +0 -3
- package/dist/types/bin/package/compile-types.d.ts.map +0 -1
- package/dist/types/bin/package/compile.d.ts +0 -3
- package/dist/types/bin/package/compile.d.ts.map +0 -1
- package/dist/types/bin/package/copy-assets-cjs.d.ts +0 -3
- package/dist/types/bin/package/copy-assets-cjs.d.ts.map +0 -1
- package/dist/types/bin/package/copy-assets-esm.d.ts +0 -3
- package/dist/types/bin/package/copy-assets-esm.d.ts.map +0 -1
- package/dist/types/bin/package/deps.d.ts +0 -3
- package/dist/types/bin/package/deps.d.ts.map +0 -1
- package/dist/types/bin/package/fix.d.ts +0 -3
- package/dist/types/bin/package/fix.d.ts.map +0 -1
- package/dist/types/bin/package/gen-docs.d.ts +0 -3
- package/dist/types/bin/package/gen-docs.d.ts.map +0 -1
- package/dist/types/bin/package/lint.d.ts +0 -3
- package/dist/types/bin/package/lint.d.ts.map +0 -1
- package/dist/types/bin/package/publint.d.ts +0 -3
- package/dist/types/bin/package/publint.d.ts.map +0 -1
- package/dist/types/bin/package/recompile.d.ts +0 -3
- package/dist/types/bin/package/recompile.d.ts.map +0 -1
- package/dist/types/bin/package/relint.d.ts +0 -3
- package/dist/types/bin/package/relint.d.ts.map +0 -1
- package/dist/types/bin/xy.d.ts +0 -3
- package/dist/types/bin/xy.d.ts.map +0 -1
- package/dist/types/index.d.ts +0 -5
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/lib/checkResult.d.ts +0 -2
- package/dist/types/lib/checkResult.d.ts.map +0 -1
- package/dist/types/lib/createBuildConfig.d.ts +0 -2
- package/dist/types/lib/createBuildConfig.d.ts.map +0 -1
- package/dist/types/lib/defaultBuildConfig.d.ts +0 -9
- package/dist/types/lib/defaultBuildConfig.d.ts.map +0 -1
- package/dist/types/lib/deleteGlob.d.ts +0 -2
- package/dist/types/lib/deleteGlob.d.ts.map +0 -1
- package/dist/types/lib/dependencies/DuplicateDetector.d.ts +0 -9
- package/dist/types/lib/dependencies/DuplicateDetector.d.ts.map +0 -1
- package/dist/types/lib/dependencies/detectDuplicateDependencies.d.ts +0 -2
- package/dist/types/lib/dependencies/detectDuplicateDependencies.d.ts.map +0 -1
- package/dist/types/lib/dependencies/index.d.ts +0 -3
- package/dist/types/lib/dependencies/index.d.ts.map +0 -1
- package/dist/types/lib/file/ReadFileSyncOptions.d.ts +0 -6
- package/dist/types/lib/file/ReadFileSyncOptions.d.ts.map +0 -1
- package/dist/types/lib/file/constants.d.ts +0 -3
- package/dist/types/lib/file/constants.d.ts.map +0 -1
- package/dist/types/lib/file/fileLines.d.ts +0 -6
- package/dist/types/lib/file/fileLines.d.ts.map +0 -1
- package/dist/types/lib/file/index.d.ts +0 -5
- package/dist/types/lib/file/index.d.ts.map +0 -1
- package/dist/types/lib/file/tryReadFileSync.d.ts +0 -4
- package/dist/types/lib/file/tryReadFileSync.d.ts.map +0 -1
- package/dist/types/lib/generateIgnoreFiles.d.ts +0 -2
- package/dist/types/lib/generateIgnoreFiles.d.ts.map +0 -1
- package/dist/types/lib/index.d.ts +0 -21
- package/dist/types/lib/index.d.ts.map +0 -1
- package/dist/types/lib/jsonFormatters.d.ts +0 -2
- package/dist/types/lib/jsonFormatters.d.ts.map +0 -1
- package/dist/types/lib/loadConfig.d.ts +0 -2
- package/dist/types/lib/loadConfig.d.ts.map +0 -1
- package/dist/types/lib/parsedPackageJSON.d.ts +0 -2
- package/dist/types/lib/parsedPackageJSON.d.ts.map +0 -1
- package/dist/types/lib/processEx.d.ts +0 -2
- package/dist/types/lib/processEx.d.ts.map +0 -1
- package/dist/types/lib/runSteps.d.ts +0 -4
- package/dist/types/lib/runSteps.d.ts.map +0 -1
- package/dist/types/lib/runStepsAsync.d.ts +0 -4
- package/dist/types/lib/runStepsAsync.d.ts.map +0 -1
- package/dist/types/lib/runXy.d.ts +0 -2
- package/dist/types/lib/runXy.d.ts.map +0 -1
- package/dist/types/lib/runXyWithWarning.d.ts +0 -2
- package/dist/types/lib/runXyWithWarning.d.ts.map +0 -1
- package/dist/types/lib/safeExit.d.ts +0 -5
- package/dist/types/lib/safeExit.d.ts.map +0 -1
- package/dist/types/lib/string/empty.d.ts +0 -3
- package/dist/types/lib/string/empty.d.ts.map +0 -1
- package/dist/types/lib/string/index.d.ts +0 -3
- package/dist/types/lib/string/index.d.ts.map +0 -1
- package/dist/types/lib/string/union.d.ts +0 -2
- package/dist/types/lib/string/union.d.ts.map +0 -1
- package/dist/types/lib/withErrnoException.d.ts +0 -2
- package/dist/types/lib/withErrnoException.d.ts.map +0 -1
- package/dist/types/lib/withError.d.ts +0 -2
- package/dist/types/lib/withError.d.ts.map +0 -1
- package/dist/types/lib/yarn/index.d.ts +0 -4
- package/dist/types/lib/yarn/index.d.ts.map +0 -1
- package/dist/types/lib/yarn/isYarnVersionOrGreater.d.ts +0 -2
- package/dist/types/lib/yarn/isYarnVersionOrGreater.d.ts.map +0 -1
- package/dist/types/lib/yarn/workspace/Workspace.d.ts +0 -5
- package/dist/types/lib/yarn/workspace/Workspace.d.ts.map +0 -1
- package/dist/types/lib/yarn/workspace/index.d.ts +0 -4
- package/dist/types/lib/yarn/workspace/index.d.ts.map +0 -1
- package/dist/types/lib/yarn/workspace/yarnWorkspace.d.ts +0 -3
- package/dist/types/lib/yarn/workspace/yarnWorkspace.d.ts.map +0 -1
- package/dist/types/lib/yarn/workspace/yarnWorkspaces.d.ts +0 -3
- package/dist/types/lib/yarn/workspace/yarnWorkspaces.d.ts.map +0 -1
- package/dist/types/lib/yarn/yarnInitCwd.d.ts +0 -2
- package/dist/types/lib/yarn/yarnInitCwd.d.ts.map +0 -1
- package/dist/types/loadPackageConfig.d.ts +0 -6
- package/dist/types/loadPackageConfig.d.ts.map +0 -1
- package/dist/types/xy/index.d.ts +0 -8
- package/dist/types/xy/index.d.ts.map +0 -1
- package/dist/types/xy/param.d.ts +0 -5
- package/dist/types/xy/param.d.ts.map +0 -1
- package/dist/types/xy/xy.d.ts +0 -10
- package/dist/types/xy/xy.d.ts.map +0 -1
- package/dist/types/xy/xyBuildCommands.d.ts +0 -3
- package/dist/types/xy/xyBuildCommands.d.ts.map +0 -1
- package/dist/types/xy/xyCommonCommands.d.ts +0 -3
- package/dist/types/xy/xyCommonCommands.d.ts.map +0 -1
- package/dist/types/xy/xyDeployCommands.d.ts +0 -3
- package/dist/types/xy/xyDeployCommands.d.ts.map +0 -1
- package/dist/types/xy/xyInstallCommands.d.ts +0 -3
- package/dist/types/xy/xyInstallCommands.d.ts.map +0 -1
- package/dist/types/xy/xyLintCommands.d.ts +0 -3
- package/dist/types/xy/xyLintCommands.d.ts.map +0 -1
- package/dist/types/xy/xyParseOptions.d.ts +0 -3
- package/dist/types/xy/xyParseOptions.d.ts.map +0 -1
|
@@ -3,7 +3,7 @@ var __defProp = Object.defineProperty;
|
|
|
3
3
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
4
4
|
|
|
5
5
|
// src/bin/package/recompile.ts
|
|
6
|
-
import
|
|
6
|
+
import chalk8 from "chalk";
|
|
7
7
|
|
|
8
8
|
// src/lib/deleteGlob.ts
|
|
9
9
|
import fs from "node:fs";
|
|
@@ -83,7 +83,7 @@ var packageClean = /* @__PURE__ */ __name(async () => {
|
|
|
83
83
|
}, "packageClean");
|
|
84
84
|
|
|
85
85
|
// src/actions/package/compile/compile.ts
|
|
86
|
-
import
|
|
86
|
+
import chalk7 from "chalk";
|
|
87
87
|
|
|
88
88
|
// src/actions/package/publint.ts
|
|
89
89
|
import { promises as fs2 } from "node:fs";
|
|
@@ -134,19 +134,19 @@ import { build, defineConfig } from "tsup";
|
|
|
134
134
|
|
|
135
135
|
// src/actions/package/compile/inputs.ts
|
|
136
136
|
import { glob as glob2 } from "glob";
|
|
137
|
-
var getAllInputs = /* @__PURE__ */ __name((folder
|
|
137
|
+
var getAllInputs = /* @__PURE__ */ __name((folder, ignore = [
|
|
138
|
+
"**/*.spec.*",
|
|
139
|
+
"**/*.stories.*",
|
|
140
|
+
"**/spec/**/*"
|
|
141
|
+
]) => {
|
|
138
142
|
return glob2.sync(`${folder}/**/*.*`, {
|
|
139
|
-
ignore
|
|
140
|
-
"**/*.spec.*",
|
|
141
|
-
"**/*.stories.*",
|
|
142
|
-
"**/spec/**/*"
|
|
143
|
-
],
|
|
143
|
+
ignore,
|
|
144
144
|
posix: true
|
|
145
145
|
});
|
|
146
146
|
}, "getAllInputs");
|
|
147
147
|
|
|
148
148
|
// src/actions/package/compile/buildEntries.ts
|
|
149
|
-
var buildEntries = /* @__PURE__ */ __name((folder, entryMode = "single", verbose = false) => {
|
|
149
|
+
var buildEntries = /* @__PURE__ */ __name((folder, entryMode = "single", excludeSpecAndStory = true, verbose = false) => {
|
|
150
150
|
let entries = [];
|
|
151
151
|
switch (entryMode) {
|
|
152
152
|
case "platform": {
|
|
@@ -157,7 +157,7 @@ var buildEntries = /* @__PURE__ */ __name((folder, entryMode = "single", verbose
|
|
|
157
157
|
break;
|
|
158
158
|
}
|
|
159
159
|
case "all": {
|
|
160
|
-
entries = getAllInputs(folder).filter((entry) => !entry.includes(".spec.") && !entry.includes(".
|
|
160
|
+
entries = excludeSpecAndStory ? getAllInputs(folder).filter((entry) => !entry.includes(".spec.") && !entry.includes(".stories.")) : getAllInputs(folder, []);
|
|
161
161
|
break;
|
|
162
162
|
}
|
|
163
163
|
default: {
|
|
@@ -171,11 +171,9 @@ var buildEntries = /* @__PURE__ */ __name((folder, entryMode = "single", verbose
|
|
|
171
171
|
return entries;
|
|
172
172
|
}, "buildEntries");
|
|
173
173
|
|
|
174
|
-
// src/actions/package/compile/compileTypes.ts
|
|
175
|
-
import chalk5 from "chalk";
|
|
176
|
-
|
|
177
174
|
// src/actions/package/compile/packageCompileTscTypes.ts
|
|
178
175
|
import { cwd } from "node:process";
|
|
176
|
+
import chalk5 from "chalk";
|
|
179
177
|
import { createProgramFromConfig } from "tsc-prog";
|
|
180
178
|
import { DiagnosticCategory, formatDiagnosticsWithColorAndContext, getPreEmitDiagnostics, sys as sys2 } from "typescript";
|
|
181
179
|
|
|
@@ -205,9 +203,6 @@ var getCompilerOptions = /* @__PURE__ */ __name((options = {}, tsconfig = "tscon
|
|
|
205
203
|
var packageCompileTscTypes = /* @__PURE__ */ __name((folder = "src", config2 = {}, compilerOptionsParam) => {
|
|
206
204
|
const pkg = process.env.INIT_CWD ?? cwd();
|
|
207
205
|
const verbose = config2?.verbose ?? false;
|
|
208
|
-
if (verbose) {
|
|
209
|
-
console.log(`Compiling types [${pkg}]`);
|
|
210
|
-
}
|
|
211
206
|
const compilerOptions = {
|
|
212
207
|
...getCompilerOptions({
|
|
213
208
|
emitDeclarationOnly: true,
|
|
@@ -231,6 +226,7 @@ var packageCompileTscTypes = /* @__PURE__ */ __name((folder = "src", config2 = {
|
|
|
231
226
|
".d.mts"
|
|
232
227
|
];
|
|
233
228
|
const files = buildEntries(folder, "all", verbose).filter((file) => validTsExt.find((ext) => file.endsWith(ext)));
|
|
229
|
+
console.log(chalk5.green(`Compiling Types ${pkg}: ${files.length}`));
|
|
234
230
|
const program = createProgramFromConfig({
|
|
235
231
|
basePath: pkg ?? cwd(),
|
|
236
232
|
compilerOptions,
|
|
@@ -259,7 +255,6 @@ var packageCompileTscTypes = /* @__PURE__ */ __name((folder = "src", config2 = {
|
|
|
259
255
|
// src/actions/package/compile/compileTypes.ts
|
|
260
256
|
var packageCompileTypes = /* @__PURE__ */ __name(async (inConfig = {}) => {
|
|
261
257
|
const pkg = process.env.INIT_CWD;
|
|
262
|
-
console.log(chalk5.green(`Compiling Types ${pkg}`));
|
|
263
258
|
const config2 = await loadConfig(inConfig);
|
|
264
259
|
return packageCompileTscTypes(void 0, config2);
|
|
265
260
|
}, "packageCompileTypes");
|
|
@@ -289,6 +284,59 @@ function deepMergeObjects(objects) {
|
|
|
289
284
|
}
|
|
290
285
|
__name(deepMergeObjects, "deepMergeObjects");
|
|
291
286
|
|
|
287
|
+
// src/actions/package/compile/packageCompileTsc.ts
|
|
288
|
+
import { cwd as cwd2 } from "node:process";
|
|
289
|
+
import chalk6 from "chalk";
|
|
290
|
+
import { createProgramFromConfig as createProgramFromConfig2 } from "tsc-prog";
|
|
291
|
+
import { DiagnosticCategory as DiagnosticCategory2, formatDiagnosticsWithColorAndContext as formatDiagnosticsWithColorAndContext2, getPreEmitDiagnostics as getPreEmitDiagnostics2, sys as sys3 } from "typescript";
|
|
292
|
+
var packageCompileTsc = /* @__PURE__ */ __name((folder = "src", config2 = {}, compilerOptionsParam) => {
|
|
293
|
+
const pkg = process.env.INIT_CWD ?? cwd2();
|
|
294
|
+
const verbose = config2?.verbose ?? false;
|
|
295
|
+
const compilerOptions = {
|
|
296
|
+
...getCompilerOptions({
|
|
297
|
+
outDir: "dist/types",
|
|
298
|
+
removeComments: false,
|
|
299
|
+
skipDefaultLibCheck: true,
|
|
300
|
+
skipLibCheck: true,
|
|
301
|
+
sourceMap: false
|
|
302
|
+
}),
|
|
303
|
+
...compilerOptionsParam,
|
|
304
|
+
emitDeclarationOnly: false,
|
|
305
|
+
noEmit: true
|
|
306
|
+
};
|
|
307
|
+
const validTsExt = [
|
|
308
|
+
".ts",
|
|
309
|
+
".tsx",
|
|
310
|
+
".d.ts",
|
|
311
|
+
".cts",
|
|
312
|
+
".d.cts",
|
|
313
|
+
".mts",
|
|
314
|
+
".d.mts"
|
|
315
|
+
];
|
|
316
|
+
const files = buildEntries(folder, "all", verbose).filter((file) => validTsExt.find((ext) => file.endsWith(ext)));
|
|
317
|
+
console.log(chalk6.green(`Compiling Files ${pkg}: ${files.length}`));
|
|
318
|
+
const program = createProgramFromConfig2({
|
|
319
|
+
basePath: pkg ?? cwd2(),
|
|
320
|
+
compilerOptions,
|
|
321
|
+
exclude: [
|
|
322
|
+
"dist",
|
|
323
|
+
"docs"
|
|
324
|
+
],
|
|
325
|
+
files
|
|
326
|
+
});
|
|
327
|
+
const diagnostics = getPreEmitDiagnostics2(program);
|
|
328
|
+
if (diagnostics.length > 0) {
|
|
329
|
+
const formattedDiagnostics = formatDiagnosticsWithColorAndContext2(diagnostics, {
|
|
330
|
+
getCanonicalFileName: /* @__PURE__ */ __name((fileName) => fileName, "getCanonicalFileName"),
|
|
331
|
+
getCurrentDirectory: /* @__PURE__ */ __name(() => folder, "getCurrentDirectory"),
|
|
332
|
+
getNewLine: /* @__PURE__ */ __name(() => sys3.newLine, "getNewLine")
|
|
333
|
+
});
|
|
334
|
+
console.error(formattedDiagnostics);
|
|
335
|
+
}
|
|
336
|
+
program.emit();
|
|
337
|
+
return diagnostics.reduce((acc, diag) => acc + (diag.category === DiagnosticCategory2.Error ? 1 : 0), 0);
|
|
338
|
+
}, "packageCompileTsc");
|
|
339
|
+
|
|
292
340
|
// src/actions/package/compile/packageCompileTsup.ts
|
|
293
341
|
var compileFolder = /* @__PURE__ */ __name(async (folder, entryMode = "single", options, verbose) => {
|
|
294
342
|
const outDir = options?.outDir ?? "dist";
|
|
@@ -362,7 +410,6 @@ var tsupOptions = /* @__PURE__ */ __name((options = []) => {
|
|
|
362
410
|
]);
|
|
363
411
|
}, "tsupOptions");
|
|
364
412
|
var packageCompileTsup = /* @__PURE__ */ __name(async (config2) => {
|
|
365
|
-
console.log("packageCompileTsup-types");
|
|
366
413
|
const compile = config2?.compile;
|
|
367
414
|
const verbose = config2?.verbose ?? false;
|
|
368
415
|
if (verbose) {
|
|
@@ -380,7 +427,8 @@ var packageCompileTsup = /* @__PURE__ */ __name(async (config2) => {
|
|
|
380
427
|
if (verbose) {
|
|
381
428
|
console.log("Calling packageCompileTscTypes");
|
|
382
429
|
}
|
|
383
|
-
|
|
430
|
+
let errors = await packageCompileTypes(config2);
|
|
431
|
+
errors = errors + packageCompileTsc(void 0, config2);
|
|
384
432
|
if (errors > 0) {
|
|
385
433
|
return errors;
|
|
386
434
|
}
|
|
@@ -423,7 +471,7 @@ var packageCompileTsup = /* @__PURE__ */ __name(async (config2) => {
|
|
|
423
471
|
// src/actions/package/compile/compile.ts
|
|
424
472
|
var packageCompile = /* @__PURE__ */ __name(async (inConfig = {}) => {
|
|
425
473
|
const pkg = process.env.INIT_CWD;
|
|
426
|
-
console.log(
|
|
474
|
+
console.log(chalk7.green(`Compiling ${pkg}`));
|
|
427
475
|
const config2 = await loadConfig(inConfig);
|
|
428
476
|
const publint = config2.publint;
|
|
429
477
|
const tsupResults = await packageCompileTsup(config2);
|
|
@@ -440,7 +488,7 @@ var packageRecompile = /* @__PURE__ */ __name(async () => {
|
|
|
440
488
|
|
|
441
489
|
// src/bin/package/recompile.ts
|
|
442
490
|
packageRecompile().then((value) => process.exitCode = value).catch((reason) => {
|
|
443
|
-
console.error(
|
|
491
|
+
console.error(chalk8.red(reason));
|
|
444
492
|
process.exitCode = 1;
|
|
445
493
|
});
|
|
446
494
|
//# sourceMappingURL=recompile.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/bin/package/recompile.ts","../../../src/lib/deleteGlob.ts","../../../src/lib/loadConfig.ts","../../../src/actions/package/clean-outputs.ts","../../../src/actions/package/clean-typescript.ts","../../../src/actions/package/clean.ts","../../../src/actions/package/compile/compile.ts","../../../src/actions/package/publint.ts","../../../src/actions/package/compile/packageCompileTsup.ts","../../../src/actions/package/compile/inputs.ts","../../../src/actions/package/compile/buildEntries.ts","../../../src/actions/package/compile/compileTypes.ts","../../../src/actions/package/compile/packageCompileTscTypes.ts","../../../src/actions/package/compile/getCompilerOptions.ts","../../../src/actions/package/compile/deepMerge.ts","../../../src/actions/package/recompile.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport chalk from 'chalk'\n\nimport { packageRecompile } from '../../actions/index.ts'\n\npackageRecompile()\n .then(value => (process.exitCode = value))\n .catch((reason) => {\n console.error(chalk.red(reason))\n process.exitCode = 1\n })\n","import fs from 'node:fs'\n\nimport { glob } from 'glob'\n\nexport const deleteGlob = (globPath: string) => {\n // Find all files matching the glob pattern\n const files = glob.sync(globPath)\n\n // Remove each file or directory\n for (const file of files) {\n fs.rmSync(file, { recursive: true, force: true })\n }\n}\n","import chalk from 'chalk'\nimport { cosmiconfig } from 'cosmiconfig'\nimport deepmerge from 'deepmerge'\n\nlet config: Record<string, unknown>\n\nexport const loadConfig = async <T extends object>(params?: T): Promise<T> => {\n if (config) {\n return deepmerge(config, params ?? {}) as T\n }\n\n const cosmicConfigResult = await cosmiconfig('xy', { cache: true }).search()\n config = cosmicConfigResult?.config\n const configFilePath = cosmicConfigResult?.filepath\n if (configFilePath) {\n console.log(chalk.gray(`Loading config from ${configFilePath}`))\n }\n return deepmerge(config, params ?? {}) as T\n}\n","import path from 'node:path'\n\nimport chalk from 'chalk'\n\nimport { deleteGlob } from '../../lib/index.ts'\n\nexport const packageCleanOutputs = () => {\n const pkg = process.env.INIT_CWD ?? '.'\n const pkgName = process.env.npm_package_name\n const folders: string[] = [path.join(pkg, 'dist'), path.join(pkg, 'build'), path.join(pkg, 'docs')]\n console.log(chalk.green(`Cleaning Outputs [${pkgName}]`))\n\n for (let folder of folders) {\n deleteGlob(folder)\n }\n\n return 0\n}\n","import path from 'node:path'\n\nimport chalk from 'chalk'\n\nimport { deleteGlob } from '../../lib/index.ts'\n\nexport const packageCleanTypescript = () => {\n const pkg = process.env.INIT_CWD ?? '.'\n const pkgName = process.env.npm_package_name\n console.log(chalk.green(`Cleaning Typescript [${pkgName}]`))\n const files: string[] = [path.join(pkg, '*.tsbuildinfo'), path.join(pkg, '.tsconfig.*'), path.join(pkg, '.eslintcache')]\n\n for (let file of files) {\n deleteGlob(file)\n }\n\n return 0\n}\n","import { packageCleanOutputs } from './clean-outputs.ts'\nimport { packageCleanTypescript } from './clean-typescript.ts'\n\nexport const packageClean = async () => {\n return (await Promise.all([packageCleanOutputs(), packageCleanTypescript()])).reduce((prev, value) => prev + value, 0)\n}\n","import chalk from 'chalk'\n\nimport { loadConfig } from '../../../lib/index.ts'\nimport { packagePublint } from '../publint.ts'\nimport { packageCompileTsup } from './packageCompileTsup.ts'\nimport type { XyConfig } from './XyConfig.ts'\n\nexport const packageCompile = async (inConfig: XyConfig = {}): Promise<number> => {\n const pkg = process.env.INIT_CWD\n console.log(chalk.green(`Compiling ${pkg}`))\n const config = await loadConfig(inConfig)\n const publint = config.publint\n\n const tsupResults = await packageCompileTsup(config)\n\n if (tsupResults > 0) {\n return tsupResults\n }\n\n return (publint ? await packagePublint(config) : 0)\n}\n","import { promises as fs } from 'node:fs'\n\nimport chalk from 'chalk'\nimport type { Message } from 'publint'\nimport sortPackageJson from 'sort-package-json'\n\nexport interface PackagePublintParams { verbose?: boolean }\n\nexport const packagePublint = async (params?: PackagePublintParams) => {\n const pkgDir = process.env.INIT_CWD\n\n const sortedPkg = sortPackageJson(await fs.readFile(`${pkgDir}/package.json`, 'utf8'))\n await fs.writeFile(`${pkgDir}/package.json`, sortedPkg)\n\n const pkg = JSON.parse(await fs.readFile(`${pkgDir}/package.json`, 'utf8'))\n\n console.log(chalk.green(`Publint: ${pkg.name}`))\n console.log(chalk.gray(pkgDir))\n\n const { publint } = await import('publint')\n\n const { messages } = await publint({\n level: 'suggestion',\n pkgDir,\n strict: true,\n })\n\n // eslint-disable-next-line import-x/no-internal-modules\n const { formatMessage } = await import('publint/utils')\n\n const validMessage = (_message: Message): boolean => {\n return true\n /* try {\n const value = getValueFromPath(pkg, message.path)\n switch (message.code) {\n case 'FILE_INVALID_FORMAT':\n return !message.args?.actualFilePath?.includes('dist/browser') && !value?.includes('dist/browser')\n case 'EXPORT_TYPES_INVALID_FORMAT':\n return !`${value}`.includes('dist/browser')\n default:\n return true\n }\n } catch (ex) {\n const error = ex as Error\n console.error(chalk.red(`validMessage Excepted: ${error.message}`))\n console.error(chalk.gray(JSON.stringify(error.stack)))\n return true\n } */\n }\n\n // we filter out invalid file formats for the esm folder since it is intentionally done\n const validMessages = messages.filter(validMessage)\n for (const message of validMessages) {\n switch (message.type) {\n case 'error': {\n console.error(chalk.red(`[${message.code}] ${formatMessage(message, pkg)}`))\n break\n }\n case 'warning': {\n console.warn(chalk.yellow(`[${message.code}] ${formatMessage(message, pkg)}`))\n break\n }\n default: {\n console.log(chalk.white(`[${message.code}] ${formatMessage(message, pkg)}`))\n break\n }\n }\n }\n\n if (params?.verbose) {\n console.log(chalk.gray(`Publint [Finish]: ${pkgDir} [${validMessages.length}]`))\n }\n\n return validMessages.filter(message => message.type === 'error').length\n}\n","import type { Loader } from 'esbuild'\nimport type { Options } from 'tsup'\nimport { build, defineConfig } from 'tsup'\n\nimport { buildEntries } from './buildEntries.ts'\nimport { packageCompileTypes } from './compileTypes.ts'\nimport { deepMergeObjects } from './deepMerge.ts'\nimport type { EntryMode, XyTsupConfig } from './XyConfig.ts'\n\nconst compileFolder = async (\n folder: string,\n entryMode: EntryMode = 'single',\n options?: Options,\n verbose?: boolean,\n): Promise<number> => {\n const outDir = options?.outDir ?? 'dist'\n\n if (verbose) {\n console.log(`compileFolder [${folder}]`)\n }\n\n const entry = buildEntries(folder, entryMode)\n const optionsResult = defineConfig({\n bundle: true,\n cjsInterop: true,\n clean: true,\n dts: false,\n entry,\n format: ['esm'],\n outDir,\n silent: true,\n sourcemap: true,\n splitting: false,\n tsconfig: 'tsconfig.json',\n ...options,\n })\n const optionsList = (\n await Promise.all(\n (Array.isArray(optionsResult) ? optionsResult : [optionsResult]).flatMap<Promise<Options[]>>(async (options) => {\n const result = typeof options === 'function' ? await options({}) : [options]\n return Array.isArray(result) ? result : [result]\n }),\n )\n ).flat()\n\n if (verbose) {\n console.log(`TSUP:build:start [${folder}]`)\n }\n\n await Promise.all(optionsList.map(options => build(options)))\n\n if (verbose) {\n console.log(`TSUP:build:stop [${folder}]`)\n }\n\n return 0\n}\n\nexport const tsupOptions = (options: Options[] = []): Options => {\n const standardLoaders: Record<string, Loader> = {\n '.gif': 'copy', '.html': 'copy', '.jpg': 'copy', '.json': 'json', '.png': 'copy', '.svg': 'copy', '.webp': 'copy',\n }\n\n const standardOptions: Options = {\n bundle: true,\n format: ['esm'],\n loader: standardLoaders,\n outExtension: ({ format }) => (format === 'esm' ? { js: '.mjs' } : { js: '.cjs' }),\n skipNodeModulesBundle: true,\n sourcemap: true,\n target: 'esnext',\n }\n\n return deepMergeObjects([standardOptions, ...options])\n}\n\nexport const packageCompileTsup = async (config?: XyTsupConfig) => {\n console.log('packageCompileTsup-types')\n const compile = config?.compile\n const verbose = config?.verbose ?? false\n if (verbose) {\n console.log(`Compiling with TSUP [Depth: ${compile?.depth}]`)\n }\n\n const compileForNode = compile?.node ?? { src: {} }\n const compileForBrowser = compile?.browser ?? { src: {} }\n const compileForNeutral = compile?.neutral ?? { src: {} }\n\n if (verbose) {\n console.log('Calling packageCompileTscTypes')\n }\n const errors = await packageCompileTypes(config)\n if (errors > 0) {\n return errors\n }\n\n return (\n (\n await Promise.all(\n Object.entries(compileForNode).map(async ([folder, options]) => {\n const inEsBuildOptions = typeof compile?.node?.esbuildOptions === 'object' ? compile?.node?.esbuildOptions : {}\n return folder\n ? await compileFolder(\n folder,\n compile?.entryMode,\n tsupOptions([inEsBuildOptions,\n compile?.tsup?.options ?? {},\n (typeof options === 'object' ? options : {}),\n { platform: 'node', outDir: 'dist/node' }]),\n verbose,\n )\n : 0\n }),\n )\n ).reduce((prev, value) => prev + value, 0)\n || (\n await Promise.all(\n Object.entries(compileForBrowser).map(async ([folder, options]) => {\n const inEsBuildOptions = typeof compile?.browser?.esbuildOptions === 'object' ? compile?.browser?.esbuildOptions : {}\n return folder\n ? await compileFolder(\n folder,\n compile?.entryMode,\n tsupOptions([inEsBuildOptions,\n compile?.tsup?.options ?? {},\n (typeof options === 'object' ? options : {}),\n { platform: 'browser', outDir: 'dist/browser' }]),\n verbose,\n )\n : 0\n }),\n )\n ).reduce((prev, value) => prev + value, 0)\n || (\n await Promise.all(\n Object.entries(compileForNeutral).map(async ([folder, options]) => {\n const inEsBuildOptions = typeof compile?.neutral?.esbuildOptions === 'object' ? compile?.neutral?.esbuildOptions : {}\n return folder\n ? await compileFolder(\n folder,\n compile?.entryMode,\n tsupOptions([inEsBuildOptions,\n compile?.tsup?.options ?? {},\n (typeof options === 'object' ? options : {}),\n { platform: 'neutral', outDir: 'dist/neutral' }]),\n verbose,\n )\n : 0\n }),\n )\n ).reduce((prev, value) => prev + value, 0)\n || 0\n )\n}\n","import { glob } from 'glob'\n\nexport const getAllInputs = (folder: string) => {\n /* tsup wants posix paths */\n return glob.sync(`${folder}/**/*.*`, { ignore: ['**/*.spec.*', '**/*.stories.*', '**/spec/**/*'], posix: true })\n}\n","import { getAllInputs } from './inputs.ts'\nimport type { EntryMode } from './XyConfig.ts'\n\nexport const buildEntries = (folder: string, entryMode: EntryMode = 'single', verbose = false) => {\n let entries: string[] = []\n switch (entryMode) {\n case 'platform': {\n entries = [`${folder}/index-node.ts`, `${folder}/index-browser.ts`]\n break\n }\n case 'all': {\n entries = getAllInputs(folder).filter(entry => !entry.includes('.spec.') && !entry.includes('.story.'))\n break\n }\n default: {\n entries = [`${folder}/index.ts`]\n break\n }\n }\n if (verbose) console.log(`buildEntries [${entryMode}] ${entries.length}`)\n return entries\n}\n","import chalk from 'chalk'\n\nimport { loadConfig } from '../../../lib/index.ts'\nimport { packageCompileTscTypes } from './packageCompileTscTypes.ts'\nimport type { XyConfig, XyTscConfig } from './XyConfig.ts'\n\nexport const packageCompileTypes = async (inConfig: XyConfig = {}): Promise<number> => {\n const pkg = process.env.INIT_CWD\n console.log(chalk.green(`Compiling Types ${pkg}`))\n const config = await loadConfig(inConfig)\n\n return packageCompileTscTypes(undefined, config as XyTscConfig)\n}\n","import { cwd } from 'node:process'\n\nimport type { TsConfigCompilerOptions } from 'tsc-prog'\nimport { createProgramFromConfig } from 'tsc-prog'\nimport type { CompilerOptions } from 'typescript'\nimport {\n DiagnosticCategory, formatDiagnosticsWithColorAndContext, getPreEmitDiagnostics, sys,\n} from 'typescript'\n\nimport { buildEntries } from './buildEntries.ts'\nimport { getCompilerOptions } from './getCompilerOptions.ts'\nimport type { XyConfig } from './XyConfig.ts'\n\nexport const packageCompileTscTypes = (\n folder: string = 'src',\n config: XyConfig = {},\n compilerOptionsParam?: CompilerOptions,\n): number => {\n const pkg = process.env.INIT_CWD ?? cwd()\n const verbose = config?.verbose ?? false\n\n if (verbose) {\n console.log(`Compiling types [${pkg}]`)\n }\n\n const compilerOptions = {\n ...(getCompilerOptions({\n emitDeclarationOnly: true,\n outDir: 'dist/types',\n removeComments: false,\n skipDefaultLibCheck: true,\n skipLibCheck: true,\n sourceMap: false,\n })),\n ...compilerOptionsParam,\n emitDeclarationOnly: true,\n noEmit: false,\n } as TsConfigCompilerOptions\n\n const validTsExt = ['.ts', '.tsx', '.d.ts', '.cts', '.d.cts', '.mts', '.d.mts']\n\n // calling all here since the types do not get rolled up\n const files = buildEntries(folder, 'all', verbose).filter(file => validTsExt.find(ext => file.endsWith(ext)))\n\n const program = createProgramFromConfig({\n basePath: pkg ?? cwd(),\n compilerOptions,\n exclude: ['dist', 'docs', '**/*.spec.*', '**/*.stories.*', 'src/**/spec/**/*'],\n files,\n })\n\n const diagnostics = getPreEmitDiagnostics(program)\n\n if (diagnostics.length > 0) {\n const formattedDiagnostics = formatDiagnosticsWithColorAndContext(\n diagnostics,\n {\n getCanonicalFileName: fileName => fileName,\n getCurrentDirectory: () => folder,\n getNewLine: () => sys.newLine,\n },\n )\n console.error(formattedDiagnostics)\n }\n\n program.emit()\n return diagnostics.reduce((acc, diag) => acc + (diag.category === DiagnosticCategory.Error ? 1 : 0), 0)\n}\n","import { createRequire } from 'node:module'\n\nimport deepmerge from 'deepmerge'\nimport type { TsConfig } from 'tsc-prog'\nimport type { CompilerOptions } from 'typescript'\nimport {\n findConfigFile, readConfigFile, sys,\n} from 'typescript'\n\nconst getNested = (config: TsConfig): CompilerOptions => {\n if (config.extends) {\n const require = createRequire(import.meta.url)\n const opts = require(config.extends)\n return deepmerge(getNested(opts), config.compilerOptions ?? {}) as CompilerOptions\n }\n\n return config.compilerOptions as CompilerOptions\n}\n\nconst getCompilerOptionsJSONFollowExtends = (filename: string): CompilerOptions => {\n const config = readConfigFile(filename, sys.readFile).config\n return getNested(config)\n}\n\nexport const getCompilerOptions = (options: CompilerOptions = {}, tsconfig: string = 'tsconfig.json'): CompilerOptions => {\n const configFileName = findConfigFile('./', sys.fileExists, tsconfig)\n const configFileCompilerOptions = (configFileName ? getCompilerOptionsJSONFollowExtends(configFileName) : undefined) ?? {}\n\n return deepmerge(configFileCompilerOptions, options)\n}\n","// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype AnyObject = Record<any, any>\n\nfunction deepMerge<T extends AnyObject>(target: AnyObject, source: AnyObject): T {\n if (!source || typeof source !== 'object') return target\n\n for (const key of Object.keys(source)) {\n if (\n typeof source[key] === 'object'\n && source[key] !== null\n && !Array.isArray(source[key])\n ) {\n // Recursively merge nested objects\n if (!target[key] || typeof target[key] !== 'object') {\n target[key] = {} as T[typeof key]\n }\n deepMerge(target[key], source[key])\n } else {\n // Overwrite with non-object values\n target[key] = source[key]\n }\n }\n\n return target\n}\n\nexport function deepMergeObjects<T extends AnyObject>(objects: T[]): T {\n const result = {} as T\n for (const obj of objects) {\n deepMerge(result, obj)\n }\n return result\n}\n","import { packageClean } from './clean.ts'\nimport { packageCompile } from './compile/index.ts'\n\nexport const packageRecompile = async () => {\n return await packageClean() || await packageCompile()\n}\n"],"mappings":";;;;;AAEA,OAAOA,YAAW;;;ACFlB,OAAOC,QAAQ;AAEf,SAASC,YAAY;AAEd,IAAMC,aAAa,wBAACC,aAAAA;AAEzB,QAAMC,QAAQC,KAAKC,KAAKH,QAAAA;AAGxB,aAAWI,QAAQH,OAAO;AACxBI,OAAGC,OAAOF,MAAM;MAAEG,WAAW;MAAMC,OAAO;IAAK,CAAA;EACjD;AACF,GAR0B;;;ACJ1B,OAAOC,WAAW;AAClB,SAASC,mBAAmB;AAC5B,OAAOC,eAAe;AAEtB,IAAIC;AAEG,IAAMC,aAAa,8BAAyBC,WAAAA;AACjD,MAAIF,QAAQ;AACV,WAAOG,UAAUH,QAAQE,UAAU,CAAC,CAAA;EACtC;AAEA,QAAME,qBAAqB,MAAMC,YAAY,MAAM;IAAEC,OAAO;EAAK,CAAA,EAAGC,OAAM;AAC1EP,WAASI,oBAAoBJ;AAC7B,QAAMQ,iBAAiBJ,oBAAoBK;AAC3C,MAAID,gBAAgB;AAClBE,Y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AOE;AAEvB,QAAMC,cAAc,MAAMC,mBAAmBJ,OAAAA;AAE7C,MAAIG,cAAc,GAAG;AACnB,WAAOA;EACT;AAEA,SAAQD,UAAU,MAAMG,eAAeL,OAAAA,IAAU;AACnD,GAb8B;;;ASJvB,IAAMM,mBAAmB,mCAAA;AAC9B,SAAO,MAAMC,aAAAA,KAAkB,MAAMC,eAAAA;AACvC,GAFgC;;;AfGhCC,iBAAAA,EACGC,KAAKC,CAAAA,UAAUC,QAAQC,WAAWF,KAAAA,EAClCG,MAAM,CAACC,WAAAA;AACNC,UAAQC,MAAMC,OAAMC,IAAIJ,MAAAA,CAAAA;AACxBH,UAAQC,WAAW;AACrB,CAAA;","names":["chalk","fs","glob","deleteGlob","globPath","files","glob","sync","file","fs","rmSync","recursive","force","chalk","cosmiconfig","deepmerge","config","loadConfig","params","deepmerge","cosmicConfigResult","cosmiconfig","cache","search","configFilePath","filepath","console","log","chalk","gray","path","chalk","packageCleanOutputs","pkg","process","env","INIT_CWD","pkgName","npm_package_name","folders","path","join","console","log","chalk","green","folder","deleteGlob","path","chalk","packageCleanTypescript","pkg","process","env","INIT_CWD","pkgName","npm_package_name","console","log","chalk","green","files","path","join","file","deleteGlob","packageClean","Promise","all","packageCleanOutputs","packageCleanTypescript","reduce","prev","value","chalk","promises","fs","chalk","sortPackageJson","packagePublint","params","pkgDir","process","env","INIT_CWD","sortedPkg","sortPackageJson","fs","readFile","writeFile","pkg","JSON","parse","console","log","chalk","green","name","gray","publint","messages","level","strict","formatMessage","validMessage","_message","validMessages","filter","message","type","error","red","code","warn","yellow","white","verbose","length","build","defineConfig","glob","getAllInputs","folder","glob","sync","ignore","posix","buildEntries","folder","entryMode","verbose","entries","getAllInputs","filter","entry","includes","console","log","length","chalk","cwd","createProgramFromConfig","DiagnosticCategory","formatDiagnosticsWithColorAndContext","getPreEmitDiagnostics","sys","createRequire","deepmerge","findConfigFile","readConfigFile","sys","getNested","config","extends","require","createRequire","url","opts","deepmerge","compilerOptions","getCompilerOptionsJSONFollowExtends","filename","readConfigFile","sys","readFile","getCompilerOptions","options","tsconfig","configFileName","findConfigFile","fileExists","configFileCompilerOptions","undefined","packageCompileTscTypes","folder","config","compilerOptionsParam","pkg","process","env","INIT_CWD","cwd","verbose","console","log","compilerOptions","getCompilerOptions","emitDeclarationOnly","outDir","removeComments","skipDefaultLibCheck","skipLibCheck","sourceMap","noEmit","validTsExt","files","buildEntries","filter","file","find","ext","endsWith","program","createProgramFromConfig","basePath","exclude","diagnostics","getPreEmitDiagnostics","length","formattedDiagnostics","formatDiagnosticsWithColorAndContext","getCanonicalFileName","fileName","getCurrentDirectory","getNewLine","sys","newLine","error","emit","reduce","acc","diag","category","DiagnosticCategory","Error","packageCompileTypes","inConfig","pkg","process","env","INIT_CWD","console","log","chalk","green","config","loadConfig","packageCompileTscTypes","undefined","deepMerge","target","source","key","Object","keys","Array","isArray","deepMergeObjects","objects","result","obj","compileFolder","folder","entryMode","options","verbose","outDir","console","log","entry","buildEntries","optionsResult","defineConfig","bundle","cjsInterop","clean","dts","format","silent","sourcemap","splitting","tsconfig","optionsList","Promise","all","Array","isArray","flatMap","result","flat","map","build","tsupOptions","standardLoaders","standardOptions","loader","outExtension","js","skipNodeModulesBundle","target","deepMergeObjects","packageCompileTsup","config","compile","depth","compileForNode","node","src","compileForBrowser","browser","compileForNeutral","neutral","errors","packageCompileTypes","Object","entries","inEsBuildOptions","esbuildOptions","tsup","platform","reduce","prev","value","packageCompile","inConfig","pkg","process","env","INIT_CWD","console","log","chalk","green","config","loadConfig","publint","tsupResults","packageCompileTsup","packagePublint","packageRecompile","packageClean","packageCompile","packageRecompile","then","value","process","exitCode","catch","reason","console","error","chalk","red"]}
|
|
1
|
+
{"version":3,"sources":["../../../src/bin/package/recompile.ts","../../../src/lib/deleteGlob.ts","../../../src/lib/loadConfig.ts","../../../src/actions/package/clean-outputs.ts","../../../src/actions/package/clean-typescript.ts","../../../src/actions/package/clean.ts","../../../src/actions/package/compile/compile.ts","../../../src/actions/package/publint.ts","../../../src/actions/package/compile/packageCompileTsup.ts","../../../src/actions/package/compile/inputs.ts","../../../src/actions/package/compile/buildEntries.ts","../../../src/actions/package/compile/packageCompileTscTypes.ts","../../../src/actions/package/compile/getCompilerOptions.ts","../../../src/actions/package/compile/compileTypes.ts","../../../src/actions/package/compile/deepMerge.ts","../../../src/actions/package/compile/packageCompileTsc.ts","../../../src/actions/package/recompile.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport chalk from 'chalk'\n\nimport { packageRecompile } from '../../actions/index.ts'\n\npackageRecompile()\n .then(value => (process.exitCode = value))\n .catch((reason) => {\n console.error(chalk.red(reason))\n process.exitCode = 1\n })\n","import fs from 'node:fs'\n\nimport { glob } from 'glob'\n\nexport const deleteGlob = (globPath: string) => {\n // Find all files matching the glob pattern\n const files = glob.sync(globPath)\n\n // Remove each file or directory\n for (const file of files) {\n fs.rmSync(file, { recursive: true, force: true })\n }\n}\n","import chalk from 'chalk'\nimport { cosmiconfig } from 'cosmiconfig'\nimport deepmerge from 'deepmerge'\n\nlet config: Record<string, unknown>\n\nexport const loadConfig = async <T extends object>(params?: T): Promise<T> => {\n if (config) {\n return deepmerge(config, params ?? {}) as T\n }\n\n const cosmicConfigResult = await cosmiconfig('xy', { cache: true }).search()\n config = cosmicConfigResult?.config\n const configFilePath = cosmicConfigResult?.filepath\n if (configFilePath) {\n console.log(chalk.gray(`Loading config from ${configFilePath}`))\n }\n return deepmerge(config, params ?? {}) as T\n}\n","import path from 'node:path'\n\nimport chalk from 'chalk'\n\nimport { deleteGlob } from '../../lib/index.ts'\n\nexport const packageCleanOutputs = () => {\n const pkg = process.env.INIT_CWD ?? '.'\n const pkgName = process.env.npm_package_name\n const folders: string[] = [path.join(pkg, 'dist'), path.join(pkg, 'build'), path.join(pkg, 'docs')]\n console.log(chalk.green(`Cleaning Outputs [${pkgName}]`))\n\n for (let folder of folders) {\n deleteGlob(folder)\n }\n\n return 0\n}\n","import path from 'node:path'\n\nimport chalk from 'chalk'\n\nimport { deleteGlob } from '../../lib/index.ts'\n\nexport const packageCleanTypescript = () => {\n const pkg = process.env.INIT_CWD ?? '.'\n const pkgName = process.env.npm_package_name\n console.log(chalk.green(`Cleaning Typescript [${pkgName}]`))\n const files: string[] = [path.join(pkg, '*.tsbuildinfo'), path.join(pkg, '.tsconfig.*'), path.join(pkg, '.eslintcache')]\n\n for (let file of files) {\n deleteGlob(file)\n }\n\n return 0\n}\n","import { packageCleanOutputs } from './clean-outputs.ts'\nimport { packageCleanTypescript } from './clean-typescript.ts'\n\nexport const packageClean = async () => {\n return (await Promise.all([packageCleanOutputs(), packageCleanTypescript()])).reduce((prev, value) => prev + value, 0)\n}\n","import chalk from 'chalk'\n\nimport { loadConfig } from '../../../lib/index.ts'\nimport { packagePublint } from '../publint.ts'\nimport { packageCompileTsup } from './packageCompileTsup.ts'\nimport type { XyConfig } from './XyConfig.ts'\n\nexport const packageCompile = async (inConfig: XyConfig = {}): Promise<number> => {\n const pkg = process.env.INIT_CWD\n console.log(chalk.green(`Compiling ${pkg}`))\n const config = await loadConfig(inConfig)\n const publint = config.publint\n\n const tsupResults = await packageCompileTsup(config)\n\n if (tsupResults > 0) {\n return tsupResults\n }\n\n return (publint ? await packagePublint(config) : 0)\n}\n","import { promises as fs } from 'node:fs'\n\nimport chalk from 'chalk'\nimport type { Message } from 'publint'\nimport sortPackageJson from 'sort-package-json'\n\nexport interface PackagePublintParams { verbose?: boolean }\n\nexport const packagePublint = async (params?: PackagePublintParams) => {\n const pkgDir = process.env.INIT_CWD\n\n const sortedPkg = sortPackageJson(await fs.readFile(`${pkgDir}/package.json`, 'utf8'))\n await fs.writeFile(`${pkgDir}/package.json`, sortedPkg)\n\n const pkg = JSON.parse(await fs.readFile(`${pkgDir}/package.json`, 'utf8'))\n\n console.log(chalk.green(`Publint: ${pkg.name}`))\n console.log(chalk.gray(pkgDir))\n\n const { publint } = await import('publint')\n\n const { messages } = await publint({\n level: 'suggestion',\n pkgDir,\n strict: true,\n })\n\n // eslint-disable-next-line import-x/no-internal-modules\n const { formatMessage } = await import('publint/utils')\n\n const validMessage = (_message: Message): boolean => {\n return true\n /* try {\n const value = getValueFromPath(pkg, message.path)\n switch (message.code) {\n case 'FILE_INVALID_FORMAT':\n return !message.args?.actualFilePath?.includes('dist/browser') && !value?.includes('dist/browser')\n case 'EXPORT_TYPES_INVALID_FORMAT':\n return !`${value}`.includes('dist/browser')\n default:\n return true\n }\n } catch (ex) {\n const error = ex as Error\n console.error(chalk.red(`validMessage Excepted: ${error.message}`))\n console.error(chalk.gray(JSON.stringify(error.stack)))\n return true\n } */\n }\n\n // we filter out invalid file formats for the esm folder since it is intentionally done\n const validMessages = messages.filter(validMessage)\n for (const message of validMessages) {\n switch (message.type) {\n case 'error': {\n console.error(chalk.red(`[${message.code}] ${formatMessage(message, pkg)}`))\n break\n }\n case 'warning': {\n console.warn(chalk.yellow(`[${message.code}] ${formatMessage(message, pkg)}`))\n break\n }\n default: {\n console.log(chalk.white(`[${message.code}] ${formatMessage(message, pkg)}`))\n break\n }\n }\n }\n\n if (params?.verbose) {\n console.log(chalk.gray(`Publint [Finish]: ${pkgDir} [${validMessages.length}]`))\n }\n\n return validMessages.filter(message => message.type === 'error').length\n}\n","import type { Loader } from 'esbuild'\nimport type { Options } from 'tsup'\nimport { build, defineConfig } from 'tsup'\n\nimport { buildEntries } from './buildEntries.ts'\nimport { packageCompileTypes } from './compileTypes.ts'\nimport { deepMergeObjects } from './deepMerge.ts'\nimport { packageCompileTsc } from './packageCompileTsc.ts'\nimport type { EntryMode, XyTsupConfig } from './XyConfig.ts'\n\nconst compileFolder = async (\n folder: string,\n entryMode: EntryMode = 'single',\n options?: Options,\n verbose?: boolean,\n): Promise<number> => {\n const outDir = options?.outDir ?? 'dist'\n\n if (verbose) {\n console.log(`compileFolder [${folder}]`)\n }\n\n const entry = buildEntries(folder, entryMode)\n const optionsResult = defineConfig({\n bundle: true,\n cjsInterop: true,\n clean: true,\n dts: false,\n entry,\n format: ['esm'],\n outDir,\n silent: true,\n sourcemap: true,\n splitting: false,\n tsconfig: 'tsconfig.json',\n ...options,\n })\n const optionsList = (\n await Promise.all(\n (Array.isArray(optionsResult) ? optionsResult : [optionsResult]).flatMap<Promise<Options[]>>(async (options) => {\n const result = typeof options === 'function' ? await options({}) : [options]\n return Array.isArray(result) ? result : [result]\n }),\n )\n ).flat()\n\n if (verbose) {\n console.log(`TSUP:build:start [${folder}]`)\n }\n\n await Promise.all(optionsList.map(options => build(options)))\n\n if (verbose) {\n console.log(`TSUP:build:stop [${folder}]`)\n }\n\n return 0\n}\n\nexport const tsupOptions = (options: Options[] = []): Options => {\n const standardLoaders: Record<string, Loader> = {\n '.gif': 'copy', '.html': 'copy', '.jpg': 'copy', '.json': 'json', '.png': 'copy', '.svg': 'copy', '.webp': 'copy',\n }\n\n const standardOptions: Options = {\n bundle: true,\n format: ['esm'],\n loader: standardLoaders,\n outExtension: ({ format }) => (format === 'esm' ? { js: '.mjs' } : { js: '.cjs' }),\n skipNodeModulesBundle: true,\n sourcemap: true,\n target: 'esnext',\n }\n\n return deepMergeObjects([standardOptions, ...options])\n}\n\nexport const packageCompileTsup = async (config?: XyTsupConfig) => {\n const compile = config?.compile\n const verbose = config?.verbose ?? false\n if (verbose) {\n console.log(`Compiling with TSUP [Depth: ${compile?.depth}]`)\n }\n\n const compileForNode = compile?.node ?? { src: {} }\n const compileForBrowser = compile?.browser ?? { src: {} }\n const compileForNeutral = compile?.neutral ?? { src: {} }\n\n if (verbose) {\n console.log('Calling packageCompileTscTypes')\n }\n\n let errors = await packageCompileTypes(config)\n errors = errors + packageCompileTsc(undefined, config)\n if (errors > 0) {\n return errors\n }\n\n return (\n (\n await Promise.all(\n Object.entries(compileForNode).map(async ([folder, options]) => {\n const inEsBuildOptions = typeof compile?.node?.esbuildOptions === 'object' ? compile?.node?.esbuildOptions : {}\n return folder\n ? await compileFolder(\n folder,\n compile?.entryMode,\n tsupOptions([inEsBuildOptions,\n compile?.tsup?.options ?? {},\n (typeof options === 'object' ? options : {}),\n { platform: 'node', outDir: 'dist/node' }]),\n verbose,\n )\n : 0\n }),\n )\n ).reduce((prev, value) => prev + value, 0)\n || (\n await Promise.all(\n Object.entries(compileForBrowser).map(async ([folder, options]) => {\n const inEsBuildOptions = typeof compile?.browser?.esbuildOptions === 'object' ? compile?.browser?.esbuildOptions : {}\n return folder\n ? await compileFolder(\n folder,\n compile?.entryMode,\n tsupOptions([inEsBuildOptions,\n compile?.tsup?.options ?? {},\n (typeof options === 'object' ? options : {}),\n { platform: 'browser', outDir: 'dist/browser' }]),\n verbose,\n )\n : 0\n }),\n )\n ).reduce((prev, value) => prev + value, 0)\n || (\n await Promise.all(\n Object.entries(compileForNeutral).map(async ([folder, options]) => {\n const inEsBuildOptions = typeof compile?.neutral?.esbuildOptions === 'object' ? compile?.neutral?.esbuildOptions : {}\n return folder\n ? await compileFolder(\n folder,\n compile?.entryMode,\n tsupOptions([inEsBuildOptions,\n compile?.tsup?.options ?? {},\n (typeof options === 'object' ? options : {}),\n { platform: 'neutral', outDir: 'dist/neutral' }]),\n verbose,\n )\n : 0\n }),\n )\n ).reduce((prev, value) => prev + value, 0)\n || 0\n )\n}\n","import { glob } from 'glob'\n\nexport const getAllInputs = (folder: string, ignore = ['**/*.spec.*', '**/*.stories.*', '**/spec/**/*']) => {\n /* tsup wants posix paths */\n return glob.sync(`${folder}/**/*.*`, { ignore, posix: true })\n}\n","import { getAllInputs } from './inputs.ts'\nimport type { EntryMode } from './XyConfig.ts'\n\nexport const buildEntries = (folder: string, entryMode: EntryMode = 'single', excludeSpecAndStory = true, verbose = false) => {\n let entries: string[] = []\n switch (entryMode) {\n case 'platform': {\n entries = [`${folder}/index-node.ts`, `${folder}/index-browser.ts`]\n break\n }\n case 'all': {\n entries = excludeSpecAndStory ? getAllInputs(folder).filter(entry => !entry.includes('.spec.') && !entry.includes('.stories.')) : getAllInputs(folder, [])\n break\n }\n default: {\n entries = [`${folder}/index.ts`]\n break\n }\n }\n if (verbose) console.log(`buildEntries [${entryMode}] ${entries.length}`)\n return entries\n}\n","import { cwd } from 'node:process'\n\nimport chalk from 'chalk'\nimport type { TsConfigCompilerOptions } from 'tsc-prog'\nimport { createProgramFromConfig } from 'tsc-prog'\nimport type { CompilerOptions } from 'typescript'\nimport {\n DiagnosticCategory, formatDiagnosticsWithColorAndContext, getPreEmitDiagnostics, sys,\n} from 'typescript'\n\nimport { buildEntries } from './buildEntries.ts'\nimport { getCompilerOptions } from './getCompilerOptions.ts'\nimport type { XyConfig } from './XyConfig.ts'\n\nexport const packageCompileTscTypes = (\n folder: string = 'src',\n config: XyConfig = {},\n compilerOptionsParam?: CompilerOptions,\n): number => {\n const pkg = process.env.INIT_CWD ?? cwd()\n const verbose = config?.verbose ?? false\n\n const compilerOptions = {\n ...(getCompilerOptions({\n emitDeclarationOnly: true,\n outDir: 'dist/types',\n removeComments: false,\n skipDefaultLibCheck: true,\n skipLibCheck: true,\n sourceMap: false,\n })),\n ...compilerOptionsParam,\n emitDeclarationOnly: true,\n noEmit: false,\n } as TsConfigCompilerOptions\n\n const validTsExt = ['.ts', '.tsx', '.d.ts', '.cts', '.d.cts', '.mts', '.d.mts']\n\n // calling all here since the types do not get rolled up\n const files = buildEntries(folder, 'all', verbose).filter(file => validTsExt.find(ext => file.endsWith(ext)))\n\n console.log(chalk.green(`Compiling Types ${pkg}: ${files.length}`))\n\n const program = createProgramFromConfig({\n basePath: pkg ?? cwd(),\n compilerOptions,\n exclude: ['dist', 'docs', '**/*.spec.*', '**/*.stories.*', 'src/**/spec/**/*'],\n files,\n })\n\n const diagnostics = getPreEmitDiagnostics(program)\n\n if (diagnostics.length > 0) {\n const formattedDiagnostics = formatDiagnosticsWithColorAndContext(\n diagnostics,\n {\n getCanonicalFileName: fileName => fileName,\n getCurrentDirectory: () => folder,\n getNewLine: () => sys.newLine,\n },\n )\n console.error(formattedDiagnostics)\n }\n\n program.emit()\n return diagnostics.reduce((acc, diag) => acc + (diag.category === DiagnosticCategory.Error ? 1 : 0), 0)\n}\n","import { createRequire } from 'node:module'\n\nimport deepmerge from 'deepmerge'\nimport type { TsConfig } from 'tsc-prog'\nimport type { CompilerOptions } from 'typescript'\nimport {\n findConfigFile, readConfigFile, sys,\n} from 'typescript'\n\nconst getNested = (config: TsConfig): CompilerOptions => {\n if (config.extends) {\n const require = createRequire(import.meta.url)\n const opts = require(config.extends)\n return deepmerge(getNested(opts), config.compilerOptions ?? {}) as CompilerOptions\n }\n\n return config.compilerOptions as CompilerOptions\n}\n\nconst getCompilerOptionsJSONFollowExtends = (filename: string): CompilerOptions => {\n const config = readConfigFile(filename, sys.readFile).config\n return getNested(config)\n}\n\nexport const getCompilerOptions = (options: CompilerOptions = {}, tsconfig: string = 'tsconfig.json'): CompilerOptions => {\n const configFileName = findConfigFile('./', sys.fileExists, tsconfig)\n const configFileCompilerOptions = (configFileName ? getCompilerOptionsJSONFollowExtends(configFileName) : undefined) ?? {}\n\n return deepmerge(configFileCompilerOptions, options)\n}\n","import chalk from 'chalk'\n\nimport { loadConfig } from '../../../lib/index.ts'\nimport { packageCompileTscTypes } from './packageCompileTscTypes.ts'\nimport type { XyConfig, XyTscConfig } from './XyConfig.ts'\n\nexport const packageCompileTypes = async (inConfig: XyConfig = {}): Promise<number> => {\n const pkg = process.env.INIT_CWD\n const config = await loadConfig(inConfig)\n\n return packageCompileTscTypes(undefined, config as XyTscConfig)\n}\n","// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype AnyObject = Record<any, any>\n\nfunction deepMerge<T extends AnyObject>(target: AnyObject, source: AnyObject): T {\n if (!source || typeof source !== 'object') return target\n\n for (const key of Object.keys(source)) {\n if (\n typeof source[key] === 'object'\n && source[key] !== null\n && !Array.isArray(source[key])\n ) {\n // Recursively merge nested objects\n if (!target[key] || typeof target[key] !== 'object') {\n target[key] = {} as T[typeof key]\n }\n deepMerge(target[key], source[key])\n } else {\n // Overwrite with non-object values\n target[key] = source[key]\n }\n }\n\n return target\n}\n\nexport function deepMergeObjects<T extends AnyObject>(objects: T[]): T {\n const result = {} as T\n for (const obj of objects) {\n deepMerge(result, obj)\n }\n return result\n}\n","import { cwd } from 'node:process'\n\nimport chalk from 'chalk'\nimport type { TsConfigCompilerOptions } from 'tsc-prog'\nimport { createProgramFromConfig } from 'tsc-prog'\nimport type { CompilerOptions } from 'typescript'\nimport {\n DiagnosticCategory, formatDiagnosticsWithColorAndContext, getPreEmitDiagnostics, sys,\n} from 'typescript'\n\nimport { buildEntries } from './buildEntries.ts'\nimport { getCompilerOptions } from './getCompilerOptions.ts'\nimport type { XyConfig } from './XyConfig.ts'\n\nexport const packageCompileTsc = (\n folder: string = 'src',\n config: XyConfig = {},\n compilerOptionsParam?: CompilerOptions,\n): number => {\n const pkg = process.env.INIT_CWD ?? cwd()\n const verbose = config?.verbose ?? false\n\n const compilerOptions = {\n ...(getCompilerOptions({\n outDir: 'dist/types',\n removeComments: false,\n skipDefaultLibCheck: true,\n skipLibCheck: true,\n sourceMap: false,\n })),\n ...compilerOptionsParam,\n emitDeclarationOnly: false,\n noEmit: true,\n } as TsConfigCompilerOptions\n\n const validTsExt = ['.ts', '.tsx', '.d.ts', '.cts', '.d.cts', '.mts', '.d.mts']\n\n // calling all here since the types do not get rolled up\n const files = buildEntries(folder, 'all', verbose).filter(file => validTsExt.find(ext => file.endsWith(ext)))\n\n console.log(chalk.green(`Compiling Files ${pkg}: ${files.length}`))\n\n const program = createProgramFromConfig({\n basePath: pkg ?? cwd(),\n compilerOptions,\n exclude: ['dist', 'docs'],\n files,\n })\n\n const diagnostics = getPreEmitDiagnostics(program)\n\n if (diagnostics.length > 0) {\n const formattedDiagnostics = formatDiagnosticsWithColorAndContext(\n diagnostics,\n {\n getCanonicalFileName: fileName => fileName,\n getCurrentDirectory: () => folder,\n getNewLine: () => sys.newLine,\n },\n )\n console.error(formattedDiagnostics)\n }\n\n program.emit()\n return diagnostics.reduce((acc, diag) => acc + (diag.category === DiagnosticCategory.Error ? 1 : 0), 0)\n}\n","import { packageClean } from './clean.ts'\nimport { packageCompile } from './compile/index.ts'\n\nexport const packageRecompile = async () => {\n return await packageClean() || await packageCompile()\n}\n"],"mappings":";;;;;AAEA,OAAOA,YAAW;;;ACFlB,OAAOC,QAAQ;AAEf,SAASC,YAAY;AAEd,IAAMC,aAAa,wBAACC,aAAAA;AAEzB,QAAMC,QAAQC,KAAKC,KAAKH,QAAAA;AAGxB,aAAWI,QAAQH,OAAO;AACxBI,OAAGC,OAAOF,MAAM;MAAEG,WAAW;MAAMC,OAAO;IAAK,CAAA;EACjD;AACF,GAR0B;;;ACJ1B,OAAOC,WAAW;AAClB,SAASC,mBAAmB;AAC5B,OAAOC,eAAe;AAEtB,IAAIC;AAEG,IAAMC,aAAa,8BAAyBC,WAAAA;AACjD,MAAIF,QAAQ;AACV,WAAOG,UAAUH,QAAQE,UAAU,CAAC,CAAA;EACtC;AAEA,QAAME,qBAAqB,MAAMC,YAAY,MAAM;IAAEC,OAAO;EAAK,CAAA,EAAGC,OAAM;AAC1EP,WAASI,oBAAoBJ;AAC7B,QAAMQ,iBAAiBJ,oBAAoBK;AAC3C,MAAID,gBAAgB;AAClBE,YAAQC,IAAIC,MAAMC,KAAK,uBAAuBL,cAAAA,EAAgB,CAAA;EAChE;AACA,SAAOL,UAAUH,QAAQE,UAAU,CAAC,CAAA;AACtC,GAZ0B;;;ACN1B,OAAOY,UAAU;AAEjB,OAAOC,YAAW;AAIX,IAAMC,sBAAsB,6BAAA;AACjC,QAAMC,MAAMC,QAAQC,IAAIC,YAAY;AACpC,QAAMC,UAAUH,QAAQC,IAAIG;AAC5B,QAAMC,UAAoB;IAACC,KAAKC,KAAKR,KAAK,MAAA;IAASO,KAAKC,KAAKR,KAAK,OAAA;IAAUO,KAAKC,KAAKR,KAAK,MAAA;;AAC3FS,UAAQC,IAAIC,OAAMC,MAAM,qBAAqBR,OAAAA,GAAU,CAAA;AAEvD,WAASS,UAAUP,SAAS;AAC1BQ,eAAWD,MAAAA;EACb;AAEA,S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ACrB,CAAA;","names":["chalk","fs","glob","deleteGlob","globPath","files","glob","sync","file","fs","rmSync","recursive","force","chalk","cosmiconfig","deepmerge","config","loadConfig","params","deepmerge","cosmicConfigResult","cosmiconfig","cache","search","configFilePath","filepath","console","log","chalk","gray","path","chalk","packageCleanOutputs","pkg","process","env","INIT_CWD","pkgName","npm_package_name","folders","path","join","console","log","chalk","green","folder","deleteGlob","path","chalk","packageCleanTypescript","pkg","process","env","INIT_CWD","pkgName","npm_package_name","console","log","chalk","green","files","path","join","file","deleteGlob","packageClean","Promise","all","packageCleanOutputs","packageCleanTypescript","reduce","prev","value","chalk","promises","fs","chalk","sortPackageJson","packagePublint","params","pkgDir","process","env","INIT_CWD","sortedPkg","sortPackageJson","fs","readFile","writeFile","pkg","JSON","parse","console","log","chalk","green","name","gray","publint","messages","level","strict","formatMessage","validMessage","_message","validMessages","filter","message","type","error","red","code","warn","yellow","white","verbose","length","build","defineConfig","glob","getAllInputs","folder","ignore","glob","sync","posix","buildEntries","folder","entryMode","excludeSpecAndStory","verbose","entries","getAllInputs","filter","entry","includes","console","log","length","cwd","chalk","createProgramFromConfig","DiagnosticCategory","formatDiagnosticsWithColorAndContext","getPreEmitDiagnostics","sys","createRequire","deepmerge","findConfigFile","readConfigFile","sys","getNested","config","extends","require","createRequire","url","opts","deepmerge","compilerOptions","getCompilerOptionsJSONFollowExtends","filename","readConfigFile","sys","readFile","getCompilerOptions","options","tsconfig","configFileName","findConfigFile","fileExists","configFileCompilerOptions","undefined","packageCompileTscTypes","folder","config","compilerOptionsParam","pkg","process","env","INIT_CWD","cwd","verbose","compilerOptions","getCompilerOptions","emitDeclarationOnly","outDir","removeComments","skipDefaultLibCheck","skipLibCheck","sourceMap","noEmit","validTsExt","files","buildEntries","filter","file","find","ext","endsWith","console","log","chalk","green","length","program","createProgramFromConfig","basePath","exclude","diagnostics","getPreEmitDiagnostics","formattedDiagnostics","formatDiagnosticsWithColorAndContext","getCanonicalFileName","fileName","getCurrentDirectory","getNewLine","sys","newLine","error","emit","reduce","acc","diag","category","DiagnosticCategory","Error","packageCompileTypes","inConfig","pkg","process","env","INIT_CWD","config","loadConfig","packageCompileTscTypes","undefined","deepMerge","target","source","key","Object","keys","Array","isArray","deepMergeObjects","objects","result","obj","cwd","chalk","createProgramFromConfig","DiagnosticCategory","formatDiagnosticsWithColorAndContext","getPreEmitDiagnostics","sys","packageCompileTsc","folder","config","compilerOptionsParam","pkg","process","env","INIT_CWD","cwd","verbose","compilerOptions","getCompilerOptions","outDir","removeComments","skipDefaultLibCheck","skipLibCheck","sourceMap","emitDeclarationOnly","noEmit","validTsExt","files","buildEntries","filter","file","find","ext","endsWith","console","log","chalk","green","length","program","createProgramFromConfig","basePath","exclude","diagnostics","getPreEmitDiagnostics","formattedDiagnostics","formatDiagnosticsWithColorAndContext","getCanonicalFileName","fileName","getCurrentDirectory","getNewLine","sys","newLine","error","emit","reduce","acc","diag","category","DiagnosticCategory","Error","compileFolder","folder","entryMode","options","verbose","outDir","console","log","entry","buildEntries","optionsResult","defineConfig","bundle","cjsInterop","clean","dts","format","silent","sourcemap","splitting","tsconfig","optionsList","Promise","all","Array","isArray","flatMap","result","flat","map","build","tsupOptions","standardLoaders","standardOptions","loader","outExtension","js","skipNodeModulesBundle","target","deepMergeObjects","packageCompileTsup","config","compile","depth","compileForNode","node","src","compileForBrowser","browser","compileForNeutral","neutral","errors","packageCompileTypes","packageCompileTsc","undefined","Object","entries","inEsBuildOptions","esbuildOptions","tsup","platform","reduce","prev","value","packageCompile","inConfig","pkg","process","env","INIT_CWD","console","log","chalk","green","config","loadConfig","publint","tsupResults","packageCompileTsup","packagePublint","packageRecompile","packageClean","packageCompile","packageRecompile","then","value","process","exitCode","catch","reason","console","error","chalk","red"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -183,7 +183,7 @@ declare const packageCompile: (inConfig?: XyConfig) => Promise<number>;
|
|
|
183
183
|
|
|
184
184
|
declare const packageCompileTypes: (inConfig?: XyConfig) => Promise<number>;
|
|
185
185
|
|
|
186
|
-
declare const packageCompileTsc: (
|
|
186
|
+
declare const packageCompileTsc: (folder?: string, config?: XyConfig, compilerOptionsParam?: CompilerOptions) => number;
|
|
187
187
|
|
|
188
188
|
declare const packageCompileTscTypes: (folder?: string, config?: XyConfig, compilerOptionsParam?: CompilerOptions) => number;
|
|
189
189
|
|
package/dist/index.mjs
CHANGED
|
@@ -1418,7 +1418,7 @@ var packageClean = /* @__PURE__ */ __name(async () => {
|
|
|
1418
1418
|
}, "packageClean");
|
|
1419
1419
|
|
|
1420
1420
|
// src/actions/package/compile/compile.ts
|
|
1421
|
-
import
|
|
1421
|
+
import chalk25 from "chalk";
|
|
1422
1422
|
|
|
1423
1423
|
// src/actions/package/publint.ts
|
|
1424
1424
|
import { promises as fs2 } from "node:fs";
|
|
@@ -1469,19 +1469,19 @@ import { build as build2, defineConfig } from "tsup";
|
|
|
1469
1469
|
|
|
1470
1470
|
// src/actions/package/compile/inputs.ts
|
|
1471
1471
|
import { glob as glob2 } from "glob";
|
|
1472
|
-
var getAllInputs = /* @__PURE__ */ __name((folder
|
|
1472
|
+
var getAllInputs = /* @__PURE__ */ __name((folder, ignore = [
|
|
1473
|
+
"**/*.spec.*",
|
|
1474
|
+
"**/*.stories.*",
|
|
1475
|
+
"**/spec/**/*"
|
|
1476
|
+
]) => {
|
|
1473
1477
|
return glob2.sync(`${folder}/**/*.*`, {
|
|
1474
|
-
ignore
|
|
1475
|
-
"**/*.spec.*",
|
|
1476
|
-
"**/*.stories.*",
|
|
1477
|
-
"**/spec/**/*"
|
|
1478
|
-
],
|
|
1478
|
+
ignore,
|
|
1479
1479
|
posix: true
|
|
1480
1480
|
});
|
|
1481
1481
|
}, "getAllInputs");
|
|
1482
1482
|
|
|
1483
1483
|
// src/actions/package/compile/buildEntries.ts
|
|
1484
|
-
var buildEntries = /* @__PURE__ */ __name((folder, entryMode = "single", verbose = false) => {
|
|
1484
|
+
var buildEntries = /* @__PURE__ */ __name((folder, entryMode = "single", excludeSpecAndStory = true, verbose = false) => {
|
|
1485
1485
|
let entries = [];
|
|
1486
1486
|
switch (entryMode) {
|
|
1487
1487
|
case "platform": {
|
|
@@ -1492,7 +1492,7 @@ var buildEntries = /* @__PURE__ */ __name((folder, entryMode = "single", verbose
|
|
|
1492
1492
|
break;
|
|
1493
1493
|
}
|
|
1494
1494
|
case "all": {
|
|
1495
|
-
entries = getAllInputs(folder).filter((entry) => !entry.includes(".spec.") && !entry.includes(".
|
|
1495
|
+
entries = excludeSpecAndStory ? getAllInputs(folder).filter((entry) => !entry.includes(".spec.") && !entry.includes(".stories.")) : getAllInputs(folder, []);
|
|
1496
1496
|
break;
|
|
1497
1497
|
}
|
|
1498
1498
|
default: {
|
|
@@ -1506,11 +1506,9 @@ var buildEntries = /* @__PURE__ */ __name((folder, entryMode = "single", verbose
|
|
|
1506
1506
|
return entries;
|
|
1507
1507
|
}, "buildEntries");
|
|
1508
1508
|
|
|
1509
|
-
// src/actions/package/compile/compileTypes.ts
|
|
1510
|
-
import chalk23 from "chalk";
|
|
1511
|
-
|
|
1512
1509
|
// src/actions/package/compile/packageCompileTscTypes.ts
|
|
1513
1510
|
import { cwd } from "node:process";
|
|
1511
|
+
import chalk23 from "chalk";
|
|
1514
1512
|
import { createProgramFromConfig } from "tsc-prog";
|
|
1515
1513
|
import { DiagnosticCategory, formatDiagnosticsWithColorAndContext, getPreEmitDiagnostics, sys as sys2 } from "typescript";
|
|
1516
1514
|
|
|
@@ -1540,9 +1538,6 @@ var getCompilerOptions = /* @__PURE__ */ __name((options = {}, tsconfig = "tscon
|
|
|
1540
1538
|
var packageCompileTscTypes = /* @__PURE__ */ __name((folder = "src", config2 = {}, compilerOptionsParam) => {
|
|
1541
1539
|
const pkg = process.env.INIT_CWD ?? cwd();
|
|
1542
1540
|
const verbose = config2?.verbose ?? false;
|
|
1543
|
-
if (verbose) {
|
|
1544
|
-
console.log(`Compiling types [${pkg}]`);
|
|
1545
|
-
}
|
|
1546
1541
|
const compilerOptions = {
|
|
1547
1542
|
...getCompilerOptions({
|
|
1548
1543
|
emitDeclarationOnly: true,
|
|
@@ -1566,6 +1561,7 @@ var packageCompileTscTypes = /* @__PURE__ */ __name((folder = "src", config2 = {
|
|
|
1566
1561
|
".d.mts"
|
|
1567
1562
|
];
|
|
1568
1563
|
const files = buildEntries(folder, "all", verbose).filter((file) => validTsExt.find((ext) => file.endsWith(ext)));
|
|
1564
|
+
console.log(chalk23.green(`Compiling Types ${pkg}: ${files.length}`));
|
|
1569
1565
|
const program = createProgramFromConfig({
|
|
1570
1566
|
basePath: pkg ?? cwd(),
|
|
1571
1567
|
compilerOptions,
|
|
@@ -1594,7 +1590,6 @@ var packageCompileTscTypes = /* @__PURE__ */ __name((folder = "src", config2 = {
|
|
|
1594
1590
|
// src/actions/package/compile/compileTypes.ts
|
|
1595
1591
|
var packageCompileTypes = /* @__PURE__ */ __name(async (inConfig = {}) => {
|
|
1596
1592
|
const pkg = process.env.INIT_CWD;
|
|
1597
|
-
console.log(chalk23.green(`Compiling Types ${pkg}`));
|
|
1598
1593
|
const config2 = await loadConfig(inConfig);
|
|
1599
1594
|
return packageCompileTscTypes(void 0, config2);
|
|
1600
1595
|
}, "packageCompileTypes");
|
|
@@ -1624,6 +1619,59 @@ function deepMergeObjects(objects) {
|
|
|
1624
1619
|
}
|
|
1625
1620
|
__name(deepMergeObjects, "deepMergeObjects");
|
|
1626
1621
|
|
|
1622
|
+
// src/actions/package/compile/packageCompileTsc.ts
|
|
1623
|
+
import { cwd as cwd2 } from "node:process";
|
|
1624
|
+
import chalk24 from "chalk";
|
|
1625
|
+
import { createProgramFromConfig as createProgramFromConfig2 } from "tsc-prog";
|
|
1626
|
+
import { DiagnosticCategory as DiagnosticCategory2, formatDiagnosticsWithColorAndContext as formatDiagnosticsWithColorAndContext2, getPreEmitDiagnostics as getPreEmitDiagnostics2, sys as sys3 } from "typescript";
|
|
1627
|
+
var packageCompileTsc = /* @__PURE__ */ __name((folder = "src", config2 = {}, compilerOptionsParam) => {
|
|
1628
|
+
const pkg = process.env.INIT_CWD ?? cwd2();
|
|
1629
|
+
const verbose = config2?.verbose ?? false;
|
|
1630
|
+
const compilerOptions = {
|
|
1631
|
+
...getCompilerOptions({
|
|
1632
|
+
outDir: "dist/types",
|
|
1633
|
+
removeComments: false,
|
|
1634
|
+
skipDefaultLibCheck: true,
|
|
1635
|
+
skipLibCheck: true,
|
|
1636
|
+
sourceMap: false
|
|
1637
|
+
}),
|
|
1638
|
+
...compilerOptionsParam,
|
|
1639
|
+
emitDeclarationOnly: false,
|
|
1640
|
+
noEmit: true
|
|
1641
|
+
};
|
|
1642
|
+
const validTsExt = [
|
|
1643
|
+
".ts",
|
|
1644
|
+
".tsx",
|
|
1645
|
+
".d.ts",
|
|
1646
|
+
".cts",
|
|
1647
|
+
".d.cts",
|
|
1648
|
+
".mts",
|
|
1649
|
+
".d.mts"
|
|
1650
|
+
];
|
|
1651
|
+
const files = buildEntries(folder, "all", verbose).filter((file) => validTsExt.find((ext) => file.endsWith(ext)));
|
|
1652
|
+
console.log(chalk24.green(`Compiling Files ${pkg}: ${files.length}`));
|
|
1653
|
+
const program = createProgramFromConfig2({
|
|
1654
|
+
basePath: pkg ?? cwd2(),
|
|
1655
|
+
compilerOptions,
|
|
1656
|
+
exclude: [
|
|
1657
|
+
"dist",
|
|
1658
|
+
"docs"
|
|
1659
|
+
],
|
|
1660
|
+
files
|
|
1661
|
+
});
|
|
1662
|
+
const diagnostics = getPreEmitDiagnostics2(program);
|
|
1663
|
+
if (diagnostics.length > 0) {
|
|
1664
|
+
const formattedDiagnostics = formatDiagnosticsWithColorAndContext2(diagnostics, {
|
|
1665
|
+
getCanonicalFileName: /* @__PURE__ */ __name((fileName) => fileName, "getCanonicalFileName"),
|
|
1666
|
+
getCurrentDirectory: /* @__PURE__ */ __name(() => folder, "getCurrentDirectory"),
|
|
1667
|
+
getNewLine: /* @__PURE__ */ __name(() => sys3.newLine, "getNewLine")
|
|
1668
|
+
});
|
|
1669
|
+
console.error(formattedDiagnostics);
|
|
1670
|
+
}
|
|
1671
|
+
program.emit();
|
|
1672
|
+
return diagnostics.reduce((acc, diag) => acc + (diag.category === DiagnosticCategory2.Error ? 1 : 0), 0);
|
|
1673
|
+
}, "packageCompileTsc");
|
|
1674
|
+
|
|
1627
1675
|
// src/actions/package/compile/packageCompileTsup.ts
|
|
1628
1676
|
var compileFolder = /* @__PURE__ */ __name(async (folder, entryMode = "single", options, verbose) => {
|
|
1629
1677
|
const outDir = options?.outDir ?? "dist";
|
|
@@ -1697,7 +1745,6 @@ var tsupOptions = /* @__PURE__ */ __name((options = []) => {
|
|
|
1697
1745
|
]);
|
|
1698
1746
|
}, "tsupOptions");
|
|
1699
1747
|
var packageCompileTsup = /* @__PURE__ */ __name(async (config2) => {
|
|
1700
|
-
console.log("packageCompileTsup-types");
|
|
1701
1748
|
const compile2 = config2?.compile;
|
|
1702
1749
|
const verbose = config2?.verbose ?? false;
|
|
1703
1750
|
if (verbose) {
|
|
@@ -1715,7 +1762,8 @@ var packageCompileTsup = /* @__PURE__ */ __name(async (config2) => {
|
|
|
1715
1762
|
if (verbose) {
|
|
1716
1763
|
console.log("Calling packageCompileTscTypes");
|
|
1717
1764
|
}
|
|
1718
|
-
|
|
1765
|
+
let errors = await packageCompileTypes(config2);
|
|
1766
|
+
errors = errors + packageCompileTsc(void 0, config2);
|
|
1719
1767
|
if (errors > 0) {
|
|
1720
1768
|
return errors;
|
|
1721
1769
|
}
|
|
@@ -1758,7 +1806,7 @@ var packageCompileTsup = /* @__PURE__ */ __name(async (config2) => {
|
|
|
1758
1806
|
// src/actions/package/compile/compile.ts
|
|
1759
1807
|
var packageCompile = /* @__PURE__ */ __name(async (inConfig = {}) => {
|
|
1760
1808
|
const pkg = process.env.INIT_CWD;
|
|
1761
|
-
console.log(
|
|
1809
|
+
console.log(chalk25.green(`Compiling ${pkg}`));
|
|
1762
1810
|
const config2 = await loadConfig(inConfig);
|
|
1763
1811
|
const publint2 = config2.publint;
|
|
1764
1812
|
const tsupResults = await packageCompileTsup(config2);
|
|
@@ -1768,62 +1816,6 @@ var packageCompile = /* @__PURE__ */ __name(async (inConfig = {}) => {
|
|
|
1768
1816
|
return publint2 ? await packagePublint(config2) : 0;
|
|
1769
1817
|
}, "packageCompile");
|
|
1770
1818
|
|
|
1771
|
-
// src/actions/package/compile/packageCompileTsc.ts
|
|
1772
|
-
import { cwd as cwd2 } from "node:process";
|
|
1773
|
-
import chalk25 from "chalk";
|
|
1774
|
-
import { createProgramFromConfig as createProgramFromConfig2 } from "tsc-prog";
|
|
1775
|
-
import { DiagnosticCategory as DiagnosticCategory2, formatDiagnosticsWithColorAndContext as formatDiagnosticsWithColorAndContext2, getLineAndCharacterOfPosition, getPreEmitDiagnostics as getPreEmitDiagnostics2 } from "typescript";
|
|
1776
|
-
var packageCompileTsc = /* @__PURE__ */ __name(async (noEmit, config2, compilerOptionsParam) => {
|
|
1777
|
-
const pkg = process.env.INIT_CWD ?? cwd2();
|
|
1778
|
-
const publint2 = config2?.publint ?? true;
|
|
1779
|
-
const verbose = config2?.verbose ?? false;
|
|
1780
|
-
const formatHost = {
|
|
1781
|
-
getCanonicalFileName: /* @__PURE__ */ __name((fileName) => fileName, "getCanonicalFileName"),
|
|
1782
|
-
getCurrentDirectory: /* @__PURE__ */ __name(() => pkg, "getCurrentDirectory"),
|
|
1783
|
-
getNewLine: /* @__PURE__ */ __name(() => "\n", "getNewLine")
|
|
1784
|
-
};
|
|
1785
|
-
if (verbose) {
|
|
1786
|
-
console.log(`Compiling with NoEmit TSC [${pkg}]`);
|
|
1787
|
-
}
|
|
1788
|
-
const compilerOptions = {
|
|
1789
|
-
...getCompilerOptions({
|
|
1790
|
-
outDir: "dist",
|
|
1791
|
-
removeComments: true,
|
|
1792
|
-
rootDir: "src"
|
|
1793
|
-
}),
|
|
1794
|
-
...compilerOptionsParam,
|
|
1795
|
-
...noEmit === void 0 ? {} : {
|
|
1796
|
-
noEmit
|
|
1797
|
-
}
|
|
1798
|
-
};
|
|
1799
|
-
const program = createProgramFromConfig2({
|
|
1800
|
-
basePath: pkg ?? cwd2(),
|
|
1801
|
-
compilerOptions,
|
|
1802
|
-
exclude: [
|
|
1803
|
-
"dist",
|
|
1804
|
-
"docs",
|
|
1805
|
-
"**/*.spec.*",
|
|
1806
|
-
"**/*.stories.*",
|
|
1807
|
-
"src/**/spec/**/*"
|
|
1808
|
-
],
|
|
1809
|
-
include: [
|
|
1810
|
-
"src"
|
|
1811
|
-
]
|
|
1812
|
-
});
|
|
1813
|
-
const results = getPreEmitDiagnostics2(program);
|
|
1814
|
-
for (const diag of results) {
|
|
1815
|
-
const lineAndChar = diag.file ? getLineAndCharacterOfPosition(diag.file, diag.start ?? 0) : {
|
|
1816
|
-
character: 0,
|
|
1817
|
-
line: 0
|
|
1818
|
-
};
|
|
1819
|
-
console.log(chalk25.cyan(`${diag.file?.fileName}:${lineAndChar.line + 1}:${lineAndChar.character + 1}`));
|
|
1820
|
-
console.log(formatDiagnosticsWithColorAndContext2([
|
|
1821
|
-
diag
|
|
1822
|
-
], formatHost));
|
|
1823
|
-
}
|
|
1824
|
-
return results.reduce((prev, diag) => prev + diag.category === DiagnosticCategory2.Error ? 1 : 0, 0) || (publint2 ? await packagePublint() : 0);
|
|
1825
|
-
}, "packageCompileTsc");
|
|
1826
|
-
|
|
1827
1819
|
// src/actions/package/copy-assets.ts
|
|
1828
1820
|
import path5 from "node:path/posix";
|
|
1829
1821
|
import chalk26 from "chalk";
|