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

chore: add components and helpers packages and show example template #1315

Open
wants to merge 36 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
d110189
feat: first component lib
derberg Oct 29, 2024
02f9067
adding first component and test for it
derberg Oct 30, 2024
cbf8f5d
fix: making module work
derberg Nov 6, 2024
4985202
Merge branch 'master' into poc-templates-in
derberg Nov 6, 2024
4c7c997
make sure tests pass
derberg Nov 6, 2024
50620fe
Update models.js.map
derberg Nov 19, 2024
2131743
Merge branch 'master' into poc-templates-in
asyncapi-bot Nov 19, 2024
94d77c0
first super simple client implementation
derberg Nov 20, 2024
f7f6ceb
Merge branch 'poc-templates-in' of https://github.com/derberg/generat…
derberg Nov 20, 2024
f38413e
some readme and examples improvement
derberg Dec 16, 2024
3c351ab
moving components to packages dir
derberg Dec 16, 2024
fc3292d
fixing package locks
derberg Dec 16, 2024
b644ab8
move helpers as independent package
derberg Dec 16, 2024
2dabbc2
quiet sonar
derberg Dec 16, 2024
d682d04
adjust linter to exclude generated files
derberg Dec 16, 2024
fdd414f
more sonar
derberg Dec 16, 2024
9386382
sonar
derberg Dec 16, 2024
720085a
more sonar
derberg Dec 16, 2024
3b5b401
turbo config improvement
derberg Dec 16, 2024
55de060
fix paths for tests
derberg Dec 16, 2024
e8f48fa
one more path fix
derberg Dec 16, 2024
9514019
adjust tests for docker
derberg Dec 16, 2024
c48a1e9
update complex tests to use locally manually published package
derberg Dec 16, 2024
705fd47
some more stuff maybe needed for winows
derberg Dec 17, 2024
e7478e3
Update asyncapi-postman-echo.yml
derberg Dec 17, 2024
dd072d0
snapshot update
derberg Dec 18, 2024
52e62d4
update test config to respect snapshot
derberg Dec 18, 2024
c307520
remove transpiled websocket template
derberg Dec 18, 2024
ca43a98
ignore transpiled
derberg Dec 18, 2024
c56cf24
remove react transpile
derberg Dec 18, 2024
daa9f9b
ignore transpiled
derberg Dec 18, 2024
8b205bf
fixing fsextra
derberg Dec 18, 2024
369aae4
Update package.json
derberg Dec 18, 2024
e1237bb
fix windows
derberg Dec 18, 2024
4071269
revert ci change
derberg Dec 18, 2024
acccf89
Update package.json
derberg Dec 18, 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
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ apps/generator/output/*
.github/templates-list-validator/dist/*
apps/generator/test/temp/*
apps/generator/test/test-templates/react-template/__transpiled/*

packages/components/lib/*
3 changes: 2 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,5 @@ rules:
react/react-in-jsx-scope: off
react/display-name: off
react/prop-types: off
react/jsx-key: off
react/jsx-key: off
react/no-unescaped-entities: off
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ coverage
.turbo

/.idea
temp
2 changes: 1 addition & 1 deletion .sonarcloud.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#we need to explicitly exclude them as some are commit to the repo
sonar.exclusions=test/**/*
sonar.exclusions=**/test/**/*,**/*__transpiled/**/*.js,packages/templates/clients/js/websocket/example.js,
1 change: 1 addition & 0 deletions apps/generator/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ test/temp/reactTemplate
test/test-project/package-lock.json
test/test-project/verdaccio/storage/
test/test-project/storage/
__transpiled
5 changes: 2 additions & 3 deletions apps/generator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,11 @@
"npm": ">=8.19.0"
},
"scripts": {
"test": "npm run test:unit && npm run test:integration && npm run test:cli",
"test": "npm run test:unit && npm run test:integration",
"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__(?!\\/loglevel\\.js$)'",
"test:integration:update": "jest --updateSnapshot --testPathPattern=integration --modulePathIgnorePatterns='./__mocks__(?!\\/loglevel\\.js$)'",
"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",
"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 .",
Expand Down Expand Up @@ -82,7 +81,7 @@
"eslint-plugin-jest": "^23.8.2",
"eslint-plugin-react": "^7.34.1",
"eslint-plugin-sonarjs": "^0.5.0",
"fs-extra": "9.1.0",
"fs-extra": "11.2.0",
"jest": "^27.3.1",
"jsdoc-to-markdown": "^7.1.1",
"markdown-toc": "^1.2.0",
Expand Down
8 changes: 4 additions & 4 deletions apps/generator/test/integration.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ const dummySpecPath = path.resolve(__dirname, './docs/dummy.yml');
const refSpecPath = path.resolve(__dirname, './docs/apiwithref.json');
const refSpecFolder = path.resolve(__dirname, './docs/');
const crypto = require('crypto');
const mainTestResultPath = 'test/temp/integrationTestResult';
const reactTemplate = 'test/test-templates/react-template';
const nunjucksTemplate = 'test/test-templates/nunjucks-template';
const mainTestResultPath = path.resolve(__dirname, './temp/integrationTestResult');
const reactTemplate = path.resolve(__dirname, './test-templates/react-template');
const nunjucksTemplate = path.resolve(__dirname, './test-templates/nunjucks-template');
//temp location where react template is copied for each test that does some mutation on template files
const copyOfReactTemplate = 'test/temp/reactTemplate';
const copyOfReactTemplate = path.resolve(__dirname, './temp/reactTemplate');

describe('Integration testing generateFromFile() to make sure the result of the generation is not changend comparing to snapshot', () => {
const generateFolderName = () => {
Expand Down
1 change: 0 additions & 1 deletion apps/generator/test/test-project/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
"test:cleanup": "rimraf \"../temp\""
},
"devDependencies": {
"fs-extra": "9.1.0",
"jest": "28.1.3",
"rimraf": "3.0.2"
},
Expand Down
5 changes: 5 additions & 0 deletions apps/generator/test/test-project/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ Publish test template to local npm-verdaccio
npm config set -- //verdaccio:4873/:_auth=YWRtaW46bmltZGE=
npm config set registry http://verdaccio:4873

echo "##########
Publish @asyncapi/generator-components to local npm-verdaccio
##########"
npm publish ../../../../packages/components

echo "##########
Publishing the correct template as 0.0.1
##########"
Expand Down
6 changes: 6 additions & 0 deletions apps/generator/test/test-project/verdaccio/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,13 @@ packages:
"react-template":
access: admin
publish: admin
"@asyncapi/generator-components":
access: admin
publish: admin
"!react-template":
access: admin
proxy: npmjs
"!@asyncapi/generator-components":
access: admin
proxy: npmjs
log: { type: stdout, format: pretty, level: error }

This file was deleted.

This file was deleted.

Loading
Loading