summaryrefslogtreecommitdiff
path: root/cli/tools/coverage/mod.rs
AgeCommit message (Collapse)Author
2024-11-13feat(node): stabilize detecting if CJS via `"type": "commonjs"` in a ↵David Sherret
package.json (#26439) This will respect `"type": "commonjs"` in a package.json to determine if `.js`/`.jsx`/`.ts`/.tsx` files are CJS or ESM. If the file is found to be ESM it will be loaded as ESM though.
2024-11-01fix: improved support for cjs and cts modules (#26558)David Sherret
* cts support * better cjs/cts type checking * deno compile cjs/cts support * More efficient detect cjs (going towards stabilization) * Determination of whether .js, .ts, .jsx, or .tsx is cjs or esm is only done after loading * Support `import x = require(...);` Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-10-31fix(coverage): exclude comment lines from coverage reports (#25939)Taku Amano
2024-10-26perf: pass transpiled module to deno_core as known string (#26555)David Sherret
2024-09-20fix(coverage): ignore urls from doc testing (#25736)Yoshiya Hinosawa
2024-07-23fix(upgrade): do not error if config in cwd invalid (#24689)David Sherret
``` > deno upgrade error: Unsupported lockfile version 'invalid'. Try upgrading Deno or recreating the lockfile. V:\scratch > V:\deno\target\debug\deno upgrade Looking up latest version Local deno version 1.45.3 is the most recent release ``` Closes #24517 Closes #20729
2024-07-05refactor: move `FileCollector` to deno_config (#24433)David Sherret
2024-06-05fix: better handling of npm resolution occurring on workers (#24094)David Sherret
Closes https://github.com/denoland/deno/issues/24063
2024-05-28fix(coverage): do not generate script coverage with empty url (#24007)Yoshiya Hinosawa
closes #24004
2024-05-28fix(coverage): skip generating coverage json for http(s) scripts (#24008)Yoshiya Hinosawa
closes #21784
2024-05-28fix(coverage): handle ignore patterns (#23974)Yoshiya Hinosawa
closes #23972
2024-04-19refactor: move redirect handling into deno_graph (#23444)David Sherret
2024-04-16fix(ext/node): dispatch beforeExit/exit events irrespective of listeners ↵Satya Rohith
(#23382) Closes https://github.com/denoland/deno/issues/23342 Closes https://github.com/denoland/deno/issues/21757
2024-03-27fix: less aggressive vendor folder ignoring (#23100)David Sherret
This is slightly breaking as some users want the `vendor` folder excluded and may not have that specified in their deno.json. Closes #22833
2024-03-15fix(coverage): Error if no files are included in the report (#22952)Nathan Whitaker
Fixes #22941. In that case, the only file with coverage was the `test.ts` file. The coverage reporter filters out test files before compiling its report, so after filtering we were left with an empty set of files. Later on it's assumed that there is at least 1 file to be reported on, and we panic. Instead of panicking, just issue an error after filtering.
2024-03-11chore: enable clippy unused_async rule (#22834)David Sherret
2024-03-07fix(publish): make include and exclude work (#22720)David Sherret
1. Stops `deno publish` using some custom include/exclude behaviour from other sub commands 2. Takes ancestor directories into account when resolving gitignore 3. Backards compatible change that adds ability to unexclude an exclude by using a negated glob at a more specific level for all sub commands (see https://github.com/denoland/deno_config/pull/44).
2024-02-15feat(unstable): single checksum per JSR package in the lockfile (#22421)David Sherret
This changes the lockfile to not store JSR specifiers in the "remote" section. Instead a single JSR integrity is stored per package in the lockfile, which is a hash of the version's `x.x.x_meta.json` file, which contains hashes for every file in the package. The hashes in this file are then compared against when loading. Additionally, when using `{ "vendor": true }` in a deno.json, the files can be modified without causing lockfile errors—the checksum is only checked when copying into the vendor folder and not afterwards (eventually we should add this behaviour for non-jsr specifiers as well). As part of this change, the `vendor` folder creation is not always automatic in the LSP and running an explicit cache command is necessary. The code required to track checksums in the LSP would have been too complex for this PR, so that all goes through deno_graph now. The vendoring is still automatic when running from the CLI.
2024-02-13feat: denort binary for `deno compile` (#22205)Divy Srivastava
This introduces the `denort` binary - a slim version of deno without tooling. The binary is used as the default for `deno compile`. Improves `deno compile` final size by ~2.5x (141 MB -> 61 MB) on Linux x86_64.
2024-02-01refactor: load bytes in deno_graph (#22212)David Sherret
Upgrades deno_graph to 0.64 where deno_graph is now responsible for turning bytes into a string. This is in preparation for Wasm modules.
2024-01-18fix(lsp): regression - formatting was broken on windows (#21972)David Sherret
~~Waiting on: https://github.com/denoland/deno_config/pull/31~~ Closes #21971 Closes https://github.com/denoland/vscode_deno/issues/1029
2024-01-15refactor: use globbing from deno_config (#21925)David Sherret
2024-01-10chore: bump deno_core (#21832)Matt Mastracci
2024-01-08perf: skip expanding exclude globs (#21817)David Sherret
We were calling `expand_glob` on our excludes, which is very expensive and unnecessary because we can pattern match while traversing instead. 1. Doesn't expand "exclude" globs. Instead pattern matches while walking the directory. 2. Splits up the "include" into base paths and applicable file patterns. This causes less pattern matching to occur because we're only pattern matching on patterns that might match and not ones in completely unrelated directories.
2024-01-04perf(coverage): faster source mapping (#21783)David Sherret
I did not measure this change (O(n) to O(log n)), but mainly this should be slightly more accurate at getting the line number.
2024-01-01chore: update to Rust 1.75 (#21731)林炳权
2024-01-01chore: update copyright to 2024 (#21753)David Sherret
2023-12-18fix(coverage): error if no files found (#21615)Bartek Iwańczuk
This commit fixes a panic in `deno coverage` command if the file to be covered doesn't produce any coverage data. Fixes https://github.com/denoland/deno/issues/21580
2023-12-11refactor(coverage): separate reporter-related structs (#21528)Yoshiya Hinosawa
2023-12-08feat(coverage): add html reporter (#21495)Yoshiya Hinosawa
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-11-05refactor: unify CDP types in a single module (#21094)Bartek Iwańczuk
This commit moves all Chrome Devtools Protocol messages to `cli/cdp.rs` and refactors all places using these types to pull them from a common place. No functional changes.
2023-10-24fix: improved using declaration support (#20959)David Sherret
Upgrades to deno_ast 0.30.
2023-10-03refactor(npm): break up `NpmModuleLoader` and move more methods into the ↵David Sherret
managed `CliNpmResolver` (#20777) Part of https://github.com/denoland/deno/issues/18967
2023-09-11fix: exclude internal JS files from coverage (#20448)Marvin Hagemeister
2023-09-08fix: empty include in config file excludes all (#20404)Nayeem Rahman
2023-08-06feat(unstable): rename `deno_modules` to `vendor` (#20065)David Sherret
Renames the unstable `deno_modules` directory and corresponding settings to `vendor` after feedback. Also causes the vendoring of the `node_modules` directory which can be disabled via `--node-modules-dir=false` or `"nodeModulesDir": false`.
2023-08-02feat(unstable): optional `deno_modules` directory (#19977)David Sherret
Closes #15633
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