Skip to content
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

doc: fix typos in esm.md #41499

Merged
merged 1 commit into from
Jan 17, 2022
Merged

doc: fix typos in esm.md #41499

merged 1 commit into from
Jan 17, 2022

Conversation

yu521088
Copy link
Contributor

doc: fix typos in esm.md

Update the logic of LOOKUP_PACKAGE_SCOPE method step 2.3:
The pjsonURL should be

the resolution of "package.json" within scopeURL

instead of

the resolution of "package.json" within packageURL

Because packageURL should be undefined now.

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/modules

@nodejs-github-bot nodejs-github-bot added doc Issues and PRs related to the documentations. esm Issues and PRs related to the ECMAScript Modules implementation. labels Jan 13, 2022
@tniessen tniessen requested a review from guybedford January 13, 2022 13:17
@aduh95 aduh95 added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Jan 13, 2022
@yu521088
Copy link
Contributor Author

@guybedford By the way, in PACKAGE_RESOLVE method step 11.1, i thought packageURL should be:

the URL resolution of "node_modules/" concatenated with packageName, relative to parentURL.

Instead of:

  1. While parentURL is not the file system root,
    1. Let packageURL be the URL resolution of "node_modules/" concatenated with packageSpecifier, relative to parentURL.

Is this another typo?

Take code from package.md as an example:

// ./node_modules/es-module-package/package.json
{
  "exports": {
    "./features/*": "./src/features/*.js"
  },
  "imports": {
    "#internal/*": "./src/internal/*.js"
  }
}
import featureY from 'es-module-package/features/y/y';
// Loads ./node_modules/es-module-package/src/features/y/y.js

If concatenated "node_modules/" with packageSpecifier, the packageURL will initially be "./node_modules/es-module-package/src/features/y/y", though according to the loop, it will finally locate packageURL to "./node_modules/es-module-package", but it's a waste of time doing meaningless loop for "src/features/y" path.

@guybedford
Copy link
Contributor

@yu521088 well spotted, yes that is another typo!

@aduh95 aduh95 added the commit-queue Add this label to land a pull request using GitHub Actions. label Jan 17, 2022
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Jan 17, 2022
@nodejs-github-bot nodejs-github-bot merged commit f458f1b into nodejs:master Jan 17, 2022
@nodejs-github-bot
Copy link
Collaborator

Landed in f458f1b

thedull pushed a commit to thedull/node that referenced this pull request Jan 18, 2022
PR-URL: nodejs#41499
Reviewed-By: Guy Bedford <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Adrian Estrada <[email protected]>
BethGriggs pushed a commit that referenced this pull request Jan 25, 2022
PR-URL: #41499
Reviewed-By: Guy Bedford <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Adrian Estrada <[email protected]>
Linkgoron pushed a commit to Linkgoron/node that referenced this pull request Jan 31, 2022
PR-URL: nodejs#41499
Reviewed-By: Guy Bedford <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Adrian Estrada <[email protected]>
danielleadams pushed a commit that referenced this pull request Feb 26, 2022
PR-URL: #41499
Reviewed-By: Guy Bedford <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Adrian Estrada <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. doc Issues and PRs related to the documentations. esm Issues and PRs related to the ECMAScript Modules implementation.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants