@codecompose/typescript-config 1.0.5 → 1.1.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/README.md +24 -10
- package/library.json +0 -3
- package/package.json +8 -4
- package/react-library.json +0 -2
- package/single-library.json +9 -0
- package/single-react-library.json +12 -0
package/README.md
CHANGED
|
@@ -1,31 +1,45 @@
|
|
|
1
1
|
# typescript-config
|
|
2
2
|
|
|
3
|
-
Opinionated reusable Typescript configurations
|
|
3
|
+
Opinionated reusable Typescript configurations, assuming:
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
- A monorepo setup
|
|
8
|
-
- You transpile using a bundler
|
|
5
|
+
- A monorepo setup (\*)
|
|
6
|
+
- Transpile with a bundler
|
|
9
7
|
- Strict rules
|
|
10
|
-
- src and dist directories
|
|
11
|
-
-
|
|
8
|
+
- Use of `src` and `dist` directories
|
|
9
|
+
- Use of `~/` as path alias for `src`
|
|
10
|
+
|
|
11
|
+
(\*) Use the `single-*.json` variants if you do **not** use a monorepo setup.
|
|
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`:
|
|
15
|
+
|
|
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.
|
|
20
|
+
|
|
21
|
+
Source maps are not enabled, because we assume that your bundler will handle
|
|
22
|
+
that.
|
|
12
23
|
|
|
13
24
|
## Install
|
|
14
25
|
|
|
15
|
-
pnpm i @codecompose/typescript-config
|
|
26
|
+
`pnpm i @codecompose/typescript-config -D`
|
|
27
|
+
|
|
28
|
+
...or the equivalent for your package manager.
|
|
16
29
|
|
|
17
30
|
## Usage
|
|
18
31
|
|
|
19
32
|
```json
|
|
20
33
|
{
|
|
21
|
-
"extends": "@codecompose/typescript-config/library.json"
|
|
34
|
+
"extends": "@codecompose/typescript-config/single-react-library.json"
|
|
22
35
|
}
|
|
23
36
|
```
|
|
24
37
|
|
|
25
38
|
## Available Configurations
|
|
26
39
|
|
|
27
|
-
- base
|
|
28
40
|
- library
|
|
29
41
|
- react-library
|
|
30
42
|
- service
|
|
31
43
|
- nextjs
|
|
44
|
+
- single-library
|
|
45
|
+
- single-react-library
|
package/library.json
CHANGED
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.
|
|
4
|
+
"version": "1.1.1",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Thijs Koerselman",
|
|
7
7
|
"publishConfig": {
|
|
@@ -20,12 +20,16 @@
|
|
|
20
20
|
],
|
|
21
21
|
"files": [
|
|
22
22
|
"base.json",
|
|
23
|
-
"nextjs.json",
|
|
24
23
|
"library.json",
|
|
24
|
+
"nextjs.json",
|
|
25
25
|
"react-library.json",
|
|
26
|
-
"service.json"
|
|
26
|
+
"service.json",
|
|
27
|
+
"single-library.json",
|
|
28
|
+
"single-react-library.json"
|
|
27
29
|
],
|
|
28
30
|
"devDependencies": {
|
|
29
|
-
"eslint": "^8.57.0"
|
|
31
|
+
"eslint": "^8.57.0",
|
|
32
|
+
"prettier": "^3.3.3",
|
|
33
|
+
"prettier-plugin-jsdoc": "^1.3.0"
|
|
30
34
|
}
|
|
31
35
|
}
|
package/react-library.json
CHANGED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json.schemastore.org/tsconfig",
|
|
3
|
+
"display": "A Single React Component Library",
|
|
4
|
+
"extends": "./base.json",
|
|
5
|
+
"compilerOptions": {
|
|
6
|
+
"lib": ["dom", "dom.iterable", "es2023"],
|
|
7
|
+
"jsx": "react-jsx",
|
|
8
|
+
|
|
9
|
+
/* AND if you're building for a library: */
|
|
10
|
+
"declaration": true
|
|
11
|
+
}
|
|
12
|
+
}
|