Fix resolver crash and handling name limits #10924
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?
This PR addresses issue #9020. It attempts to resolve the problem by dividing the data into smaller chunks and then combining them using a XOR operation. However, I am open to suggestions if there is a more optimal method to accomplish this.
Additionally, I have standardized the maximum name length across both the parser and the init command to align with npm's requirements. According to the npm documentation (https://docs.npmjs.com/cli/v10/configuring-npm/package-json#name), the maximum length for a package name is 214 characters. This standardization was necessary but had not been previously included in our implementation (in both package_json.zig and init_command.zig)
To further enhance usability, I've implemented retries for cases where the name length does not meet this limit. This should help ensure that users are able to correct the input without having to restart the process entirely.
How did you verify your code works?
I tested with the provided package.json, and different new project configs