From a3af724bfe7a48cf7adf3ed19898eb43e80f6e24 Mon Sep 17 00:00:00 2001 From: Anthony Fu Date: Sat, 14 Sep 2024 22:06:16 +0200 Subject: [PATCH] fix(vscode): ignore special protocols for engine version bumpping --- src/addons/vscode.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/addons/vscode.ts b/src/addons/vscode.ts index 0189c8c..de878e0 100644 --- a/src/addons/vscode.ts +++ b/src/addons/vscode.ts @@ -9,13 +9,19 @@ export const addonVSCode: Addon = { return } - const version = pkg.raw.dependencies?.['@types/vscode'] + const version: string = pkg.raw.dependencies?.['@types/vscode'] || pkg.raw.devDependencies?.['@types/vscode'] || pkg.raw.peerDependencies?.['@types/vscode'] + || '' + + // Protocols like `workspace:` and `catalog:`, we skip them + if (version.includes(':')) { + return + } if (version && pkg.raw.engines?.vscode !== version) { // eslint-disable-next-line no-console - console.log(`[addon] Updated VS Code engine field to ${version}`) + console.log(`[taze addon] Updated VS Code engine field to ${version}`) // If the version is not a range (fixed version), we prepend it with a caret pkg.raw.engines.vscode = /[>^<:~]/.test(version) ? version : `^${version}` }