Skip to content

Commit

Permalink
improve dev docs
Browse files Browse the repository at this point in the history
  • Loading branch information
milesstoetzner authored Jul 17, 2023
1 parent b9ff23b commit ad7eeff
Show file tree
Hide file tree
Showing 13 changed files with 487 additions and 409 deletions.
5 changes: 5 additions & 0 deletions docs/docs/assets/stylesheets/extra.css
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,8 @@
.md-typeset figure img {
display: unset;
}

/* Black banner */
.md-banner {
background-color: black;
}
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,13 @@ the community.

This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.0, available at
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
[https://www.contributor-covenant.org/version/2/0/code_of_conduct.html](https://www.contributor-covenant.org/version/2/0/code_of_conduct.html).

Community Impact Guidelines were inspired by [Mozilla's code of conduct
enforcement ladder](https://github.com/mozilla/diversity).

[homepage]: https://www.contributor-covenant.org

For answers to common questions about this code of conduct, see the FAQ at
https://www.contributor-covenant.org/faq. Translations are available at
https://www.contributor-covenant.org/translations.
[https://www.contributor-covenant.org/faq](https://www.contributor-covenant.org/faq). Translations are available at
[https://www.contributor-covenant.org/translations](https://www.contributor-covenant.org/translations).
165 changes: 165 additions & 0 deletions docs/docs/contributing/development.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
# Development

Contributions are very much welcome.
But please follow the following guidelines and our [Code of Conduct](code-of-conduct.md){target=_blank}.

## GitHub Flow

Our branching workflow follows [GitHub Flow](https://docs.github.com/de/get-started/quickstart/github-flow){target=_blank}.

## Branch Naming Convention

Branches should be names as follows

- `fix-short-title` for bug fixes
- `docs-short-title` for documentations
- `feature-short-title` for features
- `refactor-short-title` for refactoring
- `imrpove-short-title` for improvements
- `project-short-title` for thesis, EnPro, StuPro ...

## Squash and Merge

Please squash your commits into a single commit with a short but meaningful message and delete the branch afterwards.
The commit message should not have a link to the merge request.


## Command Line Interface

!!! Info
`yarn cli` uses `src/cli/index.ts` while `yarn vintner` uses `build/cli/index.js`.
Therefore, run `yarn cli` to execute the current code without building it first.

The CLI is build using [commander.js](https://github.com/tj/commander.js){target=_blank}.
The entry point is `src/cli/index.ts`.
To execute a CLI command during development, run

```shell linenums="1"
yarn cli [command] [options]
```

## Server

The server is build using [express](https://github.com/expressjs/express){target=_blank}.
The entry point is `src/server/index.ts`.
To run a development server on [http://localhost:3000](http://localhost:3000){target=_blank} with live-reload, run

```shell linenums="1"
yarn server:serve
```

## Tests

We use [mocha](https://mochajs.org){target=_blank}, [chai](https://www.chaijs.com){target=_blank}, and [nyc](https://istanbul.js.org){target=_blank} for testing.
Respective tests are inside the `tests` directory.
To run the tests, use

```shell linenums="1"
yarn test
```

To run the tests inside docker, use

```shell linenums="1"
yarn test:docker
```

On pushes to the `main` branch these tests are executed.

## Lint

[ESLint](https://eslint.org){target=_blank} is used for linting.
To lint typescript, run the following command

```shell linenums="1"
yarn lint:check
```

To fix lint problems, run the following command

```shell linenums="1"
yarn lint:fix
```

## Code Style

[Prettier](https://prettier.io){target=_blank} is used to format code.
To check the code style, run the following command

```shell linenums="1"
yarn style:check
```

To fix code style problems, run the following command

```shell linenums="1"
yarn style:fix
```

## Benchmark

Run the following command, to run to benchmark the variability resolving.

```shell linenums="1"
yarn benchmark
```

## Licenses

[license-checker](https://github.com/davglass/license-checker){target=_blank} is used for handling licenses of (transitive) dependencies.
To check that (transitive) dependencies are licensed as expected, run the following command.
This check is also executed inside workflows.

```shell linenums="1"
yarn licenses:check
```


## Patch Packages

We use [`patch-package`](https://github.com/ds300/patch-package){target=_blank} to fixing third party libraries.
For example, adding `logic-solver.d.ts` to [`logic-solver`](https://github.com/meteor/logic-solver){target=_blank}.
Therefore, make changes to the package inside `node_modules`, then run the following command.

```shell linenums="1"
yarn patch-package ${package-name}
```

If you need to patch the `package.json`, then append the option `--exclude 'nothing'` as stated in [#311](https://github.com/ds300/patch-package/issues/311){target=_blank}.

## Build

To locally build the project, run the following command.
This will transpile Javascript inside the `/build` directory.

```shell linenums="1"
yarn build
```

## Package

{{ linux_only_notice() }}

To locally package the project, run the following command.
This will package the previously transpiled Javascript using [`pkg`](https://github.com/vercel/pkg){target=_blank} and
generate binaries inside the `/dist` directory.

```shell linenums="1"
yarn package
```

The issue considering the failed bytecode generation of MiniSat is known and can be ignored in our case.

## Release

On pushes to the `main` branch, the `release` workflow is triggered.
This workflow runs several tests, builds and packages the project and creates a new release.
Thereby, an existing release and `latest` tag is deleted.
There is only one release at total.
During the workflow the string `__VERSION__` inside a Javascript file is replace with the current commit hash.
The current version can be checked using `vintner --version`.

## Night

The `night` workflow is scheduled for every tuesday at 420.
This workflow ensures that the latest release is correctly signed and can be executed.
Loading

0 comments on commit ad7eeff

Please sign in to comment.