feat(ci): typecheck TypeScript code blocks in wix-app references#686
Open
mirivoWix wants to merge 6 commits into
Open
feat(ci): typecheck TypeScript code blocks in wix-app references#686mirivoWix wants to merge 6 commits into
mirivoWix wants to merge 6 commits into
Conversation
…nces
Adds a CI workflow that extracts all ```typescript/tsx code blocks from
skills/wix-app/references/**/*.md, generates .tsx files, and runs tsc
--noEmit to catch type errors in the documentation examples.
Key design decisions:
- Two-pass tsc approach: pass 1 finds structurally broken files (parse
errors from non-self-contained code blocks) and excludes them from
pass 2 via a generated tsconfig, ensuring parse errors don't suppress
semantic analysis on well-formed files.
- node_modules cached via actions/cache@v4 keyed on package-lock.json
hash — no reinstall on every run.
- Runs only on PRs that touch skills/wix-app/**, skips forks.
- Located in .github/wix-app-typecheck/ to avoid being published to npm
(root package.json has "files": ["skills/**"]).
Also fixes 5 pre-existing type errors found by the new check:
- DATA_COLLECTION.md: add required dataPermissions field values
- DASHBOARD_API.md: suppress navigate({relativeUrl}) without pageId
- WIX_DATA.md: suppress intentional ❌ wrong-usage example
- BOOKINGS-STAFF-SORTING.md: suppress bookings.queryBookings (valid
runtime API, types lag behind)
- PAYMENT-SETTINGS.md: add getPaymentSettingsForCheckout handler (now
required by interface); fix order.totals → priceSummary.total.amount
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…example Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…erting @ts-ignore Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…@wix/environment-service Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Summary
.github/workflows/wix-app-typecheck.yml) that runs on every PR touchingskills/wix-app/**```typescriptand```tsxcode blocks from 61 markdown reference files into.tsxfiles and runstsc --noEmitnode_modulesis cached keyed onpackage-lock.jsonhash — no reinstall on every runWhat it catches
Real type errors in documentation examples — e.g. using a property that doesn't exist on a Wix API type, passing the wrong argument type to a Wix function, or object literals that violate a declared interface.
What it ignores (structural false-positives)
Code blocks in docs are often intentionally partial. The checker silently ignores errors that are artifacts of the extraction format: duplicate identifiers, missing imports, multiple default exports, non-self-contained JSX fragments, etc.
Pre-existing errors fixed in this PR
DATA_COLLECTION.mddataPermissions: {}missing all required fieldsAccessLevelvaluesDASHBOARD_API.mdnavigate({ relativeUrl })withoutpageId@ts-ignore(valid at runtime; types are stricter)WIX_DATA.md@ts-ignorewith noteBOOKINGS-STAFF-SORTING.mdbookings.queryBookingsnot in installed types@ts-ignore(valid at runtime)PAYMENT-SETTINGS.mdgetPaymentSettingsForCheckout(now required);order.totals→order.priceSummary.total.amountTest plan
skills/wix-app/**).mdfile → CI should fail with ❌🤖 Generated with Claude Code