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

Resolve dependencies and improve JS support #3779

Merged
merged 14 commits into from
Jun 19, 2024

Conversation

AyanSinhaMahapatra
Copy link
Member

@AyanSinhaMahapatra AyanSinhaMahapatra commented May 16, 2024

This PR adds support for resolving package dependencies with an initial focus on JavaScript npm packages as support by npm and yarn.

In particular:

Tasks

  • Reviewed contribution guidelines
  • PR is descriptively titled 📑 and links the original issue above 🔗
  • Tests pass -- look for a green checkbox ✔️ a few minutes after opening your PR
    Run tests locally to check for errors.
  • Commits are in uniquely-named feature branch and has no merge conflicts 📁
  • Updated documentation pages (if applicable)
  • Updated CHANGELOG.rst (if applicable)

Add parsers for pnpm-lock.yaml v5 and v6,
and shrinkwrap.yaml specs with examples
and package assembly.

Reference: #3766
Signed-off-by: Ayan Sinha Mahapatra <ayansmahapatra@gmail.com>
Apply updates for all npm lockfiles.

Signed-off-by: Ayan Sinha Mahapatra <ayansmahapatra@gmail.com>
Reference: #3780
Signed-off-by: Ayan Sinha Mahapatra <ayansmahapatra@gmail.com>
Reference: #3102
Reference: #1514
Signed-off-by: Ayan Sinha Mahapatra <ayansmahapatra@gmail.com>
Reference: #3746
Signed-off-by: Ayan Sinha Mahapatra <ayansmahapatra@gmail.com>
Reference: #3746
Signed-off-by: Ayan Sinha Mahapatra <ayansmahapatra@gmail.com>
@AyanSinhaMahapatra AyanSinhaMahapatra force-pushed the improve-npm-support branch 2 times, most recently from 02e83da to 3e11778 Compare June 10, 2024 10:02
@pombredanne pombredanne changed the title Add basic pnpm support and improve npm support Resolve dependencies and improve JS support Jun 10, 2024
Copy link
Member

@pombredanne pombredanne left a comment

Choose a reason for hiding this comment

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

Thanks... here are some first nits.

src/packagedcode/models.py Outdated Show resolved Hide resolved
src/packagedcode/npm.py Outdated Show resolved Hide resolved
src/packagedcode/npm.py Outdated Show resolved Hide resolved
src/packagedcode/npm.py Show resolved Hide resolved
src/packagedcode/npm.py Outdated Show resolved Hide resolved
Adds is_direct attribute to differentiate between direct
dependecy relationships and dependencies listed in lockfiles
which have both direct and transitive dependencies together,
which will have is_direct as False.

Reference: #3780
Signed-off-by: Ayan Sinha Mahapatra <ayansmahapatra@gmail.com>
Signed-off-by: Ayan Sinha Mahapatra <ayansmahapatra@gmail.com>
@AyanSinhaMahapatra AyanSinhaMahapatra force-pushed the improve-npm-support branch 2 times, most recently from 74f402d to 82a51c0 Compare June 13, 2024 10:03
Signed-off-by: Ayan Sinha Mahapatra <ayansmahapatra@gmail.com>
Signed-off-by: Ayan Sinha Mahapatra <ayansmahapatra@gmail.com>
Copy link
Member

@pombredanne pombredanne left a comment

Choose a reason for hiding this comment

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

Some final nits... then please merge!

src/packagedcode/models.py Outdated Show resolved Hide resolved
src/packagedcode/models.py Outdated Show resolved Hide resolved
src/packagedcode/models.py Outdated Show resolved Hide resolved
src/packagedcode/models.py Outdated Show resolved Hide resolved
src/packagedcode/npm.py Outdated Show resolved Hide resolved
src/packagedcode/npm.py Outdated Show resolved Hide resolved
src/packagedcode/npm.py Outdated Show resolved Hide resolved
src/packagedcode/npm.py Outdated Show resolved Hide resolved
src/packagedcode/utils.py Outdated Show resolved Hide resolved
src/packagedcode/utils.py Outdated Show resolved Hide resolved
Signed-off-by: Ayan Sinha Mahapatra <ayansmahapatra@gmail.com>
@AyanSinhaMahapatra
Copy link
Member Author

@pombredanne Thanks for your comments, suggestions and improved texts for the attributes. I've added all of them, and now ready to merge.

Fixes a bug where there was remaining double quotes on
namespace and name for dependencies, which was effecting
package resolution.

Signed-off-by: Ayan Sinha Mahapatra <ayansmahapatra@gmail.com>
Copy link
Member

@pombredanne pombredanne left a comment

Choose a reason for hiding this comment

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

Good to merge with just a minor nit wrt. a function name!

src/packagedcode/npm.py Outdated Show resolved Hide resolved
Signed-off-by: Ayan Sinha Mahapatra <ayansmahapatra@gmail.com>
Signed-off-by: Ayan Sinha Mahapatra <ayansmahapatra@gmail.com>
@AyanSinhaMahapatra
Copy link
Member Author

All green, merging! Thanks @pombredanne

@AyanSinhaMahapatra AyanSinhaMahapatra merged commit 2295c7f into develop Jun 19, 2024
32 of 34 checks passed
@AyanSinhaMahapatra AyanSinhaMahapatra deleted the improve-npm-support branch June 19, 2024 14:18
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.

2 participants