feat!: remove nunjucks support and `ag` CLI
Blockers removed:
- [DONE] and this https://asyncapi.slack.com/archives/CQVJXFNQL/p1763542946954309 as I'd like to change Node dependency in project. So this PR now depends on updates needed in https://github.com/asyncapi/.github/blob/master/.github/actions/get-node-version-from-package-lock/action.yml first. We can switch new major to support only latest node
- [DONE] also clear approval for https://github.com/asyncapi/cli/issues/1904 is needed, so once this PR is merged, I can immediately work on adding v3 to CLI. Maintainer π’ light for generator update plans
Resolves: https://github.com/asyncapi/generator/issues/1720
Breaking Changes
- Node 24 and npm 11 must have
- Nunjucks renderer removed β React is now the sole rendering engine. No need to specify render engine in config anymore
- Nunjucks filters package and its public filters removed; filter-based template APIs no longer available.
agCLI is no longer available. Long time ago it was already announced that it will be removed and people should move to AsyncAPI CLI. Old CLI code without watcher is still there but moved to tests as purely local-dev solution
Migration Guides
Summary by CodeRabbit
-
Removed Features
- Legacy Nunjucks renderer, filters package, file-watcher utility, CLI entry points, Docker release workflow, and related test fixtures removed.
-
Breaking Changes
- React is now the only renderer; Node and npm minimum versions raised.
-
Documentation
- Nunjucks migration guides and Nunjucks-specific docs removed; docs streamlined for React.
-
Tests
- Nunjucks-related tests deleted or reduced.
-
Chores
- Updated configs, templates, manifests, and CI to reflect these removals and dependency updates.
βοΈ Tip: You can customize this high-level summary in your review settings.
π¦ Changeset detected
Latest commit: b31c428645f69b13c72ac134d5cc809de06f74a1
The changes in this PR will be included in the next version bump.
This PR includes changesets to release 3 packages
| Name | Type |
|---|---|
| @asyncapi/generator | Major |
| @asyncapi/generator-helpers | Major |
| @asyncapi/template-kafka-integration-test | 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
Removes Nunjucks renderer, filters package, in-repo file watcher and test-only ag CLI; makes React the sole render engine; updates generator core, tests, templates, docs, manifests, workflows, and Node/NPM engine requirements.
Changes
| Cohort / File(s) | Summary |
|---|---|
Renderer & filters apps/generator/lib/renderer/nunjucks.js, apps/generator/lib/filtersRegistry.js, apps/nunjucks-filters/*, apps/nunjucks-filters/src/*, apps/nunjucks-filters/docs/* |
Deleted Nunjucks renderer implementation, filters registry, and entire apps/nunjucks-filters package (sources, tests, docs). Public filter APIs and exports removed. |
Generator core & utils apps/generator/lib/generator.js, apps/generator/lib/utils.js, apps/generator/lib/templates/config/validator.js |
Removed Nunjucks branches and filter registration; unified rendering to React-only; removed isReactTemplate/isLocalTemplate helpers; updated renderer validation/messages. |
Watcher & test CLI apps/generator/lib/watcher.js, apps/generator/test/cli.js |
Removed file-watcher module and watcher-related CLI logic; dropped --watch-template and watcher flows; test CLI imports/path adjustments and deprecation note. |
Tests & fixtures apps/generator/test/*.js, apps/generator/test/test-project/package.json, apps/generator/test/test-templates/nunjucks-template/*, apps/generator/test/test-templates/react-template/.ageneratorrc, apps/generator/lib/__mocks__/utils.js |
Deleted Nunjucks-related tests, fixtures, mocks (filtersRegistry, isReactTemplate); updated Jest mappings to drop @asyncapi/nunjucks-filters alias; adjusted test templates and CLI usage. |
Package manifests & deps apps/generator/package.json, apps/nunjucks-filters/package.json, top-level package.json |
Removed apps/nunjucks-filters manifest; removed dependencies nunjucks, @asyncapi/nunjucks-filters, chokidar; removed apps/generator bin entries; bumped Node/NPM engine requirements; bumped parser/modelina deps. |
Template manifests packages/templates/.../.ageneratorrc (e.g. packages/templates/clients/.../*.ageneratorrc) |
Removed explicit renderer: react entries from multiple template .ageneratorrc files and normalized some description strings. |
Docs & migration guides README.md, Development.md, apps/generator/docs/* (deleted: nunjucks-*, migration-nunjucks-react.md, migration-cli.md, etc.) |
Removed Nunjucks-specific docs, Filters section and migration guides; simplified Hooks/docs to React-only and updated development/testing guidance. |
Template docs & examples apps/generator/docs/template*.md, apps/generator/docs/file-templates.md, apps/generator/docs/asyncapi-document.md, apps/generator/docs/template-development.md, apps/generator/docs/generator-template*.md |
Removed renderer fields from examples and Nunjucks-specific instructions; updated wording/validation examples to React-only. |
Test template content removals apps/generator/test/test-templates/nunjucks-template/package.json, .../template/test-file.md |
Deleted Nunjucks test template manifest and template file content. |
CI, Docker & workflows .github/workflows/*, apps/generator/Dockerfile, packages/templates/.../test/*/microcks-*.yml |
Updated workflows to Node 24 or derive Node from lockfile; removed Docker release workflow and apps/generator/Dockerfile; updated Podman test images to Node 24; simplified CI matrix/steps. |
Changeset .changeset/remove-deprecated-nunjucks-cli.md |
Added a changeset documenting breaking changes: Node/NPM engine bumps, removal of Nunjucks renderer/filters, and deprecation/removal of ag CLI and watcher features. |
Estimated code review effort
π― 4 (Complex) | β±οΈ ~45 minutes
- Areas needing extra attention:
- apps/generator/lib/generator.js β verify React-only rendering path, template compilation, and no leftover Nunjucks references.
- tests & mocks β ensure all references and Jest mappings for
@asyncapi/nunjucks-filters,filtersRegistry, and removed helpers are eliminated. - CI/workflows & manifests β validate Node/NPM engine bumps, removal of Docker workflow, and
binremoval impact on downstream tooling.
Possibly related PRs
- asyncapi/generator#1329 β edits
apps/generator/lib/generator.js; likely overlaps with the rendering refactor. - asyncapi/generator#1747 β modifies Jest config/moduleNameMapper for
@asyncapi/nunjucks-filters; directly related to test mapping removals. - asyncapi/generator#1445 β changes
apps/generator/Dockerfile; related because this PR deletes that Dockerfile and Docker publish workflow.
Pre-merge checks and finishing touches
β Passed checks (5 passed)
| Check name | Status | Explanation |
|---|---|---|
| Description Check | β Passed | Check skipped - CodeRabbitβs high-level summary is enabled. |
| Title check | β Passed | The PR title clearly and concisely identifies the main breaking changes: removal of Nunjucks support and the ag CLI, which align with the primary objectives in the linked issue. |
| Linked Issues check | β Passed | The PR comprehensively addresses all coding objectives from issue #1720: removes Nunjucks renderer and filters, removes ag CLI code, makes React the default renderer, and updates documentation accordingly. |
| Out of Scope Changes check | β Passed | All changes are directly aligned with the removal of Nunjucks and ag CLI. Dependency updates to @asyncapi/parser and @asyncapi/modelina support the transition to React-only rendering and are within scope. |
| Docstring Coverage | β Passed | Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. |
β¨ Finishing touches
π§ͺ Generate unit tests (beta)
- [ ] Create PR with unit tests
- [ ] Post copyable unit tests in a comment
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.
Comment @coderabbitai help to get the list of available commands and usage tips.
What reviewer looks at during PR review
The following are ideal points maintainers look for during review. Reviewing these points yourself beforehand can help streamline the review process and reduce time to merge.
-
PR Title: Use a concise title that follows our Conventional Commits guidelines and clearly summarizes the change using imperative mood (it means
spoken or written as if giving a command or instruction, like "add new helper for listing operations")Note - In Generator, prepend
feat:orfix:in PR title only when PATCH/MINOR release must be triggered. -
PR Description: Clearly explain the issue being solved, summarize the changes made, and mention the related issue.
Note - In Generator, we use Maintainers Work board to track progress. Ensure the PR Description includes
Resolves #<issue-number>orFixes #<issue-number>this will automatically close the linked issue when the PR is merged and helps automate the maintainers workflow. -
Documentation: Update the relevant Generator documentation to accurately reflect the changes introduced in the PR, ensuring users and contributors have up-to-date guidance.
-
Comments and JSDoc: Write clear and consistent JSDoc comments for functions, including parameter types, return values, and error conditions, so others can easily understand and use the code.
-
DRY Code: Ensure the code follows the Don't Repeat Yourself principle. Look out for duplicate logic that can be reused.
-
Test Coverage: Ensure the new code is well-tested with meaningful test cases that pass consistently and cover all relevant edge cases.
-
Commit History: Contributors should avoid force-pushing as much as possible. It makes it harder to track incremental changes and review the latest updates.
-
Template Design Principles Alignment: While reviewing template-related changes in the
packages/directory, ensure they align with the Assumptions and Principles. If any principle feels outdated or no longer applicable, start a discussion these principles are meant to evolve with the project. -
Reduce Scope When Needed: If an issue or PR feels too large or complex, consider splitting it and creating follow-up issues. Smaller, focused PRs are easier to review and merge.
-
Bot Comments: As reviewers, check that contributors have appropriately addressed comments or suggestions made by automated bots. If there are bot comments the reviewer disagrees with, react to them or mark them as resolved, so the review history remains clear and accurate.
π Docs preview deployed Below link points directly to the generator docs preview. May the force be with you! β https://6916d4c0145e21b0ff0e2f12--asyncapi-website.netlify.app/docs/tools/generator
π Docs preview deployed Below link points directly to the generator docs preview. May the force be with you! β https://6916d4dab5243f1995309f10--asyncapi-website.netlify.app/docs/tools/generator
π Docs preview deployed Below link points directly to the generator docs preview. May the force be with you! β https://693bec5e58e65608ecbf25c7--asyncapi-website.netlify.app/docs/tools/generator
Tests are green but of what is left:
- double check from my side
- make sure docs changes actually make sense from a big picture perspective
- and this https://asyncapi.slack.com/archives/CQVJXFNQL/p1763542946954309 as I'd like to change Node dependency in project
And I did not even touch CLI ag removal topic
/bounty
@asyncapi/bounty_team
deprecated cli
addressing first blocker that is also blocker for releases after security issues: https://github.com/asyncapi/.github/pull/369
@aeworxet I just updated the description. Blockers removed. I continue with the task.
@magicmatatjahu ready for review
Quality Gate passed
Issues
0 New issues
0 Accepted issues
Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code
/rtm