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

feat(endo): Search for index.js and implied package exports #424

Closed
wants to merge 13 commits into from

Commits on Aug 24, 2020

  1. Configuration menu
    Copy the full SHA
    c04592d View commit details
    Browse the repository at this point in the history
  2. Add endo bin

    kriskowal committed Aug 24, 2020
    Configuration menu
    Copy the full SHA
    208afd5 View commit details
    Browse the repository at this point in the history
  3. Use stdout for compartmap

    kriskowal committed Aug 24, 2020
    Configuration menu
    Copy the full SHA
    22eb6c4 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    c24bc99 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    54bfebf View commit details
    Browse the repository at this point in the history
  6. endo/main Fix lint

    kriskowal committed Aug 24, 2020
    Configuration menu
    Copy the full SHA
    3c8dc53 View commit details
    Browse the repository at this point in the history
  7. endo/cli Nits

    kriskowal committed Aug 24, 2020
    Configuration menu
    Copy the full SHA
    4cee940 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    d5bc072 View commit details
    Browse the repository at this point in the history
  9. Document parsers

    kriskowal committed Aug 24, 2020
    Configuration menu
    Copy the full SHA
    aff7916 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    c7ad8db View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    9153014 View commit details
    Browse the repository at this point in the history
  12. feat(endo): Search for index.js and implied package exports

    When asked for a module named "x", Node.js will search for "x.js" then "x/index.js".
    
    For packages that do not supply an "exports" property in their "package.json", any module contained by that package is a valid exported module.
    
    To achieve parity with these two features, Endo uses different techniques when loading from the file system and loading from an archive.
    
    When reading from the file system, Endo will search for a satsifactory candidate in each compartment's asynchronous importHook.  Endo also uses the compartment's new moduleMapHook to search for dependency compartments in the "scope" of a module identifier prefix.  These allow Endo to operate from an incomplete compartment map for the initial load.
    
    The Endo archiver instead creates a more complete compartment map, with every discovered module.  This introduces a new kind of module to the compartment map module descriptor type union: modules with known locations and corresponding parsers.  The archiver erases the "scopes", "types", and "parsers" on each compartment description since they are no longer necessary.
    
    When reading from an archive, Endo uses an importHook that consults the compartment map directly for the locations of all contained modules, and creates a complete moduleMap up front.
    kriskowal committed Aug 24, 2020
    Configuration menu
    Copy the full SHA
    115e791 View commit details
    Browse the repository at this point in the history
  13. Type typo

    kriskowal committed Aug 24, 2020
    Configuration menu
    Copy the full SHA
    444b063 View commit details
    Browse the repository at this point in the history