@asyncapi/generator 2.5.0 → 2.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # @asyncapi/generator
2
2
 
3
+ ## 2.6.0
4
+
5
+ ### Minor Changes
6
+
7
+ - fd5dfd7: - **Deprecation of `ag` CLI**: The `ag` CLI is deprecated in favour of the `AsyncAPI CLI` that is a single entry point for all the AsyncAPI tools. No new features will be added to `ag` and it will be completely removed. The official documentation of AsyncAPI Generator has not mentioned `ag` for over a year, instead only using `AsyncAPI CLI` and `asyncapi generate fromTemplate` commands. Refer to the [migration guide](https://www.asyncapi.com/docs/tools/generator/migration-cli) that will help you understand how to migrate your `ag` commands to the new `AsyncAPI CLI` command.
8
+
9
+ - **Deprecation of Nunjucks render engine:** The [Nunjucks render engine](https://www.asyncapi.com/docs/tools/generator/nunjucks-render-engine) is deprecated and will be removed in October 2025. It is recommended to switch to the [React render engine](https://www.asyncapi.com/docs/tools/generator/react-render-engine) instead. If you are using Nunjucks in production, read the [migration guide](https://www.asyncapi.com/docs/tools/generator/migration-nunjucks-react) that will help you understand how to migrate to the new engine. The removal of the Nunjucks render engine results also in removal of [Nunjucks-filters](apps/nunjucks-filters) library.
10
+
11
+ Removal of both deprecated parts of the generator is planned for October 2025, which gives you 9 months to migrate.
12
+
3
13
  ## 2.5.0
4
14
 
5
15
  ### Minor Changes
package/cli.js CHANGED
@@ -89,10 +89,17 @@ program
89
89
  .option('-o, --output <outputDir>', 'directory where to put the generated files (defaults to current directory)', parseOutput, process.cwd())
90
90
  .option('-p, --param <name=value>', 'additional param to pass to templates', paramParser)
91
91
  .option('--force-write', 'force writing of the generated files to given directory even if it is a git repo with unstaged files or not empty dir (defaults to false)')
92
+ .option('--disable-warning', 'disable "ag" deprecation warning (defaults to false)')
92
93
  .option('--watch-template', 'watches the template directory and the AsyncAPI document, and re-generate the files when changes occur. Ignores the output directory. This flag should be used only for template development.')
93
94
  .option('--map-base-url <url:folder>','maps all schema references from base url to local folder',mapBaseUrlParser)
94
95
  .parse(process.argv);
95
96
 
97
+ if (!program.disableWarning) {
98
+ console.warn(yellow(
99
+ 'Warning: The "ag" CLI is deprecated and will be removed in a future release. Please use the AsyncAPI CLI instead. See release notes for details: https://github.com/asyncapi/generator/releases/tag/%40asyncapi%2Fgenerator%402.6.0. You can hide this working using --disable-warning flag.')
100
+ );
101
+ }
102
+
96
103
  if (!asyncapiDocPath) {
97
104
  console.error(red('> Path or URL to AsyncAPI file not provided.'));
98
105
  program.help(); // This exits the process
package/docs/api.md CHANGED
@@ -13,6 +13,7 @@ Reference API documentation for AsyncAPI Generator library.
13
13
  * [Generator](#Generator)
14
14
  * [new Generator(templateName, targetDir, options)](#new_Generator_new)
15
15
  * _instance_
16
+ * [.compile](#Generator+compile) : `Boolean`
16
17
  * [.registry](#Generator+registry) : `Object`
17
18
  * [.templateName](#Generator+templateName) : `String`
18
19
  * [.targetDir](#Generator+targetDir) : `String`
@@ -38,9 +39,9 @@ Reference API documentation for AsyncAPI Generator library.
38
39
  * [.executeAfterHook()](#Generator+executeAfterHook) ⇒ `Promise.<void>`
39
40
  * [.parseInput()](#Generator+parseInput)
40
41
  * [.configureTemplate()](#Generator+configureTemplate)
41
- * ~~[.generateFromString(asyncapiString, [parseOptions])](#Generator+generateFromString) ⇒ `Promise`~~
42
- * [.generateFromURL(asyncapiURL)](#Generator+generateFromURL) ⇒ `Promise`
43
- * [.generateFromFile(asyncapiFile)](#Generator+generateFromFile) ⇒ `Promise`
42
+ * ~~[.generateFromString(asyncapiString, [parseOptions])](#Generator+generateFromString) ⇒ `Promise.<(TemplateRenderResult|undefined)>`~~
43
+ * [.generateFromURL(asyncapiURL)](#Generator+generateFromURL) ⇒ `Promise.<(TemplateRenderResult|undefined)>`
44
+ * [.generateFromFile(asyncapiFile)](#Generator+generateFromFile) ⇒ `Promise.<(TemplateRenderResult|undefined)>`
44
45
  * [.installTemplate([force])](#Generator+installTemplate)
45
46
  * _static_
46
47
  * [.getTemplateFile(templateName, filePath, [templatesDir])](#Generator.getTemplateFile) ⇒ `Promise`
@@ -64,6 +65,7 @@ Instantiates a new Generator object.
64
65
  - [.forceWrite] `Boolean` ` = false` - Force writing of the generated files to given directory even if it is a git repo with unstaged files or not empty dir. Default is set to false.
65
66
  - [.install] `Boolean` ` = false` - Install the template and its dependencies, even when the template has already been installed.
66
67
  - [.debug] `Boolean` ` = false` - Enable more specific errors in the console. At the moment it only shows specific errors about filters. Keep in mind that as a result errors about template are less descriptive.
68
+ - [.compile] `Boolean` ` = true` - Whether to compile the template or use the cached transpiled version provided by template in '__transpiled' folder
67
69
  - [.mapBaseUrlToFolder] `Object.<String, String>` - Optional parameter to map schema references from a base url to a local base folder e.g. url=https://schema.example.com/crm/ folder=./test/docs/ .
68
70
  - [.registry] `Object` - Optional parameter with private registry configuration
69
71
  - [.url] `String` - Parameter to pass npm registry url
@@ -85,6 +87,13 @@ const generator = new Generator('@asyncapi/html-template', path.resolve(__dirnam
85
87
  });
86
88
  ```
87
89
 
90
+ <a name="Generator+compile"></a>
91
+
92
+ * generator.compile : `Boolean`** :
93
+ Whether to compile the template or use the cached transpiled version provided by template in '__transpiled' folder.
94
+
95
+ **Kind**: instance property of [`Generator`](#Generator)
96
+
88
97
  <a name="Generator+registry"></a>
89
98
 
90
99
  * generator.registry : `Object`** :
@@ -7,6 +7,8 @@ weight: 140
7
7
 
8
8
  > **Note**: This section applies only to the Nunjucks render engine. For information on using the React render engine, refer to the [Generating files with the React render engine](#generating-files-with-the-react-render-engine) section below.
9
9
 
10
+ > **Note**: Nunjucks renderer engine is deprecated and will be removed in the future. Use the React renderer engine instead. For more details read notes from release [@asyncapi/generator@2.6.0](https://github.com/asyncapi/generator/releases/tag/%40asyncapi%2Fgenerator%402.6.0).
11
+
10
12
  It is possible to generate files for each specific object in your AsyncAPI documentation using the Nunjucks render engine. For example, you can specify a filename like `$$channel$$.js` to generate a file for each channel defined in your AsyncAPI. The following file-template names and extra variables are available:
11
13
 
12
14
  - `$$channel$$`, within the template-file you have access to two variables [`channel`](https://github.com/asyncapi/parser-api/blob/master/docs/api.md#channel) and [`channelName`](https://github.com/asyncapi/parser-api/blob/master/docs/api.md#channels). Where the `channel` contains the current channel being rendered.
@@ -0,0 +1,70 @@
1
+ ---
2
+ title: "Migrating from `ag` CLI to AsyncAPI CLI"
3
+ weight: 260
4
+ ---
5
+
6
+ This guide provides detailed instructions on how to transition from the old `ag` Generator CLI to the new AsyncAPI CLI.
7
+
8
+ ## Options Overview
9
+
10
+ Here is a list of `ag` options and their equivalents in the AsyncAPI CLI:
11
+
12
+ - **-d, --disable-hook [hooks...]**
13
+ - **AsyncAPI CLI equivalent:** `asyncapi generate fromTemplate <ASYNCAPI> <TEMPLATE> --disable-hook <hookType>=<hookName>`
14
+
15
+ - **--debug**
16
+ - **AsyncAPI CLI equivalent:** `asyncapi generate fromTemplate <ASYNCAPI> <TEMPLATE> --debug`
17
+
18
+ - **-i, --install**
19
+ - **AsyncAPI CLI equivalent:** `asyncapi generate fromTemplate <ASYNCAPI> <TEMPLATE> --install`
20
+
21
+ - **-n, --no-overwrite <glob>**
22
+ - **AsyncAPI CLI equivalent:** `asyncapi generate fromTemplate <ASYNCAPI> <TEMPLATE> --no-overwrite <glob>`
23
+
24
+ - **-o, --output <outputDir>**
25
+ - **AsyncAPI CLI equivalent:** `asyncapi generate fromTemplate <ASYNCAPI> <TEMPLATE> --output <outputDir>`
26
+
27
+ - **-p, --param <name=value>**
28
+ - **AsyncAPI CLI equivalent:** `asyncapi generate fromTemplate <ASYNCAPI> <TEMPLATE> --param <name=value>`
29
+
30
+ - **--force-write**
31
+ - **AsyncAPI CLI equivalent:** `asyncapi generate fromTemplate <ASYNCAPI> <TEMPLATE> --force-write`
32
+
33
+ - **--watch-template**
34
+ - **AsyncAPI CLI equivalent:** `asyncapi generate fromTemplate <ASYNCAPI> <TEMPLATE> --watch`
35
+
36
+ - **--map-base-url <url:folder>**
37
+ - **AsyncAPI CLI equivalent:** `asyncapi generate fromTemplate <ASYNCAPI> <TEMPLATE> --map-base-url <url:folder>`
38
+
39
+ ## Migration Steps
40
+
41
+ ### 1. Install AsyncAPI CLI
42
+
43
+ There are multiple different artifacts that AsyncAPI CLI is provided as. Get familiar with the [official CLI installation guide](https://www.asyncapi.com/docs/tools/cli/installation).
44
+
45
+ ### 2. Update Your Commands
46
+
47
+ Replace the deprecated `ag` commands with the AsyncAPI CLI equivalents. Below are examples of how to update your commands:
48
+
49
+ **Using `ag`**:
50
+ ```
51
+ ag ./asyncapi.yaml ./template -o ./output -p param1=value1 --debug --install --disable-hook hookType=hookName
52
+ ```
53
+
54
+ **Using AsyncAPI CLI**:
55
+ ```
56
+ asyncapi generate fromTemplate ./asyncapi.yaml ./template -o ./output -p param1=value1 --debug --install --disable-hook hookType=hookName
57
+ ```
58
+
59
+ Notice that the change basically related to changing from `ag` to `asyncapi generate fromTemplate`.
60
+
61
+ ### 3. Verify and Test
62
+
63
+ Run the updated commands to ensure they work as expected and verify that the output files are generated correctly.
64
+
65
+ ## Additional Resources
66
+
67
+ **CLI Documentation**: [AsyncAPI CLI Documentation](https://www.asyncapi.com/docs/tools/cli)
68
+ **Installation**: [AsyncAPI CLI Installation](https://www.asyncapi.com/docs/tools/cli/installation)
69
+ **Usage**: [AsyncAPI CLI Usage](https://www.asyncapi.com/docs/tools/cli/usage)
70
+ **Support**: For any issues with CLI, create an issue in [CLI repository](https://github.com/asyncapi/cli).
@@ -0,0 +1,144 @@
1
+ ---
2
+ title: "Migrating from Nunjucks to React render engine"
3
+ weight: 250
4
+ ---
5
+
6
+ The AsyncAPI Generator is moving away from Nunjucks templates in favor of React templates. This guide will help you migrate your existing Nunjucks templates to React. For a comprehensive understanding of why we introduced React as an alternative in 2021 and why we're now removing Nunjucks entirely, please read our article [React as a Generator Engine](https://www.asyncapi.com/blog/react-as-generator-engine). The principles discussed in this article still apply to our current transition.
7
+
8
+ ## Step-by-step migration guide
9
+
10
+ ### 1. Update package.json
11
+
12
+ Change your template configuration in `package.json`:
13
+
14
+ ```json
15
+ {
16
+ "generator": {
17
+ "renderer": "react"
18
+ }
19
+ }
20
+ ```
21
+
22
+ Once the deprecation period has ended, and we remove the default Nunjucks, the React render engine will be used by default and this setting will no longer be needed to configure
23
+
24
+ ### 2. Install dependencies
25
+
26
+ Install the necessary React dependencies:
27
+
28
+ ```bash
29
+ npm install @asyncapi/generator-react-sdk
30
+ ```
31
+
32
+ ### 3. File naming
33
+
34
+ In Nunjucks, the template's filename directly corresponds to the output file. For example, a template named **index.html** will generate an **index.html** file.
35
+
36
+ In React, the filename of the generated file is not controlled by the file itself, but rather by the `File` component. The React component itself can be named anything with a `.js` extension because the output filename is controlled by the `name` attribute of the `File` component used inside the template file. Below you can see some examples of filenames:
37
+
38
+ Nunjucks: `index.html`
39
+ React: `index.js` or `index.html.js` or `anything-you-want.js`
40
+
41
+ ### 4. Basic template structure
42
+
43
+ Nunjucks:
44
+ ```js
45
+ <h1>{{ asyncapi.info().title() }}</h1>
46
+ <p>{{ asyncapi.info().description() }}</p>
47
+ ```
48
+
49
+ React:
50
+ ```js
51
+ import { File } from '@asyncapi/generator-react-sdk';
52
+
53
+ export default function({ asyncapi }) {
54
+ return (
55
+ <File name="index.html">
56
+ <h1>{asyncapi.info().title()}</h1>
57
+ <p>{asyncapi.info().description()}</p>
58
+ </File>
59
+ );
60
+ }
61
+ ```
62
+
63
+ ### 5. Macros and Partials
64
+
65
+ Replace macros with React components:
66
+
67
+ Nunjucks:
68
+ ```js
69
+ {% macro renderChannel(channel) %}
70
+ <div class="channel">
71
+ <h3>{{ channel.address() }}</h3>
72
+ <p>{{ channel.description() }}</p>
73
+ </div>
74
+ {% endmacro %}
75
+
76
+ {{ renderChannel(someChannel) }}
77
+ ```
78
+
79
+ React:
80
+ ```js
81
+ // components/Channel.js
82
+ import { Text } from '@asyncapi/generator-react-sdk';
83
+
84
+ export function Channel({ channel }) {
85
+ return (
86
+ <Text>
87
+ <div className="channel">
88
+ <h3>{channel.address()}</h3>
89
+ <p>{channel.description()}</p>
90
+ </div>
91
+ </Text>
92
+ );
93
+ }
94
+
95
+ // Main template
96
+ import { File, Text } from '@asyncapi/generator-react-sdk';
97
+ import { Channel } from './components/Channel';
98
+
99
+ export default function({ asyncapi }) {
100
+ return (
101
+ <File name="channels.html">
102
+ <Text>
103
+ <h2>Channels</h2>
104
+ </Text>
105
+ {asyncapi.channels().map(channel => (
106
+ <Channel channel={channel} />
107
+ ))}
108
+ </File>
109
+ );
110
+ }
111
+ ```
112
+
113
+ ### 6. File template
114
+
115
+ Check the [detailed guide on file templates](file-templates.md) to learn what is the difference between templating multiple file outputs in Nunjucks and React.
116
+
117
+ ### 7. Models generation
118
+
119
+ If you have a template written with Nunjucks, it is almost certain that you have your own custom models, classes, or types templates in place. Instead of migrating them to React render engine we strongly advise you to delegate models generation to AsyncAPI Modelina project. Learn more about [how to add models generation using Modelina](https://www.asyncapi.com/docs/tools/generator/model-generation).
120
+
121
+ ## Additional Resources and Information
122
+
123
+ ### Template Examples
124
+ For a complete example of React features in use, please refer to the [AsyncAPI Template for Generator Templates](https://github.com/asyncapi/template-for-generator-templates). The `master` branch demonstrates all React features, while the `nunjucks` branch shows the old Nunjucks implementation. This comparison can be particularly helpful in understanding the differences and migration process.
125
+
126
+ ### Filters to Helpers
127
+ If you've been using Nunjucks filters placed in the `filters` directory, you can still use this functionality in React. However, they should be treated as normal functions that you import into your components. We recommend renaming the `filters` directory to `helpers` to better reflect their new usage in React.
128
+
129
+ ### Hooks Remain Unchanged
130
+ It's important to note that hooks remain unchanged in this migration process. Hooks are not related to the render engine functionality, so you can continue to use them as you have been.
131
+
132
+ ### Testing your migration
133
+
134
+ After migrating, test your template thoroughly:
135
+
136
+ 1. Run the generator using your new React template
137
+ 2. Compare the output with the previous Nunjucks template output
138
+ 3. Check for any missing or incorrectly rendered content
139
+
140
+ Consider implementing snapshot tests for your template before starting the migration. This will ease the review of changes in comparing the content rendered after render engine changes. Snapshot tests allow you to have tests that will persist expected output from Nunjucks template, and compare it with output generated after the migration. Check out an [example of such snapshot integration test for our internal react template we use for development and testing](https://github.com/asyncapi/generator/blob/master/apps/generator/test/integration.test.js#L66).
141
+
142
+ ## Conclusion
143
+
144
+ Migrating from Nunjucks to React templates may require some initial effort, but it will result in more maintainable code. You can learn more about why we introduced the React render engine from article [React as a Generator Engine](https://www.asyncapi.com/blog/react-as-generator-engine).
@@ -3,6 +3,8 @@ title: "Nunjucks render engine"
3
3
  weight: 120
4
4
  ---
5
5
 
6
+ > **Note**: Nunjucks renderer engine is deprecated and will be removed in the future. Use the React renderer engine instead. For more details read notes from release [@asyncapi/generator@2.6.0](https://github.com/asyncapi/generator/releases/tag/%40asyncapi%2Fgenerator%402.6.0).
7
+
6
8
  [Nunjucks](https://mozilla.github.io/nunjucks) is the default render engine, however, we strongly recommend adopting the [React](#react) engine.
7
9
 
8
10
  ### Common assumptions
@@ -6,6 +6,7 @@ const nunjucksFilters = require('@asyncapi/nunjucks-filters');
6
6
 
7
7
  /**
8
8
  * Registers all template filters.
9
+ * @deprecated This method is deprecated. For more details, see the release notes: https://github.com/asyncapi/generator/releases/tag/%40asyncapi%2Fgenerator%402.6.0
9
10
  * @param {Object} nunjucks Nunjucks environment.
10
11
  * @param {Object} templateConfig Template configuration.
11
12
  * @param {String} templateDir Directory where template is located.
@@ -21,6 +22,7 @@ module.exports.registerFilters = async (nunjucks, templateConfig, templateDir, f
21
22
 
22
23
  /**
23
24
  * Registers the local template filters.
25
+ * @deprecated This method is deprecated. For more details, see the release notes: https://github.com/asyncapi/generator/releases/tag/%40asyncapi%2Fgenerator%402.6.0
24
26
  * @private
25
27
  * @param {Object} nunjucks Nunjucks environment.
26
28
  * @param {String} templateDir Directory where template is located.
@@ -68,6 +70,7 @@ function registerLocalFilters(nunjucks, templateDir, filtersDir) {
68
70
 
69
71
  /**
70
72
  * Registers the additionally configured filters.
73
+ * @deprecated This method is deprecated. For more details, see the release notes: https://github.com/asyncapi/generator/releases/tag/%40asyncapi%2Fgenerator%402.6.0
71
74
  * @private
72
75
  * @param {Object} nunjucks Nunjucks environment.
73
76
  * @param {String} templateDir Directory where template is located.
@@ -112,6 +115,7 @@ async function registerConfigFilters(nunjucks, templateDir, templateConfig) {
112
115
 
113
116
  /**
114
117
  * Add filter functions to Nunjucks environment. Only owned functions from the module are added.
118
+ * @deprecated This method is deprecated. For more details, see the release notes: https://github.com/asyncapi/generator/releases/tag/%40asyncapi%2Fgenerator%402.6.0
115
119
  * @private
116
120
  * @param {Object} nunjucks Nunjucks environment.
117
121
  * @param {Object} filters Module with functions.
package/lib/generator.js CHANGED
@@ -436,7 +436,7 @@ class Generator {
436
436
  * @param {String} asyncapiString AsyncAPI string to use as source.
437
437
  * @param {Object} [parseOptions={}] AsyncAPI Parser parse options. Check out {@link https://www.github.com/asyncapi/parser-js|@asyncapi/parser} for more information.
438
438
  * @deprecated Use the `generate` function instead. Just change the function name and it works out of the box.
439
- * @return {Promise}
439
+ * @return {Promise<TemplateRenderResult|undefined>}
440
440
  */
441
441
  async generateFromString(asyncapiString, parseOptions = {}) {
442
442
  const isParsableCompatible = asyncapiString && typeof asyncapiString === 'string';
@@ -466,7 +466,7 @@ class Generator {
466
466
  * }
467
467
  *
468
468
  * @param {String} asyncapiURL Link to AsyncAPI file
469
- * @return {Promise}
469
+ * @return {Promise<TemplateRenderResult|undefined>}
470
470
  */
471
471
  async generateFromURL(asyncapiURL) {
472
472
  const doc = await fetchSpec(asyncapiURL);
@@ -493,7 +493,7 @@ class Generator {
493
493
  * }
494
494
  *
495
495
  * @param {String} asyncapiFile AsyncAPI file to use as source.
496
- * @return {Promise}
496
+ * @return {Promise<TemplateRenderResult|undefined>}
497
497
  */
498
498
  async generateFromFile(asyncapiFile) {
499
499
  const doc = await readFile(asyncapiFile, { encoding: 'utf8' });
@@ -3,7 +3,7 @@ const nunjucksExport = module.exports;
3
3
 
4
4
  /**
5
5
  * Configures Nunjucks templating system
6
- *
6
+ * @deprecated This method is deprecated. For more details, see the release notes: https://github.com/asyncapi/generator/releases/tag/%40asyncapi%2Fgenerator%402.6.0
7
7
  * @private
8
8
  * @param {boolean} debug flag
9
9
  * @param {string} templateDir path
@@ -17,7 +17,7 @@ nunjucksExport.configureNunjucks = (debug, templateDir) => {
17
17
 
18
18
  /**
19
19
  * Renders the template with nunjucks and returns a string.
20
- *
20
+ * @deprecated This method is deprecated. For more details, see the release notes: https://github.com/asyncapi/generator/releases/tag/%40asyncapi%2Fgenerator%402.6.0
21
21
  * @param {import('@asyncapi/parser').AsyncAPIDocument} asyncapiDocument
22
22
  * @param {string} templateString template filecontent to be rendered with nunjucks
23
23
  * @param {string} filePath path to the template file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@asyncapi/generator",
3
- "version": "2.5.0",
3
+ "version": "2.6.0",
4
4
  "description": "The AsyncAPI generator. It can generate documentation, code, anything!",
5
5
  "main": "./lib/generator.js",
6
6
  "bin": {
@@ -12,12 +12,11 @@
12
12
  "npm": ">=8.19.0"
13
13
  },
14
14
  "scripts": {
15
- "test": "npm run test:unit && npm run test:integration && npm run test:cli",
15
+ "test": "npm run test:unit && npm run test:integration",
16
16
  "test:unit": "jest --coverage --testPathIgnorePatterns=integration --testPathIgnorePatterns=test-project",
17
17
  "test:dev": "npm run test:unit -- --watchAll",
18
18
  "test:integration": "npm run test:cleanup && jest --testPathPattern=integration --modulePathIgnorePatterns='./__mocks__(?!\\/loglevel\\.js$)'",
19
19
  "test:integration:update": "jest --updateSnapshot --testPathPattern=integration --modulePathIgnorePatterns='./__mocks__(?!\\/loglevel\\.js$)'",
20
- "test:cli": "node cli.js ./test/docs/dummy.yml ./test/test-templates/react-template -o test/output --force-write --debug && test -e test/output/test-file.md",
21
20
  "test:cleanup": "rimraf \"test/temp\"",
22
21
  "docs": "jsdoc2md --partial docs/jsdoc2md-handlebars/custom-sig-name.hbs docs/jsdoc2md-handlebars/main.hbs docs/jsdoc2md-handlebars/docs.hbs docs/jsdoc2md-handlebars/header.hbs docs/jsdoc2md-handlebars/defaultvalue.hbs docs/jsdoc2md-handlebars/link.hbs docs/jsdoc2md-handlebars/params-table.hbs --files lib/generator.js > docs/api.md",
23
22
  "docker:build": "docker build -t asyncapi/generator:latest .",
@@ -82,7 +81,7 @@
82
81
  "eslint-plugin-jest": "^23.8.2",
83
82
  "eslint-plugin-react": "^7.34.1",
84
83
  "eslint-plugin-sonarjs": "^0.5.0",
85
- "fs-extra": "9.1.0",
84
+ "fs-extra": "11.2.0",
86
85
  "jest": "^27.3.1",
87
86
  "jsdoc-to-markdown": "^7.1.1",
88
87
  "markdown-toc": "^1.2.0",
@@ -10,11 +10,11 @@ const dummySpecPath = path.resolve(__dirname, './docs/dummy.yml');
10
10
  const refSpecPath = path.resolve(__dirname, './docs/apiwithref.json');
11
11
  const refSpecFolder = path.resolve(__dirname, './docs/');
12
12
  const crypto = require('crypto');
13
- const mainTestResultPath = 'test/temp/integrationTestResult';
14
- const reactTemplate = 'test/test-templates/react-template';
15
- const nunjucksTemplate = 'test/test-templates/nunjucks-template';
13
+ const mainTestResultPath = path.resolve(__dirname, './temp/integrationTestResult');
14
+ const reactTemplate = path.resolve(__dirname, './test-templates/react-template');
15
+ const nunjucksTemplate = path.resolve(__dirname, './test-templates/nunjucks-template');
16
16
  //temp location where react template is copied for each test that does some mutation on template files
17
- const copyOfReactTemplate = 'test/temp/reactTemplate';
17
+ const copyOfReactTemplate = path.resolve(__dirname, './temp/reactTemplate');
18
18
 
19
19
  describe('Integration testing generateFromFile() to make sure the result of the generation is not changend comparing to snapshot', () => {
20
20
  const generateFolderName = () => {
@@ -11,7 +11,6 @@
11
11
  "test:cleanup": "rimraf \"../temp\""
12
12
  },
13
13
  "devDependencies": {
14
- "fs-extra": "9.1.0",
15
14
  "jest": "28.1.3",
16
15
  "rimraf": "3.0.2"
17
16
  },
@@ -71,6 +71,11 @@ Publish test template to local npm-verdaccio
71
71
  npm config set -- //verdaccio:4873/:_auth=YWRtaW46bmltZGE=
72
72
  npm config set registry http://verdaccio:4873
73
73
 
74
+ echo "##########
75
+ Publish @asyncapi/generator-components to local npm-verdaccio
76
+ ##########"
77
+ npm publish ../../../../packages/components
78
+
74
79
  echo "##########
75
80
  Publishing the correct template as 0.0.1
76
81
  ##########"
@@ -10,7 +10,13 @@ packages:
10
10
  "react-template":
11
11
  access: admin
12
12
  publish: admin
13
+ "@asyncapi/generator-components":
14
+ access: admin
15
+ publish: admin
13
16
  "!react-template":
14
17
  access: admin
15
18
  proxy: npmjs
19
+ "!@asyncapi/generator-components":
20
+ access: admin
21
+ proxy: npmjs
16
22
  log: { type: stdout, format: pretty, level: error }