vite-plugin-vue-transition-root-validator 0.0.2 → 0.0.3
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 +10 -1
- package/dist/{client-DdpHavRX.d.ts → client.d.ts} +15 -1
- package/package.json +7 -3
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
## 安装
|
|
5
5
|
|
|
6
6
|
```bash
|
|
7
|
-
|
|
7
|
+
pnpm i -D vite-plugin-vue-transition-root-validator
|
|
8
8
|
```
|
|
9
9
|
|
|
10
10
|
## 使用
|
|
@@ -45,6 +45,15 @@ app.mount('#app');
|
|
|
45
45
|
|
|
46
46
|
> 说明:overlay 的标题(message header)与正文(stack)都会跟随此处的 `lang`。
|
|
47
47
|
|
|
48
|
+
## 常见问题
|
|
49
|
+
|
|
50
|
+
### TS 报错:找不到模块“virtual:vue-transition-root-validator”
|
|
51
|
+
|
|
52
|
+
如果在 `main.ts` 中引入时遇到类型报错,请在项目的 `src/vite-env.d.ts`(或 `env.d.ts`)中添加以下引用:
|
|
53
|
+
|
|
54
|
+
```ts
|
|
55
|
+
/// <reference types="vite-plugin-vue-transition-root-validator/client" />
|
|
56
|
+
```
|
|
48
57
|
|
|
49
58
|
## 代码执行流程
|
|
50
59
|
|
|
@@ -39,4 +39,18 @@ type SetupOptions = {
|
|
|
39
39
|
declare function setupVueRootValidator(app: App, options?: SetupOptions): void;
|
|
40
40
|
//#endregion
|
|
41
41
|
export { setupVueRootValidator };
|
|
42
|
-
//# sourceMappingURL=client-DdpHavRX.d.ts.map
|
|
42
|
+
//# sourceMappingURL=client-DdpHavRX.d.ts.map
|
|
43
|
+
declare module 'virtual:vue-transition-root-validator' {
|
|
44
|
+
import type { App } from 'vue';
|
|
45
|
+
|
|
46
|
+
export type Lang = 'en' | 'zh';
|
|
47
|
+
|
|
48
|
+
export interface SetupOptions {
|
|
49
|
+
/** 界面语言,默认 'en' */
|
|
50
|
+
lang?: Lang;
|
|
51
|
+
/** 是否在检测到错误后自动禁用检测(避免重复报错),默认 false */
|
|
52
|
+
disableAfterFirstError?: boolean;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export function setupVueRootValidator(app: App, options?: SetupOptions): void;
|
|
56
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vite-plugin-vue-transition-root-validator",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.3",
|
|
5
5
|
"description": "Capture Vue <Transition> runtime warnings and show actionable overlay in Vite dev.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"azir",
|
|
@@ -30,14 +30,18 @@
|
|
|
30
30
|
"types": "./dist/index.d.cts",
|
|
31
31
|
"default": "./dist/index.cjs"
|
|
32
32
|
}
|
|
33
|
+
},
|
|
34
|
+
"./client": {
|
|
35
|
+
"types": "./dist/client.d.ts"
|
|
33
36
|
}
|
|
34
37
|
},
|
|
35
38
|
"scripts": {
|
|
36
|
-
"build": "tsdown src/index.ts --format esm,cjs --dts --sourcemap --clean && mv dist/index-*.d.ts dist/index.d.ts && mv dist/index-*.d.cts dist/index.d.cts && tsdown src/client.ts --format esm --dts --sourcemap --no-clean && publint",
|
|
39
|
+
"build": "tsdown src/index.ts --format esm,cjs --dts --sourcemap --clean && mv dist/index-*.d.ts dist/index.d.ts && mv dist/index-*.d.cts dist/index.d.cts && tsdown src/client.ts --format esm --dts --sourcemap --no-clean && mv dist/client-*.d.ts dist/client.d.ts && echo \"\" >> dist/client.d.ts && cat src/env.d.ts >> dist/client.d.ts && publint",
|
|
37
40
|
"test": "vitest run",
|
|
38
41
|
"typecheck": "tsc -p tsconfig.json",
|
|
39
|
-
"verify": "
|
|
42
|
+
"verify": "pnpm run build && attw --pack ."
|
|
40
43
|
},
|
|
44
|
+
"packageManager": "pnpm@10.14.0",
|
|
41
45
|
"peerDependencies": {
|
|
42
46
|
"vite": ">=4.0.0",
|
|
43
47
|
"vue": ">=3.0.0"
|