1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-21 15:04:11 -05:00

fix: make some warnings more standard (#25324)

This commit is contained in:
David Sherret 2024-09-03 10:45:01 +02:00 committed by GitHub
parent 3f6740ca52
commit bf7571a6f9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 15 additions and 15 deletions

View file

@ -836,9 +836,9 @@ async fn sync_resolution_with_fs(
.map(|(_, p)| format!("npm:{p}"))
.collect::<Vec<_>>()
.join(", ");
log::warn!("{}: Packages contained npm lifecycle scripts (preinstall/install/postinstall) that were not executed.
log::warn!("{} Packages contained npm lifecycle scripts (preinstall/install/postinstall) that were not executed.
This may cause the packages to not work correctly. To run them, use the `--allow-scripts` flag with `deno cache` or `deno install`
(e.g. `deno cache --allow-scripts=pkg1,pkg2 <entrypoint>` or `deno install --allow-scripts=pkg1,pkg2`):\n {packages}", crate::colors::yellow("warning"));
(e.g. `deno cache --allow-scripts=pkg1,pkg2 <entrypoint>` or `deno install --allow-scripts=pkg1,pkg2`):\n {packages}", crate::colors::yellow("Warning"));
for (scripts_warned_path, _) in packages_with_scripts_not_run {
let _ignore_err = fs::write(scripts_warned_path, "");
}

View file

@ -749,7 +749,7 @@ impl<'a> deno_graph::source::NpmResolver for WorkerCliNpmGraphResolver<'a> {
let line = start.line + 1;
let column = start.character + 1;
if !*DENO_DISABLE_PEDANTIC_NODE_WARNINGS {
log::warn!("Warning: Resolving \"{module_name}\" as \"node:{module_name}\" at {specifier}:{line}:{column}. If you want to use a built-in Node module, add a \"node:\" prefix.")
log::warn!("{} Resolving \"{module_name}\" as \"node:{module_name}\" at {specifier}:{line}:{column}. If you want to use a built-in Node module, add a \"node:\" prefix.", colors::yellow("Warning"))
}
}

View file

@ -4632,7 +4632,7 @@ itest!(node_prefix_missing {
itest!(node_prefix_missing_unstable_bare_node_builtins_enbaled {
args: "run --unstable-bare-node-builtins run/node_prefix_missing/main.ts",
output: "run/node_prefix_missing/main.ts.out_feature_enabled",
output: "run/node_prefix_missing/feature_enabled.out",
envs: env_vars_for_npm_tests(),
exit_code: 0,
});
@ -4640,7 +4640,7 @@ itest!(node_prefix_missing_unstable_bare_node_builtins_enbaled {
itest!(
node_prefix_missing_unstable_bare_node_builtins_enbaled_by_env {
args: "run run/node_prefix_missing/main.ts",
output: "run/node_prefix_missing/main.ts.out_feature_enabled",
output: "run/node_prefix_missing/feature_enabled.out",
envs: [
env_vars_for_npm_tests(),
vec![(
@ -4655,14 +4655,14 @@ itest!(
itest!(node_prefix_missing_unstable_bare_node_builtins_enbaled_by_config {
args: "run --config=run/node_prefix_missing/config.json run/node_prefix_missing/main.ts",
output: "run/node_prefix_missing/main.ts.out_feature_enabled",
output: "run/node_prefix_missing/feature_enabled.out",
envs: env_vars_for_npm_tests(),
exit_code: 0,
});
itest!(node_prefix_missing_unstable_bare_node_builtins_enbaled_with_import_map {
args: "run --unstable-bare-node-builtins --import-map run/node_prefix_missing/import_map.json run/node_prefix_missing/main.ts",
output: "run/node_prefix_missing/main.ts.out_feature_enabled",
output: "run/node_prefix_missing/feature_enabled.out",
envs: env_vars_for_npm_tests(),
exit_code: 0,
});

View file

@ -6,7 +6,7 @@ Download http://localhost:4260/@denotest/bin/1.0.0.tgz
Initialize @denotest/node-lifecycle-scripts@1.0.0
Initialize @denotest/bin@1.0.0
[UNORDERED_END]
warning: Packages contained npm lifecycle scripts (preinstall/install/postinstall) that were not executed.
Warning Packages contained npm lifecycle scripts (preinstall/install/postinstall) that were not executed.
This may cause the packages to not work correctly. To run them, use the `--allow-scripts` flag with `deno cache` or `deno install`
(e.g. `deno cache --allow-scripts=pkg1,pkg2 <entrypoint>` or `deno install --allow-scripts=pkg1,pkg2`):
npm:@denotest/node-lifecycle-scripts@1.0.0

View file

@ -6,7 +6,7 @@ Download http://localhost:4260/@denotest/bin/1.0.0.tgz
Initialize @denotest/node-lifecycle-scripts@1.0.0
Initialize @denotest/bin@1.0.0
[UNORDERED_END]
warning: Packages contained npm lifecycle scripts (preinstall/install/postinstall) that were not executed.
Warning Packages contained npm lifecycle scripts (preinstall/install/postinstall) that were not executed.
This may cause the packages to not work correctly. To run them, use the `--allow-scripts` flag with `deno cache` or `deno install`
(e.g. `deno cache --allow-scripts=pkg1,pkg2 <entrypoint>` or `deno install --allow-scripts=pkg1,pkg2`):
npm:@denotest/node-lifecycle-scripts@1.0.0

View file

@ -1,7 +1,7 @@
Download http://localhost:4260/@denotest/node-addon
Download http://localhost:4260/node-gyp
[WILDCARD]
warning: Packages contained npm lifecycle scripts (preinstall/install/postinstall) that were not executed.
Warning Packages contained npm lifecycle scripts (preinstall/install/postinstall) that were not executed.
This may cause the packages to not work correctly. To run them, use the `--allow-scripts` flag with `deno cache` or `deno install`
(e.g. `deno cache --allow-scripts=pkg1,pkg2 <entrypoint>` or `deno install --allow-scripts=pkg1,pkg2`):
npm:@denotest/node-addon@1.0.0

View file

@ -6,7 +6,7 @@ Download http://localhost:4260/@denotest/bin/1.0.0.tgz
Initialize @denotest/node-lifecycle-scripts@1.0.0
Initialize @denotest/bin@1.0.0
[UNORDERED_END]
warning: Packages contained npm lifecycle scripts (preinstall/install/postinstall) that were not executed.
Warning Packages contained npm lifecycle scripts (preinstall/install/postinstall) that were not executed.
This may cause the packages to not work correctly. To run them, use the `--allow-scripts` flag with `deno cache` or `deno install`
(e.g. `deno cache --allow-scripts=pkg1,pkg2 <entrypoint>` or `deno install --allow-scripts=pkg1,pkg2`):
npm:@denotest/node-lifecycle-scripts@1.0.0

View file

@ -1,5 +1,5 @@
Warning: Resolving "url" as "node:url" at file:///[WILDLINE]/mod.ts:1:22. If you want to use a built-in Node module, add a "node:" prefix.
Warning: Resolving "url" as "node:url" at file:///[WILDLINE]/mod.ts:1:22. If you want to use a built-in Node module, add a "node:" prefix.
Warning Resolving "url" as "node:url" at file:///[WILDLINE]/mod.ts:1:22. If you want to use a built-in Node module, add a "node:" prefix.
Warning Resolving "url" as "node:url" at file:///[WILDLINE]/mod.ts:1:22. If you want to use a built-in Node module, add a "node:" prefix.
Download http://localhost:4260/@types/node
Download http://localhost:4260/@types/node/node-18.16.19.tgz
Check file:///[WILDLINE]/mod.ts

View file

@ -0,0 +1,2 @@
[WILDCARD]Warning Resolving "fs" as "node:fs" at file:///[WILDCARD]/tests/testdata/run/node_prefix_missing/main.ts:1:16. If you want to use a built-in Node module, add a "node:" prefix.
[Function: writeFile]

View file

@ -1,2 +0,0 @@
[WILDCARD]Warning: Resolving "fs" as "node:fs" at file:///[WILDCARD]/tests/testdata/run/node_prefix_missing/main.ts:1:16. If you want to use a built-in Node module, add a "node:" prefix.
[Function: writeFile]