Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: introduce monorepo to Generator Repo #1186

Closed
wants to merge 27 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
9b3d0f4
converted the generator repo to turborepo.
AyushNautiyalDeveloper Mar 28, 2024
ef9eadd
Merge pull request #1 from asyncapi/master
ayushnau Mar 28, 2024
9a8c519
Merge branch 'master' of github.com-ayushnau:ayushnau/generator
AyushNautiyalDeveloper Mar 28, 2024
a65923c
Added the readmd file.
AyushNautiyalDeveloper Mar 28, 2024
a9b4050
Added the .github to the base code directory.
AyushNautiyalDeveloper Apr 2, 2024
145e8a6
updated the gitignore file.
AyushNautiyalDeveloper Apr 2, 2024
0f606f9
added the correct package.lock.json file.
AyushNautiyalDeveloper Apr 2, 2024
3ef4e8f
added the correct package.json file.
AyushNautiyalDeveloper Apr 2, 2024
645256c
Merge branch 'master' of github.com:asyncapi/generator
AyushNautiyalDeveloper Apr 2, 2024
6dbddff
Added the correct changes for the package.json and package.lock.json …
AyushNautiyalDeveloper Apr 2, 2024
3e4ce9b
moved the required files to the base directory.
AyushNautiyalDeveloper Apr 4, 2024
9c2b334
added .turbo in .gitignore.
AyushNautiyalDeveloper Apr 4, 2024
0b2d108
remvoed the turbo file.
AyushNautiyalDeveloper Apr 5, 2024
e20c768
Added the editor Config in the root.
AyushNautiyalDeveloper Apr 9, 2024
64b67c3
Merge from asyncapi/master
AyushNautiyalDeveloper Apr 11, 2024
d1d54f6
updated the correct jest config directory for the nimma package.
AyushNautiyalDeveloper Apr 11, 2024
dfea601
merged
AyushNautiyalDeveloper Apr 11, 2024
cb69dfe
Merge branch 'master' of github.com:asyncapi/generator into feat-Turb…
AyushNautiyalDeveloper Apr 20, 2024
bb4b6ec
Merge branch 'master' of github.com:asyncapi/generator into feat-Turb…
AyushNautiyalDeveloper Apr 20, 2024
3c01a98
Added the required changes for the hooks.
AyushNautiyalDeveloper Apr 20, 2024
fdf2c2f
Added the required link for the hooks.md
AyushNautiyalDeveloper Apr 20, 2024
2940747
updated the update-docs-in-website.yml file.
AyushNautiyalDeveloper Apr 20, 2024
7ff4552
fixed the package.json
AyushNautiyalDeveloper Apr 20, 2024
571b8dd
fixed the confilt.
AyushNautiyalDeveloper May 7, 2024
4faf883
Merge branch 'master' of github.com:asyncapi/generator into feat-Turb…
AyushNautiyalDeveloper May 7, 2024
f93ede8
removed the unwtaed file.
AyushNautiyalDeveloper May 16, 2024
4bedceb
Merge branch 'master' of github.com:asyncapi/generator into feat-Turb…
AyushNautiyalDeveloper May 16, 2024
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
10 changes: 5 additions & 5 deletions .github/workflows/update-docs-in-website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ jobs:
run: |
rm -r ./pages/docs/tools/generator
mkdir -p ./pages/docs/tools/generator
rm ../generator/docs/README.md
rm -r ../generator/docs/jsdoc2md-handlebars
printf "%s\ntitle: Generator\nweight: 3\n%s" "---" "---"> ../generator/docs/_section.md
mv ../generator/docs/*.md ./pages/docs/tools/generator
rm ../generator/apps/generator/docs/README.md
rm -r ../generator/apps/generator/docs/jsdoc2md-handlebars
printf "%s\ntitle: Generator\nweight: 3\n%s" "---" "---"> ../generator/apps/generator/docs/_section.md
mv ../generator/apps/generator/docs/*.md ./pages/docs/tools/generator
- name: Commit and push
working-directory: ./website
run: |
Expand All @@ -50,4 +50,4 @@ jobs:
- name: Create PR
working-directory: ./website
run: |
gh pr create --title "docs(generator): update latest generator documentation" --body "Updated generator documentation is available and this PR introduces update to generator folder on the website" --head "update-generator-docs-${{ github.sha }}"
gh pr create --title "docs(generator): update latest generator documentation" --body "Updated generator documentation is available and this PR introduces update to generator folder on the website" --head "update-generator-docs-${{ github.sha }}"
14 changes: 1 addition & 13 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,20 +1,8 @@
.DS_Store
node_modules
npm-debug.log
output
.vscode
######################
# Intellij
######################
.idea/
*.iml
*.iws
*.ipr
*.ids
*.orig
out/
coverage
test/temp/integrationTestResult
test/test-project/package-lock.json
test/test-project/verdaccio/storage/
test/test-project/storage/
.turbo
30 changes: 15 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,21 @@ There is a large number of templates that are ready to use and are officially su
<!-- templates list is validated with GitHub Actions do not remove list markers -->
<!-- TEMPLATES-LIST:START -->

Template Name | Description | Source code
---|---|---
`@asyncapi/nodejs-template` | Generates Nodejs service that uses Hermes package | [click here](https://github.com/asyncapi/nodejs-template)
`@asyncapi/nodejs-ws-template` | Generates Nodejs service that supports WebSockets protocol only | [click here](https://github.com/asyncapi/nodejs-ws-template)
`@asyncapi/java-template` | Generates Java JMS application | [click here](https://github.com/asyncapi/java-template)
`@asyncapi/java-spring-template` | Generates Java Spring service | [click here](https://github.com/asyncapi/java-spring-template)
`@asyncapi/java-spring-cloud-stream-template` | Generates Java Spring Cloud Stream service | [click here](https://github.com/asyncapi/java-spring-cloud-stream-template)
`@asyncapi/python-paho-template` | Generates Python service that uses Paho library | [click here](https://github.com/asyncapi/python-paho-template)
`@asyncapi/html-template` | Generates HTML documentation site | [click here](https://github.com/asyncapi/html-template)
`@asyncapi/markdown-template` | Generates documentation in Markdown file | [click here](https://github.com/asyncapi/markdown-template)
`@asyncapi/ts-nats-template` | Generates TypeScript NATS client | [click here](https://github.com/asyncapi/ts-nats-template/)
`@asyncapi/go-watermill-template` | Generates Go client using Watermill | [click here](https://github.com/asyncapi/go-watermill-template)
`@asyncapi/dotnet-nats-template` | Generates .NET C# client using NATS | [click here](https://github.com/asyncapi/dotnet-nats-template)
`@asyncapi/php-template` | Generates PHP client using RabbitMQ | [click here](https://github.com/asyncapi/php-template)
`@asyncapi/dotnet-rabbitmq-template` | Generates .NET C# client using RabbitMQ | [click here](https://github.com/asyncapi/dotnet-rabbitmq-template)
| Template Name | Description | Source code |
| --------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------------------- |
| `@asyncapi/nodejs-template` | Generates Nodejs service that uses Hermes package | [click here](https://github.com/asyncapi/nodejs-template) |
| `@asyncapi/nodejs-ws-template` | Generates Nodejs service that supports WebSockets protocol only | [click here](https://github.com/asyncapi/nodejs-ws-template) |
| `@asyncapi/java-template` | Generates Java JMS application | [click here](https://github.com/asyncapi/java-template) |
| `@asyncapi/java-spring-template` | Generates Java Spring service | [click here](https://github.com/asyncapi/java-spring-template) |
| `@asyncapi/java-spring-cloud-stream-template` | Generates Java Spring Cloud Stream service | [click here](https://github.com/asyncapi/java-spring-cloud-stream-template) |
| `@asyncapi/python-paho-template` | Generates Python service that uses Paho library | [click here](https://github.com/asyncapi/python-paho-template) |
| `@asyncapi/html-template` | Generates HTML documentation site | [click here](https://github.com/asyncapi/html-template) |
| `@asyncapi/markdown-template` | Generates documentation in Markdown file | [click here](https://github.com/asyncapi/markdown-template) |
| `@asyncapi/ts-nats-template` | Generates TypeScript NATS client | [click here](https://github.com/asyncapi/ts-nats-template/) |
| `@asyncapi/go-watermill-template` | Generates Go client using Watermill | [click here](https://github.com/asyncapi/go-watermill-template) |
| `@asyncapi/dotnet-nats-template` | Generates .NET C# client using NATS | [click here](https://github.com/asyncapi/dotnet-nats-template) |
| `@asyncapi/php-template` | Generates PHP client using RabbitMQ | [click here](https://github.com/asyncapi/php-template) |
| `@asyncapi/dotnet-rabbitmq-template` | Generates .NET C# client using RabbitMQ | [click here](https://github.com/asyncapi/dotnet-rabbitmq-template) |

<!-- TEMPLATES-LIST:END -->

Expand Down
File renamed without changes.
21 changes: 21 additions & 0 deletions apps/generator/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
.DS_Store
node_modules
npm-debug.log
output
.vscode
######################
# Intellij
######################
.idea/
*.iml
*.iws
*.ipr
*.ids
*.orig
out/
coverage
test/temp/integrationTestResult
test/test-project/package-lock.json
test/test-project/verdaccio/storage/
test/test-project/storage/
.turbo
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions docs/hooks.md → apps/generator/docs/hooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ The following types of hooks are currently supported:

|Hook type|Description| Return type | Arguments
|---|---|---|---|
| `generate:before` | Called after registration of all filters and before the generator starts processing of the template. | void : Nothing is expected to be returned. | [The generator instance](https://github.com/asyncapi/generator/blob/master/docs/api.md)
| `generate:after` | Called at the very end of the generation. | void : Nothing is expected to be returned. | [The generator instance](https://github.com/asyncapi/generator/blob/master/docs/api.md)
| `setFileTemplateName ` | Called right before saving a new file generated by [file template](./file-templates.md). | string : a new filename for the generator to use for the file template. | [The generator instance](https://github.com/asyncapi/generator/blob/master/docs/api.md) and object in the form of `{ "originalFilename" : string }`
| `generate:before` | Called after registration of all filters and before the generator starts processing of the template. | void : Nothing is expected to be returned. | [The generator instance]( https://www.asyncapi.com/docs/tools/generator/api)
| `generate:after` | Called at the very end of the generation. | void : Nothing is expected to be returned. | [The generator instance]( https://www.asyncapi.com/docs/tools/generator/api)
| `setFileTemplateName ` | Called right before saving a new file generated by [file template](./file-templates.md). | string : a new filename for the generator to use for the file template. | [The generator instance]( https://www.asyncapi.com/docs/tools/generator/api) and object in the form of `{ "originalFilename" : string }`

The generator parses:
- All the files in the `.hooks` directory inside the template.
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 8 additions & 0 deletions apps/generator/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
clearMocks: true,
moduleNameMapper: {
"^nimma/legacy$":
"<rootDir>../../node_modules/nimma/dist/legacy/cjs/index.js",
"^nimma/(.*)": "<rootDir>../../node_modules/nimma/dist/cjs/$1",
},
};
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
86 changes: 86 additions & 0 deletions apps/generator/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
{
"name": "@asyncapi/generator",
"version": "1.17.25",
"description": "The AsyncAPI generator. It can generate documentation, code, anything!",
"main": "./lib/generator.js",
"bin": {
"asyncapi-generator": "./cli.js",
"ag": "./cli.js"
},
"engines": {
"node": ">12.16",
"npm": ">6.13.7"
},
"scripts": {
"test": "npm run test:unit && npm run test:integration && npm run test:cli",
"test:unit": "jest --coverage --testPathIgnorePatterns=integration --testPathIgnorePatterns=test-project",
"test:dev": "npm run test:unit -- --watchAll",
"test:integration": "npm run test:cleanup && jest --testPathPattern=integration --modulePathIgnorePatterns='./__mocks__'",
"test:cli": "node cli.js ./test/docs/dummy.yml @asyncapi/html-template -o test/output --force-write --debug && test -e test/output/index.html",
"test:cleanup": "rimraf \"test/temp\"",
"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",
"docker:build": "docker build -t asyncapi/generator:latest .",
"lint": "eslint --max-warnings 0 --config .eslintrc .",
"lint:tpl:validator": "eslint --fix --config .eslintrc .github/templates-list-validator",
"generate:readme:toc": "markdown-toc -i README.md",
"generate:assets": "npm run docs && npm run generate:readme:toc",
"bump:version": "npm --no-git-tag-version --allow-same-version version $VERSION"
},
"preferGlobal": true,
"bugs": {
"url": "https://github.com/asyncapi/generator/issues"
},
"repository": {
"type": "git",
"url": "git://github.com/asyncapi/generator.git"
},
"keywords": [
"asyncapi",
"documentation",
"generator",
"markdown",
"codegen"
],
"author": "Fran Mendez <[email protected]>",
"publishConfig": {
"access": "public"
},
"license": "Apache-2.0",
"homepage": "https://github.com/asyncapi/generator",
"dependencies": {
"@asyncapi/generator-react-sdk": "^1.0.18",
"@asyncapi/parser": "^3.0.14",
"@npmcli/arborist": "5.6.3",
"@smoya/multi-parser": "^5.0.0",
"ajv": "^8.12.0",
"chokidar": "^3.4.0",
"commander": "^6.1.0",
"filenamify": "^4.1.0",
"fs.extra": "^1.3.2",
"global-dirs": "^3.0.0",
"jmespath": "^0.15.0",
"js-yaml": "^3.13.1",
"levenshtein-edit-distance": "^2.0.5",
"loglevel": "^1.6.8",
"minimatch": "^3.0.4",
"node-fetch": "^2.6.0",
"nunjucks": "^3.2.0",
"resolve-from": "^5.0.0",
"resolve-pkg": "^2.0.0",
"semver": "^7.3.2",
"simple-git": "^3.3.0",
"source-map-support": "^0.5.19",
"ts-node": "^10.9.1",
"typescript": "^4.9.3"
},
"devDependencies": {
"eslint": "^6.8.0",
"eslint-plugin-jest": "^23.8.2",
"eslint-plugin-sonarjs": "^0.5.0",
"jest": "^25.5.0",
"jsdoc-to-markdown": "^7.1.1",
"markdown-toc": "^1.2.0",
"rimraf": "^3.0.2",
"unixify": "^1.0.0"
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ describe('Integration testing generateFromFile() to make sure the result of the

it('generated using Nunjucks template', async () => {
const outputDir = generateFolderName();
const generator = new Generator(nunjucksTemplate, outputDir, {
const generator = new Generator(nunjucksTemplate, outputDir, {
forceWrite: true,
templateParams: { version: 'v1', mode: 'production' }
});
Expand All @@ -35,7 +35,7 @@ describe('Integration testing generateFromFile() to make sure the result of the

it('generate using React template', async () => {
const outputDir = generateFolderName();
const generator = new Generator(reactTemplate, outputDir, {
const generator = new Generator(reactTemplate, outputDir, {
forceWrite: true ,
templateParams: { version: 'v1', mode: 'production' }
});
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading
Loading