Add node modules and compiled JavaScript from main (#57)
Co-authored-by: Oliver King <oking3@uncc.edu>
This commit is contained in:
committed by
GitHub
parent
d893f27da9
commit
7f7e5ba5ea
+4
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"name": "baz",
|
||||
"main": "quux.js"
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
module.exports = 1;
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"name": "browser_field",
|
||||
"main": "a",
|
||||
"browser": "b"
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
|
||||
+1
@@ -0,0 +1 @@
|
||||
module.exports = 1;
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"main": "."
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
module.exports = 1;
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"main": "./"
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
module.exports = 1;
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
// this is the actual main file 'index.js', not 'wrong.js' like the package.json would indicate
|
||||
module.exports = 1;
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"main": "wrong.js"
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"name": "invalid main",
|
||||
"main": [
|
||||
"why is this a thing",
|
||||
"srsly omg wtf"
|
||||
]
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"packages": [
|
||||
"packages/*"
|
||||
],
|
||||
"version": "0.0.0"
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"name": "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"
|
||||
}
|
||||
}
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
var a = require.resolve('buffer/').replace(process.cwd(), '$CWD');
|
||||
var b;
|
||||
var c;
|
||||
|
||||
var test = function test() {
|
||||
console.log(a, ': require.resolve, preserveSymlinks ' + (process.execArgv.indexOf('preserve-symlinks') > -1 ? 'true' : 'false'));
|
||||
console.log(b, ': preserveSymlinks true');
|
||||
console.log(c, ': preserveSymlinks false');
|
||||
|
||||
if (a !== b && a !== c) {
|
||||
throw 'async: no match';
|
||||
}
|
||||
console.log('async: success! a matched either b or c\n');
|
||||
};
|
||||
|
||||
require('resolve')('buffer/', { preserveSymlinks: true }, function (err, result) {
|
||||
if (err) { throw err; }
|
||||
b = result.replace(process.cwd(), '$CWD');
|
||||
if (b && c) { test(); }
|
||||
});
|
||||
require('resolve')('buffer/', { preserveSymlinks: false }, function (err, result) {
|
||||
if (err) { throw err; }
|
||||
c = result.replace(process.cwd(), '$CWD');
|
||||
if (b && c) { test(); }
|
||||
});
|
||||
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"name": "mylib",
|
||||
"version": "0.0.0",
|
||||
"description": "",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"buffer": "*"
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
var a = require.resolve('buffer/').replace(process.cwd(), '$CWD');
|
||||
var b = require('resolve').sync('buffer/', { preserveSymlinks: true }).replace(process.cwd(), '$CWD');
|
||||
var c = require('resolve').sync('buffer/', { preserveSymlinks: false }).replace(process.cwd(), '$CWD');
|
||||
|
||||
console.log(a, ': require.resolve, preserveSymlinks ' + (process.execArgv.indexOf('preserve-symlinks') > -1 ? 'true' : 'false'));
|
||||
console.log(b, ': preserveSymlinks true');
|
||||
console.log(c, ': preserveSymlinks false');
|
||||
|
||||
if (a !== b && a !== c) {
|
||||
throw 'sync: no match';
|
||||
}
|
||||
console.log('sync: success! a matched either b or c\n');
|
||||
+1
@@ -0,0 +1 @@
|
||||
module.exports = 1;
|
||||
+1
@@ -0,0 +1 @@
|
||||
module.exports = 42;
|
||||
+1
@@ -0,0 +1 @@
|
||||
module.exports = 1;
|
||||
+1
@@ -0,0 +1 @@
|
||||
module.exports = 'bar';
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"main": "bar.js"
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
var resolve = require('../../../');
|
||||
|
||||
module.exports = function (t, cb) {
|
||||
resolve('mymodule', null, cb);
|
||||
};
|
||||
Reference in New Issue
Block a user