Skip to content

Commit

Permalink
Switch to nx (#1680)
Browse files Browse the repository at this point in the history
* chore: switch from lerna to nx
* chore: ignore some more files
* chore(release): publish
* chore: fix one of the errors knip is complaining about
  • Loading branch information
johnf authored Dec 14, 2024
1 parent 2559338 commit 85a3a72
Show file tree
Hide file tree
Showing 9 changed files with 554 additions and 1,386 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,7 @@ lib/
# React Native Codegen
ios/generated
android/generated

# Nx
.nx/cache
.nx/workspace-data
3 changes: 2 additions & 1 deletion .knip.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"yo",
"eslint-config-airbnb-typescript",
"@commitlint/config-conventional",
"@evilmartians/lefthook"
"@evilmartians/lefthook",
"@nx/js"
],
"ignoreBinaries": [
"scripts/generate-fonts.sh",
Expand Down
6 changes: 6 additions & 0 deletions biome.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,19 @@
"package.json",
"packages/*/package.json",

// nx keeps this formatted
"tsconfig.json",
"packages/*/tsconfig.json",

// Generated files
"packages/*/lib",
"packages/*/glyphmaps",
"packages/generator-react-native-vector-icons/generators",
"packages/*/.fontcustom-manifest.json",
"packages/directory/src/generated",
"packages/directory/build",
"packages/icon-explorer/.owl",
".nx",

// Templates that have ejs
"packages/fontawesome-common/generators/app/templates/src/index.tsx",
Expand Down
2 changes: 1 addition & 1 deletion docs/DEVELOPMENT.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Handy reminders for developers

Things we use
* lerna - for building and releasing (all behind yarn scripts)
* nx - for building and releasing (all behind yarn scripts)

## Versioning

Expand Down
10 changes: 0 additions & 10 deletions lerna.json

This file was deleted.

34 changes: 34 additions & 0 deletions nx.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"$schema": "./node_modules/nx/schemas/nx-schema.json",
"targetDefaults": {
"clean": {
"dependsOn": ["^clean"]
},
"prepare": {
"dependsOn": ["^prepare"]
},
"prepack": {
"dependsOn": ["^prepack"]
},
"postpack": {
"dependsOn": ["^postpack"]
}
},
"defaultBase": "master",
"release": {
"projects": ["*", "!IconExplorer"],
"projectsRelationship": "independent",
"changelog": {
"projectChangelogs": {
"createRelease": "github"
}
},
"version": {
"conventionalCommits": true,
"generatorOptions": {
"NOTE": "We want auto but it's overzealous for our purposes, see https://github.com/nrwl/nx/discussions/29135",
"updateDependents": "never"
}
}
}
}
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,21 @@
],
"scripts": {
"generate": "scripts/generate-fonts.sh",
"clean": "lerna run run clean",
"prepare": "lerna run prepare",
"test": "lerna run test",
"clean": "nx run-many -t clean",
"prepare": "nx run-many -t prepare",
"test": "nx run-many -t test",
"lint:eslint": "eslint .",
"lint:biome": "biome check .",
"lint:types": "bash -c 'for i in packages/*; do if [ -f $i/tsconfig.json ]; then tsc --noEmit -p $i/tsconfig.json; fi; done'",
"lint": "yarn lint:eslint; yarn lint:biome",
"release": "lerna publish --no-private",
"prerelease": "lerna publish --no-private prerelease",
"release": "nx release",
"knip": "knip"
},
"devDependencies": {
"@biomejs/biome": "1.9.4",
"@commitlint/config-conventional": "^19.5.0",
"@evilmartians/lefthook": "^1.8.2",
"@nx/js": "^20.1.4",
"@types/eslint": "^8.56.12",
"@types/node": "^20.17.3",
"@typescript-eslint/eslint-plugin": "^8.13.0",
Expand All @@ -35,7 +35,7 @@
"eslint-plugin-react": "^7.37.2",
"eslint-plugin-react-hooks": "^5.0.0",
"knip": "^5.36.3",
"lerna": "^8.1.9",
"nx": "20.1.4",
"typescript": "^5.6.3",
"yo": "^5.0.0"
},
Expand Down
8 changes: 6 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,18 @@
"compilerOptions": {
"rootDir": ".",
"paths": {
"react-native-vector-icons": ["./src/index"]
"react-native-vector-icons": [
"./src/index"
]
},
"allowUnreachableCode": false,
"allowUnusedLabels": false,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"jsx": "react-jsx",
"lib": ["ESNext"],
"lib": [
"ESNext"
],
"module": "ESNext",
"moduleResolution": "Bundler",
"noEmit": true,
Expand Down
Loading

0 comments on commit 85a3a72

Please sign in to comment.