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

.github/actions/setup/action.yml

Lines changed: 0 additions & 6 deletions
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

.github/workflows/ci.yml

Lines changed: 19 additions & 3 deletions
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

.github/workflows/fix.yml

Lines changed: 0 additions & 1 deletion
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:

.github/workflows/release.yml

Lines changed: 3 additions & 1 deletion
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:

.gitignore

Lines changed: 0 additions & 3 deletions
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

.prettierignore

Lines changed: 1 addition & 4 deletions
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

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
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

dev/package.json

Lines changed: 0 additions & 18 deletions
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
}

e2e/package.json

Lines changed: 0 additions & 22 deletions
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
}

e2e/playwright.config.ts

Lines changed: 1 addition & 1 deletion
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
},

0 commit comments

Comments
 (0)