1
0
Fork 0
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:
David Sherret 2024-04-11 19:52:35 -04:00 committed by GitHub
parent f358ae6278
commit 98077e4b3c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 50 additions and 2 deletions

View file

@ -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) {

View file

@ -0,0 +1,4 @@
{
"args": "publish --dry-run --allow-dirty",
"output": "publish.out"
}

View 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"]
}

View file

@ -0,0 +1,7 @@
import { add } from "package";
export function myAdd(a: number, b: number): number {
return add(a, b);
}
export { add };

View file

@ -0,0 +1 @@
export function add(a: number, b: number): number;

View file

@ -0,0 +1,3 @@
export function add(a, b) {
return a + b;
}

View file

@ -0,0 +1,4 @@
{
"main": "index.js",
"type": "module"
}

View file

@ -0,0 +1,5 @@
{
"dependencies": {
"package": "*"
}
}

View 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