Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
f0fc2bc
feat: remove nunjucks support
derberg Nov 14, 2025
d141638
Merge branch 'master' into nunjucksfinallygoesaway
derberg Nov 14, 2025
45dbbd8
refactor
derberg Nov 19, 2025
703d0a6
refresh lock
derberg Nov 19, 2025
e75afe6
Merge branch 'master' into nunjucksfinallygoesaway
derberg Nov 19, 2025
02d7166
docs
derberg Nov 19, 2025
1eae283
Merge branch 'nunjucksfinallygoesaway' of https://github.com/derberg/…
derberg Nov 19, 2025
26cf037
Update package-lock.json
derberg Nov 19, 2025
a5d6810
Update jest.config.js
derberg Nov 19, 2025
2e7a403
Update apps/generator/docs/typescript-support.md
derberg Nov 19, 2025
0c4d036
remove cli
derberg Nov 22, 2025
886bc20
Delete migration-cli.md
derberg Nov 22, 2025
e5efa5b
changeset
derberg Nov 22, 2025
090eee5
minor
derberg Nov 22, 2025
2c7be47
Update .changeset/remove-deprecated-nunjucks-cli.md
derberg Nov 22, 2025
925a5dd
remove watcher
derberg Nov 22, 2025
112a5ab
isLocalTemplate removal
derberg Nov 22, 2025
fc946fa
Merge branch 'master' into nunjucksfinallygoesaway
derberg Dec 8, 2025
9eaad55
make node 24 must have
derberg Dec 8, 2025
d20805c
update changeset
derberg Dec 8, 2025
4f86da6
Merge branch 'master' into nunjucksfinallygoesaway
derberg Dec 8, 2025
8bb9fd3
update workflows
derberg Dec 8, 2025
eca3b6c
Merge branch 'nunjucksfinallygoesaway' of https://github.com/derberg/…
derberg Dec 8, 2025
a6b11d6
silent security alrerts
derberg Dec 8, 2025
8dc94c2
more nunjucks wipe
derberg Dec 8, 2025
adb550d
cleanup docker
derberg Dec 8, 2025
cd48cc5
update dev guide after local testing
derberg Dec 8, 2025
32a5ce6
bump deps
derberg Dec 8, 2025
57c32e1
Update apps/generator/docs/react-render-engine.md
derberg Dec 8, 2025
9f9068e
Update apps/generator/docs/react-render-engine.md
derberg Dec 8, 2025
1872ddd
Update integration.test.js.snap
derberg Dec 8, 2025
f53a520
Update integration.test.js.snap
derberg Dec 8, 2025
ae4ea24
Merge branch 'master' into nunjucksfinallygoesaway
derberg Dec 11, 2025
aeb9d42
Update remove-deprecated-nunjucks-cli.md
derberg Dec 12, 2025
b31c428
Apply suggestions from code review
derberg Dec 12, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .changeset/remove-deprecated-nunjucks-cli.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
"@asyncapi/generator": major
"@asyncapi/generator-helpers": major
---

### Breaking Changes
* You must use Node.js 24.11 or higher, and NPM 11.5.1 or higher
* 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.
* `ag` CLI is no longer available. It was announced some time ago that it would be deprecated, and users are encouraged to switch to the [AsyncAPI CLI](https://github.com/asyncapi/cli/)

### Migration Guides
- [Migrating from Nunjucks to React render engine](https://github.com/asyncapi/generator/blob/%40asyncapi/generator%402.8.4/apps/generator/docs/migration-nunjucks-react.md)
- [Migrating from `ag` CLI to AsyncAPI CLI](https://github.com/asyncapi/generator/blob/%40asyncapi/generator%402.8.4/apps/generator/docs/migration-cli.md)
5 changes: 4 additions & 1 deletion .github/workflows/local-generate-files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,13 @@ jobs:
# if @semantic-release/github is used to publish, the minimum version is 7.2.0 for proper working
ref: ${{ github.event.release.target_commitish }}
- name: Check package-lock version
# This workflow is from our own org repo and safe to reference by 'master'.
uses: asyncapi/.github/.github/actions/get-node-version-from-package-lock@master
id: lockversion
with:
node-version: ${{ vars.NODE_VERSION }}
- name: Setup Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v6
with:
node-version: "${{ steps.lockversion.outputs.version }}"
- name: Install dependencies
Expand Down
18 changes: 11 additions & 7 deletions .github/workflows/pr-testing-with-test-project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,8 @@ jobs:
#this test job is responsible for running dedicated complex integration tests for the generator
test:
needs: changes
name: Test generator as dependency with Node ${{ matrix.node }}
name: Test generator as dependency with Node 24
runs-on: ubuntu-latest
strategy:
matrix:
node: ["18", "20"]
steps:
- name: Checkout repository
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
Expand All @@ -64,7 +61,7 @@ jobs:
echo "should_test value: ${{ needs.changes.outputs.should_test }}"
- if: needs.changes.outputs.should_test == 'true'
name: Run test
run: NODE_VERSION=${{ matrix.node }} docker compose up --abort-on-container-exit --force-recreate
run: NODE_VERSION=24 docker compose up --abort-on-container-exit --force-recreate
working-directory: ./apps/generator/test/test-project

#this test job runs acceptance tests that use microcks and check generated code against the asyncapi contract
Expand All @@ -79,10 +76,17 @@ jobs:
run: |
echo "should_test value: ${{ needs.changes.outputs.should_test }}"
- if: needs.changes.outputs.should_test == 'true'
name: Use Node.js 20
name: Check package-lock version
# This workflow is from our own org repo and safe to reference by 'master'.
uses: asyncapi/.github/.github/actions/get-node-version-from-package-lock@master
id: lockversion
with:
node-version: ${{ vars.NODE_VERSION }}
- if: needs.changes.outputs.should_test == 'true'
name: Use Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: 20
node-version: "${{ steps.lockversion.outputs.version }}"
- if: needs.changes.outputs.should_test == 'true'
name: Install dependencies
run: npm ci
Expand Down
61 changes: 0 additions & 61 deletions .github/workflows/release-docker.yml

This file was deleted.

5 changes: 4 additions & 1 deletion .github/workflows/release-with-changesets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,11 @@ jobs:
shell: bash
- if: steps.packagejson.outputs.exists == 'true'
name: Check package-lock version
# This workflow is from our own org repo and safe to reference by 'master'.
uses: asyncapi/.github/.github/actions/get-node-version-from-package-lock@master
id: lockversion
with:
node-version: ${{ vars.NODE_VERSION }}
- if: steps.packagejson.outputs.exists == 'true'
name: Setup Node.js
uses: actions/setup-node@v4
Expand Down Expand Up @@ -76,7 +79,7 @@ jobs:

release:
needs: [test-nodejs]
name: Publish to any of NPM, GitHub, or Docker Hub
name: Publish to any of NPM and GitHub
runs-on: ubuntu-latest
permissions:
contents: write
Expand Down
7 changes: 3 additions & 4 deletions Development.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ New to AsyncAPI Generator? We strongly recommend watching our comprehensive onbo
- The origins and evolution of the Generator (legacy vs. future architecture)
- Understanding event-driven architectures and protocol complexity
- How the Generator works: templates, render engines, and the generation process
- The shift from Nunjucks to React render engine
- Component-based template development for better reusability
- Baked-in templates and the monorepo structure
- Live demonstrations of code generation from AsyncAPI documents
Expand All @@ -37,7 +36,7 @@ After cloning the repository, you should setup the fork properly and configure t
2. Install dependencies:

```bash
npm install
npm install --workspaces
```

## Running tests
Expand Down Expand Up @@ -77,7 +76,7 @@ You can also opt in to run the lint checks after the tests, by setting an enviro

### Manually testing with test templates

To test template features manually we have `react-template` and `nunjucks-template` in `apps/generator/test/templates`, you can use this templates to manually test your changes like this:
To test template features, use the `react-template` in `apps/generator/test/test-templates`. You can run your changes against this template as follows:

1. Navigate to the generator directory:

Expand All @@ -89,7 +88,7 @@ cd apps/generator
3. Run the generator with the react-template:

```bash
node ./cli ./test/docs/dummy.yml ./test/test-templates/react-template -o ./test/output --force-write
node ./test/cli ./test/docs/dummy.yml ./test/test-templates/react-template -o ./test/output --force-write
```

4. Check the output in the `./test/output` directory to verify the output that you desired.
Expand Down
20 changes: 2 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,17 @@
[![AsyncAPI Generator](./assets/readme-banner.png)](https://www.asyncapi.com/tools/generator)

> Some parts of the AsyncAPI Generator are deprecated and the plan is to remove them in October 2025. For more details read notes from release [@asyncapi/[email protected]](https://github.com/asyncapi/generator/releases/tag/%40asyncapi%2Fgenerator%402.6.0).

This is a Monorepo managed using [Turborepo](https://turbo.build/) and contains the following package:

1. [Generator](apps/generator): This is a tool that you can use to generate whatever you want basing on the AsyncAPI specification file as an input.

1. [Hooks](apps/hooks): This library contains generator filters that can be reused across multiple templates, helping to avoid redundant work. Hooks are designed to let template developers hook into the template generation process. For example, one can create a hook code that will be automatically invoked right after the template generation process has ended.

1. [Nunjucks-filters](apps/nunjucks-filters): This library contains generator filters that can be reused across multiple templates helping to avoid redundant work. These filters are designed specifically for Nunjucks templates and are included by default with the generator, so there's no need to add them to dependencies separately.
1. [Hooks](apps/hooks): Hooks are designed to let template developers hook into the template generation process. For example, one can create a hook code that will be automatically invoked right after the template generation process has ended.

1. [React-sdk](apps/react-sdk): AsyncAPI React SDK is a set of components/functions to use React as render engine for the generator. This is the library that undestand components from Generator's templates that are configured to use `react` render engine.

1. [Generator-helpers](packages/helpers): A utility library that provides helper functions and utilities to simplify template development. It reduces boilerplate and speeds up template creation.

1. [Generator-components](packages/components): A library of reusable components that can be shared across different templates, helping to avoid duplication and accelerate template development.

> [!IMPORTANT]
> **Deprecation Notice:** The Nunjucks renderer engine is deprecated and will be removed in future releases. We strongly recommend using the React renderer engine instead. You can find how to migrate from Nunjucks to React in the [migration guide](apps/generator/docs/migration-nunjucks-react.md)

![npm](https://img.shields.io/npm/v/@asyncapi/generator?style=for-the-badge) ![npm](https://img.shields.io/npm/dt/@asyncapi/generator?style=for-the-badge)

<!-- toc is generated with GitHub Actions do not remove toc markers -->
Expand Down Expand Up @@ -68,18 +61,9 @@ You can find above templates and the ones provided by the community in **[this l
> [!IMPORTANT]
> **Experimental Feature:** AsyncAPI Generator also comes with **baked-in templates** - official templates shipped directly inside the Generator (`@asyncapi/generator`). They cover code, docs, configs, and SDKs, and are maintained under [/packages/templates](packages/templates) directory, following a strict, opinionated structure for consistency and ease of maintenance. This feature is not recommended for production use. For those who want to try them out or learn more, see the [Baked-in templates documentation](https://www.asyncapi.com/docs/tools/generator/baked-in-templates).

## Filters

`apps/nunjucks-filters` library contains generator filters that can be reused across multiple templates, helping to avoid redundant work. These filters are designed specifically for Nunjucks templates and are included by default with the generator, so there's no need to add them to dependencies separately.

This library consists of:

- Custom filters. Check out [API docs](apps/nunjucks-filters/docs/api.md) for complete list
- Lodash-powered filters. For the list of all available filters check [official docs](https://lodash.com/docs/)

## Hooks

The `apps/hooks` library contains generator filters that can be reused across multiple templates, helping to avoid redundant work. [Hooks](https://www.asyncapi.com/docs/tools/generator/hooks) are functions called by the generator at specific moments in the generation process. Hooks can be anonymous functions, but you can also assign them function names. These hooks can have arguments provided to them, or they may be expected to return a value.
[Hooks](https://www.asyncapi.com/docs/tools/generator/hooks) are functions called by the generator at specific moments in the generation process. Hooks can be anonymous functions, but you can also assign them function names. These hooks can have arguments provided to them, or they may be expected to return a value.

These hooks are included in the generator without adding any specific dependency to the library. You still have to enable the given hook in the configuration explicitly because some hooks can execute automatically without passing a specific parameter. [Learn more about configuration and what hooks are available out of the box](https://www.asyncapi.com/docs/tools/generator/hooks#official-library).

Expand Down
20 changes: 0 additions & 20 deletions apps/generator/Dockerfile

This file was deleted.

2 changes: 1 addition & 1 deletion apps/generator/docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ Parse the generator input based on the template `templateConfig.apiVersion` valu
<a name="Generator+configureTemplate"></a>

* generator.configureTemplate()** :
Configure the templates based the desired renderer.
Configure the templates.

**Kind**: instance method of [`Generator`](#Generator)

Expand Down
2 changes: 1 addition & 1 deletion apps/generator/docs/asyncapi-document.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ In the following sections, you'll learn about the inner working of the generator
3. The **Parser** validates the **AsyncAPI Document** using additional schema-related plugins, either the OpenAPI schema, RAML data types, or Avro schema.
4. If the **Parser** determines that the **AsyncAPI Document** is valid, it manipulates the original JSON/YAML document and provides a set of helper functions in return, bundling them together into an **asyncapi** variable that is an instance of [**AsyncAPIDocument**](https://github.com/asyncapi/parser-api/blob/master/docs/api.md#asyncapidocument).
5. At this point, the **Generator** passes the **originalAsyncAPI** and the **asyncapi** which make up part of the **[Template Context](template-context)** to the **Render Engine**.
6. The **Template Context** is accessible to the template files that are passed to either the [react](react-render-engine) or [nunjucks](nunjucks-render-engine) **Render Engines**.
6. The **Template Context** is accessible to the template files that are passed to the [react](react-render-engine) **Render Engine**.

```mermaid
graph LR
Expand Down
4 changes: 0 additions & 4 deletions apps/generator/docs/configuration-file.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ metadata:
target: javascript
stack: express

renderer: react
apiVersion: v3
supportedProtocols:
- amqp
Expand Down Expand Up @@ -86,7 +85,6 @@ Alternatively, you can include your configuration in the `generator` property of
"target": "javascript",
"stack": "express"
},
"renderer": "react",
"apiVersion": "v3",
"supportedProtocols": ["amqp", "mqtt"],
"parameters": {
Expand Down Expand Up @@ -150,7 +148,6 @@ The `generator` property from `package.json` file must contain a JSON object and
| `metadata.protocol` | String | **Required for `client`/`sdk`**. The protocol this template targets (e.g., `websocket`, `kafka`). Not used for `docs`/`config`. |
| `metadata.target` | String | **Required**. The output language or format (e.g., `javascript`, `html`, `yaml`). |
| `metadata.stack` | String | Optional. The stack or framework (e.g., `express`, `quarkus`). Only for `client`/`sdk`. |
| `renderer` | String | Its value can be either `react` or `nunjucks` (default). |
| `apiVersion` | String | Determines which **major** version of the [Parser-API](https://github.com/asyncapi/parser-api) the template uses. For example, `v2` for `v2.x.x`. If not specified, the Generator assumes the template is not compatible with the Parser-API so it will use the [Parser-JS v1 API](https://github.com/asyncapi/parser-js/tree/v1.18.1#api-documentation). For templates that need to support AsyncAPI specification v3 make sure to use `v3` [Parser-API](https://github.com/asyncapi/parser-api). If the template uses a version of the Parser-API that is not supported by the Generator, the Generator will throw an error. |
| `supportedProtocols` | [String] | A list with all the protocols this template supports. |
| `parameters` | Object[String, Object] | An object with all the parameters that can be passed when generating the template. When using the command line, it's done by indicating `--param name=value` or `-p name=value`. |
Expand All @@ -166,7 +163,6 @@ The `generator` property from `package.json` file must contain a JSON object and
| `conditionalGeneration[filePath/directoryName].validation` | Object (JSON Schema fragment) | The validation defines the condition under which the file or directory will be generated. It must be a valid JSON Schema fragment that validates the value of the parameter. For example, if you want to include a folder only when includeDocs is true, use "validation": `{ "const": true }`. You can also use more complex validation logic, like "enum": ["yes", "true"] or "type": "string" with a "pattern" constraint. If the parameter fails validation, the file or folder will not be included in the generated output. This allows for powerful and flexible control over template generation based on user input. |
| `nonRenderableFiles` | [String] | A list of file paths or [globs](https://en.wikipedia.org/wiki/Glob_(programming)) that must be copied "as-is" to the target directory, i.e., without performing any rendering process. This is useful when you want to copy binary files. |
| `generator` | [String] | A string representing the generator version-range the template is compatible with. This value must follow the [semver](https://nodejs.dev/learn/semantic-versioning-using-npm) syntax. E.g., `>=1.0.0`, `>=1.0.0 <=2.0.0`, `~1.0.0`, `^1.0.0`, `1.0.0`, etc. [Read more about semver](https://docs.npmjs.com/about-semantic-versioning). |
| `filters` | [String] | A list of modules containing functions that can be used as Nunjucks filters. In case of external modules, remember they need to be added as a dependency in `package.json` of your template. |
| `hooks` | Object[String, String] or Object[String, Array[String]] | A list of modules containing hooks, except for the ones you keep locally in your template in the default location. For each module you must specify the exact name of the hook that should be used in the template. For a single hook, you can specify it as a string; for more hooks, you must pass an array of strings. In the case of external modules, remember they need to be added as a dependency in `package.json` of your template. There is also [an official hooks library](hooks#official-library) always included in the generator. As this is a library of multiple hooks, you still need to explicitly specify in the configuration which one you want to use. Use `@asyncapi/generator-hooks` as the library name. |

## Special parameters
Expand Down
Loading