Skip to content

Make TypeScript setup more consistent - #6508

Open
remcohaszing wants to merge 10 commits into
mainfrom
fixup-tsconfig
Open

Make TypeScript setup more consistent#6508
remcohaszing wants to merge 10 commits into
mainfrom
fixup-tsconfig

Conversation

@remcohaszing

Copy link
Copy Markdown
Member

This changes the TypeScript setup so it’s consistent across all packages. Example are excluded.

This introduces a new private package named @uppy-dev/tsconfig. This contains two tsconfig presets.

Every package now has 2 tsconfig files. tsconfig.build.json extends @uppy-dev/tsconfig/build. This packages typechecks and builds the src folder of each package into lib. tsconfig.json typechecks everything except src, and references the tsconfig.build.json file.

Files that should not be published, such as tests, are moved into a separate test directory. This was already the situation sometimes, but not always.

The tsconfig.json in the project root is a solution file. Running tsc --build from the project root, builds and checks all TypeScript projects. Likewise, each project can be built or type checked individually.

Tests have been added to @uppy-dev/tsconfig to make sure this setup stays consistent.

The packages @uppy/angular and @uppy/svelte have been excluded, because they need a special build step.

This changes the TypeScript setup so it’s consistent across all
packages. Example are excluded.

This introduces a new private package named `@uppy-dev/tsconfig`. This
contains two tsconfig presets.

Every package now has 2 tsconfig files. `tsconfig.build.json` extends
`@uppy-dev/tsconfig/build`. This packages typechecks and builds the
`src` folder of each package into `lib`. `tsconfig.json` typechecks
everything except `src`, and references the `tsconfig.build.json` file.

Files that should not be published, such as tests, are moved into a
separate `test` directory. This was already the situation sometimes, but
not always.

The `tsconfig.json` in the project root is a solution file. Running
`tsc --build` from the project root, builds and checks all TypeScript
projects. Likewise, each project can be built or type checked
individually.

Tests have been added to `@uppy-dev/tsconfig` to make sure this setup
stays consistent.

The packages `@uppy/angular` and `@uppy/svelte` have been excluded,
because they need a special build step.
@changeset-bot

changeset-bot Bot commented Aug 31, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 409ae67

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

💥 An error occurred when fetching the changed packages and changesets in this PR
Some errors occurred when validating the changesets config:
Invalid tree: "@uppy/zoom" depends on the skipped package "@uppy-dev/tsconfig", but "@uppy/zoom" is not skipped. Please add "@uppy/zoom" to the "ignore" option.

Knip expects each package to specify the tsconfig they extend in their
dev dependencies.
This replaces our inline types for the `express-interceptor` package
with the `@types/express-interceptor` package from DefinitelyTyped.

Additionally this adds a direct dependency on `@types/express`, because
we import `express` directly.
The `@uppy/companion` workspace augments certain third party interfaces.
These augmentations happened in a declaration file. This means two
things:

1. Since we use `skipLibCheck`, type errors in this file are suppressed.
2. Since declaration files are not emitted, the package doesn’t have
   these types.

This change renames the declaration file to a source file. The type
errors that were previously suppressed, are now resolved.
@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addednpm/​@​types/​express-interceptor@​1.2.0671007886100

View full report

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.

1 participant