Skip to content

Commit 4684d60

Browse files
committed
feat: 🚀 优化 tsconfig 内容,修复部分 TS 问题
1 parent 9cad3b8 commit 4684d60

File tree

11 files changed

+115
-14
lines changed

11 files changed

+115
-14
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
11
{
2-
"extends": "../../tsconfig.base.json"
2+
"compilerOptions": {
3+
"outDir": "dist",
4+
"target": "es2018",
5+
"module": "esnext",
6+
"lib": ["esnext"],
7+
"sourceMap": false,
8+
"moduleResolution": "node",
9+
"allowJs": false,
10+
"strict": true,
11+
"noUnusedLocals": true,
12+
"resolveJsonModule": true,
13+
"allowSyntheticDefaultImports": true,
14+
"esModuleInterop": true,
15+
"removeComments": false,
16+
"preserveSymlinks": true,
17+
"rootDir": "."
18+
}
319
}
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
11
{
2-
"extends": "../../tsconfig.base.json"
2+
"compilerOptions": {
3+
"outDir": "dist",
4+
"target": "es2018",
5+
"module": "esnext",
6+
"lib": ["esnext"],
7+
"sourceMap": false,
8+
"moduleResolution": "node",
9+
"allowJs": false,
10+
"strict": true,
11+
"noUnusedLocals": true,
12+
"resolveJsonModule": true,
13+
"allowSyntheticDefaultImports": true,
14+
"esModuleInterop": true,
15+
"removeComments": false,
16+
"preserveSymlinks": true,
17+
"rootDir": "."
18+
}
319
}
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
11
{
2-
"extends": "../../tsconfig.base.json"
2+
"compilerOptions": {
3+
"outDir": "dist",
4+
"target": "es2018",
5+
"module": "esnext",
6+
"lib": ["esnext"],
7+
"sourceMap": false,
8+
"moduleResolution": "node",
9+
"allowJs": false,
10+
"strict": true,
11+
"noUnusedLocals": true,
12+
"resolveJsonModule": true,
13+
"allowSyntheticDefaultImports": true,
14+
"esModuleInterop": true,
15+
"removeComments": false,
16+
"preserveSymlinks": true,
17+
"rootDir": "."
18+
}
319
}
+17-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
11
{
2-
"extends": "../../tsconfig.base.json"
2+
"compilerOptions": {
3+
"outDir": "dist",
4+
"target": "es2018",
5+
"module": "esnext",
6+
"lib": ["esnext"],
7+
"sourceMap": false,
8+
"moduleResolution": "node",
9+
"allowJs": false,
10+
"strict": true,
11+
"noUnusedLocals": true,
12+
"resolveJsonModule": true,
13+
"allowSyntheticDefaultImports": true,
14+
"esModuleInterop": true,
15+
"removeComments": false,
16+
"preserveSymlinks": true,
17+
"rootDir": "."
18+
}
319
}
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { defineBuildConfig } from "unbuild";
22

33
export default defineBuildConfig({
4-
entries: ["src/index"],
4+
entries: ["src/index", "src/usePermalinks"],
55
clean: true,
66
declaration: true,
77
rollup: {
@@ -10,5 +10,5 @@ export default defineBuildConfig({
1010
exports: "named",
1111
},
1212
},
13-
externals: ["vitepress"],
13+
externals: ["vitepress", "vue"],
1414
});

plugins/vitepress-plugin-permalink/package.json

+4-2
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,10 @@
3535
"import": "./dist/index.mjs",
3636
"require": "./dist/index.cjs"
3737
},
38-
"./src/*": {
39-
"import": "./src/*"
38+
"./*": {
39+
"types": "./dist/*.d.ts",
40+
"import": "./dist/*.mjs",
41+
"require": "./dist/*.cjs"
4042
}
4143
},
4244
"scripts": {
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
11
{
2-
"extends": "../../tsconfig.base.json"
2+
"compilerOptions": {
3+
"outDir": "dist",
4+
"target": "es2018",
5+
"module": "esnext",
6+
"lib": ["esnext", "DOM"],
7+
"sourceMap": false,
8+
"moduleResolution": "node",
9+
"allowJs": false,
10+
"strict": true,
11+
"noUnusedLocals": true,
12+
"resolveJsonModule": true,
13+
"allowSyntheticDefaultImports": true,
14+
"esModuleInterop": true,
15+
"removeComments": false,
16+
"preserveSymlinks": true,
17+
"rootDir": ".",
18+
"paths": {
19+
"vitepress-plugin-permalink/*": ["./dist/*"]
20+
}
21+
}
322
}
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
11
{
2-
"extends": "../../tsconfig.base.json"
2+
"compilerOptions": {
3+
"outDir": "dist",
4+
"target": "es2018",
5+
"module": "esnext",
6+
"lib": ["esnext"],
7+
"sourceMap": false,
8+
"moduleResolution": "node",
9+
"allowJs": false,
10+
"strict": true,
11+
"noUnusedLocals": true,
12+
"resolveJsonModule": true,
13+
"allowSyntheticDefaultImports": true,
14+
"esModuleInterop": true,
15+
"removeComments": false,
16+
"preserveSymlinks": true,
17+
"rootDir": "."
18+
}
319
}

tsconfig.base.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
"allowSyntheticDefaultImports": true,
1414
"esModuleInterop": true,
1515
"removeComments": false,
16+
"preserveSymlinks": true,
1617
"rootDir": ".",
1718
"types": [],
18-
"preserveSymlinks": true,
1919
"paths": {}
2020
}
2121
}

vitepress-theme-teeker/src/components/CatalogueItem.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<script setup lang="ts" name="CatalogueItem">
2+
import type { CatalogueItem } from "vitepress-plugin-catalogue";
23
import { useDesign } from "../hooks";
3-
import type { DefaultTheme } from "vitepress";
44
55
const { getPrefixClass } = useDesign();
66
const prefixClass = getPrefixClass("catalogue");
77
const prefixClass1 = getPrefixClass("subCatalogue");
88
const prefixClass2 = getPrefixClass("catalogueItem");
99
10-
defineProps<{ item: DefaultTheme.SidebarItem; index: number | string }>();
10+
defineProps<{ item: CatalogueItem; index: number | string }>();
1111
</script>
1212

1313
<template>

vitepress-theme-teeker/src/configProvider.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { computed, defineComponent, h, InjectionKey, provide, Ref, unref, type C
22
import { useAnchorScroll, useViewTransition } from "./hooks";
33
import type { Post } from "./post/types";
44
import { useData } from "vitepress";
5-
import usePermalinks from "vitepress-plugin-permalink/src/usePermalinks";
5+
import usePermalinks from "vitepress-plugin-permalink/usePermalinks";
66
import { emptyPost } from "./post/helper";
77

88
export const postsSymbol: InjectionKey<Post> = Symbol("posts");

0 commit comments

Comments
 (0)