nexa-compiler 0.7.4 → 0.7.5

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.
@@ -24,10 +24,13 @@ export function generateComponentCode(sfc, filename) {
24
24
  // Only add Teleport/Transition if they are used in template (keeping it simple for tests)
25
25
  const hasTeleport = sfc.template?.includes('<Teleport');
26
26
  const hasTransition = sfc.template?.includes('<Transition');
27
+ const hasVCurrency = sfc.template?.includes('v-currency');
27
28
  if (hasTeleport && !existing.includes('Teleport'))
28
29
  needed.push('Teleport');
29
30
  if (hasTransition && !existing.includes('Transition'))
30
31
  needed.push('Transition');
32
+ if (hasVCurrency && !existing.includes('vCurrency'))
33
+ needed.push('vCurrency');
31
34
  if (needed.length > 0) {
32
35
  const merged = [...existing, ...needed].join(', ');
33
36
  lines.push(imp.replace(/\{[^}]+\}/s, `{ ${merged} }`));
@@ -51,6 +54,8 @@ export function generateComponentCode(sfc, filename) {
51
54
  defaultImports.push('Teleport');
52
55
  if (sfc.template?.includes('<Transition'))
53
56
  defaultImports.push('Transition');
57
+ if (sfc.template?.includes('v-currency'))
58
+ defaultImports.push('vCurrency');
54
59
  lines.push(`import { ${defaultImports.join(', ')} } from 'nexa-framework'`);
55
60
  }
56
61
  const { scopeId, styleCode } = transformStyle(sfc.style, sfc.scoped, sfc.template);
@@ -65,7 +70,7 @@ export function generateComponentCode(sfc, filename) {
65
70
  const emitsDef = parseDefineEmits(fullScript);
66
71
  const cleanSetup = stripMacroLines(fullScript);
67
72
  const scriptBindings = extractBindings(cleanSetup);
68
- const importBindings = extractImportBindings(importLines).filter(b => !['h', 'hText', 'effect', 'defineComponent', 'registerComponent', 'reloadComponent', 'injectStyle', 'signal', 'computed', 'watch', 'onMounted', 'onUnmounted', 'Teleport', 'Transition'].includes(b));
73
+ const importBindings = extractImportBindings(importLines).filter(b => !['h', 'hText', 'effect', 'defineComponent', 'registerComponent', 'reloadComponent', 'injectStyle', 'signal', 'computed', 'watch', 'onMounted', 'onUnmounted', 'Teleport', 'Transition', 'vCurrency'].includes(b));
69
74
  if (propsDef) {
70
75
  if (!propsDef._isJS) {
71
76
  propsKeys = Object.keys(propsDef);
@@ -138,6 +138,9 @@ function genProps(attrs, tag) {
138
138
  if (propName === 'vShow' && typeof attr.value === 'string') {
139
139
  parts.push(`${propName}: ${attr.value}`);
140
140
  }
141
+ else if (propName === 'vCurrency' && typeof attr.value === 'string') {
142
+ parts.push(`${propName}: ${attr.value}`);
143
+ }
141
144
  else if (propName === 'vModel' && typeof attr.value === 'string') {
142
145
  const isComponent = /^[A-Z]/.test(tag) || tag.includes('-');
143
146
  if (isComponent) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nexa-compiler",
3
- "version": "0.7.4",
3
+ "version": "0.7.5",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",