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: v1.18.0
Choose a base ref
...
head repository: browserify/resolve
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.18.1
Choose a head ref
  • 7 commits
  • 9 files changed
  • 1 contributor

Commits on Aug 1, 2020

  1. Verified

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

Commits on Oct 3, 2020

  1. Copy the full SHA
    a112d1c View commit details

Commits on Oct 5, 2020

  1. Copy the full SHA
    d204e63 View commit details

Commits on Oct 19, 2020

  1. Copy the full SHA
    72990ba View commit details
  2. [Fix] core: remove console warning on require, since the main entry…

    … point requires it
    
    Fixes #230
    ljharb committed Oct 19, 2020
    Copy the full SHA
    4eb5c87 View commit details
  3. [Dev Deps] update eslint

    ljharb committed Oct 19, 2020
    Copy the full SHA
    7ec18c7 View commit details
  4. v1.18.1

     - [Fix] `core`: remove console warning on require, since the main entry point requires it
     - [Refactor] avoid using extensions in require paths
     - [meta] update auto-generated `core.json`
     - [meta] add `eclint` and `.editorconfig`
     - [Dev Deps] update `eslint`
     - [Dev Deps] add `aud` in `posttest`
    ljharb committed Oct 19, 2020
    Copy the full SHA
    014d98d View commit details
Showing with 59 additions and 21 deletions.
  1. +34 −0 .editorconfig
  2. +3 −3 lib/async.js
  3. +0 −2 lib/core.js
  4. +2 −2 lib/core.json
  5. +3 −3 lib/sync.js
  6. +6 −3 package.json
  7. +6 −6 readme.markdown
  8. +1 −1 test/resolver/symlinked/.gitignore
  9. +4 −1 test/symlinks.js
34 changes: 34 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
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

[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
6 changes: 3 additions & 3 deletions lib/async.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
var fs = require('fs');
var path = require('path');
var caller = require('./caller.js');
var nodeModulesPaths = require('./node-modules-paths.js');
var normalizeOptions = require('./normalize-options.js');
var caller = require('./caller');
var nodeModulesPaths = require('./node-modules-paths');
var normalizeOptions = require('./normalize-options');
var isCore = require('is-core-module');

var realpathFS = fs.realpath && typeof fs.realpath.native === 'function' ? fs.realpath.native : fs.realpath;
2 changes: 0 additions & 2 deletions lib/core.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
console.warn('`resolve/lib/core` is deprecated; please use `is-core-module` directly');

var current = (process.versions && process.versions.node && process.versions.node.split('.')) || [];

function specifierIncluded(specifier) {
4 changes: 2 additions & 2 deletions lib/core.json
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@
"dgram": true,
"dns": true,
"dns/promises": ">= 15",
"domain": true,
"domain": ">= 0.7.12",
"events": true,
"freelist": "< 6",
"fs": true,
@@ -53,7 +53,7 @@
"stream": true,
"stream/promises": ">= 15",
"string_decoder": true,
"sys": true,
"sys": [">= 0.6 && < 0.7", ">= 0.8"],
"timers": true,
"timers/promises": ">= 15",
"_tls_common": ">= 0.11.13",
6 changes: 3 additions & 3 deletions lib/sync.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
var isCore = require('is-core-module');
var fs = require('fs');
var path = require('path');
var caller = require('./caller.js');
var nodeModulesPaths = require('./node-modules-paths.js');
var normalizeOptions = require('./normalize-options.js');
var caller = require('./caller');
var nodeModulesPaths = require('./node-modules-paths');
var normalizeOptions = require('./normalize-options');

var realpathFS = fs.realpathSync && typeof fs.realpathSync.native === 'function' ? fs.realpathSync.native : fs.realpathSync;

9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "resolve",
"description": "resolve like require.resolve() on behalf of files asynchronously and synchronously",
"version": "1.18.0",
"version": "1.18.1",
"repository": {
"type": "git",
"url": "git://github.com/browserify/resolve.git"
@@ -15,18 +15,21 @@
],
"scripts": {
"prepublish": "safe-publish-latest && cp node_modules/is-core-module/core.json ./lib/",
"prelint": "eclint check '**/*'",
"lint": "eslint --ext=js,mjs .",
"pretests-only": "cd ./test/resolver/nested_symlinks && node mylib/sync && node mylib/async",
"tests-only": "tape test/*.js",
"pretest": "npm run lint",
"test": "npm run --silent tests-only",
"posttest": "npm run test:multirepo",
"posttest": "npm run test:multirepo && aud --production",
"test:multirepo": "cd ./test/resolver/multirepo && npm install && npm test"
},
"devDependencies": {
"@ljharb/eslint-config": "^17.2.0",
"array.prototype.map": "^1.0.2",
"eslint": "^7.10.0",
"aud": "^1.1.2",
"eclint": "^2.8.1",
"eslint": "^7.11.0",
"object-keys": "^1.1.1",
"safe-publish-latest": "^1.1.4",
"tap": "0.4.13",
12 changes: 6 additions & 6 deletions readme.markdown
Original file line number Diff line number Diff line change
@@ -122,12 +122,12 @@ default `opts` values:
});
},
realpath: function realpath(file, cb) {
var realpath = typeof fs.realpath.native === 'function' ? fs.realpath.native : fs.realpath;
realpath(file, function (realPathErr, realPath) {
if (realPathErr && realPathErr.code !== 'ENOENT') cb(realPathErr);
else cb(null, realPathErr ? file : realPath);
});
},
var realpath = typeof fs.realpath.native === 'function' ? fs.realpath.native : fs.realpath;
realpath(file, function (realPathErr, realPath) {
if (realPathErr && realPathErr.code !== 'ENOENT') cb(realPathErr);
else cb(null, realPathErr ? file : realPath);
});
},
moduleDirectory: 'node_modules',
preserveSymlinks: true
}
2 changes: 1 addition & 1 deletion test/resolver/symlinked/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
symlink
symlink
5 changes: 4 additions & 1 deletion test/symlinks.js
Original file line number Diff line number Diff line change
@@ -68,7 +68,10 @@ test('sync symlink when preserveSymlinks = true', function (t) {
test('sync symlink', function (t) {
var start = new Date();
t.doesNotThrow(function () {
t.equal(resolve.sync('foo', { basedir: symlinkDir, preserveSymlinks: false }), path.join(__dirname, 'resolver', 'symlinked', '_', 'node_modules', 'foo.js'));
t.equal(
resolve.sync('foo', { basedir: symlinkDir, preserveSymlinks: false }),
path.join(__dirname, 'resolver', 'symlinked', '_', 'node_modules', 'foo.js')
);
});
t.ok(new Date() - start < 50, 'resolve.sync timedout');
t.end();