@codefast/typescript-config 0.3.6 → 0.3.7-canary.1
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 +28 -2
- package/README.md +175 -239
- package/base.json +2 -6
- package/library.json +0 -5
- package/next.json +2 -6
- package/package.json +1 -2
- package/react.json +1 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,31 @@
|
|
|
1
1
|
# @codefast/typescript-config
|
|
2
2
|
|
|
3
|
+
## 0.3.7-canary.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`345eb36`](https://github.com/codefastlabs/codefast/commit/345eb368a1e44051e215c0e74a255bb8bf7cca76) Thanks [@thevuong](https://github.com/thevuong)! - chore(cli): implement CLI framework with initial commands and adapters
|
|
8
|
+
|
|
9
|
+
- [`d5d8343`](https://github.com/codefastlabs/codefast/commit/d5d83431d97f433f9dd5d1c745bd35f163573ad2) Thanks [@thevuong](https://github.com/thevuong)! - chore(ui): replace `tw-animate-css` with `@tailwindcss/typography` for improved styling capabilities
|
|
10
|
+
|
|
11
|
+
- [`0c0ae47`](https://github.com/codefastlabs/codefast/commit/0c0ae47e822ca82609d5e2dfe55629387ec88df1) Thanks [@thevuong](https://github.com/thevuong)! - chore(ui): update animations and dependencies for improved consistency
|
|
12
|
+
|
|
13
|
+
## 0.3.7-canary.0
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- [`e66e9ac`](https://github.com/codefastlabs/codefast/commit/e66e9ac1186a94cb30d83d7125d4991ee91c7a41) Thanks [@thevuong](https://github.com/thevuong)! - refactor: improve readability and naming consistency across multiple packages
|
|
18
|
+
|
|
19
|
+
- [`c98a4f3`](https://github.com/codefastlabs/codefast/commit/c98a4f3c821039557205fdb0fc4b5a55d8b81944) Thanks [@thevuong](https://github.com/thevuong)! - chore(dependencies): update multiple dependencies to latest versions
|
|
20
|
+
|
|
21
|
+
- [`161717d`](https://github.com/codefastlabs/codefast/commit/161717db82457444b793bad252099084ef490085) Thanks [@thevuong](https://github.com/thevuong)! - feat(eslint-config): strengthen unicorn and TypeScript rule configurations
|
|
22
|
+
|
|
23
|
+
- [`dea11de`](https://github.com/codefastlabs/codefast/commit/dea11deef4cab04a9ed2cd411251f6ad939acba6) Thanks [@thevuong](https://github.com/thevuong)! - chore(ui): integrate `tw-animate-css` and enhance animation easing consistency
|
|
24
|
+
|
|
25
|
+
- [`2f0fd79`](https://github.com/codefastlabs/codefast/commit/2f0fd791d1505279a9c8570f8f3fddcf058d64ee) Thanks [@thevuong](https://github.com/thevuong)! - chore: reorder imports for consistency and clarity
|
|
26
|
+
|
|
27
|
+
- [`728b150`](https://github.com/codefastlabs/codefast/commit/728b1503583d1f130c2f0abd503343dd8c802ee6) Thanks [@thevuong](https://github.com/thevuong)! - chore(tests): remove obsolete test files for core use cases and adapters
|
|
28
|
+
|
|
3
29
|
## 0.3.6
|
|
4
30
|
|
|
5
31
|
### Patch Changes
|
|
@@ -846,7 +872,7 @@
|
|
|
846
872
|
|
|
847
873
|
- [#37](https://github.com/codefastlabs/codefast/pull/37) [`76aa08d`](https://github.com/codefastlabs/codefast/commit/76aa08dd12f143223d88d30c72e7b8677e9808fc) Thanks [@thevuong](https://github.com/thevuong)! - feat(day-picker): support start and end month constraints
|
|
848
874
|
|
|
849
|
-
- [#37](https://github.com/codefastlabs/codefast/pull/37) [`abde741`](https://github.com/codefastlabs/codefast/commit/abde741acf18523884da7fd98ed3e8a6379bcac4) Thanks [@thevuong](https://github.com/thevuong)! - fix(day-picker): update role query from
|
|
875
|
+
- [#37](https://github.com/codefastlabs/codefast/pull/37) [`abde741`](https://github.com/codefastlabs/codefast/commit/abde741acf18523884da7fd98ed3e8a6379bcac4) Thanks [@thevuong](https://github.com/thevuong)! - fix(day-picker): update role query from "cell" to "gridcell"
|
|
850
876
|
|
|
851
877
|
- [#37](https://github.com/codefastlabs/codefast/pull/37) [`00167ec`](https://github.com/codefastlabs/codefast/commit/00167ec8ca7c04911d3c8844c5172f1765aede9f) Thanks [@thevuong](https://github.com/thevuong)! - refactor(style): improve CSS variable formatting
|
|
852
878
|
|
|
@@ -1160,7 +1186,7 @@
|
|
|
1160
1186
|
|
|
1161
1187
|
### Patch Changes
|
|
1162
1188
|
|
|
1163
|
-
- Remove
|
|
1189
|
+
- Remove "use client" directive from components
|
|
1164
1190
|
|
|
1165
1191
|
## 0.1.15
|
|
1166
1192
|
|
package/README.md
CHANGED
|
@@ -1,337 +1,273 @@
|
|
|
1
|
-
#
|
|
1
|
+
# TypeScript Config
|
|
2
2
|
|
|
3
|
-
Shared TypeScript configuration presets for the CodeFast monorepo, providing
|
|
3
|
+
Shared TypeScript configuration presets for the CodeFast monorepo, providing standardized TypeScript settings for different project types including React applications, Next.js projects, libraries, and base configurations.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
- 🎯 **Multiple Presets** - Tailored configurations for different project types
|
|
8
|
-
- 🏗️ **Extensible Base** - Common base configuration with specialized extensions
|
|
9
|
-
- ⚡ **Modern Standards** - Latest TypeScript features and best practices
|
|
10
|
-
- 🔧 **Strict Configuration** - Enhanced type safety and code quality
|
|
11
|
-
- 📦 **Monorepo Optimized** - Designed for monorepo development workflows
|
|
12
|
-
- 🚀 **Performance Focused** - Optimized compiler options for fast builds
|
|
13
|
-
|
|
14
|
-
## Available Configurations
|
|
15
|
-
|
|
16
|
-
### Base Configuration (`base.json`)
|
|
17
|
-
|
|
18
|
-
Foundational TypeScript configuration with strict settings and modern ES features:
|
|
19
|
-
|
|
20
|
-
- ES2022 target with ESNext modules
|
|
21
|
-
- Strict type checking enabled
|
|
22
|
-
- Declaration files and source maps
|
|
23
|
-
- Optimized for development and production builds
|
|
24
|
-
|
|
25
|
-
### Library Configuration (`library.json`)
|
|
26
|
-
|
|
27
|
-
Extends base configuration for library development:
|
|
28
|
-
|
|
29
|
-
- Composite builds support
|
|
30
|
-
- Incremental compilation
|
|
31
|
-
- Source maps and declaration maps
|
|
32
|
-
- Internal type stripping for clean APIs
|
|
33
|
-
|
|
34
|
-
### React Configuration (`react.json`)
|
|
35
|
-
|
|
36
|
-
Optimized for React components and applications:
|
|
37
|
-
|
|
38
|
-
- React JSX transform (`react-jsx`)
|
|
39
|
-
- React as JSX import source
|
|
40
|
-
- ES2020 target for modern React features
|
|
41
|
-
- Source maps for debugging
|
|
42
|
-
|
|
43
|
-
### Next.js Configuration (`next.json`)
|
|
44
|
-
|
|
45
|
-
Tailored for Next.js applications:
|
|
46
|
-
|
|
47
|
-
- Next.js plugin integration
|
|
48
|
-
- JSX preserve mode
|
|
49
|
-
- JavaScript file support
|
|
50
|
-
- ES2018 target for Next.js compatibility
|
|
51
|
-
- No emit (Next.js handles compilation)
|
|
5
|
+

|
|
52
6
|
|
|
53
7
|
## Installation
|
|
54
8
|
|
|
9
|
+
Install the package via pnpm (recommended):
|
|
10
|
+
|
|
55
11
|
```bash
|
|
56
|
-
# Using pnpm (recommended)
|
|
57
12
|
pnpm add -D @codefast/typescript-config
|
|
13
|
+
```
|
|
58
14
|
|
|
59
|
-
|
|
60
|
-
npm install --save-dev @codefast/typescript-config
|
|
15
|
+
Or using npm:
|
|
61
16
|
|
|
62
|
-
|
|
63
|
-
|
|
17
|
+
```bash
|
|
18
|
+
npm install --save-dev @codefast/typescript-config
|
|
64
19
|
```
|
|
65
20
|
|
|
66
|
-
|
|
21
|
+
**Requirements**:
|
|
67
22
|
|
|
68
|
-
|
|
23
|
+
- Node.js version 20.0.0 or higher
|
|
24
|
+
- TypeScript version 5.0.0 or higher
|
|
69
25
|
|
|
70
|
-
|
|
26
|
+
## Quick Start
|
|
27
|
+
|
|
28
|
+
Create a `tsconfig.json` file in your project and extend from the appropriate configuration:
|
|
71
29
|
|
|
72
30
|
```json
|
|
73
31
|
{
|
|
74
|
-
"extends": "@codefast/typescript-config/
|
|
75
|
-
"compilerOptions": {
|
|
76
|
-
"outDir": "./dist",
|
|
77
|
-
"rootDir": "./src"
|
|
78
|
-
},
|
|
79
|
-
"include": ["src/**/*"],
|
|
80
|
-
"exclude": ["dist", "node_modules", "**/*.test.ts", "**/*.spec.ts"]
|
|
32
|
+
"extends": "@codefast/typescript-config/base.json"
|
|
81
33
|
}
|
|
82
34
|
```
|
|
83
35
|
|
|
84
|
-
|
|
36
|
+
## Usage
|
|
37
|
+
|
|
38
|
+
### Base Configuration
|
|
85
39
|
|
|
86
|
-
|
|
40
|
+
Basic configuration for all TypeScript projects:
|
|
87
41
|
|
|
88
42
|
```json
|
|
89
43
|
{
|
|
90
|
-
"extends": "@codefast/typescript-config/
|
|
44
|
+
"extends": "@codefast/typescript-config/base.json",
|
|
91
45
|
"compilerOptions": {
|
|
92
|
-
"
|
|
93
|
-
"@/*": ["./src/*"]
|
|
94
|
-
}
|
|
46
|
+
"outDir": "./dist"
|
|
95
47
|
},
|
|
96
48
|
"include": ["src/**/*"],
|
|
97
|
-
"exclude": ["node_modules", "dist"
|
|
49
|
+
"exclude": ["node_modules", "dist"]
|
|
98
50
|
}
|
|
99
51
|
```
|
|
100
52
|
|
|
101
|
-
###
|
|
53
|
+
### Library Configuration
|
|
102
54
|
|
|
103
|
-
|
|
55
|
+
For developing libraries and packages:
|
|
104
56
|
|
|
105
57
|
```json
|
|
106
58
|
{
|
|
107
|
-
"extends": "@codefast/typescript-config/
|
|
59
|
+
"extends": "@codefast/typescript-config/library.json",
|
|
108
60
|
"compilerOptions": {
|
|
109
|
-
"
|
|
110
|
-
|
|
111
|
-
}
|
|
61
|
+
"outDir": "./dist",
|
|
62
|
+
"declarationDir": "./dist/types"
|
|
112
63
|
},
|
|
113
|
-
"include": ["
|
|
114
|
-
"exclude": ["node_modules"]
|
|
64
|
+
"include": ["src/**/*"],
|
|
65
|
+
"exclude": ["node_modules", "dist", "**/*.test.ts"]
|
|
115
66
|
}
|
|
116
67
|
```
|
|
117
68
|
|
|
118
|
-
###
|
|
69
|
+
### React Configuration
|
|
119
70
|
|
|
120
|
-
|
|
71
|
+
For React components and applications:
|
|
121
72
|
|
|
122
73
|
```json
|
|
123
74
|
{
|
|
124
|
-
"extends": "@codefast/typescript-config/
|
|
75
|
+
"extends": "@codefast/typescript-config/react.json",
|
|
125
76
|
"compilerOptions": {
|
|
126
|
-
"outDir": "./
|
|
127
|
-
"rootDir": "./src",
|
|
128
|
-
"paths": {
|
|
129
|
-
"@/*": ["./src/*"],
|
|
130
|
-
"@components/*": ["./src/components/*"]
|
|
131
|
-
}
|
|
77
|
+
"outDir": "./dist"
|
|
132
78
|
},
|
|
133
79
|
"include": ["src/**/*"],
|
|
134
|
-
"exclude": ["node_modules", "
|
|
80
|
+
"exclude": ["node_modules", "dist"]
|
|
135
81
|
}
|
|
136
82
|
```
|
|
137
83
|
|
|
138
|
-
|
|
84
|
+
### Next.js Configuration
|
|
139
85
|
|
|
140
|
-
For
|
|
86
|
+
For Next.js applications:
|
|
141
87
|
|
|
142
88
|
```json
|
|
143
89
|
{
|
|
144
|
-
"extends": "
|
|
145
|
-
"
|
|
146
|
-
"
|
|
147
|
-
"
|
|
148
|
-
"
|
|
149
|
-
"
|
|
150
|
-
|
|
151
|
-
"exclude": ["node_modules"
|
|
90
|
+
"extends": "@codefast/typescript-config/next.json",
|
|
91
|
+
"include": [
|
|
92
|
+
"next-env.d.ts",
|
|
93
|
+
"**/*.ts",
|
|
94
|
+
"**/*.tsx",
|
|
95
|
+
".next/types/**/*.ts"
|
|
96
|
+
],
|
|
97
|
+
"exclude": ["node_modules"]
|
|
152
98
|
}
|
|
153
99
|
```
|
|
154
100
|
|
|
155
|
-
##
|
|
156
|
-
|
|
157
|
-
### Compiler Options Explained
|
|
158
|
-
|
|
159
|
-
This section explains the meaning and purpose of each TypeScript compiler option used across our configurations.
|
|
160
|
-
|
|
161
|
-
#### Base Configuration Options (`base.json`)
|
|
162
|
-
|
|
163
|
-
**Module and Import Settings:**
|
|
164
|
-
|
|
165
|
-
- `allowImportingTsExtensions: false` - Prevents importing TypeScript files with `.ts` extensions, enforcing proper module resolution
|
|
166
|
-
- `allowSyntheticDefaultImports: true` - Allows default imports from modules without default exports (e.g., `import React from 'react'`)
|
|
167
|
-
- `esModuleInterop: true` - Enables interoperability between CommonJS and ES modules, making imports more intuitive
|
|
168
|
-
- `module: "ESNext"` - Uses the latest ECMAScript module system for modern bundlers
|
|
169
|
-
- `moduleDetection: "force"` - Forces TypeScript to treat all files as modules, preventing global scope pollution
|
|
170
|
-
- `moduleResolution: "node"` - Uses Node.js-style module resolution for better compatibility with Node.js and npm packages
|
|
171
|
-
- `resolveJsonModule: true` - Allows importing JSON files as modules with type safety
|
|
172
|
-
|
|
173
|
-
**Type Checking and Safety:**
|
|
174
|
-
|
|
175
|
-
- `strict: true` - Enables all strict type checking options for maximum type safety
|
|
176
|
-
- `noImplicitReturns: true` - Ensures all code paths in functions return a value when a return type is specified
|
|
177
|
-
- `noImplicitOverride: true` - Requires explicit `override` keyword when overriding base class methods
|
|
178
|
-
- `noFallthroughCasesInSwitch: true` - Prevents accidental fallthrough in switch statements
|
|
179
|
-
- `noUnusedLocals: true` - Reports errors for unused local variables
|
|
180
|
-
- `noUnusedParameters: true` - Reports errors for unused function parameters
|
|
181
|
-
- `forceConsistentCasingInFileNames: true` - Ensures consistent file name casing across different operating systems
|
|
182
|
-
|
|
183
|
-
**Output and Declaration:**
|
|
184
|
-
|
|
185
|
-
- `declaration: true` - Generates `.d.ts` declaration files for type definitions
|
|
186
|
-
- `declarationMap: true` - Creates source maps for declaration files, enabling "Go to Definition" in editors
|
|
187
|
-
- `incremental: false` - Disables incremental compilation in base config (overridden in specific configs)
|
|
188
|
-
- `noEmitOnError: true` - Prevents emitting JavaScript files when TypeScript errors are present
|
|
101
|
+
## Configurations
|
|
189
102
|
|
|
190
|
-
|
|
103
|
+
### Available Configurations
|
|
191
104
|
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
105
|
+
| Configuration | Description | Use Case |
|
|
106
|
+
|---------------|-------------|----------|
|
|
107
|
+
| `base.json` | Basic configuration with strict settings | Base for all projects |
|
|
108
|
+
| `library.json` | Extends base, adds library-specific options | NPM packages, shared libraries |
|
|
109
|
+
| `react.json` | Extends base, adds React JSX support | React components and apps |
|
|
110
|
+
| `next.json` | Extends base, optimized for Next.js | Next.js applications |
|
|
197
111
|
|
|
198
|
-
|
|
112
|
+
### Base Configuration Features
|
|
199
113
|
|
|
200
|
-
-
|
|
114
|
+
- **Strict Type Checking**: Enables all strict options
|
|
115
|
+
- **Modern JavaScript**: Targets ESNext with full ESNext lib support
|
|
116
|
+
- **Module Resolution**: Node-style resolution with ESNext modules
|
|
117
|
+
- **Developer Experience**: Force consistent casing, no unused variables/parameters
|
|
118
|
+
- **JSON Support**: Resolve JSON modules
|
|
119
|
+
- **Isolated Modules**: Transpile each file separately
|
|
201
120
|
|
|
202
|
-
|
|
121
|
+
### Library Configuration Features
|
|
203
122
|
|
|
204
|
-
**
|
|
123
|
+
- **Declaration Generation**: Automatically generates `.d.ts` files
|
|
124
|
+
- **Source Maps**: Generate source maps for debugging
|
|
125
|
+
- **Strip Internal**: Remove internal declarations from output
|
|
126
|
+
- **ESNext Only**: Does not include DOM libs
|
|
205
127
|
|
|
206
|
-
|
|
207
|
-
- `incremental: true` - Enables incremental compilation for faster subsequent builds
|
|
208
|
-
- `sourceMap: true` - Generates source maps for debugging compiled JavaScript
|
|
128
|
+
### React Configuration Features
|
|
209
129
|
|
|
210
|
-
**
|
|
130
|
+
- **Modern JSX Transform**: Uses `react-jsx` transform
|
|
131
|
+
- **React Import Source**: Automatically import React when needed
|
|
132
|
+
- **DOM Support**: Full DOM and DOM.Iterable libs
|
|
211
133
|
|
|
212
|
-
|
|
213
|
-
- `removeComments: false` - Preserves comments in output for better debugging experience
|
|
214
|
-
- `stripInternal: true` - Removes types marked with `@internal` from declaration files, creating cleaner public APIs
|
|
134
|
+
### Next.js Configuration Features
|
|
215
135
|
|
|
216
|
-
**
|
|
136
|
+
- **JavaScript Support**: Allow `.js` files
|
|
137
|
+
- **Incremental Compilation**: Faster subsequent builds
|
|
138
|
+
- **JSX Preserve**: Let Next.js handle JSX transform
|
|
139
|
+
- **Bundler Resolution**: Optimized for bundler
|
|
140
|
+
- **No Emit**: Next.js handles compilation
|
|
141
|
+
- **Next.js Plugin**: TypeScript plugin support
|
|
217
142
|
|
|
218
|
-
|
|
143
|
+
## API Reference
|
|
219
144
|
|
|
220
|
-
|
|
145
|
+
### Configuration Files
|
|
221
146
|
|
|
222
|
-
|
|
147
|
+
#### `base.json`
|
|
223
148
|
|
|
224
|
-
|
|
225
|
-
- `jsxImportSource: "react"` - Specifies React as the source for JSX runtime functions
|
|
149
|
+
Base configuration with essential compiler options:
|
|
226
150
|
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
151
|
+
```typescript
|
|
152
|
+
interface BaseConfig {
|
|
153
|
+
compilerOptions: {
|
|
154
|
+
allowSyntheticDefaultImports: true;
|
|
155
|
+
declaration: true;
|
|
156
|
+
esModuleInterop: true;
|
|
157
|
+
forceConsistentCasingInFileNames: true;
|
|
158
|
+
isolatedModules: true;
|
|
159
|
+
lib: ["DOM", "DOM.Iterable", "ESNext"];
|
|
160
|
+
module: "ESNext";
|
|
161
|
+
moduleDetection: "force";
|
|
162
|
+
moduleResolution: "node";
|
|
163
|
+
noEmitOnError: true;
|
|
164
|
+
noFallthroughCasesInSwitch: true;
|
|
165
|
+
noImplicitOverride: true;
|
|
166
|
+
noImplicitReturns: true;
|
|
167
|
+
noUnusedLocals: true;
|
|
168
|
+
noUnusedParameters: true;
|
|
169
|
+
resolveJsonModule: true;
|
|
170
|
+
skipLibCheck: true;
|
|
171
|
+
strict: true;
|
|
172
|
+
target: "ESNext";
|
|
173
|
+
useDefineForClassFields: true;
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
```
|
|
250
177
|
|
|
251
|
-
|
|
178
|
+
#### `library.json`
|
|
252
179
|
|
|
253
|
-
-
|
|
254
|
-
- **React** extends base + adds JSX support and React-specific settings
|
|
255
|
-
- **Next.js** extends base + adds Next.js plugin integration and framework-specific optimizations
|
|
180
|
+
Library-specific configuration extending base:
|
|
256
181
|
|
|
257
|
-
|
|
182
|
+
```typescript
|
|
183
|
+
interface LibraryConfig extends BaseConfig {
|
|
184
|
+
compilerOptions: BaseConfig["compilerOptions"] & {
|
|
185
|
+
declaration: true;
|
|
186
|
+
lib: ["ESNext"];
|
|
187
|
+
sourceMap: true;
|
|
188
|
+
stripInternal: true;
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
```
|
|
258
192
|
|
|
259
|
-
|
|
193
|
+
#### `react.json`
|
|
260
194
|
|
|
261
|
-
|
|
195
|
+
React-specific configuration:
|
|
262
196
|
|
|
263
|
-
```
|
|
264
|
-
{
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
},
|
|
270
|
-
{
|
|
271
|
-
"path": "./packages/hooks"
|
|
272
|
-
},
|
|
273
|
-
{
|
|
274
|
-
"path": "./apps/docs"
|
|
275
|
-
}
|
|
276
|
-
]
|
|
197
|
+
```typescript
|
|
198
|
+
interface ReactConfig extends BaseConfig {
|
|
199
|
+
compilerOptions: BaseConfig["compilerOptions"] & {
|
|
200
|
+
jsx: "react-jsx";
|
|
201
|
+
jsxImportSource: "react";
|
|
202
|
+
};
|
|
277
203
|
}
|
|
278
204
|
```
|
|
279
205
|
|
|
280
|
-
|
|
206
|
+
#### `next.json`
|
|
281
207
|
|
|
282
|
-
|
|
208
|
+
Next.js-specific configuration:
|
|
283
209
|
|
|
284
|
-
```
|
|
285
|
-
{
|
|
286
|
-
"compilerOptions"
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
}
|
|
293
|
-
}
|
|
210
|
+
```typescript
|
|
211
|
+
interface NextConfig extends BaseConfig {
|
|
212
|
+
compilerOptions: BaseConfig["compilerOptions"] & {
|
|
213
|
+
allowJs: true;
|
|
214
|
+
incremental: true;
|
|
215
|
+
jsx: "preserve";
|
|
216
|
+
moduleResolution: "bundler";
|
|
217
|
+
noEmit: true;
|
|
218
|
+
plugins: [{ name: "next" }];
|
|
219
|
+
};
|
|
294
220
|
}
|
|
295
221
|
```
|
|
296
222
|
|
|
297
|
-
|
|
223
|
+
## Contributing
|
|
298
224
|
|
|
299
|
-
|
|
225
|
+
We welcome all contributions! To start developing:
|
|
300
226
|
|
|
301
|
-
|
|
302
|
-
// tsconfig.dev.json
|
|
303
|
-
{
|
|
304
|
-
extends: "./tsconfig.json",
|
|
305
|
-
compilerOptions: {
|
|
306
|
-
incremental: true,
|
|
307
|
-
tsBuildInfoFile: ".tsbuildinfo",
|
|
308
|
-
},
|
|
309
|
-
}
|
|
310
|
-
```
|
|
227
|
+
### Environment Setup
|
|
311
228
|
|
|
312
|
-
|
|
229
|
+
1. Fork this repository.
|
|
230
|
+
2. Clone to your machine: `git clone <your-fork-url>`
|
|
231
|
+
3. Install dependencies: `pnpm install`
|
|
232
|
+
4. Create a new branch: `git checkout -b feature/feature-name`
|
|
313
233
|
|
|
314
|
-
###
|
|
234
|
+
### Development Workflow
|
|
315
235
|
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
4. **Path Mapping**: Verify `baseUrl` and `paths` are correctly configured
|
|
236
|
+
```bash
|
|
237
|
+
# Build all packages
|
|
238
|
+
pnpm build:packages
|
|
320
239
|
|
|
321
|
-
|
|
240
|
+
# Development mode for typescript-config
|
|
241
|
+
pnpm dev --filter=@codefast/typescript-config
|
|
322
242
|
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
- Use `skipLibCheck: true` to skip type checking of declaration files
|
|
243
|
+
# Run tests
|
|
244
|
+
pnpm test --filter=@codefast/typescript-config
|
|
326
245
|
|
|
327
|
-
|
|
246
|
+
# Lint and format
|
|
247
|
+
pnpm lint:fix
|
|
248
|
+
pnpm format
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
5. Commit and submit pull request.
|
|
328
252
|
|
|
329
|
-
|
|
253
|
+
See details at [CONTRIBUTING.md](../../CONTRIBUTING.md).
|
|
330
254
|
|
|
331
255
|
## License
|
|
332
256
|
|
|
333
|
-
MIT License
|
|
257
|
+
Distributed under the MIT License. See [LICENSE](../../LICENSE) for more information.
|
|
258
|
+
|
|
259
|
+
## Contact
|
|
260
|
+
|
|
261
|
+
- npm: [@codefast/typescript-config](https://www.npmjs.com/package/@codefast/typescript-config)
|
|
262
|
+
- GitHub: [codefastlabs/codefast](https://github.com/codefastlabs/codefast)
|
|
263
|
+
- Issues: [GitHub Issues](https://github.com/codefastlabs/codefast/issues)
|
|
264
|
+
- Documentation: [TypeScript Config Docs](https://github.com/codefastlabs/codefast/tree/main/packages/typescript-config)
|
|
265
|
+
|
|
266
|
+
## Compatibility
|
|
334
267
|
|
|
335
|
-
|
|
268
|
+
This package is compatible with:
|
|
336
269
|
|
|
337
|
-
|
|
270
|
+
- **TypeScript**: 5.0.0+
|
|
271
|
+
- **Node.js**: 20.0.0+
|
|
272
|
+
- **React**: 18.0.0+ (when using react.json)
|
|
273
|
+
- **Next.js**: 14.0.0+ (when using next.json)
|
package/base.json
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/tsconfig",
|
|
3
3
|
"compilerOptions": {
|
|
4
|
-
"allowImportingTsExtensions": false,
|
|
5
4
|
"allowSyntheticDefaultImports": true,
|
|
6
5
|
"declaration": true,
|
|
7
|
-
"declarationMap": true,
|
|
8
6
|
"esModuleInterop": true,
|
|
9
7
|
"forceConsistentCasingInFileNames": true,
|
|
10
|
-
"incremental": false,
|
|
11
8
|
"isolatedModules": true,
|
|
12
9
|
"lib": ["DOM", "DOM.Iterable", "ESNext"],
|
|
13
10
|
"module": "ESNext",
|
|
@@ -22,9 +19,8 @@
|
|
|
22
19
|
"resolveJsonModule": true,
|
|
23
20
|
"skipLibCheck": true,
|
|
24
21
|
"strict": true,
|
|
25
|
-
"target": "
|
|
26
|
-
"useDefineForClassFields": true
|
|
27
|
-
"verbatimModuleSyntax": false
|
|
22
|
+
"target": "ESNext",
|
|
23
|
+
"useDefineForClassFields": true
|
|
28
24
|
},
|
|
29
25
|
"display": "Base configuration for monorepo packages"
|
|
30
26
|
}
|
package/library.json
CHANGED
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/tsconfig",
|
|
3
3
|
"compilerOptions": {
|
|
4
|
-
"composite": true,
|
|
5
4
|
"declaration": true,
|
|
6
|
-
"declarationMap": true,
|
|
7
|
-
"incremental": true,
|
|
8
5
|
"lib": ["ESNext"],
|
|
9
|
-
"noEmit": false,
|
|
10
|
-
"removeComments": false,
|
|
11
6
|
"sourceMap": true,
|
|
12
7
|
"stripInternal": true
|
|
13
8
|
},
|
package/next.json
CHANGED
|
@@ -4,17 +4,13 @@
|
|
|
4
4
|
"allowJs": true,
|
|
5
5
|
"incremental": true,
|
|
6
6
|
"jsx": "preserve",
|
|
7
|
-
"
|
|
8
|
-
"module": "ESNext",
|
|
9
|
-
"moduleResolution": "node",
|
|
7
|
+
"moduleResolution": "bundler",
|
|
10
8
|
"noEmit": true,
|
|
11
9
|
"plugins": [
|
|
12
10
|
{
|
|
13
11
|
"name": "next"
|
|
14
12
|
}
|
|
15
|
-
]
|
|
16
|
-
"resolveJsonModule": true,
|
|
17
|
-
"target": "ES2018"
|
|
13
|
+
]
|
|
18
14
|
},
|
|
19
15
|
"display": "Next.js application configuration",
|
|
20
16
|
"extends": "./base.json"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codefast/typescript-config",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.7-canary.1",
|
|
4
4
|
"description": "Shared TypeScript configuration for the monorepo",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"typescript",
|
|
@@ -24,7 +24,6 @@
|
|
|
24
24
|
},
|
|
25
25
|
"license": "MIT",
|
|
26
26
|
"author": "Vuong Phan <mr.thevuong@gmail.com>",
|
|
27
|
-
"sideEffects": false,
|
|
28
27
|
"exports": {
|
|
29
28
|
"./base.json": "./base.json",
|
|
30
29
|
"./library.json": "./library.json",
|
package/react.json
CHANGED
|
@@ -2,12 +2,7 @@
|
|
|
2
2
|
"$schema": "https://json.schemastore.org/tsconfig",
|
|
3
3
|
"compilerOptions": {
|
|
4
4
|
"jsx": "react-jsx",
|
|
5
|
-
"jsxImportSource": "react"
|
|
6
|
-
"lib": ["DOM", "DOM.Iterable", "ESNext"],
|
|
7
|
-
"moduleResolution": "node",
|
|
8
|
-
"noEmit": false,
|
|
9
|
-
"sourceMap": true,
|
|
10
|
-
"target": "ES2020"
|
|
5
|
+
"jsxImportSource": "react"
|
|
11
6
|
},
|
|
12
7
|
"display": "React component and application configuration",
|
|
13
8
|
"extends": "./base.json"
|