@jmlweb/tsconfig-nextjs 1.1.4 → 1.1.6
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 +54 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @jmlweb/tsconfig-nextjs
|
|
2
2
|
|
|
3
|
+
## 1.1.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 4a9ece1: Update documentation to use pnpm commands instead of npm
|
|
8
|
+
- Updated dependencies [4a9ece1]
|
|
9
|
+
- @jmlweb/tsconfig-react@1.0.5
|
|
10
|
+
|
|
11
|
+
## 1.1.5
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- 6b73301: Add changelog section with link to CHANGELOG.md in package READMEs
|
|
16
|
+
- Updated dependencies [6b73301]
|
|
17
|
+
- @jmlweb/tsconfig-react@1.0.4
|
|
18
|
+
|
|
3
19
|
## 1.1.4
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -21,9 +21,11 @@
|
|
|
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
|
+
> 💡 **Upgrading from a previous version?** See the [Migration Guide](#-migration-guide) for breaking changes and upgrade instructions.
|
|
28
|
+
|
|
27
29
|
## 🚀 Quick Start
|
|
28
30
|
|
|
29
31
|
Create a `tsconfig.json` file in your Next.js project root:
|
|
@@ -92,6 +94,32 @@ Create a `tsconfig.json` file in your Next.js project root:
|
|
|
92
94
|
}
|
|
93
95
|
```
|
|
94
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
|
+
|
|
95
123
|
## 📋 Configuration Details
|
|
96
124
|
|
|
97
125
|
### What's Included
|
|
@@ -287,11 +315,36 @@ This package requires the following peer dependencies:
|
|
|
287
315
|
|
|
288
316
|
## 🔗 Related Packages
|
|
289
317
|
|
|
318
|
+
### Internal Packages
|
|
319
|
+
|
|
290
320
|
- [`@jmlweb/tsconfig-react`](../tsconfig-react) - TypeScript configuration for React (extended by this package)
|
|
291
321
|
- [`@jmlweb/tsconfig-base`](../tsconfig-base) - Base TypeScript configuration
|
|
292
322
|
- [`@jmlweb/eslint-config-react`](../eslint-config-react) - ESLint configuration for React/Next.js projects
|
|
293
323
|
- [`@jmlweb/prettier-config-base`](../prettier-config-base) - Prettier config for consistent formatting
|
|
294
324
|
|
|
325
|
+
### External Tools
|
|
326
|
+
|
|
327
|
+
- [TypeScript](https://www.typescriptlang.org/) - Strongly typed programming language that builds on JavaScript
|
|
328
|
+
- [Next.js](https://nextjs.org/) - The React framework for production
|
|
329
|
+
- [React](https://react.dev/) - JavaScript library for building user interfaces
|
|
330
|
+
- [Turbopack](https://turbo.build/pack) - Incremental bundler optimized for JavaScript and TypeScript
|
|
331
|
+
|
|
332
|
+
## 🔄 Migration Guide
|
|
333
|
+
|
|
334
|
+
### Upgrading to a New Version
|
|
335
|
+
|
|
336
|
+
> **Note:** If no breaking changes were introduced in a version, it's safe to upgrade without additional steps.
|
|
337
|
+
|
|
338
|
+
**No breaking changes have been introduced yet.** This package follows semantic versioning. When breaking changes are introduced, detailed migration instructions will be provided here.
|
|
339
|
+
|
|
340
|
+
For version history, see the [Changelog](./CHANGELOG.md).
|
|
341
|
+
|
|
342
|
+
**Need Help?** If you encounter issues during migration, please [open an issue](https://github.com/jmlweb/tooling/issues/new).
|
|
343
|
+
|
|
344
|
+
## 📜 Changelog
|
|
345
|
+
|
|
346
|
+
See [CHANGELOG.md](./CHANGELOG.md) for version history and release notes.
|
|
347
|
+
|
|
295
348
|
## 📄 License
|
|
296
349
|
|
|
297
350
|
MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jmlweb/tsconfig-nextjs",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.6",
|
|
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.5"
|
|
42
42
|
},
|
|
43
43
|
"scripts": {}
|
|
44
44
|
}
|