monocart-coverage-reports 2.13.2 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +267 -114
- package/README.zh-Hans.md +268 -115
- package/lib/assets.js +6 -6
- package/lib/cli.js +191 -95
- package/lib/client/cdp-client.js +74 -43
- package/lib/client/coverage-client.js +24 -8
- package/lib/client/ws-session.js +115 -37
- package/lib/converter/ast-visitor.js +5 -7
- package/lib/converter/ast.js +6 -6
- package/lib/converter/collect-source-maps.js +9 -9
- package/lib/converter/converter.js +41 -115
- package/lib/converter/fake-source-coverage.js +64 -0
- package/lib/converter/find-original-range.js +3 -3
- package/lib/converter/flatten-source-maps.js +2 -4
- package/lib/converter/ignore.js +2 -4
- package/lib/converter/info-branch.js +5 -3
- package/lib/converter/info-function.js +5 -3
- package/lib/converter/info-statement.js +5 -3
- package/lib/converter/range-index.js +78 -0
- package/lib/converter/source-range-merge.js +103 -0
- package/lib/converter/untested.js +27 -55
- package/lib/default/options.js +13 -1
- package/lib/generate.js +44 -26
- package/lib/index.d.ts +52 -4
- package/lib/index.js +35 -41
- package/lib/istanbul/istanbul-summary.js +2 -2
- package/lib/istanbul/istanbul.js +35 -13
- package/lib/packages/chunks/chunk-RVOSNMVU.js +2 -0
- package/lib/packages/monocart-coverage-assets.js +4 -3
- package/lib/packages/monocart-coverage-converter.js +27 -0
- package/lib/packages/monocart-coverage-vendor.js +2 -41
- package/lib/packages/monocart-coverage-vendor.js.LICENSE +3 -221
- package/lib/platform/concurrency.js +47 -43
- package/lib/platform/share.js +1 -1
- package/lib/register/hooks.js +19 -13
- package/lib/register/register.js +5 -3
- package/lib/reports/codacy.js +3 -5
- package/lib/reports/codecov.js +3 -5
- package/lib/reports/console-details.js +5 -5
- package/lib/reports/console-summary.js +4 -4
- package/lib/reports/custom.js +8 -24
- package/lib/reports/markdown-details.js +4 -6
- package/lib/reports/markdown-summary.js +4 -6
- package/lib/reports/raw.js +10 -12
- package/lib/reports/v8-json.js +3 -5
- package/lib/reports/v8.js +3 -5
- package/lib/utils/dedupe.js +1 -1
- package/lib/utils/gc.js +30 -14
- package/lib/utils/markdown.js +2 -2
- package/lib/utils/merge/merge.js +2 -4
- package/lib/utils/merge/range-tree.js +1 -1
- package/lib/utils/request.js +85 -73
- package/lib/utils/snapshot.js +4 -4
- package/lib/utils/source-path.js +5 -5
- package/lib/utils/util.js +61 -41
- package/lib/v8/v8-summary.js +2 -4
- package/lib/v8/v8.js +11 -11
- package/migrate-to-3.md +175 -0
- package/package.json +153 -149
- package/skills/monocart-coverage-reports/SKILL.md +106 -0
- package/skills/monocart-coverage-reports/references/cli.md +108 -0
- package/skills/monocart-coverage-reports/references/collection.md +152 -0
- package/skills/monocart-coverage-reports/references/filtering-and-sourcemaps.md +170 -0
- package/skills/monocart-coverage-reports/references/reports-and-ci.md +219 -0
- package/skills/monocart-coverage-reports/references/repository-map.md +55 -0
- package/lib/index.mjs +0 -9
- package/lib/register/hooks.mjs +0 -3
- package/lib/register/register.mjs +0 -3
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Repository navigation and maintenance
|
|
2
|
+
|
|
3
|
+
This is a map of project source files, **not** a JavaScript sourcemap specification. For coverage sourcemaps read [filtering-and-sourcemaps.md](filtering-and-sourcemaps.md).
|
|
4
|
+
|
|
5
|
+
## Installed-package authority
|
|
6
|
+
|
|
7
|
+
From the host application's root:
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
node -p "require.resolve('monocart-coverage-reports/package.json')"
|
|
11
|
+
node -p "require.resolve('monocart-coverage-reports')"
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Resolve the manifest's `types` relative to its package directory (current path: `lib/index.d.ts`). Read the installed declarations and `lib/default/options.js` before inventing an API. `README.md`, `README.zh-Hans.md`, and `migrate-to-3.md` describe integration/version behavior. File inspection inside `lib/` does not make those files public package exports. Do not import arbitrary internals into a host application.
|
|
15
|
+
|
|
16
|
+
Current exports: main API, `/register` source-capture preload, `/converter` and `/util` named exports, `/package.json`, and `/skills/*` file resolution. Use the high-level API unless a task explicitly requires lower-level conversion.
|
|
17
|
+
|
|
18
|
+
## Checkout navigation
|
|
19
|
+
|
|
20
|
+
Paths below are relative to the repository root and are generally **not shipped in npm** except `lib/`.
|
|
21
|
+
|
|
22
|
+
| Task | Read first | Related validation / examples |
|
|
23
|
+
| --- | --- | --- |
|
|
24
|
+
| Public factory, config, cache lifecycle | `lib/index.js`, `lib/index.d.ts`, `lib/default/options.js` | `test/unit/config.test.js`, `test/unit/esm.test.js` |
|
|
25
|
+
| CLI execution, test targets, signals | `lib/cli.js` | `test/unit/cli-test.test.js`, `test/unit/cli-signal.test.js`, `test/specs/node.test.js` |
|
|
26
|
+
| Input reading/merge/report dispatch | `lib/generate.js` | `test/test-merge.js`, `test/test-merge-v8.js`, `test/test-merge-istanbul.js` |
|
|
27
|
+
| Source capture/import hooks | `lib/register/register.js`, `lib/register/hooks.js` | `test/unit/register.test.js`, `test/unit/source-map-comments.test.js` |
|
|
28
|
+
| CDP/WebSocket collection | `lib/client/cdp-client.js`, `lib/client/coverage-client.js`, `lib/client/ws-session.js` | `test/test-client.js`, `test/unit/ws-session.test.js` |
|
|
29
|
+
| Node capture workflows | `test/test-node-env.js`, `test/test-node-api.js`, `test/test-node-ins.js` | `test/test-node-cdp.js`, `test/test-node-vm.js` |
|
|
30
|
+
| Browser data shapes | `test/test-v8.js`, `test/test-puppeteer.js`, `test/test-css.js` | `test/test-istanbul.js` |
|
|
31
|
+
| Conversion and sourcemaps | `lib/converter/converter.js`, `lib/converter/collect-source-maps.js`, `lib/converter/find-original-range.js` | `test/test-esbuild.js`, `test/test-rollup.js`, `test/test-swc.js` |
|
|
32
|
+
| AST metrics/ignore/untested sources | `lib/converter/ast.js`, `lib/converter/ast-visitor.js`, `lib/converter/ignore.js`, `lib/converter/untested.js` | `test/test-v8.js`, `test/test-sections.js` |
|
|
33
|
+
| Filters and normalized paths | `lib/utils/util.js`, `lib/utils/source-path.js`, `lib/generate.js` | `test/unit/output-filter.test.js`, `test/unit/source-path.test.js` |
|
|
34
|
+
| Native V8/Istanbul generation | `lib/v8/v8.js`, `lib/istanbul/istanbul.js`, `lib/reports/` | `test/test-v8-and-istanbul.js`, custom reporter examples under `test/` |
|
|
35
|
+
| Snapshots | `lib/utils/snapshot.js` | `test/check-snapshot.js`, `test/snapshot/` |
|
|
36
|
+
| Report UI | `src/app/`, `src/vendor/`, `vite.config.mjs` | `npm run dev`, `npm run build` |
|
|
37
|
+
| Runtime compatibility / upgrade | `migrate-to-3.md`, `scripts/test-runtime.js` | `test/unit/node-version.test.js` |
|
|
38
|
+
|
|
39
|
+
## Development validation
|
|
40
|
+
|
|
41
|
+
Read current `package.json` scripts before running them. Typical commands from a checkout with dependencies installed:
|
|
42
|
+
|
|
43
|
+
```sh
|
|
44
|
+
npm run test-unit
|
|
45
|
+
npm run test-types
|
|
46
|
+
npm run test-runtime
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Unit tests run directly with `node:test`, independently of the MCR CLI and coverage pipeline. For a focused test: `node --test test/unit/config.test.js`. Run `npm run test-unit-coverage` separately to collect coverage through `mcr test`; reports are written to `.temp/coverage-unit/`. For focused coverage: `node ./lib/cli.js test -c test/mcr.config.unit.js test/unit/config.test.js`. Browser/integration scripts may require downloaded browsers, built fixtures, local servers, and more time; inspect the relevant script before running it. `npm run build` invokes `postbuild` and builds test fixtures. `npm test` also runs integration/report generation and documentation generation; it is not a lightweight unit-only check.
|
|
50
|
+
|
|
51
|
+
Avoid unrelated generated changes. `npm run lint` currently includes `--fix`; inspect its scope before invoking it. Do not edit generated `lib/packages/*`, `lib/assets.js`, `dist/`, `docs/`, or snapshots just to hide a source defect; use the project's build/generation workflow when those artifacts genuinely need updating.
|
|
52
|
+
|
|
53
|
+
When changing public behavior, align implementation, `lib/index.d.ts`, default options, English/Chinese docs, migration notes where applicable, and focused tests. This skill supports MCR 3.x only. Validate the installed package separately when release compatibility matters; do not infer support for other major versions from these recipes.
|
|
54
|
+
|
|
55
|
+
For changes to this skill, verify relative Markdown links, public resolution of `SKILL.md`, npm pack inclusion of **all** references, and any executable examples affected by the API change.
|
package/lib/index.mjs
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import MCR from './index.js';
|
|
2
|
-
export default MCR;
|
|
3
|
-
export const CoverageReport = MCR.CoverageReport;
|
|
4
|
-
export const getSnapshot = MCR.getSnapshot;
|
|
5
|
-
export const diffSnapshot = MCR.diffSnapshot;
|
|
6
|
-
|
|
7
|
-
export const WSSession = MCR.WSSession;
|
|
8
|
-
export const CDPClient = MCR.CDPClient;
|
|
9
|
-
export const Util = MCR.Util;
|
package/lib/register/hooks.mjs
DELETED