RenaiApp/README.md

54 lines
2.2 KiB
Markdown
Raw Normal View History

2019-07-26 22:18:56 +02:00
![Renai](resources/logo.png 'Renai')
# レンアイ - Hentai Library Thingy
## Development
2019-03-10 20:29:25 +01:00
### Quickstart
- `npm install`, the postinstall runs
- `npm run rebuild`
- might need to install some build tools depending on your platform
- `npm run watch` for code transpilation (starts watchers)
- `npm run start`
### Git Commits
This project uses [Conventional Commits](https://www.conventionalcommits.or) with the following types:
- `feat`: features, if any part of your commit implements a new functionality or changes an existing one, use this
- `remove`: removal of existing code/functionality
- `fix`: bugfixes
- `test`: implementation of new tests or fixing/removal of existing tests
- `refactor`: code refactoring
- `update`: updating dependencies and associated code changes
- `config`: changing configuration (linters, build process)
- `doc`: documentation, including comments
- `reformat`: fixing code formatting
Always try to split up your changes into coherent commits, a single commit should do a single thing. If your commit needs to do more than one thing it should be labeled with the type coming first in this list.
2019-06-23 03:33:48 +02:00
### Database Migrations
Migrations are stored in [src/main/migrations](src/main/migrations) and handled by typeorm. Migrations are run on app start inside [database.ts](src/main/services/database.ts).
2019-06-23 03:33:48 +02:00
To auto-generate a migration:
2019-06-23 15:35:57 +02:00
`node_modules/.bin/typeorm migration:generate -n <migration name> -c <connection name>`
2019-06-23 03:33:48 +02:00
To create an empty creation which can be filled with custom migration code:
2019-06-23 15:35:57 +02:00
`node_modules/.bin/typeorm migration:create -n <migration name> -c <connection name>`
2019-06-23 03:33:48 +02:00
To run migrations:
`node_modules/.bin/typeorm migration:run -c <connection name>`
This is also pre-defined in the npm script `typeorm:migrate`.
### Testing
The testing framework of choice is [Mocha](https://mochajs.org/). Call `npm run test` to run all tests. Tests are written in typescript and need to be transpiled before testing.
#### Tagging
Mocha does [not have a seperate tagging feature](https://github.com/mochajs/mocha/wiki/Tagging), but it can filter via title. Us the following tags in your test titles:
- `@slow` when the test is particularly slow