@sapphire/ts-config 5.0.2-next.a4da5c44.0 → 5.0.2-next.a6c61efd
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 +35 -37
- package/package.json +12 -43
- /package/{src/bundler.json → bundler.json} +0 -0
- /package/{src/decorators.json → decorators.json} +0 -0
- /package/{src/extra-strict.json → extra-strict.json} +0 -0
- /package/{src/tsconfig.json → tsconfig.json} +0 -0
- /package/{src/verbatim.json → verbatim.json} +0 -0
package/README.md
CHANGED
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
**TypeScript configuration for all Sapphire Community repositories.**
|
|
8
8
|
|
|
9
9
|
[](https://github.com/sapphiredev/utilities/blob/main/LICENSE.md)
|
|
10
|
-
[](https://codecov.io/gh/sapphiredev/utilities)
|
|
11
10
|
[](https://bundlephobia.com/result?p=@sapphire/ts-config)
|
|
12
11
|
[](https://www.npmjs.com/package/@sapphire/ts-config)
|
|
13
12
|
|
|
@@ -15,16 +14,15 @@
|
|
|
15
14
|
|
|
16
15
|
**Table of Contents**
|
|
17
16
|
|
|
18
|
-
-
|
|
19
|
-
|
|
20
|
-
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
- [Contributors](#contributors)
|
|
17
|
+
- [Installation](#installation)
|
|
18
|
+
- [Usage](#usage)
|
|
19
|
+
- [Base](#base)
|
|
20
|
+
- [Extra Strict](#extra-strict)
|
|
21
|
+
- [Decorators](#decorators)
|
|
22
|
+
- [Verbatim](#verbatim)
|
|
23
|
+
- [Bundler](#bundler)
|
|
24
|
+
- [Buy us some doughnuts](#buy-us-some-doughnuts)
|
|
25
|
+
- [Contributors](#contributors)
|
|
28
26
|
|
|
29
27
|
## Installation
|
|
30
28
|
|
|
@@ -41,24 +39,24 @@ npm install --save-dev @sapphire/ts-config
|
|
|
41
39
|
This package ships a couple of different sets of tsconfig, they should be used in an array of
|
|
42
40
|
`extends` in your `tsconfig.json` file. The supported configs are:
|
|
43
41
|
|
|
44
|
-
-
|
|
45
|
-
-
|
|
46
|
-
-
|
|
47
|
-
-
|
|
42
|
+
- `@sapphire/ts-config/base` -> This is identical to `@sapphire/ts-config`
|
|
43
|
+
- `@sapphire/ts-config/extra-strict`
|
|
44
|
+
- `@sapphire/ts-config/decorators`
|
|
45
|
+
- `@sapphire/ts-config/verbatim`
|
|
48
46
|
|
|
49
47
|
You should always start with the base config, regardless of what other configs you choose.
|
|
50
48
|
Next you can opt-in to the other configs.
|
|
51
49
|
|
|
52
50
|
Finally you should configure your package.json properly based on what kind of package you are writing
|
|
53
51
|
|
|
54
|
-
-
|
|
55
|
-
-
|
|
56
|
-
-
|
|
57
|
-
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
-
|
|
61
|
-
|
|
52
|
+
- For CJS packages you should add `"type": "commonjs"` to your `package.json`
|
|
53
|
+
- For ESM packages you should add `"type": "module"` to your `package.json`
|
|
54
|
+
- For a package that is going to be used by both CJS and ESM then you should not add any `"type"` to your `package.json`
|
|
55
|
+
- Note that if you intend to compile for both your best option is to compile
|
|
56
|
+
for CJS from TypeScript, then use [`gen-esm-wrapper`](https://github.com/addaleax/gen-esm-wrapper) to transform your
|
|
57
|
+
input file to ESM compatible exports. This is also what we do for our Sapphire packages.
|
|
58
|
+
- Note also that in this case you should not enable `@sapphire/ts-config/verbatim`, because it will not work without
|
|
59
|
+
a `"type"` specified in `package.json`
|
|
62
60
|
|
|
63
61
|
Next we will go over the different configs and what they do.
|
|
64
62
|
|
|
@@ -67,18 +65,18 @@ Next we will go over the different configs and what they do.
|
|
|
67
65
|
The base config (`@sapphire/ts-config`, or `@sapphire/ts-config/base`) is the default config with options set up in
|
|
68
66
|
such a way that it will suite nearly all projects.
|
|
69
67
|
|
|
70
|
-
You can view the content of this tsconfig [here](https://github.com/sapphiredev/utilities/blob/main/packages/ts-config/
|
|
68
|
+
You can view the content of this tsconfig [here](https://github.com/sapphiredev/utilities/blob/main/packages/ts-config/tsconfig.json)
|
|
71
69
|
|
|
72
70
|
### Extra Strict
|
|
73
71
|
|
|
74
72
|
You should include this config if you want to extra strict checking. This configures the following compiler options:
|
|
75
73
|
|
|
76
|
-
-
|
|
77
|
-
-
|
|
78
|
-
-
|
|
79
|
-
-
|
|
74
|
+
- [`allowUnreachableCode` to `false`](https://www.typescriptlang.org/tsconfig#allowUnreachableCode)
|
|
75
|
+
- [`allowUnusedLabels` to `false`](https://www.typescriptlang.org/tsconfig#allowUnusedLabels)
|
|
76
|
+
- [`exactOptionalPropertyTypes` to `false`](https://www.typescriptlang.org/tsconfig#exactOptionalPropertyTypes)
|
|
77
|
+
- [`noImplicitOverride` to `true`](https://www.typescriptlang.org/tsconfig#noImplicitOverride)
|
|
80
78
|
|
|
81
|
-
You can view the content of this tsconfig [here](https://github.com/sapphiredev/utilities/blob/main/packages/ts-config/
|
|
79
|
+
You can view the content of this tsconfig [here](https://github.com/sapphiredev/utilities/blob/main/packages/ts-config/extra-strict.json)
|
|
82
80
|
|
|
83
81
|
### Decorators
|
|
84
82
|
|
|
@@ -89,10 +87,10 @@ you are using decorators. Packages such as `@sapphire/decorators` rely on this c
|
|
|
89
87
|
|
|
90
88
|
This enables the following compiler options:
|
|
91
89
|
|
|
92
|
-
-
|
|
93
|
-
-
|
|
90
|
+
- [experimentalDecorators](https://www.typescriptlang.org/tsconfig#experimentalDecorators)
|
|
91
|
+
- [emitDecoratorMetadata](https://www.typescriptlang.org/tsconfig#emitDecoratorMetadata)
|
|
94
92
|
|
|
95
|
-
You can view the content of this tsconfig [here](https://github.com/sapphiredev/utilities/blob/main/packages/ts-config
|
|
93
|
+
You can view the content of this tsconfig [here](https://github.com/sapphiredev/utilities/blob/main/packages/ts-config//decorators.json)
|
|
96
94
|
|
|
97
95
|
### Verbatim
|
|
98
96
|
|
|
@@ -103,9 +101,9 @@ See the TypeScript documentation for more information.
|
|
|
103
101
|
|
|
104
102
|
This enables the following compiler options:
|
|
105
103
|
|
|
106
|
-
-
|
|
104
|
+
- [verbatimModuleSyntax](https://www.typescriptlang.org/tsconfig#verbatimModuleSyntax)
|
|
107
105
|
|
|
108
|
-
You can view the content of this tsconfig [here](https://github.com/sapphiredev/utilities/blob/main/packages/ts-config/
|
|
106
|
+
You can view the content of this tsconfig [here](https://github.com/sapphiredev/utilities/blob/main/packages/ts-config/verbatim.json)
|
|
109
107
|
|
|
110
108
|
### Bundler
|
|
111
109
|
|
|
@@ -115,10 +113,10 @@ config sets [`moduleResolution` to `Bundler`][moduleResolution] and [`module` to
|
|
|
115
113
|
|
|
116
114
|
This configures the following compiler options:
|
|
117
115
|
|
|
118
|
-
-
|
|
119
|
-
-
|
|
116
|
+
- [`moduleResolution` to `Bundler`][moduleResolution]
|
|
117
|
+
- [`module` to `ES2022`][module]
|
|
120
118
|
|
|
121
|
-
You can view the content of this tsconfig [here](https://github.com/sapphiredev/utilities/blob/main/packages/ts-config/
|
|
119
|
+
You can view the content of this tsconfig [here](https://github.com/sapphiredev/utilities/blob/main/packages/ts-config/bundler.json)
|
|
122
120
|
|
|
123
121
|
## Buy us some doughnuts
|
|
124
122
|
|
package/package.json
CHANGED
|
@@ -1,42 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sapphire/ts-config",
|
|
3
|
-
"version": "5.0.2-next.
|
|
3
|
+
"version": "5.0.2-next.a6c61efd",
|
|
4
4
|
"description": "Shareable TypeScript configuration for the Sapphire Community",
|
|
5
5
|
"author": "@sapphire",
|
|
6
6
|
"license": "MIT",
|
|
7
|
-
"main": "src/tsconfig.json",
|
|
8
|
-
"exports": {
|
|
9
|
-
".": {
|
|
10
|
-
"types": "./src/tsconfig.json",
|
|
11
|
-
"import": "./src/tsconfig.json",
|
|
12
|
-
"require": "./src/tsconfig.json"
|
|
13
|
-
},
|
|
14
|
-
"./base": {
|
|
15
|
-
"types": "./src/tsconfig.json",
|
|
16
|
-
"import": "./src/tsconfig.json",
|
|
17
|
-
"require": "./src/tsconfig.json"
|
|
18
|
-
},
|
|
19
|
-
"./decorators": {
|
|
20
|
-
"types": "./src/decorators.json",
|
|
21
|
-
"import": "./src/decorators.json",
|
|
22
|
-
"require": "./src/decorators.json"
|
|
23
|
-
},
|
|
24
|
-
"./extra-strict": {
|
|
25
|
-
"types": "./src/extra-strict.json",
|
|
26
|
-
"import": "./src/extra-strict.json",
|
|
27
|
-
"require": "./src/extra-strict.json"
|
|
28
|
-
},
|
|
29
|
-
"./verbatim": {
|
|
30
|
-
"types": "./src/verbatim.json",
|
|
31
|
-
"import": "./src/verbatim.json",
|
|
32
|
-
"require": "./src/verbatim.json"
|
|
33
|
-
},
|
|
34
|
-
"./bundler": {
|
|
35
|
-
"types": "./src/bundler.json",
|
|
36
|
-
"import": "./src/bundler.json",
|
|
37
|
-
"require": "./src/bundler.json"
|
|
38
|
-
}
|
|
39
|
-
},
|
|
40
7
|
"sideEffects": false,
|
|
41
8
|
"homepage": "https://github.com/sapphiredev/utilities/tree/main/packages/ts-config",
|
|
42
9
|
"scripts": {
|
|
@@ -47,11 +14,13 @@
|
|
|
47
14
|
"check-update": "cliff-jumper --dry-run"
|
|
48
15
|
},
|
|
49
16
|
"dependencies": {
|
|
50
|
-
"tslib": "^2.
|
|
51
|
-
"typescript": "
|
|
17
|
+
"tslib": "^2.8.1",
|
|
18
|
+
"typescript": "~5.4.5"
|
|
52
19
|
},
|
|
53
20
|
"files": [
|
|
54
|
-
"
|
|
21
|
+
"*.json",
|
|
22
|
+
"!tests/**",
|
|
23
|
+
"!tsconfig.eslint.json",
|
|
55
24
|
"UPGRADING-*.md"
|
|
56
25
|
],
|
|
57
26
|
"engines": {
|
|
@@ -80,11 +49,11 @@
|
|
|
80
49
|
"access": "public"
|
|
81
50
|
},
|
|
82
51
|
"devDependencies": {
|
|
83
|
-
"@favware/cliff-jumper": "^
|
|
84
|
-
"@sapphire/eslint-config": "^5.0.
|
|
85
|
-
"@sapphire/eslint-plugin-result": "^2.0.
|
|
86
|
-
"@vitest/coverage-v8": "^
|
|
87
|
-
"typedoc-json-parser": "^
|
|
88
|
-
"vitest": "^
|
|
52
|
+
"@favware/cliff-jumper": "^6.0.0",
|
|
53
|
+
"@sapphire/eslint-config": "^5.0.6",
|
|
54
|
+
"@sapphire/eslint-plugin-result": "^2.0.4",
|
|
55
|
+
"@vitest/coverage-v8": "^3.2.4",
|
|
56
|
+
"typedoc-json-parser": "^10.2.0",
|
|
57
|
+
"vitest": "^3.2.4"
|
|
89
58
|
}
|
|
90
59
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|