-
Notifications
You must be signed in to change notification settings - Fork 21
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: re-organize code #143
Conversation
Can you share the goal of this pull request before any reviews? |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #143 +/- ##
==========================================
- Coverage 86.73% 86.30% -0.43%
==========================================
Files 39 53 +14
Lines 2540 2666 +126
==========================================
+ Hits 2203 2301 +98
- Misses 337 365 +28
☔ View full report in Codecov by Sentry. |
This comment was marked as outdated.
This comment was marked as outdated.
The functions in |
12624bf
to
78c4e1c
Compare
It's impossible for me to review this pull request. It's 215 commits with 2000 lines. I recommend splitting the pull request into multiple pull requests. |
let command = if let Some(script) = manifest.script("start", true)? { | ||
script | ||
} else { | ||
"node server.js" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is wrong. We need to check for server.js. Here's the error code from pnpm
ERR_PNPM_NO_SCRIPT_OR_SERVER Missing script start or file server.js
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since I didn't write this code and it's not related to the goal of refactoring, I have created an issue ticket: #154
The PR is about restructuring the codebase. Not sure how splitting them is going to work. You can read the summary at the top to get an idea of what it does. These bullet points closely depend on each other. |
Co-authored-by: Zoltan Kochan <[email protected]>
I think it is too late now to split this PR. In the future try to avoid such big PRs. If a PR's goal is to reorganize code then ideally it should only contain changes to file locations and/or parts of code moved between files. With no other changes. |
pub manifest: &'a mut PackageManifest, | ||
pub lockfile: Option<&'a Lockfile>, | ||
pub list_dependency_groups: ListDependencyGroups, // must be a function because it is called multiple times | ||
pub package_name: &'a str, // TODO: 1. support version range, 2. multiple arguments, 3. name this `packages` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is not a package name because it may have a version or a tag specified too. Like express@1
.
in pnpm will call it package_specifier
or package_spec
. I think npm calls it a package spec.
and I think Yarn calls it package_descriptor
.
I would recommend using pnpm's naming conventions. If we decide to change some conventions, then we should change in both repositories.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right now, it is package_name
. The name would change once we add version range to pacquet add
, but right now, it only functions as a package name.
I will not post more comments as I don't know what code was just moved and what code is new. I am fine with merging it but in the future let's try to avoid mixing code changes and reorganization in a single PR. And let's try to make smaller PRs. |
@anonrig how do you feel about merging this? |
It includes refactoring and new changes that I'm not comfortable with merging. We should split refactoring and new features into separate pull requests. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's impossible to review this pull request due to the size and commit count. Please open separate pull request for refactoring and different pull request for each feature.
I object. The "features" are interdependent. Separating them will cause merge conflict. |
@KSXGitHub The pull request title and description does not mention this new features. How can a reviewer look through 200 commits and properly review them? |
@anonrig #158 is the state of this PR right before @zkochan wrote this comment. BTW, I have notified you guys in the Discord channel at the very moment this PR was drafted, and I've been pushing commits continuously since. I believe that GitHub should notifies you guys on each commit? |
@anonrig I think there is a misunderstanding here. This PR does not contain any changes to the CLI behaviour. All the changes that were done are in the PR description. Maybe there was a way to do these changes in multiple PRs but now it is too late. There's no easy way to split them and I don't think we want @KSXGitHub to spend time on reapplying the changes from scratch. I want to assure you that @KSXGitHub is a dedicated contributor that works on pnpm full time, so if we miss something in this PR, Khải will be there to work on the fixes. |
Summary
pacquet_package_manager
.pacquet add
reuses the algorithm frompacquet install
.pacquet add
creates an in-memorypackage.json
and pass it to theInstall
subroutine.crates/cli
into proper integration tests that invoke thepacquet
binary.cargo test
.set_current_dir
have been replaced by either integration tests or dependency injection.cargo test
.thiserror
has been completely removed.derive_more
is used in its stead.thiserror
cannot handle generic trait bound.derive_more
is already used to generate custom string types in the lockfile.pacquet_package_json::PackageJson
has been renamed topacquet_package_manifest::PackageManifest
.