Skip to content

Commit 15c084d

Browse files
committed
Merge branch 'document-the-needed-tool-versions'
* document-the-needed-tool-versions: Downgrade node version to 16.X and start using .tool-versions so that we can use same version in GH runner Document how to get the project up and running with correct dependencies using mise
2 parents 65534d1 + 9abc05e commit 15c084d

File tree

4 files changed

+61
-14
lines changed

4 files changed

+61
-14
lines changed

.github/workflows/test.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ jobs:
66
test:
77
runs-on: ubuntu-latest
88
steps:
9-
- uses: actions/checkout@v3
9+
- uses: actions/checkout@v4
1010

11-
- uses: actions/setup-node@v3
11+
- uses: actions/setup-node@v4
1212
with:
13-
node-version: 16
13+
node-version-file: .tool-versions
1414
cache: yarn
1515

1616
- run: yarn install --frozen-lockfile
@@ -19,11 +19,11 @@ jobs:
1919
build-minimal:
2020
runs-on: ubuntu-latest
2121
steps:
22-
- uses: actions/checkout@v3
22+
- uses: actions/checkout@v4
2323

24-
- uses: actions/setup-node@v3
24+
- uses: actions/setup-node@v4
2525
with:
26-
node-version: 16
26+
node-version-file: .tool-versions
2727
cache: yarn
2828

2929
- run: yarn install --frozen-lockfile
@@ -37,11 +37,11 @@ jobs:
3737
build-full:
3838
runs-on: ubuntu-latest
3939
steps:
40-
- uses: actions/checkout@v3
40+
- uses: actions/checkout@v4
4141

42-
- uses: actions/setup-node@v3
42+
- uses: actions/setup-node@v4
4343
with:
44-
node-version: 16
44+
node-version-file: .tool-versions
4545
cache: yarn
4646

4747
- run: yarn install --frozen-lockfile
@@ -57,11 +57,11 @@ jobs:
5757
# build-full-official-api:
5858
# runs-on: ubuntu-latest
5959
# steps:
60-
# - uses: actions/checkout@v3
60+
# - uses: actions/checkout@v4
6161

62-
# - uses: actions/setup-node@v3
62+
# - uses: actions/setup-node@v4
6363
# with:
64-
# node-version: 16
64+
# node-version-file: .tool-versions
6565
# cache: yarn
6666

6767
# - run: yarn install --frozen-lockfile

.mise.toml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
[tools]
2+
# node-gyp has issues with newer python versions:
3+
# 'ValueError: invalid mode: 'rU' while trying to load binding.gyp'
4+
# These should be fixed by downgrading python to 3.10
5+
# Source: https://stackoverflow.com/a/74732671
6+
python = ['3.10']
7+
8+
# Node 20.X breaks the node-gyp module:
9+
# TypeError: Cannot assign to read only property 'cflags' of object '#<Object>'
10+
# See more: https://stackoverflow.com/a/77910474/1337062
11+
# Node 18.X breaks ava test runner doesn't seem to work in package/notion-utils tests
12+
# node = ['16']
13+
# We read this value from .tool-versions file instead
14+
15+
# Installing with npm doesn't seem to work out, use yarn everywhere
16+
"npm:yarn" = "latest"
17+
18+
# To be able to build the packages in the monorepo workspace
19+
"npm:lerna" = "^4.0.0"

.tool-versions

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# FIXME: Remove this file when actions/setup-node supports .mise.toml
2+
# See more: https://github.com/actions/setup-node/issues/787
3+
nodejs 16.20.2
4+
5+
# node-gyp has issues with newer python versions.
6+
# This is the latest version of 3.10.x as of October 2024
7+
python 3.10.13

contributing.md

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,31 @@
33
Suggestions and pull requests are highly encouraged. Have a look at the [open issues](https://github.com/NotionX/react-notion-x/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22+sort%3Areactions-%2B1-desc), especially [the easy ones](https://github.com/NotionX/react-notion-x/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22+sort%3Areactions-%2B1-desc).
44

55
## Development
6+
### Installing and using mise
7+
This project has a few aging dependencies like `node-gyp` and `lerna`.
68

7-
To develop the project locally, you'll need a recent version of Node.js and `yarn` v1 installed globally.
9+
Getting the project up and running was a bit hard so we defined the environment using [mise](https://github.com/jdx/mise). Mise is a tool like `nvm` or `asdf` and allows locking up both `python` and `nodejs` versions and ensures you have `yarn` installed as well.
810

9-
To get started, clone the repo and run `yarn` from the root directory:
11+
We would love to see contributions which would help updating the aging dependencies ❤️.
12+
13+
If you are using MacOS you can install mise with `homebrew`:
14+
```sh
15+
brew install mise
16+
```
17+
Otherwise please check [mise installation docs](https://mise.jdx.dev/getting-started.html).
18+
19+
Then activate mise. This depends on your shell. You can either run one of the following or copy them to your shell configs:
20+
```sh
21+
# Bash
22+
eval "$(mise activate bash)"
23+
# ZSH
24+
eval "$(mise activate zsh)"
25+
# Fish
26+
mise activate fish | source
27+
```
28+
29+
### Cloning the repo and installing packages
30+
After installing `mise` you can proceed to clone the repo and run `yarn` from the root directory:
1031

1132
```bash
1233
git clone https://github.com/NotionX/react-notion-x.git

0 commit comments

Comments
 (0)