From 5719cbdbbd9fbc652b2f3f5773c4d9a2e651c4e3 Mon Sep 17 00:00:00 2001 From: st3phhays Date: Thu, 3 Oct 2024 09:34:22 -0500 Subject: [PATCH] (#422) yarn preview-upgrade improvements This adjust the yarn preview-upgrade command to first remove the yarn.lock file in the chosen repository before upgrading choco-theme. By doing this, it ensures all dependencies are upgraded of choco-theme and not just choco-theme itself. This is desired in most cases. Also, the CCM repository has been added to the list of configs, so that is caught when using the --all or --ccm flag on yarn commands. --- build/data/preview-config.ts | 8 ++++++++ build/preview-upgrade.ts | 7 +++++++ 2 files changed, 15 insertions(+) diff --git a/build/data/preview-config.ts b/build/data/preview-config.ts index 175af27e..489f9e87 100644 --- a/build/data/preview-config.ts +++ b/build/data/preview-config.ts @@ -24,6 +24,14 @@ export const folderMapping: FolderMapping = { isStatiq: true, isAstro: false }, + '--ccm': { + folder: 'choco-licensed-management-ui', + protocol: 'https', + port: 44302, + isStatiq: false, + isAstro: false, + root: '/src/ChocolateySoftware.ChocolateyManagement.Web.Mvc' + }, '--boxstarter': { folder: 'boxstarter.org', port: 5083, diff --git a/build/preview-upgrade.ts b/build/preview-upgrade.ts index 50ed0470..5eb17dff 100644 --- a/build/preview-upgrade.ts +++ b/build/preview-upgrade.ts @@ -51,6 +51,13 @@ const init = async () => { return; // Skip to the next folder } + try { + await fs.rm(`${folderPath}/yarn.lock`, { force: true }); + console.log(`✅ ${folderName} yarn.lock removed`); + } catch (error) { + throw new Error(`Error removing yarn.lock: ${error.message}`); + } + try { const childProcess = spawn(`yarn up choco-theme@${url}`, [], { // stdio: 'inherit', // Use 'inherit' to directly pipe the output to the parent process