-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[DevTool] sample publish doesn't work #19594
Comments
@qiaozha the error means that if (dataSources.body.entityDefs) {
console.log(dataSources.body.entityDefs.map(...)
} @witemple-msft there seems to be some minor bug in the suggested replacement. |
@jeremymeng Yes, the suggestions can only go so far if the expression is highly compound. Your alternative is probably what I'd write as well. The other two errors are caused by this This can be fixed by rewriting them as @qiaozha I will take a look through these samples and make a PR. |
as this default export is related to RLC. @joheredi can you take a look at it ? Thanks |
@witemple-msft we use default exports for Rest Clients. How should we import in our samples? import * as PurviewCatalog from "@azure-rest/purview-catalog";
const PurviewCatalogClient = PurviewCatalog.default; Would it be possible to add some metadata to the default import to tell the |
@joheredi Do you think it's safe to simply assume that if the package's namespace is The problem is that without the metadata you're describing, it's impossible for me to know if a "Default Import" in typescript represents a true ES default import (binding the export named |
Currently I only allow it for relative modules and node builtins, but we could add an allow list or something if it's really necessary, but I think the best solution is to just decide which Azure SDK packages to allow to use default exports. They're forbidden in convenience-layer SDKs, for example (because of how they interact strangely with CommonJS). |
@joheredi Should we remove the default export in RLC if that's the case ? |
@witemple-msft I think it would be safe to allow default imports for @azure-rest. I'd be okay also if we disallow by default and add metadata in our samples something like. Either way should be okay // @dev-tool default-import
import FooClient from "@azure-rest/foo @qiaozha I don't think we should remove default exports for RLC, it looks like the dev-tool could whitelist @azure-rest or take metadata to allow default imports in the samples |
@joheredi Alright. I'll put up a patch to allow default imports for anything in any |
it will report errors like this
when you run
dev-tool samples publish -f
now.which is probably caused by https://github.com/Azure/azure-sdk-for-js/pull/19496/files this PR.
The text was updated successfully, but these errors were encountered: