Skip to content

Commit

Permalink
chore: setup all tooling from contribution.md
Browse files Browse the repository at this point in the history
  • Loading branch information
chrishelgert committed Feb 23, 2023
1 parent 0872534 commit fdf3802
Show file tree
Hide file tree
Showing 6 changed files with 571 additions and 27 deletions.
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx commitlint --edit $1
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx lint-staged
14 changes: 5 additions & 9 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Please take a moment to review this document in order to make the contribution p

### Requirements

- Node.js: `>=14.17.0`
- Node.js: `>=16.15.0`
- Yarn: `>=1.21.1`

To install all dependencies and build all packages run the following commands from the root of the project.
Expand Down Expand Up @@ -53,25 +53,21 @@ yarn tsc

### Tests

We use [Jest](https://jestjs.io/) and [Testing Library](https://testing-library.com/) for writing unit tests.

#### Run tests for concrete package
We use [vitest](https://vitest.dev) and [Testing Library](https://testing-library.com/) for writing unit tests.

```bash
cd packages/single-line
yarn test
```

#### Run tests for all packages

#### Run all tests

```bash
# at the monorepo root
yarn test:ci
```

#### Links

- [`@testing-library/react` documentation](https://testing-library.com/docs/react-testing-library/intro)
- [`jest` documentation](https://testing-library.com/docs/react-testing-library/intro)
- [`jest` cheat sheet](https://github.com/sapegin/jest-cheat-sheet)
- [`vitest` documentation](https://vitest.dev/guide/)

File renamed without changes.
21 changes: 20 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,14 @@
"start": "vite build --watch",
"build": "tsc && vite build",
"lint": "eslint ./src --ext .js,.jsx,.ts,.tsx",
"tsc": "tsc --noEmit",
"test": "vitest",
"test:ci": "vitest run",
"coverage": "vitest run --coverage",
"prepare": "husky install",
"presemantic-release": "yarn build",
"semantic-release": "semantic-release"
"semantic-release": "semantic-release",
"cm": "git-cz"
},
"homepage": "https://github.com/contentful/live-preview#readme",
"dependencies": {},
Expand All @@ -41,9 +43,12 @@
"@types/react": "^18.0.27",
"@types/react-dom": "^18.0.10",
"@vitejs/plugin-react-swc": "^3.0.0",
"commitizen": "4.3.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-import-helpers": "^1.2.1",
"husky": "^8.0.3",
"lint-staged": "^13.1.2",
"prettier": "^2.8.4",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"semantic-release": "^19.0.2",
Expand All @@ -56,6 +61,20 @@
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"lint-staged": {
"*.{t,j}s?(x)": [
"prettier --write",
"eslint --fix"
],
"*.{json,yml,html}": [
"prettier --write"
]
},
"config": {
"commitizen": {
"path": "./node_modules/cz-conventional-changelog"
}
},
"release": {
"branches": [
"main"
Expand Down
Loading

0 comments on commit fdf3802

Please sign in to comment.