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.
Files changed (75) hide show
  1. package/README.md +50 -0
  2. package/bin/runner-entrypoint.js +757 -0
  3. package/dist/cli.js +37 -1
  4. package/dist/cli.js.map +1 -1
  5. package/dist/common/src/schemas/schemas.json +22 -0
  6. package/dist/common/src/types/generated/config_v3.d.ts +8 -0
  7. package/dist/common/src/types/generated/config_v3.d.ts.map +1 -1
  8. package/dist/common/src/types/generated/resolvedTests_v3.d.ts +8 -0
  9. package/dist/common/src/types/generated/resolvedTests_v3.d.ts.map +1 -1
  10. package/dist/core/appium.d.ts +3 -1
  11. package/dist/core/appium.d.ts.map +1 -1
  12. package/dist/core/appium.js +11 -3
  13. package/dist/core/appium.js.map +1 -1
  14. package/dist/core/config.d.ts +1 -1
  15. package/dist/core/config.d.ts.map +1 -1
  16. package/dist/core/config.js +98 -12
  17. package/dist/core/config.js.map +1 -1
  18. package/dist/core/index.d.ts.map +1 -1
  19. package/dist/core/index.js +85 -1
  20. package/dist/core/index.js.map +1 -1
  21. package/dist/core/tests/saveScreenshot.d.ts.map +1 -1
  22. package/dist/core/tests/saveScreenshot.js +62 -9
  23. package/dist/core/tests/saveScreenshot.js.map +1 -1
  24. package/dist/core/tests/stopRecording.d.ts.map +1 -1
  25. package/dist/core/tests/stopRecording.js +19 -2
  26. package/dist/core/tests/stopRecording.js.map +1 -1
  27. package/dist/core/tests.d.ts.map +1 -1
  28. package/dist/core/tests.js +87 -62
  29. package/dist/core/tests.js.map +1 -1
  30. package/dist/core/utils.d.ts +2 -1
  31. package/dist/core/utils.d.ts.map +1 -1
  32. package/dist/core/utils.js +45 -6
  33. package/dist/core/utils.js.map +1 -1
  34. package/dist/index.cjs +115581 -114521
  35. package/dist/runtime/browsers.d.ts +64 -0
  36. package/dist/runtime/browsers.d.ts.map +1 -0
  37. package/dist/runtime/browsers.js +311 -0
  38. package/dist/runtime/browsers.js.map +1 -0
  39. package/dist/runtime/cacheDir.d.ts +45 -0
  40. package/dist/runtime/cacheDir.d.ts.map +1 -0
  41. package/dist/runtime/cacheDir.js +207 -0
  42. package/dist/runtime/cacheDir.js.map +1 -0
  43. package/dist/runtime/heavyDeps.d.ts +27 -0
  44. package/dist/runtime/heavyDeps.d.ts.map +1 -0
  45. package/dist/runtime/heavyDeps.js +110 -0
  46. package/dist/runtime/heavyDeps.js.map +1 -0
  47. package/dist/runtime/inferRuntimeNeeds.d.ts +16 -0
  48. package/dist/runtime/inferRuntimeNeeds.d.ts.map +1 -0
  49. package/dist/runtime/inferRuntimeNeeds.js +141 -0
  50. package/dist/runtime/inferRuntimeNeeds.js.map +1 -0
  51. package/dist/runtime/installCommand.d.ts +21 -0
  52. package/dist/runtime/installCommand.d.ts.map +1 -0
  53. package/dist/runtime/installCommand.js +201 -0
  54. package/dist/runtime/installCommand.js.map +1 -0
  55. package/dist/runtime/installer.d.ts +61 -0
  56. package/dist/runtime/installer.d.ts.map +1 -0
  57. package/dist/runtime/installer.js +175 -0
  58. package/dist/runtime/installer.js.map +1 -0
  59. package/dist/runtime/loader.d.ts +54 -0
  60. package/dist/runtime/loader.d.ts.map +1 -0
  61. package/dist/runtime/loader.js +241 -0
  62. package/dist/runtime/loader.js.map +1 -0
  63. package/dist/runtime/selfUpdate.d.ts +60 -0
  64. package/dist/runtime/selfUpdate.d.ts.map +1 -0
  65. package/dist/runtime/selfUpdate.js +222 -0
  66. package/dist/runtime/selfUpdate.js.map +1 -0
  67. package/dist/utils.d.ts.map +1 -1
  68. package/dist/utils.js +22 -0
  69. package/dist/utils.js.map +1 -1
  70. package/package.json +14 -14
  71. package/scripts/postinstall.js +7 -89
  72. package/dist/checkDependencies.d.ts +0 -2
  73. package/dist/checkDependencies.d.ts.map +0 -1
  74. package/dist/checkDependencies.js +0 -72
  75. 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: