@tsrx/vue 0.0.19 → 0.0.20

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.
Files changed (2) hide show
  1. package/package.json +2 -2
  2. package/src/transform.js +12 -1
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Vue compiler built on @tsrx/core",
4
4
  "license": "MIT",
5
5
  "author": "Dominic Gannaway",
6
- "version": "0.0.19",
6
+ "version": "0.0.20",
7
7
  "type": "module",
8
8
  "publishConfig": {
9
9
  "access": "public"
@@ -30,7 +30,7 @@
30
30
  "dependencies": {
31
31
  "esrap": "^2.1.0",
32
32
  "zimmerframe": "^1.1.2",
33
- "@tsrx/core": "0.0.24"
33
+ "@tsrx/core": "0.0.25"
34
34
  },
35
35
  "peerDependencies": {
36
36
  "vue": ">=3.5",
package/src/transform.js CHANGED
@@ -120,9 +120,10 @@ function component_to_vapor_component_declaration(component, transform_context,
120
120
  }
121
121
 
122
122
  const component_id = clone_identifier(component.id);
123
+ const fn_id = fn.type === 'FunctionDeclaration' ? fn.id : null;
123
124
  component_id.metadata = {
124
125
  ...component_id.metadata,
125
- ...(fn.id?.metadata || {}),
126
+ ...(fn_id?.metadata || {}),
126
127
  path: component_id.metadata?.path || [],
127
128
  };
128
129
  /** @type {any} */ (component_id.metadata).hover = create_component_hover_replacement(fn.params);
@@ -454,6 +455,16 @@ function strip_top_level_jsx_keys(node) {
454
455
  * @returns {any}
455
456
  */
456
457
  function function_declaration_to_expression(fn) {
458
+ if (fn.type === 'ArrowFunctionExpression') {
459
+ return {
460
+ ...fn,
461
+ metadata: {
462
+ ...(fn.metadata || {}),
463
+ path: fn.metadata?.path || [],
464
+ },
465
+ };
466
+ }
467
+
457
468
  return {
458
469
  ...fn,
459
470
  type: 'FunctionExpression',