Skip to content

Commit

Permalink
Revert "fix(npm): use original node regex in npm resolution (denoland…
Browse files Browse the repository at this point in the history
…#17404)"

This reverts commit 934ed8e.
  • Loading branch information
MierenManz committed Jan 20, 2023
1 parent 9d5face commit e7a1ee9
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 9 deletions.
2 changes: 0 additions & 2 deletions cli/tests/testdata/npm/conditional_exports/main.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import mod from "npm:@denotest/conditional-exports";
import foo from "npm:@denotest/conditional-exports/foo.js";
import client from "npm:@denotest/conditional-exports/client";
import clientFoo from "npm:@denotest/conditional-exports/client/foo";
import clientBar from "npm:@denotest/conditional-exports/client/bar";
import supportsESM from "npm:supports-esm";

console.log(mod);
console.log(foo);
console.log(client);
console.log(clientFoo);
console.log(clientBar);
Expand Down
1 change: 0 additions & 1 deletion cli/tests/testdata/npm/conditional_exports/main.out
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ Download http://localhost:4545/npm/registry/@ljharb/has-package-exports-patterns
Download http://localhost:4545/npm/registry/has-package-exports/has-package-exports-1.3.0.tgz
Download http://localhost:4545/npm/registry/supports-esm/supports-esm-1.0.0.tgz
{ hello: "from esm" }
{ hello: "from foo" }
{ hello: "from esm client" }
{ hello: "from esm client foo" }
{ hello: "from esm client bar" }
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"./client/*": {
"types": "./types/src/client/*.d.ts",
"import": "./esm/client/*.js"
},
"./*": "./*"
}
}
}
2 changes: 1 addition & 1 deletion ext/node/resolution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ fn resolve_package_target_string(
));
}
let invalid_segment_re =
Regex::new(r"(^|\\|/)(\.\.?|node_modules)(\\|/|$)").expect("bad regex");
Regex::new(r"(^|\|/)(..?|node_modules)(\|/|$)").expect("bad regex");
let pattern_re = Regex::new(r"\*").expect("bad regex");
if !target.starts_with("./") {
if internal && !target.starts_with("../") && !target.starts_with('/') {
Expand Down

0 comments on commit e7a1ee9

Please sign in to comment.