Skip to content

Commit 3407c73

Browse files
authored
Merge branch 'main' into agent-markdown
2 parents b18b51c + ec9c151 commit 3407c73

599 files changed

Lines changed: 5307 additions & 17028 deletions

File tree

Some content is hidden

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

.dockerignore

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Keep the e2e image build context lean and Linux-clean: never copy host
2+
# (macOS) node_modules or build outputs — deps are installed fresh inside the
3+
# image. What actually lands in the image is selected explicitly by the COPY
4+
# steps in tests/Dockerfile (manifests + example apps), not by exclusions here;
5+
# these entries just stop the heavy/irrelevant trees from bloating the context.
6+
**/node_modules
7+
**/dist
8+
**/types
9+
**/.vite
10+
**/.vite-plus
11+
**/*.tsbuildinfo
12+
**/.DS_Store
13+
.git
14+
**/test-results
15+
**/blob-report
16+
**/playwright-report
17+
tests/.vitest-attachments

.github/workflows/build.yml

Lines changed: 87 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
runs-on: ubuntu-latest
1919
timeout-minutes: 60
2020
steps:
21-
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
21+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
2222
with:
2323
fetch-depth: 100
2424
persist-credentials: false
@@ -54,51 +54,26 @@ jobs:
5454
id: soft-release
5555
run: vp dlx pkg-pr-new publish './packages/*' # TODO disabled only for AI branch--compact
5656

57-
playwright-build:
58-
name: "Playwright Build"
57+
e2e:
58+
# Vitest Browser Mode runs in the Playwright Linux container — the same
59+
# environment as the local Docker run — so behaviour matches local dev.
60+
# The suite resolves every `@blocknote/*` import to its `src/` via the
61+
# aliases in `tests/vite.config.browser.ts` (vite transpiles the package
62+
# sources on the fly), so the packages do NOT need to be built to `dist`
63+
# first — `vp install` + the checked-out sources are enough.
64+
name: "E2E - ${{ matrix.browser }} (${{ matrix.shardIndex }}/${{ matrix.shardTotal }})"
5965
runs-on: ubuntu-latest
6066
timeout-minutes: 30
61-
steps:
62-
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
63-
with:
64-
fetch-depth: 100
65-
persist-credentials: false
66-
67-
- uses: voidzero-dev/setup-vp@2dec1e33f4ab2c6d5bce1b0c4607961bb1a3f7a1 # v1
68-
with:
69-
node-version-file: ".node-version"
70-
cache: true
71-
72-
- name: Install dependencies
73-
run: vp install
74-
75-
- name: Build packages
76-
run: vp run -r build
77-
78-
- name: Upload build artifacts
79-
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
80-
with:
81-
name: playwright-build
82-
path: |
83-
packages/*/dist
84-
playground/dist
85-
retention-days: 1
86-
87-
playwright:
88-
name: "Playwright Tests - ${{ matrix.browser }} (${{ matrix.shardIndex }}/${{ matrix.shardTotal }})"
89-
runs-on: ubuntu-latest
90-
needs: playwright-build
91-
timeout-minutes: 30
9267
container:
93-
image: mcr.microsoft.com/playwright:v1.51.1-noble
68+
image: mcr.microsoft.com/playwright:v1.60.0-noble
9469
strategy:
9570
fail-fast: false
9671
matrix:
9772
browser: [chromium, firefox, webkit]
9873
shardIndex: [1, 2]
9974
shardTotal: [2]
10075
steps:
101-
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
76+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
10277
with:
10378
fetch-depth: 100
10479
persist-credentials: false
@@ -108,44 +83,53 @@ jobs:
10883
node-version-file: ".node-version"
10984
cache: true
11085

111-
- name: Download build artifacts
112-
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
113-
with:
114-
name: playwright-build
115-
11686
- name: Install dependencies
11787
run: vp install
11888

119-
- name: Run server and Playwright tests
120-
run: |
121-
HOME=/root vp exec concurrently --success=first -r --kill-others \
122-
"vp run --filter @blocknote/example-editor preview" \
123-
"wait-on http://localhost:3000 && cd tests && vp exec playwright test --project ${{ matrix.browser }} --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }}"
89+
# No preview server: Vitest Browser Mode serves the tests + mounted example
90+
# apps itself. `--browser` selects this matrix job's browser and
91+
# `--shard=<index>/<total>` splits that browser's test files across two
92+
# parallel machines. Each shard records a machine-readable `blob` report
93+
# (named per browser+shard so they don't collide); the `merge-reports` job
94+
# stitches every browser's shards into one HTML report afterwards.
95+
- name: Run e2e tests (${{ matrix.browser }} ${{ matrix.shardIndex }}/${{ matrix.shardTotal }})
96+
run: HOME=/root vp test -c vite.config.browser.ts --run --browser ${{ matrix.browser }} --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }} --reporter=default --reporter=blob --outputFile.blob=blob-report/blob-${{ matrix.browser }}-${{ matrix.shardIndex }}.json
97+
working-directory: tests
12498

125-
- name: Upload blob report
99+
- name: Upload blob report (${{ matrix.browser }} ${{ matrix.shardIndex }}/${{ matrix.shardTotal }})
126100
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
127101
if: ${{ !cancelled() }}
128102
with:
129103
name: blob-report-${{ matrix.browser }}-${{ matrix.shardIndex }}
130104
path: tests/blob-report/
131105
retention-days: 1
132106

133-
- name: Upload HTML report
107+
- name: Upload failure artifacts
134108
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
135-
if: ${{ !cancelled() }}
109+
if: ${{ failure() }}
136110
with:
137-
name: playwright-report-${{ matrix.browser }}-${{ matrix.shardIndex }}
138-
path: tests/playwright-report/
139-
retention-days: 30
111+
name: e2e-attachments-${{ matrix.browser }}-${{ matrix.shardIndex }}
112+
path: tests/.vitest-attachments/
113+
retention-days: 7
140114

141115
merge-reports:
142-
name: "Merge Playwright Reports"
143-
if: ${{ !cancelled() }}
144-
needs: playwright
116+
# Stitch every browser+shard blob report into a single navigable HTML
117+
# report (the Vitest equivalent of `playwright merge-reports`). Runs even
118+
# when a shard failed, so the report always covers every browser.
119+
name: "E2E Report"
145120
runs-on: ubuntu-latest
121+
needs: e2e
122+
if: ${{ !cancelled() }}
123+
timeout-minutes: 15
124+
# Same container as the e2e shards: `--mergeReports` doesn't run tests or
125+
# launch browsers, but the HTML reporter still resolves the test files'
126+
# browser environment, so the browser config must stay enabled (and present).
127+
container:
128+
image: mcr.microsoft.com/playwright:v1.60.0-noble
146129
steps:
147-
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
130+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
148131
with:
132+
fetch-depth: 100
149133
persist-credentials: false
150134

151135
- uses: voidzero-dev/setup-vp@2dec1e33f4ab2c6d5bce1b0c4607961bb1a3f7a1 # v1
@@ -156,20 +140,62 @@ jobs:
156140
- name: Install dependencies
157141
run: vp install
158142

143+
# Gather every shard's blob into one directory (blob-report-chromium-1, …).
159144
- name: Download blob reports
160145
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
161146
with:
162-
path: tests/all-blob-reports
147+
path: tests/blob-report
163148
pattern: blob-report-*
164149
merge-multiple: true
165150

166-
- name: Merge reports
167-
run: vp exec playwright merge-reports --reporter html ./all-blob-reports
151+
# Re-emit a single HTML report from the merged blobs (no tests are run).
152+
- name: Merge into HTML report
153+
run: HOME=/root vp test -c vite.config.browser.ts --mergeReports=blob-report --reporter=html
168154
working-directory: tests
169155

170156
- name: Upload merged HTML report
171157
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
158+
if: ${{ !cancelled() }}
172159
with:
173-
name: playwright-report-merged
160+
name: e2e-report
174161
path: tests/playwright-report/
175-
retention-days: 30
162+
retention-days: 7
163+
164+
deploy-report:
165+
# Publish the merged report to a GitHub Pages PR preview and comment the
166+
# link on the PR (Vercel-style). Pages serves it over HTTP, so the report's
167+
# data loads correctly — unlike opening the downloaded artifact over file://
168+
# (the @vitest/ui report fetches its data and is blocked by CORS there).
169+
#
170+
# Default `needs` semantics: this runs only when `merge-reports` succeeded
171+
# (i.e. a report exists) — but regardless of whether the tests passed, so a
172+
# red run still gets a navigable preview. Skipped for fork PRs, whose
173+
# read-only token can't push to gh-pages or comment (they keep the artifact).
174+
name: "E2E Report Preview"
175+
runs-on: ubuntu-latest
176+
needs: merge-reports
177+
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository }}
178+
permissions:
179+
contents: write
180+
pull-requests: write
181+
steps:
182+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
183+
with:
184+
persist-credentials: false
185+
186+
- name: Download merged report
187+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
188+
with:
189+
name: e2e-report
190+
path: e2e-report
191+
192+
# Deploys to the `gh-pages` branch under `pr-preview/pr-<N>/` and posts a
193+
# sticky comment with the URL. The companion `pr-preview-cleanup` workflow
194+
# removes it when the PR closes.
195+
- name: Deploy report to PR preview
196+
uses: rossjrw/pr-preview-action@ffa7509e91a3ec8dfc2e5536c4d5c1acdf7a6de9 # v1
197+
with:
198+
source-dir: e2e-report
199+
preview-branch: gh-pages
200+
umbrella-dir: pr-preview
201+
action: deploy
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: pr-preview-cleanup
2+
3+
# Removes the GitHub Pages e2e-report preview that `build.yml`'s `deploy-report`
4+
# job published for a PR, once that PR is closed/merged. Kept separate from
5+
# `build.yml` so closing a PR doesn't re-run the whole build + e2e suite.
6+
on:
7+
pull_request:
8+
types: [closed]
9+
10+
permissions:
11+
contents: write
12+
pull-requests: write
13+
14+
jobs:
15+
remove-preview:
16+
name: "Remove E2E Report Preview"
17+
runs-on: ubuntu-latest
18+
# Fork PRs never got a preview (read-only token), so nothing to remove.
19+
if: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
20+
steps:
21+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
22+
with:
23+
persist-credentials: false
24+
25+
- name: Remove PR preview
26+
uses: rossjrw/pr-preview-action@ffa7509e91a3ec8dfc2e5536c4d5c1acdf7a6de9 # v1
27+
with:
28+
preview-branch: gh-pages
29+
umbrella-dir: pr-preview
30+
action: remove

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ examples/*/types
1010
tsconfig.tsbuildinfo
1111
# testing
1212
coverage
13+
# Vitest's attachment store (failure screenshots / diffs). Accumulates across
14+
# runs; the HTML reporter copies what it needs into playwright-report/data,
15+
# so the originals are unreferenced cruft.
16+
.vitest-attachments/
1317

1418
# production
1519
/build

.vscode/extensions.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
// See http://go.microsoft.com/fwlink/?LinkId=827846
33
// for the documentation about the extensions.json format
4-
"recommendations": ["esbenp.prettier-vscode", "dbaeumer.vscode-eslint"]
4+
"recommendations": ["VoidZero.vite-plus-extension-pack"]
55
}

.vscode/settings.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
{
2-
"editor.defaultFormatter": "esbenp.prettier-vscode",
2+
"editor.defaultFormatter": "oxc.oxc-vscode",
33
"editor.formatOnSave": true,
4-
"[javascript]": { "editor.defaultFormatter": "esbenp.prettier-vscode" },
5-
"[typescriptreact]": {
6-
"editor.defaultFormatter": "esbenp.prettier-vscode"
4+
"editor.formatOnSaveMode": "file",
5+
"editor.codeActionsOnSave": {
6+
"source.fixAll.oxc": "explicit"
77
},
8+
"oxc.fmt.configPath": "./vite.config.ts",
9+
"npm.scriptRunner": "vp",
10+
"[javascript]": { "editor.defaultFormatter": "oxc.oxc-vscode" },
11+
"[javascriptreact]": { "editor.defaultFormatter": "oxc.oxc-vscode" },
12+
"[typescript]": { "editor.defaultFormatter": "oxc.oxc-vscode" },
13+
"[typescriptreact]": { "editor.defaultFormatter": "oxc.oxc-vscode" },
814
"search.exclude": {
915
"packages/editor/public/types": true,
1016
"packages/website/docs/.vitepress": false,
@@ -15,11 +21,5 @@
1521
"editor.defaultFormatter": "redhat.vscode-xml"
1622
},
1723
"scm.defaultViewMode": "tree",
18-
"search.defaultViewMode": "tree",
19-
"[typescript]": {
20-
"editor.defaultFormatter": "esbenp.prettier-vscode"
21-
},
22-
"[mdx]": {
23-
"editor.defaultFormatter": "esbenp.prettier-vscode"
24-
}
24+
"search.defaultViewMode": "tree"
2525
}

0 commit comments

Comments
 (0)