Skip to content

Commit

Permalink
chore: update tsconfigs to use composite (remix-run#4269)
Browse files Browse the repository at this point in the history
Speeds up build a bit by allowing tsc to quickly find references: https://www.typescriptlang.org/docs/handbook/project-references.html#composite

Allows projects to build in more isolation and avoids wired x-project types to leak. For example I have a PR open right now that does not recognize `headers.entries()` as a method in the server-runtime, but with these changes it works fine.
  • Loading branch information
jacob-ebey authored Sep 26, 2022
1 parent 33e110d commit 68790fb
Show file tree
Hide file tree
Showing 17 changed files with 18 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
/packages/*/LICENSE.md
node_modules/
yarn-error.log
tsconfig.tsbuildinfo

/jacob
/fixtures/cloudflare
Expand Down
1 change: 1 addition & 0 deletions integration/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"include": ["**/*.ts"],
"exclude": ["helpers/*-template"],
"compilerOptions": {
"lib": ["ES2019"],
Expand Down
1 change: 1 addition & 0 deletions packages/create-remix/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"target": "ES2019",
"module": "CommonJS",
"skipLibCheck": true,
"composite": true,

"moduleResolution": "node",
"allowSyntheticDefaultImports": true,
Expand Down
1 change: 1 addition & 0 deletions packages/remix-architect/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"lib": ["ES2019", "DOM.Iterable"],
"target": "ES2019",
"skipLibCheck": true,
"composite": true,

"moduleResolution": "node",
"allowSyntheticDefaultImports": true,
Expand Down
1 change: 1 addition & 0 deletions packages/remix-cloudflare-pages/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"lib": ["ES2019"],
"target": "ES2019",
"types": ["@cloudflare/workers-types"],
"composite": true,

"moduleResolution": "node",
"allowSyntheticDefaultImports": true,
Expand Down
1 change: 1 addition & 0 deletions packages/remix-cloudflare-workers/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"lib": ["ES2019"],
"target": "ES2019",
"types": ["@cloudflare/workers-types"],
"composite": true,

"moduleResolution": "node",
"allowSyntheticDefaultImports": true,
Expand Down
1 change: 1 addition & 0 deletions packages/remix-cloudflare/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"lib": ["ES2019"],
"target": "ES2019",
"types": ["@cloudflare/workers-types"],
"composite": true,

"moduleResolution": "node",
"allowSyntheticDefaultImports": true,
Expand Down
2 changes: 2 additions & 0 deletions packages/remix-dev/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
{
"include": ["**/*.ts", "package.json"],
"exclude": ["dist", "__tests__", "node_modules", "./compiler/shims"],
"compilerOptions": {
"lib": ["ES2019", "DOM.Iterable"],
"target": "ES2019",
"module": "CommonJS",
"composite": true,

"moduleResolution": "node",
"resolveJsonModule": true,
Expand Down
1 change: 1 addition & 0 deletions packages/remix-express/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"lib": ["ES2019", "DOM.Iterable"],
"target": "ES2019",
"skipLibCheck": true,
"composite": true,

"moduleResolution": "node",
"allowSyntheticDefaultImports": true,
Expand Down
1 change: 1 addition & 0 deletions packages/remix-netlify/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"lib": ["ES2019", "DOM.Iterable"],
"target": "ES2019",
"skipLibCheck": true,
"composite": true,

"moduleResolution": "node",
"allowSyntheticDefaultImports": true,
Expand Down
1 change: 1 addition & 0 deletions packages/remix-node/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"compilerOptions": {
"lib": ["ES2019", "DOM.Iterable"],
"target": "ES2019",
"composite": true,

"moduleResolution": "node",
"allowSyntheticDefaultImports": true,
Expand Down
4 changes: 2 additions & 2 deletions packages/remix-react/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"target": "ES2020",
"module": "ES2020",
"skipLibCheck": true,
"composite": true,

"moduleResolution": "node",
"allowSyntheticDefaultImports": true,
Expand All @@ -14,7 +15,6 @@
"declaration": true,
"emitDeclarationOnly": true,
"rootDir": ".",
"outDir": "../../build/node_modules/@remix-run/react/dist",
"composite": true
"outDir": "../../build/node_modules/@remix-run/react/dist"
}
}
1 change: 1 addition & 0 deletions packages/remix-serve/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"lib": ["ES2019", "DOM.Iterable"],
"target": "ES2019",
"skipLibCheck": true,
"composite": true,

"moduleResolution": "node",
"allowSyntheticDefaultImports": true,
Expand Down
2 changes: 1 addition & 1 deletion packages/remix-server-runtime/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"compilerOptions": {
"lib": ["ES2019", "DOM", "DOM.Iterable"],
"target": "ES2019",
"composite": true,

"moduleResolution": "node",
"allowSyntheticDefaultImports": true,
Expand All @@ -12,7 +13,6 @@
"emitDeclarationOnly": true,
"rootDir": ".",
"outDir": "../../build/node_modules/@remix-run/server-runtime/dist",
"composite": true,

// Avoid naming conflicts between lib.dom.d.ts and globals.ts
"skipLibCheck": true
Expand Down
1 change: 1 addition & 0 deletions packages/remix-vercel/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"lib": ["ES2019", "DOM.Iterable"],
"target": "ES2019",
"skipLibCheck": true,
"composite": true,

"moduleResolution": "node",
"allowSyntheticDefaultImports": true,
Expand Down
1 change: 1 addition & 0 deletions packages/remix/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"target": "ES2020",
"module": "ES2020",
"skipLibCheck": true,
"composite": true,

"jsx": "react",
"moduleResolution": "node",
Expand Down
1 change: 0 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"files": [],
"exclude": ["node_modules", "build"],
"references": [
{ "path": "integration" },
{ "path": "packages/create-remix" },
Expand Down

0 comments on commit 68790fb

Please sign in to comment.