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

feat: suggest deno install --entrypoint instead of deno cache (#25228)

Hides `deno cache` from `--help` output.

---------

Signed-off-by: Asher Gomez <ashersaupingomez@gmail.com>
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
This commit is contained in:
Asher Gomez 2024-09-19 05:55:50 +10:00 committed by GitHub
parent a1d0a427e8
commit 5057f58145
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 19 additions and 15 deletions

View file

@ -1651,7 +1651,8 @@ Future runs of this module will trigger no downloads or compilation unless --rel
<y>Read more:</> <c>https://docs.deno.com/go/cache</>"),
UnstableArgsConfig::ResolutionOnly,
)
)
.hide(true)
.defer(|cmd| {
compile_args(cmd)
.arg(check_arg(false))

View file

@ -246,7 +246,7 @@ impl CliLockfile {
// has an extra newline at the end
let diff = diff.trim_end();
Err(deno_core::anyhow::anyhow!(
"The lockfile is out of date. Run `deno cache --frozen=false`, `deno install --frozen=false`, or rerun with `--frozen=false` to update it.\nchanges:\n{diff}"
"The lockfile is out of date. Run `deno install --frozen=false`, or rerun with `--frozen=false` to update it.\nchanges:\n{diff}"
))
} else {
Ok(())

View file

@ -240,7 +240,7 @@ impl LanguageServer {
}
}
/// Similar to `deno cache` on the command line, where modules will be cached
/// Similar to `deno install --entrypoint` on the command line, where modules will be cached
/// in the Deno cache, including any of their dependencies.
pub async fn cache(
&self,

View file

@ -1,6 +1,6 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
// deno-lint-ignore-file
// Only for testing types. Invoke with `deno cache`
// Only for testing types. Invoke with `deno install --entrypoint`
const remote = Deno.dlopen("dummy_lib.so", {
method1: { parameters: ["usize", "bool"], result: "void" },

View file

@ -1821,7 +1821,10 @@ fn reload_info_not_found_cache_but_exists_remote() {
{
// create it
temp_dir.write("deno.json", r#"{}"#);
test_context.new_command().args("cache main.ts").run();
test_context
.new_command()
.args("install --entrypoint main.ts")
.run();
assert!(temp_dir.path().join("deno.lock").exists());
// remove a version found in the lockfile

View file

@ -1,4 +1,4 @@
error: The lockfile is out of date. Run `deno cache --frozen=false`, `deno install --frozen=false`, or rerun with `--frozen=false` to update it.
error: The lockfile is out of date. Run `deno install --frozen=false`, or rerun with `--frozen=false` to update it.
changes:
4 | - "npm:@denotest/add@1": "1.0.0"
4 | + "npm:@denotest/add@1": "1.0.0",

View file

@ -1,5 +1,5 @@
Download http://localhost:4545/welcome.ts
error: Uncaught (in promise) TypeError: The lockfile is out of date. Run `deno cache --frozen=false`, `deno install --frozen=false`, or rerun with `--frozen=false` to update it.
error: Uncaught (in promise) TypeError: The lockfile is out of date. Run `deno install --frozen=false`, or rerun with `--frozen=false` to update it.
changes:
10 | - }
10 | + },

View file

@ -1,7 +1,7 @@
Download http://127.0.0.1:4250/@denotest/add/meta.json
Download http://127.0.0.1:4250/@denotest/add/1.0.0_meta.json
Download http://127.0.0.1:4250/@denotest/add/1.0.0/mod.ts
error: Uncaught (in promise) TypeError: The lockfile is out of date. Run `deno cache --frozen=false`, `deno install --frozen=false`, or rerun with `--frozen=false` to update it.
error: Uncaught (in promise) TypeError: The lockfile is out of date. Run `deno install --frozen=false`, or rerun with `--frozen=false` to update it.
changes:
4 | - "npm:@denotest/add@1": "1.0.0"
4 | + "jsr:@denotest/add@1": "1.0.0",

View file

@ -1,5 +1,5 @@
Download http://localhost:4260/@denotest/subtract
error: Uncaught (in promise) TypeError: The lockfile is out of date. Run `deno cache --frozen=false`, `deno install --frozen=false`, or rerun with `--frozen=false` to update it.
error: Uncaught (in promise) TypeError: The lockfile is out of date. Run `deno install --frozen=false`, or rerun with `--frozen=false` to update it.
changes:
4 | - "npm:@denotest/add@1": "1.0.0"
4 | + "npm:@denotest/add@1": "1.0.0",

View file

@ -1,4 +1,4 @@
error: The lockfile is out of date. Run `deno cache --frozen=false`, `deno install --frozen=false`, or rerun with `--frozen=false` to update it.
error: The lockfile is out of date. Run `deno install --frozen=false`, or rerun with `--frozen=false` to update it.
changes:
4 | - "jsr:@denotest/add@1": "1.0.0"
5 | - },

View file

@ -1,6 +1,6 @@
Download http://127.0.0.1:4250/@denotest/add/0.2.0_meta.json
Download http://127.0.0.1:4250/@denotest/add/0.2.0/mod.ts
error: The lockfile is out of date. Run `deno cache --frozen=false`, `deno install --frozen=false`, or rerun with `--frozen=false` to update it.
error: The lockfile is out of date. Run `deno install --frozen=false`, or rerun with `--frozen=false` to update it.
changes:
4 | - "jsr:@denotest/add@1": "1.0.0"
5 | - },

View file

@ -1,5 +1,5 @@
Download http://localhost:4260/@denotest/subtract
error: The lockfile is out of date. Run `deno cache --frozen=false`, `deno install --frozen=false`, or rerun with `--frozen=false` to update it.
error: The lockfile is out of date. Run `deno install --frozen=false`, or rerun with `--frozen=false` to update it.
changes:
4 | - "npm:@denotest/add@1": "1.0.0"
4 | + "npm:@denotest/add@1": "1.0.0",

View file

@ -1,5 +1,5 @@
Download http://localhost:4260/@denotest/bin
error: The lockfile is out of date. Run `deno cache --frozen=false`, `deno install --frozen=false`, or rerun with `--frozen=false` to update it.
error: The lockfile is out of date. Run `deno install --frozen=false`, or rerun with `--frozen=false` to update it.
changes:
4 | - "npm:@denotest/add@1": "1.0.0"
4 | + "npm:@denotest/add@1": "1.0.0",

View file

@ -1,4 +1,4 @@
error: The lockfile is out of date. Run `deno cache --frozen=false`, `deno install --frozen=false`, or rerun with `--frozen=false` to update it.
error: The lockfile is out of date. Run `deno install --frozen=false`, or rerun with `--frozen=false` to update it.
changes:
4 | - "npm:@denotest/add@1": "1.0.0"
4 | + "npm:@denotest/add@1": "1.0.0",

View file

@ -1,5 +1,5 @@
Download http://localhost:4260/@denotest/add
error: The lockfile is out of date. Run `deno cache --frozen=false`, `deno install --frozen=false`, or rerun with `--frozen=false` to update it.
error: The lockfile is out of date. Run `deno install --frozen=false`, or rerun with `--frozen=false` to update it.
changes:
1 | -
1 | +{