Skip to content

Commit ef79da2

Browse files
authored
chore: remove nx (#1794)
* chore: remove nx * chore: fix * chore: fix deps * chore: fix deps * fix: dont run build on every setup action * fix: prettier * chore: fix * chore: add build in summary
1 parent c44c516 commit ef79da2

File tree

43 files changed

+392
-3372
lines changed

Some content is hidden

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

43 files changed

+392
-3372
lines changed

Diff for: .github/actions/setup/action.yml

-6
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,3 @@ runs:
2424
- name: Install
2525
run: pnpm install
2626
shell: bash
27-
28-
- uses: nrwl/nx-set-shas@v4
29-
30-
- name: Build packages
31-
run: pnpm build:nx
32-
shell: bash

Diff for: .github/workflows/ci.yml

+19-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ concurrency:
1313

1414
env:
1515
CI: true
16-
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
1716

1817
jobs:
1918
install-deps:
@@ -54,6 +53,20 @@ jobs:
5453
- name: Run unit tests
5554
run: pnpm test:unit
5655

56+
build:
57+
runs-on: ubuntu-latest
58+
needs: install-deps
59+
steps:
60+
- name: Checkout code repository
61+
uses: actions/checkout@v4
62+
with:
63+
fetch-depth: 0
64+
65+
- uses: ./.github/actions/setup
66+
67+
- name: Build packages
68+
run: pnpm build
69+
5770
e2e:
5871
runs-on: ubuntu-latest
5972
needs: install-deps
@@ -69,6 +82,9 @@ jobs:
6982

7083
- uses: ./.github/actions/setup
7184

85+
- name: Build e2e
86+
run: pnpm --filter=@milkdown/e2e run build
87+
7288
- name: Install browsers
7389
run: pnpm --filter=@milkdown/e2e test:install
7490

@@ -85,9 +101,9 @@ jobs:
85101

86102
summary:
87103
if: ${{ always() }}
88-
needs: [lint, unit, e2e]
104+
needs: [lint, unit, e2e, build]
89105
runs-on: ubuntu-latest
90106
steps:
91107
- name: On error
92-
if: ${{ needs.e2e.result != 'success' || needs.unit.result != 'success' || needs.lint.result != 'success' }}
108+
if: ${{ always() && (contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')) }}
93109
run: exit 1

Diff for: .github/workflows/fix.yml

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ permissions:
1010

1111
env:
1212
CI: true
13-
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
1413

1514
jobs:
1615
fix:

Diff for: .github/workflows/release.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ concurrency: ${{ github.workflow }}-${{ github.ref }}
88

99
env:
1010
CI: true
11-
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
1211

1312
jobs:
1413
prepare:
@@ -39,6 +38,9 @@ jobs:
3938

4039
- uses: ./.github/actions/setup
4140

41+
- name: Build packages
42+
run: pnpm build
43+
4244
- name: Publish to NPM
4345
run: pnpm ci:publish
4446
env:

Diff for: .gitignore

-3
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,9 @@ e2e/cypress/downloads
1919
sitemap.xml
2020

2121
.env
22-
nx-cloud.env
2322
*.local
2423
*.cache
2524
*error.log
2625
*debug.log
2726

28-
.nx
29-
3027
storybook-static

Diff for: .prettierignore

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
pnpm-lock.yaml
2-
3-
/.nx/cache
4-
/.nx/workspace-data
1+
pnpm-lock.yaml

Diff for: CONTRIBUTING.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
66
After cloning Milkdown, run `pnpm install` to install dependencies.
77

8-
1. Run `pnpm build:nx`.
8+
1. Run `pnpm build`.
99
2. Run `pnpm start` in one terminal to see storybook.
1010

1111
# Commands
@@ -18,7 +18,7 @@ You can run several commands:
1818
- `pnpm test:e2e:debug` runs e2e test with UI.
1919
- `pnpm test:lint` checks the code style.
2020
- `pnpm test:tsc` runs typescript type checks.
21-
- `pnpm build:nx` runs build for all packages with cache powered by nx.
21+
- `pnpm build` runs build for all packages.
2222
- `pnpm commit` runs commit with git hooks.
2323

2424
# Pre Check

Diff for: dev/package.json

-18
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,5 @@
1414
},
1515
"scripts": {
1616
"build": "rimraf './lib' && tsc"
17-
},
18-
"nx": {
19-
"targets": {
20-
"build": {
21-
"outputs": [
22-
"{projectRoot}/lib"
23-
],
24-
"dependsOn": [
25-
"build"
26-
]
27-
},
28-
"tsc": {
29-
"outputs": [],
30-
"dependsOn": [
31-
"build"
32-
]
33-
}
34-
}
3517
}
3618
}

Diff for: e2e/package.json

-22
Original file line numberDiff line numberDiff line change
@@ -37,27 +37,5 @@
3737
"katex": "^0.16.0",
3838
"serve": "^14.2.3",
3939
"tslib": "^2.8.1"
40-
},
41-
"nx": {
42-
"targets": {
43-
"build": {
44-
"outputs": [
45-
"{projectRoot}/lib"
46-
],
47-
"dependsOn": [
48-
"build"
49-
]
50-
},
51-
"preview": {
52-
"dependsOn": [
53-
"build"
54-
]
55-
},
56-
"serve": {
57-
"dependsOn": [
58-
"build"
59-
]
60-
}
61-
}
6240
}
6341
}

Diff for: e2e/playwright.config.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export default defineConfig({
5858

5959
/* Run your local dev server before starting the tests */
6060
webServer: {
61-
command: process.env.CI ? 'pnpm run serve' : 'pnpm run start -- --host',
61+
command: process.env.CI ? 'pnpm run serve' : 'pnpm run start --host',
6262
url: process.env.CI ? 'http://127.0.0.1:4173' : 'http://localhost:5173',
6363
reuseExistingServer: !process.env.CI,
6464
},

Diff for: nx.json

-32
This file was deleted.

Diff for: package.json

+1-27
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,15 @@
1111
"test:unit": "vitest run",
1212
"test:unit:watch": "vitest",
1313
"test:tsc": "pnpm --filter=@milkdown/* run tsc",
14-
"test:tsc:cache": "nx run-many --target=tsc --all --parallel",
1514
"test:lint": "oxlint -c .oxlintrc.json",
1615
"test:e2e": "pnpm --filter=@milkdown/e2e test",
1716
"test:e2e:build": "pnpm --filter=@milkdown/e2e run build",
1817
"format": "lint-staged",
1918
"fix": "prettier . --write",
2019
"start": "pnpm --filter=@milkdown/storybook run start",
21-
"build:nx": "nx run-many --target=build --all --parallel",
22-
"build:affected": "nx affected --target=build",
23-
"build:packs": "pnpm --filter=@milkdown/* run build",
20+
"build": "pnpm -r run build",
2421
"ci:version": "changeset version && pnpm install --no-frozen-lockfile",
2522
"ci:publish": "pnpm build:packs && pnpm publish --access public -r --no-git-checks --tag latest",
26-
"graph": "nx dep-graph",
2723
"clear": "rimraf 'packages/*/{lib,tsconfig.tsbuildinfo,node_modules,.rollup.cache}' && rimraf node_modules",
2824
"changeset": "changeset && node scripts/changelog.mjs",
2925
"release": "changeset publish",
@@ -36,9 +32,6 @@
3632
"@commitlint/cli": "^19.0.0",
3733
"@commitlint/config-conventional": "^19.0.0",
3834
"@milkdown/dev": "workspace:*",
39-
"@nrwl/tao": "19.8.4",
40-
"@nx/web": "20.7.2",
41-
"@nx/workspace": "20.7.2",
4235
"@rollup/plugin-commonjs": "^28.0.0",
4336
"@rollup/plugin-json": "^6.0.0",
4437
"@rollup/plugin-node-resolve": "^16.0.0",
@@ -61,7 +54,6 @@
6154
"husky": "^9.0.10",
6255
"jsdom": "^26.0.0",
6356
"lint-staged": "^15.0.0",
64-
"nx": "20.7.2",
6557
"oxlint": "^0.16.3",
6658
"pathe": "^2.0.0",
6759
"postcss": "^8.4.38",
@@ -129,23 +121,5 @@
129121
"safe-buffer": "npm:@nolyfill/safe-buffer@^1",
130122
"safer-buffer": "npm:@nolyfill/safer-buffer@^1"
131123
}
132-
},
133-
"nx": {
134-
"targets": {
135-
"build": {
136-
"outputs": [
137-
"{projectRoot}/lib"
138-
],
139-
"dependsOn": [
140-
"build"
141-
]
142-
},
143-
"tsc": {
144-
"outputs": [],
145-
"dependsOn": [
146-
"build"
147-
]
148-
}
149-
}
150124
}
151125
}

Diff for: packages/components/package.json

+10-36
Original file line numberDiff line numberDiff line change
@@ -105,17 +105,17 @@
105105
"peerDependencies": {
106106
"@codemirror/language": "^6",
107107
"@codemirror/state": "^6",
108-
"@codemirror/view": "^6",
109-
"@milkdown/core": "^7.2.0",
110-
"@milkdown/ctx": "^7.2.0",
111-
"@milkdown/plugin-tooltip": "^7.2.0",
112-
"@milkdown/preset-commonmark": "^7.2.0",
113-
"@milkdown/preset-gfm": "^7.2.0",
114-
"@milkdown/prose": "^7.2.0",
115-
"@milkdown/transformer": "^7.2.0",
116-
"@milkdown/utils": "^7.2.0"
108+
"@codemirror/view": "^6"
117109
},
118110
"dependencies": {
111+
"@milkdown/core": "workspace:*",
112+
"@milkdown/ctx": "workspace:*",
113+
"@milkdown/plugin-tooltip": "workspace:*",
114+
"@milkdown/preset-commonmark": "workspace:*",
115+
"@milkdown/preset-gfm": "workspace:*",
116+
"@milkdown/prose": "workspace:*",
117+
"@milkdown/transformer": "workspace:*",
118+
"@milkdown/utils": "workspace:*",
119119
"@atomico/hooks": "^4.1.2",
120120
"@floating-ui/dom": "^1.5.1",
121121
"@milkdown/exception": "workspace:*",
@@ -132,32 +132,6 @@
132132
"devDependencies": {
133133
"@codemirror/language": "^6.10.1",
134134
"@codemirror/state": "^6.4.1",
135-
"@codemirror/view": "^6.26.0",
136-
"@milkdown/core": "workspace:*",
137-
"@milkdown/ctx": "workspace:*",
138-
"@milkdown/plugin-tooltip": "workspace:*",
139-
"@milkdown/preset-commonmark": "workspace:*",
140-
"@milkdown/preset-gfm": "workspace:*",
141-
"@milkdown/prose": "workspace:*",
142-
"@milkdown/transformer": "workspace:*",
143-
"@milkdown/utils": "workspace:*"
144-
},
145-
"nx": {
146-
"targets": {
147-
"build": {
148-
"outputs": [
149-
"{projectRoot}/lib"
150-
],
151-
"dependsOn": [
152-
"build"
153-
]
154-
},
155-
"tsc": {
156-
"outputs": [],
157-
"dependsOn": [
158-
"build"
159-
]
160-
}
161-
}
135+
"@codemirror/view": "^6.26.0"
162136
}
163137
}

Diff for: packages/core/package.json

+3-28
Original file line numberDiff line numberDiff line change
@@ -43,39 +43,14 @@
4343
"tsc": "tsc --noEmit && echo",
4444
"build": "rimraf './lib' && tsc --emitDeclarationOnly && vite build"
4545
},
46-
"peerDependencies": {
47-
"@milkdown/ctx": "^7.2.0",
48-
"@milkdown/prose": "^7.2.0",
49-
"@milkdown/transformer": "^7.2.0"
50-
},
5146
"dependencies": {
47+
"@milkdown/ctx": "workspace:*",
48+
"@milkdown/prose": "workspace:*",
49+
"@milkdown/transformer": "workspace:*",
5250
"@milkdown/exception": "workspace:*",
5351
"remark-parse": "^11.0.0",
5452
"remark-stringify": "^11.0.0",
5553
"tslib": "^2.8.1",
5654
"unified": "^11.0.3"
57-
},
58-
"devDependencies": {
59-
"@milkdown/ctx": "workspace:*",
60-
"@milkdown/prose": "workspace:*",
61-
"@milkdown/transformer": "workspace:*"
62-
},
63-
"nx": {
64-
"targets": {
65-
"build": {
66-
"outputs": [
67-
"{projectRoot}/lib"
68-
],
69-
"dependsOn": [
70-
"build"
71-
]
72-
},
73-
"tsc": {
74-
"outputs": [],
75-
"dependsOn": [
76-
"build"
77-
]
78-
}
79-
}
8055
}
8156
}

0 commit comments

Comments
 (0)