@4mbl/tsconfig 0.0.0-beta.1ef7e27 → 0.0.0-beta.2891e8a

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,65 @@
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.4.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 05ab9ba: [browser,node,node-ts] Replace `baseUrl` with `paths` catch-all to improve TypeScript 7 support.
8
+
9
+ ## 4.3.0
10
+
11
+ ### Minor Changes
12
+
13
+ - ce274df: node-ts: add rewriteRelativeImportExtensions
14
+
15
+ ## 4.2.0
16
+
17
+ ### Minor Changes
18
+
19
+ - 090f642: Add node-ts template.
20
+
21
+ ## 4.1.3
22
+
23
+ ### Patch Changes
24
+
25
+ - 0957212: Migrate to monorepo setup internally. No changes to the package itself.
26
+
27
+ ## 4.1.2
28
+
29
+ - Setup npm trusted publishing. No changes to the package itself.
30
+
31
+ ## 4.1.1
32
+
33
+ - Fixed missing artifacts in the previous release.
34
+
35
+ ## 4.1.0
36
+
37
+ - Add vite-react template.
38
+
39
+ ## 4.0.1
40
+
41
+ - Move `baseUrl` definition from the base template to child templates to improve Next.js support.
42
+
43
+ ## 4.0.0
44
+
45
+ - 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.
46
+ - Enabled the following options in the base template:
47
+ - `declarationMap`
48
+ - `tsBuildInfoFile` set to `node_modules/.tmp/tsbuildinfo`
49
+ - `verbatimModuleSyntax`
50
+ - `allowSyntheticDefaultImports`
51
+ - `noImplicitOverride`
52
+ - In the Next.js all paths now use paths relative to the project.
53
+ - Removed `tsBuildInfoFile` from browser template in favor of the base template value.
54
+
55
+ ## 3.0.0
56
+
57
+ - Enabled `erasableSyntaxOnly` option in the base template. Requires TypeScript 5.8.0+.
58
+
59
+ ## 2.0.0
60
+
61
+ - Changed path options to use `${configDir}` instead of relative paths in base template. Requires TypeScript 5.5.0+.
62
+
63
+ ## 1.0.0
64
+
65
+ - Initial release
package/README.md CHANGED
@@ -1,6 +1,18 @@
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
+ * [Node-TS (tsconfig)](#node-ts-tsconfig)
10
+ * [Browser (tsconfig)](#browser-tsconfig)
11
+ * [Next (tsconfig)](#next-tsconfig)
12
+ * [Vite React (app | node)](#vite-react-app--node)
13
+ * [Versioning](#versioning)
14
+
15
+ ---
4
16
 
5
17
  ## Usage
6
18
 
@@ -15,29 +27,82 @@ Create a `tsconfig.json` file in the root of your project and extend the desired
15
27
  ```jsonc
16
28
  {
17
29
  "extends": "@4mbl/tsconfig/node"
18
- /* your custom settings */
30
+ // your custom configuration...
19
31
  }
20
32
  ```
21
33
 
22
34
  ## Available templates
23
35
 
24
- There are currently four `tsconfig` templates.
36
+ These are the currently available `tsconfig` templates.
37
+
38
+ ### Base (<kbd>[tsconfig](https://unpkg.com/@4mbl/tsconfig@latest/base.json)</kbd>)
39
+
40
+ This is the base `tsconfig` file that is used by the other templates. It contains common configuration for TypeScript with minimal environment specific configuration.
41
+
42
+ ### Node (<kbd>[tsconfig](https://unpkg.com/@4mbl/tsconfig@latest/node.json)</kbd>)
43
+
44
+ Extends the base template with configuration specific to Node.js.
45
+
46
+ ### Node-TS (<kbd>[tsconfig](https://unpkg.com/@4mbl/tsconfig@latest/node-ts.json)</kbd>)
47
+
48
+ Extends the node template with configuration for TypeScript-only projects.
25
49
 
26
- ### Base <kbd>[tsconfig](https://unpkg.com/@4mbl/tsconfig@latest/base.json)</kbd>
50
+ ### Browser (<kbd>[tsconfig](https://unpkg.com/@4mbl/tsconfig@latest/browser.json)</kbd>)
27
51
 
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.
52
+ Extends the base template with configuration specific to browser and React applications.
29
53
 
30
- ### Node <kbd>[tsconfig](https://unpkg.com/@4mbl/tsconfig@latest/node.json)</kbd>
54
+ ### Next (<kbd>[tsconfig](https://unpkg.com/@4mbl/tsconfig@latest/next.json)</kbd>)
31
55
 
32
- Extends the base template with settings specific to Node.js.
56
+ Extends the base template with configuration from the Next.js app template.
33
57
 
34
- ### Browser <kbd>[tsconfig](https://unpkg.com/@4mbl/tsconfig@latest/browser.json)</kbd>
58
+ [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.
35
59
 
36
- Extends the base template with settings specific to browser and React applications.
60
+ ```jsonc
61
+ {
62
+ "extends": "@4mbl/tsconfig/next",
63
+ "compilerOptions": {
64
+ "paths": {
65
+ "@/*": ["./src/*"]
66
+ }
67
+ },
68
+ "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
69
+ "exclude": ["node_modules"]
70
+ }
71
+ ```
37
72
 
38
- ### Next <kbd>[tsconfig](https://unpkg.com/@4mbl/tsconfig@latest/next.json)</kbd>
73
+ ### 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>)
39
74
 
40
- Extends the base template with settings from the Next.js app template.
75
+ Extends the base template with configuration from Vite's `react-ts` preset.
76
+
77
+ Vite uses seperate `tsconfig` files for the application and the node environment. So you need to have three files in total:
78
+
79
+ **`tsconfig.json`**
80
+
81
+ ```jsonc
82
+ {
83
+ "files": [],
84
+ "references": [
85
+ { "path": "./tsconfig.app.json" },
86
+ { "path": "./tsconfig.node.json" }
87
+ ]
88
+ }
89
+ ```
90
+
91
+ **`tsconfig.app.json`**
92
+
93
+ ```jsonc
94
+ {
95
+ "extends": "@4mbl/tsconfig/vite-react/app"
96
+ }
97
+ ```
98
+
99
+ **`tsconfig.node.json`**
100
+
101
+ ```jsonc
102
+ {
103
+ "extends": "@4mbl/tsconfig/vite-react/node"
104
+ }
105
+ ```
41
106
 
42
107
  ## Versioning
43
108
 
@@ -45,6 +110,6 @@ As of version 4.0.0, the package migrated to a single template per type. The pac
45
110
 
46
111
  The package follows the following versioning scheme: `X.Y.Z`
47
112
 
48
- * `X` - Breaking changes to the base template.
49
- * `Y` - Breaking changes to individual, non-base templates.
50
- * `Z` - Minor fixes to any template.
113
+ - `X` - Breaking changes to the base template.
114
+ - `Y` - Breaking changes to individual, non-base templates. New templates may be introduced.
115
+ - `Z` - Minor fixes to any template.
package/package.json CHANGED
@@ -1,22 +1,34 @@
1
1
  {
2
2
  "name": "@4mbl/tsconfig",
3
- "version": "0.0.0-beta.1ef7e27",
4
- "description": "TypeScript configuration templates for various environments.",
3
+ "version": "0.0.0-beta.2891e8a",
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-ts": "./dist/node-ts.json",
13
+ "./node": "./dist/node.json",
14
+ "./vite-react/app": "./dist/vite-react/app.json",
15
+ "./vite-react/node": "./dist/vite-react/node.json"
16
+ },
17
+ "files": [
18
+ "dist",
19
+ "package.json",
20
+ "README.md",
21
+ "CHANGELOG.md"
22
+ ],
9
23
  "repository": {
10
24
  "type": "git",
11
- "url": "git+https://github.com/4mbl/tsconfig.git"
25
+ "url": "git+https://github.com/4mbl/config.git",
26
+ "directory": "packages/tsconfig"
12
27
  },
13
28
  "keywords": [
14
29
  "typescript",
15
30
  "tsconfig"
16
31
  ],
17
- "scripts": {
18
- "build": "cp templates/*.json ."
19
- },
20
32
  "peerDependencies": {
21
33
  "typescript": ">=5.8.0"
22
34
  },
@@ -24,5 +36,8 @@
24
36
  "typescript": {
25
37
  "optional": true
26
38
  }
39
+ },
40
+ "scripts": {
41
+ "build": "rm -rf dist && mkdir dist && cp -r templates/* dist/ && node scripts/generate-exports.mjs"
27
42
  }
28
- }
43
+ }
package/base.json DELETED
@@ -1,45 +0,0 @@
1
- {
2
- "$schema": "https://json.schemastore.org/tsconfig",
3
- "display": "Base",
4
- "compilerOptions": {
5
- /* Base Options */
6
- "lib": ["ESNext"],
7
- "allowJs": true,
8
- "skipLibCheck": true,
9
- "resolveJsonModule": true,
10
- "moduleDetection": "force",
11
- "baseUrl": "${configDir}/src",
12
- "paths": {
13
- "@/*": ["${configDir}/src/*"]
14
- },
15
-
16
- /* Output */
17
- "target": "ES6",
18
- "outDir": "${configDir}/dist",
19
- "sourceMap": true,
20
- "declarationMap": true,
21
- "composite": true,
22
- "declaration": true,
23
- "incremental": true,
24
- "isolatedModules": true,
25
- "esModuleInterop": true,
26
- "tsBuildInfoFile": "${configDir}/node_modules/.tmp/tsconfig.tsbuildinfo",
27
- "verbatimModuleSyntax": true,
28
-
29
- /* Linting */
30
- "strict": true,
31
- "checkJs": true,
32
- "erasableSyntaxOnly": true,
33
- "forceConsistentCasingInFileNames": true,
34
- "allowSyntheticDefaultImports": true,
35
- "noFallthroughCasesInSwitch": true,
36
- "noImplicitAny": true,
37
- "noImplicitOverride": true,
38
- "noImplicitReturns": false,
39
- "noUnusedLocals": true,
40
- "noUnusedParameters": true,
41
- "noUncheckedIndexedAccess": true
42
- },
43
- "include": ["${configDir}/src/**/*"],
44
- "exclude": ["${configDir}/node_modules"]
45
- }
package/browser.json DELETED
@@ -1,13 +0,0 @@
1
- {
2
- "$schema": "https://json.schemastore.org/tsconfig",
3
- "display": "Browser",
4
- "extends": "./base.json",
5
- "compilerOptions": {
6
- "lib": ["DOM", "DOM.Iterable", "ESNext"],
7
- "jsx": "react-jsx",
8
- "module": "ESNext",
9
- "moduleResolution": "Bundler",
10
- "noEmit": true,
11
- "sourceMap": true
12
- }
13
- }
package/next.json DELETED
@@ -1,37 +0,0 @@
1
- {
2
- "$schema": "https://json.schemastore.org/tsconfig",
3
- "display": "Next.js",
4
- "extends": "./base.json",
5
- "compilerOptions": {
6
- "target": "ES2017",
7
- "lib": ["dom", "dom.iterable", "esnext"],
8
- "allowJs": true,
9
- "skipLibCheck": true,
10
- "strict": true,
11
- "noEmit": true,
12
- "esModuleInterop": true,
13
- "module": "preserve",
14
- "moduleResolution": "bundler",
15
- "resolveJsonModule": true,
16
- "isolatedModules": true,
17
- "jsx": "preserve",
18
- "incremental": true,
19
- "plugins": [
20
- {
21
- "name": "next"
22
- }
23
- ],
24
- "paths": {
25
- "@/*": ["${configDir}/src/*"]
26
- },
27
- "rootDir": "${configDir}/src",
28
- "baseUrl": "${configDir}"
29
- },
30
- "include": [
31
- "${configDir}/next-env.d.ts",
32
- "${configDir}/**/*.ts",
33
- "${configDir}/**/*.tsx",
34
- "${configDir}/.next/types/**/*.ts"
35
- ],
36
- "exclude": ["${configDir}/node_modules"]
37
- }
package/node.json DELETED
@@ -1,10 +0,0 @@
1
- {
2
- "$schema": "https://json.schemastore.org/tsconfig",
3
- "display": "Node",
4
- "extends": "./base.json",
5
- "compilerOptions": {
6
- "target": "ESNext",
7
- "moduleResolution": "NodeNext",
8
- "module": "NodeNext"
9
- }
10
- }