fix: solution for issue #19 - #30
Open
adityawaghamare04 wants to merge 1 commit into
Open
Conversation
6 tasks
|
这个 PR 已经 7 天没有新提交、作者也没有回复,它关联任务上的托管因此一直被占着,既不结算也不释放。
PR 不会被关闭——这是你的工作,随时可以接着做。被释放的只是任务上的认领,任务重新开放给其他人。 如果你还在做,回一句就行。 No commits or author replies for 7 days. The claim is released; this PR stays open. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fix & Proposed Solution
Closes #19
🛠️ Proposed Solution (by Aditya Waghamare)
Analysis
The current implementation of
stripPrefixonly allows stripping a single prefix string from destination paths inside a pack. To support complex project layouts (e.g., monorepos or repositories where config, tests, and source code do not share a common root directory), we generalisestripPrefixintoremap.Fix
src/config.mjs:'remap'toKNOWN_KEYS.remapitems: checking string types, enforcing traversal prevention on bothfromandtoinputs.stripPrefixintoremap: [{ from: stripPrefix, to: "" }]whenremapis absent.src/pack.mjs:remaprules sequentially (first match wins).frompath matches at least one file.MANIFEST.json.Init Template & README:
remapexample tosparepack inittemplate and updated documentation inREADME.md.Implementation
1.
src/config.mjs2.
src/pack.mjs3.
README.md(excerpt update)remapis an ordered array; the first matching rule is applied.remapis omitted, legacystripPrefix(string) is still supported as a shorthand.from,to, or resulting paths are rejected.fromvalues cause a hard error.The suite should complete with zero failures, confirming the new
remapfunctionality works as specified.Submitted by Aditya Waghamare
💰 Payout Address (Base L2 / EVM):
0xb61dBcdBc3407F71EaCb64D4CBFAcf9FFfe2415C