Skip to content

Commit ec7918e

Browse files
authored
Merge branch 'main' into feat/fix-codeblock-input-rule
2 parents 6be224a + 73f4827 commit ec7918e

501 files changed

Lines changed: 22710 additions & 10557 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.

.github/dependabot.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ updates:
2121
- dependency-name: "@tiptap/extension-code"
2222
- dependency-name: "@tiptap/extension-horizontal-rule"
2323
- dependency-name: "@tiptap/extension-italic"
24-
- dependency-name: "@tiptap/extension-link"
24+
2525
- dependency-name: "@tiptap/extension-paragraph"
2626
- dependency-name: "@tiptap/extension-strike"
2727
- dependency-name: "@tiptap/extension-text"
@@ -40,6 +40,12 @@ updates:
4040
# yjs packages
4141
- dependency-name: "yjs"
4242
- dependency-name: "y-prosemirror"
43+
ignore:
44+
# Hono packages are used only in the demo AI server and are not part of
45+
# the main editor/runtime surface area.
46+
- dependency-name: "hono"
47+
- dependency-name: "@hono/node-server"
48+
- dependency-name: "@hono/*"
4349
groups:
4450
editor-dependencies:
4551
patterns:

.github/workflows/build.yml

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -7,32 +7,34 @@ on:
77
types: [opened, synchronize, reopened, edited]
88

99
env:
10+
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
1011
NX_SELF_HOSTED_REMOTE_CACHE_ACCESS_TOKEN: ${{ secrets.NX_SELF_HOSTED_REMOTE_CACHE_ACCESS_TOKEN }}
1112
NX_SELF_HOSTED_REMOTE_CACHE_SERVER: ${{ secrets.NX_SELF_HOSTED_REMOTE_CACHE_SERVER }}
13+
pnpm_config_store_dir: ./node_modules/.pnpm-store
1214

1315
jobs:
1416
build:
1517
name: Build
1618
runs-on: ubuntu-latest
1719
timeout-minutes: 60
1820
steps:
19-
- uses: actions/checkout@v4
21+
- uses: actions/checkout@v6
2022
with:
2123
fetch-depth: 100
2224

2325
- name: Install pnpm
24-
uses: pnpm/action-setup@v4
26+
uses: pnpm/action-setup@v5
2527

26-
- uses: nrwl/nx-set-shas@v3
28+
- uses: nrwl/nx-set-shas@v5
2729

28-
- uses: actions/setup-node@v4
30+
- uses: actions/setup-node@v6
2931
with:
3032
cache: "pnpm"
3133
cache-dependency-path: "**/pnpm-lock.yaml"
3234
node-version-file: ".nvmrc"
3335

3436
- name: Cache NX
35-
uses: actions/cache@v4
37+
uses: actions/cache@v5
3638
with:
3739
path: .nx/cache
3840
key: nx-${{ env.NX_BRANCH }}-${{ env.NX_RUN_GROUP }}-${{ github.sha }}
@@ -41,8 +43,6 @@ jobs:
4143
nx-${{ env.NX_BRANCH }}-
4244
nx-
4345
44-
# This is needed for the canvas dep, Tiptap V3 should remove the need for this
45-
- run: sudo apt-get update && sudo apt-get install -y build-essential libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev pkg-config
4646
- name: Install Dependencies
4747
run: pnpm install
4848

@@ -55,6 +55,9 @@ jobs:
5555
- name: Run unit tests
5656
run: pnpm run test
5757

58+
- name: Run Next.js integration test (production build)
59+
run: NEXTJS_TEST_MODE=build npx vitest run tests/src/unit/nextjs/serverUtil.test.ts
60+
5861
- name: Upload webpack stats artifact (editor)
5962
uses: relative-ci/agent-upload-artifact-action@v2
6063
with:
@@ -70,23 +73,23 @@ jobs:
7073
runs-on: ubuntu-latest
7174
timeout-minutes: 30
7275
steps:
73-
- uses: actions/checkout@v4
76+
- uses: actions/checkout@v6
7477
with:
7578
fetch-depth: 100
7679

7780
- name: Install pnpm
78-
uses: pnpm/action-setup@v4
81+
uses: pnpm/action-setup@v5
7982

80-
- uses: nrwl/nx-set-shas@v3
83+
- uses: nrwl/nx-set-shas@v5
8184

82-
- uses: actions/setup-node@v4
85+
- uses: actions/setup-node@v6
8386
with:
8487
cache: "pnpm"
8588
cache-dependency-path: "**/pnpm-lock.yaml"
8689
node-version-file: ".nvmrc"
8790

8891
- name: Cache NX
89-
uses: actions/cache@v4
92+
uses: actions/cache@v5
9093
with:
9194
path: .nx/cache
9295
key: nx-playwright-${{ env.NX_BRANCH }}-${{ env.NX_RUN_GROUP }}-${{ github.sha }}
@@ -95,16 +98,14 @@ jobs:
9598
nx-playwright-${{ env.NX_BRANCH }}-
9699
nx-
97100
98-
- run: sudo apt-get update && sudo apt-get install -y build-essential libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev pkg-config
99-
100101
- name: Install dependencies
101102
run: pnpm install
102103

103104
- name: Build packages
104105
run: pnpm run build
105106

106107
- name: Upload build artifacts
107-
uses: actions/upload-artifact@v4
108+
uses: actions/upload-artifact@v7
108109
with:
109110
name: playwright-build
110111
path: |
@@ -126,21 +127,21 @@ jobs:
126127
shardIndex: [1, 2]
127128
shardTotal: [2]
128129
steps:
129-
- uses: actions/checkout@v4
130+
- uses: actions/checkout@v6
130131
with:
131132
fetch-depth: 100
132133

133134
- name: Install pnpm
134-
uses: pnpm/action-setup@v4
135+
uses: pnpm/action-setup@v5
135136

136-
- uses: actions/setup-node@v4
137+
- uses: actions/setup-node@v6
137138
with:
138139
cache: "pnpm"
139140
cache-dependency-path: "**/pnpm-lock.yaml"
140141
node-version-file: ".nvmrc"
141142

142143
- name: Download build artifacts
143-
uses: actions/download-artifact@v4
144+
uses: actions/download-artifact@v8
144145
with:
145146
name: playwright-build
146147

@@ -152,15 +153,15 @@ jobs:
152153
HOME=/root PLAYWRIGHT_CONFIG="--project ${{ matrix.browser }} --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }}" pnpm run e2e
153154
154155
- name: Upload blob report
155-
uses: actions/upload-artifact@v4
156+
uses: actions/upload-artifact@v7
156157
if: ${{ !cancelled() }}
157158
with:
158159
name: blob-report-${{ matrix.browser }}-${{ matrix.shardIndex }}
159160
path: tests/blob-report/
160161
retention-days: 1
161162

162163
- name: Upload HTML report
163-
uses: actions/upload-artifact@v4
164+
uses: actions/upload-artifact@v7
164165
if: ${{ !cancelled() }}
165166
with:
166167
name: playwright-report-${{ matrix.browser }}-${{ matrix.shardIndex }}
@@ -173,12 +174,12 @@ jobs:
173174
needs: playwright
174175
runs-on: ubuntu-latest
175176
steps:
176-
- uses: actions/checkout@v4
177+
- uses: actions/checkout@v6
177178

178179
- name: Install pnpm
179-
uses: pnpm/action-setup@v4
180+
uses: pnpm/action-setup@v5
180181

181-
- uses: actions/setup-node@v4
182+
- uses: actions/setup-node@v6
182183
with:
183184
cache: "pnpm"
184185
cache-dependency-path: "**/pnpm-lock.yaml"
@@ -188,7 +189,7 @@ jobs:
188189
run: pnpm install
189190

190191
- name: Download blob reports
191-
uses: actions/download-artifact@v4
192+
uses: actions/download-artifact@v8
192193
with:
193194
path: tests/all-blob-reports
194195
pattern: blob-report-*
@@ -199,7 +200,7 @@ jobs:
199200
working-directory: tests
200201

201202
- name: Upload merged HTML report
202-
uses: actions/upload-artifact@v4
203+
uses: actions/upload-artifact@v7
203204
with:
204205
name: playwright-report-merged
205206
path: tests/playwright-report/
Lines changed: 110 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,144 @@
11
name: Fresh Install Tests
22

3-
# Periodically tests BlockNote with the latest versions of its dependencies
4-
# (within declared ranges), without a lockfile. This catches breakage when a
3+
# Periodically tests BlockNote with the latest versions of its production
4+
# dependencies (within declared semver ranges). This catches breakage when a
55
# new release of a dep like @tiptap/* or prosemirror-* ships and conflicts
66
# with BlockNote's declared ranges — the kind of failure a user would hit when
77
# running `npm install @blocknote/react` in a fresh project.
88
#
9-
# DevDependencies (vitest, vite, typescript, etc.) are still bounded by their
10-
# declared ranges in package.json; only prod/peer deps get freshly resolved.
9+
# Only production dependencies of published (non-private) packages are updated.
10+
# DevDependencies (vitest, vite, typescript, etc.) stay pinned to the lockfile,
11+
# so test tooling churn doesn't cause false positives.
1112

1213
on:
1314
schedule:
1415
- cron: "0 2 * * *" # Daily at 02:00 UTC
1516
workflow_dispatch: # Allow manual runs
1617

18+
env:
19+
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
20+
pnpm_config_store_dir: ./node_modules/.pnpm-store
21+
1722
jobs:
1823
fresh-install-unit-tests:
1924
name: Unit Tests (Fresh Dep Resolution)
2025
runs-on: ubuntu-latest
2126
timeout-minutes: 30
2227

2328
steps:
24-
- uses: actions/checkout@v4
29+
- id: checkout
30+
uses: actions/checkout@v6
2531

26-
- name: Install pnpm
27-
uses: pnpm/action-setup@v4
32+
- id: install_pnpm
33+
name: Install pnpm
34+
uses: pnpm/action-setup@v5
2835

29-
- uses: actions/setup-node@v4
36+
- id: setup_node
37+
uses: actions/setup-node@v6
3038
with:
3139
node-version-file: ".nvmrc"
32-
# Intentionally no pnpm cache — we want a genuinely fresh install
40+
# Intentionally no pnpm cache — we want fresh prod dep resolution
3341

34-
# Required for the `canvas` native dependency
35-
- name: Install system dependencies
36-
run: sudo apt-get update && sudo apt-get install -y build-essential libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev pkg-config
42+
- id: install_dependencies
43+
name: Install dependencies
44+
run: pnpm install
3745

38-
- name: Remove lockfile to force fresh dep resolution
39-
# Removing pnpm-lock.yaml causes pnpm to resolve all dependencies to
40-
# the latest versions that satisfy the ranges declared in package.json
41-
# (including pnpm-workspace.yaml overrides). This is equivalent to what
42-
# a new user experiences when installing BlockNote in a blank project.
43-
run: rm pnpm-lock.yaml
46+
- id: update_prod_deps
47+
name: Update prod deps of published packages
48+
# Resolves production dependencies of every published (non-private)
49+
# workspace package to the latest version within their declared semver
50+
# ranges. This simulates what a user gets when running
51+
# `npm install @blocknote/react` in a fresh project.
52+
# DevDependencies are left at their lockfile versions.
53+
run: |
54+
FILTERS=$(node -e "
55+
const fs = require('fs');
56+
const path = require('path');
57+
fs.readdirSync('packages').forEach(dir => {
58+
try {
59+
const pkg = JSON.parse(fs.readFileSync(path.join('packages', dir, 'package.json'), 'utf8'));
60+
if (!pkg.private && pkg.name) process.stdout.write('--filter ' + pkg.name + ' ');
61+
} catch {}
62+
});
63+
")
64+
echo "Updating prod deps for: $FILTERS"
65+
eval pnpm update --prod $FILTERS
4466
45-
- name: Install dependencies
46-
run: pnpm install --no-frozen-lockfile
67+
- id: dedupe_deps
68+
name: Dedupe transitive dependencies
69+
# After bumping the publishable packages' prod deps, collapse any
70+
# duplicate transitive resolutions (e.g. @tiptap/core + @tiptap/pm)
71+
# that would otherwise differ between the updated publishable packages
72+
# and the un-updated examples/playground. Without this, TypeScript
73+
# treats the two copies' exports as unrelated types and example-editor
74+
# fails to build (TS2322 on Extension<any, any> vs AnyExtension).
75+
# Dedupe only rewrites the lockfile — it does NOT modify package.json,
76+
# so the examples' "@blocknote/*": "latest" specs (which is what
77+
# CodeSandbox users see) stay intact.
78+
run: pnpm dedupe
4779

48-
- name: Build packages
80+
- id: build_packages
81+
name: Build packages
4982
run: pnpm run build
5083
env:
5184
NX_SKIP_NX_CACHE: "true"
5285

53-
- name: Run unit tests
86+
- id: run_unit_tests
87+
name: Run unit tests
5488
run: pnpm run test
5589
env:
5690
NX_SKIP_NX_CACHE: "true"
91+
92+
- name: Notify Slack on workflow failure
93+
if: ${{ failure() }}
94+
env:
95+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
96+
REPOSITORY: ${{ github.repository }}
97+
WORKFLOW: ${{ github.workflow }}
98+
RUN_ID: ${{ github.run_id }}
99+
RUN_NUMBER: ${{ github.run_number }}
100+
RUN_ATTEMPT: ${{ github.run_attempt }}
101+
BRANCH: ${{ github.ref_name }}
102+
run: |
103+
if [ -z "$SLACK_WEBHOOK_URL" ]; then
104+
echo "SLACK_WEBHOOK_URL is not configured; skipping Slack notification."
105+
exit 0
106+
fi
107+
108+
failed_step="Unknown step"
109+
if [ "${{ steps.checkout.outcome }}" = "failure" ]; then
110+
failed_step="Checkout repository"
111+
elif [ "${{ steps.install_pnpm.outcome }}" = "failure" ]; then
112+
failed_step="Install pnpm"
113+
elif [ "${{ steps.setup_node.outcome }}" = "failure" ]; then
114+
failed_step="Setup Node.js"
115+
elif [ "${{ steps.install_dependencies.outcome }}" = "failure" ]; then
116+
failed_step="Install dependencies"
117+
elif [ "${{ steps.update_prod_deps.outcome }}" = "failure" ]; then
118+
failed_step="Update prod deps of published packages"
119+
elif [ "${{ steps.dedupe_deps.outcome }}" = "failure" ]; then
120+
failed_step="Dedupe transitive dependencies"
121+
elif [ "${{ steps.build_packages.outcome }}" = "failure" ]; then
122+
failed_step="Build packages"
123+
elif [ "${{ steps.run_unit_tests.outcome }}" = "failure" ]; then
124+
failed_step="Run unit tests"
125+
fi
126+
127+
run_url="https://github.com/${REPOSITORY}/actions/runs/${RUN_ID}"
128+
message=$(printf '%s\n%s\n%s\n%s' \
129+
":warning: Fresh Install Tests failed in *${REPOSITORY}* on branch *${BRANCH}*." \
130+
"*Workflow:* ${WORKFLOW}" \
131+
"*Run:* <${run_url}|#${RUN_NUMBER} (attempt ${RUN_ATTEMPT})>" \
132+
"*Failed step:* ${failed_step}")
133+
payload=$(jq --compact-output --null-input --arg text "$message" '{text: $text}')
134+
135+
curl -sS -X POST \
136+
--fail \
137+
--retry 4 \
138+
--retry-all-errors \
139+
--retry-max-time 60 \
140+
--connect-timeout 10 \
141+
--max-time 30 \
142+
-H "Content-type: application/json" \
143+
--data "$payload" \
144+
"$SLACK_WEBHOOK_URL"

0 commit comments

Comments
 (0)