Skip to content
This repository was archived by the owner on Dec 31, 2025. It is now read-only.

Commit 26fc81c

Browse files
committed
chore: update readme
1 parent 2e0af3c commit 26fc81c

File tree

1 file changed

+22
-59
lines changed

1 file changed

+22
-59
lines changed

README.md

Lines changed: 22 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ Forked from [`samp-node`](https://github.com/AmyrAhmady/samp-node)
44

55
## Changes in this fork
66

7-
- Used to work with [infernus](https://github.com/dockfries/infernus).
8-
- Update `Node.js` to **v22.17.0**.
7+
- Only can work with [infernus](https://github.com/dockfries/infernus).
8+
- Update `Node.js` to **v22.22.0**.
9+
- Both `ESModule` and `CommonJS` supported, depending on the type field of package.json and the bundler output format.
910
- Only `entry_file` is used, `resource` config are removed.
1011
- Removed `samp.fire` to avoid crashes.
1112
- Updated github workflows.
@@ -43,105 +44,67 @@ for powershell
4344

4445
### NodeHeaders
4546

46-
> example v20.x
47+
> example v22.x
4748
48-
[download here](https://nodejs.org/download/release/latest-v20.x/).
49+
[download here](https://nodejs.org/download/release/latest-v22.x/).
4950

5051
0. delete everything under `deps/node/include`.
51-
1. download `node-v20.19.3-headers.tar.gz`.
52-
2. decompress and copy everything under `node/v20.19.3/include/node` to `deps/node/include`.
52+
1. download `node-v22.20.0-headers.tar.gz`.
53+
2. decompress and copy everything under `node/v22.20.0/include/node` to `deps/node/include`.
5354

54-
### Windows20
55+
### Windows v22
5556

5657
```sh
57-
git clone https://github.com/nodejs/node.git -b v20.x --depth 1
58+
git clone https://github.com/nodejs/node.git -b v22.x --depth 1
5859
cd node
5960
.\vcbuild x86 dll openssl-no-asm
6061
cd out/Release # so you can get the libnode.dll & libnode.lib, windows need this two files.
6162
```
6263

63-
### Linux20
64+
### Linux v22
6465

6566
1. You need to install docker first.
6667
2. Create a normal user and set up home directories and passwd.
6768
3. Add this user to the docker group.
6869
1. `sudo usermod -aG docker YOUR_NORMAL_USERNAME`
6970

70-
> We use [unofficial-builds](https://github.com/nodejs/unofficial-builds) build x86, which build symbols without the c++11_ABI, see `CMakeLists.txt` line 54.
71-
7271
```sh
7372
su YOUR_NORMAL_USERNAME
7473
/bin/bash
7574

7675
rm -fr ~/Devel/unofficial-builds-home
7776
mkdir -p ~/Devel/unofficial-builds-home
7877
cd ~/Devel/unofficial-builds-home
79-
git clone https://github.com/nodejs/unofficial-builds
78+
79+
git clone https://github.com/dockfries/unofficial-builds
80+
cd ~/Devel/unofficial-builds-home/unofficial-builds/recipes/x86_22/
81+
chmod +x ./run.sh
82+
chmod +x ./should-build.sh
8083

8184
cd ~/Devel/unofficial-builds-home/unofficial-builds
82-
vim ./recipes/x86/run.sh
83-
# before: config_flags=--openssl-no-asm
84-
# after: config_flags="--openssl-no-asm --shared"
8585

86-
bin/local_build.sh -r x86 -v v20.19.3 # for example 20.19.3, don't forget startWith 'v'
86+
bin/local_build.sh -r x86 -v v22.20.0 # don't forget startWith 'v'
8787

88-
cp ~/Devel/unofficial-builds-home/staging/release/v20.19.3/node-v20.19.3-linux-x86.tar.gz /tmp
88+
cp ~/Devel/unofficial-builds-home/staging/release/v22.20.0/node-v22.20.0-linux-x86.tar.gz /tmp
8989

9090
su YOUR_SUDO_USER
91-
mv /tmp/node-v20.19.3-linux-x86.tar.gz ~
91+
mv /tmp/node-v22.20.0-linux-x86.tar.gz ~
9292
# use anything like shell/sftp download this file
9393
# decompress it, you can see libnode.so.xxx in lib folder, that's what you need only.
94+
# For version 22, `.so` files end with `127`
9495
```
9596

9697
after that, for local build samp-node, pls put your libnode into `deps/node/lib/Release/win` and `deps/node/lib/Release/linux` respectively.
9798

9899
for build samp-node, see `.github/workflows/build.yml`.
99100

100-
### Windows22
101-
102-
Please refer to the previous version, but there are some differences.
103-
104-
1. Download Node.js headers and place them in `deps/node/include` directory. Then locate `v8-typed-array.h` and add `#undef max` before:
105-
106-
```cpp
107-
#undef max
108-
static constexpr size_t kMaxByteLength = std::numeric_limits<int>::max();
109-
```
110-
111-
2. Find `deps/v8/src/compiler/backend/ia32/instruction-selector-ia32.cc` in Node.js source code and replace globally:
112-
113-
```cpp
114-
using node_t = Adapter::node_t
115-
```
116-
117-
with:
118-
119-
```cpp
120-
using node_t = typename Adapter::node_t
121-
```
122-
123-
3. compilation as before.
124-
125-
### Linux22
126-
127-
1. Clone from [our forked unofficial repository](https://github.com/dockfries/unofficial-builds) (not the original one), then follow similar steps as above.
128-
129-
2. Execute:
130-
131-
```bash
132-
bin/local_build.sh -r x86_22 -v v22.17.0
133-
```
134-
135-
> Note: Use `x86_22` instead of `x86` for `-r` parameter
136-
> For version 22, `.so` files end with `127`
137-
138101
## Credits
139102

140-
- [Damo](https://github.com/damopewpew) for his [samp.js project](https://github.com/damopewpew/samp.js). 80% of native caller code is from that project, cause I didn't want to do all the args processing by myself when there's already something useful out there!
141-
- [Hual](https://github.com/Hual/) for some v8 tips he gave me
103+
- [Damo](https://github.com/damopewpew) for his [samp.js project](https://github.com/damopewpew/samp.js).
104+
- [Hual](https://github.com/Hual/) for some v8 tips
142105
- [Graber](https://github.com/AGraber) for a few suggestions and helpful advices
143106
- [pkfln (peek)](https://github.com/pkfln) for fixing and adding some samp callbacks/events in samp-node, and making [@sa-mp/node](https://github.com/samp-dev/node)
144107
- [polygxn](https://github.com/polygxn) for his changes in README.md which don't exist anymore
145108
- [JustMichael (ADRFranklin)](https://github.com/ADRFranklin) for his contributions, including fixes, features, and any others he's going to do in future
146109
- [Alexander Plutalov (plutalov)](https://github.com/plutalov) for fixing long time crash issues and not having context running properly
147-
- [iAmir (AmyrAhmady)](https://github.com/AmyrAhmady)
110+
- [iAmir (AmyrAhmady)](https://github.com/AmyrAhmady) samp-node and omp-node developer

0 commit comments

Comments
 (0)