Skip to content

Commit

Permalink
Improve list version (#4463)
Browse files Browse the repository at this point in the history
  • Loading branch information
timotheeguerin authored Mar 10, 2022
1 parent 46e690a commit c57f071
Show file tree
Hide file tree
Showing 15 changed files with 312 additions and 327 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"packageName": "@azure-tools/codegen",
"comment": "Bump `semver` dependency",
"type": "patch"
}
],
"packageName": "@azure-tools/codegen",
"email": "tiguerin@microsoft.com"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"packageName": "@azure-tools/extension",
"comment": "Stop using shell call to `yarn` or `npm` to resolve list of available version and use `pactote` library. Improving reliability and performance.",
"type": "minor"
}
],
"packageName": "@azure-tools/extension",
"email": "tiguerin@microsoft.com"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"packageName": "autorest",
"comment": "Cleanup logic with using `--list-available`.",
"type": "minor"
}
],
"packageName": "autorest",
"email": "tiguerin@microsoft.com"
}
107 changes: 50 additions & 57 deletions common/config/rush/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/apps/autorest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
"prettier": "~2.3.1",
"rimraf": "^3.0.2",
"safe-buffer": "5.2.0",
"semver": "^5.5.1",
"semver": "^7.3.5",
"source-map-support": "^0.5.19",
"source-map": "0.7.3",
"ts-jest": "^27.0.3",
Expand Down
8 changes: 1 addition & 7 deletions packages/apps/autorest/src/autorest-as-a-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,7 @@ export async function availableVersions() {
const vers = (await (await extensionManager).getPackageVersions(newCorePackage)).sort((b, a) =>
semver.compare(a, b),
);
const result = new Array<string>();
for (const ver of vers) {
if (semver.satisfies(ver, versionRange)) {
result.push(ver);
}
}
return result;
return vers.filter((x) => semver.satisfies(x, versionRange));
} catch (e) {
console.info(`No available versions of package ${newCorePackage} found.`);
}
Expand Down
Loading

0 comments on commit c57f071

Please sign in to comment.