forked from denoland/deno
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(cli): Support deno.lock with only package.json present + fix DENO…
…_FUTURE install interactions with lockfile (denoland#23918) Fixes denoland#23571. Previously, we required a `deno.json` to be present (or the `--lock` flag) in order for us to resolve a `deno.lock` file. This meant that if you were using deno in an npm-first project deno wouldn't use a lockfile. Additionally, while I was fixing that, I discovered there were a couple bugs keeping the future `install` command from using a lockfile. With this PR, `install` will actually resolve the lockfile (or create one if not present), and update it if it's not up-to-date. This also speeds up `deno install`, as we can use the lockfile to skip work during npm resolution.
- Loading branch information
1 parent
20dad29
commit 5de30c5
Showing
15 changed files
with
184 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
tests/specs/install/future_install_local_deno/deno.lock.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"version": "3", | ||
"packages": { | ||
"specifiers": { | ||
"jsr:@denotest/add": "jsr:@denotest/[email protected]", | ||
"npm:@denotest/esm-basic@^1.0.0": "npm:@denotest/[email protected]" | ||
}, | ||
"jsr": { | ||
"@denotest/[email protected]": [WILDCARD] | ||
}, | ||
"npm": { | ||
"@denotest/[email protected]": [WILDCARD] | ||
} | ||
}, | ||
"remote": [WILDCARD], | ||
"workspace": { | ||
"dependencies": [ | ||
"jsr:@denotest/add", | ||
"npm:@denotest/esm-basic@^1.0.0" | ||
] | ||
} | ||
} |
65 changes: 52 additions & 13 deletions
65
tests/specs/install/future_install_node_modules/__test__.jsonc
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
3 changes: 3 additions & 0 deletions
3
tests/specs/install/future_install_node_modules/corrupted.out
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
19 changes: 19 additions & 0 deletions
19
tests/specs/install/future_install_node_modules/deno.lock.out
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"tempDir": true, | ||
"steps": [ | ||
{ | ||
"args": "cache index.js", | ||
"output": "cache.out" | ||
}, | ||
{ | ||
"args": [ | ||
"eval", | ||
"console.log(Deno.readTextFileSync('./deno.lock').trim())" | ||
], | ||
"output": "deno.lock.out" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Download https://localhost:4260/@denotest/esm-basic | ||
Download https://localhost:4260/@denotest/esm-basic/1.0.0.tgz | ||
Initialize @denotest/[email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"version": "3", | ||
"packages": { | ||
"specifiers": { | ||
"npm:@denotest/esm-basic": "npm:@denotest/[email protected]" | ||
}, | ||
"npm": { | ||
"@denotest/[email protected]": [WILDCARD] | ||
} | ||
}, | ||
"remote": {}, | ||
"workspace": { | ||
"packageJson": { | ||
"dependencies": [ | ||
"npm:@denotest/esm-basic" | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
import * as basic from "@denotest/esm-basic"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"name": "lockfile_only_package_json", | ||
"dependencies": { | ||
"@denotest/esm-basic": "*" | ||
}, | ||
"type": "module" | ||
} |