Uh oh!
There was an error while loading. Please reload this page.
-m alias; determine type based for symlinks based on targets; error on mismatched type flag and package scope - #45
Conversation
There was a problem hiding this comment.
as long as esm is being renamed, can it pretty please be changed to source-text-module or stmr or something. we're going to have at least stmr and wasm in the future, and probably more.
and type is very generic for a flag to the node binary, it should probably be something more specific like --entry-type
and i don't think adding the shortcut is a good idea. we generally don't add shortcuts for other things like this where they change major runtime behaviour, because it becomes difficult to reason about.
MylesBorins
commented
Feb 27, 2019
This is going to need a rebase I'm -1 on calling them source text module records. That is spec text that the average developer is not going to know. What is the problem with either esm or module? |
GeoffreyBooth
commented
Feb 27, 2019
@devsnek User-facing references to We had a lot of discussion on the naming and we settled on |
c5052c6 to
210cbc2Compare@MylesBorins It’s been rebased. @devsnek If you’d like to propose renaming some things, can that be a separate PR? Since the names are already in the implementation; this PR doesn’t add any new ones. If you come up with better names that the group approves, we can change them via your PR. Based on the research I’ve done so far, |
d0edcd9 to
31ec58bCompare@GeoffreyBooth |
ljharb
left a comment
There was a problem hiding this comment.
Assuming the OP is exhaustive about the changes in this PR, this seems good to land.
GeoffreyBooth
commented
Feb 27, 2019
Per meeting on 2019-02-27, landing on 2019-03-01 |
91e7c3c to
6a2166cComparefc03720 to
7e2e82cCompare6a2166c to
5e9f16eCompareMylesBorins
commented
Mar 5, 2019
Unfortunately this PR landed in a way that broke CI (both linting issues as well as broken tests on windows). I've gone ahead and reverted modules-lkgr back to the state before this landed and backed up the original branch in https://github.com/nodejs/ecmascript-modules/tree/modules-lkgr-2019-03-05-backup We will work in #49 to get things working again |
GeoffreyBooth
commented
Mar 5, 2019
That's weird, I ran the tests and |
MylesBorins
commented
Mar 5, 2019
@GeoffreyBooth there were unfortunately linting errors that were still broken... we have for other prs run ci.nodejs.org against it... although only node.js core collaborators have access. It isn't a big deal, we'll get this fixed quickly, just documenting |
This PR fills in a few to-dos from the last entry points PR:
A new flag
-mis an alias for--type=module.Module type is now determined based on a symlink’s target rather than its source. This allows a symlink like
/usr/local/bin/footo point to/usr/local/node_modules/foo/bin.mjsand the type is determined bybin.mjs(orfoo/package.jsonifbin.mjswerebin.js). The existing Node flags--preserve-symlinksand--preserve-symlinks-mainare still supported, which would cause the type determination to be based on the source instead. With tests.Addressing feedback from @bmeck, an error is now thrown when
--typeand file extension mismatch; or when--typeand package scope mismatch. For example:node -m file.cjs, ornode --type=commonjs index.jswhere the nearest parentpackage.jsoncontains"type": "module". The spec has been updated to account for this.Addressing feedback from @devsnek, within the codebase the type strings are now either
'module'or'commonjs'to match the values accepted by--typeand"type":.Supersedes #39.