mirror of
https://github.com/denoland/deno.git
synced 2024-11-24 15:19:26 -05:00
fix(publish): do not warn about excluded external modules in node_modules directory (#23173)
This commit is contained in:
parent
f358ae6278
commit
98077e4b3c
9 changed files with 50 additions and 2 deletions
|
@ -212,8 +212,15 @@ fn collect_excluded_module_diagnostics(
|
|||
return;
|
||||
};
|
||||
let specifiers = graph
|
||||
.specifiers()
|
||||
.map(|(s, _)| s)
|
||||
.modules()
|
||||
.filter_map(|m| match m {
|
||||
deno_graph::Module::Js(_) | deno_graph::Module::Json(_) => {
|
||||
Some(m.specifier())
|
||||
}
|
||||
deno_graph::Module::Npm(_)
|
||||
| deno_graph::Module::Node(_)
|
||||
| deno_graph::Module::External(_) => None,
|
||||
})
|
||||
.filter(|s| s.as_str().starts_with(root.as_str()));
|
||||
for specifier in specifiers {
|
||||
if !file_patterns.matches_specifier(specifier) {
|
||||
|
|
4
tests/specs/publish/byonm_dep/__test__.jsonc
Normal file
4
tests/specs/publish/byonm_dep/__test__.jsonc
Normal file
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"args": "publish --dry-run --allow-dirty",
|
||||
"output": "publish.out"
|
||||
}
|
11
tests/specs/publish/byonm_dep/deno.jsonc
Normal file
11
tests/specs/publish/byonm_dep/deno.jsonc
Normal file
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"name": "@scope/package",
|
||||
"version": "0.0.0",
|
||||
"exports": "./mod.ts",
|
||||
"publish": {
|
||||
// this was previously causing issues because it would cause
|
||||
// external modules in the node_modules directory to be ignored
|
||||
"include": ["mod.ts"]
|
||||
},
|
||||
"unstable": ["byonm", "sloppy-imports"]
|
||||
}
|
7
tests/specs/publish/byonm_dep/mod.ts
Normal file
7
tests/specs/publish/byonm_dep/mod.ts
Normal file
|
@ -0,0 +1,7 @@
|
|||
import { add } from "package";
|
||||
|
||||
export function myAdd(a: number, b: number): number {
|
||||
return add(a, b);
|
||||
}
|
||||
|
||||
export { add };
|
1
tests/specs/publish/byonm_dep/node_modules/package/index.d.ts
generated
vendored
Normal file
1
tests/specs/publish/byonm_dep/node_modules/package/index.d.ts
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
export function add(a: number, b: number): number;
|
3
tests/specs/publish/byonm_dep/node_modules/package/index.js
generated
vendored
Normal file
3
tests/specs/publish/byonm_dep/node_modules/package/index.js
generated
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
export function add(a, b) {
|
||||
return a + b;
|
||||
}
|
4
tests/specs/publish/byonm_dep/node_modules/package/package.json
generated
vendored
Normal file
4
tests/specs/publish/byonm_dep/node_modules/package/package.json
generated
vendored
Normal file
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"main": "index.js",
|
||||
"type": "module"
|
||||
}
|
5
tests/specs/publish/byonm_dep/package.json
Normal file
5
tests/specs/publish/byonm_dep/package.json
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"dependencies": {
|
||||
"package": "*"
|
||||
}
|
||||
}
|
6
tests/specs/publish/byonm_dep/publish.out
Normal file
6
tests/specs/publish/byonm_dep/publish.out
Normal file
|
@ -0,0 +1,6 @@
|
|||
Check file:///[WILDLINE]/mod.ts
|
||||
Checking for slow types in the public API...
|
||||
Check file:///[WILDLINE]/mod.ts
|
||||
Simulating publish of @scope/package@0.0.0 with files:
|
||||
file:///[WILDLINE]/mod.ts (129B)
|
||||
Warning Aborting due to --dry-run
|
Loading…
Reference in a new issue