Skip to content

Commit

Permalink
chore: generator templates support prereleases (#378)
Browse files Browse the repository at this point in the history
  • Loading branch information
derberg authored Jun 8, 2020
1 parent c170bc9 commit f2941c8
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 4 deletions.
6 changes: 6 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
test/
.DS_Store
*.swp
.github
lib/__mocks__
.all-contributorsrc
.dockerignore
.editorconfig
jest.config.js
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ ag asyncapi.yaml @asyncapi/html-template
**Generating from a URL:**
```bash
ag https://raw.githubusercontent.com/asyncapi/asyncapi/2.0.0/examples/2.0.0/streetlights.yml @asyncapi/html-template
ag https://bit.ly/asyncapi @asyncapi/html-template
```
**Specify where to put the result:**
Expand Down
2 changes: 1 addition & 1 deletion lib/templateConfigValidator.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ module.exports.validateTemplateConfig = (templateConfig, templateParams, asyncap
*/
function isTemplateCompatible(generator) {
const generatorVersion = getGeneratorVersion();
if (typeof generator === 'string' && !semver.satisfies(generatorVersion, generator)) {
if (typeof generator === 'string' && !semver.satisfies(generatorVersion, generator, {includePrerelease: true})) {
throw new Error(`This template is not compatible with the current version of the generator (${generatorVersion}). This template is compatible with the following version range: ${generator}.`);
}
}
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@asyncapi/generator",
"version": "0.53.1",
"version": "1.0.0-rc.2",
"description": "The AsyncAPI generator. It can generate documentation, code, anything!",
"main": "./lib/generator.js",
"bin": {
Expand Down

0 comments on commit f2941c8

Please sign in to comment.