Azure / azure-sdk-for-js

This repository is for active development of the Azure SDK for JavaScript (NodeJS & Browser). For consumers of the SDK we recommend visiting our public developer docs at https://docs.microsoft.com/javascript/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-js.
MIT License
2.1k stars 1.21k forks source link

Adopt vendored commands #27909

Open deyaaeldeen opened 1 year ago

deyaaeldeen commented 1 year ago

The current setup of our libraries involves various npm scripts, such as "clean", "build", "format", among others, utilizing third-party development dependencies like rollup, typescript, api-extractor, prettier, rimraf, etc. This approach in our mono-repository presents several challenges:

  1. The need to individually update each package.json file for upgrading development dependencies.
  2. Inconsistent versions of development dependencies across libraries, leading to potential discrepancies in experience and unnecessary duplication of dependencies.
  3. Lack of uniformity in npm scripts across libraries, contributing to the aforementioned inconsistency.
  4. Possibility of missing dependencies in the package.json file, as rush may not strictly link only explicitly stated dependencies, thus creating ambiguity about a library's actual requirements and utilization.

To address these issues, I suggest adopt dev-tool vendored commands (the dtx command) for incorporating development dependencies. This approach will standardize the use of these dependencies across all our libraries. For instance, generating an API view for a library would be executed with the following command:

dtx api-extractor run --local

This command would reference the version of api-extractor that dev-tool relies on. By adopting this method, our libraries will not directly depend on individual development dependencies, simplifying management and upgrades, and ensuring a consistent development experience across all libraries.

jeremymeng commented 1 year ago

For api-extractor, I kind of have it here https://github.com/Azure/azure-sdk-for-js/pull/27646

We should be able to have format commands too. Most of the commands are using the same config/ignore config.

xirzec commented 12 months ago

I wonder if we should in general lean into dev-tool providing virtual handling for all/most npm scripts so that all packages have the same entry points but we can override/customize the behavior in dev-tool instead of in the individual package?