summaryrefslogtreecommitdiff
path: root/cli/tools/coverage/mod.rs
AgeCommit message (Collapse)Author
2023-06-26chore: fix typos (#19572)Martin Fischer
2023-05-01refactor(cli): remove ProcState - add CliFactory (#18900)David Sherret
This removes `ProcState` and replaces it with a new `CliFactory` which initializes our "service structs" on demand. This isn't a performance improvement at the moment for `deno run`, but might unlock performance improvements in the future.
2023-04-19fix(test/coverage): exclude test files (#18748)Levente Kurusa
Fixes: #18454
2023-04-14refactor: break up `ProcState` (#18707)David Sherret
1. Breaks up functionality within `ProcState` into several other structs to break out the responsibilities (`ProcState` is only a data struct now). 2. Moves towards being able to inject dependencies more easily and have functionality only require what it needs. 3. Exposes `Arc<T>` around the "service structs" instead of it being embedded within them. The idea behind embedding them was to reduce the verbosity of needing to pass around `Arc<...>`, but I don't think it was exactly working and as we move more of these structs to be more injectable I don't think the extra verbosity will be a big deal.
2023-04-13refactor(cli): add `Emitter` struct (#18690)David Sherret
Removes the functions in the `emit` module and replaces them with an `Emitter` struct that can have "ctor dependencies" injected rather than using functions to pass along the dependencies. This is part of a long term refactor to move more functionality out of proc state.
2023-04-12refactor: `ProcState::build` -> `ProcState::from_flags` (#18672)David Sherret
2023-04-04refactor(core): Improve ergonomics of managing ASCII strings (#18498)Matt Mastracci
This is a follow-on to the earlier work in reducing string copies, mainly focused on ensuring that ASCII strings are easy to provide to the JS runtime. While we are replacing a 16-byte reference in a number of places with a 24-byte structure (measured via `std::mem::size_of`), the reduction in copies wins out over the additional size of the arguments passed into functions. Benchmarking shows approximately the same if not slightly less wallclock time/instructions retired, but I believe this continues to open up further refactoring opportunities.
2023-03-30fix(coverage): ignore files from npm registry (#18457)Geert-Jan Zwiers
Fixes https://github.com/denoland/deno/issues/17664 and part of https://github.com/denoland/deno/issues/18454 by excluding files belonging to npm modules by default in the coverage output.
2023-03-21perf(core) Reduce script name and script code copies (#18298)Matt Mastracci
Reduce the number of copies and allocations of script code by carrying around ownership/reference information from creation time. As an advantage, this allows us to maintain the identity of `&'static str`-based scripts and use v8's external 1-byte strings (to avoid incorrectly passing non-ASCII strings, debug `assert!`s gate all string reference paths). Benchmark results: Perf improvements -- ~0.1 - 0.2ms faster, but should reduce garbage w/external strings and reduces data copies overall. May also unlock some more interesting optimizations in the future. This requires adding some generics to functions, but manual monomorphization has been applied (outer/inner function) to avoid code bloat.
2023-03-15refactor: remove usages of `map_or` / `map_or_else` (#18212)David Sherret
These methods are confusing because the arguments are backwards. I feel like they should have never been added to `Option<T>` and that clippy should suggest rewriting to `map(...).unwrap_or(...)`/`map(...).unwrap_or_else(|| ...)` https://github.com/rust-lang/rfcs/issues/1025
2023-03-14refactor(core): resolve_url_or_path and resolve_url_or_path_deprecated (#18170)Bartek Iwańczuk
This commit changes current "deno_core::resolve_url_or_path" API to "resolve_url_or_path_deprecated" and adds new "resolve_url_or_path" API that requires to explicitly pass the directory from which paths should be resolved to. Some of the call sites were updated to use the new API, the reminder of them will be updated in a follow up PR. Towards landing https://github.com/denoland/deno/pull/15454
2023-03-08refactor: rename InternalModuleLoader to ExtModuleLoader, use ext: scheme ↵Bartek Iwańczuk
for snapshotted modules (#18041) This commit renames "deno_core::InternalModuleLoader" to "ExtModuleLoader" and changes the specifiers used by the modules loaded from this loader to "ext:". "internal:" scheme was really ambiguous and it's more characters than "ext:", which should result in slightly smaller snapshot size. Closes https://github.com/denoland/deno/issues/18020
2023-02-05 refactor: rename `deno` specifiers to `internal` (#17655)Leo Kettmeir
2023-01-27chore: upgrade to Rust 1.67 (#17548)David Sherret
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-01-14chore: use rustfmt imports_granularity option (#17421)Divy Srivastava
Closes https://github.com/denoland/deno/issues/2699 Closes https://github.com/denoland/deno/issues/2347 Uses unstable rustfmt features. Since dprint invokes `rustfmt` we do not need to switch the cargo toolchain to nightly. Do we care about formatting stability of our codebase across Rust versions? (I don't)
2023-01-13refactor(coverage): use FileFlags struct (#17388)Geert-Jan Zwiers
2023-01-02chore: update copyright year to 2023 (#17247)David Sherret
Yearly tradition of creating extra noise in git.
2022-12-09refactor: cleanup main.rs (#16996)David Sherret
1. Extracts out some code from main.rs 2. Inlines all the `x_command` functions in main.rs
2022-12-07feat: ignore `node_modules` and `.git` folders when collecting files ↵David Sherret
everywhere (#16862) We currently only do this for fmt. This makes it so they're excluded by default, but you can still opt into these directories by explicitly specifying them.
2022-11-29fix(coverage): Error if the emit cache is invalid (#16850)sigmaSd
2022-11-28refactor: create util folder, move nap_sym to napi/sym, move http_cache to ↵David Sherret
cache folder (#16857)
2022-07-20fix(coverage): do not verify emit source hash for coverage (#15260)David Sherret
2022-07-19feat: emit files on demand and fix racy emit (#15220)David Sherret
2022-07-12perf: use emit from swc instead of tsc (#15118)David Sherret
2022-07-11fix(coverage): better handling of multi-byte characters (#15159)David Sherret
2022-06-28refactor: add `RootConfig` (#14985)David Sherret
2022-06-27refactor: create `args` folder (#14982)David Sherret
2022-05-22fix(coverage): do not report transpiled files with no lines (#14699)Colin Ihrig
This commit omits files from the coverage report that have no lines of code to report coverage for. Fixes: https://github.com/denoland/deno/issues/14683
2022-05-20refactor: upgrade to deno_ast 0.15 (#14680)David Sherret
2022-05-04fix(coverage): exclude .snap files (#14480)Geert-Jan Zwiers
2022-04-15refactor: Move source map lookups to core (#14274)Nayeem Rahman
The following transformations gradually faced by "JsError" have all been moved up front to "JsError::from_v8_exception()": - finding the first non-"deno:" source line; - moving "JsError::script_resource_name" etc. into the first error stack in case of syntax errors; - source mapping "JsError::script_resource_name" etc. when wrapping the error even though the frame locations are source mapped earlier; - removing "JsError::{script_resource_name,line_number,start_column,end_column}" entirely in favour of "js_error.frames.get(0)". We also no longer pass a js-side callback to "core/02_error.js" from cli. I avoided doing this on previous occasions because the source map lookups were in an awkward place.
2022-03-29chore: upgrade dprint-core to 0.54.1 (#14146)David Sherret
2022-02-24chore: upgrade to Rust 1.59 (#13767)David Sherret
2022-02-15feat(coverage): add "--output" flag (#13289)VishnuJin
This commit adds "--output" to "deno coverage" subcommand. It can be used instead of piping output to a file. Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2022-02-11refactor: use `Arc` instead of making copies of `Flags` struct (#13610)Maxim
2022-02-07refactor: factor out CDP message types (#13551)Leo Kettmeir
2022-01-31Revert "refactor: factor out CDP message types (#13501)" (#13540)Bartek Iwańczuk
This reverts commit 382a978859a7a7a4351542be818bb2e59523429c.
2022-01-27refactor: factor out CDP message types (#13501)Leo Kettmeir
2022-01-11fix(coverage): merge coverage ranges (#13334)Bartek Iwańczuk
Covered ranges were not merged and thus it appeared that some lines might be uncovered. To fix this I used "v8-coverage" that takes care of merging the ranges properly. With this change, coverage collected from a file by multiple entrypoints is now correctly calculated. I ended up forking https://github.com/demurgos/v8-coverage and adding "cli/tools/coverage/merge.rs" and "cli/tools/coverage/range_tree.rs".