-
-
Notifications
You must be signed in to change notification settings - Fork 31.4k
doc: recommend package exports instead of requiring folders #41381
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
Review requested:
|
This likely needs a warning that it will block access to adjacent things? |
Also, that this feature is the only practical way to make adding “exports” non-breaking. |
Subpath imports does not encapsulate the package AFAIK; subpath exports does, but its documentation warns about that. Given that, I would say a warning is not needed here, but happy to reconsider if you disagree.
Hum, not sure about that, a more prudent approach is to always treat adding |
Co-authored-by: Tobias Nießen <tniessen@users.noreply.github.com>
Commit Queue failed- Loading data for nodejs/node/pull/41381 ✔ Done loading data for nodejs/node/pull/41381 ----------------------------------- PR info ------------------------------------ Title doc: recommend package exports instead of requiring folders (#41381) ⚠ Could not retrieve the email or name of the PR author's from user's GitHub profile! Branch aduh95:no-require-folder -> nodejs:master Labels doc, module, author ready Commits 2 - doc: recommend package exports instead of requiring folders - Update doc/api/modules.md Committers 2 - Antoine du Hamel - GitHub PR-URL: https://github.com/nodejs/node/pull/41381 Reviewed-By: James M Snell Reviewed-By: Geoffrey Booth ------------------------------ Generated metadata ------------------------------ PR-URL: https://github.com/nodejs/node/pull/41381 Reviewed-By: James M Snell Reviewed-By: Geoffrey Booth -------------------------------------------------------------------------------- ℹ This PR was created on Sun, 02 Jan 2022 18:05:47 GMT ✔ Approvals: 2 ✔ - James M Snell (@jasnell) (TSC): https://github.com/nodejs/node/pull/41381#pullrequestreview-854803616 ✔ - Geoffrey Booth (@GeoffreyBooth): https://github.com/nodejs/node/pull/41381#pullrequestreview-854846838 ✔ Last GitHub CI successful ℹ Green GitHub CI is sufficient -------------------------------------------------------------------------------- ✔ No git cherry-pick in progress ✔ No git am in progress ✔ No git rebase in progress -------------------------------------------------------------------------------- - Bringing origin/master up to date... From https://github.com/nodejs/node * branch master -> FETCH_HEAD 50b7ab9659..f8f3d35bd6 master -> origin/master ✔ origin/master is now up-to-date master is out of sync with origin/master. Mismatched commits: - 5c0b717ab6 tools: add missing `.PHONY` and `.NOTPARALLEL` targets in `Makefile` - f8f3d35bd6 tools: add missing `.PHONY` and `.NOTPARALLEL` targets in `Makefile` -------------------------------------------------------------------------------- HEAD is now at f8f3d35bd6 tools: add missing `.PHONY` and `.NOTPARALLEL` targets in `Makefile` ✔ Reset to origin/master - Downloading patch for 41381 From https://github.com/nodejs/node * branch refs/pull/41381/merge -> FETCH_HEAD ✔ Fetched commits as f8f3d35bd639..9969b1c6ab44 -------------------------------------------------------------------------------- Auto-merging doc/api/modules.md [master dff4d2532d] doc: recommend package exports instead of requiring folders Author: Antoine du Hamel Date: Sun Jan 2 19:02:38 2022 +0100 1 file changed, 10 insertions(+), 4 deletions(-) Auto-merging doc/api/modules.md [master 09b7fb7b5e] Update doc/api/modules.md Author: Antoine du Hamel Date: Sun Jan 2 21:26:27 2022 +0100 1 file changed, 1 insertion(+), 1 deletion(-) ✔ Patches applied There are 2 commits in the PR. Attempting autorebase. Rebasing (2/4)https://github.com/nodejs/node/actions/runs/1714154234 |
Landed in 56679eb |
PR-URL: #41381 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
PR-URL: nodejs#41381 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
PR-URL: #41381 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
PR-URL: #41381 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Clarify that
import
ing a folder is not supported by default, and addLegacy
status to nudge users into using the more modern and versatile"exports"
and/or"imports"
fields in theirpackage.json
.//cc @nodejs/modules