@vitavision/config-ts 0.1.0 → 0.2.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 +48 -0
- package/package.json +28 -7
- package/tsconfig.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# @vitavision/config-ts
|
|
2
|
+
|
|
3
|
+
Shared TypeScript compiler options and a tsdown library preset for the `@vitavision/*`
|
|
4
|
+
frontends.
|
|
5
|
+
|
|
6
|
+
```bash
|
|
7
|
+
bun add -d @vitavision/config-ts typescript@^7.0.2
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## App
|
|
11
|
+
|
|
12
|
+
```jsonc
|
|
13
|
+
// tsconfig.json
|
|
14
|
+
{
|
|
15
|
+
"extends": "@vitavision/config-ts/tsconfig.json",
|
|
16
|
+
"include": ["src"]
|
|
17
|
+
}
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
The options:
|
|
21
|
+
- **Strictness:** `strict`, `noUncheckedIndexedAccess`, `exactOptionalPropertyTypes`, `noUnusedLocals` / `noUnusedParameters`, `noFallthroughCasesInSwitch`.
|
|
22
|
+
- **Modules:** `verbatimModuleSyntax`, `isolatedModules`, `moduleResolution: "bundler"`, `jsx: "react-jsx"`.
|
|
23
|
+
- **Emit:** `noEmit`, because the bundler builds.
|
|
24
|
+
|
|
25
|
+
## Library in a monorepo
|
|
26
|
+
|
|
27
|
+
`tsconfig.lib.json` adds `declaration` and the `@vitavision/source` custom condition. With
|
|
28
|
+
that condition, a sibling package that maps it to its `src/` in `exports` typechecks without
|
|
29
|
+
a prior build.
|
|
30
|
+
|
|
31
|
+
```jsonc
|
|
32
|
+
{ "extends": "@vitavision/config-ts/tsconfig.lib.json", "include": ["src"] }
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
```ts
|
|
36
|
+
// tsdown.config.ts (needs tsdown 0.23.0)
|
|
37
|
+
import { library } from "@vitavision/config-ts/tsdown";
|
|
38
|
+
|
|
39
|
+
export default library(); // ESM + declarations from src/index.ts; pass overrides to change it
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
With TypeScript 7, tsdown emits the declarations with the native compiler (its `tsgo`
|
|
43
|
+
generator) and logs that this path is experimental. It reads the options from
|
|
44
|
+
`tsconfig.json`, so put declaration options there rather than in `dts` overrides.
|
|
45
|
+
|
|
46
|
+
## License
|
|
47
|
+
|
|
48
|
+
MIT OR Apache-2.0.
|
package/package.json
CHANGED
|
@@ -1,19 +1,40 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vitavision/config-ts",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Shared TypeScript compiler options and tsdown library preset for vitavision frontends.",
|
|
5
5
|
"license": "MIT OR Apache-2.0",
|
|
6
|
-
"repository": {
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/VitalyVorobyev/lab-ui.git",
|
|
9
|
+
"directory": "packages/config/ts"
|
|
10
|
+
},
|
|
7
11
|
"type": "module",
|
|
8
12
|
"sideEffects": false,
|
|
9
|
-
"files": [
|
|
13
|
+
"files": [
|
|
14
|
+
"tsconfig.json",
|
|
15
|
+
"tsconfig.lib.json",
|
|
16
|
+
"tsdown.js",
|
|
17
|
+
"tsdown.d.ts"
|
|
18
|
+
],
|
|
10
19
|
"exports": {
|
|
11
20
|
"./tsconfig.json": "./tsconfig.json",
|
|
12
21
|
"./tsconfig.lib.json": "./tsconfig.lib.json",
|
|
13
|
-
"./tsdown": {
|
|
22
|
+
"./tsdown": {
|
|
23
|
+
"types": "./tsdown.d.ts",
|
|
24
|
+
"default": "./tsdown.js"
|
|
25
|
+
},
|
|
14
26
|
"./package.json": "./package.json"
|
|
15
27
|
},
|
|
16
|
-
"publishConfig": {
|
|
17
|
-
|
|
18
|
-
|
|
28
|
+
"publishConfig": {
|
|
29
|
+
"access": "public"
|
|
30
|
+
},
|
|
31
|
+
"peerDependencies": {
|
|
32
|
+
"typescript": "^7.0.2",
|
|
33
|
+
"tsdown": "0.23.0"
|
|
34
|
+
},
|
|
35
|
+
"peerDependenciesMeta": {
|
|
36
|
+
"tsdown": {
|
|
37
|
+
"optional": true
|
|
38
|
+
}
|
|
39
|
+
}
|
|
19
40
|
}
|
package/tsconfig.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
// The compiler options every vitavision frontend shares
|
|
2
|
+
// The compiler options every vitavision frontend shares.
|
|
3
3
|
// An app extends this and adds its own `include`; a library extends tsconfig.lib.json.
|
|
4
4
|
"compilerOptions": {
|
|
5
5
|
"target": "ES2022",
|