Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: browserify/resolve
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 1de53b227990cfcb07e59fdf49d34b2a8373ba4c
Choose a base ref
...
head repository: browserify/resolve
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: b8298720c6ece9d3b7231ea90bd920f266a449a8
Choose a head ref

Commits on Jan 21, 2015

  1. Copy the full SHA
    96d38c6 View commit details
  2. Copy the full SHA
    f6edcd9 View commit details

Commits on Nov 29, 2017

  1. Copy the full SHA
    dc23387 View commit details

Commits on Mar 1, 2018

  1. [Fix] support opts.package in non-relative lookups

    Kelly Selden authored and ljharb committed Mar 1, 2018
    Copy the full SHA
    c8a2052 View commit details

Commits on Apr 4, 2018

  1. [Tests] add some tests for a non-directory basedir

    Related to #154.
    ljharb committed Apr 4, 2018
    Copy the full SHA
    0c18e40 View commit details
  2. Copy the full SHA
    876b0b0 View commit details
  3. [Docs] fix default “isFile” implementations

     - also, name isFile functions for debugging
    ljharb committed Apr 4, 2018
    Copy the full SHA
    0f29c93 View commit details
  4. Copy the full SHA
    fa6e6f5 View commit details
  5. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    4b10996 View commit details

Commits on Apr 5, 2018

  1. [Tests] add a failing test

    ljharb committed Apr 5, 2018
    Copy the full SHA
    90b1192 View commit details
  2. Minor cleanup

    ljharb committed Apr 5, 2018

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    c449d48 View commit details
  3. Copy the full SHA
    13fb572 View commit details
  4. [Docs] fix options formatting

    ljharb committed Apr 5, 2018

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    23df5f5 View commit details
  5. Copy the full SHA
    c3621a3 View commit details
  6. Merge pull request #146 from lbogdan/fix/resolve-sync

    [Fix] Make loadAsFileSync() work the same as async loadAsFile()
    ljharb authored Apr 5, 2018
    Copy the full SHA
    7a2edf8 View commit details
  7. Copy the full SHA
    7cbd17a View commit details
  8. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    04cb0bb View commit details

Commits on Apr 7, 2018

  1. v1.7.0

     - [New] `resolve.sync`: add `opts.pathFilter` (#146)
     - [Fix] Make loadAsFileSync() work the same as async loadAsFile() (#146)
     - [Fix] support `opts.package` in non-relative lookups (#152)
     - [Docs] fix default “isFile” implementations
     - [Docs] fix options formatting
     - [Refactor] cache default isFile functions at module level
     - [Refactor] use "basedir" instead of "y", because meaningful variable names
     - [Tests] add some tests for a non-directory basedir (#154)
     - [Tests] work around npm SSL issue
     - [Tests] add some tests for browser field
     - [Tests] add node 8 and 9 to appveyor
    ljharb committed Apr 7, 2018
    Copy the full SHA
    bdf1210 View commit details

Commits on Apr 12, 2018

  1. Copy the full SHA
    f5c2a41 View commit details
  2. v1.7.1

     - [Fix] revert proper but unintended breaking change in sync packageFilter (#157)
    ljharb committed Apr 12, 2018
    Copy the full SHA
    579e2b1 View commit details

Commits on May 23, 2018

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    def5931 View commit details

Commits on Jun 15, 2018

  1. [New] add fs/promises to the list of core modules

    shinnn authored and ljharb committed Jun 15, 2018

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    756419a View commit details
  2. Copy the full SHA
    4225ac5 View commit details
  3. Copy the full SHA
    bae0338 View commit details
  4. Copy the full SHA
    ad16af2 View commit details
  5. Merge pull request #162 from ClearCanvas/master

    [New] include filename in error message
    ljharb committed Jun 15, 2018

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    9493b22 View commit details
  6. v1.8.0

     - [New] include filename in error message (#162)
     - [New] core: add `trace_events`, `v8/tools/arguments`
     - [New] add fs/promises to the list of core modules
     - [Fix] core: `_tls_legacy` is removed in node 10
     - [Tests] up to `node` `v10.1`, `v9.11`, `v8.11`, `v6.14`, `4.9`
    ljharb committed Jun 15, 2018

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    dcba6d0 View commit details
  7. [Docs] clean up readme code

    ljharb committed Jun 15, 2018
    Copy the full SHA
    f5394d8 View commit details

Commits on Jun 16, 2018

  1. Copy the full SHA
    6f771b2 View commit details
  2. [New] add isDirectory

    Backport of 698a3e1 to 1.x without the breaking change.
    
    See #154.
    ljharb committed Jun 16, 2018

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    b502f7c View commit details

Commits on Jun 17, 2018

  1. [Tests] up to node v10.4

    ljharb committed Jun 17, 2018
    Copy the full SHA
    3a64219 View commit details
  2. [Fix] resolution when filename option is passed

    PR #162 introduced a `parent` variable that contains either the full
    filename of the requiring module or the `basedir`. Some of the places
    where `basedir` was used were updated to use `parent` instead, but
    that's not correct; the `path.resolve()` calls would receive the full
    filename instead of the directory name.
    
    This patch reverts the improper `parent` uses to `basedir`.
    goto-bus-stop authored and ljharb committed Jun 17, 2018
    Copy the full SHA
    9c370c9 View commit details
  3. v1.8.1

     - [Fix] resolution when `filename` option is passed (#167, #162)
     - [Docs] clean up readme code
     - [Tests] improve output of symlink tests that fail on Mac
     - [Tests] up to `node` `v10.4`
    ljharb committed Jun 17, 2018
    Copy the full SHA
    b5fc91b View commit details

Commits on Nov 14, 2018

  1. [New] Implements a "normalize-options" pseudo-hook

    Maël Nison authored and ljharb committed Nov 14, 2018
    Copy the full SHA
    f3961df View commit details
  2. [New] async/sync/node-modules-paths: Adds support for “paths” b…

    …eing a function
    Maël Nison authored and ljharb committed Nov 14, 2018
    Copy the full SHA
    7112873 View commit details

Commits on Nov 22, 2018

  1. [Refactor] node-modules-paths: Change paths function option to re…

    …ceive a thunk for node modules resolution paths
    
     - this would be a breaking change, but the “paths as function” option has not yet been released.
    ljharb committed Nov 22, 2018
    Copy the full SHA
    d652f01 View commit details

Commits on Nov 28, 2018

  1. Copy the full SHA
    2b4f3a8 View commit details
  2. [Dev Deps] update eslint, @ljharb/eslint-config, object-keys, `…

    …safe-publish-latest`, `tape`
    ljharb committed Nov 28, 2018
    Copy the full SHA
    5542700 View commit details
  3. [Deps] update path-parse

    ljharb committed Nov 28, 2018
    Copy the full SHA
    1018c0e View commit details

Commits on Dec 13, 2018

  1. Copy the full SHA
    4b2b392 View commit details

Commits on Dec 14, 2018

  1. Copy the full SHA
    f839d20 View commit details
  2. Copy the full SHA
    765b3cb View commit details

Commits on Dec 17, 2018

  1. v1.9.0

     - [New] `async`/`sync`/`node-modules-paths`: Adds support for “paths” being a function (#172, #173)
     - [New] Implements a "normalize-options" pseudo-hook (#174)
     - [Fix] `sync`/`async`: fix `preserveSymlinks` option (#177)
     - [Fix] `sync`/`async`: when package.json `main` is not a string, throw an error (#178)
     - [Deps] update `path-parse`
     - [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `object-keys`, `safe-publish-latest`, `tape`
     - [Tests] up to `node` `v11.4`, `v10.14`, `v8.14`, `v6.15`
     - [Tests] better failure messages
    ljharb committed Dec 17, 2018
    Copy the full SHA
    254bb40 View commit details

Commits on Jan 12, 2019

  1. Copy the full SHA
    ce163e3 View commit details

Commits on Jan 13, 2019

  1. Copy the full SHA
    083e78c View commit details
  2. Copy the full SHA
    29a4994 View commit details
  3. Copy the full SHA
    09dc3e8 View commit details
  4. [Tests] add an additional test

    ljharb committed Jan 13, 2019
    Copy the full SHA
    2c67936 View commit details

Commits on Jan 21, 2019

  1. Copy the full SHA
    3296106 View commit details
  2. v1.10.0

     - [New] `core`: add `worker_threads` in v11.7+
     - [Fix] `sync`/`async`: when package.json `main` is not a string, throw an error (#178)
     - [Fix] TypeError: Path must be a string. Received undefined (#181)
     - [Tests] up to `v11.6`, `v10.15`, `v8.15`, `v6.16`
     - [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape`
    ljharb committed Jan 21, 2019
    Copy the full SHA
    d098e92 View commit details
Showing with 3,026 additions and 671 deletions.
  1. +37 −0 .editorconfig
  2. +0 −1 .eslintignore
  3. +45 −10 .eslintrc
  4. +12 −0 .github/FUNDING.yml
  5. +19 −0 .github/workflows/executable.yml
  6. +18 −0 .github/workflows/node-aught.yml
  7. +7 −0 .github/workflows/node-pretest.yml
  8. +18 −0 .github/workflows/node-tens.yml
  9. +9 −0 .github/workflows/rebase.yml
  10. +12 −0 .github/workflows/require-allow-edits.yml
  11. +6 −0 .gitignore
  12. +0 −199 .travis.yml
  13. +15 −12 LICENSE
  14. +3 −0 SECURITY.md
  15. +45 −8 appveyor.yml
  16. +3 −0 async.js
  17. +50 −0 bin/resolve
  18. +2 −4 index.js
  19. +203 −77 lib/async.js
  20. +3 −44 lib/core.js
  21. +156 −67 lib/core.json
  22. +24 −0 lib/homedir.js
  23. +5 −0 lib/is-core.js
  24. +22 −25 lib/node-modules-paths.js
  25. +10 −0 lib/normalize-options.js
  26. +157 −42 lib/sync.js
  27. +70 −38 package.json
  28. +183 −42 readme.markdown
  29. +3 −0 sync.js
  30. +14 −8 test/core.js
  31. +17 −1 test/faulty_basedir.js
  32. +20 −5 test/filter.js
  33. +20 −3 test/filter_sync.js
  34. +127 −0 test/home_paths.js
  35. +114 −0 test/home_paths_sync.js
  36. +172 −0 test/mock.js
  37. +151 −4 test/mock_sync.js
  38. +52 −2 test/node-modules-paths.js
  39. +33 −12 test/node_path.js
  40. +60 −27 test/pathfilter.js
  41. +264 −16 test/resolver.js
  42. +1 −0 test/resolver/baz/package.json
  43. 0 test/resolver/browser_field/a.js
  44. 0 test/resolver/browser_field/b.js
  45. +5 −0 test/resolver/browser_field/package.json
  46. 0 test/resolver/false_main/index.js
  47. +4 −0 test/resolver/false_main/package.json
  48. +7 −0 test/resolver/invalid_main/package.json
  49. 0 test/resolver/malformed_package_json/index.js
  50. +1 −0 test/resolver/malformed_package_json/package.json
  51. +1 −0 test/resolver/multirepo/.npmrc
  52. +6 −0 test/resolver/multirepo/lerna.json
  53. +20 −0 test/resolver/multirepo/package.json
  54. +35 −0 test/resolver/multirepo/packages/package-a/index.js
  55. +14 −0 test/resolver/multirepo/packages/package-a/package.json
  56. 0 test/resolver/multirepo/packages/package-b/index.js
  57. +14 −0 test/resolver/multirepo/packages/package-b/package.json
  58. +1 −0 test/resolver/nested_symlinks/common/node_modules/buffer/index.js
  59. +7 −0 test/resolver/nested_symlinks/common/node_modules/buffer/package.json
  60. +26 −0 test/resolver/nested_symlinks/mylib/async.js
  61. +1 −0 test/resolver/nested_symlinks/mylib/node_modules/buffer
  62. +1 −0 test/resolver/nested_symlinks/mylib/node_modules/resolve
  63. +15 −0 test/resolver/nested_symlinks/mylib/package.json
  64. +12 −0 test/resolver/nested_symlinks/mylib/sync.js
  65. +1 −1 test/resolver/symlinked/.gitignore
  66. +1 −0 test/resolver/symlinked/package/bar.js
  67. +3 −0 test/resolver/symlinked/package/package.json
  68. +483 −20 test/resolver_sync.js
  69. +54 −0 test/shadowed_core.js
  70. +1 −0 test/shadowed_core/.gitignore
  71. 0 test/shadowed_core/node_modules/util/index.js
  72. +125 −3 test/symlinks.js
  73. +1 −0 test/symlinks/dest/node_modules/mod-a
  74. +3 −0 test/symlinks/source/node_modules/mod-a/index.js
  75. +2 −0 test/symlinks/source/node_modules/mod-a/package.json
37 changes: 37 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
max_line_length = 200

[*.js]
block_comment_start = /*
block_comment = *
block_comment_end = */

[*.yml]
indent_size = 1

[package.json]
indent_style = tab

[lib/core.json]
indent_style = tab

[CHANGELOG.md]
indent_style = space
indent_size = 2

[{*.json,Makefile}]
max_line_length = off

[test/{dotdot,resolver,module_dir,multirepo,node_path,pathfilter,precedence}/**/*]
indent_style = off
indent_size = off
max_line_length = off
insert_final_newline = off
1 change: 0 additions & 1 deletion .eslintignore

This file was deleted.

55 changes: 45 additions & 10 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"extends": "@ljharb",
"root": true,

"extends": "@ljharb",

"rules": {
"array-bracket-newline": 0,
"array-element-newline": 0,
"indent": [2, 4],
"strict": 0,
"complexity": 0,
@@ -12,19 +12,54 @@
"dot-notation": [2, { "allowKeywords": true }],
"func-name-matching": 0,
"func-style": 0,
"global-require": 0,
"id-length": [2, { "min": 1, "max": 30 }],
"global-require": 1,
"id-length": [2, { "min": 1, "max": 40 }],
"max-lines": [2, 350],
"max-lines-per-function": 0,
"max-nested-callbacks": 0,
"max-params": 0,
"max-statements-per-line": [2, { "max": 2 }],
"max-statements": 0,
"no-magic-numbers": 0,
"no-console": 0,
"no-shadow": 0,
"no-unused-vars": [2, { "vars": "all", "args": "none" }],
"no-use-before-define": 0,
"object-curly-newline": 0,
"operator-linebreak": [2, "before"],
"sort-keys": 0,
}
},
"overrides": [
{
"files": "bin/**",
"rules": {
"no-process-exit": "off",
},
},
{
"files": "example/**",
"rules": {
"no-console": 0,
},
},
{
"files": "test/resolver/nested_symlinks/mylib/*.js",
"rules": {
"no-throw-literal": 0,
},
},
{
"files": "test/**",
"parserOptions": {
"ecmaVersion": 5,
"allowReserved": false,
},
"rules": {
"dot-notation": [2, { "allowPattern": "throws" }],
"max-lines": 0,
"max-lines-per-function": 0,
"no-unused-vars": [2, { "vars": "all", "args": "none" }],
},
},
],

"ignorePatterns": [
"./test/resolver/malformed_package_json/package.json",
],
}
12 changes: 12 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# These are supported funding model platforms

github: [ljharb]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: npm/resolve
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
19 changes: 19 additions & 0 deletions .github/workflows/executable.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: resolve executable

on: [push, pull_request]

jobs:
_:
name: cli

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: ljharb/actions/node/install@main
- run: "[ $(./bin/resolve fs) = 'fs' ]"
name: run inside the package with a direct path
- run: "npm link && [ $(resolve fs) = 'fs' ] && npm uninstall -g resolve"
name: run linked as a global in the PATH
- run: "[ $(npx resolve fs) = 'fs' ]"
name: run via npx
18 changes: 18 additions & 0 deletions .github/workflows/node-aught.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: 'Tests: node.js < 10'

on: [pull_request, push]

jobs:
tests:
uses: ljharb/actions/.github/workflows/node.yml@main
with:
range: '< 10'
type: minors
command: npm run tests-only

node:
name: 'node < 10'
needs: [tests]
runs-on: ubuntu-latest
steps:
- run: 'echo tests completed'
7 changes: 7 additions & 0 deletions .github/workflows/node-pretest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: 'Tests: pretest/posttest'

on: [pull_request, push]

jobs:
tests:
uses: ljharb/actions/.github/workflows/pretest.yml@main
18 changes: 18 additions & 0 deletions .github/workflows/node-tens.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: 'Tests: node.js >= 10'

on: [pull_request, push]

jobs:
tests:
uses: ljharb/actions/.github/workflows/node.yml@main
with:
range: '>= 10'
type: minors
command: npm run tests-only

node:
name: 'node >= 10'
needs: [tests]
runs-on: ubuntu-latest
steps:
- run: 'echo tests completed'
9 changes: 9 additions & 0 deletions .github/workflows/rebase.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: Automatic Rebase

on: [pull_request_target]

jobs:
_:
uses: ljharb/actions/.github/workflows/rebase.yml@main
secrets:
token: ${{ secrets.GITHUB_TOKEN }}
12 changes: 12 additions & 0 deletions .github/workflows/require-allow-edits.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Require “Allow Edits”

on: [pull_request_target]

jobs:
_:
name: "Require “Allow Edits”"

runs-on: ubuntu-latest

steps:
- uses: ljharb/require-allow-edits@main
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
# gitignore
node_modules
**/node_modules

# Only apps should have lockfiles
npm-shrinkwrap.json
package-lock.json
yarn.lock

# symlinked file used in tests
test/resolver/symlinked/_/node_modules/package

.npmignore
Loading