locally hosted web application that allows you to perform various operations on PDF files
Go to file
James Brunton 1cc562a6b1
Stop type checking TypeScript files that won't be run (#5607)
# Description of Changes
This PR fixes false-positive TypeScript errors in our layered build
setup (core → proprietary → desktop) by ensuring each build’s typecheck
only evaluates files that are actually part of that build’s reachable
module graph. This prevents overridden core implementations from being
typechecked in higher-layer builds where they are effectively
unreachable due to alias-based overrides.

## Background

We maintain multiple build targets from a layered source tree:

- core: open source baseline
- proprietary: core + proprietary additions/overrides
- desktop: proprietary + desktop-specific additions/overrides

We implement overrides via paths/aliases such that placing a file in a
higher layer at the same relative path supersedes the lower-layer file
at runtime.

For safety, we run TypeScript typechecking independently per build
target to ensure all builds remain valid.

## Problem

Our existing tsconfig setup often typechecked files that are not
actually reachable in a given build. Specifically:

- When a file in core is overridden by a file in proprietary or desktop,
the overridden core file can still be included in the TypeScript Program
for the higher-layer build (typically due to broad include globs).
- This produces false-positive type errors in higher-layer typecheck
runs, even though those core files are effectively unreachable in the
build.

This created friction and noise, and meant we had to make unnecessary
changes to `core` to make the other builds happy, reducing type safety
in the process.

## Solution

This PR adjusts the tsconfig strategy so each build target's typecheck
is driven by reachable entrypoints rather than blanket inclusion of all
layer source trees. Concretely:

- Each build’s tsconfig now includes only:
- that build’s entrypoints and layer sources that are intended to be
compiled for the target
  - any shared/top-level sources required by the target
- Lower layers (e.g., core) are not globally included in higher-layer
builds; they are instead pulled in through module resolution only when
actually referenced (with paths ordering ensuring the correct override
wins).
- This means that we still check all the files that will actually be run
with whatever the overridden logic is, but avoid wasting time and
introducing false-positives by not checking files which have been
overridden.

## Notes
Unfortunately, the config we use for the type checking can't be the same
as the one we use for Vite in this strategy. Vite needs to know about
the entire source tree, so it can't only include the subfolders because
it causes build errors. Because of this, I've duplicated the existing
(valid) tsconfig files and use them for Vite. This is a little clunky
but it does the job. Some day hopefully I'll come back to it and be able
to figure out a nicer way to do it, but for now at least, this solves
the type checking issues without impacting the runtime builds.

Also, I noticed that `@desktop` is defined as an alias, which was
presumably missed when I was removing the self-aliases from the files. I
don't see why you'd ever need to have a desktop file reference
`@desktop` to say "import this but make it impossible for something else
to override the import". I've removed the `@desktop` alias in this PR
while I was in there.
2026-01-30 15:27:35 +00:00
.devcontainer chore: update development configs, formatting tools, and CI enhancements (#4130) 2025-08-08 12:52:51 +01:00
.github chore(ci): remove automated version sync job from build workflow (#5547) 2026-01-24 23:45:48 +00:00
.vscode V2 Auto rename (#4244) 2025-09-05 17:12:52 +01:00
app feat(stamp): add dynamic variables and templates for stamp text customization (#5546) 2026-01-29 21:16:14 +00:00
devGuide refactor: remove legacy Thymeleaf web UI controllers and templates (#5406) 2026-01-21 21:58:29 +00:00
devTools build(deps-dev): bump stylelint-config-standard from 39.0.1 to 40.0.0 in /devTools (#5504) 2026-01-21 22:24:29 +00:00
docker removal of old java desktop + workspace change in tauri (#5459) 2026-01-23 11:42:33 +00:00
docs V1 merge (#5193) 2025-12-21 10:40:32 +00:00
frontend Stop type checking TypeScript files that won't be run (#5607) 2026-01-30 15:27:35 +00:00
gradle/wrapper Upgrade Gradle to 8.14 in CI Workflows and Gradle Wrapper (#3425) 2025-04-27 16:17:07 +01:00
images Revert "[ImgBot] Optimize images" (#5293) 2025-12-22 22:10:23 +00:00
scripts 🤖 format everything with pre-commit by stirlingbot (#5538) 2026-01-29 23:07:59 +00:00
testing build(deps): bump pypdf from 6.6.0 to 6.6.2 in /testing/cucumber in the pip group across 1 directory (#5577) 2026-01-28 16:11:15 +00:00
.dockerignore java frontend (#5097) 2025-12-02 17:15:29 +00:00
.editorconfig Add linting to frontend (#4341) 2025-09-04 14:08:28 +01:00
.git-blame-ignore-revs refactor: move modules under app/ directory and update file paths (#3938) 2025-07-14 20:53:11 +01:00
.gitattributes refactor: move modules under app/ directory and update file paths (#3938) 2025-07-14 20:53:11 +01:00
.gitignore refactor(security): clean up SSO handling, harden URL parsing, and bump dependencies (#5523) 2026-01-22 19:39:34 +00:00
.pre-commit-config.yaml deps(ci): update Dependabot, pre-commit tooling, and testing dependencies (#5170) 2025-12-27 23:56:57 +00:00
ADDING_TOOLS.md refactor: remove legacy Thymeleaf web UI controllers and templates (#5406) 2026-01-21 21:58:29 +00:00
build.gradle 🤖 format everything with pre-commit by stirlingbot (#5538) 2026-01-29 23:07:59 +00:00
CLAUDE.md removal of old java desktop + workspace change in tauri (#5459) 2026-01-23 11:42:33 +00:00
CONTRIBUTING.md exception handling and exception improvements (#3858) 2025-07-02 16:51:45 +01:00
DATABASE.md feat(database): make backup schedule configurable via system keys (#4251) 2025-09-04 15:02:31 +01:00
DeveloperGuide.md refactor: remove legacy Thymeleaf web UI controllers and templates (#5406) 2026-01-21 21:58:29 +00:00
gradle.properties build(local): simplify writeVersion task with WriteProperties plugin and enable build caching (#4139) 2025-08-08 10:36:30 +01:00
gradlew Upgrade Gradle to 8.14 in CI Workflows and Gradle Wrapper (#3425) 2025-04-27 16:17:07 +01:00
gradlew.bat Upgrade Gradle to 8.14 in CI Workflows and Gradle Wrapper (#3425) 2025-04-27 16:17:07 +01:00
HowToUseOCR.md Improve Markdown documentation a bit 2024-12-22 17:37:58 +08:00
launch4jConfig.xml ci: enhance GitHub Actions workflows with Gradle setup, caching improvements, and Docker image testing (#3956) 2025-07-16 17:17:11 +01:00
LICENSE Update LICENSE with proprietary directory details 2025-11-27 11:11:53 +00:00
README.md Update wording for third-party services reference 2025-12-02 19:14:03 +00:00
SECURITY.md Improve Markdown documentation a bit 2024-12-22 17:37:58 +08:00
settings.gradle chore(ci): enable Gradle dependency caching across GitHub workflows (#5400) 2026-01-19 19:03:50 +00:00
test_globalsign.pdf V2 Validate PDF Signature tool (#4679) 2025-10-16 13:45:59 +01:00
test_irs_signed.pdf V2 Validate PDF Signature tool (#4679) 2025-10-16 13:45:59 +01:00
WINDOWS_SIGNING.md Add initial Windows signing infrastructure (#4945) 2025-11-20 12:21:42 +00:00

Stirling PDF logo

Stirling PDF - The Open-Source PDF Platform

Stirling PDF is a powerful, open-source PDF editing platform. Run it as a personal desktop app, in the browser, or deploy it on your own servers with a private API. Edit, sign, redact, convert, and automate PDFs without sending documents to external services.

Docker Pulls Discord OpenSSF Scorecard GitHub Repo stars

Stirling PDF - Dashboard

Key Capabilities

  • Everywhere you work - Desktop client, browser UI, and self-hosted server with a private API.
  • 50+ PDF tools - Edit, merge, split, sign, redact, convert, OCR, compress, and more.
  • Automation & workflows - No-code pipelines direct in UI with APIs to process millions of PDFs.
  • Enterprisegrade - SSO, auditing, and flexible onprem deployments.
  • Developer platform - REST APIs available for nearly all tools to integrate into your existing systems.
  • Global UI - Interface available in 40+ languages.

For a full feature list, see the docs: https://docs.stirlingpdf.com

Quick Start

docker run -p 8080:8080 docker.stirlingpdf.com/stirlingtools/stirling-pdf

Then open: http://localhost:8080

For full installation options (including desktop and Kubernetes), see our Documentation Guide.

Resources

Support

Contributing

We welcome contributions! Please see CONTRIBUTING.md for guidelines.

For development setup, see the Developer Guide.

For adding translations, see the Translation Guide.

License

Stirling PDF is open-core. See LICENSE for details.