@petbee/tsconfig 1.0.3 → 2.0.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
@@ -10,6 +10,55 @@ yarn add -D @petbee/tsconfig
10
10
 
11
11
  ## Usage
12
12
 
13
+ ### React Project
14
+
15
+ #### React Application Project
16
+
17
+ To start, create a `tsconfig.json` in the root of your project.
18
+
19
+ A typical setup where the application sit in `[project root]/app` folder is as follow:
20
+
21
+ ```json
22
+ {
23
+ "extends": "@petbee/tsconfig/react/application.json",
24
+ "compilerOptions": {
25
+ "baseUrl": ".",
26
+ "rootDir": ".",
27
+ "paths": { "*": ["*", "app/*"] }
28
+ },
29
+ "include": ["./app/**/*", "./client/**/*", "./server/**/*", "./tests/**/*"]
30
+ }
31
+ ```
32
+
33
+ #### React Library Project
34
+
35
+ Similarly for a react library project. Create a `tsconfig.json` in the root of your project with a setup below assuming the library code sit in `[project root]/src` folder.
36
+
37
+ ```json
38
+ {
39
+ "extends": "@petbee/tsconfig/react/library.json",
40
+ "compilerOptions": {
41
+ "baseUrl": "./src",
42
+ "rootDir": "."
43
+ },
44
+ "include": ["./src/**/*"]
45
+ }
46
+ ```
47
+
48
+ #### Project that run in the browser
49
+
50
+ A configuration file is provided that included styles setup and a more conservative build target.
51
+
52
+ ```json
53
+ {
54
+ "extends": "@petbee/tsconfig/react/dom.json",
55
+ "compilerOptions": {
56
+ "baseUrl": ".",
57
+ "rootDir": "."
58
+ }
59
+ }
60
+ ```
61
+
13
62
  ### NestJS Project
14
63
 
15
64
  To start, create a `tsconfig.json` in the root of your project.
@@ -26,13 +75,46 @@ A typical setup where the application sit in `[project root]/app` folder is as f
26
75
  }
27
76
  ```
28
77
 
78
+ ### NodeJS Project
79
+
80
+ #### Node Application Project
81
+
82
+ To start, create a `tsconfig.json` in the root of your project.
83
+
84
+ A typical setup where the application sit in `[project root]/src` folder is as follow:
85
+
86
+ ```json
87
+ {
88
+ "extends": "@petbee/tsconfig/node/base.json",
89
+ "compilerOptions": {
90
+ "baseUrl": "./",
91
+ "outDir": "./dist"
92
+ }
93
+ }
94
+ ```
95
+
96
+ #### Node Library Project
97
+
98
+ Similarly for a node library project. Create a `tsconfig.json` in the root of your project with a setup below assuming the library code sit in `[project root]/src` folder.
99
+
100
+ ```json
101
+ {
102
+ "extends": "@petbee/tsconfig/node/library.json",
103
+ "compilerOptions": {
104
+ "baseUrl": "./src",
105
+ "rootDir": "."
106
+ },
107
+ "include": ["./src/**/*"]
108
+ }
109
+ ```
110
+
29
111
  ### All Other Project
30
112
 
31
113
  A base configuration file is also provided if the above does not fit your need.
32
114
 
33
115
  ```json
34
116
  {
35
- "extends": "@petbee/tsconfig",
117
+ "extends": "@petbee/tsconfig/base.json",
36
118
  "compilerOptions": {
37
119
  "baseUrl": ".",
38
120
  "rootDir": "."
@@ -50,7 +132,7 @@ eg.
50
132
 
51
133
  ```json
52
134
  {
53
- "extends": "@petbee/tsconfig",
135
+ "extends": "@petbee/tsconfig/base.json",
54
136
  "compilerOptions": {
55
137
  "baseUrl": ".",
56
138
  "rootDir": ".",
@@ -1,26 +1,21 @@
1
1
  {
2
+ "compileOnSave": false,
2
3
  "compilerOptions": {
3
- "alwaysStrict": true,
4
- "allowSyntheticDefaultImports": true,
5
4
  "esModuleInterop": true,
6
- "jsx": "react",
7
- "lib": ["es2017", "dom", "es2018.promise", "esnext.asynciterable", "es2020", "esnext"],
8
- "module": "esnext",
5
+ "isolatedModules": true,
6
+ "experimentalDecorators": true,
7
+ "lib": ["dom", "es2020"],
9
8
  "moduleResolution": "node",
10
9
  "noImplicitAny": true,
11
10
  "noImplicitReturns": true,
12
11
  "noImplicitThis": true,
13
12
  "noUnusedLocals": true,
14
13
  "noUnusedParameters": true,
14
+ "resolveJsonModule": true,
15
15
  "skipLibCheck": true,
16
- "sourceMap": true,
16
+ "strict": true,
17
17
  "strictFunctionTypes": true,
18
18
  "strictNullChecks": true,
19
- "strictPropertyInitialization": true,
20
- "target": "esnext",
21
19
  "forceConsistentCasingInFileNames": true
22
- },
23
- "typeAcquisition": {
24
- "enable": true
25
20
  }
26
21
  }
package/nestjs.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "emitDecoratorMetadata": true,
7
7
  "experimentalDecorators": true,
8
8
  "allowSyntheticDefaultImports": true,
9
- "target": "ES2019",
9
+ "target": "es2020",
10
10
  "sourceMap": true,
11
11
  "outDir": "./dist",
12
12
  "baseUrl": "./",
package/node/base.json ADDED
@@ -0,0 +1,15 @@
1
+ {
2
+ "compileOnSave": false,
3
+ "compilerOptions": {
4
+ "esModuleInterop": true,
5
+ "isolatedModules": true,
6
+ "experimentalDecorators": true,
7
+ "lib": ["es2020"],
8
+ "moduleResolution": "node",
9
+ "noUnusedLocals": true,
10
+ "noUnusedParameters": true,
11
+ "resolveJsonModule": true,
12
+ "skipLibCheck": true,
13
+ "strict": true
14
+ }
15
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "extends": "./base.json",
3
+ "compilerOptions": {
4
+ "declaration": true,
5
+ "declarationMap": true,
6
+ "noEmit": false,
7
+ "noEmitHelpers": true
8
+ }
9
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@petbee/tsconfig",
3
- "version": "1.0.3",
3
+ "version": "2.0.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -15,5 +15,5 @@
15
15
  "peerDependencies": {
16
16
  "typescript": "^3 || ^4 || ^5"
17
17
  },
18
- "gitHead": "4abb4d54bdc927736aee06803e0e9a5d179acfa1"
18
+ "gitHead": "0885e6ebef089afcee9b87428cf90ecb8c95e946"
19
19
  }
@@ -0,0 +1,6 @@
1
+ {
2
+ "extends": "./dom.json",
3
+ "compilerOptions": {
4
+ "noEmit": true
5
+ }
6
+ }
package/react/dom.json ADDED
@@ -0,0 +1,10 @@
1
+ {
2
+ "extends": "../base.json",
3
+ "compilerOptions": {
4
+ "jsx": "react",
5
+ "lib": ["dom", "dom.iterable", "scripthost", "es2020"],
6
+ "module": "esnext",
7
+ "target": "es2020"
8
+ },
9
+ "files": ["./definitions/images.d.ts", "./definitions/styles.d.ts"]
10
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "extends": "./dom.json",
3
+ "compilerOptions": {
4
+ "declaration": true,
5
+ "declarationMap": true,
6
+ "noEmit": false,
7
+ "noEmitHelpers": true
8
+ }
9
+ }