@4mbl/tsconfig 0.0.0-beta.d1ebf2c → 0.0.0-beta.eaadc61

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 CHANGED
@@ -1,11 +1,26 @@
1
1
  # @4mbl/tsconfig Changelog
2
2
 
3
+ ## 4.1.2
4
+
5
+ * Setup npm trusted publishing. No changes to the package itself.
6
+
7
+ ## 4.1.1
8
+
9
+ * Fixed missing artifacts in the previous release.
10
+
11
+ ## 4.1.0
12
+
13
+ * Add vite-react template.
14
+
15
+ ## 4.0.1
16
+
17
+ * Move `baseUrl` definition from the base template to child templates to improve Next.js support.
18
+
3
19
  ## 4.0.0
4
20
 
5
21
  * Migrated from versioned templates to a single template per type. The package version is now used to determine the template version. This simplifies both the maintenance and usage of the package.
6
22
  * Enabled the following options in the base template:
7
23
  * `declarationMap`
8
- * `composite`
9
24
  * `tsBuildInfoFile` set to `node_modules/.tmp/tsbuildinfo`
10
25
  * `verbatimModuleSyntax`
11
26
  * `allowSyntheticDefaultImports`
package/README.md CHANGED
@@ -1,6 +1,17 @@
1
1
  # @4mbl/tsconfig
2
2
 
3
- > TypeScript configuration templates for various environments.
3
+ > Strict TypeScript configuration for various environments.
4
+
5
+ * [Usage](#usage)
6
+ * [Available templates](#available-templates)
7
+ * [Base (tsconfig)](#base-tsconfig)
8
+ * [Node (tsconfig)](#node-tsconfig)
9
+ * [Browser (tsconfig)](#browser-tsconfig)
10
+ * [Next (tsconfig)](#next-tsconfig)
11
+ * [Vite React (app | node)](#vite-react-app--node)
12
+ * [Versioning](#versioning)
13
+
14
+ ---
4
15
 
5
16
  ## Usage
6
17
 
@@ -15,29 +26,78 @@ Create a `tsconfig.json` file in the root of your project and extend the desired
15
26
  ```jsonc
16
27
  {
17
28
  "extends": "@4mbl/tsconfig/node"
18
- /* your custom settings */
29
+ // your custom configuration...
19
30
  }
20
31
  ```
21
32
 
22
33
  ## Available templates
23
34
 
24
- There are currently four `tsconfig` templates.
35
+ There are currently five `tsconfig` templates.
36
+
37
+ ### Base (<kbd>[tsconfig](https://unpkg.com/@4mbl/tsconfig@latest/base.json)</kbd>)
38
+
39
+ This is the base `tsconfig` file that is used by the other templates. It contains common configuration for TypeScript with minimal environment specific configuration.
25
40
 
26
- ### Base <kbd>[tsconfig](https://unpkg.com/@4mbl/tsconfig@latest/base.json)</kbd>
41
+ ### Node (<kbd>[tsconfig](https://unpkg.com/@4mbl/tsconfig@latest/node.json)</kbd>)
27
42
 
28
- This is the base `tsconfig` file that is used by the other templates. It contains common configuration for TypeScript with minimal environment specific settings.
43
+ Extends the base template with configuration specific to Node.js.
29
44
 
30
- ### Node <kbd>[tsconfig](https://unpkg.com/@4mbl/tsconfig@latest/node.json)</kbd>
45
+ ### Browser (<kbd>[tsconfig](https://unpkg.com/@4mbl/tsconfig@latest/browser.json)</kbd>)
31
46
 
32
- Extends the base template with settings specific to Node.js.
47
+ Extends the base template with configuration specific to browser and React applications.
33
48
 
34
- ### Browser <kbd>[tsconfig](https://unpkg.com/@4mbl/tsconfig@latest/browser.json)</kbd>
49
+ ### Next (<kbd>[tsconfig](https://unpkg.com/@4mbl/tsconfig@latest/next.json)</kbd>)
35
50
 
36
- Extends the base template with settings specific to browser and React applications.
51
+ Extends the base template with configuration from the Next.js app template.
37
52
 
38
- ### Next <kbd>[tsconfig](https://unpkg.com/@4mbl/tsconfig@latest/next.json)</kbd>
53
+ [Next.js does not yet support tsconfig template variables](https://github.com/vercel/next.js/issues/70912), so you need to override the paths manually on the `tsconfig.json` file of your project.
39
54
 
40
- Extends the base template with settings from the Next.js app template.
55
+ ```jsonc
56
+ {
57
+ "extends": "@4mbl/tsconfig/next",
58
+ "compilerOptions": {
59
+ "paths": {
60
+ "@/*": ["./src/*"]
61
+ }
62
+ },
63
+ "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
64
+ "exclude": ["node_modules"]
65
+ }
66
+ ```
67
+
68
+ ### Vite React (<kbd>[app](https://unpkg.com/@4mbl/tsconfig@latest/vite-react/app.json)</kbd> | <kbd>[node](https://unpkg.com/@4mbl/tsconfig@latest/vite-react/node.json)</kbd>)
69
+
70
+ Extends the base template with configuration from Vite's `react-ts` preset.
71
+
72
+ Vite uses seperate `tsconfig` files for the application and the node environment. So you need to have three files in total:
73
+
74
+ **`tsconfig.json`**
75
+
76
+ ```jsonc
77
+ {
78
+ "files": [],
79
+ "references": [
80
+ { "path": "./tsconfig.app.json" },
81
+ { "path": "./tsconfig.node.json" }
82
+ ]
83
+ }
84
+ ```
85
+
86
+ **`tsconfig.app.json`**
87
+
88
+ ```jsonc
89
+ {
90
+ "extends": "@4mbl/tsconfig/vite-react/app"
91
+ }
92
+ ```
93
+
94
+ **`tsconfig.node.json`**
95
+
96
+ ```jsonc
97
+ {
98
+ "extends": "@4mbl/tsconfig/vite-react/node"
99
+ }
100
+ ```
41
101
 
42
102
  ## Versioning
43
103
 
@@ -46,5 +106,5 @@ As of version 4.0.0, the package migrated to a single template per type. The pac
46
106
  The package follows the following versioning scheme: `X.Y.Z`
47
107
 
48
108
  * `X` - Breaking changes to the base template.
49
- * `Y` - Breaking changes to individual, non-base templates.
109
+ * `Y` - Breaking changes to individual, non-base templates. New templates may be introduced.
50
110
  * `Z` - Minor fixes to any template.
package/base.json CHANGED
@@ -1,7 +1,6 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/tsconfig",
3
3
  "display": "Base",
4
- "_version": "3.0.0",
5
4
  "compilerOptions": {
6
5
  /* Base Options */
7
6
  "lib": ["ESNext"],
@@ -9,7 +8,6 @@
9
8
  "skipLibCheck": true,
10
9
  "resolveJsonModule": true,
11
10
  "moduleDetection": "force",
12
- "baseUrl": "${configDir}/src",
13
11
  "paths": {
14
12
  "@/*": ["${configDir}/src/*"]
15
13
  },
@@ -19,7 +17,6 @@
19
17
  "outDir": "${configDir}/dist",
20
18
  "sourceMap": true,
21
19
  "declarationMap": true,
22
- "composite": true,
23
20
  "declaration": true,
24
21
  "incremental": true,
25
22
  "isolatedModules": true,
package/browser.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/tsconfig",
3
3
  "display": "Browser",
4
- "_version": "3.0.0",
5
- "extends": "../base/3.0.0.json",
4
+ "extends": "./base.json",
6
5
  "compilerOptions": {
7
6
  "lib": ["DOM", "DOM.Iterable", "ESNext"],
8
7
  "jsx": "react-jsx",
9
8
  "module": "ESNext",
10
9
  "moduleResolution": "Bundler",
10
+ "baseUrl": "${configDir}/src",
11
11
  "noEmit": true,
12
12
  "sourceMap": true
13
13
  }
package/next.json CHANGED
@@ -1,8 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/tsconfig",
3
3
  "display": "Next.js",
4
- "_version": "3.0.0",
5
- "extends": "../base/3.0.0.json",
4
+ "extends": "./base.json",
6
5
  "compilerOptions": {
7
6
  "target": "ES2017",
8
7
  "lib": ["dom", "dom.iterable", "esnext"],
@@ -24,9 +23,7 @@
24
23
  ],
25
24
  "paths": {
26
25
  "@/*": ["${configDir}/src/*"]
27
- },
28
- "rootDir": "${configDir}/src",
29
- "baseUrl": "${configDir}"
26
+ }
30
27
  },
31
28
  "include": [
32
29
  "${configDir}/next-env.d.ts",
package/node.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/tsconfig",
3
3
  "display": "Node",
4
- "_version": "3.0.0",
5
- "extends": "../base/3.0.0.json",
4
+ "extends": "./base.json",
6
5
  "compilerOptions": {
7
6
  "target": "ESNext",
8
7
  "moduleResolution": "NodeNext",
9
- "module": "NodeNext"
8
+ "module": "NodeNext",
9
+ "baseUrl": "${configDir}/src"
10
10
  }
11
11
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@4mbl/tsconfig",
3
- "version": "0.0.0-beta.d1ebf2c",
4
- "description": "TypeScript configuration templates for various environments.",
3
+ "version": "0.0.0-beta.eaadc61",
4
+ "description": "Strict TypeScript configuration for various environments.",
5
5
  "type": "module",
6
6
  "author": "4mbl",
7
7
  "license": "MIT",
@@ -15,7 +15,7 @@
15
15
  "tsconfig"
16
16
  ],
17
17
  "scripts": {
18
- "build": "cp templates/*.json ."
18
+ "build": "cp -r templates/* ."
19
19
  },
20
20
  "peerDependencies": {
21
21
  "typescript": ">=5.8.0"
@@ -0,0 +1,22 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/tsconfig",
3
+ "display": "Vite React (App)",
4
+ "extends": "../base.json",
5
+ "compilerOptions": {
6
+ "tsBuildInfoFile": "${configDir}/node_modules/.tmp/tsconfig.app.tsbuildinfo",
7
+ "target": "ES2022",
8
+ "useDefineForClassFields": true,
9
+ "lib": ["ES2022", "DOM", "DOM.Iterable"],
10
+ "module": "ESNext",
11
+
12
+ /* Bundler mode */
13
+ "moduleResolution": "bundler",
14
+ "allowImportingTsExtensions": true,
15
+ "noEmit": true,
16
+ "jsx": "react-jsx",
17
+
18
+ /* Linting */
19
+ "noUncheckedSideEffectImports": true
20
+ },
21
+ "include": ["${configDir}/src"]
22
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/tsconfig",
3
+ "display": "Vite React (Node)",
4
+ "extends": "../base.json",
5
+ "compilerOptions": {
6
+ "tsBuildInfoFile": "${configDir}/node_modules/.tmp/tsconfig.node.tsbuildinfo",
7
+ "target": "ES2023",
8
+ "lib": ["ES2023"],
9
+ "module": "ESNext",
10
+
11
+ /* Bundler mode */
12
+ "moduleResolution": "bundler",
13
+ "allowImportingTsExtensions": true,
14
+ "noEmit": true,
15
+
16
+ /* Linting */
17
+ "noUncheckedSideEffectImports": true
18
+ },
19
+ "include": ["${configDir}/vite.config.ts"]
20
+ }