@4mbl/tsconfig 1.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/README.md ADDED
@@ -0,0 +1,78 @@
1
+ # @4mbl/tsconfig
2
+
3
+ > Templates for `tsconfig` files for various environments.
4
+
5
+ ## Usage
6
+
7
+ Install the [`@4mbl/tsconfig`](https://www.npmjs.com/package/@4mbl/tsconfig) npm package.
8
+
9
+ ```shell
10
+ npm install -D @4mbl/tsconfig
11
+ ```
12
+
13
+ Create a `tsconfig.json` file in the root of your project and extend the desired `tsconfig` template.
14
+
15
+ ```jsonc
16
+ {
17
+ "extends": "@4mbl/tsconfig/node/latest"
18
+ /* your custom settings */
19
+ }
20
+ ```
21
+
22
+ To avoid path related problems, you should override the following settings in your project's `tsconfig` file.
23
+
24
+ ```jsonc
25
+ {
26
+ "extends": "@4mbl/tsconfig/node/latest",
27
+ "include": ["src/**/*"],
28
+ "exclude": ["node_modules"],
29
+ "compilerOptions": {
30
+ "rootDir": "src",
31
+ "paths": {
32
+ "@/*": ["*"]
33
+ }
34
+ }
35
+
36
+ /* your custom settings */
37
+ }
38
+ ```
39
+
40
+ ## Available templates
41
+
42
+ There are currently three `tsconfig` templates.
43
+
44
+ ### Base <kbd>[tsconfig](./base/latest.json) | [changelog](./base/CHANGELOG.md)</kbd>
45
+
46
+ This is the base `tsconfig` file that is used by the other `tsconfig` files. It contains the basic configuration for TypeScript without any environment specific settings.
47
+
48
+ ### Node <kbd>[tsconfig](./node/latest.json) | [changelog](./node/CHANGELOG.md)</kbd>
49
+
50
+ Extends the base `tsconfig` file and adds settings specific to Node.js.
51
+
52
+ ### Browser <kbd>[tsconfig](./browser/latest.json) | [changelog](./browser/CHANGELOG.md)</kbd>
53
+
54
+ Extends the base `tsconfig` file and adds settings specific to browser and React applications.
55
+
56
+ ## Versioning
57
+
58
+ 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 updating the `extends` field in your project's `tsconfig` file.
59
+
60
+ ### Package versioning
61
+
62
+ The package itself follows the following versioning scheme: `major.minor.patch`
63
+
64
+ * `major` - Base template is changed and older template versions may be removed.
65
+ * `minor` - Non-base template is changed or added.
66
+ * `patch` - Non-breaking changes to the templates.
67
+
68
+ If you are using a specific version of the template in your project's `tsconfig` file, you can update the package without worrying about any breaking changes to your project.
69
+
70
+ ### Template versioning
71
+
72
+ Each template is versioned separately. The versioning scheme is: `major.minor.patch`
73
+
74
+ * `major` - Major overhaul of the template. Rarely used.
75
+ * `minor` - Breaking changes to the template.
76
+ * `patch` - Non-breaking changes to the template.
77
+
78
+ Each template also has a `latest` version. However, it is not recommended to use the `latest` version in your project's `tsconfig` file as it may introduce breaking changes when the package is updated.
@@ -0,0 +1,40 @@
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
+ }
@@ -0,0 +1,40 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/tsconfig",
3
+ "display": "Base",
4
+ "_version": "0.0.1",
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
+ }
@@ -0,0 +1,15 @@
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
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/tsconfig",
3
+ "display": "Browser",
4
+ "_version": "0.0.1",
5
+ "extends": "../base/0.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
+ }
@@ -0,0 +1,11 @@
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
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/tsconfig",
3
+ "display": "Node",
4
+ "_version": "0.0.1",
5
+ "extends": "../base/0.0.1.json",
6
+ "compilerOptions": {
7
+ "target": "ESNext",
8
+ "moduleResolution": "NodeNext",
9
+ "module": "NodeNext"
10
+ }
11
+ }
package/package.json ADDED
@@ -0,0 +1,25 @@
1
+ {
2
+ "name": "@4mbl/tsconfig",
3
+ "version": "1.0.0",
4
+ "description": "tsconfig templates for typescript projects",
5
+ "type": "module",
6
+ "author": "4mbl",
7
+ "license": "MIT",
8
+ "homepage": "https://github.com/4mbl/tsconfig#readme",
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/4mbl/tsconfig.git"
12
+ },
13
+ "keywords": [
14
+ "typescript",
15
+ "tsconfig"
16
+ ],
17
+ "scripts": {
18
+ "build": "node ./scripts/copyLatest.js *",
19
+ "get:version": "node -pe \"require('./package.json')['version']\" > version.txt",
20
+ "release": "npm run get:version && npm run build && npm publish && git add . && git commit --file version.txt && git push && rm version.txt",
21
+ "release:patch": "npm version patch --no-git-tag-version && npm run release",
22
+ "release:minor": "npm version minor --no-git-tag-version && npm run release",
23
+ "release:major": "npm version major --no-git-tag-version && npm run release"
24
+ }
25
+ }