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

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,26 +1,47 @@
1
- # @4mbl/tsconfig Changelog
2
-
3
- ## 4.0.0
4
-
5
- * 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
- * Enabled the following options in the base template:
7
- * `declarationMap`
8
- * `composite`
9
- * `tsBuildInfoFile` set to `node_modules/.tmp/tsbuildinfo`
10
- * `verbatimModuleSyntax`
11
- * `allowSyntheticDefaultImports`
12
- * `noImplicitOverride`
13
- * In the Next.js all paths now use paths relative to the project.
14
- * Removed `tsBuildInfoFile` from browser template in favor of the base template value.
15
-
16
- ## 3.0.0
17
-
18
- * Enabled `erasableSyntaxOnly` option in the base template. Requires TypeScript 5.8.0+.
19
-
20
- ## 2.0.0
21
-
22
- * Changed path options to use `${configDir}` instead of relative paths in base template. Requires TypeScript 5.5.0+.
23
-
24
- ## 1.0.0
25
-
26
- * Initial release
1
+ # @4mbl/tsconfig Changelog
2
+
3
+ ## 4.1.3
4
+
5
+ ### Patch Changes
6
+
7
+ - 0957212: Migrate to monorepo setup internally. No changes to the package itself.
8
+
9
+ ## 4.1.2
10
+
11
+ - Setup npm trusted publishing. No changes to the package itself.
12
+
13
+ ## 4.1.1
14
+
15
+ - Fixed missing artifacts in the previous release.
16
+
17
+ ## 4.1.0
18
+
19
+ - Add vite-react template.
20
+
21
+ ## 4.0.1
22
+
23
+ - Move `baseUrl` definition from the base template to child templates to improve Next.js support.
24
+
25
+ ## 4.0.0
26
+
27
+ - 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.
28
+ - Enabled the following options in the base template:
29
+ - `declarationMap`
30
+ - `tsBuildInfoFile` set to `node_modules/.tmp/tsbuildinfo`
31
+ - `verbatimModuleSyntax`
32
+ - `allowSyntheticDefaultImports`
33
+ - `noImplicitOverride`
34
+ - In the Next.js all paths now use paths relative to the project.
35
+ - Removed `tsBuildInfoFile` from browser template in favor of the base template value.
36
+
37
+ ## 3.0.0
38
+
39
+ - Enabled `erasableSyntaxOnly` option in the base template. Requires TypeScript 5.8.0+.
40
+
41
+ ## 2.0.0
42
+
43
+ - Changed path options to use `${configDir}` instead of relative paths in base template. Requires TypeScript 5.5.0+.
44
+
45
+ ## 1.0.0
46
+
47
+ - Initial release
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/package.json CHANGED
@@ -1,22 +1,33 @@
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.df1c48b",
4
+ "description": "Strict TypeScript configuration for various environments.",
5
5
  "type": "module",
6
6
  "author": "4mbl",
7
7
  "license": "MIT",
8
- "homepage": "https://github.com/4mbl/tsconfig#readme",
8
+ "homepage": "https://github.com/4mbl/config/tree/main/packages/tsconfig#readme",
9
+ "exports": {
10
+ "./browser": "./dist/browser.json",
11
+ "./next": "./dist/next.json",
12
+ "./node": "./dist/node.json",
13
+ "./vite-react/app": "./dist/vite-react/app.json",
14
+ "./vite-react/node": "./dist/vite-react/node.json"
15
+ },
16
+ "files": [
17
+ "dist",
18
+ "package.json",
19
+ "README.md",
20
+ "CHANGELOG.md"
21
+ ],
9
22
  "repository": {
10
23
  "type": "git",
11
- "url": "git+https://github.com/4mbl/tsconfig.git"
24
+ "url": "git+https://github.com/4mbl/config.git",
25
+ "directory": "packages/tsconfig"
12
26
  },
13
27
  "keywords": [
14
28
  "typescript",
15
29
  "tsconfig"
16
30
  ],
17
- "scripts": {
18
- "build": "cp templates/*.json ."
19
- },
20
31
  "peerDependencies": {
21
32
  "typescript": ">=5.8.0"
22
33
  },
@@ -24,5 +35,8 @@
24
35
  "typescript": {
25
36
  "optional": true
26
37
  }
38
+ },
39
+ "scripts": {
40
+ "build": "rm -rf dist && mkdir dist && cp -r templates/* dist/ && node scripts/generate-exports.mjs"
27
41
  }
28
- }
42
+ }
package/base.json DELETED
@@ -1,46 +0,0 @@
1
- {
2
- "$schema": "https://json.schemastore.org/tsconfig",
3
- "display": "Base",
4
- "_version": "3.0.0",
5
- "compilerOptions": {
6
- /* Base Options */
7
- "lib": ["ESNext"],
8
- "allowJs": true,
9
- "skipLibCheck": true,
10
- "resolveJsonModule": true,
11
- "moduleDetection": "force",
12
- "baseUrl": "${configDir}/src",
13
- "paths": {
14
- "@/*": ["${configDir}/src/*"]
15
- },
16
-
17
- /* Output */
18
- "target": "ES6",
19
- "outDir": "${configDir}/dist",
20
- "sourceMap": true,
21
- "declarationMap": true,
22
- "composite": true,
23
- "declaration": true,
24
- "incremental": true,
25
- "isolatedModules": true,
26
- "esModuleInterop": true,
27
- "tsBuildInfoFile": "${configDir}/node_modules/.tmp/tsconfig.tsbuildinfo",
28
- "verbatimModuleSyntax": true,
29
-
30
- /* Linting */
31
- "strict": true,
32
- "checkJs": true,
33
- "erasableSyntaxOnly": true,
34
- "forceConsistentCasingInFileNames": true,
35
- "allowSyntheticDefaultImports": true,
36
- "noFallthroughCasesInSwitch": true,
37
- "noImplicitAny": true,
38
- "noImplicitOverride": true,
39
- "noImplicitReturns": false,
40
- "noUnusedLocals": true,
41
- "noUnusedParameters": true,
42
- "noUncheckedIndexedAccess": true
43
- },
44
- "include": ["${configDir}/src/**/*"],
45
- "exclude": ["${configDir}/node_modules"]
46
- }
package/browser.json DELETED
@@ -1,14 +0,0 @@
1
- {
2
- "$schema": "https://json.schemastore.org/tsconfig",
3
- "display": "Browser",
4
- "_version": "3.0.0",
5
- "extends": "../base/3.0.0.json",
6
- "compilerOptions": {
7
- "lib": ["DOM", "DOM.Iterable", "ESNext"],
8
- "jsx": "react-jsx",
9
- "module": "ESNext",
10
- "moduleResolution": "Bundler",
11
- "noEmit": true,
12
- "sourceMap": true
13
- }
14
- }
package/next.json DELETED
@@ -1,38 +0,0 @@
1
- {
2
- "$schema": "https://json.schemastore.org/tsconfig",
3
- "display": "Next.js",
4
- "_version": "3.0.0",
5
- "extends": "../base/3.0.0.json",
6
- "compilerOptions": {
7
- "target": "ES2017",
8
- "lib": ["dom", "dom.iterable", "esnext"],
9
- "allowJs": true,
10
- "skipLibCheck": true,
11
- "strict": true,
12
- "noEmit": true,
13
- "esModuleInterop": true,
14
- "module": "preserve",
15
- "moduleResolution": "bundler",
16
- "resolveJsonModule": true,
17
- "isolatedModules": true,
18
- "jsx": "preserve",
19
- "incremental": true,
20
- "plugins": [
21
- {
22
- "name": "next"
23
- }
24
- ],
25
- "paths": {
26
- "@/*": ["${configDir}/src/*"]
27
- },
28
- "rootDir": "${configDir}/src",
29
- "baseUrl": "${configDir}"
30
- },
31
- "include": [
32
- "${configDir}/next-env.d.ts",
33
- "${configDir}/**/*.ts",
34
- "${configDir}/**/*.tsx",
35
- "${configDir}/.next/types/**/*.ts"
36
- ],
37
- "exclude": ["${configDir}/node_modules"]
38
- }
package/node.json DELETED
@@ -1,11 +0,0 @@
1
- {
2
- "$schema": "https://json.schemastore.org/tsconfig",
3
- "display": "Node",
4
- "_version": "3.0.0",
5
- "extends": "../base/3.0.0.json",
6
- "compilerOptions": {
7
- "target": "ESNext",
8
- "moduleResolution": "NodeNext",
9
- "module": "NodeNext"
10
- }
11
- }