@4mbl/tsconfig 3.0.0 → 4.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/CHANGELOG.md ADDED
@@ -0,0 +1,25 @@
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
+ * `tsBuildInfoFile` set to `node_modules/.tmp/tsbuildinfo`
9
+ * `verbatimModuleSyntax`
10
+ * `allowSyntheticDefaultImports`
11
+ * `noImplicitOverride`
12
+ * In the Next.js all paths now use paths relative to the project.
13
+ * Removed `tsBuildInfoFile` from browser template in favor of the base template value.
14
+
15
+ ## 3.0.0
16
+
17
+ * Enabled `erasableSyntaxOnly` option in the base template. Requires TypeScript 5.8.0+.
18
+
19
+ ## 2.0.0
20
+
21
+ * Changed path options to use `${configDir}` instead of relative paths in base template. Requires TypeScript 5.5.0+.
22
+
23
+ ## 1.0.0
24
+
25
+ * Initial release
package/README.md CHANGED
@@ -14,7 +14,7 @@ Create a `tsconfig.json` file in the root of your project and extend the desired
14
14
 
15
15
  ```jsonc
16
16
  {
17
- "extends": "@4mbl/tsconfig/node/latest"
17
+ "extends": "@4mbl/tsconfig/node"
18
18
  /* your custom settings */
19
19
  }
20
20
  ```
@@ -23,42 +23,45 @@ Create a `tsconfig.json` file in the root of your project and extend the desired
23
23
 
24
24
  There are currently four `tsconfig` templates.
25
25
 
26
- ### Base <kbd>[tsconfig](https://unpkg.com/@4mbl/tsconfig@latest/base/latest.json) | [changelog](./base/changelog.md)</kbd>
26
+ ### Base <kbd>[tsconfig](https://unpkg.com/@4mbl/tsconfig@latest/base.json)</kbd>
27
27
 
28
- This is the base `tsconfig` file that is used by the other templates. It contains the basic configuration for TypeScript without any environment specific settings.
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.
29
29
 
30
- ### Node <kbd>[tsconfig](https://unpkg.com/@4mbl/tsconfig@latest/node/latest.json) | [changelog](./node/changelog.md)</kbd>
30
+ ### Node <kbd>[tsconfig](https://unpkg.com/@4mbl/tsconfig@latest/node.json)</kbd>
31
31
 
32
- Extends the base template and adds settings specific to Node.js.
32
+ Extends the base template with settings specific to Node.js.
33
33
 
34
- ### Browser <kbd>[tsconfig](https://unpkg.com/@4mbl/tsconfig@latest/browser/latest.json) | [changelog](./browser/changelog.md)</kbd>
34
+ ### Browser <kbd>[tsconfig](https://unpkg.com/@4mbl/tsconfig@latest/browser.json)</kbd>
35
35
 
36
- Extends the base template and adds settings specific to browser and React applications.
36
+ Extends the base template with settings specific to browser and React applications.
37
37
 
38
- ### Next.js <kbd>[tsconfig](https://unpkg.com/@4mbl/tsconfig@latest/next/latest.json) | [changelog](./next/changelog.md)</kbd>
38
+ ### Next <kbd>[tsconfig](https://unpkg.com/@4mbl/tsconfig@latest/next.json)</kbd>
39
39
 
40
- Extends the base template and with settings from the Next.js app template.
40
+ Extends the base template with settings from the Next.js app template.
41
41
 
42
- ## Versioning
43
-
44
- The package and each template are versioned separately. Seperate versioning allows you to update the package without worrying about breaking changes to the templates. It also allows you to easily test newer versions of the templates by just changing the `extends` field in the `tsconfig` file of your project.
45
-
46
- ### Package versioning
42
+ [Next.js does not yet support tsconfig template variables](https://github.com/vercel/next.js/issues/70912), so you need to configure the path settings manually on the `tsconfig.json` file of your project.
47
43
 
48
- The package itself follows the following versioning scheme: `major.minor.patch`
49
-
50
- * `major` - Base template is changed and older template versions may be removed.
51
- * `minor` - Non-base template is changed or added.
52
- * `patch` - Non-breaking changes to the templates.
44
+ ```jsonc
45
+ {
46
+ "extends": "@4mbl/tsconfig/next",
47
+ "compilerOptions": {
48
+ "paths": {
49
+ "@/*": ["./src/*"]
50
+ }
51
+ },
52
+ "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
53
+ "exclude": ["node_modules"]
54
+ }
55
+ ```
53
56
 
54
- If you are extending a specific version of a template in your project, you can update the package without worrying about any breaking changes to your project.
57
+ The Next.js template should work without extra configuration as soon as Next.js supports tsconfig template variables. Until then, you need to set the paths settings manually.
55
58
 
56
- ### Template versioning
59
+ ## Versioning
57
60
 
58
- Each template is versioned separately. The versioning scheme is: `major.minor.patch`
61
+ 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.
59
62
 
60
- * `major` - Major overhaul of the template. Major changes to upstream templates warrant a major version on the inheriting templates.
61
- * `minor` - Breaking changes to the template.
62
- * `patch` - Non-breaking changes to the template.
63
+ The package follows the following versioning scheme: `X.Y.Z`
63
64
 
64
- Each template also has a `latest` version. However, it is not recommended to extend the `latest` version in your project as it may introduce breaking changes when the package is updated.
65
+ * `X` - Breaking changes to the base template.
66
+ * `Y` - Breaking changes to individual, non-base templates.
67
+ * `Z` - Minor fixes to any template.
@@ -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,8 +8,7 @@
9
8
  "skipLibCheck": true,
10
9
  "resolveJsonModule": true,
11
10
  "moduleDetection": "force",
12
- "rootDir": "${configDir}/src",
13
- "baseUrl": "${configDir}/",
11
+ "baseUrl": "${configDir}/src",
14
12
  "paths": {
15
13
  "@/*": ["${configDir}/src/*"]
16
14
  },
@@ -19,18 +17,23 @@
19
17
  "target": "ES6",
20
18
  "outDir": "${configDir}/dist",
21
19
  "sourceMap": true,
20
+ "declarationMap": true,
22
21
  "declaration": true,
23
22
  "incremental": true,
24
23
  "isolatedModules": true,
25
24
  "esModuleInterop": true,
25
+ "tsBuildInfoFile": "${configDir}/node_modules/.tmp/tsconfig.tsbuildinfo",
26
+ "verbatimModuleSyntax": true,
26
27
 
27
28
  /* Linting */
28
29
  "strict": true,
29
30
  "checkJs": true,
30
31
  "erasableSyntaxOnly": true,
31
32
  "forceConsistentCasingInFileNames": true,
33
+ "allowSyntheticDefaultImports": true,
32
34
  "noFallthroughCasesInSwitch": true,
33
35
  "noImplicitAny": true,
36
+ "noImplicitOverride": true,
34
37
  "noImplicitReturns": false,
35
38
  "noUnusedLocals": true,
36
39
  "noUnusedParameters": true,
@@ -1,15 +1,13 @@
1
- {
2
- "$schema": "https://json.schemastore.org/tsconfig",
3
- "display": "Browser",
4
- "_version": "1.0.0",
5
- "extends": "../base/1.0.0.json",
6
- "compilerOptions": {
7
- "lib": ["DOM", "DOM.Iterable", "ESNext"],
8
- "jsx": "react-jsx",
9
- "tsBuildInfoFile": "tsconfig.browser.tsbuildinfo",
10
- "module": "ESNext",
11
- "moduleResolution": "Bundler",
12
- "noEmit": true,
13
- "sourceMap": true
14
- }
15
- }
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
+ }
@@ -1,9 +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",
6
-
4
+ "extends": "./base.json",
7
5
  "compilerOptions": {
8
6
  "target": "ES2017",
9
7
  "lib": ["dom", "dom.iterable", "esnext"],
@@ -12,7 +10,7 @@
12
10
  "strict": true,
13
11
  "noEmit": true,
14
12
  "esModuleInterop": true,
15
- "module": "esnext",
13
+ "module": "preserve",
16
14
  "moduleResolution": "bundler",
17
15
  "resolveJsonModule": true,
18
16
  "isolatedModules": true,
@@ -24,9 +22,14 @@
24
22
  }
25
23
  ],
26
24
  "paths": {
27
- "@/*": ["./src/*"]
25
+ "@/*": ["${configDir}/src/*"]
28
26
  }
29
27
  },
30
- "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
31
- "exclude": ["node_modules"]
28
+ "include": [
29
+ "${configDir}/next-env.d.ts",
30
+ "${configDir}/**/*.ts",
31
+ "${configDir}/**/*.tsx",
32
+ "${configDir}/.next/types/**/*.ts"
33
+ ],
34
+ "exclude": ["${configDir}/node_modules"]
32
35
  }
@@ -1,11 +1,10 @@
1
- {
2
- "$schema": "https://json.schemastore.org/tsconfig",
3
- "display": "Node",
4
- "_version": "1.0.0",
5
- "extends": "../base/1.0.0.json",
6
- "compilerOptions": {
7
- "target": "ESNext",
8
- "moduleResolution": "NodeNext",
9
- "module": "NodeNext"
10
- }
11
- }
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
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@4mbl/tsconfig",
3
- "version": "3.0.0",
3
+ "version": "4.0.0",
4
4
  "description": "TypeScript configuration templates for various environments.",
5
5
  "type": "module",
6
6
  "author": "4mbl",
@@ -15,14 +15,7 @@
15
15
  "tsconfig"
16
16
  ],
17
17
  "scripts": {
18
- "build": "node ./scripts/copyLatest.js '*'",
19
- "delete:latest": "node ./scripts/deleteLatestJson.js",
20
- "delete:version": "node ./scripts/deleteVersionFile.js",
21
- "get:version": "node -pe \"require('./package.json')['version']\" > version.txt",
22
- "release": "npm run get:version && npm run build && npm publish && npm run delete:latest && git add . && git commit --file version.txt && git push && npm run delete:version",
23
- "release:patch": "npm version patch --no-git-tag-version && npm run release",
24
- "release:minor": "npm version minor --no-git-tag-version && npm run release",
25
- "release:major": "npm version major --no-git-tag-version && npm run release"
18
+ "build": "cp templates/*.json ."
26
19
  },
27
20
  "peerDependencies": {
28
21
  "typescript": ">=5.8.0"
package/base/1.0.0.json DELETED
@@ -1,40 +0,0 @@
1
- {
2
- "$schema": "https://json.schemastore.org/tsconfig",
3
- "display": "Base",
4
- "_version": "1.0.0",
5
- "compilerOptions": {
6
- /* Base Options */
7
- "lib": ["ESNext"],
8
- "allowJs": true,
9
- "skipLibCheck": true,
10
- "resolveJsonModule": true,
11
- "moduleDetection": "force",
12
- "rootDir": "../../../../../../../",
13
- "baseUrl": "../../../../../../../",
14
- "paths": {
15
- "@/*": ["../../../../../../../src/*"]
16
- },
17
-
18
- /* Output */
19
- "target": "ES6",
20
- "outDir": "dist",
21
- "sourceMap": true,
22
- "declaration": true,
23
- "incremental": true,
24
- "isolatedModules": true,
25
- "esModuleInterop": true,
26
-
27
- /* Linting */
28
- "checkJs": true,
29
- "forceConsistentCasingInFileNames": true,
30
- "noFallthroughCasesInSwitch": true,
31
- "noImplicitAny": true,
32
- "noImplicitReturns": false,
33
- "noUnusedLocals": true,
34
- "noUnusedParameters": true,
35
- "strict": true,
36
- "noUncheckedIndexedAccess": true
37
- },
38
- "include": ["../../../../../../../src/**/*"],
39
- "exclude": ["../../../../../../node_modules"]
40
- }
package/base/2.0.0.json DELETED
@@ -1,40 +0,0 @@
1
- {
2
- "$schema": "https://json.schemastore.org/tsconfig",
3
- "display": "Base",
4
- "_version": "2.0.0",
5
- "compilerOptions": {
6
- /* Base Options */
7
- "lib": ["ESNext"],
8
- "allowJs": true,
9
- "skipLibCheck": true,
10
- "resolveJsonModule": true,
11
- "moduleDetection": "force",
12
- "rootDir": "${configDir}/",
13
- "baseUrl": "${configDir}/",
14
- "paths": {
15
- "@/*": ["${configDir}/src/*"]
16
- },
17
-
18
- /* Output */
19
- "target": "ES6",
20
- "outDir": "dist",
21
- "sourceMap": true,
22
- "declaration": true,
23
- "incremental": true,
24
- "isolatedModules": true,
25
- "esModuleInterop": true,
26
-
27
- /* Linting */
28
- "strict": true,
29
- "checkJs": true,
30
- "forceConsistentCasingInFileNames": true,
31
- "noFallthroughCasesInSwitch": true,
32
- "noImplicitAny": true,
33
- "noImplicitReturns": false,
34
- "noUnusedLocals": true,
35
- "noUnusedParameters": true,
36
- "noUncheckedIndexedAccess": true
37
- },
38
- "include": ["${configDir}/src/**/*"],
39
- "exclude": ["${configDir}/node_modules"]
40
- }
package/base/2.0.1.json DELETED
@@ -1,40 +0,0 @@
1
- {
2
- "$schema": "https://json.schemastore.org/tsconfig",
3
- "display": "Base",
4
- "_version": "2.0.1",
5
- "compilerOptions": {
6
- /* Base Options */
7
- "lib": ["ESNext"],
8
- "allowJs": true,
9
- "skipLibCheck": true,
10
- "resolveJsonModule": true,
11
- "moduleDetection": "force",
12
- "rootDir": "${configDir}/src",
13
- "baseUrl": "${configDir}/",
14
- "paths": {
15
- "@/*": ["${configDir}/src/*"]
16
- },
17
-
18
- /* Output */
19
- "target": "ES6",
20
- "outDir": "${configDir}/dist",
21
- "sourceMap": true,
22
- "declaration": true,
23
- "incremental": true,
24
- "isolatedModules": true,
25
- "esModuleInterop": true,
26
-
27
- /* Linting */
28
- "strict": true,
29
- "checkJs": true,
30
- "forceConsistentCasingInFileNames": true,
31
- "noFallthroughCasesInSwitch": true,
32
- "noImplicitAny": true,
33
- "noImplicitReturns": false,
34
- "noUnusedLocals": true,
35
- "noUnusedParameters": true,
36
- "noUncheckedIndexedAccess": true
37
- },
38
- "include": ["${configDir}/src/**/*"],
39
- "exclude": ["${configDir}/node_modules"]
40
- }
package/base/3.0.0.json DELETED
@@ -1,41 +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
- "rootDir": "${configDir}/src",
13
- "baseUrl": "${configDir}/",
14
- "paths": {
15
- "@/*": ["${configDir}/src/*"]
16
- },
17
-
18
- /* Output */
19
- "target": "ES6",
20
- "outDir": "${configDir}/dist",
21
- "sourceMap": true,
22
- "declaration": true,
23
- "incremental": true,
24
- "isolatedModules": true,
25
- "esModuleInterop": true,
26
-
27
- /* Linting */
28
- "strict": true,
29
- "checkJs": true,
30
- "erasableSyntaxOnly": true,
31
- "forceConsistentCasingInFileNames": true,
32
- "noFallthroughCasesInSwitch": true,
33
- "noImplicitAny": true,
34
- "noImplicitReturns": false,
35
- "noUnusedLocals": true,
36
- "noUnusedParameters": true,
37
- "noUncheckedIndexedAccess": true
38
- },
39
- "include": ["${configDir}/src/**/*"],
40
- "exclude": ["${configDir}/node_modules"]
41
- }
@@ -1,15 +0,0 @@
1
- {
2
- "$schema": "https://json.schemastore.org/tsconfig",
3
- "display": "Browser",
4
- "_version": "2.0.0",
5
- "extends": "../base/2.0.0.json",
6
- "compilerOptions": {
7
- "lib": ["DOM", "DOM.Iterable", "ESNext"],
8
- "jsx": "react-jsx",
9
- "tsBuildInfoFile": "tsconfig.browser.tsbuildinfo",
10
- "module": "ESNext",
11
- "moduleResolution": "Bundler",
12
- "noEmit": true,
13
- "sourceMap": true
14
- }
15
- }
@@ -1,15 +0,0 @@
1
- {
2
- "$schema": "https://json.schemastore.org/tsconfig",
3
- "display": "Browser",
4
- "_version": "2.0.1",
5
- "extends": "../base/2.0.1.json",
6
- "compilerOptions": {
7
- "lib": ["DOM", "DOM.Iterable", "ESNext"],
8
- "jsx": "react-jsx",
9
- "tsBuildInfoFile": "tsconfig.browser.tsbuildinfo",
10
- "module": "ESNext",
11
- "moduleResolution": "Bundler",
12
- "noEmit": true,
13
- "sourceMap": true
14
- }
15
- }
@@ -1,15 +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
- "tsBuildInfoFile": "tsconfig.browser.tsbuildinfo",
10
- "module": "ESNext",
11
- "moduleResolution": "Bundler",
12
- "noEmit": true,
13
- "sourceMap": true
14
- }
15
- }
@@ -1,15 +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
- "tsBuildInfoFile": "tsconfig.browser.tsbuildinfo",
10
- "module": "ESNext",
11
- "moduleResolution": "Bundler",
12
- "noEmit": true,
13
- "sourceMap": true
14
- }
15
- }
package/next/latest.json DELETED
@@ -1,32 +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
-
7
- "compilerOptions": {
8
- "target": "ES2017",
9
- "lib": ["dom", "dom.iterable", "esnext"],
10
- "allowJs": true,
11
- "skipLibCheck": true,
12
- "strict": true,
13
- "noEmit": true,
14
- "esModuleInterop": true,
15
- "module": "esnext",
16
- "moduleResolution": "bundler",
17
- "resolveJsonModule": true,
18
- "isolatedModules": true,
19
- "jsx": "preserve",
20
- "incremental": true,
21
- "plugins": [
22
- {
23
- "name": "next"
24
- }
25
- ],
26
- "paths": {
27
- "@/*": ["./src/*"]
28
- }
29
- },
30
- "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
31
- "exclude": ["node_modules"]
32
- }
package/node/2.0.0.json DELETED
@@ -1,11 +0,0 @@
1
- {
2
- "$schema": "https://json.schemastore.org/tsconfig",
3
- "display": "Node",
4
- "_version": "2.0.0",
5
- "extends": "../base/2.0.0.json",
6
- "compilerOptions": {
7
- "target": "ESNext",
8
- "moduleResolution": "NodeNext",
9
- "module": "NodeNext"
10
- }
11
- }
package/node/2.0.1.json DELETED
@@ -1,11 +0,0 @@
1
- {
2
- "$schema": "https://json.schemastore.org/tsconfig",
3
- "display": "Node",
4
- "_version": "2.0.1",
5
- "extends": "../base/2.0.1.json",
6
- "compilerOptions": {
7
- "target": "ESNext",
8
- "moduleResolution": "NodeNext",
9
- "module": "NodeNext"
10
- }
11
- }
package/node/3.0.0.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
- }
package/node/latest.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
- }