Make TypeScript setup more consistent - #6508
Open
remcohaszing wants to merge 10 commits into
Open
Conversation
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.
|
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.
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.jsonextends@uppy-dev/tsconfig/build. This packages typechecks and builds thesrcfolder of each package intolib.tsconfig.jsontypechecks everything exceptsrc, and references thetsconfig.build.jsonfile.Files that should not be published, such as tests, are moved into a separate
testdirectory. This was already the situation sometimes, but not always.The
tsconfig.jsonin the project root is a solution file. Runningtsc --buildfrom 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/tsconfigto make sure this setup stays consistent.The packages
@uppy/angularand@uppy/sveltehave been excluded, because they need a special build step.