@jmlweb/tsconfig-nextjs 1.1.5 → 1.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/README.md +27 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @jmlweb/tsconfig-nextjs
|
|
2
2
|
|
|
3
|
+
## 1.1.7
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 30f8ffb: Add "Why Use This?" sections to package READMEs explaining configuration philosophy and design decisions
|
|
8
|
+
- Updated dependencies [30f8ffb]
|
|
9
|
+
- @jmlweb/tsconfig-react@1.0.6
|
|
10
|
+
|
|
11
|
+
## 1.1.6
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- 4a9ece1: Update documentation to use pnpm commands instead of npm
|
|
16
|
+
- Updated dependencies [4a9ece1]
|
|
17
|
+
- @jmlweb/tsconfig-react@1.0.5
|
|
18
|
+
|
|
3
19
|
## 1.1.5
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
## 📦 Installation
|
|
22
22
|
|
|
23
23
|
```bash
|
|
24
|
-
|
|
24
|
+
pnpm add -D @jmlweb/tsconfig-nextjs typescript next @jmlweb/tsconfig-react @jmlweb/tsconfig-base
|
|
25
25
|
```
|
|
26
26
|
|
|
27
27
|
> 💡 **Upgrading from a previous version?** See the [Migration Guide](#-migration-guide) for breaking changes and upgrade instructions.
|
|
@@ -94,6 +94,32 @@ Create a `tsconfig.json` file in your Next.js project root:
|
|
|
94
94
|
}
|
|
95
95
|
```
|
|
96
96
|
|
|
97
|
+
## 🤔 Why Use This?
|
|
98
|
+
|
|
99
|
+
> **Philosophy**: Next.js projects need TypeScript configured for both server and client code with incremental builds and framework-specific optimizations.
|
|
100
|
+
|
|
101
|
+
This package provides a TypeScript configuration specifically optimized for Next.js applications. It extends the React configuration while adding Next.js-specific settings like incremental compilation, the Next.js TypeScript plugin, and sensible path aliases that work with Next.js's file-based routing.
|
|
102
|
+
|
|
103
|
+
### Design Decisions
|
|
104
|
+
|
|
105
|
+
**Incremental Compilation (`incremental: true`)**: Faster rebuilds for development
|
|
106
|
+
|
|
107
|
+
- **Why**: Next.js projects are often large with many files. Incremental compilation dramatically speeds up subsequent builds by only recompiling changed files and their dependents. This makes the development experience much faster
|
|
108
|
+
- **Trade-off**: Creates a `.tsbuildinfo` file that needs to be gitignored. But the build speed improvement is worth it
|
|
109
|
+
- **When to override**: Never - there's no downside to incremental compilation in Next.js projects
|
|
110
|
+
|
|
111
|
+
**Next.js TypeScript Plugin**: Framework-specific type checking
|
|
112
|
+
|
|
113
|
+
- **Why**: Next.js has special conventions (Server Components, Route Handlers, Metadata API, etc.) that benefit from enhanced type checking. The plugin provides better autocomplete and catches Next.js-specific errors that generic TypeScript can't detect
|
|
114
|
+
- **Trade-off**: Adds a dependency on Next.js being installed. But if you're using this config, you're already using Next.js
|
|
115
|
+
- **When to override**: Only if the plugin causes issues (rare), but report bugs to Next.js if found
|
|
116
|
+
|
|
117
|
+
**Path Aliases (`@/*` → project root)**: Clean imports for Next.js file structure
|
|
118
|
+
|
|
119
|
+
- **Why**: Next.js projects have deep file structures (app/components/ui/button/index.tsx). Path aliases like `@/components/ui/button` are more readable and easier to refactor than `../../../components/ui/button`. The `@/*` convention is standard in Next.js projects
|
|
120
|
+
- **Trade-off**: Need to configure the same alias in next.config.js for runtime (though Next.js 13+ does this automatically from tsconfig.json)
|
|
121
|
+
- **When to override**: If your team prefers a different alias convention (like `~/*`), but `@/*` is the Next.js convention
|
|
122
|
+
|
|
97
123
|
## 📋 Configuration Details
|
|
98
124
|
|
|
99
125
|
### What's Included
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jmlweb/tsconfig-nextjs",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.7",
|
|
4
4
|
"description": "TypeScript configuration for Next.js applications with App Router and Pages Router support",
|
|
5
5
|
"main": "tsconfig.json",
|
|
6
6
|
"exports": {
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"peerDependencies": {
|
|
39
39
|
"next": ">=13.0.0",
|
|
40
40
|
"typescript": ">=5.0.0",
|
|
41
|
-
"@jmlweb/tsconfig-react": "1.0.
|
|
41
|
+
"@jmlweb/tsconfig-react": "1.0.6"
|
|
42
42
|
},
|
|
43
43
|
"scripts": {}
|
|
44
44
|
}
|