Skip to content

Update dependency generation to adopt pnpm workspace catalog versions #3172

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
May 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/autorest.typescript/src/autorestSession.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ export interface AutorestOptions {
lenientModelDeduplication?: boolean;
useLegacyLro?: boolean;
flavor?: PackageFlavor;
//TODO should remove this after finish the release tool test
shouldUsePnpmDep?: boolean;
}

let host: AutorestExtensionHost;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ function regularAutorestPackage(
clientDetails: ClientDetails,
packageDetails: PackageDetails
) {
//TODO should remove all the shouldUsePnpmDep codes after finish the release tool test
const {
srcPath,
useCoreV2,
Expand All @@ -61,7 +62,8 @@ function regularAutorestPackage(
generateSample,
coreHttpCompatMode,
azureSdkForJs,
isTestPackage
isTestPackage,
shouldUsePnpmDep
} = getAutorestOptions();
const { model } = getSession();
const { addCredentials } = getSecurityInfoFromModel(model.security);
Expand All @@ -87,18 +89,18 @@ function regularAutorestPackage(
node: ">=18.0.0"
},
dependencies: {
...(hasLro && { "@azure/core-lro": "^2.5.4" }),
...(hasLro && { "@azure/abort-controller": "^2.1.2" }),
...(hasAsyncIterators && { "@azure/core-paging": "^1.6.2" }),
...(useCoreV2 && { "@azure/core-client": "^1.9.2" }),
...(useCoreV2 && addCredentials && { "@azure/core-auth": "^1.9.0" }),
...(hasLro && { "@azure/core-lro": shouldUsePnpmDep && azureSdkForJs ? "catalog:corelrov2" : "^2.5.4" }),
...(hasLro && { "@azure/abort-controller": shouldUsePnpmDep && azureSdkForJs ? "workspace:*" : "^2.1.2" }),
...(hasAsyncIterators && { "@azure/core-paging": shouldUsePnpmDep && azureSdkForJs ? "workspace:*" : "^1.6.2" }),
...(useCoreV2 && { "@azure/core-client": shouldUsePnpmDep && azureSdkForJs ? "workspace:*" : "^1.9.2" }),
...(useCoreV2 && addCredentials && { "@azure/core-auth": shouldUsePnpmDep && azureSdkForJs ? "workspace:*" : "^1.9.0" }),
...(useCoreV2 && {
"@azure/core-rest-pipeline": "^1.19.0"
"@azure/core-rest-pipeline": shouldUsePnpmDep && azureSdkForJs ? "workspace:*" : "^1.19.0"
}),
...(tracingInfo && {
"@azure/core-tracing": "^1.2.0"
"@azure/core-tracing": shouldUsePnpmDep && azureSdkForJs ? "workspace:*" : "^1.2.0"
}),
tslib: "^2.8.1"
tslib: shouldUsePnpmDep && azureSdkForJs ? "workspace:*" : "^2.8.1"
},
keywords: ["node", "azure", "typescript", "browser", "isomorphic", "cloud"],
license: "MIT",
Expand All @@ -109,9 +111,9 @@ function regularAutorestPackage(
devDependencies: {
"@microsoft/api-extractor": "^7.40.3",
mkdirp: "^3.0.1",
typescript: "~5.8.2",
typescript: shouldUsePnpmDep && azureSdkForJs ? "catalog:" : "~5.8.2",
rimraf: "^5.0.0",
dotenv: "^16.0.0"
dotenv: shouldUsePnpmDep && azureSdkForJs ? "catalog:testing" : "^16.0.0"
},
repository: "github:Azure/azure-sdk-for-js",
bugs: {
Expand Down Expand Up @@ -178,7 +180,7 @@ function regularAutorestPackage(
esmDialects: ["browser", "react-native"],
selfLink: false,
};
packageInfo.devDependencies["@azure/dev-tool"] = "^1.0.0";
packageInfo.devDependencies["@azure/dev-tool"] = shouldUsePnpmDep && azureSdkForJs ? "workspace:*" : "^1.0.0";
delete packageInfo.devDependencies["@microsoft/api-extractor"];
delete packageInfo.devDependencies["rimraf"];
delete packageInfo.devDependencies["mkdirp"];
Expand All @@ -202,19 +204,19 @@ function regularAutorestPackage(
}

if (generateTest) {
packageInfo.devDependencies["@azure/identity"] = "^4.6.0";
packageInfo.devDependencies["@azure/logger"] = "^1.1.4";
packageInfo.devDependencies["@azure/identity"] = shouldUsePnpmDep && azureSdkForJs ? "catalog:internal" : "^4.6.0";
packageInfo.devDependencies["@azure/logger"] = shouldUsePnpmDep && azureSdkForJs ? "workspace:*" : "^1.1.4";
// TODO need unify the version when 4.1.0 released
packageInfo.devDependencies["@azure-tools/test-recorder"] = azureSdkForJs ? "^4.1.0" : "^4.0.0";
packageInfo.devDependencies["@azure-tools/test-credential"] = "^2.0.0";
packageInfo.devDependencies["@azure-tools/test-recorder"] = azureSdkForJs ? shouldUsePnpmDep ? "workspace:*" : "^4.1.0" : "^4.0.0";
packageInfo.devDependencies["@azure-tools/test-credential"] = shouldUsePnpmDep && azureSdkForJs ? "workspace:*" : "^2.0.0";
if (azureSdkForJs) {
packageInfo.devDependencies["@azure-tools/test-utils-vitest"] = "^1.0.0";
packageInfo.devDependencies["@azure-tools/test-utils-vitest"] = shouldUsePnpmDep && azureSdkForJs ? "workspace:*" : "^1.0.0";
}
packageInfo.devDependencies["@types/node"] = "^18.0.0";
packageInfo.devDependencies["@vitest/browser"] = "^3.0.9";
packageInfo.devDependencies["@vitest/coverage-istanbul"] = "^3.0.9";
packageInfo.devDependencies["playwright"] = "^1.50.1";
packageInfo.devDependencies["vitest"] = "^3.0.9";
packageInfo.devDependencies["@types/node"] = shouldUsePnpmDep && azureSdkForJs ? "catalog:" : "^18.0.0";
packageInfo.devDependencies["@vitest/browser"] = shouldUsePnpmDep && azureSdkForJs ? "catalog:testing" : "^3.0.9";
packageInfo.devDependencies["@vitest/coverage-istanbul"] = shouldUsePnpmDep && azureSdkForJs ? "catalog:testing" : "^3.0.9";
packageInfo.devDependencies["playwright"] = shouldUsePnpmDep && azureSdkForJs ? "catalog:testing" : "^1.50.1";
packageInfo.devDependencies["vitest"] = shouldUsePnpmDep && azureSdkForJs ? "catalog:testing" : "^3.0.9";

packageInfo.scripts["test"] = "npm run integration-test";
packageInfo.scripts["unit-test"] =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,23 +42,24 @@
]
},
"dependencies": {
"@azure-rest/core-client": "^1.4.0",
"@azure/core-auth": "^1.6.0",
"@azure/core-rest-pipeline": "^1.5.0",
"@azure/logger": "^1.0.0",
"tslib": "^2.6.2",
"@azure/core-lro": "^3.1.0",
"@azure/abort-controller": "^2.1.2"
"@azure-rest/core-client": "^2.1.0",
"@azure/abort-controller": "^2.1.2",
"@azure/core-auth": "^1.9.0",
"@azure/core-lro": "^3.0.0",
"@azure/core-rest-pipeline": "^1.18.2",
"@azure/core-util": "^1.11.0",
"@azure/logger": "^1.1.4",
"tslib": "^2.8.1"
},
"devDependencies": {
"dotenv": "^16.0.0",
"@types/node": "^18.0.0",
"eslint": "^9.9.0",
"typescript": "~5.8.2",
"autorest": "latest",
"source-map-support": "^0.5.9",
"@azure-tools/test-credential": "^2.0.0",
"@azure-tools/test-recorder": "^4.1.0",
"@azure-tools/test-utils-vitest": "^1.0.0",
"@azure/dev-tool": "^1.0.0",
"@azure/eslint-plugin-azure-sdk": "^3.0.0"
"@azure/eslint-plugin-azure-sdk": "^3.0.0",
"@azure/identity": "^4.6.0",
"@types/node": "^18.0.0",
"typescript": "~5.8.2"
},
"scripts": {
"clean": "dev-tool run vendored rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,21 +42,22 @@
]
},
"dependencies": {
"@azure-rest/core-client": "^1.4.0",
"@azure/core-auth": "^1.6.0",
"@azure/core-rest-pipeline": "^1.5.0",
"@azure/logger": "^1.0.0",
"tslib": "^2.6.2"
"@azure-rest/core-client": "^2.1.0",
"@azure/core-auth": "^1.9.0",
"@azure/core-rest-pipeline": "^1.18.2",
"@azure/core-util": "^1.11.0",
"@azure/logger": "^1.1.4",
"tslib": "^2.8.1"
},
"devDependencies": {
"dotenv": "^16.0.0",
"@types/node": "^18.0.0",
"eslint": "^9.9.0",
"typescript": "~5.8.2",
"autorest": "latest",
"source-map-support": "^0.5.9",
"@azure-tools/test-credential": "^2.0.0",
"@azure-tools/test-recorder": "^4.1.0",
"@azure-tools/test-utils-vitest": "^1.0.0",
"@azure/dev-tool": "^1.0.0",
"@azure/eslint-plugin-azure-sdk": "^3.0.0"
"@azure/eslint-plugin-azure-sdk": "^3.0.0",
"@azure/identity": "^4.6.0",
"@types/node": "^18.0.0",
"typescript": "~5.8.2"
},
"scripts": {
"clean": "dev-tool run vendored rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,21 +42,22 @@
]
},
"dependencies": {
"@azure-rest/core-client": "^1.4.0",
"@azure/core-auth": "^1.6.0",
"@azure/core-rest-pipeline": "^1.5.0",
"@azure/logger": "^1.0.0",
"tslib": "^2.6.2"
"@azure-rest/core-client": "^2.1.0",
"@azure/core-auth": "^1.9.0",
"@azure/core-rest-pipeline": "^1.18.2",
"@azure/core-util": "^1.11.0",
"@azure/logger": "^1.1.4",
"tslib": "^2.8.1"
},
"devDependencies": {
"dotenv": "^16.0.0",
"@types/node": "^18.0.0",
"eslint": "^9.9.0",
"typescript": "~5.8.2",
"autorest": "latest",
"source-map-support": "^0.5.9",
"@azure-tools/test-credential": "^2.0.0",
"@azure-tools/test-recorder": "^4.1.0",
"@azure-tools/test-utils-vitest": "^1.0.0",
"@azure/dev-tool": "^1.0.0",
"@azure/eslint-plugin-azure-sdk": "^3.0.0"
"@azure/eslint-plugin-azure-sdk": "^3.0.0",
"@azure/identity": "^4.6.0",
"@types/node": "^18.0.0",
"typescript": "~5.8.2"
},
"scripts": {
"clean": "dev-tool run vendored rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,21 +42,22 @@
]
},
"dependencies": {
"@azure-rest/core-client": "^1.4.0",
"@azure/core-auth": "^1.6.0",
"@azure/core-rest-pipeline": "^1.5.0",
"@azure/logger": "^1.0.0",
"tslib": "^2.6.2"
"@azure-rest/core-client": "^2.1.0",
"@azure/core-auth": "^1.9.0",
"@azure/core-rest-pipeline": "^1.18.2",
"@azure/core-util": "^1.11.0",
"@azure/logger": "^1.1.4",
"tslib": "^2.8.1"
},
"devDependencies": {
"dotenv": "^16.0.0",
"@types/node": "^18.0.0",
"eslint": "^9.9.0",
"typescript": "~5.8.2",
"autorest": "latest",
"source-map-support": "^0.5.9",
"@azure-tools/test-credential": "^2.0.0",
"@azure-tools/test-recorder": "^4.1.0",
"@azure-tools/test-utils-vitest": "^1.0.0",
"@azure/dev-tool": "^1.0.0",
"@azure/eslint-plugin-azure-sdk": "^3.0.0"
"@azure/eslint-plugin-azure-sdk": "^3.0.0",
"@azure/identity": "^4.6.0",
"@types/node": "^18.0.0",
"typescript": "~5.8.2"
},
"scripts": {
"clean": "dev-tool run vendored rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,21 +42,22 @@
]
},
"dependencies": {
"@azure-rest/core-client": "^1.4.0",
"@azure/core-auth": "^1.6.0",
"@azure/core-rest-pipeline": "^1.5.0",
"@azure/logger": "^1.0.0",
"tslib": "^2.6.2"
"@azure-rest/core-client": "^2.1.0",
"@azure/core-auth": "^1.9.0",
"@azure/core-rest-pipeline": "^1.18.2",
"@azure/core-util": "^1.11.0",
"@azure/logger": "^1.1.4",
"tslib": "^2.8.1"
},
"devDependencies": {
"dotenv": "^16.0.0",
"@types/node": "^18.0.0",
"eslint": "^9.9.0",
"typescript": "~5.8.2",
"autorest": "latest",
"source-map-support": "^0.5.9",
"@azure-tools/test-credential": "^2.0.0",
"@azure-tools/test-recorder": "^4.1.0",
"@azure-tools/test-utils-vitest": "^1.0.0",
"@azure/dev-tool": "^1.0.0",
"@azure/eslint-plugin-azure-sdk": "^3.0.0"
"@azure/eslint-plugin-azure-sdk": "^3.0.0",
"@azure/identity": "^4.6.0",
"@types/node": "^18.0.0",
"typescript": "~5.8.2"
},
"scripts": {
"clean": "dev-tool run vendored rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log",
Expand Down
2 changes: 2 additions & 0 deletions packages/rlc-common/src/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,8 @@ export interface RLCOptions {
ignoreEnumMemberNameNormalize?: boolean;
compatibilityQueryMultiFormat?: boolean;
typespecTitleMap?: Record<string, string>;
//TODO should remove this after finish the release tool test
shouldUsePnpmDep?: boolean;
}

export interface ServiceInfo {
Expand Down
4 changes: 3 additions & 1 deletion packages/rlc-common/src/metadata/buildPackageFile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ export function buildPackageFile(
exports,
azureArm: model.options?.azureArm,
isModularLibrary: model.options?.isModularLibrary ?? false,
azureSdkForJs: model.options?.azureSdkForJs
azureSdkForJs: model.options?.azureSdkForJs,
//TODO should remove this after finish the release tool test
shouldUsePnpmDep: model.options?.shouldUsePnpmDep
};

let packageInfo: Record<string, any> = buildFlavorlessPackage(config);
Expand Down
Loading
Loading