Skip to content

Commit

Permalink
docs: add the development related sections to CONTRIBUTING document
Browse files Browse the repository at this point in the history
  • Loading branch information
rainx committed Sep 16, 2023
1 parent 9b79f56 commit fa90054
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 6 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ We are stilling waiting for someones to contribute, especially for the following
- More docs
- A script to monitor [upstream](https://github.com/phpstan/phpdoc-parser) updates and notify the author to catch up.

Please check out our [Contribution guide](docs/CONTRIBUTING.md)

## How did we create the initial version of this project.

We created most of our code by using ChatGPT as a tool to transform most code from https://github.com/phpstan/phpdoc-parser to TypeScript version.
Expand Down
51 changes: 45 additions & 6 deletions docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,58 @@ Please note we have a [code of conduct](CODE_OF_CONDUCT.md), please follow it in

## Development environment setup

> **[?]**
> Proceed to describe how to setup local development environment.
> e.g:
To set up a development environment, please follow these steps:

1. Clone the repo
1. Before cloning the repo, ensure you have the following softwares installed.

- `Node.js` (You should install a [version manager](https://github.com/shadowspawn/node-version-usage) that could handle .node-version file)
- `pnpm` (You might have already installed it if you enabled the [Corepack](https://nodejs.org/api/corepack.html) feature)
- git

2. Clone the repo

```sh
git clone https://github.com/RightCapitalHQ/phpdoc-parser
```

2. TODO
3. Install the dependencies

```sh
pnpm install
```

## Guidelines

- The code style follows the RightCapital [front-end style guide](https://github.com/RightCapitalHQ/frontend-style-guide)
- Some naming rules might be break. because for some variables or methods naming, we keep it the same as the upstream library(PHP version PHPDoc parer), It would make it easier to catch up the upstream changes.

- eg. for the boolean variable/property name, our guide let us prefix the name with `is`, `has`, `can`, `should`, however, the upstream lib is not following this rule. so we just use the upstream's name. like `lines`, `indexes`, ``parseDescription`.
- Our style guide requires enum types to be named in camel case. but for the enum directly from upstream lib, we just use the all caps for the member of the enum. like
```ts
enum ArrayShapeNodeKind {
ARRAY = 'array',
LIST = 'list',
}
```

## Linting and testing the code.

Please ensure your code is

1. Passing the ESLint check and Prettier check
2. Passing all existing test cases

and Your commit message is following the spec of the Conventional Commits ( https://www.conventionalcommits.org/ )

## Publishing and Changelog management

we use [beachball](https://microsoft.github.io/beachball/) to automate the npm publishing and changelog. when you fire a PR. the only thing the contributor needs to take care is ensuring run

```sh
pnpm change
```

to generate appropriate change file for us to bump the version and generate the changelog

## Issues and feature requests

Expand Down

0 comments on commit fa90054

Please sign in to comment.