Skip to content

Preflight unsupported VS Code runtimes before PDF export#22

Merged
MelbourneDeveloper merged 3 commits into
Nimblesite:mainfrom
abdushakoor12:fix/issue-20-pdf-export-runtime-preflight
May 2, 2026
Merged

Preflight unsupported VS Code runtimes before PDF export#22
MelbourneDeveloper merged 3 commits into
Nimblesite:mainfrom
abdushakoor12:fix/issue-20-pdf-export-runtime-preflight

Conversation

@abdushakoor12
Copy link
Copy Markdown
Contributor

TLDR

Preflight unsupported VS Code runtimes before markdown PDF export, add a regression test for the early-fail path, and ratchet packages/web coverage thresholds after the passing CI run.

Details

Closes #20.

What was changed:

  • Added a new exportPdf regression test that asserts unsupported runtimes fail before markdown is read, HTML is composed, or a PDF is written.
  • Added an optional isPrintToPdfRuntimeSupported dependency in the VS Code PDF export path and used it to fail fast with the existing desktop-VS-Code error message.
  • Wired the real runtime check in the VS Code extension through vscode.env.uiKind === vscode.UIKind.Desktop.
  • Extended the VS Code test mock with UIKind and env.uiKind so the runtime-capability path is testable.
  • Updated coverage-thresholds.json for packages/web after make ci passed and the repo’s ratchet step raised those thresholds.

What was added:

  • No new runtime dependencies.
  • One new regression test covering unsupported PDF-export runtimes.

What was changed/deleted:

  • PDF export now rejects unsupported VS Code runtimes before file read/composition work starts.
  • No spec/docs were changed.
  • No breaking changes.

How Do The Automated Tests Prove It Works?

  • make ci passed end-to-end.
  • packages/vscode/test/export-pdf.test.ts now includes preflights unsupported runtimes before reading or composing the markdown, which proves the command stops before readFile, createWebviewPanel, and writeFile on unsupported runtimes.
  • The full packages/vscode suite passed, including test/export-pdf.test.ts, test/export-pdf-physical.test.ts, and test/extension.test.ts.
  • The full web unit and Playwright suites passed during make ci, and the repo ratcheted packages/web coverage thresholds from the measured passing run.

@MelbourneDeveloper MelbourneDeveloper merged commit 79e036e into Nimblesite:main May 2, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PDF export fails in production VS Code extension: webview.printToPDF unavailable

2 participants