summaryrefslogtreecommitdiff
path: root/cli/main.rs
AgeCommit message (Collapse)Author
2021-06-29feat: Add "deno_net" extension (#11150)Bartek Iwańczuk
This commits moves implementation of net related APIs available on "Deno" namespace to "deno_net" extension. Following APIs were moved: - Deno.listen() - Deno.connect() - Deno.listenTls() - Deno.serveHttp() - Deno.shutdown() - Deno.resolveDns() - Deno.listenDatagram() - Deno.startTls() - Deno.Conn - Deno.Listener - Deno.DatagramConn
2021-06-22chore: use lsp to get parent process id (#11083)David Sherret
Removes the previously added internal `--parent-pid` flag. This solution is better.
2021-06-22feat: transfer MessagePort between workers (#11076)Luca Casonato
Add support for transferring `MessagePort`s between workers.
2021-06-22refactor: unify JavaScript script execution method (#11043)Bartek Iwańczuk
This commit renames "JsRuntime::execute" to "JsRuntime::execute_script". Additionally same renames were applied to methods on "deno_runtime::Worker" and "deno_runtime::WebWorker". A new macro was added to "deno_core" called "located_script_name" which returns the name of Rust file alongside line no and col no of that call site. This macro is useful in combination with "JsRuntime::execute_script" and allows to provide accurate place where "one-off" JavaScript scripts are executed for internal runtime functions. Co-authored-by: Nayeem Rahman <nayeemrmn99@gmail.com>
2021-06-22feat(cli): support "types" when type checking (#10999)Kitson Kelly
Fixes #10677
2021-06-21refactor(core): always attach inspector to isolate (#11042)Bartek Iwańczuk
This commit changes "deno_core::JsRuntime" to always create "deno_core::JsRuntimeInspector" instance.
2021-06-19fix(core/modules): Prepare modules only once per runtime (#11015)Nayeem Rahman
This commit changes module loading implementation in "deno_core" to call "ModuleLoader::prepare" hook only once per entry point. This is done to avoid multiple type checking of the same code in case of duplicated dynamic imports. Relevant code in "cli/module_graph.rs" was updated as well.
2021-06-17chore(lsp): add `--parent-pid <pid>` flag (#11023)David Sherret
This commit adds a new `--parent-pid <pid>` flag to `deno lsp` that when provided starts a task that checks for the existence of the provided process id (ex. vscode's) every 30 seconds. If the process doesn't exist (meaning the deno process has nothing interacting with it), then it terminates itself.
2021-06-10refactor: use join instead of format! (#10921)Bartek Iwańczuk
2021-06-10refactor: merge deno_file crate into deno_web (#10914)Bartek Iwańczuk
This refactor makes it so there's one less crate to publish on each release.
2021-06-03fix(cli): output json with trailing newline character (#10830)Yusuke Tanaka
2021-05-31fix: running subcommand with coverage collection (#10802)Bartek Iwańczuk
2021-05-27feat(cli): add origin data dir to deno info (#10589)crowlKats
Co-authored-by: Nayeem Rahman <nayeemrmn99@gmail.com> Co-authored-by: Luca Casonato <lucacasonato@yahoo.com> Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
2021-05-26refactor: move JsRuntimeInspector to deno_core (#10763)Bartek Iwańczuk
This commit moves implementation of "JsRuntimeInspector" to "deno_core" crate. To achieve that following changes were made: * "Worker" and "WebWorker" no longer own instance of "JsRuntimeInspector", instead it is now owned by "deno_core::JsRuntime". * Consequently polling of inspector is no longer done in "Worker"/"WebWorker", instead it's done in "deno_core::JsRuntime::poll_event_loop". * "deno_core::JsRuntime::poll_event_loop" and "deno_core::JsRuntime::run_event_loop", now accept "wait_for_inspector" boolean that tells if event loop should still be "pending" if there are active inspector sessions - this change fixes the problem that inspector disconnects from the frontend and process exits once the code has stopped executing.
2021-05-26refactor: Rewrite Inspector implementation (#10725)Bartek Iwańczuk
This commit refactors implementation of inspector. The intention is to be able to move inspector implementation to "deno_core". Following things were done to make that possible: * "runtime/inspector.rs" was split into "runtime/inspector/mod.rs" and "runtime/inspector/server.rs", separating inspector implementation from Websocket server implementation. * "DenoInspector" was renamed to "JsRuntimeInspector" and reference to "server" was removed from the structure, making it independent of Websocket server used to connect to Chrome Devtools. * "WebsocketSession" was renamed to "InspectorSession" and rewritten in such a way that it's not tied to Websockets anymore; instead it accepts a pair of "proxy" channel ends that allow to integrate the session with different "transports". * "InspectorSession" was renamed to "LocalInspectorSession" to better indicate that it's an "in-memory" session and doesn't require Websocket server. It was also rewritten in such a way that it uses "InspectorSession" from previous point instead of reimplementing "v8::inspector::ChannelImpl" trait; this is done by using the "proxy" channels to communicate with the V8 session. Consequently "LocalInspectorSession" is now a frontend to "InspectorSession". This introduces a small inconvenience that awaiting responses for "LocalInspectorSession" requires to concurrently poll worker's event loop. This arises from the fact that "InspectorSession" is now owned by "JsRuntimeInspector", which in turn is owned by "Worker" or "WebWorker". To ease this situation "Worker::with_event_loop" helper method was added, that takes a future and concurrently polls it along with the event loop (using "tokio::select!" macro inside a loop).
2021-05-23feat(extensions): BroadcastChannel WPT conformanceBen Noordhuis
Replaces the file-backed provider by an in-memory one because proper file locking is a hard problem that detracts from the proof of concept. Teach the WPT runner how to extract tests from .html files because all the relevant tests in test_util/wpt/webmessaging/broadcastchannel are inside basics.html and interface.html.
2021-05-23feat(extensions): add BroadcastChannelBen Noordhuis
Co-Authored-By: Ben Noordhuis <info@bnoordhuis.nl> Fixes: #10354
2021-05-21fix(test): ensure coverage dir exists (#10717)Yoshiya Hinosawa
2021-05-19fix(cli): canonicalize coverage dir (#10364)Casper Beyer
2021-05-17fix: static import permissions in dynamic importsLuca Casonato
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2021-05-11feat(lsp): add internal debugging logging (#10438)Kitson Kelly
Ref: #10368
2021-05-11feat(test): add support for type checking documentation (#10521)Casper Beyer
This commit adds support for type checking codeblocks in the JS doc comments.
2021-05-10refactor(cli): replace loading file for --config flag with generic structure ↵Bartek Iwańczuk
(#10481) Currently file passed to --config file is parsed using TsConfig structure that does multiple things when loading the file. Instead of relying on that structure I've introduced ConfigFile structure that can be updated to sniff out more fields from the config file in the future.
2021-05-10feat: add WebStorage API (#7819)crowlKats
This commit introduces localStorage and sessionStorage.
2021-05-10feat: add deno test --watch (#9160)Liam Murphy
This commit implements file watching for deno test. When a file is changed, only the test modules which use it as a dependency are rerun. This is accomplished by reworking the file watching infrastructure to pass the paths which have changed to the resolver, and then constructing a module graph for each test module to check if it contains any changed files.
2021-05-06chore: update wgpu and realign to spec (#9760)Luca Casonato
2021-04-28feat(test): run test modules in parallel (#9815)Casper Beyer
This commit adds support for running test in parallel. Entire test runner functionality has been rewritten from JavaScript to Rust and a set of ops was added to support reporting in Rust. A new "--jobs" flag was added to "deno test" that allows to configure how many threads will be used. When given no value it defaults to 2.
2021-04-27remove --unstable flag from CLI features (#10190)Bartek Iwańczuk
2021-04-26Remove denort optimization (#10350)Ryan Dahl
denort is an optimization to "deno compile" to produce slightly smaller output. It's a decent idea, but causes a lot of negative side-effects: - Deno's link time is a source of constant agony both locally and in CI, denort doubles link time. - The release process is a long and arduous undertaking with many manual steps. denort necessitates an additional manual zip + upload from M1 apple computers. - The "deno compile" interface is complicated with the "--lite" option. This is confusing for uses ("why wouldn't you want lite?"). The benefits of this feature do not outweigh the negatives. We must find a different approach to optimizing "deno compile" output.
2021-04-26remove #![deny(warnings)] (#10376)Ryan Dahl
Prefer RUSTFLAGS="-D warnings" to prevent warnings, but cannot enable yet due to #10378.
2021-04-25feat(cli): add test permissions to Deno.test (#10188)Casper Beyer
This commits adds adds "permissions" option to the test definitions which allows tests to run with different permission sets than the process's permission. The change will only be in effect within the test function, once the test has completed the original process permission set is restored. Test permissions cannot exceed the process's permission. You can only narrow or drop permissions, failure to acquire a permission results in an error being thrown and the test case will fail.
2021-04-25refactor(core): move op cache sync responsibility to rust space (#10340)Aaron O'Mullan
Even if bootstrapping the JS runtime is low level, it's an abstraction leak of core to require users to call `Deno.core.ops()` in JS space. So instead we're introducing a `JsRuntime::sync_ops_cache()` method, once we have runtime extensions a new runtime will ensure the ops cache is setup (for the provided extensions) and then loading/unloading plugins should be the only operations that require op cache syncs
2021-04-13feat(cli): raise file descriptor limit on startup (#10162)Ben Noordhuis
Raise the soft limit to the hard limit when possible. This is similar to what Node.js does to avoid running into "out of file descriptors" errors too quickly. On most Linux systems, raises the limit from 1,024 to 1,048,576. On most macOS systems, raises the limit from 256 to 10,240. Fixes #10148.
2021-04-09feat(lsp): add registry import auto-complete (#9934)Kitson Kelly
2021-04-07feat: blob URL support (#10045)Luca Casonato
This commit adds blob URL support. Blob URLs are stored in a process global storage, that can be accessed from all workers, and the module loader. Blob URLs can be created using `URL.createObjectURL` and revoked using `URL.revokeObjectURL`. This commit does not add support for `fetch`ing blob URLs. This will be added in a follow up commit.
2021-04-06refactor: add deno_file op crate (#10019)Luca Casonato
Also enables WPT for FileReader.
2021-03-26remove macro_use (#9884)Ryan Dahl
2021-03-26fix: include deno.crypto in "deno types" (#9863)Luca Casonato
2021-03-25upgrade: Rust 1.51.0 (#9895)Yusuke Tanaka
2021-03-18fix(cli/bundle): display anyhow error chain (#9822)Andrew Mitchell
2021-03-12refactor: move Console to op_crates/console (#9770)Luca Casonato
2021-03-12chore: split web op crate (#9635)Luca Casonato
This commit starts splitting out the deno_web op crate into multiple smaller crates. This commit splits out WebIDL and URL API, but in the future I want to split out each spec into its own crate. That means we will have (in rough order of loading): `webidl`, `dom`, `streams`, `console`, `encoding`, `url`, `file`, `fetch`, `websocket`, and `webgpu` crates.
2021-03-07fix(cli/compile): do not append .exe depending on target (#9668)Divy Srivastava
2021-03-01feat(cli): represent type dependencies in info (#9630)Kitson Kelly
Fixes #7927
2021-03-01feat: WebGPU API (#7977)crowlKats
Co-authored-by: Luca Casonato <lucacasonato@yahoo.com>
2021-03-01fix: typo in coverage exit_unstable (#9626)Luca Casonato
2021-02-26Improve 'deno lsp' help text (#9610)Ryan Dahl
2021-02-25feat(cli/doc): use type definitions "deno doc" if available (#8459)Liam Murphy
This commit adds support for type definitions in "deno doc"; with this change "deno doc" is able to leverage the same directives as TS compiler. Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2021-02-24feat: add "deno coverage" subcommand (#8664)Casper Beyer
This commit adds a new subcommand called "coverage" which can generate code coverage reports to stdout in multiple formats from code coverage profiles collected to disk. Currently this supports outputting a pretty printed diff and the lcov format for interoperability with third-party services and tools. Code coverage is still collected via other subcommands that run and collect code coverage such as "deno test --coverage=<directory>" but that command no longer prints a pretty printed report at the end of a test run with coverage collection enabled. The restrictions on which files that can be reported on has also been relaxed and are fully controllable with the include and exclude regular expression flags on the coverage subcommand. Co-authored-by: Luca Casonato <lucacasonato@yahoo.com>
2021-02-21feat: add --ext flag to deno eval (#9295)Satya Rohith
This PR deprecates the "--ts"/"-T" flag of "deno eval" (which will later be removed in 2.0) and introduces "--ext" which is used by "deno fmt" for content type selection. This is to ensure we have a single flag that can be used across subcommands to select the language (JS/TS).