@vureact/compiler-core 1.0.3 → 1.0.4

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.
@@ -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; } var _class; var _class2; var _class3; var _class4; var _class5; var _class6; var _class7; var _class8; var _class9;/**
2
- * @vureact/compiler-core v1.0.2
2
+ * @vureact/compiler-core v1.0.3
3
3
  * (c) 2025-present Ruihong Zhong (Ryan John)
4
4
  * @license MIT
5
5
  */
@@ -2964,7 +2964,7 @@ function buildSlotPropSignature(rawName, params, optional) {
2964
2964
  t27.tsTypeReference(t27.identifier(REACT_API_MAP.ReactNode))
2965
2965
  );
2966
2966
  let typeAnnotation;
2967
- if (rawName === SLOT_DEFAULT_NAME && params.length === 0) {
2967
+ if (rawName === SLOT_DEFAULT_NAME && params.length === 0 || params.length === 0) {
2968
2968
  typeAnnotation = reactNodeType;
2969
2969
  } else {
2970
2970
  const fnType = t27.tsFunctionType(null, params, reactNodeType);
@@ -5076,7 +5076,7 @@ function transform(ast, ctx, options) {
5076
5076
  }
5077
5077
 
5078
5078
  // package.json
5079
- var version = "1.0.2";
5079
+ var version = "1.0.3";
5080
5080
  var bin = {
5081
5081
  vureact: "./bin/vureact.js"
5082
5082
  };
@@ -5801,7 +5801,13 @@ var AssetManager = class {
5801
5801
  const filename = _path2.default.basename(p).toLowerCase();
5802
5802
  const ext = _path2.default.extname(p).toLowerCase();
5803
5803
  if (!_optionalChain([this, 'access', _205 => _205.fileCompiler, 'access', _206 => _206.options, 'access', _207 => _207.output, 'optionalAccess', _208 => _208.ignoreAssets])) {
5804
- if (!relativeToRoot.includes(_path2.default.sep) && exclusions.has(filename)) {
5804
+ const shouldExclude = Array.from(exclusions).some((pattern) => {
5805
+ if (pattern.endsWith(".")) {
5806
+ return filename.startsWith(pattern);
5807
+ }
5808
+ return relativeToRoot === pattern || filename === pattern;
5809
+ });
5810
+ if (shouldExclude) {
5805
5811
  return false;
5806
5812
  }
5807
5813
  } else if (exclusions.has(relativeToRoot) || exclusions.has(filename)) {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vureact/compiler-core v1.0.2
2
+ * @vureact/compiler-core v1.0.3
3
3
  * (c) 2025-present Ruihong Zhong (Ryan John)
4
4
  * @license MIT
5
5
  */
@@ -2964,7 +2964,7 @@ function buildSlotPropSignature(rawName, params, optional) {
2964
2964
  t27.tsTypeReference(t27.identifier(REACT_API_MAP.ReactNode))
2965
2965
  );
2966
2966
  let typeAnnotation;
2967
- if (rawName === SLOT_DEFAULT_NAME && params.length === 0) {
2967
+ if (rawName === SLOT_DEFAULT_NAME && params.length === 0 || params.length === 0) {
2968
2968
  typeAnnotation = reactNodeType;
2969
2969
  } else {
2970
2970
  const fnType = t27.tsFunctionType(null, params, reactNodeType);
@@ -5076,7 +5076,7 @@ function transform(ast, ctx, options) {
5076
5076
  }
5077
5077
 
5078
5078
  // package.json
5079
- var version = "1.0.2";
5079
+ var version = "1.0.3";
5080
5080
  var bin = {
5081
5081
  vureact: "./bin/vureact.js"
5082
5082
  };
@@ -5801,7 +5801,13 @@ var AssetManager = class {
5801
5801
  const filename = path4.basename(p).toLowerCase();
5802
5802
  const ext = path4.extname(p).toLowerCase();
5803
5803
  if (!this.fileCompiler.options.output?.ignoreAssets) {
5804
- if (!relativeToRoot.includes(path4.sep) && exclusions.has(filename)) {
5804
+ const shouldExclude = Array.from(exclusions).some((pattern) => {
5805
+ if (pattern.endsWith(".")) {
5806
+ return filename.startsWith(pattern);
5807
+ }
5808
+ return relativeToRoot === pattern || filename === pattern;
5809
+ });
5810
+ if (shouldExclude) {
5805
5811
  return false;
5806
5812
  }
5807
5813
  } else if (exclusions.has(relativeToRoot) || exclusions.has(filename)) {
package/lib/cli.esm.js CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  /**
3
- * @vureact/compiler-core v1.0.2
3
+ * @vureact/compiler-core v1.0.3
4
4
  * (c) 2025-present Ruihong Zhong (Ryan John)
5
5
  * @license MIT
6
6
  */
@@ -12,7 +12,7 @@ import {
12
12
  calcElapsedTime,
13
13
  normalizePath,
14
14
  version
15
- } from "./chunk-BVCPVRCO.esm.js";
15
+ } from "./chunk-VWMAAVDB.esm.js";
16
16
 
17
17
  // src/cli/index.ts
18
18
  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.0.2
3
+ * @vureact/compiler-core v1.0.3
4
4
  * (c) 2025-present Ruihong Zhong (Ryan John)
5
5
  * @license MIT
6
6
  */
@@ -12,7 +12,7 @@
12
12
 
13
13
 
14
14
 
15
- var _chunkE542D3GCjs = require('./chunk-E542D3GC.js');
15
+ var _chunk6PSD2CIOjs = require('./chunk-6PSD2CIO.js');
16
16
 
17
17
  // src/cli/index.ts
18
18
  var _cac = require('cac');
@@ -28,7 +28,7 @@ async function resolveAction(root, options) {
28
28
  const projectRoot = root ? _path2.default.resolve(process.cwd(), root) : process.cwd();
29
29
  const userConfig = await loadUserConfig(projectRoot);
30
30
  const finalConfig = mergeConfig(projectRoot, options, userConfig);
31
- const compiler = new (0, _chunkE542D3GCjs.VuReact)(finalConfig);
31
+ const compiler = new (0, _chunk6PSD2CIOjs.VuReact)(finalConfig);
32
32
  await compiler.execute();
33
33
  if (finalConfig.watch) {
34
34
  setupWatcher(compiler, finalConfig);
@@ -82,7 +82,7 @@ function mergeConfig(projectRoot, options, userConfig) {
82
82
  }
83
83
  function setupWatcher(compiler, config) {
84
84
  const spinner = _ora2.default.call(void 0, );
85
- const cmpHelper = new (0, _chunkE542D3GCjs.Helper)(config);
85
+ const cmpHelper = new (0, _chunk6PSD2CIOjs.Helper)(config);
86
86
  const watcher = _chokidar2.default.watch(cmpHelper.getInputPath(), {
87
87
  ignored: cmpHelper.getExcludes(),
88
88
  persistent: true,
@@ -114,7 +114,7 @@ function setupWatcher(compiler, config) {
114
114
  const fn = processors[ext];
115
115
  const unit = await fn(filePath);
116
116
  cmpHelper.printCoreLogs();
117
- cmpHelper.printCompileInfo(filePath, _chunkE542D3GCjs.calcElapsedTime.call(void 0, startTime));
117
+ cmpHelper.printCompileInfo(filePath, _chunk6PSD2CIOjs.calcElapsedTime.call(void 0, startTime));
118
118
  if (unit) {
119
119
  await _optionalChain([config, 'access', _11 => _11.onChange, 'optionalCall', _12 => _12(event, unit)]);
120
120
  }
@@ -123,7 +123,7 @@ function setupWatcher(compiler, config) {
123
123
  await compiler.processAsset(filePath);
124
124
  cmpHelper.print(
125
125
  _kleur2.default.blue("Copied Asset"),
126
- _kleur2.default.dim(_chunkE542D3GCjs.normalizePath.call(void 0, cmpHelper.relativePath(filePath)))
126
+ _kleur2.default.dim(_chunk6PSD2CIOjs.normalizePath.call(void 0, cmpHelper.relativePath(filePath)))
127
127
  );
128
128
  }
129
129
  spinner.stop();
@@ -134,7 +134,7 @@ function setupWatcher(compiler, config) {
134
134
  await compiler.removeOutputPath(filePath, type2);
135
135
  cmpHelper.print(
136
136
  _kleur2.default.yellow("Removed"),
137
- _kleur2.default.dim(_chunkE542D3GCjs.normalizePath.call(void 0, cmpHelper.relativePath(filePath)))
137
+ _kleur2.default.dim(_chunk6PSD2CIOjs.normalizePath.call(void 0, cmpHelper.relativePath(filePath)))
138
138
  );
139
139
  };
140
140
  if (type === "unlink") {
@@ -163,7 +163,7 @@ function resolveOptions(command) {
163
163
  }
164
164
 
165
165
  // src/cli/index.ts
166
- var [programName] = Object.keys(_chunkE542D3GCjs.bin);
166
+ var [programName] = Object.keys(_chunk6PSD2CIOjs.bin);
167
167
  var cli = _cac.cac.call(void 0, programName);
168
168
  var buildCommand = cli.command("build [root]", "Compile Vue3 to React (one-time)");
169
169
  resolveOptions(buildCommand).action((root, options) => {
@@ -173,4 +173,4 @@ var watchCommand = cli.command("watch [root]", "Compile Vue3 to React and watch
173
173
  resolveOptions(watchCommand).action((root, options) => {
174
174
  resolveAction(root, { ...options, watch: true });
175
175
  });
176
- cli.help().version(_chunkE542D3GCjs.version).parse();
176
+ cli.help().version(_chunk6PSD2CIOjs.version).parse();
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vureact/compiler-core v1.0.2
2
+ * @vureact/compiler-core v1.0.3
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-BVCPVRCO.esm.js";
21
+ } from "./chunk-VWMAAVDB.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.0.2
2
+ * @vureact/compiler-core v1.0.3
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 _chunkE542D3GCjs = require('./chunk-E542D3GC.js');
21
+ var _chunk6PSD2CIOjs = require('./chunk-6PSD2CIO.js');
22
22
 
23
23
 
24
24
 
@@ -33,4 +33,4 @@ var _chunkE542D3GCjs = require('./chunk-E542D3GC.js');
33
33
 
34
34
 
35
35
 
36
- exports.BaseCompiler = _chunkE542D3GCjs.BaseCompiler; exports.CacheKey = _chunkE542D3GCjs.CacheKey; exports.FileCompiler = _chunkE542D3GCjs.FileCompiler; exports.Helper = _chunkE542D3GCjs.Helper; exports.VuReact = _chunkE542D3GCjs.VuReact; exports.defineConfig = _chunkE542D3GCjs.defineConfig; exports.generate = _chunkE542D3GCjs.generate; exports.generateComponent = _chunkE542D3GCjs.generateComponent; exports.generateOnlyScript = _chunkE542D3GCjs.generateOnlyScript; exports.parse = _chunkE542D3GCjs.parse; exports.parseOnlyScript = _chunkE542D3GCjs.parseOnlyScript; exports.parseSFC = _chunkE542D3GCjs.parseSFC; exports.transform = _chunkE542D3GCjs.transform;
36
+ exports.BaseCompiler = _chunk6PSD2CIOjs.BaseCompiler; exports.CacheKey = _chunk6PSD2CIOjs.CacheKey; exports.FileCompiler = _chunk6PSD2CIOjs.FileCompiler; exports.Helper = _chunk6PSD2CIOjs.Helper; exports.VuReact = _chunk6PSD2CIOjs.VuReact; exports.defineConfig = _chunk6PSD2CIOjs.defineConfig; exports.generate = _chunk6PSD2CIOjs.generate; exports.generateComponent = _chunk6PSD2CIOjs.generateComponent; exports.generateOnlyScript = _chunk6PSD2CIOjs.generateOnlyScript; exports.parse = _chunk6PSD2CIOjs.parse; exports.parseOnlyScript = _chunk6PSD2CIOjs.parseOnlyScript; exports.parseSFC = _chunk6PSD2CIOjs.parseSFC; exports.transform = _chunk6PSD2CIOjs.transform;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vureact/compiler-core",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "Next Vue to React compiler, compiles Vue 3 syntax into runnable React 18+ code.",
5
5
  "author": "Ruihong Zhong (Ryan John)",
6
6
  "license": "MIT",