Skip to content

Commit

Permalink
fix: asset building on release (#140)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonaslagoni authored Oct 22, 2024
1 parent a40e4fa commit 7faf26c
Show file tree
Hide file tree
Showing 10 changed files with 347 additions and 32 deletions.
6 changes: 0 additions & 6 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,3 @@ Each input has its own limitations, corner cases, and features; thus, each has s
### Protocols
Each protocol has its own limitations, corner cases, and features; thus, each has separate documentation.
- [NATS](./protocols/nats.md)






4 changes: 0 additions & 4 deletions docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,3 @@ Prefix that follows specification is not enough though. Remember that the title

## License
When you submit changes, your submissions are understood to be under the same [Apache 2.0 License](../LICENSE) that covers the project.




2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
"pack:tarballs": "oclif pack tarballs -t linux-x64 && npm run pack:rename",
"pack:windows": "oclif pack win && npm run pack:rename",
"pack:rename": "node scripts/releasePackagesRename.js",
"prepublishOnly": "npm run build",
"prepublishOnly": "npm run build && npm run generate:assets && cd website && npm i && npm run build:resources",
"test": "jest --coverage --testPathIgnorePatterns ./test/blackbox",
"coverage": "nyc npm run test",
"bump:version": "npm --no-git-tag-version --allow-same-version version $VERSION",
Expand Down
15 changes: 13 additions & 2 deletions website/docs/README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
---
sidebar_position: 1
---

# Documentation

<!-- toc is generated with GitHub Actions do not remove toc markers -->

<!-- toc -->

- [Configurations](#configurations)
- [Getting Started](#getting-started)
- [Contributing](#contributing)
- [Usage](#usage)
- [Generators](#generators)
- [Architectural Decisions](#architectural-decisions)
Expand All @@ -25,6 +26,9 @@ Contains all the information about the how the configuration file works and how
### [Getting Started](./getting-started.md)
Get started in 5 minutes :fire:

### [Contributing](./contributing.md)
Get an overview of how to contribute to the project

### [Usage](./usage.md)
Contains all the information about what the CLI can do and how.

Expand All @@ -41,4 +45,11 @@ Each input has its own limitations, corner cases, and features; thus, each has s

### Protocols
Each protocol has its own limitations, corner cases, and features; thus, each has separate documentation.
- [NATS](./protocols/nats.md)
- [NATS](./protocols/nats.md)







144 changes: 144 additions & 0 deletions website/docs/contributing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
---
sidebar_position: 5
---
# Contributing to The Codegen Project

<!-- toc is generated with GitHub Actions do not remove toc markers -->

<!-- toc -->

- [Acceptance criteria and process](#acceptance-criteria-and-process)
* [Fixing bugs](#fixing-bugs)
* [New features](#new-features)
- [Repository Architecture](#repository-architecture)
- [Getting started](#getting-started)
- [Contribution recogniton](#contribution-recogniton)
- [Summary of the contribution flow](#summary-of-the-contribution-flow)
- [Code of Conduct](#code-of-conduct)
- [Our Development Process](#our-development-process)
- [Pull Requests](#pull-requests)
- [Conventional commits](#conventional-commits)
- [License](#license)

<!-- tocstop -->

First of all, thank you 🙇🏾‍♀️ for considering contributing to The Codegen Project

If you have any questions, are unsure how your use-case fits in, or want something clarified, don't hesitate to reach out, we are always happy to help out!

## Acceptance criteria and process

Even though we love contributions, we need to maintain a certain standard of what can be merged into the codebase.

The below sections provide information about our acceptance criteria, based on the type of contribution you make.

### Fixing bugs

The Acceptance Criteria for _fixing any bug_ means that you should be able to reproduce the error using tests that will fail, unless a fix is implemented.

### New features

The Acceptance Criteria for _adding new features_ requires a few things in order to be accepted. This ensures all features are well described and implemented before being released.

1. **Not all feature requests from the community (or maintainers!) are accepted:** Even though you are welcome to create a new feature without an issue, it might be rejected and turn out to be a waste of your time. We don't want that to happen, so make sure to create an issue first and wait to see if it's accepted after community discussion of the proposal.
1. **When creating tests for your new feature, aim for as high coverage numbers as possible:** When you run the tests (`npm run test`), you should see a `./coverage/lcov-report/index.html` file being generated. Use this to see in depth where your tests are not covering your implementation.
1. **No documentation, no feature:** If a user cannot understand a new feature, that feature basically doesn't exist! Remember to make sure that any and all relevant [documentation](./) is consistently updated.
- New features such as new generators or inputs, etc, need associated use case documentation along side [examples](../examples).

## Repository Architecture

The repository is setup with multiple functions to keep it simple.
- `src`; includes the CLI and library code both exposed through the same package.
- `website`; is... Well the website.
- `scripts`; includes helpfull scripts for the release flow such as for building JSON Schema files from the code for configuration validation and CLI release configurations
- `test`; include all the testing done for the repository
- `blackbox`; is a quick and dirt syntax testing of different configurations against different inputs to quickly detect problems
- `runtime`; is sematic testing of the generated code in the corresponding languages they generate for, ensuring correct behaviour at runtime
- The rest normal unit and integration testing of the actual CLI and library
- `examples`; is the showcase of actual projects using the CLI to simplify the implementation phase of software development.
- `schemas`; is the autogenerated JSON schemas for validating configurations.

## Getting started

Here is a quick litle get started quick tutorial;

1. Fork the repository
2. Create a branch from the upstream repository
3. Install the dependencies `npm install`
4. Make sure test pass `npm run test`
5. Adapt the source code as well as test and documentation
6. Push the changes
7. Create a PR with the proposed change
8. Get the change reviewed and merged :tada:

Happy contributing :heart:

## Contribution recogniton

We use [All Contributors](https://allcontributors.org/docs/en/specification) specification to handle recognitions.

## Summary of the contribution flow

The following is a summary of the ideal contribution flow. Please, note that Pull Requests can also be rejected by the maintainers when appropriate.

```
┌───────────────────────┐
│ │
│ Open an issue │
│ (a bug report or a │
│ feature request) │
│ │
└───────────────────────┘
┌───────────────────────┐
│ │
│ Open a Pull Request │
│ (only after issue │
│ is approved) │
│ │
└───────────────────────┘
┌───────────────────────┐
│ │
│ Your changes will │
│ be merged and │
│ published on the next │
│ release │
│ │
└───────────────────────┘
```

## Code of Conduct
AsyncAPI has adopted a Code of Conduct that we expect project participants to adhere to. Please [read the full text](../CODE_OF_CONDUCT.md) so that you can understand what sort of behaviour is expected.

## Our Development Process
We use Github to host code, to track issues and feature requests, as well as accept pull requests.

## Pull Requests

**Please, make sure you open an issue before starting with a Pull Request, unless it's a typo or a really obvious error.** Pull requests are the best way to propose changes to the specification.

## Conventional commits

Our repositories follow [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/#summary) specification. Releasing to GitHub and NPM is done with the support of [semantic-release](https://semantic-release.gitbook.io/semantic-release/).

Pull requests should have a title that follows the specification, otherwise, merging is blocked. If you are not familiar with the specification simply ask maintainers to modify. You can also use this cheatsheet if you want:

- `fix: ` prefix in the title indicates that PR is a bug fix and PATCH release must be triggered.
- `feat: ` prefix in the title indicates that PR is a feature and MINOR release must be triggered.
- `docs: ` prefix in the title indicates that PR is only related to the documentation and there is no need to trigger release.
- `chore: ` prefix in the title indicates that PR is only related to cleanup in the project and there is no need to trigger release.
- `test: ` prefix in the title indicates that PR is only related to tests and there is no need to trigger release.
- `refactor: ` prefix in the title indicates that PR is only related to refactoring and there is no need to trigger release.

What about MAJOR release? just add `!` to the prefix, like `fix!: ` or `refactor!: `

Prefix that follows specification is not enough though. Remember that the title must be clear and descriptive with usage of [imperative mood](https://chris.beams.io/posts/git-commit/#imperative).

## License
When you submit changes, your submissions are understood to be under the same [Apache 2.0 License](../LICENSE) that covers the project.





9 changes: 5 additions & 4 deletions website/docs/generators/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@ All available generators, across languages and inputs:
- [`parameters`](./parameters.md)
- [`custom`](./custom.md)
- [`channels`](./channels.md)
- [`client`](./client.md)

| **Inputs** | [`payloads`](./payloads.md) | [`parameters`](./parameters.md) | [`channels`](./channels.md) | [`custom`](./custom.md) |
| **Inputs** | [`payloads`](./payloads.md) | [`parameters`](./parameters.md) | [`channels`](./channels.md) | [`client`](./client.md) | [`custom`](./custom.md) |
|---|---|---|---|---|
| AsyncAPI | X | X | X | X |
| AsyncAPI | X | X | X | X | X |

| **Languages** | [`payloads`](./payloads.md) | [`parameters`](./parameters.md) | [`channels`](./channels.md) | [`custom`](./custom.md) |
| **Languages** | [`payloads`](./payloads.md) | [`parameters`](./parameters.md) | [`channels`](./channels.md) | [`client`](./client.md) | [`custom`](./custom.md) |
|---|---|---|---|---|
| TypeScript | X | X | X | X |
| TypeScript | X | X | X | X | X |
12 changes: 6 additions & 6 deletions website/docs/generators/channels.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ sidebar_position: 99
export default {
...,
generators: [
{
preset: 'channels',
outputPath: './src/__gen__/',
language: 'typescript',
protocols: ['nats']
}
{
preset: 'channels',
outputPath: './src/__gen__/',
language: 'typescript',
protocols: ['nats']
}
]
};
```
Expand Down
Loading

0 comments on commit 7faf26c

Please sign in to comment.