@codecompose/typescript-config 1.1.3 → 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 +25 -9
- package/library.json +2 -2
- package/package.json +1 -1
- package/react-library.json +1 -1
- package/single-library.json +2 -1
- package/single-react-library.json +3 -2
package/README.md
CHANGED
|
@@ -3,23 +3,23 @@
|
|
|
3
3
|
Opinionated reusable Typescript configurations, assuming:
|
|
4
4
|
|
|
5
5
|
- A monorepo setup (\*)
|
|
6
|
-
- Transpile
|
|
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
|
-
|
|
14
|
-
adding the following script to your manifest based on `del-cli`:
|
|
13
|
+
## Warning
|
|
15
14
|
|
|
16
|
-
|
|
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
|
-
|
|
22
|
-
|
|
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/library.json
CHANGED
package/package.json
CHANGED
package/react-library.json
CHANGED
package/single-library.json
CHANGED
|
@@ -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", "
|
|
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
|
}
|