From 4874960eff7c9335d51c375ea858bca992c9e5f8 Mon Sep 17 00:00:00 2001 From: Patrick Sullivan Date: Thu, 16 Nov 2023 01:10:01 -0500 Subject: [PATCH] fix(workspace-tools): Update tsup patch to use the logger --- .../src/executors/tsup/get-config.ts | 2 ++ patches/tsup@7.2.0.patch | 20 ++++++++++--------- pnpm-lock.yaml | 6 +++--- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/packages/workspace-tools/src/executors/tsup/get-config.ts b/packages/workspace-tools/src/executors/tsup/get-config.ts index 84d46a0b7..5822e81a1 100644 --- a/packages/workspace-tools/src/executors/tsup/get-config.ts +++ b/packages/workspace-tools/src/executors/tsup/get-config.ts @@ -33,6 +33,7 @@ export function modernConfig( : ["esnext", "node18"], tsconfig, outDir: joinPathFragments(outDir, "dist", "modern"), + silent: false, metafile: true, minify: false, bundle, @@ -60,6 +61,7 @@ export function legacyConfig( target: ["es2022", "node18"], tsconfig, outDir: joinPathFragments(outDir, "dist", "legacy"), + silent: false, metafile: true, shims: true, minify: false, diff --git a/patches/tsup@7.2.0.patch b/patches/tsup@7.2.0.patch index 16ac1498c..76fc3d1c9 100644 --- a/patches/tsup@7.2.0.patch +++ b/patches/tsup@7.2.0.patch @@ -1,41 +1,43 @@ diff --git a/dist/index.js b/dist/index.js -index 68c197cb2b8dfa928a448475b4020e7301da959e..426559111d4475c7e4fecc69217d037e9ff0c516 100644 +index 68c197cb2b8dfa928a448475b4020e7301da959e..7df518683ef812a3bc309f4bfdbcbcbb2bd57ed1 100644 --- a/dist/index.js +++ b/dist/index.js -@@ -1605,8 +1605,30 @@ async function runEsbuild(options, { +@@ -1605,8 +1605,32 @@ async function runEsbuild(options, { buildDependencies, pluginContainer }) { - const pkg = await _chunk52KWB5QBjs.loadPkg.call(void 0, process.cwd()); - const deps = await _chunk52KWB5QBjs.getProductionDeps.call(void 0, process.cwd()); ++ logger.info("⚡ Preparing to run ESBuild"); ++ + let pkgPath = options.outDir + ? options.outDir + : process.cwd(); -+ console.error("Original pkgPath: ", pkgPath); ++ logger.error("Original pkgPath: ", pkgPath); + if (pkgPath) { + const splits = pkgPath.split(_path2.default.sep); -+ console.error("splits: ", splits); ++ logger.error("splits: ", splits); + if (splits.length > 0) { + const pkgPathIndex = splits.slice(0, splits.length) + .findLastIndex(index => + existsSync(_path2.default.join(splits.slice(0, index) + .join(_path2.default.sep), "package.json"))); -+ console.error("pkgPathIndex: ", pkgPathIndex); ++ logger.error("pkgPathIndex: ", pkgPathIndex); + if (pkgPathIndex) { + pkgPath = splits.slice(0, pkgPathIndex).join(_path2.default.sep); -+ console.error("Updated pkgPath: ", pkgPath); ++ logger.error("Updated pkgPath: ", pkgPath); + } + } + } + -+ console.error("Final pkgPath: ", pkgPath); ++ logger.error("Final pkgPath: ", pkgPath); + const pkg = await _chunk52KWB5QBjs.loadPkg.call(void 0, pkgPath); -+ console.error("pkg: ", pkg); ++ logger.error("pkg: ", pkg); + const deps = await _chunk52KWB5QBjs.getProductionDeps.call(void 0, pkgPath); const external = [ // Exclude dependencies, e.g. `lodash`, `lodash/get` ...deps.map((dep) => new RegExp(`^${dep}($|\\/|\\\\)`)), -@@ -2052,6 +2074,7 @@ var sizeReporter = () => { +@@ -2052,6 +2076,7 @@ var sizeReporter = () => { // src/plugins/tree-shaking.ts var import_rollup_plugin_hashbang = _chunkB7UJSB4Njs.__toESM.call(void 0, _chunk52KWB5QBjs.require_dist.call(void 0, )); var _rollup = require('rollup'); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 78cf281bc..9a5e4d2f7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -19,7 +19,7 @@ patchedDependencies: hash: sdh76cbs3s6gimrygngciaff4a path: patches/semantic-release@22.0.7.patch tsup@7.2.0: - hash: ggqmsp2frk5q4ngo6vbtjnv53y + hash: 5m5luxqme2sqxxdqzzm4g2vcnq path: patches/tsup@7.2.0.patch importers: @@ -506,7 +506,7 @@ importers: version: 2.6.2 tsup: specifier: 7.2.0 - version: 7.2.0(patch_hash=ggqmsp2frk5q4ngo6vbtjnv53y)(@swc/core@1.3.96)(ts-node@10.9.1)(typescript@5.2.2) + version: 7.2.0(patch_hash=5m5luxqme2sqxxdqzzm4g2vcnq)(@swc/core@1.3.96)(ts-node@10.9.1)(typescript@5.2.2) packages: /@aashutoshrathi/word-wrap@1.2.6: @@ -19895,7 +19895,7 @@ packages: engines: { node: ">=0.6.x" } dev: false - /tsup@7.2.0(patch_hash=ggqmsp2frk5q4ngo6vbtjnv53y)(@swc/core@1.3.96)(ts-node@10.9.1)(typescript@5.2.2): + /tsup@7.2.0(patch_hash=5m5luxqme2sqxxdqzzm4g2vcnq)(@swc/core@1.3.96)(ts-node@10.9.1)(typescript@5.2.2): resolution: { integrity: sha512-vDHlczXbgUvY3rWvqFEbSqmC1L7woozbzngMqTtL2PGBODTtWlRwGDDawhvWzr5c1QjKe4OAKqJGfE1xeXUvtQ==