Skip to content

Commit c3c3dec

Browse files
authored
chore: simplify monorepo setup (#451)
* feat: support local cache for build:* commands * fixup tests * save cache after build * changeset * drop nx * fixup tests * add e2e config back * followup * build first * revert unrelated changes * filter packages
1 parent 16ab4ff commit c3c3dec

File tree

100 files changed

+514
-3105
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+514
-3105
lines changed

.changeset/rotten-taxis-vanish.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
'@rnef/platform-apple-helpers': patch
3+
'@rnef/plugin-brownfield-ios': patch
4+
'@rnef/platform-android': patch
5+
'@rnef/platform-ios': patch
6+
'@rnef/tools': patch
7+
---
8+
9+
feat: support local cache for build:\* commands

.github/actions/setup-node/action.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: Setup Node.js
2-
description: Setup Node.js, pnpm & nx
2+
description: Setup Node.js and pnpm
33

44
runs:
55
using: composite
@@ -16,5 +16,3 @@ runs:
1616

1717
- run: pnpm install --frozen-lockfile
1818
shell: bash
19-
20-
- uses: nrwl/nx-set-shas@dbe0650947e5f2c81f59190a38512cf49126fe6b # v4.3.0

.github/workflows/ci.yml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,15 @@ jobs:
2626
- name: Setup
2727
uses: ./.github/actions/setup-node
2828

29-
# Nx Affected runs only tasks affected by the changes in this PR/commit. Learn more: https://nx.dev/ci/features/affected
30-
- name: Typecheck and lint
31-
run: pnpm exec nx affected -t typecheck lint
32-
33-
- name: Run tests
34-
run: pnpm exec nx affected -t test
35-
3629
- name: Build
3730
run: pnpm build
3831

32+
- name: Lint
33+
run: pnpm lint
34+
35+
- name: Run tests
36+
run: pnpm test
37+
3938
- name: Run end-to-end tests
4039
run: |
4140
# Run in background
@@ -44,7 +43,7 @@ jobs:
4443
npx [email protected] http://localhost:4873
4544
pnpm verdaccio:publish
4645
47-
NPM_CONFIG_REGISTRY=http://localhost:4873 pnpm exec nx affected -t e2e
46+
NPM_CONFIG_REGISTRY=http://localhost:4873 pnpm e2e
4847
4948
check-changeset:
5049
name: Check Changeset

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,6 @@ testem.log
3939
.DS_Store
4040
Thumbs.db
4141

42-
.nx/cache
43-
.nx/workspace-data
44-
4542
# Local Templates
4643
*.tgz
4744
*.tar

.nxignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

.prettierignore

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
# Add files here to ignore them from prettier formatting
22
/dist
3-
/coverage
4-
/.nx/cache
5-
/.nx/workspace-data
3+
/coverage

CONTRIBUTING.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ In order to test changes to `create-app` package, you need to run the following
6464

6565
```sh
6666
# Ensure fresh build
67-
nx reset
6867
pnpm build
6968

7069
# Start local verdaccio registry (in one terminal), keep it open
@@ -123,7 +122,7 @@ When you're sending a pull request:
123122

124123
## Publishing workflow
125124

126-
This part is for maintainers only, documenting steps to manually publish the packages with Nx.
125+
This part is for maintainers only, documenting steps to manually publish the packages with Changesets.
127126

128127
### Stable version
129128

eslint.config.js

Lines changed: 17 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,24 @@
1-
import nx from '@nx/eslint-plugin';
1+
import eslint from '@eslint/js';
2+
import { globalIgnores } from 'eslint/config';
23
import simpleImportSort from 'eslint-plugin-simple-import-sort';
3-
import jsoncParser from 'jsonc-eslint-parser';
4+
import tseslint from 'typescript-eslint';
45

56
export default [
6-
...nx.configs['flat/base'],
7-
...nx.configs['flat/typescript'],
8-
...nx.configs['flat/javascript'],
7+
eslint.configs.recommended,
8+
...tseslint.configs.recommended,
9+
globalIgnores(['website/', 'templates/']),
910
{
1011
files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'],
1112
rules: {
1213
'@typescript-eslint/consistent-type-imports': 'error',
14+
'@typescript-eslint/no-explicit-any': 'warn',
1315
'@typescript-eslint/no-unused-vars': [
1416
'error',
1517
{
1618
argsIgnorePattern: '^_',
1719
caughtErrorsIgnorePattern: '^_',
1820
},
1921
],
20-
'@nx/enforce-module-boundaries': [
21-
'error',
22-
{
23-
enforceBuildableLibDependency: true,
24-
allow: ['^.*/eslint(\\.base)?\\.config\\.[cm]?js$'],
25-
depConstraints: [
26-
{
27-
sourceTag: '*',
28-
onlyDependOnLibsWithTags: ['*'],
29-
},
30-
],
31-
},
32-
],
3322
},
3423
},
3524
{
@@ -48,31 +37,23 @@ export default [
4837
{
4938
files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'],
5039
// Override or add rules here
51-
rules: {},
5240
},
5341
{
54-
files: ['**/*.test.ts', '**/__tests__/**'],
42+
files: ['scripts/**/*.mjs'],
43+
// Override or add rules here
5544
rules: {
56-
'@typescript-eslint/no-empty-function': 'off',
45+
'no-undef': 'off',
5746
},
5847
},
5948
{
60-
ignores: ['**/template/**/*.mjs', '**/dist/**', '**/__fixtures__/**'],
61-
},
62-
{
63-
files: ['**/*.json'],
49+
files: ['**/*.test.ts', '**/__tests__/**', '**/metro.config.js', '**/vite.e2e.config.js'],
6450
rules: {
65-
'@nx/dependency-checks': [
66-
'warn',
67-
{
68-
ignoredFiles: ['{projectRoot}/eslint.config.{js,cjs,mjs}'],
69-
// TODO: @nx/dependency-checks incorrectly reports unused dependencies
70-
checkObsoleteDependencies: false,
71-
},
72-
],
73-
},
74-
languageOptions: {
75-
parser: jsoncParser,
51+
'@typescript-eslint/no-empty-function': 'off',
52+
'@typescript-eslint/no-require-imports': 'off',
53+
'no-undef': 'off',
7654
},
7755
},
56+
{
57+
ignores: ['**/template/**/*.mjs', '**/dist/**', '**/__fixtures__/**'],
58+
},
7859
];

nx.json

Lines changed: 0 additions & 60 deletions
This file was deleted.

package.json

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@
44
"license": "MIT",
55
"type": "module",
66
"scripts": {
7-
"build": "nx run-many --target build",
8-
"test": "nx run-many --target test",
9-
"e2e": "nx run-many --target e2e",
10-
"lint": "nx run-many --target lint",
11-
"typecheck": "nx run-many --target typecheck",
12-
"watch": "nx watch --all -- nx run \\$NX_PROJECT_NAME:build",
7+
"build": "pnpm -r run build",
8+
"test": "vitest run",
9+
"e2e": "pnpm -r run e2e",
10+
"lint": "eslint .",
11+
"typecheck": "tsc --noEmit",
12+
"watch": "pnpm --filter='./packages/**' -r --parallel --stream run dev",
13+
"dev": "pnpm --filter='./packages/**' -r --parallel --stream run dev",
1314
"validate": "pnpm typecheck && pnpm lint && pnpm test",
1415
"link-packages": "node ./scripts/linkPackages.mjs",
1516
"version": "changeset version && ./scripts/update-template-dependencies.sh && pnpm install --no-frozen-lockfile",
@@ -27,11 +28,6 @@
2728
"@changesets/cli": "^2.27.12",
2829
"@clack/prompts": "^0.10.0",
2930
"@eslint/js": "^9.8.0",
30-
"@nx/eslint": "21.2.1",
31-
"@nx/eslint-plugin": "21.2.1",
32-
"@nx/js": "21.2.1",
33-
"@nx/vite": "21.2.1",
34-
"@nx/web": "21.2.1",
3531
"@swc-node/register": "~1.9.1",
3632
"@swc/core": "~1.5.7",
3733
"@swc/helpers": "~0.5.11",
@@ -41,13 +37,11 @@
4137
"@typescript-eslint/utils": "^8.13.0",
4238
"@vitest/coverage-v8": "^2.1.2",
4339
"@vitest/ui": "^2.1.2",
44-
"eslint": "^9.8.0",
40+
"eslint": "^9.31.0",
4541
"eslint-config-prettier": "^9.0.0",
4642
"eslint-plugin-simple-import-sort": "^12.1.1",
4743
"fast-glob": "^3.3.2",
48-
"jsonc-eslint-parser": "^2.4.0",
4944
"nano-spawn": "^0.2.0",
50-
"nx": "21.2.1",
5145
"prettier": "^2.6.2",
5246
"ts-node": "10.9.1",
5347
"typescript": "5.6.3",
@@ -56,8 +50,5 @@
5650
"vite": "^5.0.0",
5751
"vitest": "^2.1.2"
5852
},
59-
"nx": {
60-
"includedScripts": []
61-
},
6253
"packageManager": "[email protected]"
6354
}

0 commit comments

Comments
 (0)