Skip to content

Conversation

milaninfy
Copy link
Contributor

@milaninfy milaninfy commented Dec 9, 2024

npm-packlist gets normalized package-json when assessing files to include. when main is specified with relative file path it doesn't consider that entry when including files. Fixing main in normalization step

  • check on changes condition
  • sanity testing
  • check npm pack command with empty files array in package.json
    • arborist node uses read-package-json-fast normalization functionality instead of package-json's normalization flow
  • need to check for read-package-json-fast's normalization logic to replace it with package-json's normalization

Fixes: npm/cli#7799

@milaninfy milaninfy force-pushed the mm/fix-relative-main branch from b9f766d to 92f7aee Compare December 11, 2024 16:08
@wraithgar
Copy link
Member

A big refactor just happened here in anticipation of removing rpjf from arborist node. Note that it needs a completely different code path than normal, because it's in a class constructor. A new method was added to have parity with what happens now, which does NOT do bin lookups or underscore attribute stripping. A PR for arborist/node will be made once this package has its next release and we will finally be done with read-package-json-fast.

@milaninfy
Copy link
Contributor Author

might need different code path changes after this replaces read-package-json-fast in cli

@milaninfy milaninfy closed this Aug 28, 2025
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.

[DOCS] npm pack doesn't include file specified in main field
2 participants