Skip to content

Commit 4e3bd6c

Browse files
committed
Add nx with project specific configs
1 parent 520cba1 commit 4e3bd6c

File tree

14 files changed

+8924
-1609
lines changed

14 files changed

+8924
-1609
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: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"$schema": "./node_modules/nx/schemas/nx-schema.json",
3+
"targetDefaults": {},
4+
"plugins": [
5+
{
6+
"plugin": "@nx/eslint/plugin",
7+
"options": {
8+
"targetName": "lint"
9+
}
10+
},
11+
{
12+
"plugin": "@nx/react-native/plugin",
13+
"options": {
14+
"startTargetName": "react-native:start",
15+
"upgradeTargetName": "update",
16+
"bundleTargetName": "bundle",
17+
"podInstallTargetName": "react-native:pod-install",
18+
"runIosTargetName": "run-ios",
19+
"runAndroidTargetName": "run-android",
20+
"buildIosTargetName": "build-ios",
21+
"buildAndroidTargetName": "build-android",
22+
"syncDepsTargetName": "sync-deps"
23+
}
24+
}
25+
],
26+
"tui": {
27+
"autoExit": true
28+
}
29+
}

package-lock.json

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

package.json

Lines changed: 6 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",
@@ -28,14 +28,17 @@
2828
"license": "MIT",
2929
"devDependencies": {
3030
"@eslint/js": "^9.19.0",
31+
"@nx/eslint": "21.1.3",
32+
"@nx/react-native": "21.1.3",
3133
"@tsconfig/node22": "^22.0.0",
3234
"@tsconfig/react-native": "3.0.5",
3335
"@types/node": "^22.13.0",
3436
"eslint": "^9.19.0",
3537
"globals": "^16.0.0",
38+
"nx": "21.1.3",
3639
"react-native": "0.79.1",
40+
"tsx": "^4.19.3",
3741
"typescript": "^5.7.3",
38-
"typescript-eslint": "^8.22.0",
39-
"tsx": "^4.19.3"
42+
"typescript-eslint": "^8.22.0"
4043
}
4144
}

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)