@4mbl/tsconfig 0.0.0-beta.00cfefd

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.
Files changed (3) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/README.md +110 -0
  3. package/package.json +42 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,47 @@
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 ADDED
@@ -0,0 +1,110 @@
1
+ # @4mbl/tsconfig
2
+
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
+ ---
15
+
16
+ ## Usage
17
+
18
+ Install the [`@4mbl/tsconfig`](https://www.npmjs.com/package/@4mbl/tsconfig) npm package.
19
+
20
+ ```shell
21
+ npm install -D @4mbl/tsconfig
22
+ ```
23
+
24
+ Create a `tsconfig.json` file in the root of your project and extend the desired `tsconfig` template.
25
+
26
+ ```jsonc
27
+ {
28
+ "extends": "@4mbl/tsconfig/node"
29
+ // your custom configuration...
30
+ }
31
+ ```
32
+
33
+ ## Available templates
34
+
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.
40
+
41
+ ### Node (<kbd>[tsconfig](https://unpkg.com/@4mbl/tsconfig@latest/node.json)</kbd>)
42
+
43
+ Extends the base template with configuration specific to Node.js.
44
+
45
+ ### Browser (<kbd>[tsconfig](https://unpkg.com/@4mbl/tsconfig@latest/browser.json)</kbd>)
46
+
47
+ Extends the base template with configuration specific to browser and React applications.
48
+
49
+ ### Next (<kbd>[tsconfig](https://unpkg.com/@4mbl/tsconfig@latest/next.json)</kbd>)
50
+
51
+ Extends the base template with configuration from the Next.js app template.
52
+
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.
54
+
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
+ ```
101
+
102
+ ## Versioning
103
+
104
+ As of version 4.0.0, the package migrated 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.
105
+
106
+ The package follows the following versioning scheme: `X.Y.Z`
107
+
108
+ * `X` - Breaking changes to the base template.
109
+ * `Y` - Breaking changes to individual, non-base templates. New templates may be introduced.
110
+ * `Z` - Minor fixes to any template.
package/package.json ADDED
@@ -0,0 +1,42 @@
1
+ {
2
+ "name": "@4mbl/tsconfig",
3
+ "version": "0.0.0-beta.00cfefd",
4
+ "description": "Strict TypeScript configuration for various environments.",
5
+ "type": "module",
6
+ "author": "4mbl",
7
+ "license": "MIT",
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
+ ],
22
+ "repository": {
23
+ "type": "git",
24
+ "url": "git+https://github.com/4mbl/config.git",
25
+ "directory": "packages/tsconfig"
26
+ },
27
+ "keywords": [
28
+ "typescript",
29
+ "tsconfig"
30
+ ],
31
+ "peerDependencies": {
32
+ "typescript": ">=5.8.0"
33
+ },
34
+ "peerDependenciesMeta": {
35
+ "typescript": {
36
+ "optional": true
37
+ }
38
+ },
39
+ "scripts": {
40
+ "build": "rm -rf dist && mkdir dist && cp -r templates/* dist/ && node scripts/generate-exports.mjs"
41
+ }
42
+ }