Skip to content
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 14 commits into from
Nov 3, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
docs
  • Loading branch information
ry committed Oct 29, 2019
commit e9194ba3d36c548191251314a5622483dcaef09e
6 changes: 3 additions & 3 deletions cli/flags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ pub fn create_cli_app<'a, 'b>() -> App<'a, 'b> {
.global_settings(&[AppSettings::ColorNever, AppSettings::UnifiedHelpMessage, AppSettings::DisableVersion])
.settings(&[AppSettings::AllowExternalSubcommands])
.after_help(ENV_VARIABLES_HELP)
.long_about("A secure runtime for JavaScript and TypeScript built with V8, Rust, and Tokio.
.long_about("A secure JavaScript and TypeScript runtime

Docs: https://deno.land/manual.html
Modules: https://deno.land/x/
Expand All @@ -146,7 +146,7 @@ To run the REPL:

To execute a sandboxed script:

deno https://deno.land/welcome.ts
deno https://deno.land/std/examples/welcome.ts

To evaluate code from the command line:

Expand Down Expand Up @@ -236,7 +236,7 @@ Examples: https://github.com/WICG/import-maps#the-import-map",
).arg(
Arg::with_name("lock-write")
Copy link
Member

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 than deno --lock lockfile.json --lock-write.
I'd be okay with doing this in in a follow-up PR tho.

.long("lock-write")
.help("Write lock file. Use with --lock to specify file.")
.help("Write lock file. Use with --lock.")
.global(true),
).arg(
Arg::with_name("v8-options")
Expand Down
16 changes: 14 additions & 2 deletions std/manual.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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/
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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).
Expand Down