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

[v16.x backport] loader: return package format from defaultResolve if known #41752

Commits on Feb 1, 2022

  1. fs: accept URL as argument for fs.rm and fs.rmSync

    PR-URL: nodejs#41132
    Reviewed-By: Michaël Zasso <targos@protonmail.com>
    Reviewed-By: James M Snell <jasnell@gmail.com>
    Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
    Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
    Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
    Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
    
    Backport-PR-URL: nodejs#41752
    aduh95 authored and dygabo committed Feb 1, 2022
    Configuration menu
    Copy the full SHA
    3a9a260 View commit details
    Browse the repository at this point in the history
  2. loader: return package format from defaultResolve if known

    This is a proposed modification of defaultResolve to return the package
    format in case it has been found during package resolution.
    The format will be returned as described in the documentation:
    https://nodejs.org/api/esm.html#resolvespecifier-context-defaultresolve
    There is one new unit test as well:
    test/es-module/test-esm-resolve-type.js
    
    PR-URL: nodejs#40980
    Reviewed-By: Bradley Farias <bradley.meck@gmail.com>
    Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
    Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
    
    Backport-PR-URL: nodejs#41752
    dygabo committed Feb 1, 2022
    Configuration menu
    Copy the full SHA
    3e60925 View commit details
    Browse the repository at this point in the history
  3. loader: fix package resolution for edge case

    this commit solves a regression introduced with PR-40980.
    if a resolve call results in a script with .mjs extension the
    is automatically set to . This avoids the case where an additional
     in the same directory as the .mjs file would declare the
     to commonjs
    
    PR-URL: nodejs#41218
    Refs: nodejs#40980
    Refs: yargs/yargs#2068
    Reviewed-By: Guy Bedford <guybedford@gmail.com>
    Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
    Reviewed-By: James M Snell <jasnell@gmail.com>
    
    Backport-PR-URL: nodejs#41752
    dygabo committed Feb 1, 2022
    Configuration menu
    Copy the full SHA
    29a7f7b View commit details
    Browse the repository at this point in the history