Conversation
…ate inputs - Extract every inline regex across all 10 packages to named exported constants with descriptive names and JSDoc comments - MCP handler: make CORS origin configurable via MCPHandlerOptions, sanitize error responses to prevent information leakage - Router: validate hash fragments against VALID_DOM_ID_RE before passing to getElementById - Form validation: add RFC 5321 max email length check (254 chars) before regex test to mitigate ReDoS on long inputs - Deduplicate shared patterns (HTML_TAG_RE, escape regexes) - Reset lastIndex on shared global regexes to prevent stale state - All 590 tests pass, lint clean, format clean, build clean
security: extract all regexes to constants, harden MCP handler, validate inputs
…e, and llms.md - Parser: recognize <test> blocks in .utopia SFCs (parsed but ignored by compiler) - New package: @matthesketh/utopia-test with mount(), render(), fireEvent, nextTick - Vitest plugin: extracts <test> blocks into .utopia.test.ts files (only under VITEST env) - CLI: add `utopia test` command wrapping vitest with auto-injected plugin - Vite plugin: skip HMR refresh when only <test> block changes - llms.md: comprehensive LLM reference with verified framework comparisons - README: updated with test package, AI agent guidance, llms.md link - Config: vitest aliases, tsconfig paths, .gitignore for generated test files - Templates: create-utopia scaffold includes test deps and example <test> block - 23 new tests (19 in test package, 4 in compiler), 613 total passing
Combine test block support (BLOCK_RE includes 'test', type assertion includes 'test') with security audit changes (extracted regex constants, lastIndex resets).
feat(test): add <test> block support and llms.md
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
<test>block support with new@matthesketh/utopia-testpackageRelease