Skip to content

Commit c5f929c

Browse files
committed
fix: add app-local globals.d.ts for CSS side-effect imports
TS 6 + the tooling-group bump made tsc stricter about side-effect imports (`import "./globals.css"`). The CSS module declaration that allows them comes from `next-env.d.ts` which Next.js auto-generates — but that file is gitignored and only emitted after `next build`. CI runs `pnpm typecheck` before `next build`, so each app would error with TS2882 on the layout.tsx CSS import. Added `apps/<app>/globals.d.ts` with the same triple-slash refs plus an explicit `declare module "*.css"`. Bundled with the existing tooling-group bump (#73). Verified typecheck passes locally for airdrop, coinblast, dex, faucet, landing, scan.
1 parent f52d967 commit c5f929c

12 files changed

Lines changed: 192 additions & 30 deletions

File tree

apps/airdrop/globals.d.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/// <reference types="next" />
2+
/// <reference types="next/image-types/global" />
3+
4+
// CSS side-effect imports (e.g. `import "./globals.css"`)
5+
// Typically declared by the auto-generated next-env.d.ts, but that
6+
// file is gitignored + only emitted after `next build`. CI runs
7+
// `pnpm typecheck` before `next build`, so we mirror those refs
8+
// here to keep TS 6 happy.
9+
declare module "*.css";

apps/airdrop/tsconfig.json

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,30 @@
55
"noEmit": true,
66
"verbatimModuleSyntax": false,
77
"noUncheckedIndexedAccess": false,
8-
"lib": ["dom", "dom.iterable", "esnext"],
9-
"plugins": [{ "name": "next" }],
8+
"lib": [
9+
"dom",
10+
"dom.iterable",
11+
"esnext"
12+
],
13+
"plugins": [
14+
{
15+
"name": "next"
16+
}
17+
],
1018
"paths": {
11-
"@/*": ["./src/*"]
19+
"@/*": [
20+
"./src/*"
21+
]
1222
}
1323
},
14-
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
15-
"exclude": ["node_modules"]
24+
"include": [
25+
"next-env.d.ts",
26+
"**/*.ts",
27+
"**/*.tsx",
28+
".next/types/**/*.ts",
29+
"globals.d.ts"
30+
],
31+
"exclude": [
32+
"node_modules"
33+
]
1634
}

apps/coinblast/globals.d.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/// <reference types="next" />
2+
/// <reference types="next/image-types/global" />
3+
4+
// CSS side-effect imports (e.g. `import "./globals.css"`)
5+
// Typically declared by the auto-generated next-env.d.ts, but that
6+
// file is gitignored + only emitted after `next build`. CI runs
7+
// `pnpm typecheck` before `next build`, so we mirror those refs
8+
// here to keep TS 6 happy.
9+
declare module "*.css";

apps/coinblast/tsconfig.json

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,30 @@
55
"noEmit": true,
66
"verbatimModuleSyntax": false,
77
"noUncheckedIndexedAccess": false,
8-
"lib": ["dom", "dom.iterable", "esnext"],
9-
"plugins": [{ "name": "next" }],
8+
"lib": [
9+
"dom",
10+
"dom.iterable",
11+
"esnext"
12+
],
13+
"plugins": [
14+
{
15+
"name": "next"
16+
}
17+
],
1018
"paths": {
11-
"@/*": ["./src/*"]
19+
"@/*": [
20+
"./src/*"
21+
]
1222
}
1323
},
14-
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
15-
"exclude": ["node_modules"]
24+
"include": [
25+
"next-env.d.ts",
26+
"**/*.ts",
27+
"**/*.tsx",
28+
".next/types/**/*.ts",
29+
"globals.d.ts"
30+
],
31+
"exclude": [
32+
"node_modules"
33+
]
1634
}

apps/dex/globals.d.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/// <reference types="next" />
2+
/// <reference types="next/image-types/global" />
3+
4+
// CSS side-effect imports (e.g. `import "./globals.css"`)
5+
// Typically declared by the auto-generated next-env.d.ts, but that
6+
// file is gitignored + only emitted after `next build`. CI runs
7+
// `pnpm typecheck` before `next build`, so we mirror those refs
8+
// here to keep TS 6 happy.
9+
declare module "*.css";

apps/dex/tsconfig.json

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,30 @@
55
"noEmit": true,
66
"verbatimModuleSyntax": false,
77
"noUncheckedIndexedAccess": false,
8-
"lib": ["dom", "dom.iterable", "esnext"],
9-
"plugins": [{ "name": "next" }],
8+
"lib": [
9+
"dom",
10+
"dom.iterable",
11+
"esnext"
12+
],
13+
"plugins": [
14+
{
15+
"name": "next"
16+
}
17+
],
1018
"paths": {
11-
"@/*": ["./src/*"]
19+
"@/*": [
20+
"./src/*"
21+
]
1222
}
1323
},
14-
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
15-
"exclude": ["node_modules"]
24+
"include": [
25+
"next-env.d.ts",
26+
"**/*.ts",
27+
"**/*.tsx",
28+
".next/types/**/*.ts",
29+
"globals.d.ts"
30+
],
31+
"exclude": [
32+
"node_modules"
33+
]
1634
}

apps/faucet/globals.d.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/// <reference types="next" />
2+
/// <reference types="next/image-types/global" />
3+
4+
// CSS side-effect imports (e.g. `import "./globals.css"`)
5+
// Typically declared by the auto-generated next-env.d.ts, but that
6+
// file is gitignored + only emitted after `next build`. CI runs
7+
// `pnpm typecheck` before `next build`, so we mirror those refs
8+
// here to keep TS 6 happy.
9+
declare module "*.css";

apps/faucet/tsconfig.json

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,30 @@
55
"noEmit": true,
66
"verbatimModuleSyntax": false,
77
"noUncheckedIndexedAccess": false,
8-
"lib": ["dom", "dom.iterable", "esnext"],
9-
"plugins": [{ "name": "next" }],
8+
"lib": [
9+
"dom",
10+
"dom.iterable",
11+
"esnext"
12+
],
13+
"plugins": [
14+
{
15+
"name": "next"
16+
}
17+
],
1018
"paths": {
11-
"@/*": ["./src/*"]
19+
"@/*": [
20+
"./src/*"
21+
]
1222
}
1323
},
14-
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
15-
"exclude": ["node_modules"]
24+
"include": [
25+
"next-env.d.ts",
26+
"**/*.ts",
27+
"**/*.tsx",
28+
".next/types/**/*.ts",
29+
"globals.d.ts"
30+
],
31+
"exclude": [
32+
"node_modules"
33+
]
1634
}

apps/landing/globals.d.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/// <reference types="next" />
2+
/// <reference types="next/image-types/global" />
3+
4+
// CSS side-effect imports (e.g. `import "./globals.css"`)
5+
// Typically declared by the auto-generated next-env.d.ts, but that
6+
// file is gitignored + only emitted after `next build`. CI runs
7+
// `pnpm typecheck` before `next build`, so we mirror those refs
8+
// here to keep TS 6 happy.
9+
declare module "*.css";

apps/landing/tsconfig.json

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,30 @@
55
"noEmit": true,
66
"verbatimModuleSyntax": false,
77
"noUncheckedIndexedAccess": false,
8-
"lib": ["dom", "dom.iterable", "esnext"],
9-
"plugins": [{ "name": "next" }],
8+
"lib": [
9+
"dom",
10+
"dom.iterable",
11+
"esnext"
12+
],
13+
"plugins": [
14+
{
15+
"name": "next"
16+
}
17+
],
1018
"paths": {
11-
"@/*": ["./*"]
19+
"@/*": [
20+
"./*"
21+
]
1222
}
1323
},
14-
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
15-
"exclude": ["node_modules"]
24+
"include": [
25+
"next-env.d.ts",
26+
"**/*.ts",
27+
"**/*.tsx",
28+
".next/types/**/*.ts",
29+
"globals.d.ts"
30+
],
31+
"exclude": [
32+
"node_modules"
33+
]
1634
}

0 commit comments

Comments
 (0)