| Current Path : /home/emeraadmin/www/4d695/ |
| Current File : /home/emeraadmin/www/4d695/resolver.zip |
PK %_�\��2
cup.coffeenu �[���
PK %_�\a��� quux/foo/index.jsnu �[��� module.exports = 1;
PK %_�\�QN symlinked/package/package.jsonnu �[��� {
"main": "bar.js"
}PK %_�\��v� symlinked/package/bar.jsnu �[��� module.exports = 'bar';
PK %_�\ # symlinked/_/symlink_target/.gitkeepnu �[��� PK %_�\ symlinked/_/node_modules/foo.jsnu �[��� PK %_�\P�
dot_slash_main/package.jsonnu �[��� {
"main": "./"
}
PK %_�\a��� dot_slash_main/index.jsnu �[��� module.exports = 1;
PK %_�\ mug.jsnu �[��� PK %_�\��D\� � multirepo/package.jsonnu �[��� {
"name": "ljharb-monorepo-symlink-test",
"private": true,
"version": "0.0.0",
"description": "",
"main": "index.js",
"scripts": {
"postinstall": "lerna bootstrap",
"test": "node packages/package-a"
},
"author": "",
"license": "MIT",
"dependencies": {
"jquery": "^3.3.1",
"resolve": "../../../"
},
"devDependencies": {
"lerna": "^3.4.3"
}
}
PK %_�\-� ) multirepo/packages/package-b/package.jsonnu �[��� {
"name": "@my-scope/package-b",
"private": true,
"version": "0.0.0",
"description": "",
"license": "MIT",
"main": "index.js",
"scripts": {
"test": "echo \"Error: run tests from root\" && exit 1"
},
"dependencies": {
"@my-scope/package-a": "^0.0.0"
}
}
PK %_�\ % multirepo/packages/package-b/index.jsnu �[��� PK %_�\.�� ) multirepo/packages/package-a/package.jsonnu �[��� {
"name": "@my-scope/package-a",
"version": "0.0.0",
"private": true,
"description": "",
"license": "MIT",
"main": "index.js",
"scripts": {
"test": "echo \"Error: run tests from root\" && exit 1"
},
"dependencies": {
"@my-scope/package-b": "^0.0.0"
}
}
PK %_�\Lv��' ' % multirepo/packages/package-a/index.jsnu �[��� 'use strict';
var assert = require('assert');
var path = require('path');
var resolve = require('resolve');
var basedir = __dirname + '/node_modules/@my-scope/package-b';
var expected = path.join(__dirname, '../../node_modules/jquery/dist/jquery.js');
/*
* preserveSymlinks === false
* will search NPM package from
* - packages/package-b/node_modules
* - packages/node_modules
* - node_modules
*/
assert.equal(resolve.sync('jquery', { basedir: basedir, preserveSymlinks: false }), expected);
assert.equal(resolve.sync('../../node_modules/jquery', { basedir: basedir, preserveSymlinks: false }), expected);
/*
* preserveSymlinks === true
* will search NPM package from
* - packages/package-a/node_modules/@my-scope/packages/package-b/node_modules
* - packages/package-a/node_modules/@my-scope/packages/node_modules
* - packages/package-a/node_modules/@my-scope/node_modules
* - packages/package-a/node_modules/node_modules
* - packages/package-a/node_modules
* - packages/node_modules
* - node_modules
*/
assert.equal(resolve.sync('jquery', { basedir: basedir, preserveSymlinks: true }), expected);
assert.equal(resolve.sync('../../../../../node_modules/jquery', { basedir: basedir, preserveSymlinks: true }), expected);
console.log(' * all monorepo paths successfully resolved through symlinks');
PK %_�\ӟ�F? ? multirepo/lerna.jsonnu �[��� {
"packages": [
"packages/*"
],
"version": "0.0.0"
}
PK %_�\ other_path/lib/other-lib.jsnu �[��� PK %_�\ other_path/root.jsnu �[��� PK %_�\�C? ? browser_field/package.jsonnu �[��� {
"name": "browser_field",
"main": "a",
"browser": "b"
}
PK %_�\ browser_field/b.jsnu �[��� PK %_�\ browser_field/a.jsnu �[��� PK %_�\N�0o dot_main/package.jsonnu �[��� {
"main": "."
}
PK %_�\a��� dot_main/index.jsnu �[��� module.exports = 1;
PK %_�\�i �o o without_basedir/main.jsnu �[��� var resolve = require('../../../');
module.exports = function (t, cb) {
resolve('mymodule', null, cb);
};
PK %_�\��* * false_main/package.jsonnu �[��� {
"name": "false_main",
"main": false
}
PK %_�\ false_main/index.jsnu �[��� PK %_�\
mug.coffeenu �[��� PK %_�\a��� same_names/foo/index.jsnu �[��� module.exports = 1;
PK %_�\�.� same_names/foo.jsnu �[��� module.exports = 42;
PK %_�\��t� incorrect_main/package.jsonnu �[��� {
"main": "wrong.js"
}
PK %_�\ t t incorrect_main/index.jsnu �[��� // this is the actual main file 'index.js', not 'wrong.js' like the package.json would indicate
module.exports = 1;
PK %_�\��* "