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: add pacote to resolve template name instead of arborist workaround #1115

Closed
wants to merge 11 commits into from

Conversation

akkshitgupta
Copy link

Description

  • add pacote dependency
  • cleanup arbortis mock and add new one for pacote
  • modify generator.js as suggested

Related issue(s) fixes: #1102

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.

lib/generator.js Outdated Show resolved Hide resolved
@derberg derberg changed the title chore: add pacote refactor: add pacote to resolve template name instead of arborist workaround Feb 13, 2024
Copy link

Quality Gate Passed Quality Gate passed

Issues
0 New issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@@ -0,0 +1,9 @@
const pacote = jest.genMockFromModule('pacote');
Copy link
Member

Choose a reason for hiding this comment

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

tests complain

ENOENT: no such file or directory, open 'node:fs/promises'

can you have a look?

Copy link
Author

Choose a reason for hiding this comment

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

It seems very weird to me. In my investigation, all the tests are running fine if I am not installing the pacote module and keeping all other things untouched.

When I run npm i pacote before running the tests, I get the same error. I need to figure out the possible reason.

Copy link
Author

Choose a reason for hiding this comment

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

The node version is the culprit here: #1115 (comment)

Also, several dependencies are deprecated, which results in failing tests. The project needs to be upgraded to a newer node version with updated dependencies. I suggest updating all the project dependencies to updated versions based on our requirements.

WDYT @derberg How should we move forward?

@lmgyuan
Copy link
Collaborator

lmgyuan commented Apr 19, 2024

@derberg @akkshitgupta Can you try deprecating the version of pacote to 15.1.1 in the package.js? I tried it in my copied branch of my forked repository, and it seems to pass the ubuntu test after I deprecated it.

Screenshot 2024-04-18 at 11 56 01 PM

Link to my PR
Screenshot 2024-04-18 at 11 56 38 PM

@derberg
Copy link
Member

derberg commented Apr 22, 2024

let's maybe wait for #1069 that will release new generator major release dropping support for older nodes where pacote may have issues?

@derberg
Copy link
Member

derberg commented Apr 24, 2024

@akkshitgupta please solve merge conflicts

@akkshitgupta
Copy link
Author

akkshitgupta commented Apr 25, 2024

Hello @derberg, after resolving conflicts, I am getting this error while running test while it was not the case before merging master. Can you have a look at here

image

Copy link
Member

derberg commented Apr 25, 2024

yeah, knows issue, here is a fix #1202

@derberg
Copy link
Member

derberg commented Apr 29, 2024

@akkshitgupta you can update your PR. There is a conflict with package-lock. Just solve it locally by running npm install with verbose flag, of course after first merging latest upstream to your branch, the installation will update package-lock

@derberg
Copy link
Member

derberg commented May 13, 2024

@akkshitgupta please have a look into failing tests

Copy link

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@akkshitgupta
Copy link
Author

Hey @derberg, its working now. It was an issue on the server side. on the previous update, there some network issue.test failed because of improper dependency installation.

@derberg
Copy link
Member

derberg commented May 13, 2024

@akkshitgupta still failing

@akkshitgupta
Copy link
Author

Apologies for the delay @derberg. I couldn't pay much attention due to some problems. I looked into it, but couldn't find the reason. i guess, it is failing because of the template version and I don't know how tk solve it.

@Gmin2
Copy link
Collaborator

Gmin2 commented Jul 1, 2024

Hey @akkshitgupta please resolve the conflicts, just change the file structure

@Gmin2
Copy link
Collaborator

Gmin2 commented Jul 24, 2024

Hey @akkshitgupta your test are failing, please resolve it and feel free to ask for any help if yu need

derberg
derberg previously approved these changes Jul 24, 2024
Copy link
Member

@derberg derberg left a comment

Choose a reason for hiding this comment

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

@akkshitgupta you need to add pacote to package.json in apps/generator

@derberg
Copy link
Member

derberg commented Jul 29, 2024

@akkshitgupta you need to solve conflicts

Copy link

changeset-bot bot commented Jul 29, 2024

⚠️ No Changeset found

Latest commit: fcc7dce

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

@derberg
Copy link
Member

derberg commented Jul 30, 2024

@akkshitgupta tests are failing for some strange reasons. Please consult chatgpt that gives some hints that you need to try out. Basically something related to mock and jest config

@derberg
Copy link
Member

derberg commented Aug 11, 2024

@akkshitgupta do you plan to continue with this one?

@akkshitgupta
Copy link
Author

Apologies @derberg
Being occupied, I wasn't able to pay much attention to the issue for a while now, unfortunately.
someone else can take it up.

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
4 participants