Skip to content

Commit

Permalink
docs: update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
cajubelt authored Aug 3, 2023
1 parent 3280044 commit 3053073
Showing 1 changed file with 4 additions and 52 deletions.
56 changes: 4 additions & 52 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# typescript-app-starter
# blockscout-status

A starter template for Valora TypeScript projects with best practices.
A script for monitoring the status of blockscout features that Valora depends on.

Intended for cLabs to be able to deploy as a cloud function that could be used for automated health checks and alerting.

## What's in the stack?

Expand All @@ -14,26 +16,6 @@ A starter template for Valora TypeScript projects with best practices.
- Semantic PR title enforcement with [semantic-pull-request](https://github.com/amannn/action-semantic-pull-request)
- Automated dependency updates with [Renovate](https://renovatebot.com/), configured with [valora-inc/renovate-config](https://github.com/valora-inc/renovate-config)

## How to use this?

Above the file list, click the big green button: `Use this template`.

Or using [GitHub CLI](https://cli.github.com/):

```sh
gh repo create --template valora-inc/typescript-app-starter valora-inc/new-repo
```

## Structure

Here's the recommended structure:

- [`src`](src): source code
- [`index.ts`](src/index.ts): example source file
- [`index.test.ts`](src/index.test.ts): unit tests for `index.ts`
- [`scripts`](scripts): more complex scripts in TypeScript
- [`example.ts`](scripts/example.ts): example script using [ShellJS](https://github.com/shelljs/shelljs)

## Type Checking

This project uses [TypeScript](https://www.typescriptlang.org/). It's recommended to get TypeScript set up for your editor to get a really great in-editor experience with type checking and auto-complete. To run type checking across the whole project, run `yarn typecheck`.
Expand All @@ -42,30 +24,6 @@ This project uses [TypeScript](https://www.typescriptlang.org/). It's recommende

For lower level tests of utilities and individual modules, we use [Jest](https://jestjs.io).

## Test coverage checks

### For private repos

For private repos, Jest can be configured to terminate with an error status if there is less coverage than some configurable threshold.
This project applies coverage thresholds for `yarn test:ci`, so CI checks will fail if there is insufficient test coverage.

Make sure to add fixture data, mocks, or other files and file paths that you don't want to count towards your coverage thresholds
to `coveragePathIgnorePatterns` in [`jest.config.js`](jest.config.js).

### For public repos

For public repos, [Codecov](https://codecov.io) is free. The tool offers two nice features that Jest doesn't offer out of the box:

- "auto" coverage targets, which track the current coverage of the `main` branch. This lets you guarantee that test coverage increases over time.
- "patch" coverage, counting only the lines modified by the current PR

Here's how to set it up:

Uncomment the `Upload Coverage Report` and `Upload coverage to Codecov` steps in [`workflow.yaml`](.github/workflows/workflow.yaml). No token is needed for public repos uploading via GitHub Actions.

If you set up Codecov, you may consider turning off Jest coverage checks for simplicity. You can do this by removing the
`coverageThreshold` parameter from [`jest.config.js`](jest.config.js).

## Linting

This project uses [ESLint](https://eslint.org/) for linting. That is configured in [`.eslintrc.js`](.eslintrc.js).
Expand All @@ -84,12 +42,6 @@ We use TypeScript instead of shell scripts. This is it to avoid the many pitfall

To run external commands we recommend using [ShellJS](https://github.com/shelljs/shelljs).

## GitHub Actions

We use [GitHub Actions](https://docs.github.com/en/actions) for continuous integration and deployment (CI/CD). Anything that gets into the `main` branch will be deployed using `yarn deploy` after running tests/build/etc.

Also, we use [semantic-pull-request](https://github.com/amannn/action-semantic-pull-request) to ensure PR titles match the [Conventional Commits spec](https://www.conventionalcommits.org/). It can be used in combination with [semantic-release](https://github.com/semantic-release/semantic-release) to automate releases and changelogs.

## Renovate

[Renovate](https://renovatebot.com/) ensures our dependencies are kept up to date. It's configured with our shared config in [`renovate.json5`](renovate.json5).

0 comments on commit 3053073

Please sign in to comment.