vite-plugin-debugger 0.3.0 → 0.3.2
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 +177 -0
- package/README.zh_CN.md +176 -0
- package/dist/{chunk-AY5SPOLM.js → chunk-IRNZNPGP.js} +1 -1
- package/dist/{chunk-M5FN5N6N.js → chunk-NUUDR57M.js} +1 -1
- package/dist/{chunk-WG6FWYWY.js → chunk-VQAYNSKK.js} +284 -60
- package/dist/eruda.d.ts +2 -2
- package/dist/eruda.js +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -3
- package/dist/vconsole.d.ts +2 -2
- package/dist/vconsole.js +2 -2
- package/package.json +5 -5
package/README.md
ADDED
@@ -0,0 +1,177 @@
|
|
1
|
+
# vite-plugin-debugger
|
2
|
+
|
3
|
+
A vite plugin provide the debugger tools for mobile devices.
|
4
|
+
|
5
|
+
<a href="https://npmjs.com/package/vite-plugin-debugger" target="\_parent">
|
6
|
+
<img alt="" src="https://img.shields.io/npm/dm/vite-plugin-debugger.svg" />
|
7
|
+
</a><a href="https://www.npmjs.com/package/vite-plugin-debugger">
|
8
|
+
<img src="https://badgen.net/npm/v/vite-plugin-debugger" alt="">
|
9
|
+
</a><a href="https://github.com/jaderd-jh/vite-plugin-debugger" target="\_parent">
|
10
|
+
<img alt="" src="https://img.shields.io/github/stars/jaderd-jh/vite-plugin-debugger.svg?style=social&label=Star" />
|
11
|
+
</a>
|
12
|
+
|
13
|
+
**English** | [中文](README.zh_CN.md)
|
14
|
+
|
15
|
+
## Install
|
16
|
+
|
17
|
+
**node version:** >=20.0.0
|
18
|
+
|
19
|
+
**vite version:** >=6.0.0
|
20
|
+
|
21
|
+
```bash
|
22
|
+
pnpm add vite-plugin-debugger -D
|
23
|
+
# or
|
24
|
+
yarn add vite-plugin-debugger -D
|
25
|
+
# or
|
26
|
+
npm i vite-plugin-debugger -D
|
27
|
+
```
|
28
|
+
|
29
|
+
## Usage
|
30
|
+
|
31
|
+
### For [eruda](https://github.com/liriliri/eruda)
|
32
|
+
|
33
|
+
we use eruda with CDN by default since it's unpacked size is 2.38 MB.
|
34
|
+
|
35
|
+
```typescript
|
36
|
+
import vDebugger from 'vite-plugin-debugger/eruda'
|
37
|
+
|
38
|
+
export default defineConfig(({ command, mode }) => ({
|
39
|
+
plugins: [
|
40
|
+
vDebugger({
|
41
|
+
debug: mode !== 'production',
|
42
|
+
eruda: {
|
43
|
+
// cdn: 'jsdelivr', // 'jsdelivr' | 'unpkg' | 'cdnjs' | 'staticfile'
|
44
|
+
// src: 'custom CDN URL',
|
45
|
+
options: {
|
46
|
+
tool: ['console', 'elements'],
|
47
|
+
useShadowDom: true,
|
48
|
+
autoScale: true,
|
49
|
+
defaults: {
|
50
|
+
displaySize: 50,
|
51
|
+
transparency: 0.8,
|
52
|
+
theme: 'Dark',
|
53
|
+
},
|
54
|
+
},
|
55
|
+
},
|
56
|
+
})
|
57
|
+
]
|
58
|
+
}))
|
59
|
+
```
|
60
|
+
|
61
|
+
Use active tools to enable eruda forcibly, you can specify activation mode and parameter name like:
|
62
|
+
```typescript
|
63
|
+
const config = {
|
64
|
+
active: {
|
65
|
+
override: true, // true if you want to override debug option
|
66
|
+
mode: 'url',
|
67
|
+
param: 'debugwhatever',
|
68
|
+
}
|
69
|
+
}
|
70
|
+
```
|
71
|
+
|
72
|
+
For more details about eruda options, please check
|
73
|
+
out [eruda API](https://github.com/liriliri/eruda/blob/master/doc/API.md).
|
74
|
+
|
75
|
+
If you prefer use eruda locally, you should install eruda and it's plugins first.
|
76
|
+
|
77
|
+
```bash
|
78
|
+
pnpm add eruda -D
|
79
|
+
# or
|
80
|
+
yarn add eruda -D
|
81
|
+
# or
|
82
|
+
npm i eruda -D
|
83
|
+
|
84
|
+
```
|
85
|
+
|
86
|
+
```typescript
|
87
|
+
import { fileURLToPath } from 'node:url'
|
88
|
+
import vDebugger from 'vite-plugin-debugger/eruda'
|
89
|
+
|
90
|
+
const resolve = (dir: string) => fileURLToPath(new URL(dir, import.meta.url))
|
91
|
+
|
92
|
+
export default defineConfig(({ command, mode }) => ({
|
93
|
+
plugins: [
|
94
|
+
vDebugger({
|
95
|
+
debug: mode !== 'production',
|
96
|
+
local: true,
|
97
|
+
entry: resolve('src/main.ts'), // vue or src/main.tsx for react
|
98
|
+
eruda: {
|
99
|
+
options: {
|
100
|
+
tool: ['console', 'elements'],
|
101
|
+
useShadowDom: true,
|
102
|
+
autoScale: true,
|
103
|
+
defaults: {
|
104
|
+
displaySize: 50,
|
105
|
+
transparency: 0.8,
|
106
|
+
theme: 'Dark',
|
107
|
+
},
|
108
|
+
},
|
109
|
+
}
|
110
|
+
})
|
111
|
+
]
|
112
|
+
}))
|
113
|
+
```
|
114
|
+
|
115
|
+
### For [vConsole](https://github.com/Tencent/vConsole)
|
116
|
+
|
117
|
+
we use vConsole with CDN by default since it's unpacked size is 344 kB.
|
118
|
+
|
119
|
+
```typescript
|
120
|
+
import vDebugger from 'vite-plugin-debugger/vconsole'
|
121
|
+
|
122
|
+
export default defineConfig(({ command, mode }) => ({
|
123
|
+
plugins: [
|
124
|
+
vDebugger({
|
125
|
+
debug: mode !== 'production',
|
126
|
+
vConsole: {
|
127
|
+
options: {
|
128
|
+
theme: 'dark',
|
129
|
+
},
|
130
|
+
},
|
131
|
+
})
|
132
|
+
]
|
133
|
+
}))
|
134
|
+
```
|
135
|
+
|
136
|
+
Use active tools to enable vConsole dynamically, you can specify activation mode and parameter name like:
|
137
|
+
|
138
|
+
active: { mode: 'url', param: 'debugwhatever' },
|
139
|
+
|
140
|
+
For more details about vConsole options, please check
|
141
|
+
out [vConsole API](https://github.com/Tencent/vConsole/blob/dev/doc/public_properties_methods.md).
|
142
|
+
|
143
|
+
If you prefer use vConsole locally, you should install vConsole first.
|
144
|
+
|
145
|
+
```bash
|
146
|
+
pnpm add vconsole -D
|
147
|
+
# or
|
148
|
+
yarn add vconsole -D
|
149
|
+
# or
|
150
|
+
npm i vconsole -D
|
151
|
+
```
|
152
|
+
|
153
|
+
```typescript
|
154
|
+
import { fileURLToPath } from 'node:url'
|
155
|
+
import vDebugger from 'vite-plugin-debugger/vconsole'
|
156
|
+
|
157
|
+
const resolve = (dir: string) => fileURLToPath(new URL(dir, import.meta.url))
|
158
|
+
|
159
|
+
export default defineConfig(({ command, mode }) => ({
|
160
|
+
plugins: [
|
161
|
+
vDebugger({
|
162
|
+
debug: mode !== 'production',
|
163
|
+
local: true,
|
164
|
+
entry: resolve('src/main.ts'), // vue or src/main.tsx for react
|
165
|
+
vConsole: {
|
166
|
+
options: {
|
167
|
+
theme: 'dark',
|
168
|
+
},
|
169
|
+
},
|
170
|
+
})
|
171
|
+
]
|
172
|
+
}))
|
173
|
+
```
|
174
|
+
|
175
|
+
## License
|
176
|
+
|
177
|
+
[MIT](../../LICENSE)
|
package/README.zh_CN.md
ADDED
@@ -0,0 +1,176 @@
|
|
1
|
+
# vite-plugin-debugger
|
2
|
+
|
3
|
+
一个提供移动端debug工具的vite插件
|
4
|
+
|
5
|
+
<a href="https://npmjs.com/package/vite-plugin-debugger" target="\_parent">
|
6
|
+
<img alt="" src="https://img.shields.io/npm/dm/vite-plugin-debugger.svg" />
|
7
|
+
</a><a href="https://www.npmjs.com/package/vite-plugin-debugger">
|
8
|
+
<img src="https://badgen.net/npm/v/vite-plugin-debugger" alt="">
|
9
|
+
</a><a href="https://github.com/jaderd-jh/vite-plugin-debugger" target="\_parent">
|
10
|
+
<img alt="" src="https://img.shields.io/github/stars/jaderd-jh/vite-plugin-debugger.svg?style=social&label=Star" />
|
11
|
+
</a>
|
12
|
+
|
13
|
+
**English** | [中文](README.zh_CN.md)
|
14
|
+
|
15
|
+
## 安装
|
16
|
+
|
17
|
+
**node 版本:** >=20.0.0
|
18
|
+
|
19
|
+
**vite 版本:** >=6.0.0
|
20
|
+
|
21
|
+
```bash
|
22
|
+
pnpm add vite-plugin-debugger -D
|
23
|
+
# or
|
24
|
+
yarn add vite-plugin-debugger -D
|
25
|
+
# or
|
26
|
+
npm i vite-plugin-debugger -D
|
27
|
+
```
|
28
|
+
|
29
|
+
## 使用
|
30
|
+
|
31
|
+
### For [eruda](https://github.com/liriliri/eruda)
|
32
|
+
|
33
|
+
由于eruda的未打包大小有2.38MB,所以我们推荐默认使用CDN方式引入
|
34
|
+
|
35
|
+
```typescript
|
36
|
+
import vDebugger from 'vite-plugin-debugger/eruda'
|
37
|
+
|
38
|
+
export default defineConfig(({ command, mode }) => ({
|
39
|
+
plugins: [
|
40
|
+
vDebugger({
|
41
|
+
debug: mode !== 'production',
|
42
|
+
eruda: {
|
43
|
+
// cdn: 'jsdelivr', // 'jsdelivr' | 'unpkg' | 'cdnjs'
|
44
|
+
// src: 'custom CDN URL',
|
45
|
+
options: {
|
46
|
+
tool: ['console', 'elements'],
|
47
|
+
useShadowDom: true,
|
48
|
+
autoScale: true,
|
49
|
+
defaults: {
|
50
|
+
displaySize: 50,
|
51
|
+
transparency: 0.8,
|
52
|
+
theme: 'Dark',
|
53
|
+
},
|
54
|
+
},
|
55
|
+
},
|
56
|
+
})
|
57
|
+
]
|
58
|
+
}))
|
59
|
+
```
|
60
|
+
|
61
|
+
使用active工具强制开启eruda,您可以像这样指定激活方法和参数名:
|
62
|
+
|
63
|
+
```typescript
|
64
|
+
const config = {
|
65
|
+
active: {
|
66
|
+
override: true, // 设置为true以覆盖debug选项
|
67
|
+
mode: 'url',
|
68
|
+
param: 'debugwhatever',
|
69
|
+
}
|
70
|
+
}
|
71
|
+
```
|
72
|
+
|
73
|
+
想了解更多有关eruda配置,请移至 [eruda API](https://github.com/liriliri/eruda/blob/master/doc/API.md).
|
74
|
+
|
75
|
+
如果您偏好于在本地使用eruda,您应该先安装reuda及其插件。
|
76
|
+
|
77
|
+
```bash
|
78
|
+
pnpm add eruda -D
|
79
|
+
# or
|
80
|
+
yarn add eruda -D
|
81
|
+
# or
|
82
|
+
npm i eruda -D
|
83
|
+
|
84
|
+
```
|
85
|
+
|
86
|
+
```typescript
|
87
|
+
import { fileURLToPath } from 'node:url'
|
88
|
+
import vDebugger from 'vite-plugin-debugger/eruda'
|
89
|
+
|
90
|
+
const resolve = (dir: string) => fileURLToPath(new URL(dir, import.meta.url))
|
91
|
+
|
92
|
+
export default defineConfig(({ command, mode }) => ({
|
93
|
+
plugins: [
|
94
|
+
vDebugger({
|
95
|
+
debug: mode !== 'production',
|
96
|
+
local: true,
|
97
|
+
entry: resolve('src/main.ts'), // vue or src/main.tsx for react
|
98
|
+
eruda: {
|
99
|
+
options: {
|
100
|
+
tool: ['console', 'elements'],
|
101
|
+
useShadowDom: true,
|
102
|
+
autoScale: true,
|
103
|
+
defaults: {
|
104
|
+
displaySize: 50,
|
105
|
+
transparency: 0.8,
|
106
|
+
theme: 'Dark',
|
107
|
+
},
|
108
|
+
},
|
109
|
+
}
|
110
|
+
})
|
111
|
+
]
|
112
|
+
}))
|
113
|
+
```
|
114
|
+
|
115
|
+
### For [vConsole](https://github.com/Tencent/vConsole)
|
116
|
+
|
117
|
+
由于vConsole的未打包大小有344kb,所以我们推荐默认使用CDN方式引入
|
118
|
+
|
119
|
+
```typescript
|
120
|
+
import vDebugger from 'vite-plugin-debugger/vconsole'
|
121
|
+
|
122
|
+
export default defineConfig(({ command, mode }) => ({
|
123
|
+
plugins: [
|
124
|
+
vDebugger({
|
125
|
+
debug: mode !== 'production',
|
126
|
+
vConsole: {
|
127
|
+
options: {
|
128
|
+
theme: 'dark',
|
129
|
+
},
|
130
|
+
},
|
131
|
+
})
|
132
|
+
]
|
133
|
+
}))
|
134
|
+
```
|
135
|
+
|
136
|
+
使用active配置动态开启vConsole,您可以像这样指定激活方法和参数名:
|
137
|
+
|
138
|
+
active: { mode: 'url', param: 'debugwhatever' },
|
139
|
+
|
140
|
+
想了解更多有关vConsole配置,请移至 [vConsole API](https://github.com/Tencent/vConsole/blob/dev/doc/public_properties_methods.md).
|
141
|
+
|
142
|
+
如果您偏好于在本地使用vConsole,您应该先安装vConsole及其插件。
|
143
|
+
|
144
|
+
```bash
|
145
|
+
pnpm add vconsole -D
|
146
|
+
# or
|
147
|
+
yarn add vconsole -D
|
148
|
+
# or
|
149
|
+
npm i vconsole -D
|
150
|
+
```
|
151
|
+
|
152
|
+
```typescript
|
153
|
+
import { fileURLToPath } from 'node:url'
|
154
|
+
import vDebugger from 'vite-plugin-debugger/vconsole'
|
155
|
+
|
156
|
+
const resolve = (dir: string) => fileURLToPath(new URL(dir, import.meta.url))
|
157
|
+
|
158
|
+
export default defineConfig(({ command, mode }) => ({
|
159
|
+
plugins: [
|
160
|
+
vDebugger({
|
161
|
+
debug: mode !== 'production',
|
162
|
+
local: true,
|
163
|
+
entry: resolve('src/main.ts'), // vue or src/main.tsx for react
|
164
|
+
vConsole: {
|
165
|
+
options: {
|
166
|
+
theme: 'dark',
|
167
|
+
},
|
168
|
+
},
|
169
|
+
})
|
170
|
+
]
|
171
|
+
}))
|
172
|
+
```
|
173
|
+
|
174
|
+
## License
|
175
|
+
|
176
|
+
[MIT](../../LICENSE)
|
@@ -1,9 +1,12 @@
|
|
1
|
-
// ../../node_modules/.pnpm/local-pkg@
|
1
|
+
// ../../node_modules/.pnpm/local-pkg@1.1.1/node_modules/local-pkg/dist/index.mjs
|
2
|
+
import fs2 from "node:fs";
|
2
3
|
import { createRequire as createRequire2 } from "node:module";
|
3
|
-
import
|
4
|
+
import path2, { dirname as dirname3, join as join2, win32 } from "node:path";
|
4
5
|
import process2 from "node:process";
|
6
|
+
import fsPromises from "node:fs/promises";
|
7
|
+
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
5
8
|
|
6
|
-
// ../../node_modules/.pnpm/acorn@8.14.
|
9
|
+
// ../../node_modules/.pnpm/acorn@8.14.1/node_modules/acorn/dist/acorn.mjs
|
7
10
|
var astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 7, 9, 32, 4, 318, 1, 80, 3, 71, 10, 50, 3, 123, 2, 54, 14, 32, 10, 3, 1, 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 3, 0, 158, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 68, 8, 2, 0, 3, 0, 2, 3, 2, 4, 2, 0, 15, 1, 83, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 7, 19, 58, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 343, 9, 54, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 10, 1, 2, 0, 49, 6, 4, 4, 14, 10, 5350, 0, 7, 14, 11465, 27, 2343, 9, 87, 9, 39, 4, 60, 6, 26, 9, 535, 9, 470, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4178, 9, 519, 45, 3, 22, 543, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 101, 0, 161, 6, 10, 9, 357, 0, 62, 13, 499, 13, 245, 1, 2, 9, 726, 6, 110, 6, 6, 9, 4759, 9, 787719, 239];
|
8
11
|
var astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 4, 51, 13, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 8, 70, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 39, 27, 10, 22, 251, 41, 7, 1, 17, 2, 60, 28, 11, 0, 9, 21, 43, 17, 47, 20, 28, 22, 13, 52, 58, 1, 3, 0, 14, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 20, 1, 64, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 31, 9, 2, 0, 3, 0, 2, 37, 2, 0, 26, 0, 2, 0, 45, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 38, 6, 186, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 19, 72, 200, 32, 32, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, 16, 0, 2, 12, 2, 33, 125, 0, 80, 921, 103, 110, 18, 195, 2637, 96, 16, 1071, 18, 5, 26, 3994, 6, 582, 6842, 29, 1763, 568, 8, 30, 18, 78, 18, 29, 19, 47, 17, 3, 32, 20, 6, 18, 433, 44, 212, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 42, 9, 8936, 3, 2, 6, 2, 1, 2, 290, 16, 0, 30, 2, 3, 0, 15, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 1845, 30, 7, 5, 262, 61, 147, 44, 11, 6, 17, 0, 322, 29, 19, 43, 485, 27, 229, 29, 3, 0, 496, 6, 2, 3, 2, 1, 2, 14, 2, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42719, 33, 4153, 7, 221, 3, 5761, 15, 7472, 16, 621, 2467, 541, 1507, 4938, 6, 4191];
|
9
12
|
var nonASCIIidentifierChars = "\u200C\u200D\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u200C\u200D\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\u30FB\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F\uFF65";
|
@@ -423,6 +426,7 @@ var SCOPE_SIMPLE_CATCH = 32;
|
|
423
426
|
var SCOPE_SUPER = 64;
|
424
427
|
var SCOPE_DIRECT_SUPER = 128;
|
425
428
|
var SCOPE_CLASS_STATIC_BLOCK = 256;
|
429
|
+
var SCOPE_CLASS_FIELD_INIT = 512;
|
426
430
|
var SCOPE_VAR = SCOPE_TOP | SCOPE_FUNCTION | SCOPE_CLASS_STATIC_BLOCK;
|
427
431
|
function functionFlags(async, generator) {
|
428
432
|
return SCOPE_FUNCTION | (async ? SCOPE_ASYNC : 0) | (generator ? SCOPE_GENERATOR : 0);
|
@@ -491,19 +495,20 @@ prototypeAccessors.inFunction.get = function() {
|
|
491
495
|
return (this.currentVarScope().flags & SCOPE_FUNCTION) > 0;
|
492
496
|
};
|
493
497
|
prototypeAccessors.inGenerator.get = function() {
|
494
|
-
return (this.currentVarScope().flags & SCOPE_GENERATOR) > 0
|
498
|
+
return (this.currentVarScope().flags & SCOPE_GENERATOR) > 0;
|
495
499
|
};
|
496
500
|
prototypeAccessors.inAsync.get = function() {
|
497
|
-
return (this.currentVarScope().flags & SCOPE_ASYNC) > 0
|
501
|
+
return (this.currentVarScope().flags & SCOPE_ASYNC) > 0;
|
498
502
|
};
|
499
503
|
prototypeAccessors.canAwait.get = function() {
|
500
504
|
for (var i = this.scopeStack.length - 1; i >= 0; i--) {
|
501
|
-
var
|
502
|
-
|
505
|
+
var ref2 = this.scopeStack[i];
|
506
|
+
var flags = ref2.flags;
|
507
|
+
if (flags & (SCOPE_CLASS_STATIC_BLOCK | SCOPE_CLASS_FIELD_INIT)) {
|
503
508
|
return false;
|
504
509
|
}
|
505
|
-
if (
|
506
|
-
return (
|
510
|
+
if (flags & SCOPE_FUNCTION) {
|
511
|
+
return (flags & SCOPE_ASYNC) > 0;
|
507
512
|
}
|
508
513
|
}
|
509
514
|
return this.inModule && this.options.ecmaVersion >= 13 || this.options.allowAwaitOutsideFunction;
|
@@ -511,8 +516,7 @@ prototypeAccessors.canAwait.get = function() {
|
|
511
516
|
prototypeAccessors.allowSuper.get = function() {
|
512
517
|
var ref2 = this.currentThisScope();
|
513
518
|
var flags = ref2.flags;
|
514
|
-
|
515
|
-
return (flags & SCOPE_SUPER) > 0 || inClassFieldInit || this.options.allowSuperOutsideMethod;
|
519
|
+
return (flags & SCOPE_SUPER) > 0 || this.options.allowSuperOutsideMethod;
|
516
520
|
};
|
517
521
|
prototypeAccessors.allowDirectSuper.get = function() {
|
518
522
|
return (this.currentThisScope().flags & SCOPE_DIRECT_SUPER) > 0;
|
@@ -521,10 +525,14 @@ prototypeAccessors.treatFunctionsAsVar.get = function() {
|
|
521
525
|
return this.treatFunctionsAsVarInScope(this.currentScope());
|
522
526
|
};
|
523
527
|
prototypeAccessors.allowNewDotTarget.get = function() {
|
524
|
-
var
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
+
for (var i = this.scopeStack.length - 1; i >= 0; i--) {
|
529
|
+
var ref2 = this.scopeStack[i];
|
530
|
+
var flags = ref2.flags;
|
531
|
+
if (flags & (SCOPE_CLASS_STATIC_BLOCK | SCOPE_CLASS_FIELD_INIT) || flags & SCOPE_FUNCTION && !(flags & SCOPE_ARROW)) {
|
532
|
+
return true;
|
533
|
+
}
|
534
|
+
}
|
535
|
+
return false;
|
528
536
|
};
|
529
537
|
prototypeAccessors.inClassStaticBlock.get = function() {
|
530
538
|
return (this.currentVarScope().flags & SCOPE_CLASS_STATIC_BLOCK) > 0;
|
@@ -1367,11 +1375,9 @@ pp$8.parseClassField = function(field) {
|
|
1367
1375
|
this.raise(field.key.start, "Classes can't have a static field named 'prototype'");
|
1368
1376
|
}
|
1369
1377
|
if (this.eat(types$1.eq)) {
|
1370
|
-
|
1371
|
-
var inClassFieldInit = scope.inClassFieldInit;
|
1372
|
-
scope.inClassFieldInit = true;
|
1378
|
+
this.enterScope(SCOPE_CLASS_FIELD_INIT | SCOPE_SUPER);
|
1373
1379
|
field.value = this.parseMaybeAssign();
|
1374
|
-
|
1380
|
+
this.exitScope();
|
1375
1381
|
} else {
|
1376
1382
|
field.value = null;
|
1377
1383
|
}
|
@@ -1494,6 +1500,9 @@ pp$8.parseExport = function(node, exports) {
|
|
1494
1500
|
}
|
1495
1501
|
node.specifiers = [];
|
1496
1502
|
node.source = null;
|
1503
|
+
if (this.options.ecmaVersion >= 16) {
|
1504
|
+
node.attributes = [];
|
1505
|
+
}
|
1497
1506
|
} else {
|
1498
1507
|
node.declaration = null;
|
1499
1508
|
node.specifiers = this.parseExportSpecifiers(exports);
|
@@ -1515,6 +1524,9 @@ pp$8.parseExport = function(node, exports) {
|
|
1515
1524
|
}
|
1516
1525
|
}
|
1517
1526
|
node.source = null;
|
1527
|
+
if (this.options.ecmaVersion >= 16) {
|
1528
|
+
node.attributes = [];
|
1529
|
+
}
|
1518
1530
|
}
|
1519
1531
|
this.semicolon();
|
1520
1532
|
}
|
@@ -2874,9 +2886,10 @@ pp$5.parseProperty = function(isPattern, refDestructuringErrors) {
|
|
2874
2886
|
return this.finishNode(prop, "Property");
|
2875
2887
|
};
|
2876
2888
|
pp$5.parseGetterSetter = function(prop) {
|
2877
|
-
|
2889
|
+
var kind = prop.key.name;
|
2878
2890
|
this.parsePropertyName(prop);
|
2879
2891
|
prop.value = this.parseMethod(false);
|
2892
|
+
prop.kind = kind;
|
2880
2893
|
var paramCount = prop.kind === "get" ? 0 : 1;
|
2881
2894
|
if (prop.value.params.length !== paramCount) {
|
2882
2895
|
var start = prop.value.start;
|
@@ -2902,9 +2915,9 @@ pp$5.parsePropertyValue = function(prop, isPattern, isGenerator, isAsync, startP
|
|
2902
2915
|
if (isPattern) {
|
2903
2916
|
this.unexpected();
|
2904
2917
|
}
|
2905
|
-
prop.kind = "init";
|
2906
2918
|
prop.method = true;
|
2907
2919
|
prop.value = this.parseMethod(isGenerator, isAsync);
|
2920
|
+
prop.kind = "init";
|
2908
2921
|
} else if (!isPattern && !containsEsc && this.options.ecmaVersion >= 5 && !prop.computed && prop.key.type === "Identifier" && (prop.key.name === "get" || prop.key.name === "set") && (this.type !== types$1.comma && this.type !== types$1.braceR && this.type !== types$1.eq)) {
|
2909
2922
|
if (isGenerator || isAsync) {
|
2910
2923
|
this.unexpected();
|
@@ -2918,7 +2931,6 @@ pp$5.parsePropertyValue = function(prop, isPattern, isGenerator, isAsync, startP
|
|
2918
2931
|
if (prop.key.name === "await" && !this.awaitIdentPos) {
|
2919
2932
|
this.awaitIdentPos = startPos;
|
2920
2933
|
}
|
2921
|
-
prop.kind = "init";
|
2922
2934
|
if (isPattern) {
|
2923
2935
|
prop.value = this.parseMaybeDefault(startPos, startLoc, this.copyNode(prop.key));
|
2924
2936
|
} else if (this.type === types$1.eq && refDestructuringErrors) {
|
@@ -2929,6 +2941,7 @@ pp$5.parsePropertyValue = function(prop, isPattern, isGenerator, isAsync, startP
|
|
2929
2941
|
} else {
|
2930
2942
|
prop.value = this.copyNode(prop.key);
|
2931
2943
|
}
|
2944
|
+
prop.kind = "init";
|
2932
2945
|
prop.shorthand = true;
|
2933
2946
|
} else {
|
2934
2947
|
this.unexpected();
|
@@ -3078,7 +3091,7 @@ pp$5.checkUnreserved = function(ref2) {
|
|
3078
3091
|
if (this.inAsync && name === "await") {
|
3079
3092
|
this.raiseRecoverable(start, "Cannot use 'await' as identifier inside an async function");
|
3080
3093
|
}
|
3081
|
-
if (this.currentThisScope().
|
3094
|
+
if (!(this.currentThisScope().flags & SCOPE_VAR) && name === "arguments") {
|
3082
3095
|
this.raiseRecoverable(start, "Cannot use 'arguments' in class field initializer");
|
3083
3096
|
}
|
3084
3097
|
if (this.inClassStaticBlock && (name === "arguments" || name === "await")) {
|
@@ -3171,6 +3184,9 @@ var pp$4 = Parser.prototype;
|
|
3171
3184
|
pp$4.raise = function(pos, message) {
|
3172
3185
|
var loc = getLineInfo(this.input, pos);
|
3173
3186
|
message += " (" + loc.line + ":" + loc.column + ")";
|
3187
|
+
if (this.sourceFile) {
|
3188
|
+
message += " in " + this.sourceFile;
|
3189
|
+
}
|
3174
3190
|
var err = new SyntaxError(message);
|
3175
3191
|
err.pos = pos;
|
3176
3192
|
err.loc = loc;
|
@@ -3189,7 +3205,6 @@ var Scope = function Scope2(flags) {
|
|
3189
3205
|
this.var = [];
|
3190
3206
|
this.lexical = [];
|
3191
3207
|
this.functions = [];
|
3192
|
-
this.inClassFieldInit = false;
|
3193
3208
|
};
|
3194
3209
|
pp$3.enterScope = function(flags) {
|
3195
3210
|
this.scopeStack.push(new Scope(flags));
|
@@ -3251,7 +3266,7 @@ pp$3.currentScope = function() {
|
|
3251
3266
|
pp$3.currentVarScope = function() {
|
3252
3267
|
for (var i = this.scopeStack.length - 1; ; i--) {
|
3253
3268
|
var scope = this.scopeStack[i];
|
3254
|
-
if (scope.flags & SCOPE_VAR) {
|
3269
|
+
if (scope.flags & (SCOPE_VAR | SCOPE_CLASS_FIELD_INIT | SCOPE_CLASS_STATIC_BLOCK)) {
|
3255
3270
|
return scope;
|
3256
3271
|
}
|
3257
3272
|
}
|
@@ -3259,7 +3274,7 @@ pp$3.currentVarScope = function() {
|
|
3259
3274
|
pp$3.currentThisScope = function() {
|
3260
3275
|
for (var i = this.scopeStack.length - 1; ; i--) {
|
3261
3276
|
var scope = this.scopeStack[i];
|
3262
|
-
if (scope.flags & SCOPE_VAR && !(scope.flags & SCOPE_ARROW)) {
|
3277
|
+
if (scope.flags & (SCOPE_VAR | SCOPE_CLASS_FIELD_INIT | SCOPE_CLASS_STATIC_BLOCK) && !(scope.flags & SCOPE_ARROW)) {
|
3263
3278
|
return scope;
|
3264
3279
|
}
|
3265
3280
|
}
|
@@ -5507,7 +5522,7 @@ pp.readWord = function() {
|
|
5507
5522
|
}
|
5508
5523
|
return this.finishToken(type, word);
|
5509
5524
|
};
|
5510
|
-
var version = "8.14.
|
5525
|
+
var version = "8.14.1";
|
5511
5526
|
Parser.acorn = {
|
5512
5527
|
Parser,
|
5513
5528
|
version,
|
@@ -5530,11 +5545,11 @@ Parser.acorn = {
|
|
5530
5545
|
nonASCIIwhitespace
|
5531
5546
|
};
|
5532
5547
|
|
5533
|
-
// ../../node_modules/.pnpm/mlly@1.7.
|
5548
|
+
// ../../node_modules/.pnpm/mlly@1.7.4/node_modules/mlly/dist/index.mjs
|
5534
5549
|
import { builtinModules, createRequire } from "node:module";
|
5535
5550
|
import fs, { realpathSync, statSync, promises } from "node:fs";
|
5536
5551
|
|
5537
|
-
// ../../node_modules/.pnpm/ufo@1.
|
5552
|
+
// ../../node_modules/.pnpm/ufo@1.6.1/node_modules/ufo/dist/index.mjs
|
5538
5553
|
var r = String.fromCharCode;
|
5539
5554
|
var TRAILING_SLASH_RE = /\/$|\/\?|\/#/;
|
5540
5555
|
var JOIN_LEADING_SLASH_RE = /^\.?\//;
|
@@ -5551,17 +5566,17 @@ function withTrailingSlash(input = "", respectQueryAndFragment) {
|
|
5551
5566
|
if (hasTrailingSlash(input, true)) {
|
5552
5567
|
return input || "/";
|
5553
5568
|
}
|
5554
|
-
let
|
5569
|
+
let path3 = input;
|
5555
5570
|
let fragment = "";
|
5556
5571
|
const fragmentIndex = input.indexOf("#");
|
5557
|
-
if (fragmentIndex
|
5558
|
-
|
5572
|
+
if (fragmentIndex !== -1) {
|
5573
|
+
path3 = input.slice(0, fragmentIndex);
|
5559
5574
|
fragment = input.slice(fragmentIndex);
|
5560
|
-
if (!
|
5575
|
+
if (!path3) {
|
5561
5576
|
return fragment;
|
5562
5577
|
}
|
5563
5578
|
}
|
5564
|
-
const [s0, ...s] =
|
5579
|
+
const [s0, ...s] = path3.split("?");
|
5565
5580
|
return s0 + "/" + (s.length > 0 ? `?${s.join("?")}` : "") + fragment;
|
5566
5581
|
}
|
5567
5582
|
function isNonEmptyURL(url) {
|
@@ -5581,22 +5596,22 @@ function joinURL(base, ...input) {
|
|
5581
5596
|
}
|
5582
5597
|
var protocolRelative = Symbol.for("ufo:protocolRelative");
|
5583
5598
|
|
5584
|
-
// ../../node_modules/.pnpm/pathe@
|
5599
|
+
// ../../node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs
|
5585
5600
|
var _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
|
5586
5601
|
var isAbsolute = function(p) {
|
5587
5602
|
return _IS_ABSOLUTE_RE.test(p);
|
5588
5603
|
};
|
5589
5604
|
|
5590
|
-
// ../../node_modules/.pnpm/mlly@1.7.
|
5605
|
+
// ../../node_modules/.pnpm/mlly@1.7.4/node_modules/mlly/dist/index.mjs
|
5591
5606
|
import { fileURLToPath as fileURLToPath$1, URL as URL$1, pathToFileURL as pathToFileURL$1 } from "node:url";
|
5592
5607
|
import assert from "node:assert";
|
5593
5608
|
import process$1 from "node:process";
|
5594
|
-
import
|
5609
|
+
import path, { dirname as dirname2 } from "node:path";
|
5595
5610
|
import v8 from "node:v8";
|
5596
5611
|
import { format as format2, inspect } from "node:util";
|
5597
5612
|
var BUILTIN_MODULES = new Set(builtinModules);
|
5598
|
-
function normalizeSlash(
|
5599
|
-
return
|
5613
|
+
function normalizeSlash(path3) {
|
5614
|
+
return path3.replace(/\\/g, "/");
|
5600
5615
|
}
|
5601
5616
|
var own$1 = {}.hasOwnProperty;
|
5602
5617
|
var classRegExp = /^([A-Z][a-z\d]*)+$/;
|
@@ -5709,8 +5724,8 @@ codes.ERR_INVALID_PACKAGE_CONFIG = createError(
|
|
5709
5724
|
* @param {string} [base]
|
5710
5725
|
* @param {string} [message]
|
5711
5726
|
*/
|
5712
|
-
(
|
5713
|
-
return `Invalid package config ${
|
5727
|
+
(path3, base, message) => {
|
5728
|
+
return `Invalid package config ${path3}${base ? ` while importing ${base}` : ""}${message ? `. ${message}` : ""}`;
|
5714
5729
|
},
|
5715
5730
|
Error
|
5716
5731
|
);
|
@@ -5742,8 +5757,8 @@ codes.ERR_MODULE_NOT_FOUND = createError(
|
|
5742
5757
|
* @param {string} base
|
5743
5758
|
* @param {boolean} [exactUrl]
|
5744
5759
|
*/
|
5745
|
-
(
|
5746
|
-
return `Cannot find ${exactUrl ? "module" : "package"} '${
|
5760
|
+
(path3, base, exactUrl = false) => {
|
5761
|
+
return `Cannot find ${exactUrl ? "module" : "package"} '${path3}' imported from ${base}`;
|
5747
5762
|
},
|
5748
5763
|
Error
|
5749
5764
|
);
|
@@ -5794,8 +5809,8 @@ codes.ERR_UNKNOWN_FILE_EXTENSION = createError(
|
|
5794
5809
|
* @param {string} extension
|
5795
5810
|
* @param {string} path
|
5796
5811
|
*/
|
5797
|
-
(extension,
|
5798
|
-
return `Unknown file extension "${extension}" for ${
|
5812
|
+
(extension, path3) => {
|
5813
|
+
return `Unknown file extension "${extension}" for ${path3}`;
|
5799
5814
|
},
|
5800
5815
|
TypeError
|
5801
5816
|
);
|
@@ -5940,7 +5955,7 @@ function read(jsonPath, { base, specifier }) {
|
|
5940
5955
|
}
|
5941
5956
|
let string;
|
5942
5957
|
try {
|
5943
|
-
string = fs.readFileSync(
|
5958
|
+
string = fs.readFileSync(path.toNamespacedPath(jsonPath), "utf8");
|
5944
5959
|
} catch (error) {
|
5945
5960
|
const exception = (
|
5946
5961
|
/** @type {ErrnoException} */
|
@@ -6156,7 +6171,7 @@ Default "index" lookups for the main are deprecated for ES modules.`,
|
|
6156
6171
|
"DeprecationWarning",
|
6157
6172
|
"DEP0151"
|
6158
6173
|
);
|
6159
|
-
} else if (
|
6174
|
+
} else if (path.resolve(packagePath, main) !== urlPath) {
|
6160
6175
|
process$1.emitWarning(
|
6161
6176
|
`Package ${packagePath} has a "main" field set to "${main}", excluding the full filename and extension to the resolved file at "${urlPath.slice(
|
6162
6177
|
packagePath.length
|
@@ -6167,9 +6182,9 @@ Default "index" lookups for the main are deprecated for ES modules.`,
|
|
6167
6182
|
);
|
6168
6183
|
}
|
6169
6184
|
}
|
6170
|
-
function tryStatSync(
|
6185
|
+
function tryStatSync(path3) {
|
6171
6186
|
try {
|
6172
|
-
return statSync(
|
6187
|
+
return statSync(path3);
|
6173
6188
|
} catch {
|
6174
6189
|
}
|
6175
6190
|
}
|
@@ -6260,10 +6275,10 @@ function finalizeResolution(resolved, base, preserveSymlinks) {
|
|
6260
6275
|
error.url = String(resolved);
|
6261
6276
|
throw error;
|
6262
6277
|
}
|
6263
|
-
|
6278
|
+
{
|
6264
6279
|
const real = realpathSync(filePath);
|
6265
6280
|
const { search, hash } = resolved;
|
6266
|
-
resolved = pathToFileURL$1(real + (filePath.endsWith(
|
6281
|
+
resolved = pathToFileURL$1(real + (filePath.endsWith(path.sep) ? "/" : ""));
|
6267
6282
|
resolved.search = search;
|
6268
6283
|
resolved.hash = hash;
|
6269
6284
|
}
|
@@ -6807,7 +6822,7 @@ function moduleResolve(specifier, base, conditions, preserveSymlinks) {
|
|
6807
6822
|
if (resolved.protocol !== "file:") {
|
6808
6823
|
return resolved;
|
6809
6824
|
}
|
6810
|
-
return finalizeResolution(resolved, base
|
6825
|
+
return finalizeResolution(resolved, base);
|
6811
6826
|
}
|
6812
6827
|
function fileURLToPath(id) {
|
6813
6828
|
if (typeof id === "string" && !id.startsWith("file://")) {
|
@@ -6934,9 +6949,157 @@ function resolvePathSync(id, options) {
|
|
6934
6949
|
return fileURLToPath(resolveSync(id, options));
|
6935
6950
|
}
|
6936
6951
|
|
6937
|
-
// ../../node_modules/.pnpm/
|
6938
|
-
var
|
6939
|
-
|
6952
|
+
// ../../node_modules/.pnpm/quansync@0.2.10/node_modules/quansync/dist/index.mjs
|
6953
|
+
var GET_IS_ASYNC = Symbol.for("quansync.getIsAsync");
|
6954
|
+
var QuansyncError = class extends Error {
|
6955
|
+
constructor(message = "Unexpected promise in sync context") {
|
6956
|
+
super(message);
|
6957
|
+
this.name = "QuansyncError";
|
6958
|
+
}
|
6959
|
+
};
|
6960
|
+
function isThenable(value) {
|
6961
|
+
return value && typeof value === "object" && typeof value.then === "function";
|
6962
|
+
}
|
6963
|
+
function isQuansyncGenerator(value) {
|
6964
|
+
return value && typeof value === "object" && typeof value[Symbol.iterator] === "function" && "__quansync" in value;
|
6965
|
+
}
|
6966
|
+
function fromObject(options) {
|
6967
|
+
const generator = function* (...args) {
|
6968
|
+
const isAsync = yield GET_IS_ASYNC;
|
6969
|
+
if (isAsync)
|
6970
|
+
return yield options.async.apply(this, args);
|
6971
|
+
return options.sync.apply(this, args);
|
6972
|
+
};
|
6973
|
+
function fn(...args) {
|
6974
|
+
const iter = generator.apply(this, args);
|
6975
|
+
iter.then = (...thenArgs) => options.async.apply(this, args).then(...thenArgs);
|
6976
|
+
iter.__quansync = true;
|
6977
|
+
return iter;
|
6978
|
+
}
|
6979
|
+
fn.sync = options.sync;
|
6980
|
+
fn.async = options.async;
|
6981
|
+
return fn;
|
6982
|
+
}
|
6983
|
+
function fromPromise(promise) {
|
6984
|
+
return fromObject({
|
6985
|
+
async: () => Promise.resolve(promise),
|
6986
|
+
sync: () => {
|
6987
|
+
if (isThenable(promise))
|
6988
|
+
throw new QuansyncError();
|
6989
|
+
return promise;
|
6990
|
+
}
|
6991
|
+
});
|
6992
|
+
}
|
6993
|
+
function unwrapYield(value, isAsync) {
|
6994
|
+
if (value === GET_IS_ASYNC)
|
6995
|
+
return isAsync;
|
6996
|
+
if (isQuansyncGenerator(value))
|
6997
|
+
return isAsync ? iterateAsync(value) : iterateSync(value);
|
6998
|
+
if (!isAsync && isThenable(value))
|
6999
|
+
throw new QuansyncError();
|
7000
|
+
return value;
|
7001
|
+
}
|
7002
|
+
var DEFAULT_ON_YIELD = (value) => value;
|
7003
|
+
function iterateSync(generator, onYield = DEFAULT_ON_YIELD) {
|
7004
|
+
let current2 = generator.next();
|
7005
|
+
while (!current2.done) {
|
7006
|
+
try {
|
7007
|
+
current2 = generator.next(unwrapYield(onYield(current2.value, false)));
|
7008
|
+
} catch (err) {
|
7009
|
+
current2 = generator.throw(err);
|
7010
|
+
}
|
7011
|
+
}
|
7012
|
+
return unwrapYield(current2.value);
|
7013
|
+
}
|
7014
|
+
async function iterateAsync(generator, onYield = DEFAULT_ON_YIELD) {
|
7015
|
+
let current2 = generator.next();
|
7016
|
+
while (!current2.done) {
|
7017
|
+
try {
|
7018
|
+
current2 = generator.next(await unwrapYield(onYield(current2.value, true), true));
|
7019
|
+
} catch (err) {
|
7020
|
+
current2 = generator.throw(err);
|
7021
|
+
}
|
7022
|
+
}
|
7023
|
+
return current2.value;
|
7024
|
+
}
|
7025
|
+
function fromGeneratorFn(generatorFn, options) {
|
7026
|
+
return fromObject({
|
7027
|
+
name: generatorFn.name,
|
7028
|
+
async(...args) {
|
7029
|
+
return iterateAsync(generatorFn.apply(this, args), options?.onYield);
|
7030
|
+
},
|
7031
|
+
sync(...args) {
|
7032
|
+
return iterateSync(generatorFn.apply(this, args), options?.onYield);
|
7033
|
+
}
|
7034
|
+
});
|
7035
|
+
}
|
7036
|
+
function quansync(input, options) {
|
7037
|
+
if (isThenable(input))
|
7038
|
+
return fromPromise(input);
|
7039
|
+
if (typeof input === "function")
|
7040
|
+
return fromGeneratorFn(input, options);
|
7041
|
+
else
|
7042
|
+
return fromObject(input);
|
7043
|
+
}
|
7044
|
+
var getIsAsync = quansync({
|
7045
|
+
async: () => Promise.resolve(true),
|
7046
|
+
sync: () => false
|
7047
|
+
});
|
7048
|
+
|
7049
|
+
// ../../node_modules/.pnpm/quansync@0.2.10/node_modules/quansync/dist/macro.mjs
|
7050
|
+
var quansync2 = quansync;
|
7051
|
+
|
7052
|
+
// ../../node_modules/.pnpm/local-pkg@1.1.1/node_modules/local-pkg/dist/index.mjs
|
7053
|
+
var toPath = (urlOrPath) => urlOrPath instanceof URL ? fileURLToPath2(urlOrPath) : urlOrPath;
|
7054
|
+
async function findUp$1(name, {
|
7055
|
+
cwd = process2.cwd(),
|
7056
|
+
type = "file",
|
7057
|
+
stopAt
|
7058
|
+
} = {}) {
|
7059
|
+
let directory = path2.resolve(toPath(cwd) ?? "");
|
7060
|
+
const { root } = path2.parse(directory);
|
7061
|
+
stopAt = path2.resolve(directory, toPath(stopAt ?? root));
|
7062
|
+
const isAbsoluteName = path2.isAbsolute(name);
|
7063
|
+
while (directory) {
|
7064
|
+
const filePath = isAbsoluteName ? name : path2.join(directory, name);
|
7065
|
+
try {
|
7066
|
+
const stats = await fsPromises.stat(filePath);
|
7067
|
+
if (type === "file" && stats.isFile() || type === "directory" && stats.isDirectory()) {
|
7068
|
+
return filePath;
|
7069
|
+
}
|
7070
|
+
} catch {
|
7071
|
+
}
|
7072
|
+
if (directory === stopAt || directory === root) {
|
7073
|
+
break;
|
7074
|
+
}
|
7075
|
+
directory = path2.dirname(directory);
|
7076
|
+
}
|
7077
|
+
}
|
7078
|
+
function findUpSync(name, {
|
7079
|
+
cwd = process2.cwd(),
|
7080
|
+
type = "file",
|
7081
|
+
stopAt
|
7082
|
+
} = {}) {
|
7083
|
+
let directory = path2.resolve(toPath(cwd) ?? "");
|
7084
|
+
const { root } = path2.parse(directory);
|
7085
|
+
stopAt = path2.resolve(directory, toPath(stopAt) ?? root);
|
7086
|
+
const isAbsoluteName = path2.isAbsolute(name);
|
7087
|
+
while (directory) {
|
7088
|
+
const filePath = isAbsoluteName ? name : path2.join(directory, name);
|
7089
|
+
try {
|
7090
|
+
const stats = fs2.statSync(filePath, { throwIfNoEntry: false });
|
7091
|
+
if (type === "file" && stats?.isFile() || type === "directory" && stats?.isDirectory()) {
|
7092
|
+
return filePath;
|
7093
|
+
}
|
7094
|
+
} catch {
|
7095
|
+
}
|
7096
|
+
if (directory === stopAt || directory === root) {
|
7097
|
+
break;
|
7098
|
+
}
|
7099
|
+
directory = path2.dirname(directory);
|
7100
|
+
}
|
7101
|
+
}
|
7102
|
+
function _resolve2(path3, options = {}) {
|
6940
7103
|
if (options.platform === "auto" || !options.platform)
|
6941
7104
|
options.platform = process2.platform === "win32" ? "win32" : "posix";
|
6942
7105
|
if (process2.versions.pnp) {
|
@@ -6945,11 +7108,11 @@ function _resolve2(path4, options = {}) {
|
|
6945
7108
|
paths.push(process2.cwd());
|
6946
7109
|
const targetRequire = createRequire2(import.meta.url);
|
6947
7110
|
try {
|
6948
|
-
return targetRequire.resolve(
|
7111
|
+
return targetRequire.resolve(path3, { paths });
|
6949
7112
|
} catch {
|
6950
7113
|
}
|
6951
7114
|
}
|
6952
|
-
const modulePath = resolvePathSync(
|
7115
|
+
const modulePath = resolvePathSync(path3, {
|
6953
7116
|
url: options.paths
|
6954
7117
|
});
|
6955
7118
|
if (options.platform === "win32")
|
@@ -6959,6 +7122,30 @@ function _resolve2(path4, options = {}) {
|
|
6959
7122
|
function isPackageExists(name, options = {}) {
|
6960
7123
|
return !!resolvePackage(name, options);
|
6961
7124
|
}
|
7125
|
+
function getPackageJsonPath(name, options = {}) {
|
7126
|
+
const entry = resolvePackage(name, options);
|
7127
|
+
if (!entry)
|
7128
|
+
return;
|
7129
|
+
return searchPackageJSON(entry);
|
7130
|
+
}
|
7131
|
+
var readFile = quansync2({
|
7132
|
+
async: (id) => fs2.promises.readFile(id, "utf8"),
|
7133
|
+
sync: (id) => fs2.readFileSync(id, "utf8")
|
7134
|
+
});
|
7135
|
+
var getPackageInfo = quansync2(function* (name, options = {}) {
|
7136
|
+
const packageJsonPath = getPackageJsonPath(name, options);
|
7137
|
+
if (!packageJsonPath)
|
7138
|
+
return;
|
7139
|
+
const packageJson = JSON.parse(yield readFile(packageJsonPath));
|
7140
|
+
return {
|
7141
|
+
name,
|
7142
|
+
version: packageJson.version,
|
7143
|
+
rootPath: dirname3(packageJsonPath),
|
7144
|
+
packageJsonPath,
|
7145
|
+
packageJson
|
7146
|
+
};
|
7147
|
+
});
|
7148
|
+
var getPackageInfoSync = getPackageInfo.sync;
|
6962
7149
|
function resolvePackage(name, options = {}) {
|
6963
7150
|
try {
|
6964
7151
|
return _resolve2(`${name}/package.json`, options);
|
@@ -6972,11 +7159,48 @@ function resolvePackage(name, options = {}) {
|
|
6972
7159
|
return false;
|
6973
7160
|
}
|
6974
7161
|
}
|
7162
|
+
function searchPackageJSON(dir) {
|
7163
|
+
let packageJsonPath;
|
7164
|
+
while (true) {
|
7165
|
+
if (!dir)
|
7166
|
+
return;
|
7167
|
+
const newDir = dirname3(dir);
|
7168
|
+
if (newDir === dir)
|
7169
|
+
return;
|
7170
|
+
dir = newDir;
|
7171
|
+
packageJsonPath = join2(dir, "package.json");
|
7172
|
+
if (fs2.existsSync(packageJsonPath))
|
7173
|
+
break;
|
7174
|
+
}
|
7175
|
+
return packageJsonPath;
|
7176
|
+
}
|
7177
|
+
var findUp = quansync2({
|
7178
|
+
sync: findUpSync,
|
7179
|
+
async: findUp$1
|
7180
|
+
});
|
7181
|
+
var loadPackageJSON = quansync2(function* (cwd = process2.cwd()) {
|
7182
|
+
const path3 = yield findUp("package.json", { cwd });
|
7183
|
+
if (!path3 || !fs2.existsSync(path3))
|
7184
|
+
return null;
|
7185
|
+
return JSON.parse(yield readFile(path3));
|
7186
|
+
});
|
7187
|
+
var loadPackageJSONSync = loadPackageJSON.sync;
|
7188
|
+
var isPackageListed = quansync2(function* (name, cwd) {
|
7189
|
+
const pkg = (yield loadPackageJSON(cwd)) || {};
|
7190
|
+
return name in (pkg.dependencies || {}) || name in (pkg.devDependencies || {});
|
7191
|
+
});
|
7192
|
+
var isPackageListedSync = isPackageListed.sync;
|
6975
7193
|
|
6976
7194
|
// src/helpers/index.ts
|
6977
7195
|
import { readFileSync } from "node:fs";
|
6978
|
-
import { fileURLToPath as
|
7196
|
+
import { fileURLToPath as fileURLToPath3 } from "node:url";
|
6979
7197
|
var transformCDN = async (pkg, cdn) => {
|
7198
|
+
if (!["eruda", "vConsole"].includes(pkg)) {
|
7199
|
+
throw new Error(`The package "${pkg}" is not supported for CDN transformation.`);
|
7200
|
+
}
|
7201
|
+
if (!["jsdelivr", "unpkg", "cdnjs", "staticfile"].includes(cdn)) {
|
7202
|
+
throw new Error(`The CDN "${cdn}" is not supported for "${pkg}".`);
|
7203
|
+
}
|
6980
7204
|
if (cdn === "jsdelivr") {
|
6981
7205
|
return `https://cdn.jsdelivr.net/npm/${pkg.toLowerCase()}`;
|
6982
7206
|
}
|
@@ -6999,8 +7223,8 @@ var transformCDN = async (pkg, cdn) => {
|
|
6999
7223
|
}
|
7000
7224
|
return "";
|
7001
7225
|
};
|
7002
|
-
var readFileContent = (
|
7003
|
-
return readFileSync(
|
7226
|
+
var readFileContent = (path3) => {
|
7227
|
+
return readFileSync(fileURLToPath3(new URL(path3, import.meta.url)), "utf-8");
|
7004
7228
|
};
|
7005
7229
|
|
7006
7230
|
export {
|
package/dist/eruda.d.ts
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
import { InitOptions } from 'eruda';
|
2
2
|
export { InitOptions } from 'eruda';
|
3
|
-
import { S as SharedConfig, C as CommonConfig } from './index.d-D0Oa6UqJ.js';
|
4
3
|
import { Plugin } from 'vite';
|
4
|
+
import { S as SharedConfig, C as CommonConfig } from './index.d-D0Oa6UqJ.js';
|
5
5
|
|
6
6
|
interface ErudaConfig extends CommonConfig {
|
7
7
|
/**
|
@@ -17,6 +17,6 @@ interface ErudaDebuggerOptions extends SharedConfig {
|
|
17
17
|
*/
|
18
18
|
config?: ErudaConfig;
|
19
19
|
}
|
20
|
-
declare function vDebugger(options: ErudaDebuggerOptions): Plugin
|
20
|
+
declare function vDebugger(options: ErudaDebuggerOptions): Plugin<ErudaDebuggerOptions>;
|
21
21
|
|
22
22
|
export { vDebugger as default, vDebugger };
|
package/dist/eruda.js
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
import {
|
2
2
|
vDebugger
|
3
|
-
} from "./chunk-
|
3
|
+
} from "./chunk-NUUDR57M.js";
|
4
4
|
import {
|
5
5
|
vDebugger as vDebugger2
|
6
|
-
} from "./chunk-
|
7
|
-
import "./chunk-
|
6
|
+
} from "./chunk-IRNZNPGP.js";
|
7
|
+
import "./chunk-VQAYNSKK.js";
|
8
8
|
export {
|
9
9
|
vDebugger as eruda,
|
10
10
|
vDebugger2 as vConsole
|
package/dist/vconsole.d.ts
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
import { VConsoleOptions } from 'core/options.interface';
|
2
2
|
export { VConsoleOptions } from 'core/options.interface';
|
3
|
-
import { S as SharedConfig, C as CommonConfig } from './index.d-D0Oa6UqJ.js';
|
4
3
|
import { Plugin } from 'vite';
|
4
|
+
import { S as SharedConfig, C as CommonConfig } from './index.d-D0Oa6UqJ.js';
|
5
5
|
|
6
6
|
interface VConsoleConfig extends CommonConfig {
|
7
7
|
/**
|
@@ -17,6 +17,6 @@ interface VConsoleDebuggerOptions extends SharedConfig {
|
|
17
17
|
*/
|
18
18
|
config?: VConsoleConfig;
|
19
19
|
}
|
20
|
-
declare function vDebugger(options: VConsoleDebuggerOptions): Plugin
|
20
|
+
declare function vDebugger(options: VConsoleDebuggerOptions): Plugin<VConsoleDebuggerOptions>;
|
21
21
|
|
22
22
|
export { vDebugger as default, vDebugger };
|
package/dist/vconsole.js
CHANGED
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "vite-plugin-debugger",
|
3
3
|
"type": "module",
|
4
|
-
"version": "0.3.
|
4
|
+
"version": "0.3.2",
|
5
5
|
"description": "A vite plugin provide the debugger tools for mobile devices.",
|
6
6
|
"author": "jade-gjz",
|
7
7
|
"license": "MIT",
|
@@ -51,10 +51,10 @@
|
|
51
51
|
}
|
52
52
|
},
|
53
53
|
"devDependencies": {
|
54
|
-
"@types/node": "^22.
|
55
|
-
"local-pkg": "^
|
56
|
-
"terser": "^5.
|
57
|
-
"tsup": "^8.
|
54
|
+
"@types/node": "^22.14.1",
|
55
|
+
"local-pkg": "^1.1.1",
|
56
|
+
"terser": "^5.39.0",
|
57
|
+
"tsup": "^8.4.0"
|
58
58
|
},
|
59
59
|
"scripts": {
|
60
60
|
"dev": "tsup --watch",
|