Skip to content

Commit

Permalink
fix(workspace-tools): Updated issue with bad map logging
Browse files Browse the repository at this point in the history
  • Loading branch information
sullivanpj committed Nov 27, 2023
1 parent 3134c63 commit 70092a8
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 19 deletions.
36 changes: 20 additions & 16 deletions patches/tsup@8.0.0.patch
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ index 36191e8e511f9cc413d70403ac86c989890f8d65..3f62789299ce916f0cdbc8009a8673c2
interface NormalizedExperimentalDtsConfig {
entry: {
diff --git a/dist/index.js b/dist/index.js
index 2c8ba016932710c259e84a7a070271eb4f73da5b..b61bfa263a2357a8cbadbf020024b967d6bfedfd 100644
index 2c8ba016932710c259e84a7a070271eb4f73da5b..0c88829a4b465021ab4223aba886193da0603705 100644
--- a/dist/index.js
+++ b/dist/index.js
@@ -1590,19 +1590,54 @@ var getOutputExtensionMap = (options, format, pkgType) => {
Expand Down Expand Up @@ -256,7 +256,7 @@ index 2c8ba016932710c259e84a7a070271eb4f73da5b..b61bfa263a2357a8cbadbf020024b967
let diagnostics = _typescript2.default.getPreEmitDiagnostics(program).concat(emitResult.diagnostics);
let diagnosticMessages = [];
diagnostics.forEach((diagnostic) => {
@@ -2287,48 +2347,197 @@ function emitDtsFiles(program, host) {
@@ -2287,48 +2347,201 @@ function emitDtsFiles(program, host) {
}
return fileMapping;
}
Expand Down Expand Up @@ -386,9 +386,13 @@ index 2c8ba016932710c259e84a7a070271eb4f73da5b..b61bfa263a2357a8cbadbf020024b967
+ });
+
+ const fileMapping = emitDtsFiles(program, host, options);
+ logger.info("tsc", `Emitted the following file names: \n${fileMapping
+ ? fileMapping.keys().map((key) => `${key}: ${fileMapping.get(key)}\n`)
+ : "No files were emitted!"}`);
+
+ const fileMappingLog = "No files were emitted!";
+ if (fileMapping) {
+ fileMapping.forEach((value, key) => fileMappingLog += ` -> ${key}: ${value}\n`)
+ }
+
+ logger.info("tsc", `Emitted the following file names: \n${fileMappingLog}`);
+
+ /*const fsMap = await _tsvfs2.createDefaultMapFromNodeModules(parsedTsconfig.options,
+ _typescript2.default,
Expand Down Expand Up @@ -436,7 +440,8 @@ index 2c8ba016932710c259e84a7a070271eb4f73da5b..b61bfa263a2357a8cbadbf020024b967
+ }*/
+
+ return getExports(options, program, fileMapping);
+}
}
-function runTypeScriptCompiler(options) {
+
+
+function getSystem(
Expand All @@ -455,8 +460,7 @@ index 2c8ba016932710c259e84a7a070271eb4f73da5b..b61bfa263a2357a8cbadbf020024b967
+ return ts.sys.readFile(path, encoding);
+ },
+ };
}
-function runTypeScriptCompiler(options) {
+}
+
+async function runTypeScriptCompiler(options) {
try {
Expand All @@ -475,7 +479,7 @@ index 2c8ba016932710c259e84a7a070271eb4f73da5b..b61bfa263a2357a8cbadbf020024b967
logger.success("tsc", `\u26A1\uFE0F Build success in ${getDuration()}`);
return exports;
} catch (error) {
@@ -2428,40 +2637,86 @@ function formatDistributionExport(declaration, dest) {
@@ -2428,40 +2641,86 @@ function formatDistributionExport(declaration, dest) {

// src/api-extractor.ts
var logger2 = _chunk7G76EW2Rjs.createLogger.call(void 0, );
Expand Down Expand Up @@ -573,7 +577,7 @@ index 2c8ba016932710c259e84a7a070271eb4f73da5b..b61bfa263a2357a8cbadbf020024b967
const extractorResult = Extractor.invoke(extractorConfig, {
// Equivalent to the "--local" command-line parameter
localBuild: true,
@@ -2475,33 +2730,52 @@ function rollupDtsFile(inputFilePath, outputFilePath, tsconfigFilePath) {
@@ -2475,33 +2734,52 @@ function rollupDtsFile(inputFilePath, outputFilePath, tsconfigFilePath) {
}
}
async function rollupDtsFiles(options, exports, format) {
Expand Down Expand Up @@ -634,7 +638,7 @@ index 2c8ba016932710c259e84a7a070271eb4f73da5b..b61bfa263a2357a8cbadbf020024b967
);
}
}
@@ -2592,11 +2866,14 @@ var normalizeOptions = async (logger3, optionsFromConfigFile, optionsOverride) =
@@ -2592,11 +2870,14 @@ var normalizeOptions = async (logger3, optionsFromConfigFile, optionsOverride) =
options.entry = entry;
logger3.info("CLI", `Building entry: ${JSON.stringify(entry)}`);
}
Expand All @@ -651,7 +655,7 @@ index 2c8ba016932710c259e84a7a070271eb4f73da5b..b61bfa263a2357a8cbadbf020024b967
);
options.tsconfig = tsconfig.path;
options.tsconfigResolvePaths = _optionalChain([tsconfig, 'access', _20 => _20.data, 'optionalAccess', _21 => _21.compilerOptions, 'optionalAccess', _22 => _22.paths]) || {};
@@ -2610,7 +2887,8 @@ var normalizeOptions = async (logger3, optionsFromConfigFile, optionsOverride) =
@@ -2610,7 +2891,8 @@ var normalizeOptions = async (logger3, optionsFromConfigFile, optionsOverride) =
if (options.experimentalDts) {
options.experimentalDts.compilerOptions = {
...tsconfig.data.compilerOptions || {},
Expand All @@ -661,7 +665,7 @@ index 2c8ba016932710c259e84a7a070271eb4f73da5b..b61bfa263a2357a8cbadbf020024b967
};
options.experimentalDts.entry = _chunkGQ77QZBOjs.toObjectEntry.call(void 0,
Object.keys(options.experimentalDts.entry).length > 0 ? options.experimentalDts.entry : options.entry
@@ -2629,7 +2907,7 @@ var normalizeOptions = async (logger3, optionsFromConfigFile, optionsOverride) =
@@ -2629,7 +2911,7 @@ var normalizeOptions = async (logger3, optionsFromConfigFile, optionsOverride) =
};
async function build(_options) {
const config = _options.config === false ? {} : await _chunk7G76EW2Rjs.loadTsupConfig.call(void 0,
Expand All @@ -670,7 +674,7 @@ index 2c8ba016932710c259e84a7a070271eb4f73da5b..b61bfa263a2357a8cbadbf020024b967
_options.config === true ? void 0 : _options.config
);
const configData = typeof config.data === "function" ? await config.data(_options) : config.data;
@@ -2652,7 +2930,7 @@ async function build(_options) {
@@ -2652,7 +2934,7 @@ async function build(_options) {
);
}
if (options.experimentalDts) {
Expand All @@ -679,7 +683,7 @@ index 2c8ba016932710c259e84a7a070271eb4f73da5b..b61bfa263a2357a8cbadbf020024b967
await runDtsRollup(options, exports);
}
if (options.dts) {
@@ -2695,7 +2973,7 @@ async function build(_options) {
@@ -2695,7 +2977,7 @@ async function build(_options) {
let onSuccessProcess;
let onSuccessCleanup;
const buildDependencies = /* @__PURE__ */ new Set();
Expand All @@ -688,7 +692,7 @@ index 2c8ba016932710c259e84a7a070271eb4f73da5b..b61bfa263a2357a8cbadbf020024b967
const doOnSuccessCleanup = async () => {
if (onSuccessProcess) {
await killProcess({
@@ -2816,7 +3094,7 @@ async function build(_options) {
@@ -2816,7 +3098,7 @@ async function build(_options) {
let shouldSkipChange = false;
if (options.watch === true) {
if (file === "package.json" && !buildDependencies.has(file)) {
Expand Down
6 changes: 3 additions & 3 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 70092a8

Please sign in to comment.