feat: add playground and refactor code structure#358
Merged
jonaslagoni merged 15 commits intomainfrom Apr 26, 2026
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
✅ Deploy Preview for the-codegen-project ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 3 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit c972979. Configure here.
…inputs When 'from' is absolute and 'to' is relative (or vice versa), resolve the relative path against process.cwd() in Node so the result no longer depends on how deep the absolute path is from the filesystem root. Previously the mixed-mode branch stripped the root prefix from the absolute path and treated both as relative, producing different import paths depending on where CI checked the repo out. Browser environments (no process.cwd) retain the previous strip-prefix fallback, since real absolute filesystem paths shouldn't appear there. Refresh channels snapshots to the restored 5-level import depth.
Docusaurus executes client modules during the server-side build to prerender pages. The playground page statically imported Monaco Editor and the suppressResizeObserver client module, both of which touch window/document at module init and blew up the SSR pass with 'ReferenceError: window is not defined'. - Wrap the playground page body in BrowserOnly so Monaco, the codegen browser bundle, and their dependencies are only evaluated on the client. The content lives in a new PlaygroundContent component that is required lazily inside the BrowserOnly render function. - Guard the suppressResizeObserver client module with typeof window so it's a no-op during SSR.
…ode in extracted playground Keeps behavioural parity with the pre-refactor index.tsx.
Netlify's build just OOMed in a worker ('Worker terminated due to
reaching memory limit: JS heap out of memory') while webpack minified
the client bundle (Monaco Editor + playground + JSON schemas). Bump
NODE_OPTIONS so the build stays within headroom on Netlify/Vercel (both
Linux). The Windows variant is unchanged since it's only used locally.
Contributor
Author
|
🎉 This PR is included in version 0.71.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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.

Note
Medium Risk
Medium risk because it refactors the generation pipeline from writing files during generation to returning
GeneratedFile[]and moves filesystem writes into the CLI, which can affect output paths/deduplication and downstream integrations.Overview
Adds a browser build + API for in-browser codegen. Introduces
src/browserentrypoints (generate,parseConfig,BrowserOutput) plus anesbuildbrowser bundling setup with Node polyfills and targeted shims forfs,@asyncapi/parser/browser,swagger-parser, andjson-schema-ref-parser(including lodash-to-lodash-esredirection and aSlowBufferpatch).Refactors core generation to be I/O-free. Generators and
renderGraphnow returnGeneratedFile[](path+content) instead offilesWrittenpaths, with shared Modelina generation viagenerateModels()and new portable path helpers (joinPath,relativePath); the CLIgeneratecommand now writes results to disk viawriteGeneratedFiles()and updates verbose/JSON output accordingly.Tests and tooling updated. Adds comprehensive browser generation tests (AsyncAPI/OpenAPI/JSON Schema,
$refcases, dependency ordering) and updates snapshots/path handling; addsesbuildtooling and typecheck steps tolint.Reviewed by Cursor Bugbot for commit c972979. Bugbot is set up for automated code reviews on this repo. Configure here.