-
Notifications
You must be signed in to change notification settings - Fork 5.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: lockfiles #3231
Merged
Merged
feat: lockfiles #3231
Changes from 1 commit
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
9453695
First pass at lockfile support
ry ecccf9f
add lock-check tests
ry 0f3bf43
clippy
ry d83e2c1
cleanup
ry 3e6a616
use http for lock_check tests
ry f2c3aa5
cleanup
ry e8745d1
use @hayd's suggestion for flags
ry 72ac938
cleanup
ry e9194ba
docs
ry 4c21065
fmt
ry d060d78
clippy
ry def8edc
cleanup
ry 38e1158
dont write local file:https:// urls to lockfile
ry 13e75de
Merge branch 'master' into lock_file
ry File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
docs
- Loading branch information
commit e9194ba3d36c548191251314a5622483dcaef09e
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -574,6 +574,10 @@ always bundle its dependencies. In Deno this is done by checking the `$DENO_DIR` | |
into your source control system, and specifying that path as the `$DENO_DIR` | ||
environmental variable at runtime. | ||
|
||
**How can I trust a URL that may change** By using a lock file (using the | ||
`--lock` command line flag) you can ensure you're running the code you expect to | ||
be. | ||
|
||
**How do you import to a specific version?** Simply specify the version in the | ||
URL. For example, this URL fully specifies the code being run: | ||
`https://unpkg.com/[email protected]/dist/liltest.js`. Combined with the | ||
|
@@ -666,8 +670,8 @@ if (import.meta.main) { | |
Use `deno help` to see the help text. | ||
|
||
``` | ||
deno | ||
A secure runtime for JavaScript and TypeScript built with V8, Rust, and Tokio. | ||
deno | ||
A secure JavaScript and TypeScript runtime | ||
ry marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
Docs: https://deno.land/manual.html | ||
Modules: https://deno.land/x/ | ||
|
@@ -704,6 +708,8 @@ OPTIONS: | |
--current-thread Use tokio::runtime::current_thread | ||
-h, --help Prints help information | ||
--importmap <FILE> Load import map file | ||
--lock <FILE> Check the specified lock file | ||
--lock-write Write lock file. Use with --lock. | ||
-L, --log-level <log-level> Set log level [possible values: debug, info] | ||
--no-fetch Do not download remote modules | ||
-r, --reload=<CACHE_BLACKLIST> Reload source code cache (recompile TypeScript) | ||
|
@@ -905,6 +911,12 @@ Proxy configuration is read from environmental variables: `HTTP_PROXY` and | |
In case of Windows if environmental variables are not found Deno falls back to | ||
reading proxies from registry. | ||
|
||
## Lock file | ||
|
||
Deno can store and check module subresource integrity for modules using a small | ||
JSON file. Use the `--lock=lock.json` to enable and specify lock file checking. | ||
To update or create a lock use `--lock=lock.json --lock-write`. | ||
|
||
## Import maps | ||
|
||
Deno supports [import maps](https://github.com/WICG/import-maps). | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it may be more user friendly to do
deno --lock-write lockfile.json
rather thandeno --lock lockfile.json --lock-write
.I'd be okay with doing this in in a follow-up PR tho.