Skip to content

Commit

Permalink
fix: invalid version when checking vscode engine (#147)
Browse files Browse the repository at this point in the history
  • Loading branch information
hyoban authored Jan 9, 2025
1 parent a778512 commit 13dcf44
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/addons/vscode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ export const addonVSCode: Addon = {
return
}

const minEngineVersion = semver.minVersion(pkg.raw.engines.vscode)
if (!minEngineVersion) {
return
}

const version: string = pkg.raw.dependencies?.['@types/vscode']
|| pkg.raw.devDependencies?.['@types/vscode']
|| pkg.raw.peerDependencies?.['@types/vscode']
Expand All @@ -20,7 +25,7 @@ export const addonVSCode: Addon = {
return
}

if (version && semver.gt(version, pkg.raw.engines.vscode)) {
if (version && semver.gt(version, minEngineVersion)) {
// eslint-disable-next-line no-console
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
Expand Down

0 comments on commit 13dcf44

Please sign in to comment.