Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .githooks/dep-check
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env bash

changed() {
git diff --name-only HEAD@{1} HEAD | grep "^$1" > /dev/null 2>&1
}

if changed 'yarn.lock'; then
echo "Lockfile changes detected. Installing updates..."
yarn install
fi
1 change: 1 addition & 0 deletions .husky/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_
3 changes: 3 additions & 0 deletions .husky/post-merge
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env bash

./.githooks/dep-check
3 changes: 3 additions & 0 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env bash

yarn prettify && yarn lint && yarn test
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Setup

The required node version is v16.14.0. Alternatively, you can run:
The required node version is v22.22.0. Alternatively, you can run:

```console
shell:~$ nvm use
Expand Down Expand Up @@ -40,14 +40,21 @@ You can start a build on watch mode:
shell:~$ yarn build --watch
```

Or use `ts-node` to compile and execute:
Or use `tsx` to compile and execute:

```console
shell:~$ npx ts-node src/index.ts [...]
shell:~$ npx tsx src/index.ts [...]
```

To run tests on watch mode:

```console
shell:~$ yarn test --watch
```

## Git hooks

Git hooks are managed with [husky](https://typicode.github.io/husky/) and installed automatically when you run `yarn install` (via the `prepare` script):

- **pre-push**: runs `yarn prettify`, `yarn lint` and `yarn test`. The push is aborted if any of them fails.
- **post-merge**: reinstalls dependencies (`yarn install`) when `yarn.lock` changed in the merge.
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"localize": "echo no-op",
"start": "node dist/index.js",
"test": "vitest",
"prettify": "prettier \"./**/*.{js,jsx,json,css,ts,tsx}\" --write"
"prettify": "prettier \"./**/*.{js,jsx,json,css,ts,tsx}\" --write",
"prepare": "husky"
},
"author": "EyeSeeTea team <info@eyeseetea.com>",
"license": "GPL-3.0",
Expand All @@ -30,11 +31,12 @@
"eslint": "^8.11.0",
"eslint-config-standard": "^16.0.3",
"expect-type": "^0.17.3",
"husky": "^9.1.7",
"prettier": "^2.6.0",
"ts-loader": "^9.2.8",
"ts-node": "^10.7.0",
"tsconfig-paths": "^3.14.0",
"tsconfig-paths-webpack-plugin": "^3.5.2",
"tsx": "^4.21.0",
"typescript": "5.2.2",
"vitest": "^0.34.6",
"webpack": "^5.70.0",
Expand Down
4 changes: 0 additions & 4 deletions tsconfig.base.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
{
"ts-node": {
"files": true,
"require": ["tsconfig-paths/register"]
},
"compilerOptions": {
/* Visit https://aka.ms/tsconfig.json to read more about this file */

Expand Down
266 changes: 179 additions & 87 deletions yarn.lock

Large diffs are not rendered by default.

Loading