Skip to content

Commit

Permalink
(#422) yarn preview-upgrade improvements
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
st3phhays committed Oct 3, 2024
1 parent 875bbfa commit 5719cbd
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
8 changes: 8 additions & 0 deletions build/data/preview-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
7 changes: 7 additions & 0 deletions build/preview-upgrade.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5719cbd

Please sign in to comment.