@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 CHANGED
@@ -1,36 +1,55 @@
1
1
  # @vureact/compiler-core
2
2
 
3
- **Write in Vue 3, compile to React 18+ code.**
3
+ **Write in Vue, generate maintainable React.**
4
4
 
5
- It is not only suitable for migrating Vue 3 projects to React, but is also committed to seamlessly integrating Vue's excellent mental model with React's ecosystem capabilities, directly producing **maintainable, evolvable, and production-ready** React code from Vue code.
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
- [![Npm](https://img.shields.io/npm/v/@vureact/compiler-core.svg?label=Npm&style=flat-square)](https://vureact.top/en/)
8
10
  [![Downloads](https://img.shields.io/npm/dt/@vureact/compiler-core?label=Downloads&style=flat-square)](https://www.npmjs.com/package/@vureact/compiler-core)
9
- [![Monthly](https://img.shields.io/npm/dm/@vureact/compiler-core?label=Monthly&style=flat-square)](https://www.npmjs.com/package/@vureact/compiler-core)
10
11
  [![Node](https://img.shields.io/badge/node-%3E%3D19.0.0-green?label=Node)](https://nodejs.org/)
11
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
12
- [![Vue 3](https://img.shields.io/badge/Vue-3.x-42b883)](https://vuejs.org/)
13
- [![React 18+](https://img.shields.io/badge/React-18%2B-61dafb)](https://reactjs.org/)
12
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/vureact-js/core/blob/master/LICENSE)
14
13
 
15
14
  English | [简体中文](./README.md)
16
15
 
17
- ## Introduction
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
- `@vureact/compiler-core` is the core compilation package of VuReact, responsible for compiling Vue 3 SFC, script files, and style files into React 18+ JSX/TSX code ready for production.
22
+ ## Usage
20
23
 
21
- ## Installation
24
+ ### 1. Install
22
25
 
23
26
  ```bash
24
27
  npm install -D @vureact/compiler-core
25
28
  ```
26
29
 
27
- ## Quick Start
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
- 👉 **Full tutorial: [VuReact Website - Quick Start](https://vureact.top/en/guide/quick-start.html)**
41
+ ```ts
42
+ import { defineConfig } from '@vureact/compiler-core';
30
43
 
31
- ### Configuration Example
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
- `vureact.config.ts`
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
- ### Commands
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
- npx vureact build # Build project
53
- npx vureact watch # Watch mode
156
+ cd .vureact/react-app
157
+ npm install
158
+ npm run dev
54
159
  ```
55
160
 
56
- ## Ecosystem
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
- - **[VuReact Runtime Core](https://runtime.vureact.top/en)**: React-compatible implementations of Vue core APIs
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
- If necessary, you can choose [☣️ Mixed Coding](https://vureact.top/en/guide/mind-control-readme.html) to directly use the React ecosystem.
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
- ## FAQ
172
+ ## Related packages
64
173
 
65
- 👉 [FAQ](https://vureact.top/en/guide/faq.html)
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
- ## 🔗 Links
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
- - Documentation: <https://vureact.top/en>
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
- 它不仅适用于 Vue 3 React 项目的迁移,更致力于将 Vue 优秀的心智模型与 React 生态能力无缝融合,用 Vue 代码直接产出**可维护、可演进、生产就绪**的 React 代码。
5
+ `@vureact/compiler-core` VuReact **CLI 与核心编译包**。
6
+ 它用于将 Vue 3 的 SFC、脚本和样式文件编译为 **纯 React 18+ 代码**,适合渐进式迁移,以及“保持 Vue 心智模型、输出 React 工程”的场景。
7
+
8
+ 它是 **编译时方案**,不是运行时桥接。
6
9
 
7
- [![Npm](https://img.shields.io/npm/v/@vureact/compiler-core.svg?label=Npm&style=flat-square)](https://vureact.top/)
8
10
  [![Downloads](https://img.shields.io/npm/dt/@vureact/compiler-core?label=Downloads&style=flat-square)](https://www.npmjs.com/package/@vureact/compiler-core)
9
- [![Monthly](https://img.shields.io/npm/dm/@vureact/compiler-core?label=Monthly&style=flat-square)](https://www.npmjs.com/package/@vureact/compiler-core)
10
11
  [![Node](https://img.shields.io/badge/node-%3E%3D19.0.0-green?label=Node)](https://nodejs.org/)
11
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
12
- [![Vue 3](https://img.shields.io/badge/Vue-3.x-42b883)](https://vuejs.org/)
13
- [![React 18+](https://img.shields.io/badge/React-18%2B-61dafb)](https://reactjs.org/)
12
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](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
- `@vureact/compiler-core` 是 VuReact 的核心编译包,负责将 Vue 3 单文件组件、脚本文件和样式文件**三位一体**编译为可直接用于生产环境的 React 18+ JSX/TSX 代码。
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
- 👉 **完整教程请访问:[VuReact - 快速开始](https://vureact.top/guide/quick-start.html)**
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
- `vureact.config.ts`
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
- npx vureact build # 编译项目
53
- npx vureact watch # 监听模式
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
- - **[VuReact Runtime Core](https://runtime.vureact.top/)**:提供 React 版的 Vue 常用内置组件、核心 Composition API
59
- - **[VuReact Router](https://router.vureact.top/)**:支持 Vue Router 4.x React Router DOM 7.9+ 转换
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
- 如果确实需要,你可以选择 [☣️混合编写](https://vureact.top/guide/mind-control-readme.html),以此直接使用 React 生态。
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
- 👉 请查阅[官网 FAQ 章节](https://vureact.top/guide/faq.html)
186
+ ## 仓库与许可证
66
187
 
67
- ## 🔗 链接
188
+ - GitHub: <https://github.com/vureact-js/core>
189
+ - 文档: <https://vureact.top>
68
190
 
69
- - GitHub:<https://github.com/vureact-js/core>
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.0
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.0";
6615
+ var version = "1.8.1";
6616
6616
  var bin = {
6617
- vureact: "./bin/vureact.js"
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 activeFiles = new Set(updates.map((u) => u.unit.file));
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 activeFiles = new Set(updates.map((u) => u.unit.file));
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.0
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.0";
6615
+ var version = "1.8.1";
6616
6616
  var bin = {
6617
- vureact: "./bin/vureact.js"
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 activeFiles = new Set(updates.map((u) => u.unit.file));
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 activeFiles = new Set(updates.map((u) => u.unit.file));
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.0
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-6MTN25KZ.esm.js";
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.0
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 _chunkV7G7OQWKjs = require('./chunk-V7G7OQWK.js');
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, _chunkV7G7OQWKjs.Helper)(config);
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, _chunkV7G7OQWKjs.calcElapsedTime.call(void 0, startTime));
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(_chunkV7G7OQWKjs.normalizePath.call(void 0, cmpHelper.relativePath(filePath)))
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(_chunkV7G7OQWKjs.normalizePath.call(void 0, cmpHelper.relativePath(filePath)))
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, _chunkV7G7OQWKjs.VuReact)(finalConfig);
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 = _chunkV7G7OQWKjs.getDirname.call(void 0, import.meta.url);
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(_chunkV7G7OQWKjs.bin);
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(_chunkV7G7OQWKjs.version).parse();
244
+ cli.help().version(_chunkSGP2JC7Fjs.version).parse();
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vureact/compiler-core v1.8.0
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-6MTN25KZ.esm.js";
21
+ } from "./chunk-QXYYGKFW.esm.js";
22
22
  export {
23
23
  BaseCompiler,
24
24
  CacheKey,
@@ -1,5 +1,5 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});/**
2
- * @vureact/compiler-core v1.8.0
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 _chunkV7G7OQWKjs = require('./chunk-V7G7OQWK.js');
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 = _chunkV7G7OQWKjs.BaseCompiler; exports.CacheKey = _chunkV7G7OQWKjs.CacheKey; exports.FileCompiler = _chunkV7G7OQWKjs.FileCompiler; exports.Helper = _chunkV7G7OQWKjs.Helper; exports.VuReact = _chunkV7G7OQWKjs.VuReact; exports.defineConfig = _chunkV7G7OQWKjs.defineConfig; exports.generate = _chunkV7G7OQWKjs.generate; exports.generateComponent = _chunkV7G7OQWKjs.generateComponent; exports.generateOnlyScript = _chunkV7G7OQWKjs.generateOnlyScript; exports.parse = _chunkV7G7OQWKjs.parse; exports.parseOnlyScript = _chunkV7G7OQWKjs.parseOnlyScript; exports.parseSFC = _chunkV7G7OQWKjs.parseSFC; exports.transform = _chunkV7G7OQWKjs.transform;
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.0",
4
- "description": " Write in Vue 3, compile to React 18+ code.",
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.top",
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",