@codecompose/typescript-config 1.1.2 → 1.2.0

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/README.md CHANGED
@@ -3,23 +3,23 @@
3
3
  Opinionated reusable Typescript configurations, assuming:
4
4
 
5
5
  - A monorepo setup (\*)
6
- - Transpile with a bundler
6
+ - Transpile using a bundler
7
7
  - Strict rules
8
8
  - Use of `src` and `dist` directories
9
9
  - Use of `~/` as path alias for `src`
10
10
 
11
11
  (\*) Use the `single-*.json` variants if you do **not** use a monorepo setup.
12
12
 
13
- All configurations have `incremental` set to `true`. For this reason I recommend
14
- adding the following script to your manifest based on `del-cli`:
13
+ ## Warning
15
14
 
16
- `"clean": "del dist tsconfig.tsbuildinfo"`
17
-
18
- In my experience, it can happen that builds get stuck in limbo and you need to
19
- delete the `tsbuildinfo` file to get things going again.
15
+ At the time of writing, not all tooling correctly interprets the extended
16
+ config.
20
17
 
21
- Source maps are not enabled, because we assume that your bundler will handle
22
- that.
18
+ - Next.js will require you to explicitly defined "includes". Give it "src" and
19
+ it will inject its types on startup.
20
+ - TSUP will not understand the tsconfig if you ask it to generate type
21
+ definitions. I use tsc to generate the types, as demonstrated in
22
+ [mono-ts](https://github.com/0x80/mono-ts).
23
23
 
24
24
  ## Install
25
25
 
@@ -37,9 +37,25 @@ that.
37
37
 
38
38
  ## Available Configurations
39
39
 
40
+ - base
40
41
  - library
41
42
  - react-library
42
43
  - service
43
44
  - nextjs
44
45
  - single-library
45
46
  - single-react-library
47
+
48
+ For something else, like a CLI or E2E app you can probably just use the
49
+ `base.json` configuration.
50
+
51
+ ## Assumptions and Recommendations
52
+
53
+ Source maps are not enabled, because we assume that your bundler will handle
54
+ that.
55
+
56
+ All configurations have `incremental` set to `true`. In my experience, it can
57
+ happen that builds get stuck in limbo and you need to delete the `tsbuildinfo`
58
+ file to get things going again. For this reason I recommend adding the following
59
+ script to your manifest based on `del-cli`:
60
+
61
+ `"clean": "del dist tsconfig.tsbuildinfo"`
package/base.json CHANGED
@@ -20,7 +20,7 @@
20
20
 
21
21
  /* Opinion */
22
22
  "incremental": true,
23
- "tsBuildInfoFile": "${configDir}/.tsbuildinfo",
23
+ "tsBuildInfoFile": "${configDir}/tsconfig.tsbuildinfo",
24
24
  "module": "preserve",
25
25
  "outDir": "${configDir}/dist",
26
26
  "baseUrl": "${configDir}",
package/library.json CHANGED
@@ -5,9 +5,9 @@
5
5
  "compilerOptions": {
6
6
  /* AND if you're building for a library: */
7
7
  "declaration": true,
8
+ "declarationMap": true,
8
9
 
9
10
  /* AND if you're building for a library in a monorepo: */
10
- "composite": true,
11
- "declarationMap": true
11
+ "composite": true
12
12
  }
13
13
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@codecompose/typescript-config",
3
3
  "description": "Opinionated reusable TypeScript configurations",
4
- "version": "1.1.2",
4
+ "version": "1.2.0",
5
5
  "license": "MIT",
6
6
  "author": "Thijs Koerselman",
7
7
  "publishConfig": {
@@ -3,7 +3,7 @@
3
3
  "display": "A React Component Library",
4
4
  "extends": "./base.json",
5
5
  "compilerOptions": {
6
- "lib": ["dom", "dom.iterable", "es2023"],
6
+ "lib": ["dom", "dom.iterable", "esnext"],
7
7
  "jsx": "react-jsx",
8
8
 
9
9
  /* AND if you're building for a library: */
@@ -4,6 +4,7 @@
4
4
  "extends": "./base.json",
5
5
  "compilerOptions": {
6
6
  /* AND if you're building for a library: */
7
- "declaration": true
7
+ "declaration": true,
8
+ "declarationMap": true
8
9
  }
9
10
  }
@@ -3,10 +3,11 @@
3
3
  "display": "A Single React Component Library",
4
4
  "extends": "./base.json",
5
5
  "compilerOptions": {
6
- "lib": ["dom", "dom.iterable", "es2023"],
6
+ "lib": ["dom", "dom.iterable", "esnext"],
7
7
  "jsx": "react-jsx",
8
8
 
9
9
  /* AND if you're building for a library: */
10
- "declaration": true
10
+ "declaration": true,
11
+ "declarationMap": true
11
12
  }
12
13
  }