From b687eb7b32b4764a720378aa360e06be72d1c938 Mon Sep 17 00:00:00 2001 From: Caio Pizzol Date: Wed, 15 Apr 2026 15:08:04 -0700 Subject: [PATCH 1/5] ci(superdoc): add Codecov coverage reporting Adds a coverage job to ci-superdoc.yml that runs vitest with v8 coverage on the superdoc package and uploads lcov to Codecov. Minimal codecov.yml with auto project + patch targets. --- .github/workflows/ci-superdoc.yml | 56 ++++++++++++++++++++++++++++++- codecov.yml | 10 ++++++ 2 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 codecov.yml diff --git a/.github/workflows/ci-superdoc.yml b/.github/workflows/ci-superdoc.yml index 6187f83ceb..2359d8d4e2 100644 --- a/.github/workflows/ci-superdoc.yml +++ b/.github/workflows/ci-superdoc.yml @@ -206,9 +206,63 @@ jobs: - name: Run CLI tests run: pnpm run test:cli + coverage: + needs: build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + + - uses: pnpm/action-setup@v4 + + - uses: actions/setup-node@v6 + with: + node-version-file: .nvmrc + cache: pnpm + + - uses: oven-sh/setup-bun@v2 + with: + bun-version: 1.3.12 + + - name: Install canvas system dependencies + run: | + sudo apt-get update + sudo apt-get install -y \ + build-essential \ + libcairo2-dev \ + libpango1.0-dev \ + libjpeg-dev \ + libgif-dev \ + librsvg2-dev \ + libpixman-1-dev + + - name: Install dependencies + run: pnpm install + + - name: Build + run: pnpm run build + + - name: Run superdoc tests with coverage + env: + NODE_OPTIONS: '--max-old-space-size=4096' + run: >- + pnpm --filter superdoc exec vitest run + --coverage + --coverage.provider=v8 + --coverage.reporter=lcov + --coverage.reporter=text-summary + --coverage.include='src/**' + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v5 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: packages/superdoc/coverage/lcov.info + flags: superdoc + fail_ci_if_error: false + validate: if: always() - needs: [build, unit-tests, cli-tests] + needs: [build, unit-tests, cli-tests, coverage] runs-on: ubuntu-latest steps: - name: Check results diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 0000000000..58d1399af4 --- /dev/null +++ b/codecov.yml @@ -0,0 +1,10 @@ +coverage: + status: + project: + default: + target: auto + threshold: 1% + patch: + default: + target: auto + threshold: 1% From c76fe9cce263776c203540ac641ff0fe37f17ec8 Mon Sep 17 00:00:00 2001 From: Caio Pizzol Date: Wed, 15 Apr 2026 15:10:24 -0700 Subject: [PATCH 2/5] ci(superdoc): slim down coverage job --- .github/workflows/ci-superdoc.yml | 37 +++---------------------------- 1 file changed, 3 insertions(+), 34 deletions(-) diff --git a/.github/workflows/ci-superdoc.yml b/.github/workflows/ci-superdoc.yml index 2359d8d4e2..f9dfd976ff 100644 --- a/.github/workflows/ci-superdoc.yml +++ b/.github/workflows/ci-superdoc.yml @@ -219,46 +219,15 @@ jobs: node-version-file: .nvmrc cache: pnpm - - uses: oven-sh/setup-bun@v2 - with: - bun-version: 1.3.12 + - run: pnpm install - - name: Install canvas system dependencies - run: | - sudo apt-get update - sudo apt-get install -y \ - build-essential \ - libcairo2-dev \ - libpango1.0-dev \ - libjpeg-dev \ - libgif-dev \ - librsvg2-dev \ - libpixman-1-dev - - - name: Install dependencies - run: pnpm install + - run: pnpm --filter superdoc exec vitest run --coverage --coverage.provider=v8 --coverage.reporter=lcov - - name: Build - run: pnpm run build - - - name: Run superdoc tests with coverage - env: - NODE_OPTIONS: '--max-old-space-size=4096' - run: >- - pnpm --filter superdoc exec vitest run - --coverage - --coverage.provider=v8 - --coverage.reporter=lcov - --coverage.reporter=text-summary - --coverage.include='src/**' - - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v5 + - uses: codecov/codecov-action@v5 with: token: ${{ secrets.CODECOV_TOKEN }} files: packages/superdoc/coverage/lcov.info flags: superdoc - fail_ci_if_error: false validate: if: always() From 05480e54e6fdb9aad4b0da41c4f3aca907502585 Mon Sep 17 00:00:00 2001 From: Caio Pizzol Date: Wed, 15 Apr 2026 15:17:40 -0700 Subject: [PATCH 3/5] ci(superdoc): build yjs-collaboration before coverage tests --- .github/workflows/ci-superdoc.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci-superdoc.yml b/.github/workflows/ci-superdoc.yml index f9dfd976ff..e53601821e 100644 --- a/.github/workflows/ci-superdoc.yml +++ b/.github/workflows/ci-superdoc.yml @@ -221,6 +221,8 @@ jobs: - run: pnpm install + - run: pnpm --filter @superdoc-dev/superdoc-yjs-collaboration build + - run: pnpm --filter superdoc exec vitest run --coverage --coverage.provider=v8 --coverage.reporter=lcov - uses: codecov/codecov-action@v5 From 55dd29aa67b5ed5775e0afa58452e2375dd884aa Mon Sep 17 00:00:00 2001 From: Caio Pizzol Date: Wed, 15 Apr 2026 17:43:27 -0700 Subject: [PATCH 4/5] ci(superdoc): scope coverage to shipped src code Move coverage include/exclude into packages/superdoc/vite.config.js so local and CI agree on what counts. Excludes dev playground, build scripts, and pure re-export entry points (index.js, main.js, super-editor.js, headless-toolbar*.js). Coverage rises from ~64% to ~75% by measuring only code we ship. --- .github/workflows/ci-superdoc.yml | 2 +- packages/superdoc/vite.config.js | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci-superdoc.yml b/.github/workflows/ci-superdoc.yml index e53601821e..6b03dcaea2 100644 --- a/.github/workflows/ci-superdoc.yml +++ b/.github/workflows/ci-superdoc.yml @@ -223,7 +223,7 @@ jobs: - run: pnpm --filter @superdoc-dev/superdoc-yjs-collaboration build - - run: pnpm --filter superdoc exec vitest run --coverage --coverage.provider=v8 --coverage.reporter=lcov + - run: pnpm --filter superdoc exec vitest run --coverage - uses: codecov/codecov-action@v5 with: diff --git a/packages/superdoc/vite.config.js b/packages/superdoc/vite.config.js index 5a8a95a67b..5d32085259 100644 --- a/packages/superdoc/vite.config.js +++ b/packages/superdoc/vite.config.js @@ -167,6 +167,21 @@ export default defineConfig(({ mode, command }) => { '**/*.spec.js', 'tests/umd-smoke/**', ], + coverage: { + provider: 'v8', + reporter: ['text-summary', 'lcov'], + include: ['src/**'], + exclude: [ + 'src/dev/**', + 'src/index.js', + 'src/main.js', + 'src/types.ts', + 'src/super-editor.js', + 'src/headless-toolbar.js', + 'src/headless-toolbar-react.js', + 'src/headless-toolbar-vue.js', + ], + }, }, build: { target: 'es2022', From b17ec6a45910f4a4d1fe44678695eb68fc045c40 Mon Sep 17 00:00:00 2001 From: Caio Pizzol Date: Wed, 15 Apr 2026 17:49:56 -0700 Subject: [PATCH 5/5] ci(superdoc): exclude jsdoc typedef files from coverage --- packages/superdoc/vite.config.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/superdoc/vite.config.js b/packages/superdoc/vite.config.js index 5d32085259..f6dfe5ae75 100644 --- a/packages/superdoc/vite.config.js +++ b/packages/superdoc/vite.config.js @@ -180,6 +180,9 @@ export default defineConfig(({ mode, command }) => { 'src/headless-toolbar.js', 'src/headless-toolbar-react.js', 'src/headless-toolbar-vue.js', + // Pure JSDoc typedef files (body is `export {}`, no runtime code) + 'src/core/types/**', + '**/types.js', ], }, },