@yuu1111/tsconfig 1.0.3 → 1.0.5

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.ja.md ADDED
@@ -0,0 +1,82 @@
1
+ [English](README.md)
2
+
3
+ # @yuu1111/tsconfig
4
+
5
+ 共有のTypeScript設定
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ bun add -D @yuu1111/tsconfig
11
+ ```
12
+
13
+ ## Usage
14
+
15
+ `tsconfig.json` でpresetの1つをextendsする
16
+
17
+ ### Base
18
+
19
+ ```json
20
+ {
21
+ "extends": "@yuu1111/tsconfig/base.json"
22
+ }
23
+ ```
24
+
25
+ ### Bun
26
+
27
+ 利用Projectで `@types/bun` をinstallしてからBun presetをextendsする
28
+
29
+ ```json
30
+ {
31
+ "extends": "@yuu1111/tsconfig/bun.json"
32
+ }
33
+ ```
34
+
35
+ ### Library
36
+
37
+ ```json
38
+ {
39
+ "extends": "@yuu1111/tsconfig/library.json",
40
+ "compilerOptions": {
41
+ "rootDir": "src",
42
+ "outDir": "dist"
43
+ },
44
+ "include": ["src/**/*.ts"]
45
+ }
46
+ ```
47
+
48
+ ### Declaration-only library
49
+
50
+ bundlerがJavaScriptを出し、TypeScriptはdeclaration fileだけを出す場合にこのpresetを使う
51
+
52
+ ```json
53
+ {
54
+ "extends": "@yuu1111/tsconfig/declaration-only.json",
55
+ "compilerOptions": {
56
+ "rootDir": "src",
57
+ "outDir": "dist"
58
+ },
59
+ "include": ["src/**/*.ts"]
60
+ }
61
+ ```
62
+
63
+ ### React
64
+
65
+ ```json
66
+ {
67
+ "extends": "@yuu1111/tsconfig/react.json",
68
+ "compilerOptions": {
69
+ "outDir": "dist"
70
+ }
71
+ }
72
+ ```
73
+
74
+ ## Presets
75
+
76
+ | Preset | Use case |
77
+ |--------|----------|
78
+ | `base.json` | 厳格な共有base |
79
+ | `bun.json` | Bun project |
80
+ | `declaration-only.json` | declarationだけを出すlibrary build |
81
+ | `library.json` | declarationとsource mapを出すlibrary build |
82
+ | `react.json` | React(JSX + DOM型) |
package/README.md CHANGED
@@ -1,3 +1,5 @@
1
+ [日本語](README.ja.md)
2
+
1
3
  # @yuu1111/tsconfig
2
4
 
3
5
  Shared TypeScript configurations.
@@ -20,6 +22,45 @@ Extend one of the presets in your `tsconfig.json`:
20
22
  }
21
23
  ```
22
24
 
25
+ ### Bun
26
+
27
+ Install `@types/bun` in the consuming project, then extend the Bun preset:
28
+
29
+ ```json
30
+ {
31
+ "extends": "@yuu1111/tsconfig/bun.json"
32
+ }
33
+ ```
34
+
35
+ ### Library
36
+
37
+ ```json
38
+ {
39
+ "extends": "@yuu1111/tsconfig/library.json",
40
+ "compilerOptions": {
41
+ "rootDir": "src",
42
+ "outDir": "dist"
43
+ },
44
+ "include": ["src/**/*.ts"]
45
+ }
46
+ ```
47
+
48
+ ### Declaration-only library
49
+
50
+ Use this preset when a bundler emits JavaScript and TypeScript only needs to emit
51
+ declaration files.
52
+
53
+ ```json
54
+ {
55
+ "extends": "@yuu1111/tsconfig/declaration-only.json",
56
+ "compilerOptions": {
57
+ "rootDir": "src",
58
+ "outDir": "dist"
59
+ },
60
+ "include": ["src/**/*.ts"]
61
+ }
62
+ ```
63
+
23
64
  ### React
24
65
 
25
66
  ```json
@@ -36,4 +77,7 @@ Extend one of the presets in your `tsconfig.json`:
36
77
  | Preset | Use case |
37
78
  |--------|----------|
38
79
  | `base.json` | Strict shared base |
80
+ | `bun.json` | Bun projects |
81
+ | `declaration-only.json` | Declaration-only library builds |
82
+ | `library.json` | Library builds with declarations and source maps |
39
83
  | `react.json` | React (JSX + DOM types) |
package/base.json CHANGED
@@ -1,21 +1,23 @@
1
1
  {
2
- "$schema": "https://json.schemastore.org/tsconfig",
3
- "compilerOptions": {
4
- "strict": true,
5
- "lib": ["ESNext"],
6
- "target": "ESNext",
7
- "module": "Preserve",
8
- "moduleDetection": "force",
9
- "moduleResolution": "bundler",
10
- "esModuleInterop": true,
11
- "noEmit": true,
12
- "isolatedModules": true,
13
- "skipLibCheck": true,
14
- "resolveJsonModule": true,
15
- "forceConsistentCasingInFileNames": true,
16
- "verbatimModuleSyntax": true,
17
- "noUncheckedIndexedAccess": true,
18
- "noFallthroughCasesInSwitch": true,
19
- "exactOptionalPropertyTypes": true
20
- }
2
+ "$schema": "https://json.schemastore.org/tsconfig",
3
+ "compilerOptions": {
4
+ "strict": true,
5
+ "lib": [
6
+ "ESNext"
7
+ ],
8
+ "target": "ESNext",
9
+ "module": "Preserve",
10
+ "moduleDetection": "force",
11
+ "moduleResolution": "bundler",
12
+ "esModuleInterop": true,
13
+ "noEmit": true,
14
+ "isolatedModules": true,
15
+ "skipLibCheck": true,
16
+ "resolveJsonModule": true,
17
+ "forceConsistentCasingInFileNames": true,
18
+ "verbatimModuleSyntax": true,
19
+ "noUncheckedIndexedAccess": true,
20
+ "noFallthroughCasesInSwitch": true,
21
+ "exactOptionalPropertyTypes": true
22
+ }
21
23
  }
package/bun.json ADDED
@@ -0,0 +1,9 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/tsconfig",
3
+ "extends": "./base.json",
4
+ "compilerOptions": {
5
+ "types": [
6
+ "bun"
7
+ ]
8
+ }
9
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/tsconfig",
3
+ "extends": "./library.json",
4
+ "compilerOptions": {
5
+ "emitDeclarationOnly": true
6
+ }
7
+ }
package/library.json ADDED
@@ -0,0 +1,10 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/tsconfig",
3
+ "extends": "./base.json",
4
+ "compilerOptions": {
5
+ "noEmit": false,
6
+ "declaration": true,
7
+ "declarationMap": true,
8
+ "sourceMap": true
9
+ }
10
+ }
package/package.json CHANGED
@@ -1,16 +1,25 @@
1
1
  {
2
- "name": "@yuu1111/tsconfig",
3
- "version": "1.0.3",
4
- "description": "Shared TypeScript configurations",
5
- "license": "MIT",
6
- "tsconfig": "./base.json",
7
- "files": [
8
- "base.json",
9
- "react.json"
10
- ],
11
- "keywords": [
12
- "tsconfig",
13
- "typescript",
14
- "config"
15
- ]
2
+ "name": "@yuu1111/tsconfig",
3
+ "version": "1.0.5",
4
+ "description": "Shared TypeScript configurations",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/yuu1111/configs.git",
9
+ "directory": "packages/tsconfig"
10
+ },
11
+ "tsconfig": "./base.json",
12
+ "files": [
13
+ "README.ja.md",
14
+ "base.json",
15
+ "bun.json",
16
+ "declaration-only.json",
17
+ "library.json",
18
+ "react.json"
19
+ ],
20
+ "keywords": [
21
+ "tsconfig",
22
+ "typescript",
23
+ "config"
24
+ ]
16
25
  }
package/react.json CHANGED
@@ -1,8 +1,12 @@
1
1
  {
2
- "$schema": "https://json.schemastore.org/tsconfig",
3
- "extends": "./base.json",
4
- "compilerOptions": {
5
- "lib": ["ESNext", "DOM", "DOM.Iterable"],
6
- "jsx": "react-jsx"
7
- }
2
+ "$schema": "https://json.schemastore.org/tsconfig",
3
+ "extends": "./base.json",
4
+ "compilerOptions": {
5
+ "lib": [
6
+ "ESNext",
7
+ "DOM",
8
+ "DOM.Iterable"
9
+ ],
10
+ "jsx": "react-jsx"
11
+ }
8
12
  }