Skip to content

Commit 861079d

Browse files
committed
Add nx with project specific configs
1 parent 4afef09 commit 861079d

File tree

14 files changed

+1010
-270
lines changed

14 files changed

+1010
-270
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,6 @@ node_modules/
44
dist/
55

66
*.tsbuildinfo
7+
8+
# NX
9+
.nx/

nx.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"$schema": "./node_modules/nx/schemas/nx-schema.json",
3+
"targetDefaults": {},
4+
"tui": {
5+
"autoExit": true
6+
}
7+
}

package-lock.json

Lines changed: 868 additions & 262 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"clean": "tsc --build --clean",
1414
"dev": "tsc --build --watch",
1515
"lint": "eslint .",
16-
"test": "npm run test --workspace react-native-node-api --workspace cmake-rn --workspace gyp-to-cmake --workspace node-addon-examples"
16+
"test": "nx run-many -t test"
1717
},
1818
"author": {
1919
"name": "Callstack",
@@ -34,9 +34,10 @@
3434
"@types/node": "^22.13.0",
3535
"eslint": "^9.19.0",
3636
"globals": "^16.0.0",
37+
"nx": "21.1.3",
3738
"react-native": "0.79.1",
39+
"tsx": "^4.19.3",
3840
"typescript": "^5.7.3",
39-
"typescript-eslint": "^8.22.0",
40-
"tsx": "^4.19.3"
41+
"typescript-eslint": "^8.22.0"
4142
}
4243
}

packages/cmake-rn/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
"chalk": "^5.4.1",
2828
"cmake-js": "^7.3.1",
2929
"commander": "^13.1.0",
30+
"react-native-node-api": "0.1.0",
3031
"ora": "^8.2.0"
3132
},
3233
"peerDependencies": {

packages/cmake-rn/project.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"$schema": "../../node_modules/nx/schemas/project-schema.json",
3+
"targets": {
4+
"build": {
5+
"dependsOn": ["react-native-node-api:build"],
6+
"outputs": ["{projectRoot}/dist"],
7+
"cache": true
8+
}
9+
}
10+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"$schema": "../../node_modules/nx/schemas/project-schema.json",
3+
"targets": {
4+
"build": {
5+
"inputs": [
6+
"{projectRoot}/build.rs",
7+
"{projectRoot}/Cargo.toml",
8+
"{projectRoot}/src/**"
9+
],
10+
"outputs": ["{projectRoot}/target", "{projectRoot}/*.node"],
11+
"cache": true
12+
}
13+
}
14+
}

packages/ferric/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,11 @@
1313
"ferric": "./bin/ferric.js"
1414
},
1515
"scripts": {
16+
"build": "tsc",
1617
"start": "tsx src/run.ts"
1718
},
1819
"dependencies": {
19-
"@napi-rs/cli": "3.0.0-alpha.80",
20+
"@napi-rs/cli": "3.0.0-alpha.88",
2021
"@commander-js/extra-typings": "^13.1.0",
2122
"bufout": "^0.3.1",
2223
"chalk": "^5.4.1",

packages/ferric/project.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"$schema": "../../node_modules/nx/schemas/project-schema.json",
3+
"targets": {
4+
"build": {
5+
"inputs": ["{projectRoot}/src"],
6+
"outputs": ["{projectRoot}/dist", "{projectRoot}/*.tsbuildinfo"],
7+
"cache": true
8+
}
9+
}
10+
}

packages/gyp-to-cmake/project.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"$schema": "../../node_modules/nx/schemas/project-schema.json",
3+
"targets": {
4+
"build": {
5+
"inputs": ["{projectRoot}/src"],
6+
"outputs": ["{projectRoot}/dist", "{projectRoot}/*.tsbuildinfo"],
7+
"cache": true
8+
}
9+
}
10+
}

0 commit comments

Comments
 (0)