doc-detective 4.4.0 → 4.6.0-next.1
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 +50 -0
- package/bin/runner-entrypoint.js +757 -0
- package/dist/cli.js +37 -1
- package/dist/cli.js.map +1 -1
- package/dist/common/src/schemas/schemas.json +22 -0
- package/dist/common/src/types/generated/config_v3.d.ts +8 -0
- package/dist/common/src/types/generated/config_v3.d.ts.map +1 -1
- package/dist/common/src/types/generated/resolvedTests_v3.d.ts +8 -0
- package/dist/common/src/types/generated/resolvedTests_v3.d.ts.map +1 -1
- package/dist/core/appium.d.ts +3 -1
- package/dist/core/appium.d.ts.map +1 -1
- package/dist/core/appium.js +11 -3
- package/dist/core/appium.js.map +1 -1
- package/dist/core/config.d.ts +1 -1
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +98 -12
- package/dist/core/config.js.map +1 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +85 -1
- package/dist/core/index.js.map +1 -1
- package/dist/core/tests/saveScreenshot.d.ts.map +1 -1
- package/dist/core/tests/saveScreenshot.js +62 -9
- package/dist/core/tests/saveScreenshot.js.map +1 -1
- package/dist/core/tests/stopRecording.d.ts.map +1 -1
- package/dist/core/tests/stopRecording.js +19 -2
- package/dist/core/tests/stopRecording.js.map +1 -1
- package/dist/core/tests.d.ts.map +1 -1
- package/dist/core/tests.js +87 -62
- package/dist/core/tests.js.map +1 -1
- package/dist/core/utils.d.ts +2 -1
- package/dist/core/utils.d.ts.map +1 -1
- package/dist/core/utils.js +45 -6
- package/dist/core/utils.js.map +1 -1
- package/dist/index.cjs +115581 -114521
- package/dist/runtime/browsers.d.ts +64 -0
- package/dist/runtime/browsers.d.ts.map +1 -0
- package/dist/runtime/browsers.js +311 -0
- package/dist/runtime/browsers.js.map +1 -0
- package/dist/runtime/cacheDir.d.ts +45 -0
- package/dist/runtime/cacheDir.d.ts.map +1 -0
- package/dist/runtime/cacheDir.js +207 -0
- package/dist/runtime/cacheDir.js.map +1 -0
- package/dist/runtime/heavyDeps.d.ts +27 -0
- package/dist/runtime/heavyDeps.d.ts.map +1 -0
- package/dist/runtime/heavyDeps.js +110 -0
- package/dist/runtime/heavyDeps.js.map +1 -0
- package/dist/runtime/inferRuntimeNeeds.d.ts +16 -0
- package/dist/runtime/inferRuntimeNeeds.d.ts.map +1 -0
- package/dist/runtime/inferRuntimeNeeds.js +141 -0
- package/dist/runtime/inferRuntimeNeeds.js.map +1 -0
- package/dist/runtime/installCommand.d.ts +21 -0
- package/dist/runtime/installCommand.d.ts.map +1 -0
- package/dist/runtime/installCommand.js +201 -0
- package/dist/runtime/installCommand.js.map +1 -0
- package/dist/runtime/installer.d.ts +61 -0
- package/dist/runtime/installer.d.ts.map +1 -0
- package/dist/runtime/installer.js +175 -0
- package/dist/runtime/installer.js.map +1 -0
- package/dist/runtime/loader.d.ts +54 -0
- package/dist/runtime/loader.d.ts.map +1 -0
- package/dist/runtime/loader.js +241 -0
- package/dist/runtime/loader.js.map +1 -0
- package/dist/runtime/selfUpdate.d.ts +60 -0
- package/dist/runtime/selfUpdate.d.ts.map +1 -0
- package/dist/runtime/selfUpdate.js +222 -0
- package/dist/runtime/selfUpdate.js.map +1 -0
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +22 -0
- package/dist/utils.js.map +1 -1
- package/package.json +14 -14
- package/scripts/postinstall.js +7 -89
- package/dist/checkDependencies.d.ts +0 -2
- package/dist/checkDependencies.d.ts.map +0 -1
- package/dist/checkDependencies.js +0 -72
- package/dist/checkDependencies.js.map +0 -1
package/README.md
CHANGED
|
@@ -35,6 +35,56 @@ Doc Detective has multiple components to integrate with your workflows as you ne
|
|
|
35
35
|
|
|
36
36
|
**Note:** If you're working in a cloned `doc-detective` repository, run `npm i` to install local dependencies or the `npx` command in the next step will fail.
|
|
37
37
|
|
|
38
|
+
### Lazy-installed runtime
|
|
39
|
+
|
|
40
|
+
`npm i doc-detective` installs the CLI and a small set of light dependencies. Heavy runtime assets — browsers (Chrome, Firefox), drivers (ChromeDriver, Geckodriver), ffmpeg, and the npm packages that drive them (webdriverio, appium, sharp, etc.) — install lazily into `<os.tmpdir()>/doc-detective/` the first time a test needs them, or up front via `doc-detective install all`.
|
|
41
|
+
|
|
42
|
+
The heavy npm packages live in `optionalDependencies`, which means **npm still installs them by default during `npm i doc-detective`** alongside the light deps. To get a truly lean install — only the CLI shim — pass `--omit=optional`:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
npm i doc-detective --omit=optional
|
|
46
|
+
# or for CI
|
|
47
|
+
npm ci --omit=optional
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
With `--omit=optional`, the lazy resolver fetches each heavy dep into the cache on first use; without it you still get the speed-of-startup benefits of lazy loading (no `postinstall` browser download) but pay the on-disk cost up front.
|
|
51
|
+
|
|
52
|
+
- **Pre-install everything up front:**
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
doc-detective install all --yes
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
- **Install only what you need:**
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
doc-detective install browsers chrome
|
|
62
|
+
doc-detective install runtime webdriverio appium
|
|
63
|
+
doc-detective install agents
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
- **Inspect what's installed vs. expected:**
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
doc-detective install status
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
- **Override the cache location** (useful in containers and CI):
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
DOC_DETECTIVE_CACHE_DIR=/opt/doc-detective doc-detective install all --yes
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### Auto-update
|
|
79
|
+
|
|
80
|
+
By default, `doc-detective` checks the npm registry on startup and self-updates if a newer release is available — global installs run `npm install -g`, `npx` invocations re-exec via `npx -y doc-detective@latest`, and local project installs print an "update available" hint instead of mutating your `package.json`. To opt out:
|
|
81
|
+
|
|
82
|
+
- `--no-auto-update` on the CLI
|
|
83
|
+
- `autoUpdate: false` in `.doc-detective.json`
|
|
84
|
+
- `DOC_DETECTIVE_SKIP_AUTO_UPDATE=1` in the environment
|
|
85
|
+
|
|
86
|
+
CI environments (where `process.env.CI` is set) skip the check automatically.
|
|
87
|
+
|
|
38
88
|
## Run tests
|
|
39
89
|
|
|
40
90
|
To run your tests, use the following command:
|