mirror of
https://github.com/denoland/deno.git
synced 2025-01-05 13:59:01 -05:00
fix(ext/node): fix unable to resolve fraction.js (#18544)
Turns out `autoprefixer` is a better reproduction case then `microbundle`. Fixes #18535 Fixes #18600 --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
This commit is contained in:
parent
cd57451e05
commit
b7af3caf78
24 changed files with 29 additions and 1 deletions
|
@ -735,6 +735,15 @@ itest!(node_modules_dir_require_added_node_modules_folder {
|
|||
temp_cwd: true,
|
||||
});
|
||||
|
||||
itest!(node_modules_dir_require_main_entry {
|
||||
args: "run --node-modules-dir -A --quiet $TESTDATA/npm/require_main/main.js",
|
||||
output: "npm/require_main/main.out",
|
||||
envs: env_vars_for_npm_tests(),
|
||||
http_server: true,
|
||||
exit_code: 0,
|
||||
temp_cwd: true,
|
||||
});
|
||||
|
||||
itest!(node_modules_dir_with_deps {
|
||||
args: "run --allow-read --allow-env --node-modules-dir $TESTDATA/npm/cjs_with_deps/main.js",
|
||||
output: "npm/cjs_with_deps/main_node_modules.out",
|
||||
|
|
BIN
cli/tests/testdata/npm/registry/autoprefixer/autoprefixer-10.4.14.tgz
vendored
Normal file
BIN
cli/tests/testdata/npm/registry/autoprefixer/autoprefixer-10.4.14.tgz
vendored
Normal file
Binary file not shown.
1
cli/tests/testdata/npm/registry/autoprefixer/registry.json
vendored
Normal file
1
cli/tests/testdata/npm/registry/autoprefixer/registry.json
vendored
Normal file
File diff suppressed because one or more lines are too long
BIN
cli/tests/testdata/npm/registry/browserslist/browserslist-4.21.5.tgz
vendored
Normal file
BIN
cli/tests/testdata/npm/registry/browserslist/browserslist-4.21.5.tgz
vendored
Normal file
Binary file not shown.
1
cli/tests/testdata/npm/registry/browserslist/registry.json
vendored
Normal file
1
cli/tests/testdata/npm/registry/browserslist/registry.json
vendored
Normal file
File diff suppressed because one or more lines are too long
BIN
cli/tests/testdata/npm/registry/caniuse-lite/caniuse-lite-1.0.30001473.tgz
vendored
Normal file
BIN
cli/tests/testdata/npm/registry/caniuse-lite/caniuse-lite-1.0.30001473.tgz
vendored
Normal file
Binary file not shown.
1
cli/tests/testdata/npm/registry/caniuse-lite/registry.json
vendored
Normal file
1
cli/tests/testdata/npm/registry/caniuse-lite/registry.json
vendored
Normal file
File diff suppressed because one or more lines are too long
BIN
cli/tests/testdata/npm/registry/electron-to-chromium/electron-to-chromium-1.4.348.tgz
vendored
Normal file
BIN
cli/tests/testdata/npm/registry/electron-to-chromium/electron-to-chromium-1.4.348.tgz
vendored
Normal file
Binary file not shown.
1
cli/tests/testdata/npm/registry/electron-to-chromium/registry.json
vendored
Normal file
1
cli/tests/testdata/npm/registry/electron-to-chromium/registry.json
vendored
Normal file
File diff suppressed because one or more lines are too long
BIN
cli/tests/testdata/npm/registry/escalade/escalade-3.1.1.tgz
vendored
Normal file
BIN
cli/tests/testdata/npm/registry/escalade/escalade-3.1.1.tgz
vendored
Normal file
Binary file not shown.
1
cli/tests/testdata/npm/registry/escalade/registry.json
vendored
Normal file
1
cli/tests/testdata/npm/registry/escalade/registry.json
vendored
Normal file
File diff suppressed because one or more lines are too long
BIN
cli/tests/testdata/npm/registry/fraction.js/fraction.js-4.2.0.tgz
vendored
Normal file
BIN
cli/tests/testdata/npm/registry/fraction.js/fraction.js-4.2.0.tgz
vendored
Normal file
Binary file not shown.
1
cli/tests/testdata/npm/registry/fraction.js/registry.json
vendored
Normal file
1
cli/tests/testdata/npm/registry/fraction.js/registry.json
vendored
Normal file
File diff suppressed because one or more lines are too long
BIN
cli/tests/testdata/npm/registry/node-releases/node-releases-2.0.10.tgz
vendored
Normal file
BIN
cli/tests/testdata/npm/registry/node-releases/node-releases-2.0.10.tgz
vendored
Normal file
Binary file not shown.
1
cli/tests/testdata/npm/registry/node-releases/registry.json
vendored
Normal file
1
cli/tests/testdata/npm/registry/node-releases/registry.json
vendored
Normal file
File diff suppressed because one or more lines are too long
BIN
cli/tests/testdata/npm/registry/normalize-range/normalize-range-0.1.2.tgz
vendored
Normal file
BIN
cli/tests/testdata/npm/registry/normalize-range/normalize-range-0.1.2.tgz
vendored
Normal file
Binary file not shown.
1
cli/tests/testdata/npm/registry/normalize-range/registry.json
vendored
Normal file
1
cli/tests/testdata/npm/registry/normalize-range/registry.json
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
{"name":"normalize-range","dist-tags":{"latest":"0.1.2"},"versions":{"0.1.0":{"name":"normalize-range","version":"0.1.0","devDependencies":{"codeclimate-test-reporter":"^0.1.0","coveralls":"^2.11.2","istanbul":"^0.3.17","jscs":"^2.1.1","jshint":"^2.8.0","jshint-stylish":"^2.0.1","mocha":"^2.2.5"},"dist":{"shasum":"7dc10354319857a4bc115926c2c0b46584963102","tarball":"http://localhost:4545/npm/registry/normalize-range/normalize-range-0.1.0.tgz","integrity":"sha512-4fsB/sNmYhDAIP6QbzL9PmwCvnLfWL0Ln69oYIN2oZENUe4rLxjlXjEJuT9idgayeSJA9sMhp5mWsCTVIIpONg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIB2CC+fsxUBSR/x5AQclibqWsHjYaroDVX0t6mecusFSAiEAuOk6cKVrq/xKaJuUVp/RbahS2+ly1bHziRjjNc0uCTM="}]},"engines":{"node":">=0.10.0"}},"0.1.1":{"name":"normalize-range","version":"0.1.1","devDependencies":{"codeclimate-test-reporter":"^0.1.0","coveralls":"^2.11.2","istanbul":"^0.3.17","jscs":"^2.1.1","jshint":"^2.8.0","jshint-stylish":"^2.0.1","mocha":"^2.2.5"},"dist":{"shasum":"a40ffccb98fe9d3a2ebb52014b0ef42973fe0209","tarball":"http://localhost:4545/npm/registry/normalize-range/normalize-range-0.1.1.tgz","integrity":"sha512-E40wR+fwvuCNoAPhlT89paNVG4Dx+QFWq0P5RPjHtRU0UDWW1Zc4tYGnFqOYCrprKvoUSz0zIW0sYz6bh5gY5A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD/UFjvwwZGgQcE0y9dcb3t2X+D4WzSxZTxSPaqZdOIQwIgXVUyEpzKlSUVKYlirK2CltJztrd8qLEqwGvmKYTaNu0="}]},"engines":{"node":">=0.10.0"}},"0.1.2":{"name":"normalize-range","version":"0.1.2","devDependencies":{"almost-equal":"^1.0.0","codeclimate-test-reporter":"^0.1.0","coveralls":"^2.11.2","istanbul":"^0.3.17","jscs":"^2.1.1","jshint":"^2.8.0","jshint-stylish":"^2.0.1","mocha":"^2.2.5","stringify-pi":"0.0.3"},"dist":{"shasum":"2d10c06bdfd312ea9777695a4d28439456b75942","tarball":"http://localhost:4545/npm/registry/normalize-range/normalize-range-0.1.2.tgz","integrity":"sha512-bdok/XvKII3nUpklnV6P2hxtMNrCboOjAcyBuQnWEhO665FwrSNRxU+AqpsyvO6LgGYPspN+lu5CLtw4jPRKNA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIE/pPGFro0Dc2jy+Xczxvr24YzO9s1xQynEBZoe2bi1MAiEAu5ZcDlfU7EqSGImCiQY9jpsumxIQCyAlpFAuAnfjDw8="}]},"engines":{"node":">=0.10.0"}}},"modified":"2022-06-22T05:32:01.991Z"}
|
BIN
cli/tests/testdata/npm/registry/postcss-value-parser/postcss-value-parser-4.2.0.tgz
vendored
Normal file
BIN
cli/tests/testdata/npm/registry/postcss-value-parser/postcss-value-parser-4.2.0.tgz
vendored
Normal file
Binary file not shown.
1
cli/tests/testdata/npm/registry/postcss-value-parser/registry.json
vendored
Normal file
1
cli/tests/testdata/npm/registry/postcss-value-parser/registry.json
vendored
Normal file
File diff suppressed because one or more lines are too long
1
cli/tests/testdata/npm/registry/update-browserslist-db/registry.json
vendored
Normal file
1
cli/tests/testdata/npm/registry/update-browserslist-db/registry.json
vendored
Normal file
File diff suppressed because one or more lines are too long
BIN
cli/tests/testdata/npm/registry/update-browserslist-db/update-browserslist-db-1.0.10.tgz
vendored
Normal file
BIN
cli/tests/testdata/npm/registry/update-browserslist-db/update-browserslist-db-1.0.10.tgz
vendored
Normal file
Binary file not shown.
2
cli/tests/testdata/npm/require_main/main.js
vendored
Normal file
2
cli/tests/testdata/npm/require_main/main.js
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
import fraction from "npm:autoprefixer";
|
||||
console.log(typeof fraction);
|
1
cli/tests/testdata/npm/require_main/main.out
vendored
Normal file
1
cli/tests/testdata/npm/require_main/main.out
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
function
|
|
@ -470,7 +470,13 @@ where
|
|||
{
|
||||
modules_path
|
||||
} else {
|
||||
path_resolve(vec![modules_path, name])
|
||||
let orignal = modules_path.clone();
|
||||
let mod_dir = path_resolve(vec![modules_path, name]);
|
||||
if Env::Fs::is_dir(&mod_dir) {
|
||||
mod_dir
|
||||
} else {
|
||||
orignal
|
||||
}
|
||||
};
|
||||
let pkg = PackageJson::load::<Env::Fs>(
|
||||
&*resolver,
|
||||
|
|
Loading…
Reference in a new issue