diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2024-09-03 10:45:01 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-03 10:45:01 +0200 |
commit | bf7571a6f93659ef087ef529225642ce85e215d4 (patch) | |
tree | 189dd9ddbb150c45190f5c18a0e6a91ead099595 | |
parent | 3f6740ca52b938c5b792991d72b921c59cdda4d0 (diff) |
fix: make some warnings more standard (#25324)
10 files changed, 15 insertions, 15 deletions
diff --git a/cli/npm/managed/resolvers/local.rs b/cli/npm/managed/resolvers/local.rs index b88dd57cf..6ac83ee94 100644 --- a/cli/npm/managed/resolvers/local.rs +++ b/cli/npm/managed/resolvers/local.rs @@ -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, ""); } diff --git a/cli/resolver.rs b/cli/resolver.rs index e0a33bf3c..3f5f79f77 100644 --- a/cli/resolver.rs +++ b/cli/resolver.rs @@ -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")) } } diff --git a/tests/integration/run_tests.rs b/tests/integration/run_tests.rs index 360ff4d77..79dc397e0 100644 --- a/tests/integration/run_tests.rs +++ b/tests/integration/run_tests.rs @@ -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, }); diff --git a/tests/specs/npm/lifecycle_scripts/all_lifecycles_not_run.out b/tests/specs/npm/lifecycle_scripts/all_lifecycles_not_run.out index 7d432ead9..eff0ae250 100644 --- a/tests/specs/npm/lifecycle_scripts/all_lifecycles_not_run.out +++ b/tests/specs/npm/lifecycle_scripts/all_lifecycles_not_run.out @@ -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 diff --git a/tests/specs/npm/lifecycle_scripts/future_install_all_lifecycles_not_run.out b/tests/specs/npm/lifecycle_scripts/future_install_all_lifecycles_not_run.out index 7d432ead9..eff0ae250 100644 --- a/tests/specs/npm/lifecycle_scripts/future_install_all_lifecycles_not_run.out +++ b/tests/specs/npm/lifecycle_scripts/future_install_all_lifecycles_not_run.out @@ -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 diff --git a/tests/specs/npm/lifecycle_scripts/node_gyp_not_run.out b/tests/specs/npm/lifecycle_scripts/node_gyp_not_run.out index a6315b0ef..a462d3465 100644 --- a/tests/specs/npm/lifecycle_scripts/node_gyp_not_run.out +++ b/tests/specs/npm/lifecycle_scripts/node_gyp_not_run.out @@ -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 diff --git a/tests/specs/npm/lifecycle_scripts/only_warns_first1.out b/tests/specs/npm/lifecycle_scripts/only_warns_first1.out index 0d52ae729..cd27c80d5 100644 --- a/tests/specs/npm/lifecycle_scripts/only_warns_first1.out +++ b/tests/specs/npm/lifecycle_scripts/only_warns_first1.out @@ -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 diff --git a/tests/specs/publish/bare_node_builtins/bare_node_builtins.out b/tests/specs/publish/bare_node_builtins/bare_node_builtins.out index 8646ef540..2a12eb6de 100644 --- a/tests/specs/publish/bare_node_builtins/bare_node_builtins.out +++ b/tests/specs/publish/bare_node_builtins/bare_node_builtins.out @@ -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 diff --git a/tests/testdata/run/node_prefix_missing/feature_enabled.out b/tests/testdata/run/node_prefix_missing/feature_enabled.out new file mode 100644 index 000000000..c577fa92c --- /dev/null +++ b/tests/testdata/run/node_prefix_missing/feature_enabled.out @@ -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] diff --git a/tests/testdata/run/node_prefix_missing/main.ts.out_feature_enabled b/tests/testdata/run/node_prefix_missing/main.ts.out_feature_enabled deleted file mode 100644 index 513b411ce..000000000 --- a/tests/testdata/run/node_prefix_missing/main.ts.out_feature_enabled +++ /dev/null @@ -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] |