@vureact/compiler-core 1.8.0 → 1.8.1
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.en.md +147 -25
- package/README.md +147 -27
- package/lib/{chunk-6MTN25KZ.esm.js → chunk-QXYYGKFW.esm.js} +6 -8
- package/lib/{chunk-V7G7OQWK.js → chunk-SGP2JC7F.js} +6 -8
- package/lib/cli.esm.js +2 -2
- package/lib/cli.js +10 -10
- package/lib/compiler-core.esm.js +2 -2
- package/lib/compiler-core.js +3 -3
- package/package.json +3 -3
package/README.en.md
CHANGED
|
@@ -1,36 +1,55 @@
|
|
|
1
1
|
# @vureact/compiler-core
|
|
2
2
|
|
|
3
|
-
**Write in Vue
|
|
3
|
+
**Write in Vue, generate maintainable React.**
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
`@vureact/compiler-core` is the **CLI and core compiler package** of VuReact.
|
|
6
|
+
It compiles Vue 3 SFC, script, and style files into **pure React 18+ code**, making it suitable for progressive migration and for teams that want to keep Vue authoring conventions while targeting a React app.
|
|
7
|
+
|
|
8
|
+
It is a **compile-time solution**, not a runtime bridge.
|
|
6
9
|
|
|
7
|
-
[](https://vureact.top/en/)
|
|
8
10
|
[](https://www.npmjs.com/package/@vureact/compiler-core)
|
|
9
|
-
[](https://www.npmjs.com/package/@vureact/compiler-core)
|
|
10
11
|
[](https://nodejs.org/)
|
|
11
|
-
[](https://
|
|
12
|
-
[](https://vuejs.org/)
|
|
13
|
-
[](https://reactjs.org/)
|
|
12
|
+
[](https://github.com/vureact-js/core/blob/master/LICENSE)
|
|
14
13
|
|
|
15
14
|
English | [简体中文](./README.md)
|
|
16
15
|
|
|
17
|
-
##
|
|
16
|
+
## Who this package is for
|
|
17
|
+
|
|
18
|
+
- Teams progressively migrating a Vue 3 codebase to React
|
|
19
|
+
- Developers who want Vue-style authoring with React output
|
|
20
|
+
- Projects that need a config-driven `build/watch` compilation workflow
|
|
18
21
|
|
|
19
|
-
|
|
22
|
+
## Usage
|
|
20
23
|
|
|
21
|
-
|
|
24
|
+
### 1. Install
|
|
22
25
|
|
|
23
26
|
```bash
|
|
24
27
|
npm install -D @vureact/compiler-core
|
|
25
28
|
```
|
|
26
29
|
|
|
27
|
-
|
|
30
|
+
You can also use:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
pnpm add -D @vureact/compiler-core
|
|
34
|
+
yarn add -D @vureact/compiler-core
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### 2. Create a config file
|
|
38
|
+
|
|
39
|
+
Create `vureact.config.ts` in your project root:
|
|
28
40
|
|
|
29
|
-
|
|
41
|
+
```ts
|
|
42
|
+
import { defineConfig } from '@vureact/compiler-core';
|
|
30
43
|
|
|
31
|
-
|
|
44
|
+
export default defineConfig({
|
|
45
|
+
input: '', // input path: a single file or a directory
|
|
46
|
+
exclude: ['src/main.ts'], // exclude the Vue entry file
|
|
47
|
+
});
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
If you are fine with the default workspace and output directory, this is enough.
|
|
32
51
|
|
|
33
|
-
|
|
52
|
+
If you want to make the output settings explicit, you can write:
|
|
34
53
|
|
|
35
54
|
```ts
|
|
36
55
|
import { defineConfig } from '@vureact/compiler-core';
|
|
@@ -46,25 +65,128 @@ export default defineConfig({
|
|
|
46
65
|
});
|
|
47
66
|
```
|
|
48
67
|
|
|
49
|
-
|
|
68
|
+
If your project uses Vue Router, you will usually also add:
|
|
69
|
+
|
|
70
|
+
```ts
|
|
71
|
+
router: {
|
|
72
|
+
configFile: 'src/router/index.ts',
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### 3. Start with a single-file pilot
|
|
77
|
+
|
|
78
|
+
If you want to validate the transformation first, start with one SFC:
|
|
79
|
+
|
|
80
|
+
```ts
|
|
81
|
+
export default defineConfig({
|
|
82
|
+
input: './src/your-component.vue',
|
|
83
|
+
exclude: ['src/main.ts'],
|
|
84
|
+
});
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
This is useful when you want to:
|
|
88
|
+
|
|
89
|
+
- validate the compilation conventions first
|
|
90
|
+
- inspect the generated output first
|
|
91
|
+
- run a small pilot before scaling to the whole codebase
|
|
92
|
+
|
|
93
|
+
### 4. Expand to the whole project
|
|
94
|
+
|
|
95
|
+
Once the single-file pilot works, point `input` to a directory:
|
|
96
|
+
|
|
97
|
+
```ts
|
|
98
|
+
export default defineConfig({
|
|
99
|
+
input: './src',
|
|
100
|
+
exclude: ['src/main.ts'],
|
|
101
|
+
});
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
This will recursively process Vue, script, and style files under that directory.
|
|
105
|
+
|
|
106
|
+
> Note: VuReact primarily targets modern Vue 3 codebases built around `<script setup>`.
|
|
107
|
+
> If your project uses Vue Router, also see the [router adaptation guide](https://vureact.top/en/guide/router-adaptation.html).
|
|
108
|
+
|
|
109
|
+
### 5. Run the compiler
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
# one-time build
|
|
113
|
+
npx vureact build
|
|
114
|
+
|
|
115
|
+
# watch mode
|
|
116
|
+
npx vureact watch
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
If you prefer scripts, add them to `package.json`:
|
|
120
|
+
|
|
121
|
+
```json
|
|
122
|
+
{
|
|
123
|
+
"scripts": {
|
|
124
|
+
"vr:build": "vureact build",
|
|
125
|
+
"vr:watch": "vureact watch"
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
### 6. Check the output
|
|
131
|
+
|
|
132
|
+
By default, VuReact generates:
|
|
133
|
+
|
|
134
|
+
- `.vureact/cache` for compilation cache
|
|
135
|
+
- `.vureact/react-app` for the React app output
|
|
136
|
+
- `.tsx` / `.css` files that mirror your source structure
|
|
137
|
+
|
|
138
|
+
The project layout typically looks like:
|
|
139
|
+
|
|
140
|
+
```txt
|
|
141
|
+
vue-project/
|
|
142
|
+
├── .vureact/
|
|
143
|
+
│ ├── cache/
|
|
144
|
+
│ ├── react-app/
|
|
145
|
+
│ │ ├── src/
|
|
146
|
+
│ │ ├── package.json
|
|
147
|
+
│ │ ├── vite.config.ts
|
|
148
|
+
├── src/
|
|
149
|
+
├── package.json
|
|
150
|
+
└── vureact.config.ts
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
You can then run the generated app directly:
|
|
50
154
|
|
|
51
155
|
```bash
|
|
52
|
-
|
|
53
|
-
|
|
156
|
+
cd .vureact/react-app
|
|
157
|
+
npm install
|
|
158
|
+
npm run dev
|
|
54
159
|
```
|
|
55
160
|
|
|
56
|
-
|
|
161
|
+
If you want a deeper explanation of the two modes, continue with:
|
|
162
|
+
|
|
163
|
+
- [Watch Mode](https://vureact.top/en/guide/watch-mode.html)
|
|
164
|
+
- [Incremental Compilation](https://vureact.top/en/guide/incremental-compilation.html)
|
|
57
165
|
|
|
58
|
-
|
|
59
|
-
- **[VuReact Router](https://router.vureact.top/en)**: Vue Router 4.x → React Router DOM 7.9+ conversion
|
|
166
|
+
## What this package is not
|
|
60
167
|
|
|
61
|
-
|
|
168
|
+
- It is not a Vue-in-React / React-in-Vue runtime bridge
|
|
169
|
+
- It is not a zero-convention codemod for arbitrary Vue code
|
|
170
|
+
- It works best in projects that follow VuReact compilation conventions
|
|
62
171
|
|
|
63
|
-
##
|
|
172
|
+
## Related packages
|
|
64
173
|
|
|
65
|
-
|
|
174
|
+
- [@vureact/runtime-core](https://runtime.vureact.top/en/) - React-side Vue runtime adaptation APIs
|
|
175
|
+
- [@vureact/router](https://router.vureact.top/en/) - Vue Router to React Router adaptation
|
|
66
176
|
|
|
67
|
-
##
|
|
177
|
+
## Documentation
|
|
178
|
+
|
|
179
|
+
- [Quick Start](https://vureact.top/en/guide/quick-start.html)
|
|
180
|
+
- [Key Configuration](https://vureact.top/en/guide/key-configuration.html)
|
|
181
|
+
- [Watch Mode](https://vureact.top/en/guide/watch-mode.html)
|
|
182
|
+
- [Incremental Compilation](https://vureact.top/en/guide/incremental-compilation.html)
|
|
183
|
+
- [Progressive Migration Guide](https://vureact.top/en/guide/progressive-migration.html)
|
|
184
|
+
- [Config API](https://vureact.top/en/api/config.html)
|
|
185
|
+
- [FAQ](https://vureact.top/en/guide/faq.html)
|
|
186
|
+
|
|
187
|
+
## Repository and license
|
|
68
188
|
|
|
69
189
|
- GitHub: <https://github.com/vureact-js/core>
|
|
70
|
-
-
|
|
190
|
+
- Docs: <https://vureact.top/en>
|
|
191
|
+
|
|
192
|
+
MIT License © 2025 Ruihong Zhong (Ryan John)
|
package/README.md
CHANGED
|
@@ -1,36 +1,54 @@
|
|
|
1
1
|
# @vureact/compiler-core
|
|
2
2
|
|
|
3
|
-
**写 Vue,生成可维护的 React
|
|
3
|
+
**写 Vue,生成可维护的 React。**
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
`@vureact/compiler-core` 是 VuReact 的 **CLI 与核心编译包**。
|
|
6
|
+
它用于将 Vue 3 的 SFC、脚本和样式文件编译为 **纯 React 18+ 代码**,适合渐进式迁移,以及“保持 Vue 心智模型、输出 React 工程”的场景。
|
|
7
|
+
|
|
8
|
+
它是 **编译时方案**,不是运行时桥接。
|
|
6
9
|
|
|
7
|
-
[](https://vureact.top/)
|
|
8
10
|
[](https://www.npmjs.com/package/@vureact/compiler-core)
|
|
9
|
-
[](https://www.npmjs.com/package/@vureact/compiler-core)
|
|
10
11
|
[](https://nodejs.org/)
|
|
11
|
-
[](https://
|
|
12
|
-
[](https://vuejs.org/)
|
|
13
|
-
[](https://reactjs.org/)
|
|
12
|
+
[](https://github.com/vureact-js/core/blob/master/LICENSE)
|
|
14
13
|
|
|
15
14
|
简体中文 | [English](./README.en.md)
|
|
16
15
|
|
|
17
|
-
##
|
|
16
|
+
## 这个包适合谁
|
|
17
|
+
|
|
18
|
+
- 正在把 Vue 3 项目渐进迁移到 React
|
|
19
|
+
- 想继续按 Vue 约定写代码,但产出 React 工程
|
|
20
|
+
- 需要基于配置文件执行 `build/watch` 编译流程
|
|
18
21
|
|
|
19
|
-
|
|
22
|
+
## 使用方式
|
|
20
23
|
|
|
21
|
-
|
|
24
|
+
### 1. 安装
|
|
22
25
|
|
|
23
26
|
```bash
|
|
24
27
|
npm install -D @vureact/compiler-core
|
|
25
28
|
```
|
|
26
29
|
|
|
27
|
-
|
|
30
|
+
也可以使用:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
pnpm add -D @vureact/compiler-core
|
|
34
|
+
yarn add -D @vureact/compiler-core
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### 2. 创建配置文件
|
|
38
|
+
|
|
39
|
+
在项目根目录新建 `vureact.config.ts`:
|
|
28
40
|
|
|
29
|
-
|
|
41
|
+
```ts
|
|
42
|
+
import { defineConfig } from '@vureact/compiler-core';
|
|
30
43
|
|
|
31
|
-
|
|
44
|
+
export default defineConfig({
|
|
45
|
+
exclude: ['src/main.ts'], // 排除 Vue 入口文件
|
|
46
|
+
});
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
如果你只想用默认工作区和输出目录,这样就够了。
|
|
32
50
|
|
|
33
|
-
|
|
51
|
+
如果需要显式指定输出配置,可以写成:
|
|
34
52
|
|
|
35
53
|
```ts
|
|
36
54
|
import { defineConfig } from '@vureact/compiler-core';
|
|
@@ -46,26 +64,128 @@ export default defineConfig({
|
|
|
46
64
|
});
|
|
47
65
|
```
|
|
48
66
|
|
|
49
|
-
|
|
67
|
+
如果项目使用 Vue Router,通常还会补上:
|
|
68
|
+
|
|
69
|
+
```ts
|
|
70
|
+
router: {
|
|
71
|
+
configFile: 'src/router/index.ts',
|
|
72
|
+
}
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### 3. 先从单文件试点
|
|
76
|
+
|
|
77
|
+
如果你想先验证一个组件能否稳定转换,可以先只编译单个 SFC:
|
|
78
|
+
|
|
79
|
+
```ts
|
|
80
|
+
export default defineConfig({
|
|
81
|
+
input: './src/your-component.vue',
|
|
82
|
+
exclude: ['src/main.ts'],
|
|
83
|
+
});
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
这适合:
|
|
87
|
+
|
|
88
|
+
- 先验证编译约定
|
|
89
|
+
- 先看生成结果
|
|
90
|
+
- 先小范围试点,而不是直接全仓推进
|
|
91
|
+
|
|
92
|
+
### 4. 再扩展到整个项目
|
|
93
|
+
|
|
94
|
+
当单文件试点通过后,再把 `input` 指向目录:
|
|
95
|
+
|
|
96
|
+
```ts
|
|
97
|
+
export default defineConfig({
|
|
98
|
+
input: './src',
|
|
99
|
+
exclude: ['src/main.ts'],
|
|
100
|
+
});
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
这会递归处理目录下的 Vue / Script / Style 文件。
|
|
104
|
+
|
|
105
|
+
> 注意:VuReact 优先支持基于 `<script setup>` 的现代 Vue 3 写法。
|
|
106
|
+
> 如果你的项目使用 Vue Router,请同时查看 [路由适配指南](https://vureact.top/guide/router-adaptation.html)。
|
|
107
|
+
|
|
108
|
+
### 5. 执行编译
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
# 一次性编译
|
|
112
|
+
npx vureact build
|
|
113
|
+
|
|
114
|
+
# 监听模式
|
|
115
|
+
npx vureact watch
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
如果你更喜欢脚本命令,也可以写进 `package.json`:
|
|
119
|
+
|
|
120
|
+
```json
|
|
121
|
+
{
|
|
122
|
+
"scripts": {
|
|
123
|
+
"vr:build": "vureact build",
|
|
124
|
+
"vr:watch": "vureact watch"
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### 6. 查看输出结果
|
|
130
|
+
|
|
131
|
+
默认情况下,VuReact 会生成:
|
|
132
|
+
|
|
133
|
+
- `.vureact/cache`:编译缓存
|
|
134
|
+
- `.vureact/react-app`:React 工程产物
|
|
135
|
+
- 与源目录结构对应的 `.tsx` / `.css` 文件
|
|
136
|
+
|
|
137
|
+
目录大致如下:
|
|
138
|
+
|
|
139
|
+
```txt
|
|
140
|
+
vue-project/
|
|
141
|
+
├── .vureact/
|
|
142
|
+
│ ├── cache/
|
|
143
|
+
│ ├── react-app/
|
|
144
|
+
│ │ ├── src/
|
|
145
|
+
│ │ ├── package.json
|
|
146
|
+
│ │ ├── vite.config.ts
|
|
147
|
+
├── src/
|
|
148
|
+
├── package.json
|
|
149
|
+
└── vureact.config.ts
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
进入产物目录后可直接运行:
|
|
50
153
|
|
|
51
154
|
```bash
|
|
52
|
-
|
|
53
|
-
|
|
155
|
+
cd .vureact/react-app
|
|
156
|
+
npm install
|
|
157
|
+
npm run dev
|
|
54
158
|
```
|
|
55
159
|
|
|
56
|
-
|
|
160
|
+
如果你想更系统地了解 build/watch 的差异,可以继续阅读:
|
|
161
|
+
|
|
162
|
+
- [监听模式](https://vureact.top/guide/watch-mode.html)
|
|
163
|
+
- [增量编译](https://vureact.top/guide/incremental-compilation.html)
|
|
164
|
+
|
|
165
|
+
## 这个包不负责什么
|
|
166
|
+
|
|
167
|
+
- 它不是 Vue in React / React in Vue 的运行时桥接层
|
|
168
|
+
- 它不是对任意 Vue 代码都“零约定”生效的通用 codemod
|
|
169
|
+
- 它更适合遵循 VuReact 编译约定的工程化项目
|
|
170
|
+
|
|
171
|
+
## 相关包
|
|
57
172
|
|
|
58
|
-
-
|
|
59
|
-
-
|
|
173
|
+
- [@vureact/runtime-core](https://runtime.vureact.top/):React 版 Vue 运行时适配 API
|
|
174
|
+
- [@vureact/router](https://router.vureact.top/):Vue Router 到 React Router 的适配方案
|
|
60
175
|
|
|
61
|
-
|
|
176
|
+
## 文档入口
|
|
62
177
|
|
|
63
|
-
|
|
178
|
+
- [快速开始](https://vureact.top/guide/quick-start.html)
|
|
179
|
+
- [关键配置](https://vureact.top/guide/key-configuration.html)
|
|
180
|
+
- [监听模式](https://vureact.top/guide/watch-mode.html)
|
|
181
|
+
- [增量编译](https://vureact.top/guide/incremental-compilation.html)
|
|
182
|
+
- [渐进式迁移指南](https://vureact.top/guide/progressive-migration.html)
|
|
183
|
+
- [配置 API](https://vureact.top/api/config.html)
|
|
184
|
+
- [FAQ](https://vureact.top/guide/faq.html)
|
|
64
185
|
|
|
65
|
-
|
|
186
|
+
## 仓库与许可证
|
|
66
187
|
|
|
67
|
-
|
|
188
|
+
- GitHub: <https://github.com/vureact-js/core>
|
|
189
|
+
- 文档: <https://vureact.top>
|
|
68
190
|
|
|
69
|
-
|
|
70
|
-
- Gitee:<https://gitee.com/vureact-js/core>
|
|
71
|
-
- 文档:<https://vureact.top>
|
|
191
|
+
MIT License © 2025 Ruihong Zhong (Ryan John)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vureact/compiler-core v1.8.
|
|
2
|
+
* @vureact/compiler-core v1.8.1
|
|
3
3
|
* (c) 2025-present Ruihong Zhong (Ryan John)
|
|
4
4
|
* @license MIT
|
|
5
5
|
*/
|
|
@@ -6612,9 +6612,9 @@ function transform(ast, ctx, options) {
|
|
|
6612
6612
|
}
|
|
6613
6613
|
|
|
6614
6614
|
// package.json
|
|
6615
|
-
var version = "1.8.
|
|
6615
|
+
var version = "1.8.1";
|
|
6616
6616
|
var bin = {
|
|
6617
|
-
vureact: "
|
|
6617
|
+
vureact: "bin/vureact.js"
|
|
6618
6618
|
};
|
|
6619
6619
|
|
|
6620
6620
|
// src/plugins/prettier.ts
|
|
@@ -7473,8 +7473,7 @@ var CacheManager = class {
|
|
|
7473
7473
|
for (const key of keys) {
|
|
7474
7474
|
const updates = this.pendingUpdates.get(key);
|
|
7475
7475
|
if (!updates?.length) continue;
|
|
7476
|
-
const
|
|
7477
|
-
const entries = (this.cachedData[key] || []).filter((c) => activeFiles.has(c.file));
|
|
7476
|
+
const entries = [...this.cachedData[key] || []];
|
|
7478
7477
|
updates.forEach(({ unit, meta }) => {
|
|
7479
7478
|
const idx = entries.findIndex((c) => c.file === unit.file);
|
|
7480
7479
|
if (idx > -1) {
|
|
@@ -7545,9 +7544,7 @@ var CacheManager = class {
|
|
|
7545
7544
|
}
|
|
7546
7545
|
}
|
|
7547
7546
|
}
|
|
7548
|
-
const
|
|
7549
|
-
let entries = (this.cachedData || this.getEmptyList())[key] || [];
|
|
7550
|
-
entries = entries.filter((c) => activeFiles.has(c.file));
|
|
7547
|
+
const entries = [...(this.cachedData || this.getEmptyList())[key] || []];
|
|
7551
7548
|
updates.forEach(({ unit, meta }) => {
|
|
7552
7549
|
const idx = entries.findIndex((c) => c.file === unit.file);
|
|
7553
7550
|
if (idx > -1) {
|
|
@@ -8080,6 +8077,7 @@ var PipelineManager = class {
|
|
|
8080
8077
|
*/
|
|
8081
8078
|
resetSkippedCount() {
|
|
8082
8079
|
this.skippedCount = 0;
|
|
8080
|
+
this.fileProcessor.resetSkippedCount();
|
|
8083
8081
|
}
|
|
8084
8082
|
};
|
|
8085
8083
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } function _optionalChainDelete(ops) { const result = _optionalChain(ops); return result == null ? true : result; } var _class; var _class2; var _class3; var _class4; var _class5; var _class6; var _class7; var _class8; var _class9; var _class10; var _class11; var _class12; var _class13;/**
|
|
2
|
-
* @vureact/compiler-core v1.8.
|
|
2
|
+
* @vureact/compiler-core v1.8.1
|
|
3
3
|
* (c) 2025-present Ruihong Zhong (Ryan John)
|
|
4
4
|
* @license MIT
|
|
5
5
|
*/
|
|
@@ -6612,9 +6612,9 @@ function transform(ast, ctx, options) {
|
|
|
6612
6612
|
}
|
|
6613
6613
|
|
|
6614
6614
|
// package.json
|
|
6615
|
-
var version = "1.8.
|
|
6615
|
+
var version = "1.8.1";
|
|
6616
6616
|
var bin = {
|
|
6617
|
-
vureact: "
|
|
6617
|
+
vureact: "bin/vureact.js"
|
|
6618
6618
|
};
|
|
6619
6619
|
|
|
6620
6620
|
// src/plugins/prettier.ts
|
|
@@ -7473,8 +7473,7 @@ var CacheManager = (_class9 = class {
|
|
|
7473
7473
|
for (const key of keys) {
|
|
7474
7474
|
const updates = this.pendingUpdates.get(key);
|
|
7475
7475
|
if (!_optionalChain([updates, 'optionalAccess', _281 => _281.length])) continue;
|
|
7476
|
-
const
|
|
7477
|
-
const entries = (this.cachedData[key] || []).filter((c) => activeFiles.has(c.file));
|
|
7476
|
+
const entries = [...this.cachedData[key] || []];
|
|
7478
7477
|
updates.forEach(({ unit, meta }) => {
|
|
7479
7478
|
const idx = entries.findIndex((c) => c.file === unit.file);
|
|
7480
7479
|
if (idx > -1) {
|
|
@@ -7545,9 +7544,7 @@ var CacheManager = (_class9 = class {
|
|
|
7545
7544
|
}
|
|
7546
7545
|
}
|
|
7547
7546
|
}
|
|
7548
|
-
const
|
|
7549
|
-
let entries = (this.cachedData || this.getEmptyList())[key] || [];
|
|
7550
|
-
entries = entries.filter((c) => activeFiles.has(c.file));
|
|
7547
|
+
const entries = [...(this.cachedData || this.getEmptyList())[key] || []];
|
|
7551
7548
|
updates.forEach(({ unit, meta }) => {
|
|
7552
7549
|
const idx = entries.findIndex((c) => c.file === unit.file);
|
|
7553
7550
|
if (idx > -1) {
|
|
@@ -8080,6 +8077,7 @@ var PipelineManager = (_class11 = class {
|
|
|
8080
8077
|
*/
|
|
8081
8078
|
resetSkippedCount() {
|
|
8082
8079
|
this.skippedCount = 0;
|
|
8080
|
+
this.fileProcessor.resetSkippedCount();
|
|
8083
8081
|
}
|
|
8084
8082
|
}, _class11);
|
|
8085
8083
|
|
package/lib/cli.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/**
|
|
3
|
-
* @vureact/compiler-core v1.8.
|
|
3
|
+
* @vureact/compiler-core v1.8.1
|
|
4
4
|
* (c) 2025-present Ruihong Zhong (Ryan John)
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
getDirname,
|
|
14
14
|
normalizePath,
|
|
15
15
|
version
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-QXYYGKFW.esm.js";
|
|
17
17
|
|
|
18
18
|
// src/cli/index.ts
|
|
19
19
|
import { cac } from "cac";
|
package/lib/cli.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
"use strict"; function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }/**
|
|
3
|
-
* @vureact/compiler-core v1.8.
|
|
3
|
+
* @vureact/compiler-core v1.8.1
|
|
4
4
|
* (c) 2025-present Ruihong Zhong (Ryan John)
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _chunkSGP2JC7Fjs = require('./chunk-SGP2JC7F.js');
|
|
17
17
|
|
|
18
18
|
// src/cli/index.ts
|
|
19
19
|
var _cac = require('cac');
|
|
@@ -76,7 +76,7 @@ var _ora = require('ora'); var _ora2 = _interopRequireDefault(_ora);
|
|
|
76
76
|
|
|
77
77
|
function setupWatcher(compiler, config) {
|
|
78
78
|
const spinner = _ora2.default.call(void 0, );
|
|
79
|
-
const cmpHelper = new (0,
|
|
79
|
+
const cmpHelper = new (0, _chunkSGP2JC7Fjs.Helper)(config);
|
|
80
80
|
const watcher = _chokidar2.default.watch(cmpHelper.getInputPath(), {
|
|
81
81
|
ignored: cmpHelper.getExcludes(),
|
|
82
82
|
persistent: true,
|
|
@@ -111,7 +111,7 @@ function setupWatcher(compiler, config) {
|
|
|
111
111
|
const fn = processors[ext];
|
|
112
112
|
const unit = await fn(filePath);
|
|
113
113
|
cmpHelper.printCoreLogs();
|
|
114
|
-
cmpHelper.printCompileInfo(filePath,
|
|
114
|
+
cmpHelper.printCompileInfo(filePath, _chunkSGP2JC7Fjs.calcElapsedTime.call(void 0, startTime));
|
|
115
115
|
if (unit) {
|
|
116
116
|
await _optionalChain([config, 'access', _5 => _5.onChange, 'optionalCall', _6 => _6(event, unit)]);
|
|
117
117
|
}
|
|
@@ -120,7 +120,7 @@ function setupWatcher(compiler, config) {
|
|
|
120
120
|
await compiler.processAsset(filePath);
|
|
121
121
|
cmpHelper.print(
|
|
122
122
|
_kleur2.default.blue("Copied Asset"),
|
|
123
|
-
_kleur2.default.dim(
|
|
123
|
+
_kleur2.default.dim(_chunkSGP2JC7Fjs.normalizePath.call(void 0, cmpHelper.relativePath(filePath)))
|
|
124
124
|
);
|
|
125
125
|
}
|
|
126
126
|
spinner.stop();
|
|
@@ -133,7 +133,7 @@ function setupWatcher(compiler, config) {
|
|
|
133
133
|
await compiler.removeOutputPath(filePath, type2);
|
|
134
134
|
cmpHelper.print(
|
|
135
135
|
_kleur2.default.yellow("Removed"),
|
|
136
|
-
_kleur2.default.dim(
|
|
136
|
+
_kleur2.default.dim(_chunkSGP2JC7Fjs.normalizePath.call(void 0, cmpHelper.relativePath(filePath)))
|
|
137
137
|
);
|
|
138
138
|
};
|
|
139
139
|
if (type === "unlink") {
|
|
@@ -166,7 +166,7 @@ async function resolveAction(root, options) {
|
|
|
166
166
|
const projectRoot = root ? _path2.default.resolve(process.cwd(), root) : process.cwd();
|
|
167
167
|
const userConfig = await loadUserConfig(projectRoot);
|
|
168
168
|
const finalConfig = mergeConfig(projectRoot, options, userConfig);
|
|
169
|
-
const compiler = new (0,
|
|
169
|
+
const compiler = new (0, _chunkSGP2JC7Fjs.VuReact)(finalConfig);
|
|
170
170
|
await compiler.execute();
|
|
171
171
|
if (finalConfig.watch) {
|
|
172
172
|
setupWatcher(compiler, finalConfig);
|
|
@@ -189,7 +189,7 @@ function resolveOptions(command) {
|
|
|
189
189
|
|
|
190
190
|
|
|
191
191
|
var _updatenotifier = require('update-notifier'); var _updatenotifier2 = _interopRequireDefault(_updatenotifier);
|
|
192
|
-
var __dirname =
|
|
192
|
+
var __dirname = _chunkSGP2JC7Fjs.getDirname.call(void 0, import.meta.url);
|
|
193
193
|
function checkForUpdates() {
|
|
194
194
|
try {
|
|
195
195
|
const possiblePaths = [
|
|
@@ -230,7 +230,7 @@ function checkForUpdates() {
|
|
|
230
230
|
}
|
|
231
231
|
|
|
232
232
|
// src/cli/index.ts
|
|
233
|
-
var [programName] = Object.keys(
|
|
233
|
+
var [programName] = Object.keys(_chunkSGP2JC7Fjs.bin);
|
|
234
234
|
var cli = _cac.cac.call(void 0, programName);
|
|
235
235
|
checkForUpdates();
|
|
236
236
|
var buildCommand = cli.command("build [root]", "Compile Vue3 to React (one-time)");
|
|
@@ -241,4 +241,4 @@ var watchCommand = cli.command("watch [root]", "Compile Vue3 to React and watch
|
|
|
241
241
|
resolveOptions(watchCommand).action((root, options) => {
|
|
242
242
|
resolveAction(root, { ...options, watch: true });
|
|
243
243
|
});
|
|
244
|
-
cli.help().version(
|
|
244
|
+
cli.help().version(_chunkSGP2JC7Fjs.version).parse();
|
package/lib/compiler-core.esm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vureact/compiler-core v1.8.
|
|
2
|
+
* @vureact/compiler-core v1.8.1
|
|
3
3
|
* (c) 2025-present Ruihong Zhong (Ryan John)
|
|
4
4
|
* @license MIT
|
|
5
5
|
*/
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
parseOnlyScript,
|
|
19
19
|
parseSFC,
|
|
20
20
|
transform
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-QXYYGKFW.esm.js";
|
|
22
22
|
export {
|
|
23
23
|
BaseCompiler,
|
|
24
24
|
CacheKey,
|
package/lib/compiler-core.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});/**
|
|
2
|
-
* @vureact/compiler-core v1.8.
|
|
2
|
+
* @vureact/compiler-core v1.8.1
|
|
3
3
|
* (c) 2025-present Ruihong Zhong (Ryan John)
|
|
4
4
|
* @license MIT
|
|
5
5
|
*/
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
|
|
21
|
-
var
|
|
21
|
+
var _chunkSGP2JC7Fjs = require('./chunk-SGP2JC7F.js');
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
|
|
@@ -33,4 +33,4 @@ var _chunkV7G7OQWKjs = require('./chunk-V7G7OQWK.js');
|
|
|
33
33
|
|
|
34
34
|
|
|
35
35
|
|
|
36
|
-
exports.BaseCompiler =
|
|
36
|
+
exports.BaseCompiler = _chunkSGP2JC7Fjs.BaseCompiler; exports.CacheKey = _chunkSGP2JC7Fjs.CacheKey; exports.FileCompiler = _chunkSGP2JC7Fjs.FileCompiler; exports.Helper = _chunkSGP2JC7Fjs.Helper; exports.VuReact = _chunkSGP2JC7Fjs.VuReact; exports.defineConfig = _chunkSGP2JC7Fjs.defineConfig; exports.generate = _chunkSGP2JC7Fjs.generate; exports.generateComponent = _chunkSGP2JC7Fjs.generateComponent; exports.generateOnlyScript = _chunkSGP2JC7Fjs.generateOnlyScript; exports.parse = _chunkSGP2JC7Fjs.parse; exports.parseOnlyScript = _chunkSGP2JC7Fjs.parseOnlyScript; exports.parseSFC = _chunkSGP2JC7Fjs.parseSFC; exports.transform = _chunkSGP2JC7Fjs.transform;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vureact/compiler-core",
|
|
3
|
-
"version": "1.8.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "1.8.1",
|
|
4
|
+
"description": "🌀 Write in Vue 3, compile to React 18+ output.",
|
|
5
5
|
"author": "Ruihong Zhong (Ryan John)",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"type": "module",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"progressive-migration",
|
|
50
50
|
"automated-refactoring"
|
|
51
51
|
],
|
|
52
|
-
"homepage": "https://vureact
|
|
52
|
+
"homepage": "https://github.com/vureact-js/core#readme",
|
|
53
53
|
"repository": {
|
|
54
54
|
"type": "git",
|
|
55
55
|
"url": "git+https://github.com/vureact-js/core.git",
|