Skip to content

Commit

Permalink
Merge remote-tracking branch 'denoland/master' into filesystem8g
Browse files Browse the repository at this point in the history
* denoland/master:
  Remove doc strings from cli/js TS files (denoland#4329)
  upgrade: Rust 1.42.0 (denoland#4331)
  Enable std tests in debug mode (denoland#4332)
  fix: Node polyfill fsAppend rework (denoland#4322)
  v0.36.0
  Add waker to StreamResource to fix hang on close bugs (denoland#4293)
  reorg: Deno global initialization (denoland#4317)
  move compiler API tests to integration tests (denoland#4319)
  support permission mode in mkdir (denoland#4286)
  Stricter permissions for Deno.makeTemp* (denoland#4318)
  reorg: remove dispatch.ts, move signals, factor out web utils (denoland#4316)
  reorg: cli/js/compiler/, move more API to cli/js/web/ (denoland#4310)
  Improve dprint config (denoland#4314)
  doc(cli/flags): Reduce empty lines in help messages (denoland#4312)
  • Loading branch information
dubiousjim committed Mar 13, 2020
2 parents 3f8a630 + e435c2b commit af428e8
Show file tree
Hide file tree
Showing 140 changed files with 1,057 additions and 2,916 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
- name: Install rust
uses: hecrj/setup-rust-action@v1
with:
rust-version: "1.41.0"
rust-version: "1.42.0"

- name: Install clippy and rustfmt
if: matrix.kind == 'lint'
Expand Down
6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

47 changes: 47 additions & 0 deletions Releases.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,53 @@ https://github.com/denoland/deno/releases
We also have one-line install commands at
https://github.com/denoland/deno_install

### v0.36.0 / 2020.03.11

- BREAKING CHANGE: Remove Deno.errors.Other (#4249)
- BREAKING CHANGE: Rename readDir -> readdir (#4225)
- feat(std/encoding): add binary module (#4274)
- feat(std/node): add appendFile and appendFileSync (#4294)
- feat(std/node): add directory classes (#4087)
- feat(std/node): add os.tmpdir() implementation (#4213)
- feat: Add Deno.umask (#4290)
- feat: Add global --quiet flag (#4135)
- feat: Improvements to std/flags. (#4279)
- feat: Make internel error frames dimmer (#4201)
- feat: Support async function and EventListenerObject as listeners (#4240)
- feat: add actual error class to fail message (#4305)
- feat: seek should return cursor position (#4211)
- feat: support permission mode in mkdir (#4286)
- feat: update metrics to track different op types (#4221)
- fix: Add content type for wasm, fix encoding in wasm test fixture (#4269)
- fix: Add waker to StreamResource to fix hang on close bugs (#4293)
- fix: Flattens dispatch error handling to produce one less useless stack frame
on op errors. (#4189)
- fix: JavaScript dependencies in bundles. (#4215)
- fix: Stricter permissions for Deno.makeTemp (#4318)
- fix: `deno install` file name including extra dot on Windows (#4243)
- fix: inlining of lib.dom.iterable.d.ts. (#4242)
- fix: properly close FsEventsResource (#4266)
- fix: remove unwanted ANSI Reset Sequence (#4268)
- perf: use Object instead of Map for promise table (#4309)
- perf: use subarray instead of slice in dispatch minimal (#4180)
- refactor(cli/js): add assertOps and assertResources sanitizer in cli/js/ unit
tests (#4209, #4161)
- refactor(cli/js/net): Cleanup iterable APIs (#4236)
- refactor(core): improve exception handling(#4214, #4214, #4198)
- refactor(core): rename structures related to Modules (#4217)
- refactor: Cleanup options object parameters (#4296)
- refactor: Migrate internal bundles to System (#4233)
- refactor: Rename Option -> Options (#4226)
- refactor: cleanup compiler runtimes (#4230)
- refactor: preliminary cleanup of Deno.runTests() (#4237)
- refactor: reduce unnecesarry output in cli/js tests (#4182)
- refactor: reorganize cli/js (#4317, #4316, #4310, #4250, #4302, #4283, #4264)
- refactor: rewrite testPerm into unitTest (#4231)
- refactor: uncomment tests broken tests, use skip (#4311)
- upgrade: dprint 0.8.0 (#4308, #4314)
- upgrade: rust dependencies (#4270)
- upgrade: typescript 3.8.3 (#4301)

### v0.35.0 / 2020.02.28

- feat: Deno.fsEvents() (#3452)
Expand Down
10 changes: 5 additions & 5 deletions cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[package]
name = "deno"
version = "0.35.0"
version = "0.36.0"
license = "MIT"
authors = ["the Deno authors"]
edition = "2018"
Expand All @@ -19,12 +19,12 @@ name = "deno"
path = "main.rs"

[build-dependencies]
deno_core = { path = "../core", version = "0.35.0" }
deno_typescript = { path = "../deno_typescript", version = "0.35.0" }
deno_core = { path = "../core", version = "0.36.0" }
deno_typescript = { path = "../deno_typescript", version = "0.36.0" }

[dependencies]
deno_core = { path = "../core", version = "0.35.0" }
deno_typescript = { path = "../deno_typescript", version = "0.35.0" }
deno_core = { path = "../core", version = "0.36.0" }
deno_typescript = { path = "../deno_typescript", version = "0.36.0" }

atty = "0.2.14"
base64 = "0.11.0"
Expand Down
107 changes: 40 additions & 67 deletions cli/flags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,26 +176,20 @@ static ENV_VARIABLES_HELP: &str = "ENVIRONMENT VARIABLES:
static DENO_HELP: &str = "A secure JavaScript and TypeScript runtime
Docs: https://deno.land/std/manual.md
Modules: https://deno.land/x/
Modules: https://deno.land/std/ https://deno.land/x/
Bugs: https://github.com/denoland/deno/issues
To run the REPL supply no arguments:
To start the REPL, supply no arguments:
deno
To evaluate code from the command line:
deno eval \"console.log(30933 + 404)\"
To execute a script:
deno run https://deno.land/std/examples/welcome.ts
deno https://deno.land/std/examples/welcome.ts
The default subcommand is 'run'. The above is equivalent to
deno run https://deno.land/std/examples/welcome.ts
To evaluate code in the shell:
deno eval \"console.log(30933 + 404)\"
See 'deno help run' for run specific flags.";
Run 'deno help run' for 'run'-specific flags.";

lazy_static! {
static ref LONG_VERSION: String = format!(
Expand Down Expand Up @@ -545,7 +539,6 @@ fn types_subcommand<'a, 'b>() -> App<'a, 'b> {
.about("Print runtime TypeScript declarations")
.long_about(
"Print runtime TypeScript declarations.
deno types > lib.deno_runtime.d.ts
The declaration file could be saved and used for typing information.",
Expand All @@ -556,15 +549,12 @@ fn fmt_subcommand<'a, 'b>() -> App<'a, 'b> {
SubCommand::with_name("fmt")
.about("Format source files")
.long_about(
"Auto-format JavaScript/TypeScript source code
"Auto-format JavaScript/TypeScript source code.
deno fmt
deno fmt myfile1.ts myfile2.ts
deno fmt --check
# Format stdin and write to stdout
Format stdin and write to stdout:
cat file.ts | deno fmt -",
)
.arg(
Expand Down Expand Up @@ -619,13 +609,10 @@ fn install_subcommand<'a, 'b>() -> App<'a, 'b> {
.long_about(
"Installs a script as executable. The default installation directory is
$HOME/.deno/bin and it must be added to the path manually.
deno install --allow-net --allow-read file_server https://deno.land/std/http/file_server.ts
deno install colors https://deno.land/std/examples/colors.ts
To change installation directory use -d/--dir flag
To change installation directory use -d/--dir flag:
deno install --allow-net --allow-read -d /usr/local/bin file_server https://deno.land/std/http/file_server.ts")
}

Expand All @@ -641,13 +628,10 @@ fn bundle_subcommand<'a, 'b>() -> App<'a, 'b> {
.about("Bundle module and dependencies into single file")
.long_about(
"Output a single JavaScript file with all dependencies.
deno bundle https://deno.land/std/examples/colors.ts colors.bundle.js
If a out_file argument is omitted, the output of the bundle will be sent to
standard out. Examples:
deno bundle https://deno.land/std/examples/colors.ts
deno bundle https://deno.land/std/examples/colors.ts colors.bundle.js",
If no output file is given, the output is written to standard output:
deno bundle https://deno.land/std/examples/colors.ts",
)
}

Expand All @@ -662,9 +646,6 @@ fn completions_subcommand<'a, 'b>() -> App<'a, 'b> {
.about("Generate shell completions")
.long_about(
"Output shell completion script to standard output.
Example:
deno completions bash > /usr/local/etc/bash_completion.d/deno.bash
source /usr/local/etc/bash_completion.d/deno.bash",
)
Expand All @@ -675,16 +656,13 @@ fn eval_subcommand<'a, 'b>() -> App<'a, 'b> {
.arg(ca_file_arg())
.about("Eval script")
.long_about(
"Evaluate JavaScript from command-line
This command has implicit access to all permissions (--allow-all)
"Evaluate JavaScript from the command line.
deno eval \"console.log('hello world')\"
To evaluate as TypeScript:
deno eval -T \"const v: string = 'hello'; console.log(v)\"
",
This command has implicit access to all permissions (--allow-all).",
)
.arg(
Arg::with_name("ts")
Expand All @@ -702,23 +680,24 @@ fn info_subcommand<'a, 'b>() -> App<'a, 'b> {
SubCommand::with_name("info")
.about("Show info about cache or info related to source file")
.long_about(
"Information about source file and cache
"Information about a module or the cache directories.
Example: deno info https://deno.land/std/http/file_server.ts
Get information about a module:
deno info https://deno.land/std/http/file_server.ts
The following information is shown:
local: Local path of the file.
type: JavaScript, TypeScript, or JSON.
compiled: Local path of compiled source code (TypeScript only)
map: Local path of source map (TypeScript only)
compiled: Local path of compiled source code. (TypeScript only.)
map: Local path of source map. (TypeScript only.)
deps: Dependency tree of the source file.
Without any additional arguments 'deno info' shows:
Without any additional arguments, 'deno info' shows:
DENO_DIR: directory containing Deno-related files
Remote modules cache: directory containing remote modules
TypeScript compiler cache: directory containing TS compiler output",
DENO_DIR: Directory containing Deno-managed files.
Remote modules cache: Subdirectory containing downloaded remote modules.
TypeScript compiler cache: Subdirectory containing TS compiler output.",
)
.arg(Arg::with_name("file").takes_value(true).required(false))
.arg(ca_file_arg())
Expand All @@ -743,17 +722,12 @@ fn fetch_subcommand<'a, 'b>() -> App<'a, 'b> {
.long_about(
"Fetch and compile remote dependencies recursively.
Downloads all statically imported scripts and save them in local
cache, without running the code. No future import network requests
would be made unless --reload is specified.
Downloads all dependencies
Download and compile a module with all of its static dependencies and save them
in the local cache, without running any code:
deno fetch https://deno.land/std/http/file_server.ts
Once cached, static imports no longer send network requests
deno run -A https://deno.land/std/http/file_server.ts",
Future runs of this module will trigger no downloads or compilation unless
--reload is specified.",
)
}

Expand Down Expand Up @@ -846,25 +820,21 @@ fn run_subcommand<'a, 'b>() -> App<'a, 'b> {
run_test_args(SubCommand::with_name("run"))
.setting(AppSettings::TrailingVarArg)
.arg(script_arg())
.about("Run a program given a filename or url to the source code")
.about("Run a program given a filename or url to the module")
.long_about(
"Run a program given a filename or url to the source code.
"Run a program given a filename or url to the module.
By default all programs are run in sandbox without access to disk, network or
ability to spawn subprocesses.
deno run https://deno.land/std/examples/welcome.ts
With all permissions
Grant all permissions:
deno run -A https://deno.land/std/http/file_server.ts
With only permission to read from disk and listen to network
deno run --allow-net --allow-read https://deno.land/std/http/file_server.ts
With only permission to read whitelist files from disk
Grant permission to read from disk and listen to network:
deno run --allow-read --allow-net https://deno.land/std/http/file_server.ts
Grant permission to read whitelisted files from disk:
deno run --allow-read=/etc https://deno.land/std/http/file_server.ts",
)
}
Expand Down Expand Up @@ -892,11 +862,14 @@ fn test_subcommand<'a, 'b>() -> App<'a, 'b> {
)
.about("Run tests")
.long_about(
"Run tests using test runner
"Run tests using Deno's built-in test runner.
Searches the specified directories for all files that end in _test.ts or
_test.js and executes them.
Evaluate the given modules, run all tests declared with 'Deno.test()' and
report results to standard output:
deno test src/fetch_test.ts src/signal_test.ts
Directory arguments are expanded to all contained files matching the glob
{*_,}test.{js,ts,jsx,tsx}:
deno test src/",
)
}
Expand Down
14 changes: 7 additions & 7 deletions cli/fmt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ fn is_supported(path: &Path) -> bool {
}

fn get_config() -> dprint::configuration::Configuration {
dprint::configuration::ConfigurationBuilder::new()
use dprint::configuration::*;
ConfigurationBuilder::new()
.line_width(80)
.indent_width(2)
.next_control_flow_position(
dprint::configuration::NextControlFlowPosition::SameLine,
)
.binary_expression_operator_position(
dprint::configuration::OperatorPosition::SameLine,
)
.next_control_flow_position(NextControlFlowPosition::SameLine)
.binary_expression_operator_position(OperatorPosition::SameLine)
.brace_position(BracePosition::SameLine) // default is NextLineIfHanging
.comment_line_force_space_after_slashes(false)
.construct_signature_space_after_new_keyword(true)
.build()
}

Expand Down
Loading

0 comments on commit af428e8

Please sign in to comment.