Skip to content
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

Azure Purview Scanning Sample Issue #18878

Closed
v-jiaodi opened this issue Nov 30, 2021 · 1 comment · Fixed by #20391
Closed

Azure Purview Scanning Sample Issue #18878

v-jiaodi opened this issue Nov 30, 2021 · 1 comment · Fixed by #20391
Assignees
Labels
Client This issue points to a problem in the data-plane of the library. dev-tool Issues related to the Azure SDK for JS dev-tool Docs Purview test-manual-pass
Milestone

Comments

@v-jiaodi
Copy link
Member

Section link:

image

Reason:
Cannot use both import and require in a .js file

Suggestion:
Update import PurviewScanning, { paginate } from "@azure-rest/purview-scanning";
to const {default:PurviewScanning, paginate } = require("@azure-rest/purview-scanning");

@ramya-rao-a , @mikekistler, @lmazuel and @qiaozha for notification.

@ghost ghost added the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Nov 30, 2021
@v-xuto v-xuto added Client This issue points to a problem in the data-plane of the library. needs-team-triage Workflow: This issue needs the team to triage. Purview test-manual-pass and removed needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. labels Nov 30, 2021
@ramya-rao-a ramya-rao-a added this to the [2022] January milestone Nov 30, 2021
@ramya-rao-a ramya-rao-a removed the needs-team-triage Workflow: This issue needs the team to triage. label Nov 30, 2021
@joheredi
Copy link
Member

The ts-to-js in the sample generator doesn't know how to handle default imports.

@willmtemple, I was thinking we can add a couple of new replacements in the tsToJs.ts util, what do you think about something like this:

  // Handles default imports
  // import foo from  -> const foo = require("...").default;
  [/import\s+([^\s]+)\s+from\s*("[^"]+");/g, "const $1 = require($2).default;"],
  // Handles default imports and named imports
  // import foo, {bar, baz} from  -> const {default: foo, bar, baz} = require("...").default;
  [/import\s+([^\s]+),\s+{([^}]+)}\s+from\s*("[^"]+");/g, "const {default: $1, $2} = require($3);"]

@witemple-msft witemple-msft added the dev-tool Issues related to the Azure SDK for JS dev-tool label Feb 10, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Apr 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Client This issue points to a problem in the data-plane of the library. dev-tool Issues related to the Azure SDK for JS dev-tool Docs Purview test-manual-pass
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants