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.03k stars 1.19k forks source link

[engsys][samples] guide or steps on how to verify if the samples have compile issue #30801

Open MaryGao opened 3 weeks ago

MaryGao commented 3 weeks ago

According to the doc , I notice that we have commands to publish samples with dev-tool samples publish or execute samples with dev-tool samples run. But we don't have a command to build the samples. Could we provide any guides or build a command on how to build samples in esm + tshy project?

This will be helpful in mgmt because most samples are auto-generated and we may not run them one by one, this could help us to ensure no compile issue.

Also we could enable the publish and build check in ci to ensure the latest and no compile issues in samples.

MaryGao commented 3 weeks ago

@jeremymeng @xirzec Could you help on this?

kazrael2119 commented 3 weeks ago

@jeremymeng Is this expected? When I tried to run dev-tool samples run samples-dev, I got the following error message in our letest MPG client which is tshy + esm project? image

more details are in https://github.com/Azure/azure-sdk-for-js/pull/30802

jeremymeng commented 3 weeks ago

Yes, the samples execution is not working now for packages that have migrated to ESM: https://github.com/Azure/azure-sdk-for-js/issues/29672. I have explored some other approaches but don't have an ETA for fixing it yet.

The original design was that code under samples-dev can be run run directly by the dev-tool samples run command. Packages the build samples can also use the same command to run them from dist-samples (storage packages still do that).

jeremymeng commented 3 weeks ago

But we don't have a command to build the samples. Could we provide any guides or build a command on how to build samples in esm + tshy project?

is samples-dev usually not included in the src list of tsconfig.json? I remember we also have another work item to do type checking for tests when build command doesn't build tests folders. samples could be a part of that too.

jeremymeng commented 3 weeks ago

I opened https://github.com/Azure/azure-sdk-for-js/pull/30810. @MaryGao do you think it will help?