From 5c8485d09ffec60ad4965ced62f4595890cb7535 Mon Sep 17 00:00:00 2001 From: Brian Madison Date: Sat, 21 Jun 2025 14:55:44 -0500 Subject: [PATCH] fix: resolve web bundles directory path when using relative paths in NPX installer When users enter "." as the installation directory, the web bundles directory path was not being resolved correctly, causing the bundles to not be copied. This fix ensures the web bundles directory is resolved using the same logic as the main installation directory, resolving relative paths from the original working directory where npx was executed. --- tools/installer/lib/installer.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tools/installer/lib/installer.js b/tools/installer/lib/installer.js index e5a5082b..3ea29140 100644 --- a/tools/installer/lib/installer.js +++ b/tools/installer/lib/installer.js @@ -350,7 +350,12 @@ class Installer { // Install web bundles if requested if (config.includeWebBundles && config.webBundlesDirectory) { spinner.text = "Installing web bundles..."; - await this.installWebBundles(config.webBundlesDirectory, config, spinner); + // Resolve web bundles directory using the same logic as the main installation directory + const originalCwd = process.env.INIT_CWD || process.env.PWD || process.cwd(); + let resolvedWebBundlesDir = path.isAbsolute(config.webBundlesDirectory) + ? config.webBundlesDirectory + : path.resolve(originalCwd, config.webBundlesDirectory); + await this.installWebBundles(resolvedWebBundlesDir, config, spinner); } // Set up IDE integration if requested @@ -608,7 +613,12 @@ class Installer { if (config.includeWebBundles && config.webBundlesDirectory) { const bundleInfo = this.getWebBundleInfo(config); - console.log(chalk.green(`✓ Web bundles (${bundleInfo}) installed to: ${config.webBundlesDirectory}`)); + // Resolve the web bundles directory for display + const originalCwd = process.env.INIT_CWD || process.env.PWD || process.cwd(); + const resolvedWebBundlesDir = path.isAbsolute(config.webBundlesDirectory) + ? config.webBundlesDirectory + : path.resolve(originalCwd, config.webBundlesDirectory); + console.log(chalk.green(`✓ Web bundles (${bundleInfo}) installed to: ${resolvedWebBundlesDir}`)); } if (ides.length > 0) {