@alwaysmeticulous/cli 2.326.0 → 2.327.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/dist/__tests__/commonjs-dependencies.spec.d.ts +2 -0
- package/dist/__tests__/commonjs-dependencies.spec.d.ts.map +1 -0
- package/dist/__tests__/commonjs-dependencies.spec.js +82 -0
- package/dist/__tests__/commonjs-dependencies.spec.js.map +1 -0
- package/dist/command-utils/__tests__/parse-rewrites.spec.js +2 -2
- package/dist/command-utils/__tests__/parse-rewrites.spec.js.map +1 -1
- package/dist/command-utils/__tests__/warn-regex-rewrites.spec.js +2 -2
- package/dist/command-utils/__tests__/warn-regex-rewrites.spec.js.map +1 -1
- package/dist/command-utils/common-options.js +2 -2
- package/dist/command-utils/common-options.js.map +1 -1
- package/dist/command-utils/detect-upload-mode.js +2 -2
- package/dist/command-utils/detect-upload-mode.js.map +1 -1
- package/dist/command-utils/detect-upload-mode.spec.js +2 -2
- package/dist/command-utils/detect-upload-mode.spec.js.map +1 -1
- package/dist/command-utils/download-session.utils.js +2 -2
- package/dist/command-utils/download-session.utils.js.map +1 -1
- package/dist/command-utils/json-args.js +2 -2
- package/dist/command-utils/json-args.js.map +1 -1
- package/dist/command-utils/json-args.spec.js +2 -2
- package/dist/command-utils/json-args.spec.js.map +1 -1
- package/dist/command-utils/parse-container-env.js +2 -2
- package/dist/command-utils/parse-container-env.js.map +1 -1
- package/dist/command-utils/parse-rewrites.js +2 -2
- package/dist/command-utils/parse-rewrites.js.map +1 -1
- package/dist/command-utils/print-json.js +2 -2
- package/dist/command-utils/print-json.js.map +1 -1
- package/dist/command-utils/sentry.utils.js +2 -2
- package/dist/command-utils/sentry.utils.js.map +1 -1
- package/dist/command-utils/warn-regex-rewrites.js +2 -2
- package/dist/command-utils/warn-regex-rewrites.js.map +1 -1
- package/dist/commands/agent/agent-review-writes.command.spec.js +2 -2
- package/dist/commands/agent/agent-review-writes.command.spec.js.map +1 -1
- package/dist/commands/agent/build-git-options.js +2 -2
- package/dist/commands/agent/build-git-options.js.map +1 -1
- package/dist/commands/agent/build-git-options.spec.js +2 -2
- package/dist/commands/agent/build-git-options.spec.js.map +1 -1
- package/dist/commands/agent/coverage-columns.util.js +2 -2
- package/dist/commands/agent/coverage-columns.util.js.map +1 -1
- package/dist/commands/agent/create-diff-comment.command.js +2 -2
- package/dist/commands/agent/create-diff-comment.command.js.map +1 -1
- package/dist/commands/agent/diff-comment-write.utils.js +2 -2
- package/dist/commands/agent/diff-comment-write.utils.js.map +1 -1
- package/dist/commands/agent/diff-comments.command.js +2 -2
- package/dist/commands/agent/diff-comments.command.js.map +1 -1
- package/dist/commands/agent/diff-comments.command.spec.js +2 -2
- package/dist/commands/agent/diff-comments.command.spec.js.map +1 -1
- package/dist/commands/agent/ignore-diff.command.js +2 -2
- package/dist/commands/agent/ignore-diff.command.js.map +1 -1
- package/dist/commands/agent/index.js +2 -2
- package/dist/commands/agent/index.js.map +1 -1
- package/dist/commands/agent/js-coverage-diff.command.js +2 -2
- package/dist/commands/agent/js-coverage-diff.command.js.map +1 -1
- package/dist/commands/agent/js-coverage.command.handler.spec.js +2 -2
- package/dist/commands/agent/js-coverage.command.handler.spec.js.map +1 -1
- package/dist/commands/agent/js-coverage.command.js +2 -2
- package/dist/commands/agent/js-coverage.command.js.map +1 -1
- package/dist/commands/agent/js-coverage.command.spec.js +2 -2
- package/dist/commands/agent/js-coverage.command.spec.js.map +1 -1
- package/dist/commands/agent/reject-diff.command.js +2 -2
- package/dist/commands/agent/reject-diff.command.js.map +1 -1
- package/dist/commands/agent/reject-diff.command.spec.js +2 -2
- package/dist/commands/agent/reject-diff.command.spec.js.map +1 -1
- package/dist/commands/agent/reply-to-diff-comment.command.js +2 -2
- package/dist/commands/agent/reply-to-diff-comment.command.js.map +1 -1
- package/dist/commands/agent/screenshot-dom-diff.command.js +2 -2
- package/dist/commands/agent/screenshot-dom-diff.command.js.map +1 -1
- package/dist/commands/agent/screenshot-image-files.command.js +2 -2
- package/dist/commands/agent/screenshot-image-files.command.js.map +1 -1
- package/dist/commands/agent/screenshot-image.command.js +2 -2
- package/dist/commands/agent/screenshot-image.command.js.map +1 -1
- package/dist/commands/agent/sessions.command.js +2 -2
- package/dist/commands/agent/sessions.command.js.map +1 -1
- package/dist/commands/agent/sessions.command.spec.js +2 -2
- package/dist/commands/agent/sessions.command.spec.js.map +1 -1
- package/dist/commands/agent/submit-feedback.command.js +2 -2
- package/dist/commands/agent/submit-feedback.command.js.map +1 -1
- package/dist/commands/agent/test-run-check.command.js +2 -2
- package/dist/commands/agent/test-run-check.command.js.map +1 -1
- package/dist/commands/agent/test-run-check.command.spec.js +2 -2
- package/dist/commands/agent/test-run-check.command.spec.js.map +1 -1
- package/dist/commands/agent/test-run-diffs.command.js +2 -2
- package/dist/commands/agent/test-run-diffs.command.js.map +1 -1
- package/dist/commands/agent/test-run-diffs.command.spec.js +2 -2
- package/dist/commands/agent/test-run-diffs.command.spec.js.map +1 -1
- package/dist/commands/agent/test-run-diffs.utils.js +2 -2
- package/dist/commands/agent/test-run-diffs.utils.js.map +1 -1
- package/dist/commands/agent/test-run-diffs.utils.spec.js +2 -2
- package/dist/commands/agent/test-run-diffs.utils.spec.js.map +1 -1
- package/dist/commands/agent/test-run-for-commit.command.js +2 -2
- package/dist/commands/agent/test-run-for-commit.command.js.map +1 -1
- package/dist/commands/agent/timeline.command.js +2 -2
- package/dist/commands/agent/timeline.command.js.map +1 -1
- package/dist/commands/agent/timeline.command.spec.js +2 -2
- package/dist/commands/agent/timeline.command.spec.js.map +1 -1
- package/dist/commands/agent/trigger-test-run.command.js +2 -2
- package/dist/commands/agent/trigger-test-run.command.js.map +1 -1
- package/dist/commands/agent/trigger-test-run.command.spec.js +2 -2
- package/dist/commands/agent/trigger-test-run.command.spec.js.map +1 -1
- package/dist/commands/agent/upload-build.command.js +2 -2
- package/dist/commands/agent/upload-build.command.js.map +1 -1
- package/dist/commands/all-commands.d.ts.map +1 -1
- package/dist/commands/all-commands.js +8 -6
- package/dist/commands/all-commands.js.map +1 -1
- package/dist/commands/auth/__tests__/get-project.command.spec.js +2 -2
- package/dist/commands/auth/__tests__/get-project.command.spec.js.map +1 -1
- package/dist/commands/auth/__tests__/list-projects.command.spec.js +2 -2
- package/dist/commands/auth/__tests__/list-projects.command.spec.js.map +1 -1
- package/dist/commands/auth/__tests__/login.command.spec.js +2 -2
- package/dist/commands/auth/__tests__/login.command.spec.js.map +1 -1
- package/dist/commands/auth/__tests__/logout.command.spec.js +2 -2
- package/dist/commands/auth/__tests__/logout.command.spec.js.map +1 -1
- package/dist/commands/auth/__tests__/set-project.command.spec.js +2 -2
- package/dist/commands/auth/__tests__/set-project.command.spec.js.map +1 -1
- package/dist/commands/auth/__tests__/whoami.command.spec.js +2 -2
- package/dist/commands/auth/__tests__/whoami.command.spec.js.map +1 -1
- package/dist/commands/auth/get-project.command.js +2 -2
- package/dist/commands/auth/get-project.command.js.map +1 -1
- package/dist/commands/auth/index.js +2 -2
- package/dist/commands/auth/index.js.map +1 -1
- package/dist/commands/auth/list-projects.command.js +2 -2
- package/dist/commands/auth/list-projects.command.js.map +1 -1
- package/dist/commands/auth/login.command.js +2 -2
- package/dist/commands/auth/login.command.js.map +1 -1
- package/dist/commands/auth/logout.command.js +2 -2
- package/dist/commands/auth/logout.command.js.map +1 -1
- package/dist/commands/auth/set-project.command.js +2 -2
- package/dist/commands/auth/set-project.command.js.map +1 -1
- package/dist/commands/auth/whoami.command.js +2 -2
- package/dist/commands/auth/whoami.command.js.map +1 -1
- package/dist/commands/ci/__tests__/label-commit.utils.spec.js +2 -2
- package/dist/commands/ci/__tests__/label-commit.utils.spec.js.map +1 -1
- package/dist/commands/ci/__tests__/session-filter.utils.spec.js +2 -2
- package/dist/commands/ci/__tests__/session-filter.utils.spec.js.map +1 -1
- package/dist/commands/ci/agent-test.command.js +2 -2
- package/dist/commands/ci/agent-test.command.js.map +1 -1
- package/dist/commands/ci/deprecated-trigger-options.js +2 -2
- package/dist/commands/ci/deprecated-trigger-options.js.map +1 -1
- package/dist/commands/ci/index.js +2 -2
- package/dist/commands/ci/index.js.map +1 -1
- package/dist/commands/ci/label-commit.command.js +2 -2
- package/dist/commands/ci/label-commit.command.js.map +1 -1
- package/dist/commands/ci/label-commit.core.js +2 -2
- package/dist/commands/ci/label-commit.core.js.map +1 -1
- package/dist/commands/ci/label-commit.types.js +2 -2
- package/dist/commands/ci/label-commit.types.js.map +1 -1
- package/dist/commands/ci/label-commit.utils.js +2 -2
- package/dist/commands/ci/label-commit.utils.js.map +1 -1
- package/dist/commands/ci/prepare.command.js +2 -2
- package/dist/commands/ci/prepare.command.js.map +1 -1
- package/dist/commands/ci/resolve-git-options.js +2 -2
- package/dist/commands/ci/resolve-git-options.js.map +1 -1
- package/dist/commands/ci/run-local.command.js +2 -2
- package/dist/commands/ci/run-local.command.js.map +1 -1
- package/dist/commands/ci/run-with-uploaded-asset-chunks.command.js +2 -2
- package/dist/commands/ci/run-with-uploaded-asset-chunks.command.js.map +1 -1
- package/dist/commands/ci/run-with-uploaded-asset-chunks.command.spec.js +2 -2
- package/dist/commands/ci/run-with-uploaded-asset-chunks.command.spec.js.map +1 -1
- package/dist/commands/ci/run-with-uploaded-asset-chunks.utils.js +2 -2
- package/dist/commands/ci/run-with-uploaded-asset-chunks.utils.js.map +1 -1
- package/dist/commands/ci/run.command.js +2 -2
- package/dist/commands/ci/run.command.js.map +1 -1
- package/dist/commands/ci/session-filter.utils.js +2 -2
- package/dist/commands/ci/session-filter.utils.js.map +1 -1
- package/dist/commands/ci/start-tunnel.command.js +2 -2
- package/dist/commands/ci/start-tunnel.command.js.map +1 -1
- package/dist/commands/ci/trigger-test-run.core.js +2 -2
- package/dist/commands/ci/trigger-test-run.core.js.map +1 -1
- package/dist/commands/ci/trigger-test-run.types.js +2 -2
- package/dist/commands/ci/trigger-test-run.types.js.map +1 -1
- package/dist/commands/ci/upload-asset-chunk.command.js +2 -2
- package/dist/commands/ci/upload-asset-chunk.command.js.map +1 -1
- package/dist/commands/ci/upload-assets.command.js +2 -2
- package/dist/commands/ci/upload-assets.command.js.map +1 -1
- package/dist/commands/ci/upload-container.command.js +2 -2
- package/dist/commands/ci/upload-container.command.js.map +1 -1
- package/dist/commands/crawl.command.js +2 -2
- package/dist/commands/crawl.command.js.map +1 -1
- package/dist/commands/debug/clean-workspaces.js +2 -2
- package/dist/commands/debug/clean-workspaces.js.map +1 -1
- package/dist/commands/debug/index.js +2 -2
- package/dist/commands/debug/index.js.map +1 -1
- package/dist/commands/debug/present-workspace.js +2 -2
- package/dist/commands/debug/present-workspace.js.map +1 -1
- package/dist/commands/debug/project-worktree.js +2 -2
- package/dist/commands/debug/project-worktree.js.map +1 -1
- package/dist/commands/deprecated-aliases.js +2 -2
- package/dist/commands/deprecated-aliases.js.map +1 -1
- package/dist/commands/download/index.js +2 -2
- package/dist/commands/download/index.js.map +1 -1
- package/dist/commands/download/replay.command.js +2 -2
- package/dist/commands/download/replay.command.js.map +1 -1
- package/dist/commands/download/session.command.js +2 -2
- package/dist/commands/download/session.command.js.map +1 -1
- package/dist/commands/download/test-run.command.js +2 -2
- package/dist/commands/download/test-run.command.js.map +1 -1
- package/dist/commands/local/get-edited-files.utils.js +2 -2
- package/dist/commands/local/get-edited-files.utils.js.map +1 -1
- package/dist/commands/local/get-edited-files.utils.spec.js +2 -2
- package/dist/commands/local/get-edited-files.utils.spec.js.map +1 -1
- package/dist/commands/local/index.js +2 -2
- package/dist/commands/local/index.js.map +1 -1
- package/dist/commands/local/relevant-sessions.command.js +2 -2
- package/dist/commands/local/relevant-sessions.command.js.map +1 -1
- package/dist/commands/onboard/__tests__/build-context.spec.d.ts +2 -0
- package/dist/commands/onboard/__tests__/build-context.spec.d.ts.map +1 -0
- package/dist/commands/onboard/__tests__/build-context.spec.js +179 -0
- package/dist/commands/onboard/__tests__/build-context.spec.js.map +1 -0
- package/dist/commands/onboard/__tests__/check-vcs-link.spec.d.ts +2 -0
- package/dist/commands/onboard/__tests__/check-vcs-link.spec.d.ts.map +1 -0
- package/dist/commands/onboard/__tests__/check-vcs-link.spec.js +164 -0
- package/dist/commands/onboard/__tests__/check-vcs-link.spec.js.map +1 -0
- package/dist/commands/onboard/__tests__/codex-mcp.spec.d.ts +2 -0
- package/dist/commands/onboard/__tests__/codex-mcp.spec.d.ts.map +1 -0
- package/dist/commands/onboard/__tests__/codex-mcp.spec.js +73 -0
- package/dist/commands/onboard/__tests__/codex-mcp.spec.js.map +1 -0
- package/dist/commands/onboard/__tests__/detect-framework.spec.d.ts +2 -0
- package/dist/commands/onboard/__tests__/detect-framework.spec.d.ts.map +1 -0
- package/dist/commands/onboard/__tests__/detect-framework.spec.js +277 -0
- package/dist/commands/onboard/__tests__/detect-framework.spec.js.map +1 -0
- package/dist/commands/onboard/__tests__/git-repo-info.spec.d.ts +2 -0
- package/dist/commands/onboard/__tests__/git-repo-info.spec.d.ts.map +1 -0
- package/dist/commands/onboard/__tests__/git-repo-info.spec.js +109 -0
- package/dist/commands/onboard/__tests__/git-repo-info.spec.js.map +1 -0
- package/dist/commands/onboard/__tests__/inline-doc-constants.spec.d.ts +2 -0
- package/dist/commands/onboard/__tests__/inline-doc-constants.spec.d.ts.map +1 -0
- package/dist/commands/onboard/__tests__/inline-doc-constants.spec.js +157 -0
- package/dist/commands/onboard/__tests__/inline-doc-constants.spec.js.map +1 -0
- package/dist/commands/onboard/__tests__/install-skills.spec.d.ts +2 -0
- package/dist/commands/onboard/__tests__/install-skills.spec.d.ts.map +1 -0
- package/dist/commands/onboard/__tests__/install-skills.spec.js +158 -0
- package/dist/commands/onboard/__tests__/install-skills.spec.js.map +1 -0
- package/dist/commands/onboard/__tests__/materialize-workspace.spec.d.ts +2 -0
- package/dist/commands/onboard/__tests__/materialize-workspace.spec.d.ts.map +1 -0
- package/dist/commands/onboard/__tests__/materialize-workspace.spec.js +116 -0
- package/dist/commands/onboard/__tests__/materialize-workspace.spec.js.map +1 -0
- package/dist/commands/onboard/__tests__/resolve-app.spec.d.ts +2 -0
- package/dist/commands/onboard/__tests__/resolve-app.spec.d.ts.map +1 -0
- package/dist/commands/onboard/__tests__/resolve-app.spec.js +166 -0
- package/dist/commands/onboard/__tests__/resolve-app.spec.js.map +1 -0
- package/dist/commands/onboard/__tests__/safe-repo-fs.spec.d.ts +2 -0
- package/dist/commands/onboard/__tests__/safe-repo-fs.spec.d.ts.map +1 -0
- package/dist/commands/onboard/__tests__/safe-repo-fs.spec.js +137 -0
- package/dist/commands/onboard/__tests__/safe-repo-fs.spec.js.map +1 -0
- package/dist/commands/onboard/__tests__/setup-agent-integrations.spec.d.ts +2 -0
- package/dist/commands/onboard/__tests__/setup-agent-integrations.spec.d.ts.map +1 -0
- package/dist/commands/onboard/__tests__/setup-agent-integrations.spec.js +286 -0
- package/dist/commands/onboard/__tests__/setup-agent-integrations.spec.js.map +1 -0
- package/dist/commands/onboard/build-context.d.ts +16 -0
- package/dist/commands/onboard/build-context.d.ts.map +1 -0
- package/dist/commands/onboard/build-context.js +104 -0
- package/dist/commands/onboard/build-context.js.map +1 -0
- package/dist/commands/onboard/check-vcs-link.d.ts +14 -0
- package/dist/commands/onboard/check-vcs-link.d.ts.map +1 -0
- package/dist/commands/onboard/check-vcs-link.js +111 -0
- package/dist/commands/onboard/check-vcs-link.js.map +1 -0
- package/dist/commands/onboard/codex-mcp.d.ts +24 -0
- package/dist/commands/onboard/codex-mcp.d.ts.map +1 -0
- package/dist/commands/onboard/codex-mcp.js +302 -0
- package/dist/commands/onboard/codex-mcp.js.map +1 -0
- package/dist/commands/onboard/customer-agents.d.ts +9 -0
- package/dist/commands/onboard/customer-agents.d.ts.map +1 -0
- package/dist/commands/onboard/customer-agents.js +19 -0
- package/dist/commands/onboard/customer-agents.js.map +1 -0
- package/dist/commands/onboard/customer-agents.json +17 -0
- package/dist/commands/onboard/customer-docs.d.ts +21 -0
- package/dist/commands/onboard/customer-docs.d.ts.map +1 -0
- package/dist/commands/onboard/customer-docs.js +31 -0
- package/dist/commands/onboard/customer-docs.js.map +1 -0
- package/dist/commands/onboard/customer-docs.json +35 -0
- package/dist/commands/onboard/detect-framework.d.ts +26 -0
- package/dist/commands/onboard/detect-framework.d.ts.map +1 -0
- package/dist/commands/onboard/detect-framework.js +305 -0
- package/dist/commands/onboard/detect-framework.js.map +1 -0
- package/dist/commands/onboard/discover-apps.d.ts +21 -0
- package/dist/commands/onboard/discover-apps.d.ts.map +1 -0
- package/dist/commands/onboard/discover-apps.js +318 -0
- package/dist/commands/onboard/discover-apps.js.map +1 -0
- package/dist/commands/onboard/docs-urls.d.ts +11 -0
- package/dist/commands/onboard/docs-urls.d.ts.map +1 -0
- package/dist/commands/onboard/docs-urls.js +17 -0
- package/dist/commands/onboard/docs-urls.js.map +1 -0
- package/dist/commands/onboard/git-repo-info.d.ts +15 -0
- package/dist/commands/onboard/git-repo-info.d.ts.map +1 -0
- package/dist/commands/onboard/git-repo-info.js +84 -0
- package/dist/commands/onboard/git-repo-info.js.map +1 -0
- package/dist/commands/onboard/index.d.ts +18 -0
- package/dist/commands/onboard/index.d.ts.map +1 -0
- package/dist/commands/onboard/index.js +164 -0
- package/dist/commands/onboard/index.js.map +1 -0
- package/dist/commands/onboard/inline-doc-constants.d.ts +21 -0
- package/dist/commands/onboard/inline-doc-constants.d.ts.map +1 -0
- package/dist/commands/onboard/inline-doc-constants.js +238 -0
- package/dist/commands/onboard/inline-doc-constants.js.map +1 -0
- package/dist/commands/onboard/launch-agent.d.ts +65 -0
- package/dist/commands/onboard/launch-agent.d.ts.map +1 -0
- package/dist/commands/onboard/launch-agent.js +311 -0
- package/dist/commands/onboard/launch-agent.js.map +1 -0
- package/dist/commands/onboard/materialize-workspace.d.ts +68 -0
- package/dist/commands/onboard/materialize-workspace.d.ts.map +1 -0
- package/dist/commands/onboard/materialize-workspace.js +177 -0
- package/dist/commands/onboard/materialize-workspace.js.map +1 -0
- package/dist/commands/onboard/print-summary.d.ts +10 -0
- package/dist/commands/onboard/print-summary.d.ts.map +1 -0
- package/dist/commands/onboard/print-summary.js +49 -0
- package/dist/commands/onboard/print-summary.js.map +1 -0
- package/dist/commands/onboard/resolve-app.d.ts +21 -0
- package/dist/commands/onboard/resolve-app.d.ts.map +1 -0
- package/dist/commands/onboard/resolve-app.js +78 -0
- package/dist/commands/onboard/resolve-app.js.map +1 -0
- package/dist/commands/onboard/resolve-project.d.ts +14 -0
- package/dist/commands/onboard/resolve-project.d.ts.map +1 -0
- package/dist/commands/onboard/resolve-project.js +92 -0
- package/dist/commands/onboard/resolve-project.js.map +1 -0
- package/dist/commands/onboard/safe-repo-fs.d.ts +59 -0
- package/dist/commands/onboard/safe-repo-fs.d.ts.map +1 -0
- package/dist/commands/onboard/safe-repo-fs.js +266 -0
- package/dist/commands/onboard/safe-repo-fs.js.map +1 -0
- package/dist/commands/onboard/setup-agent-integrations.d.ts +43 -0
- package/dist/commands/onboard/setup-agent-integrations.d.ts.map +1 -0
- package/dist/commands/onboard/setup-agent-integrations.js +324 -0
- package/dist/commands/onboard/setup-agent-integrations.js.map +1 -0
- package/dist/commands/onboard/templates/CLAUDE.md +213 -0
- package/dist/commands/onboard/templates/agents/auth-setup.md +117 -0
- package/dist/commands/onboard/templates/agents/ci-setup.md +742 -0
- package/dist/commands/onboard/templates/agents/csp-setup.md +78 -0
- package/dist/commands/onboard/templates/agents/false-positive-prevention.md +268 -0
- package/dist/commands/onboard/templates/agents/feature-flag-setup.md +133 -0
- package/dist/commands/onboard/templates/agents/local-simulation-verification.md +96 -0
- package/dist/commands/onboard/templates/agents/persisted-graphql-queries.md +150 -0
- package/dist/commands/onboard/templates/agents/recorder-installation.md +194 -0
- package/dist/commands/onboard/templates/agents/replay-fetch-retry-compatibility.md +252 -0
- package/dist/commands/onboard/templates/agents/reviewer.md +788 -0
- package/dist/commands/onboard/templates/agents/service-worker-compatibility.md +254 -0
- package/dist/commands/onboard/templates/agents/session-context.md +133 -0
- package/dist/commands/onboard/templates/agents/shared-worker-compatibility.md +187 -0
- package/dist/commands/onboard/templates/docs/additional-guides/backend-recorder.ts +340 -0
- package/dist/commands/onboard/templates/docs/ci/not-yet-run-checks.ts +58 -0
- package/dist/commands/onboard/templates/docs/ci.ts +19 -0
- package/dist/commands/onboard/templates/docs/cloud-replay.ts +145 -0
- package/dist/commands/onboard/templates/docs/constants.ts +37 -0
- package/dist/commands/onboard/templates/docs/github-actions-v2.ts +859 -0
- package/dist/commands/onboard/templates/docs/how-to/auth/bypassing-auth.ts +27 -0
- package/dist/commands/onboard/templates/docs/how-to/auth/enabling-full-auth.ts +91 -0
- package/dist/commands/onboard/templates/docs/how-to/configure-ignore-patterns.ts +77 -0
- package/dist/commands/onboard/templates/docs/how-to/enable-source-coverage.ts +84 -0
- package/dist/commands/onboard/templates/docs/how-to/fix-false-positive-diffs.ts +156 -0
- package/dist/commands/onboard/templates/docs/how-to/link-bitbucket.ts +15 -0
- package/dist/commands/onboard/templates/docs/how-to/link-gitlab.ts +22 -0
- package/dist/commands/onboard/templates/docs/how-to/record-session-context.ts +129 -0
- package/dist/commands/onboard/templates/docs/how-to/recorder-script.ts +139 -0
- package/dist/commands/onboard/templates/docs/how-to/testing-feature-flags.ts +97 -0
- package/dist/commands/onboard/templates/docs/how-to/testing-multiple-apps-or-app-variants.ts +40 -0
- package/dist/commands/onboard/templates/docs/how-to/troubleshoot-auth.ts +58 -0
- package/dist/commands/onboard/templates/docs/how-to/troubleshoot-failed-simulations.ts +97 -0
- package/dist/commands/onboard/templates/docs/how-to/typescript-types.ts +51 -0
- package/dist/commands/onboard/templates/docs/how-to/window-meticulous-object.ts +685 -0
- package/dist/commands/onboard/templates/docs/onboarding-guide.ts +415 -0
- package/dist/commands/onboard/templates/docs/recorder-getting-started.ts +24 -0
- package/dist/commands/onboard/templates/docs/recorder-snippets/constants.ts +1 -0
- package/dist/commands/onboard/templates/docs/recorder-snippets/explanation-of-methods-to-add-recorder.ts +21 -0
- package/dist/commands/onboard/templates/docs/recorder-snippets/npm-package-based-instructions/angular-instructions.ts +34 -0
- package/dist/commands/onboard/templates/docs/recorder-snippets/npm-package-based-instructions/any-other-framework-instructions.ts +118 -0
- package/dist/commands/onboard/templates/docs/recorder-snippets/npm-package-based-instructions/vue-instructions.ts +39 -0
- package/dist/commands/onboard/templates/docs/recorder-snippets/script-based-instructions/next-js-instructions.ts +49 -0
- package/dist/commands/onboard/templates/docs/recorder-snippets/script-based-instructions/nuxtjs-instructions.ts +68 -0
- package/dist/commands/onboard/templates/docs/recorder-snippets/script-based-instructions/rsbuild-instructions.ts +66 -0
- package/dist/commands/onboard/templates/docs/recorder-snippets/script-based-instructions/storybook-instructions.ts +59 -0
- package/dist/commands/onboard/templates/docs/recorder-snippets/script-based-instructions/sveltekit-instructions.ts +113 -0
- package/dist/commands/onboard/templates/docs/recorder-snippets/script-based-instructions/vite-instructions.ts +58 -0
- package/dist/commands/onboard/templates/docs/recorder-snippets/script-requirements.ts +51 -0
- package/dist/commands/onboard/templates/docs/recorder-snippets/steps-after-installing-recorder.ts +25 -0
- package/dist/commands/onboard/templates/docs/reference/cli-commands.ts +1324 -0
- package/dist/commands/onboard/templates/docs/session-recording/csp-exceptions.ts +17 -0
- package/dist/commands/onboard/templates/docs/session-recording/recorder-npm-dependency.ts +62 -0
- package/dist/commands/onboard/templates/docs-imports/src/lib/next/next.constants.ts +46 -0
- package/dist/commands/onboard/templates/docs-imports/src/lib/utils/internal-urls/docs-urls.utils.ts +254 -0
- package/dist/commands/onboard/templates/settings.json +14 -0
- package/dist/commands/project/index.js +2 -2
- package/dist/commands/project/index.js.map +1 -1
- package/dist/commands/project/show.command.js +2 -2
- package/dist/commands/project/show.command.js.map +1 -1
- package/dist/commands/project/upload-source.command.js +2 -2
- package/dist/commands/project/upload-source.command.js.map +1 -1
- package/dist/commands/record/__tests__/backend-dev-command.utils.spec.js +2 -2
- package/dist/commands/record/__tests__/backend-dev-command.utils.spec.js.map +1 -1
- package/dist/commands/record/__tests__/backend-sidecar.utils.spec.js +2 -2
- package/dist/commands/record/__tests__/backend-sidecar.utils.spec.js.map +1 -1
- package/dist/commands/record/__tests__/backend.command.spec.js +2 -2
- package/dist/commands/record/__tests__/backend.command.spec.js.map +1 -1
- package/dist/commands/record/__tests__/login.command.spec.js +2 -2
- package/dist/commands/record/__tests__/login.command.spec.js.map +1 -1
- package/dist/commands/record/__tests__/session.command.spec.js +2 -2
- package/dist/commands/record/__tests__/session.command.spec.js.map +1 -1
- package/dist/commands/record/backend-dev-command.utils.js +2 -2
- package/dist/commands/record/backend-dev-command.utils.js.map +1 -1
- package/dist/commands/record/backend-sidecar.utils.js +2 -2
- package/dist/commands/record/backend-sidecar.utils.js.map +1 -1
- package/dist/commands/record/backend.command.js +2 -2
- package/dist/commands/record/backend.command.js.map +1 -1
- package/dist/commands/record/index.js +2 -2
- package/dist/commands/record/index.js.map +1 -1
- package/dist/commands/record/login.command.js +2 -2
- package/dist/commands/record/login.command.js.map +1 -1
- package/dist/commands/record/session.command.js +2 -2
- package/dist/commands/record/session.command.js.map +1 -1
- package/dist/commands/replay-debugger.ui.js +2 -2
- package/dist/commands/replay-debugger.ui.js.map +1 -1
- package/dist/commands/replay.command.js +2 -2
- package/dist/commands/replay.command.js.map +1 -1
- package/dist/commands/schema.command.js +2 -2
- package/dist/commands/schema.command.js.map +1 -1
- package/dist/commands/schema.command.spec.js +2 -2
- package/dist/commands/schema.command.spec.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/main.js +2 -2
- package/dist/main.js.map +1 -1
- package/dist/utils/__tests__/handle-auth-failure.spec.js +2 -2
- package/dist/utils/__tests__/handle-auth-failure.spec.js.map +1 -1
- package/dist/utils/__tests__/project-selection-hint.spec.js +2 -2
- package/dist/utils/__tests__/project-selection-hint.spec.js.map +1 -1
- package/dist/utils/__tests__/resolve-project-identifier.spec.js +2 -2
- package/dist/utils/__tests__/resolve-project-identifier.spec.js.map +1 -1
- package/dist/utils/__tests__/resolve-test-run-from-commit.spec.js +2 -2
- package/dist/utils/__tests__/resolve-test-run-from-commit.spec.js.map +1 -1
- package/dist/utils/__tests__/select-project.spec.js +5 -4
- package/dist/utils/__tests__/select-project.spec.js.map +1 -1
- package/dist/utils/cli-user-error.js +2 -2
- package/dist/utils/cli-user-error.js.map +1 -1
- package/dist/utils/constants.js +2 -2
- package/dist/utils/constants.js.map +1 -1
- package/dist/utils/environment.utils.js +2 -2
- package/dist/utils/environment.utils.js.map +1 -1
- package/dist/utils/format-coverage-ranges.js +2 -2
- package/dist/utils/format-coverage-ranges.js.map +1 -1
- package/dist/utils/handle-auth-failure.js +2 -2
- package/dist/utils/handle-auth-failure.js.map +1 -1
- package/dist/utils/out-of-date-client-error.js +2 -2
- package/dist/utils/out-of-date-client-error.js.map +1 -1
- package/dist/utils/project-selection-hint.js +2 -2
- package/dist/utils/project-selection-hint.js.map +1 -1
- package/dist/utils/resolve-project-identifier.js +2 -2
- package/dist/utils/resolve-project-identifier.js.map +1 -1
- package/dist/utils/resolve-test-run-from-commit.js +2 -2
- package/dist/utils/resolve-test-run-from-commit.js.map +1 -1
- package/dist/utils/select-project.d.ts +9 -0
- package/dist/utils/select-project.d.ts.map +1 -1
- package/dist/utils/select-project.js +58 -15
- package/dist/utils/select-project.js.map +1 -1
- package/package.json +13 -11
|
@@ -0,0 +1,685 @@
|
|
|
1
|
+
import {
|
|
2
|
+
HANDLE_FILE_UPLOADS_URL,
|
|
3
|
+
RECORD_CUSTOM_VALUES_URL,
|
|
4
|
+
TYPESCRIPT_TYPES_URL,
|
|
5
|
+
USE_CUSTOM_EVENT_API_URL,
|
|
6
|
+
} from "src/lib/utils/internal-urls/docs-urls.utils";
|
|
7
|
+
|
|
8
|
+
export const document = `---
|
|
9
|
+
{
|
|
10
|
+
"title": "window.Meticulous API Reference"
|
|
11
|
+
}
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# {% $frontmatter.title %}
|
|
15
|
+
|
|
16
|
+
Complete reference for the \`window.Meticulous\` JavaScript API available in your application.
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## Overview
|
|
21
|
+
|
|
22
|
+
The \`window.Meticulous\` object is exposed by the Meticulous recorder snippet and provides methods for:
|
|
23
|
+
- Detecting test mode
|
|
24
|
+
- Recording custom data
|
|
25
|
+
- Controlling replay timing
|
|
26
|
+
- Handling custom events
|
|
27
|
+
|
|
28
|
+
**Availability**: Only when Meticulous recorder is loaded.
|
|
29
|
+
|
|
30
|
+
**TypeScript types**: See [TypeScript Types](${TYPESCRIPT_TYPES_URL}) for full type definitions.
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## API Reference
|
|
35
|
+
|
|
36
|
+
### isRunningAsTest
|
|
37
|
+
|
|
38
|
+
**Type**: \`boolean | undefined\`
|
|
39
|
+
|
|
40
|
+
**Description**: Indicates whether the app is running as a Meticulous test.
|
|
41
|
+
|
|
42
|
+
**Values**:
|
|
43
|
+
- \`true\`: Running in test/replay mode
|
|
44
|
+
- \`false\` or \`undefined\`: Running normally (production/development)
|
|
45
|
+
|
|
46
|
+
**Example**:
|
|
47
|
+
|
|
48
|
+
\`\`\`typescript
|
|
49
|
+
if (window.Meticulous?.isRunningAsTest) {
|
|
50
|
+
// Skip validation, use test data, etc.
|
|
51
|
+
console.log('Running as Meticulous test');
|
|
52
|
+
} else {
|
|
53
|
+
// Normal application logic
|
|
54
|
+
console.log('Running normally');
|
|
55
|
+
}
|
|
56
|
+
\`\`\`
|
|
57
|
+
|
|
58
|
+
**Common use cases**:
|
|
59
|
+
- Skip form validation
|
|
60
|
+
- Bypass authentication
|
|
61
|
+
- Use deterministic values (timestamps, IDs)
|
|
62
|
+
- Disable analytics/tracking
|
|
63
|
+
- Skip animations
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
### recordCustomValues()
|
|
68
|
+
|
|
69
|
+
**Signature**: \`recordCustomValues(values: Record<string, any>): void\`
|
|
70
|
+
|
|
71
|
+
**Description**: Store custom data during recording to be retrieved during replay.
|
|
72
|
+
|
|
73
|
+
**Parameters**:
|
|
74
|
+
- \`values\`: Object with key-value pairs to store
|
|
75
|
+
|
|
76
|
+
**Size limits**:
|
|
77
|
+
- **Development**: 20MB total (set \`data-is-production-environment="false"\`)
|
|
78
|
+
- **Production**: 1MB total
|
|
79
|
+
|
|
80
|
+
**When to use**:
|
|
81
|
+
- Store file upload contents
|
|
82
|
+
- Record feature flag values
|
|
83
|
+
- Save user context
|
|
84
|
+
- Preserve random/dynamic values
|
|
85
|
+
|
|
86
|
+
**Example**:
|
|
87
|
+
|
|
88
|
+
\`\`\`typescript
|
|
89
|
+
// During recording
|
|
90
|
+
const handleFileUpload = (file: File) => {
|
|
91
|
+
const reader = new FileReader();
|
|
92
|
+
reader.onload = (e) => {
|
|
93
|
+
const fileData = e.target?.result as string;
|
|
94
|
+
|
|
95
|
+
// Store for replay
|
|
96
|
+
if (window.Meticulous?.recordCustomValues) {
|
|
97
|
+
window.Meticulous.recordCustomValues({
|
|
98
|
+
uploadedFile: fileData,
|
|
99
|
+
fileName: file.name,
|
|
100
|
+
fileType: file.type,
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
processFile(fileData);
|
|
105
|
+
};
|
|
106
|
+
reader.readAsDataURL(file);
|
|
107
|
+
};
|
|
108
|
+
\`\`\`
|
|
109
|
+
|
|
110
|
+
**Multiple calls**: Values are merged, not overwritten. Later calls add/update keys.
|
|
111
|
+
|
|
112
|
+
\`\`\`typescript
|
|
113
|
+
// First call
|
|
114
|
+
window.Meticulous.recordCustomValues({ key1: 'value1' });
|
|
115
|
+
|
|
116
|
+
// Second call - adds key2, keeps key1
|
|
117
|
+
window.Meticulous.recordCustomValues({ key2: 'value2' });
|
|
118
|
+
|
|
119
|
+
// Result: { key1: 'value1', key2: 'value2' }
|
|
120
|
+
\`\`\`
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
### getCustomValues()
|
|
125
|
+
|
|
126
|
+
**Signature**: \`getCustomValues(): Record<string, any> | undefined\`
|
|
127
|
+
|
|
128
|
+
**Description**: Retrieve custom values stored during recording.
|
|
129
|
+
|
|
130
|
+
**Returns**: Object with stored values, or \`undefined\` if none.
|
|
131
|
+
|
|
132
|
+
**When to use**:
|
|
133
|
+
- Restore file upload data during replay
|
|
134
|
+
- Get feature flag values
|
|
135
|
+
- Restore user context
|
|
136
|
+
|
|
137
|
+
**Example**:
|
|
138
|
+
|
|
139
|
+
\`\`\`typescript
|
|
140
|
+
// During replay
|
|
141
|
+
useEffect(() => {
|
|
142
|
+
if (window.Meticulous?.isRunningAsTest) {
|
|
143
|
+
const stored = window.Meticulous.getCustomValues();
|
|
144
|
+
|
|
145
|
+
if (stored?.uploadedFile) {
|
|
146
|
+
// Restore file preview
|
|
147
|
+
setPreview(stored.uploadedFile);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
if (stored?.featureFlags) {
|
|
151
|
+
// Apply feature flags
|
|
152
|
+
setFlags(stored.featureFlags);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}, []);
|
|
156
|
+
\`\`\`
|
|
157
|
+
|
|
158
|
+
**Complete pattern**:
|
|
159
|
+
|
|
160
|
+
\`\`\`typescript
|
|
161
|
+
function useStoredValue(key: string) {
|
|
162
|
+
const [value, setValue] = useState(null);
|
|
163
|
+
|
|
164
|
+
useEffect(() => {
|
|
165
|
+
if (window.Meticulous?.isRunningAsTest) {
|
|
166
|
+
const stored = window.Meticulous.getCustomValues();
|
|
167
|
+
if (stored?.[key]) {
|
|
168
|
+
setValue(stored[key]);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}, [key]);
|
|
172
|
+
|
|
173
|
+
return value;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
// Usage
|
|
177
|
+
const userContext = useStoredValue('userContext');
|
|
178
|
+
\`\`\`
|
|
179
|
+
|
|
180
|
+
---
|
|
181
|
+
|
|
182
|
+
### pause()
|
|
183
|
+
|
|
184
|
+
**Signature**: \`pause(): void\`
|
|
185
|
+
|
|
186
|
+
**Description**: Pause replay until \`resume()\` is called.
|
|
187
|
+
|
|
188
|
+
**When to use**:
|
|
189
|
+
- Before async operations (data loading, image loading)
|
|
190
|
+
- Before third-party script initialization
|
|
191
|
+
- When content loads dynamically
|
|
192
|
+
|
|
193
|
+
**Important**: Always pair with \`resume()\`. Unpaired \`pause()\` will hang the test.
|
|
194
|
+
|
|
195
|
+
**Example - Data Loading**:
|
|
196
|
+
|
|
197
|
+
\`\`\`typescript
|
|
198
|
+
async function loadCriticalData() {
|
|
199
|
+
window.Meticulous?.pause?.();
|
|
200
|
+
|
|
201
|
+
try {
|
|
202
|
+
const data = await fetchDataFromAPI();
|
|
203
|
+
setData(data);
|
|
204
|
+
} finally {
|
|
205
|
+
window.Meticulous?.resume?.();
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
\`\`\`
|
|
209
|
+
|
|
210
|
+
**Example - Image Loading**:
|
|
211
|
+
|
|
212
|
+
\`\`\`typescript
|
|
213
|
+
function LazyImage({ src }: { src: string }) {
|
|
214
|
+
const [loaded, setLoaded] = useState(false);
|
|
215
|
+
|
|
216
|
+
useEffect(() => {
|
|
217
|
+
if (!loaded && window.Meticulous?.isRunningAsTest) {
|
|
218
|
+
window.Meticulous?.pause?.();
|
|
219
|
+
}
|
|
220
|
+
}, [loaded]);
|
|
221
|
+
|
|
222
|
+
const handleLoad = () => {
|
|
223
|
+
setLoaded(true);
|
|
224
|
+
window.Meticulous?.resume?.();
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
return <img src={src} onLoad={handleLoad} />;
|
|
228
|
+
}
|
|
229
|
+
\`\`\`
|
|
230
|
+
|
|
231
|
+
---
|
|
232
|
+
|
|
233
|
+
### resume()
|
|
234
|
+
|
|
235
|
+
**Signature**: \`resume(): void\`
|
|
236
|
+
|
|
237
|
+
**Description**: Resume replay after \`pause()\`.
|
|
238
|
+
|
|
239
|
+
**When to use**: After the async operation started with \`pause()\` completes.
|
|
240
|
+
|
|
241
|
+
**Example - Third-Party Script**:
|
|
242
|
+
|
|
243
|
+
\`\`\`typescript
|
|
244
|
+
function loadGoogleMaps() {
|
|
245
|
+
return new Promise((resolve) => {
|
|
246
|
+
if (window.google?.maps) {
|
|
247
|
+
resolve(window.google.maps);
|
|
248
|
+
return;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
window.Meticulous?.pause?.();
|
|
252
|
+
|
|
253
|
+
const script = document.createElement('script');
|
|
254
|
+
script.src = 'https://maps.googleapis.com/.../js?key=KEY';
|
|
255
|
+
script.onload = () => {
|
|
256
|
+
window.Meticulous?.resume?.();
|
|
257
|
+
resolve(window.google.maps);
|
|
258
|
+
};
|
|
259
|
+
script.onerror = () => {
|
|
260
|
+
window.Meticulous?.resume?.();
|
|
261
|
+
reject(new Error('Failed to load'));
|
|
262
|
+
};
|
|
263
|
+
|
|
264
|
+
document.head.appendChild(script);
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
\`\`\`
|
|
268
|
+
|
|
269
|
+
---
|
|
270
|
+
|
|
271
|
+
### recordCustomEvent()
|
|
272
|
+
|
|
273
|
+
**Signature**: \`recordCustomEvent(event: { type: string; payload?: any }): void\`
|
|
274
|
+
|
|
275
|
+
**Description**: Record a custom event with optional payload.
|
|
276
|
+
|
|
277
|
+
**Parameters**:
|
|
278
|
+
- \`event.type\`: String identifying the event type
|
|
279
|
+
- \`event.payload\`: Optional data to store with event
|
|
280
|
+
|
|
281
|
+
**When to use**: Advanced scenarios requiring fine-grained replay control.
|
|
282
|
+
|
|
283
|
+
**Example**:
|
|
284
|
+
|
|
285
|
+
\`\`\`typescript
|
|
286
|
+
// Record event during session
|
|
287
|
+
function handlePaymentComplete(transaction: Transaction) {
|
|
288
|
+
if (window.Meticulous?.recordCustomEvent) {
|
|
289
|
+
window.Meticulous.recordCustomEvent({
|
|
290
|
+
type: 'PAYMENT_COMPLETE',
|
|
291
|
+
payload: {
|
|
292
|
+
transactionId: transaction.id,
|
|
293
|
+
amount: transaction.amount,
|
|
294
|
+
timestamp: Date.now(),
|
|
295
|
+
},
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
showSuccessMessage();
|
|
300
|
+
}
|
|
301
|
+
\`\`\`
|
|
302
|
+
|
|
303
|
+
---
|
|
304
|
+
|
|
305
|
+
### onReplayCustomEvent()
|
|
306
|
+
|
|
307
|
+
**Signature**: \`onReplayCustomEvent(handler: (event: CustomEvent) => void): void\`
|
|
308
|
+
|
|
309
|
+
**Description**: Register handler for custom events during replay.
|
|
310
|
+
|
|
311
|
+
**Parameters**:
|
|
312
|
+
- \`handler\`: Function called when custom event is replayed
|
|
313
|
+
|
|
314
|
+
**Example**:
|
|
315
|
+
|
|
316
|
+
\`\`\`typescript
|
|
317
|
+
// Setup handler during component mount
|
|
318
|
+
useEffect(() => {
|
|
319
|
+
if (window.Meticulous?.onReplayCustomEvent) {
|
|
320
|
+
window.Meticulous.onReplayCustomEvent((event) => {
|
|
321
|
+
if (event.type === 'PAYMENT_COMPLETE') {
|
|
322
|
+
console.log('Replaying payment:', event.payload);
|
|
323
|
+
handlePaymentReplay(event.payload);
|
|
324
|
+
}
|
|
325
|
+
});
|
|
326
|
+
}
|
|
327
|
+
}, []);
|
|
328
|
+
\`\`\`
|
|
329
|
+
|
|
330
|
+
---
|
|
331
|
+
|
|
332
|
+
## Backend Detection
|
|
333
|
+
|
|
334
|
+
### meticulous-is-test Header
|
|
335
|
+
|
|
336
|
+
Check for the \`meticulous-is-test\` header in server-side code:
|
|
337
|
+
|
|
338
|
+
**Value**: \`"1"\` when running as test
|
|
339
|
+
|
|
340
|
+
**Security**: For secure detection, set a custom secret header in project settings.
|
|
341
|
+
|
|
342
|
+
### Next.js App Router
|
|
343
|
+
|
|
344
|
+
\`\`\`typescript
|
|
345
|
+
import { headers } from 'next/headers';
|
|
346
|
+
|
|
347
|
+
export async function isMeticulousTest(): Promise<boolean> {
|
|
348
|
+
const requestHeaders = await headers();
|
|
349
|
+
return requestHeaders.get('meticulous-is-test') === '1';
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
// Usage in Server Component
|
|
353
|
+
export default async function Page() {
|
|
354
|
+
const isTest = await isMeticulousTest();
|
|
355
|
+
|
|
356
|
+
if (isTest) {
|
|
357
|
+
// Skip auth, use test data, etc.
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
return <div>...</div>;
|
|
361
|
+
}
|
|
362
|
+
\`\`\`
|
|
363
|
+
|
|
364
|
+
### Next.js Pages Router
|
|
365
|
+
|
|
366
|
+
\`\`\`typescript
|
|
367
|
+
export const getServerSideProps = (context) => {
|
|
368
|
+
const { req } = context;
|
|
369
|
+
const isTest = req.headers['meticulous-is-test'] === '1';
|
|
370
|
+
|
|
371
|
+
return {
|
|
372
|
+
props: {
|
|
373
|
+
isRunningAsMeticulousTest: isTest,
|
|
374
|
+
},
|
|
375
|
+
};
|
|
376
|
+
};
|
|
377
|
+
|
|
378
|
+
function Page({ isRunningAsMeticulousTest }) {
|
|
379
|
+
if (isRunningAsMeticulousTest) {
|
|
380
|
+
// Test-specific rendering
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
return <div>...</div>;
|
|
384
|
+
}
|
|
385
|
+
\`\`\`
|
|
386
|
+
|
|
387
|
+
### Express.js
|
|
388
|
+
|
|
389
|
+
\`\`\`typescript
|
|
390
|
+
app.get('/api/data', (req, res) => {
|
|
391
|
+
const isTest = req.headers['meticulous-is-test'] === '1';
|
|
392
|
+
|
|
393
|
+
if (isTest) {
|
|
394
|
+
// Return test data
|
|
395
|
+
res.json({ data: 'test-data' });
|
|
396
|
+
} else {
|
|
397
|
+
// Return real data
|
|
398
|
+
res.json({ data: getRealData() });
|
|
399
|
+
}
|
|
400
|
+
});
|
|
401
|
+
\`\`\`
|
|
402
|
+
|
|
403
|
+
---
|
|
404
|
+
|
|
405
|
+
## Common Patterns
|
|
406
|
+
|
|
407
|
+
### Pattern 1: Skip Validation
|
|
408
|
+
|
|
409
|
+
\`\`\`typescript
|
|
410
|
+
function submitForm(data: FormData) {
|
|
411
|
+
if (!window.Meticulous?.isRunningAsTest) {
|
|
412
|
+
// Only validate in normal mode
|
|
413
|
+
if (!data.email) {
|
|
414
|
+
throw new Error('Email required');
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
// Submit form
|
|
419
|
+
return api.post('/submit', data);
|
|
420
|
+
}
|
|
421
|
+
\`\`\`
|
|
422
|
+
|
|
423
|
+
### Pattern 2: Deterministic Values
|
|
424
|
+
|
|
425
|
+
\`\`\`typescript
|
|
426
|
+
function generateId(): string {
|
|
427
|
+
if (window.Meticulous?.isRunningAsTest) {
|
|
428
|
+
return 'test-id-12345';
|
|
429
|
+
}
|
|
430
|
+
return crypto.randomUUID();
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
function getCurrentTimestamp(): string {
|
|
434
|
+
if (window.Meticulous?.isRunningAsTest) {
|
|
435
|
+
return '2024-01-01T00:00:00Z';
|
|
436
|
+
}
|
|
437
|
+
return new Date().toISOString();
|
|
438
|
+
}
|
|
439
|
+
\`\`\`
|
|
440
|
+
|
|
441
|
+
### Pattern 3: Disable Third-Party Services
|
|
442
|
+
|
|
443
|
+
\`\`\`typescript
|
|
444
|
+
function initializeServices() {
|
|
445
|
+
if (!window.Meticulous?.isRunningAsTest) {
|
|
446
|
+
initializeAnalytics();
|
|
447
|
+
initializeSentry();
|
|
448
|
+
initializeIntercom();
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
\`\`\`
|
|
452
|
+
|
|
453
|
+
### Pattern 4: Feature Flags
|
|
454
|
+
|
|
455
|
+
\`\`\`typescript
|
|
456
|
+
function useFeatureFlag(flagName: string): boolean {
|
|
457
|
+
const [enabled, setEnabled] = useState(false);
|
|
458
|
+
|
|
459
|
+
useEffect(() => {
|
|
460
|
+
if (window.Meticulous?.isRunningAsTest) {
|
|
461
|
+
const stored = window.Meticulous.getCustomValues();
|
|
462
|
+
if (stored?.featureFlags?.[flagName] !== undefined) {
|
|
463
|
+
setEnabled(stored.featureFlags[flagName]);
|
|
464
|
+
return;
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
// Normal flag fetching
|
|
469
|
+
fetchFlag(flagName).then(setEnabled);
|
|
470
|
+
}, [flagName]);
|
|
471
|
+
|
|
472
|
+
return enabled;
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
// Record flags during session
|
|
476
|
+
if (window.Meticulous?.recordCustomValues) {
|
|
477
|
+
window.Meticulous.recordCustomValues({
|
|
478
|
+
featureFlags: {
|
|
479
|
+
newCheckout: true,
|
|
480
|
+
experimentalUI: false,
|
|
481
|
+
},
|
|
482
|
+
});
|
|
483
|
+
}
|
|
484
|
+
\`\`\`
|
|
485
|
+
|
|
486
|
+
### Pattern 5: Conditional Rendering
|
|
487
|
+
|
|
488
|
+
\`\`\`typescript
|
|
489
|
+
function WelcomeBanner() {
|
|
490
|
+
if (window.Meticulous?.isRunningAsTest) {
|
|
491
|
+
// Don't show banner during tests
|
|
492
|
+
return null;
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
return <div>Welcome!</div>;
|
|
496
|
+
}
|
|
497
|
+
\`\`\`
|
|
498
|
+
|
|
499
|
+
---
|
|
500
|
+
|
|
501
|
+
## Integration Patterns
|
|
502
|
+
|
|
503
|
+
### React Hook
|
|
504
|
+
|
|
505
|
+
\`\`\`typescript
|
|
506
|
+
function useMeticulous() {
|
|
507
|
+
return {
|
|
508
|
+
isTest: window.Meticulous?.isRunningAsTest ?? false,
|
|
509
|
+
recordValues: window.Meticulous?.recordCustomValues,
|
|
510
|
+
getValues: window.Meticulous?.getCustomValues,
|
|
511
|
+
pause: window.Meticulous?.pause,
|
|
512
|
+
resume: window.Meticulous?.resume,
|
|
513
|
+
};
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
// Usage
|
|
517
|
+
function MyComponent() {
|
|
518
|
+
const { isTest, recordValues } = useMeticulous();
|
|
519
|
+
|
|
520
|
+
if (isTest) {
|
|
521
|
+
// Test-specific logic
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
\`\`\`
|
|
525
|
+
|
|
526
|
+
### Context Provider
|
|
527
|
+
|
|
528
|
+
\`\`\`typescript
|
|
529
|
+
const MeticulousContext = createContext({
|
|
530
|
+
isTest: false,
|
|
531
|
+
recordValues: () => {},
|
|
532
|
+
getValues: () => ({}),
|
|
533
|
+
});
|
|
534
|
+
|
|
535
|
+
function MeticulousProvider({ children }) {
|
|
536
|
+
const value = {
|
|
537
|
+
isTest: window.Meticulous?.isRunningAsTest ?? false,
|
|
538
|
+
recordValues: window.Meticulous?.recordCustomValues?.bind(window.Meticulous) ?? (() => {}),
|
|
539
|
+
getValues: window.Meticulous?.getCustomValues?.bind(window.Meticulous) ?? (() => ({})),
|
|
540
|
+
};
|
|
541
|
+
|
|
542
|
+
return (
|
|
543
|
+
<MeticulousContext.Provider value={value}>
|
|
544
|
+
{children}
|
|
545
|
+
</MeticulousContext.Provider>
|
|
546
|
+
);
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
// Usage
|
|
550
|
+
const { isTest } = useContext(MeticulousContext);
|
|
551
|
+
\`\`\`
|
|
552
|
+
|
|
553
|
+
---
|
|
554
|
+
|
|
555
|
+
## Best Practices
|
|
556
|
+
|
|
557
|
+
### 1. Always Use Optional Chaining
|
|
558
|
+
|
|
559
|
+
\`\`\`typescript
|
|
560
|
+
// Good
|
|
561
|
+
window.Meticulous?.isRunningAsTest
|
|
562
|
+
|
|
563
|
+
// Bad - throws error if Meticulous not loaded
|
|
564
|
+
window.Meticulous.isRunningAsTest
|
|
565
|
+
\`\`\`
|
|
566
|
+
|
|
567
|
+
### 2. Pair pause() with resume()
|
|
568
|
+
|
|
569
|
+
\`\`\`typescript
|
|
570
|
+
// Good - always resume
|
|
571
|
+
async function load() {
|
|
572
|
+
window.Meticulous?.pause?.();
|
|
573
|
+
try {
|
|
574
|
+
await fetchData();
|
|
575
|
+
} finally {
|
|
576
|
+
window.Meticulous?.resume?.();
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
// Bad - might not resume
|
|
581
|
+
async function load() {
|
|
582
|
+
window.Meticulous?.pause?.();
|
|
583
|
+
await fetchData();
|
|
584
|
+
window.Meticulous?.resume?.(); // Skipped if fetchData throws
|
|
585
|
+
}
|
|
586
|
+
\`\`\`
|
|
587
|
+
|
|
588
|
+
### 3. Check isRunningAsTest Before Using Other Methods
|
|
589
|
+
|
|
590
|
+
\`\`\`typescript
|
|
591
|
+
// Good
|
|
592
|
+
if (window.Meticulous?.isRunningAsTest) {
|
|
593
|
+
const values = window.Meticulous.getCustomValues();
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
// Also good
|
|
597
|
+
const values = window.Meticulous?.getCustomValues?.();
|
|
598
|
+
\`\`\`
|
|
599
|
+
|
|
600
|
+
### 4. Record Early, Retrieve Early
|
|
601
|
+
|
|
602
|
+
\`\`\`typescript
|
|
603
|
+
// Record as soon as data is available
|
|
604
|
+
useEffect(() => {
|
|
605
|
+
if (userData && window.Meticulous?.recordCustomValues) {
|
|
606
|
+
window.Meticulous.recordCustomValues({ user: userData });
|
|
607
|
+
}
|
|
608
|
+
}, [userData]);
|
|
609
|
+
|
|
610
|
+
// Retrieve during component initialization
|
|
611
|
+
useEffect(() => {
|
|
612
|
+
if (window.Meticulous?.isRunningAsTest) {
|
|
613
|
+
const stored = window.Meticulous.getCustomValues();
|
|
614
|
+
if (stored?.user) {
|
|
615
|
+
setUser(stored.user);
|
|
616
|
+
}
|
|
617
|
+
}
|
|
618
|
+
}, []); // Empty deps - run once
|
|
619
|
+
\`\`\`
|
|
620
|
+
|
|
621
|
+
---
|
|
622
|
+
|
|
623
|
+
## Troubleshooting
|
|
624
|
+
|
|
625
|
+
### window.Meticulous is undefined
|
|
626
|
+
|
|
627
|
+
**Cause**: Recorder not loaded
|
|
628
|
+
|
|
629
|
+
**Solutions**:
|
|
630
|
+
- Verify recorder script tag is in HTML
|
|
631
|
+
- Check script loads before app code
|
|
632
|
+
- Check for CSP blocking
|
|
633
|
+
|
|
634
|
+
### Custom values not available during replay
|
|
635
|
+
|
|
636
|
+
**Cause**: Values not recorded or size limit exceeded
|
|
637
|
+
|
|
638
|
+
**Solutions**:
|
|
639
|
+
- Check \`recordCustomValues\` was called during recording
|
|
640
|
+
- Verify value size < 1MB (prod) or 20MB (dev)
|
|
641
|
+
- Check \`data-is-production-environment\` setting
|
|
642
|
+
|
|
643
|
+
### Pause/Resume hanging tests
|
|
644
|
+
|
|
645
|
+
**Cause**: \`resume()\` never called
|
|
646
|
+
|
|
647
|
+
**Solutions**:
|
|
648
|
+
- Use try/finally to ensure \`resume()\` always runs
|
|
649
|
+
- Check async callbacks complete
|
|
650
|
+
- Add timeout fallback
|
|
651
|
+
|
|
652
|
+
---
|
|
653
|
+
|
|
654
|
+
## TypeScript Types
|
|
655
|
+
|
|
656
|
+
For full TypeScript type definitions:
|
|
657
|
+
|
|
658
|
+
\`\`\`typescript
|
|
659
|
+
interface Meticulous {
|
|
660
|
+
isRunningAsTest?: boolean;
|
|
661
|
+
recordCustomValues?: (values: Record<string, any>) => void;
|
|
662
|
+
getCustomValues?: () => Record<string, any> | undefined;
|
|
663
|
+
pause?: () => void;
|
|
664
|
+
resume?: () => void;
|
|
665
|
+
recordCustomEvent?: (event: { type: string; payload?: any }) => void;
|
|
666
|
+
onReplayCustomEvent?: (handler: (event: any) => void) => void;
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
declare global {
|
|
670
|
+
interface Window {
|
|
671
|
+
Meticulous?: Meticulous;
|
|
672
|
+
}
|
|
673
|
+
}
|
|
674
|
+
\`\`\`
|
|
675
|
+
|
|
676
|
+
See [TypeScript Types](${TYPESCRIPT_TYPES_URL}) for importable types.
|
|
677
|
+
|
|
678
|
+
---
|
|
679
|
+
|
|
680
|
+
## See Also
|
|
681
|
+
|
|
682
|
+
- [Record Custom Values](${RECORD_CUSTOM_VALUES_URL}) - Detailed custom values guide
|
|
683
|
+
- [Custom Event API](${USE_CUSTOM_EVENT_API_URL}) - Advanced event handling
|
|
684
|
+
- [Handle File Uploads](${HANDLE_FILE_UPLOADS_URL}) - File upload patterns
|
|
685
|
+
`;
|