Repository navigation
Typecheck Checkly CLI snippets against checkly@10 - #737
Merged
Merged
Conversation
checkly@10 requires Node >=22.13.
Extracts code blocks that import from checkly, typechecks them with the
TypeScript compiler API against the installed CLI, and reports errors at
the MDX line. Opt out per block with {/* typecheck-skip */}. Runs
report-only in static docs checks for now.
Add required projectName/logicalId to abbreviated config examples, close the unterminated ApiCheck example and give it a request, and shift highlight ranges accordingly.
Snippets marked with /* More options... */ may omit required props; wrong or unknown props still fail the typecheck.
AgenticCheck was removed in checkly@10; these pages document v9 until the December 1, 2026 shutdown.
{/* typecheck-wrap: ApiCheck */} before a fence auto-imports the checkly
exports and wraps property fragments in the named construct.
Mark fragments with typecheck-wrap, auto-import path for entrypoints, and add the missing request method to the inline setup script example.
Mark fragments with typecheck-wrap so they're checked against checkly@10. Add /* More options... */ to usage examples that omit required props, and projectName/logicalId to abbreviated checkly.config.ts examples.
Contributor
|
Preview deployment for your docs. Learn more about Mintlify Previews.
|
# Conflicts: # package-lock.json # package.json
stefanjudis
marked this pull request as ready for review
October 28, 2026 15:19
This was referenced Oct 29, 2026
# Conflicts: # constructs/tcp-monitor.mdx # detect/synthetic-monitoring/playwright-checks/dependencies.mdx # package.json
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Typechecks the docs' Checkly CLI code snippets against the latest
checklyrelease (currently 10.1.0) on every PR, so examples can't drift from the constructs. It also fixes the snippets that didn't typecheck.Affected Components
What changed
Checker (
.github/snippet-typecheck/).mdxfiles (.mintignoredirs,samples/andnode_modulesexcluded) and typechecks them in memory with the TypeScript compiler API against the latest CLI. Runs in about a second.checkly,@checkly/playwright-helpers,@playwright/testand@types/nodeonlatestand no lockfile (.npmrc:package-lock=false). Every run checks against the newest CLI release, independently of the docs project's ownchecklyversion. Because the packages are unpinned,.npmrcalso setsignore-scripts=true, so they never run install scripts. TypeScript is pinned to^6: 7 (the Go-native compiler) has no JavaScript compiler API.npm run check:snippetsruns the check,npm run test:snippetsruns its 30node:testtests. Both runnpm updatefirst, becausenpm installkeeps an already-installed version of alatestdependency. That way local runs use the same CLI as CI.What gets checked (584 snippets)
requirefromcheckly,checkly/constructsorcheckly/util.new BrowserCheck(,Frequency.EVERY_5M,UrlAssertionBuilder.…), with no marker needed. Exports that are also globals, likeRequest, don't count.{/* typecheck-wrap: ApiCheck */}: property fragments likerequest: {...}are checked insidenew ApiCheck('snippet', {...}). Fragments that already call the constructor only get imports added.{/* typecheck-wrap */}: statements that don't use a construct directly, likeexport default defineConfig(...). These only get imports added.checkly/constructsandcheckly/utilexport,defineConfigandpathauto-imported. Readers don't see any of it.{/* typecheck-skip */}opts a block out. It's only used on the 6AgenticCheckblocks, which document CLI v9 until the December 1, 2026 shutdown.Rules that keep it from failing on intentional shortcuts
/* More options... */: the docs already use this 84 times to mark shortened snippets. In those, missing required props are allowed; wrong or unknown props still fail.Relative imports in multi-file examples (
./group.check) resolve toany.Undeclared lowercase names in fragments (
statusPage,group) count as page context. Unknown PascalCase names (a removed or misspelled construct) still fail.// Equivalent to:in assertion examples: the comment and the raw object after it are dropped, and the builder call above it is checked.Left unchecked on purpose: nested option fragments (
sslConfig: {...},reminders: {...}), Playwright configs, and non-Checkly code.CI and dependencies
static-docs-checks.yml. It installs the checker's dependencies fresh and runs on docs changes, and also when anything in.github/snippet-typecheck/changes. It doesn't need the rootnpm ci.latest: a CLI release that changes the types fails the snippet step on every open docs PR until the snippets are fixed onmain.checkly(used for this repo's own monitoring) goes from 8.2.0 to 10.0.0. Apart from that, the rootpackage.jsononly gains the two snippet scripts. v10 requires Node ≥ 22.13, so deploy-checks, preview-checks and static-docs-checks move from Node 20 to 22..playwright-cli/and.playwright-mcp/are now gitignored.__checks__/no-console-errors.spec.tsnow ignores Facebook requests.Doc fixes the check found
projectName/logicalIdin shortenedcheckly.config.tsexamples: Playwright Check Suite pages, including-checks, checkly-runtimes. Highlight ranges are shifted to match.defineConfig(config)withlocationswidened tostring[]: the JS config incli/installation.mdxnow passes the object todefineConfigdirectly.ApiCheckblock, which also lacked arequest:cli/checkly-runtimes.mdx.ApiCheckinline setup example with no requestmethod:constructs/api-check.mdx....placeholders:cli/importing.mdx.page.getByLabel('email', { name: /email/i }):getByLabelhas nonameoption, so it was ignored. NowgetByLabel(/email/i)(and password) inconstructs/browser-check.mdx.api-check.mdxandtcp-monitor.mdx./* More options... */added to usage examples that omit required props: url, dns, icmp, tcp, heartbeat, multistep, overview.Notes for the Reviewer
main, the snippet check reports 0 errors againstcheckly@10.1.0. Snippet tests, API-nav tests, frontmatter, redirect destinations and broken links all pass locally. Before that merge, I rendered all 48 changed pages at the time, plus one page that includes a changed snippet, withmint dev: no marker text is visible, and every CodeGroup has the same tab count as its source. The render wasn't repeated after the merge.New Dependency Submission
checkly8.2.0 → 10.0.0 (devDependency), for this repo's own monitoring..github/snippet-typecheck/(separate package, not installed with the root project):checkly,@checkly/playwright-helpers(seven pages import it),@playwright/test,@types/nodeonlatest, andtypescript^6.Screenshots
No visual changes. The markers are MDX comments and don't render.