Skip to content

Commit eb8e1c9

Browse files
committed
feat: 添加类型声明生成和has方法文档
添加vite-plugin-dts插件用于自动生成类型声明文件 更新README.md文档添加has方法使用示例 升级版本号至1.0.1
1 parent 33621db commit eb8e1c9

4 files changed

Lines changed: 16 additions & 3 deletions

File tree

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727

2828
- name: Install dependencies
2929
run: npm install
30-
30+
3131
- name: Build package
3232
run: npm run build
3333

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,7 @@ storage.keys(); // ['name', 'age', 'user', 'busy']
3636

3737
/** length */
3838
storage.length; // 3
39+
40+
/** has */
41+
storage.has('name'); // true
3942
```

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "geed-storage",
3-
"version": "1.0.0",
3+
"version": "1.0.1",
44
"description": "支持 `json` 的本地存储。",
55
"author": "onlymisaky",
66
"license": "ISC",
@@ -45,7 +45,8 @@
4545
"husky": "^9.1.7",
4646
"lint-staged": "^16.2.7",
4747
"typescript": "^5.9.3",
48-
"vite": "^7.3.1"
48+
"vite": "^7.3.1",
49+
"vite-plugin-dts": "^4.5.4"
4950
},
5051
"devDependencies.back": {
5152
"@babel/core": "^7.12.10",

vite.config.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,16 @@
11
import path from 'node:path';
22
import { defineConfig } from 'vite';
3+
import dts from 'vite-plugin-dts';
34

45
export default defineConfig({
6+
plugins: [
7+
dts({
8+
insertTypesEntry: true,
9+
rollupTypes: true,
10+
outDir: 'dist/typings',
11+
tsconfigPath: './tsconfig.json',
12+
}),
13+
],
514
build: {
615
outDir: 'dist',
716
sourcemap: true,

0 commit comments

Comments
 (0)