generator
generator copied to clipboard
fix: add `generator-react-sdk` library and release as patch first time under `generator` monorepo
resolves https://github.com/asyncapi/generator/issues/1044
moving last repo https://github.com/asyncapi/generator-react-sdk to generator to complete monorepo setup
this is first time we include package that will also be release separately
Summary by CodeRabbit
-
New Features
- Introduced the AsyncAPI React SDK package, enabling React-based template rendering and code generation.
- Added React components (
File,Indent,Text) and utility functions for customizable rendering and indentation. - Provided functions for transpiling and rendering React templates to string output.
- Included comprehensive API documentation and usage examples.
-
Documentation
- Added detailed README and API documentation for the new React SDK package.
- Updated the main README to list the React SDK as part of the monorepo.
-
Bug Fixes
- Added a new contributor to the contributors list.
-
Chores
- Added and updated
.gitignoreand.eslintignorefiles to exclude editor and build artifacts. - Updated workspace configuration and package dependencies, including test tools for templates.
- Added TypeScript, ESLint, and Jest configurations for the React SDK.
- Added and updated
-
Tests
- Introduced comprehensive test suites for React components, rendering, template functions, and transpiler output to ensure reliability and correctness.
🦋 Changeset detected
Latest commit: fd35328f1fa1f889676eea20c5833e7bb1c54aaf
The changes in this PR will be included in the next version bump.
This PR includes changesets to release 2 packages
| Name | Type |
|---|---|
| @asyncapi/generator-react-sdk | Patch |
| @asyncapi/generator | Patch |
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
Walkthrough
This change migrates the generator-react-sdk codebase into the monorepo under apps/react-sdk, including all its components, utilities, tests, documentation, configuration, and publishing setup. The monorepo is updated to recognize and document the new package, and related configuration files are adjusted to support the new structure.
Changes
| File(s) / Path(s) | Change Summary |
|---|---|
| .all-contributorsrc | Added new contributor entry for "Julusian". |
| .changeset/silly-pants-shave.md | Added changeset describing migration of generator-react-sdk to monorepo. |
| .eslintrc | Added ESLint overrides for test files, disabling specific rules. |
| .gitignore | Added .vscode to ignored files. |
| README.md | Documented new React SDK package in monorepo package list. |
| turbo.json | Disabled caching for the build pipeline; updated test pipeline dependencies. |
| .sonarcloud.properties | Updated SonarCloud exclusions and added new test exclusion pattern. |
| .eslintignore | Added new ignore paths for react-sdk lib, docs, and transpiler test transpiled files. |
| apps/react-sdk/.eslintignore, .gitignore, .releaserc, API.md, README.md, jest.config.js, package.json, tsconfig.json | Added new React SDK package with configuration, documentation, and ignore files. |
| apps/react-sdk/src/components/** (File.tsx, Indent.tsx, Text.tsx, index.ts) | Introduced main React SDK components and centralized exports. |
| apps/react-sdk/src/components/tests/** (File.spec.tsx, Indent.spec.tsx, Text.spec.tsx) | Added test suites for components. |
| apps/react-sdk/src/renderer/** (index.ts, renderer.ts, template.ts, tests/*) | Added rendering utilities, template rendering logic, and related tests. |
| apps/react-sdk/src/transpiler/** (index.ts, transpiler.ts, tests/, tests/testfiles/) | Added transpiler logic, test files for various JS formats, and test suite. |
| apps/react-sdk/src/types.ts | Added TypeScript types for SDK components and template context. |
| apps/react-sdk/src/utils/** (getStatsInDir.ts, isJsFile.ts, withIndendation.ts, withNewLines.ts, index.ts) | Added utility functions for file handling, indentation, and newlines, and centralized exports. |
| apps/react-sdk/src/index.ts | Created package entry point re-exporting all modules and utilities. |
Estimated code review effort
3 (30–60 minutes)
Possibly related PRs
- asyncapi/generator#1506: Introduces a Dart WebSocket client template that uses React components from the newly added React SDK, directly building upon the components and infrastructure introduced in this PR.
📜 Recent review details
Configuration used: .coderabbit.yaml Review profile: CHILL Plan: Pro
📥 Commits
Reviewing files that changed from the base of the PR and between 0aa29235ee30bc05e2407f82cc5a760cb0b139fd and 8e827cb549aab7ce5cabcc64a3ee44388291a10c.
📒 Files selected for processing (1)
apps/react-sdk/package.json(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- apps/react-sdk/package.json
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
- GitHub Check: Test generator as dependency with Node 20
- GitHub Check: Acceptance tests for generated templates
- GitHub Check: Test generator as dependency with Node 18
- GitHub Check: Test NodeJS PR - macos-13
- GitHub Check: Test NodeJS PR - ubuntu-latest
- GitHub Check: Test NodeJS PR - windows-latest
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
🪧 Tips
Chat
There are 3 ways to chat with CodeRabbit:
‼️ IMPORTANT Auto-reply has been disabled for this repository in the CodeRabbit settings. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.
- Files and specific lines of code (under the "Files changed" tab): Tag
@coderabbitaiin a new review comment at the desired location with your query. Examples:@coderabbitai explain this code block.@coderabbitai modularize this function.
- PR comments: Tag
@coderabbitaiin a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.@coderabbitai read src/utils.ts and explain its main purpose.@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.@coderabbitai help me debug CodeRabbit configuration file.
Support
Need help? Create a ticket on our support page for assistance with any issues or questions.
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.
CodeRabbit Commands (Invoked using PR comments)
@coderabbitai pauseto pause the reviews on a PR.@coderabbitai resumeto resume the paused reviews.@coderabbitai reviewto trigger an incremental review. This is useful when automatic reviews are disabled for the repository.@coderabbitai full reviewto do a full review from scratch and review all the files again.@coderabbitai summaryto regenerate the summary of the PR.@coderabbitai generate docstringsto generate docstrings for this PR.@coderabbitai generate sequence diagramto generate a sequence diagram of the changes in this PR.@coderabbitai resolveresolve all the CodeRabbit review comments.@coderabbitai configurationto show the current CodeRabbit configuration for the repository.@coderabbitai helpto get help.
Other keywords and placeholders
- Add
@coderabbitai ignoreanywhere in the PR description to prevent this PR from being reviewed. - Add
@coderabbitai summaryto generate the high-level summary at a specific location in the PR description. - Add
@coderabbitaianywhere in the PR title to generate the title automatically.
Documentation and Community
- Visit our Documentation for detailed information on how to use CodeRabbit.
- Join our Discord Community to get help, request features, and share feedback.
- Follow us on X/Twitter for updates and announcements.
@derberg just a curious question. What you exactly did in this PR? How all the commits are also visible what git cmds you used? Basically can you explain the process AsyncAPI follows when you want to add a new repo to monorepo.
it is special case - I wanted to preserve commits history from old repo, to have them easy to access from this PR level for future. I do it usually when moving packages inside monorepo - I used some python tool for that: https://github.com/newren/git-filter-repo
@asyncapi/bounty_team
Quality Gate passed
Issues
4 New issues
0 Accepted issues
Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code
/rtm