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

refactor: added pacote to resolve template name instead of arborist workaround #1287

Closed
wants to merge 1 commit into from

Conversation

ShashwatPS
Copy link

Description

  • Added pacote dependency.
  • Cleaned arbortis mock and added a new one for pacote.
  • Modified generator.js as suggested.

Related issue(s)

Copy link

changeset-bot bot commented Oct 6, 2024

⚠️ No Changeset found

Latest commit: 0712275

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Welcome to AsyncAPI. Thanks a lot for creating your first pull request. Please check out our contributors guide useful for opening a pull request.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.

Copy link

sonarcloud bot commented Oct 6, 2024

if (!addResult) throw new Error('Unable to resolve the name of the added package. It was most probably not added to node_modules successfully');

const packageName = addResult[0].name;
const manifest = await pacote.manifest(this.templateName);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here how errors are handled? If they are not pls. add conditions for that

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pls. remove empty file if its not required

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this empty file also

const generatorReactSdk = require('@asyncapi/generator-react-sdk');
const jsxRuntime = require('react/cjs/react-jsx-runtime.production.min');
var generatorReactSdk = require('@asyncapi/generator-react-sdk');
var jsxRuntime = require('C:/Users/shash/Desktop/generator/node_modules/react/cjs/react-jsx-runtime.production.min.js');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here the file path is compatible to windows OS, if someone is using Linux or Mac. Won't it fail to execute?

@derberg
Copy link
Member

derberg commented Oct 14, 2024

@ShashwatPS do you plan to followup with initial review from @DhairyaMajmudar ?

@derberg
Copy link
Member

derberg commented Oct 21, 2024

no more reaction from contributor

closing

@ShashwatPS feel free to open a new PR if you want to continue. Just make sure to take into account feedback from @DhairyaMajmudar

@derberg derberg closed this Oct 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve arborist (npm installation) to have no hacks
3 participants