@vue-jsx-vapor/macros 3.2.11 → 3.2.13

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 (71) hide show
  1. package/dist/api.cjs +3 -3
  2. package/dist/api.d.cts +5 -5
  3. package/dist/api.d.ts +5 -5
  4. package/dist/api.js +2 -3
  5. package/dist/astro.cjs +7 -8
  6. package/dist/astro.d.cts +1 -1
  7. package/dist/astro.d.ts +1 -1
  8. package/dist/astro.js +3 -7
  9. package/dist/bun.cjs +6 -8
  10. package/dist/bun.d.cts +1 -1
  11. package/dist/bun.d.ts +1 -1
  12. package/dist/bun.js +3 -7
  13. package/dist/{core-Qf0K0TQC.js → core-CspOqTxm.js} +9 -26
  14. package/dist/{core-CyGS7Va2.cjs → core-j6kwFyf2.cjs} +78 -100
  15. package/dist/esbuild.cjs +6 -8
  16. package/dist/esbuild.d.cts +3 -3
  17. package/dist/esbuild.d.ts +3 -3
  18. package/dist/esbuild.js +3 -7
  19. package/dist/index.cjs +12 -8
  20. package/dist/index.d.cts +1 -1
  21. package/dist/index.d.ts +1 -1
  22. package/dist/index.js +7 -6
  23. package/dist/nuxt.cjs +9 -10
  24. package/dist/nuxt.d.cts +3 -3
  25. package/dist/nuxt.d.ts +3 -3
  26. package/dist/nuxt.js +2 -7
  27. package/dist/options.cjs +29 -3
  28. package/dist/options.d.cts +1 -1
  29. package/dist/options.d.ts +1 -1
  30. package/dist/options.js +28 -3
  31. package/dist/{raw-C-xS65ku.cjs → raw-B-nh3eEu.cjs} +8 -12
  32. package/dist/{raw-BTUP7Cbc.js → raw-CrS9IkfP.js} +3 -7
  33. package/dist/raw.cjs +6 -5
  34. package/dist/raw.d.cts +1 -1
  35. package/dist/raw.d.ts +1 -1
  36. package/dist/raw.js +2 -4
  37. package/dist/rolldown.cjs +6 -8
  38. package/dist/rolldown.d.cts +3 -3
  39. package/dist/rolldown.d.ts +3 -3
  40. package/dist/rolldown.js +3 -7
  41. package/dist/rollup.cjs +6 -8
  42. package/dist/rollup.d.cts +3 -3
  43. package/dist/rollup.d.ts +3 -3
  44. package/dist/rollup.js +3 -7
  45. package/dist/rsbuild.cjs +16 -0
  46. package/dist/rsbuild.d.cts +8 -0
  47. package/dist/rsbuild.d.ts +9 -0
  48. package/dist/rsbuild.js +12 -0
  49. package/dist/rspack.cjs +6 -8
  50. package/dist/rspack.d.cts +1 -1
  51. package/dist/rspack.d.ts +1 -1
  52. package/dist/rspack.js +3 -7
  53. package/dist/vite.cjs +6 -8
  54. package/dist/vite.d.cts +3 -3
  55. package/dist/vite.d.ts +3 -3
  56. package/dist/vite.js +3 -7
  57. package/dist/volar.cjs +8 -14
  58. package/dist/volar.d.cts +1 -1
  59. package/dist/volar.d.ts +1 -1
  60. package/dist/volar.js +2 -11
  61. package/dist/webpack.cjs +6 -8
  62. package/dist/webpack.d.cts +3 -3
  63. package/dist/webpack.d.ts +3 -3
  64. package/dist/webpack.js +3 -7
  65. package/package.json +35 -29
  66. package/dist/options-BMD1qLwt.cjs +0 -35
  67. package/dist/options-CmJjcwvr.js +0 -29
  68. package/dist/src-BoqluMMt.js +0 -9
  69. package/dist/src-Qjj50LHy.cjs +0 -15
  70. /package/dist/{options-BOh4R4y_.d.cts → options-CtTcew0x.d.ts} +0 -0
  71. /package/dist/{options-BV2zYeKi.d.ts → options-qs66-MV7.d.cts} +0 -0
@@ -1,4 +1,4 @@
1
- //#region rolldown:runtime
1
+ //#region \0rolldown/runtime.js
2
2
  var __create = Object.create;
3
3
  var __defProp = Object.defineProperty;
4
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -6,16 +6,12 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __getProtoOf = Object.getPrototypeOf;
7
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
8
  var __copyProps = (to, from, except, desc) => {
9
- if (from && typeof from === "object" || typeof from === "function") {
10
- for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
11
- key = keys[i];
12
- if (!__hasOwnProp.call(to, key) && key !== except) {
13
- __defProp(to, key, {
14
- get: ((k) => from[k]).bind(null, key),
15
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
16
- });
17
- }
18
- }
9
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
10
+ key = keys[i];
11
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
12
+ get: ((k) => from[k]).bind(null, key),
13
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
14
+ });
19
15
  }
20
16
  return to;
21
17
  };
@@ -23,14 +19,12 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
23
19
  value: mod,
24
20
  enumerable: true
25
21
  }) : target, mod));
26
-
27
22
  //#endregion
28
23
  require("@babel/parser");
29
24
  let magic_string = require("magic-string");
30
- magic_string = __toESM(magic_string);
25
+ magic_string = __toESM(magic_string, 1);
31
26
  let hash_sum = require("hash-sum");
32
- hash_sum = __toESM(hash_sum);
33
-
27
+ hash_sum = __toESM(hash_sum, 1);
34
28
  //#region ../../node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs
35
29
  const _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
36
30
  function normalizeWindowsPath(input = "") {
@@ -43,7 +37,6 @@ const extname = function(p) {
43
37
  const match = _EXTNAME_RE.exec(normalizeWindowsPath(p));
44
38
  return match && match[1] || "";
45
39
  };
46
-
47
40
  //#endregion
48
41
  //#region ../../node_modules/.pnpm/ast-kit@2.2.0/node_modules/ast-kit/dist/index.js
49
42
  /**
@@ -471,26 +464,21 @@ function markScopeIdentifier(node, child, knownIds) {
471
464
  markKnownIds(name, knownIds);
472
465
  (node.scopeIds || (node.scopeIds = /* @__PURE__ */ new Set())).add(name);
473
466
  }
474
-
475
467
  //#endregion
476
468
  //#region src/core/helper/use-model.ts?raw
477
- var use_model_default = "import { customRef, watchSyncEffect } from \"vue\";\nconst EMPTY_OBJ = {};\nexport function useModel(props, name, options = {}) {\n const res = customRef((track, trigger) => {\n let localValue = options && options.default;\n let prevSetValue = EMPTY_OBJ;\n watchSyncEffect(() => {\n let propValue = props[name];\n if (propValue === void 0) {\n propValue = options && options.default;\n }\n if (!Object.is(localValue, propValue)) {\n localValue = propValue;\n trigger();\n }\n });\n return {\n get() {\n track();\n return options.get ? options.get(localValue) : localValue;\n },\n set(value) {\n const emittedValue = options.set ? options.set(value) : value;\n if (Object.is(emittedValue, localValue) && (prevSetValue === EMPTY_OBJ || Object.is(value, prevSetValue)))\n return;\n localValue = emittedValue;\n trigger();\n for (const emit of [props[`onUpdate:${name}`]].flat()) {\n if (typeof emit === \"function\") emit(emittedValue);\n }\n prevSetValue = value;\n }\n };\n });\n res[Symbol.iterator] = () => {\n let i = 0;\n return {\n next() {\n if (i < 2) {\n return {\n value: i++ ? props[`${name}Modifiers`] || {} : res,\n done: false\n };\n } else {\n return { done: true };\n }\n }\n };\n };\n return res;\n}\n";
478
-
469
+ var use_model_default = "import { customRef, watchSyncEffect } from \"vue\";\nconst EMPTY_OBJ = {};\nexport function useModel(props, name, options = EMPTY_OBJ) {\n const res = customRef((track, trigger) => {\n let localValue = options && options.default;\n let prevSetValue = EMPTY_OBJ;\n watchSyncEffect(() => {\n let propValue = props[name];\n if (propValue === void 0) {\n propValue = options && options.default;\n }\n if (!Object.is(localValue, propValue)) {\n localValue = propValue;\n trigger();\n }\n });\n return {\n get() {\n track();\n return options.get ? options.get(localValue) : localValue;\n },\n set(value) {\n const emittedValue = options.set ? options.set(value) : value;\n if (Object.is(emittedValue, localValue) && (prevSetValue === EMPTY_OBJ || Object.is(value, prevSetValue)))\n return;\n localValue = emittedValue;\n trigger();\n for (const emit of [props[`onUpdate:${name}`]].flat()) {\n if (typeof emit === \"function\") emit(emittedValue);\n }\n prevSetValue = value;\n }\n };\n });\n res[Symbol.iterator] = () => {\n let i = 0;\n return {\n next() {\n if (i < 2) {\n return {\n value: i++ ? props[`${name}Modifiers`] || {} : res,\n done: false\n };\n } else {\n return { done: true };\n }\n }\n };\n };\n return res;\n}\n";
479
470
  //#endregion
480
471
  //#region src/core/helper/use-slots.ts?raw
481
472
  var use_slots_default = "import { useSlots as _useSlots } from \"vue\";\nexport function useSlots(defaultSlots = {}) {\n const slots = _useSlots();\n return new Proxy(defaultSlots, {\n get(target, key) {\n return key in slots ? slots[key] : target[key];\n }\n });\n}\n";
482
-
483
473
  //#endregion
484
474
  //#region src/core/helper/with-defaults.ts?raw
485
475
  var with_defaults_default = "function resolveDefaultProps(paths) {\n const result = {};\n for (const path of Object.keys(paths)) {\n const segments = path.split(/[.?[\\]]/).filter(Boolean);\n let current = result;\n for (let i = 0; i < segments.length; i++) {\n const segment = segments[i];\n if (i === segments.length - 1) {\n current[segment] = paths[path];\n } else {\n if (!current[segment]) {\n current[segment] = Number.isNaN(Number(segments[i + 1])) ? {} : [];\n }\n current = current[segment];\n }\n }\n }\n return result;\n}\nexport function createPropsDefaultProxy(props, defaults) {\n const defaultProps = resolveDefaultProps(defaults);\n const result = {};\n for (const key of /* @__PURE__ */ new Set([\n ...Object.keys(props),\n ...Object.keys(defaultProps)\n ])) {\n Object.defineProperty(result, key, {\n enumerable: true,\n get: () => props[key] === void 0 ? defaultProps[key] : props[key]\n });\n }\n return result;\n}\n";
486
-
487
476
  //#endregion
488
477
  //#region src/core/helper/index.ts
489
478
  const helperPrefix = "/vue-jsx-vapor/macros";
490
479
  const useModelHelperId = `${helperPrefix}/use-model`;
491
480
  const withDefaultsHelperId = `${helperPrefix}/with-defaults`;
492
481
  const useSlotsHelperId = `${helperPrefix}/use-slots`;
493
-
494
482
  //#endregion
495
483
  //#region src/core/utils.ts
496
484
  function prependFunctionalNode(node, s, result) {
@@ -524,24 +512,22 @@ function getRequire() {
524
512
  } catch {}
525
513
  }
526
514
  const importedMap = /* @__PURE__ */ new WeakMap();
527
- const HELPER_PREFIX = "__";
528
515
  function importHelperFn(s, imported, local = imported, from = "vue") {
529
516
  const cacheKey = `${from}@${imported}`;
530
517
  if (!importedMap.get(s)?.has(cacheKey)) {
531
- s.appendLeft(0, `\nimport ${imported === "default" ? HELPER_PREFIX + local : `{ ${imported} as ${HELPER_PREFIX + local} }`} from ${JSON.stringify(from)};`);
518
+ s.appendLeft(0, `\nimport ${imported === "default" ? "__" + local : `{ ${imported} as ${"__" + local} }`} from ${JSON.stringify(from)};`);
532
519
  if (importedMap.has(s)) importedMap.get(s).add(cacheKey);
533
520
  else importedMap.set(s, new Set([cacheKey]));
534
521
  }
535
- return `${HELPER_PREFIX}${local}`;
522
+ return `__${local}`;
536
523
  }
537
-
538
524
  //#endregion
539
525
  //#region src/core/restructure.ts
540
526
  function restructure(s, node, options = {}) {
541
527
  let index = 0;
542
528
  const propList = [];
543
529
  for (const param of node.params) {
544
- const path = `${HELPER_PREFIX}props${index++ || ""}`;
530
+ const path = `__props${index++ || ""}`;
545
531
  const props = getProps(s, options, param, path);
546
532
  if (props) {
547
533
  s.overwrite(param.start, param.end, path);
@@ -607,7 +593,7 @@ function getProps(s, options, node, path = "", props = []) {
607
593
  });
608
594
  }
609
595
  propNames.push(`'${prop.key.name}'`);
610
- } else if (prop?.type === "RestElement" && prop.argument.type === "Identifier" && !prop.argument.name.startsWith(`${HELPER_PREFIX}props`)) props.push({
596
+ } else if (prop?.type === "RestElement" && prop.argument.type === "Identifier" && !prop.argument.name.startsWith(`__props`)) props.push({
611
597
  path,
612
598
  name: prop.argument.name,
613
599
  value: propNames.join(", "),
@@ -617,7 +603,6 @@ function getProps(s, options, node, path = "", props = []) {
617
603
  });
618
604
  return props.length ? props : void 0;
619
605
  }
620
-
621
606
  //#endregion
622
607
  //#region src/core/define-component/await.ts
623
608
  function transformAwait(root, s) {
@@ -650,7 +635,6 @@ function processAwait(s, node, needSemi, isStatement) {
650
635
  s.overwrite(node.start, argumentStart, `${needSemi ? `;` : ``}(\n ([__temp,__restore] = ${importHelperFn(s, `withAsyncContext`)}(${containsNestedAwait ? `async ` : ``}() => `);
651
636
  s.appendLeft(node.end, `)),\n ${isStatement ? `` : `__temp = `}await __temp,\n __restore()${isStatement ? `` : `,\n __temp`}\n)`);
652
637
  }
653
-
654
638
  //#endregion
655
639
  //#region src/core/define-component/index.ts
656
640
  function transformDefineComponent(root, propsName, macros, s) {
@@ -661,7 +645,7 @@ function transformDefineComponent(root, propsName, macros, s) {
661
645
  if (root.params[0].type === "Identifier") {
662
646
  getWalkedIds(root, propsName).forEach((id) => props[id] = null);
663
647
  prependFunctionalNode(root, s, `const ${propsName} = ${importHelperFn(s, "useFullProps", void 0, "/vue-jsx-vapor/props")}()`);
664
- s.overwrite(root.params[0].start, root.params[0].end, root.params.length > 1 ? `${HELPER_PREFIX}props` : root.start === root.params[0].start ? "()" : "");
648
+ s.overwrite(root.params[0].start, root.params[0].end, root.params.length > 1 ? `__props` : root.start === root.params[0].start ? "()" : "");
665
649
  } else if (root.params[0].type === "ObjectPattern") {
666
650
  const restructuredProps = root.params[0];
667
651
  for (const prop of restructuredProps.properties) {
@@ -785,27 +769,23 @@ function getTypeAndValue(s, node) {
785
769
  skipFactory
786
770
  };
787
771
  }
788
-
789
772
  //#endregion
790
773
  //#region src/core/define-expose.ts
791
774
  function transformDefineExpose(node, s) {
792
775
  s.overwrite(node.callee.start, node.callee.end, ";");
793
776
  s.appendRight(node.arguments[0]?.start || node.end - 1, `${importHelperFn(s, "getCurrentInstance", void 0, "/vue-jsx-vapor/props")}().exposed = `);
794
777
  }
795
-
796
778
  //#endregion
797
779
  //#region src/core/define-model.ts
798
780
  function transformDefineModel(node, propsName, s) {
799
781
  s.overwrite(node.callee.start, node.callee.end, importHelperFn(s, "useModel", void 0, useModelHelperId));
800
782
  s.appendRight(node.arguments[0]?.start || node.end - 1, `${propsName}, ${node.arguments[0]?.type === "StringLiteral" ? "" : `'modelValue',`}`);
801
783
  }
802
-
803
784
  //#endregion
804
785
  //#region src/core/define-slots.ts
805
786
  function transformDefineSlots(node, s) {
806
787
  s.overwrite(node.callee.start, node.callee.end, importHelperFn(s, "useSlots", void 0, useSlotsHelperId));
807
788
  }
808
-
809
789
  //#endregion
810
790
  //#region src/core/define-style.ts
811
791
  function transformDefineStyle(defineStyle, index, root, s, importMap, { defineSlots }) {
@@ -865,7 +845,6 @@ function toCssVarId(name, prefix = "") {
865
845
  return searchValue === "." ? "-" : name.charCodeAt(replaceValue).toString();
866
846
  });
867
847
  }
868
-
869
848
  //#endregion
870
849
  //#region src/core/index.ts
871
850
  let babelParse;
@@ -891,13 +870,13 @@ async function transformJsxMacros(code, id, importMap, options) {
891
870
  transformDefineStyle(defineStyle, defineStyleIndex++, root, s, importMap, macros);
892
871
  });
893
872
  if (root === void 0) continue;
894
- let propsName = `${HELPER_PREFIX}props`;
873
+ let propsName = `__props`;
895
874
  if (root.params[0]) {
896
875
  if (root.params[0].type === "Identifier") propsName = root.params[0].name;
897
876
  else if (root.params[0].type === "ObjectPattern") {
898
877
  const lastProp = root.params[0].properties.at(-1);
899
878
  if (!macros.defineComponent && lastProp?.type === "RestElement" && lastProp.argument.type === "Identifier") propsName = lastProp.argument.name;
900
- else s.appendRight(root.params[0].extra?.trailingComma ? root.params[0].extra?.trailingComma + 1 : lastProp?.end || root.params[0].end - 1, `${!root.params[0].extra?.trailingComma && root.params[0].properties.length ? "," : ""} ...${HELPER_PREFIX}props`);
879
+ else s.appendRight(root.params[0].extra?.trailingComma ? root.params[0].extra?.trailingComma + 1 : lastProp?.end || root.params[0].end - 1, `${!root.params[0].extra?.trailingComma && root.params[0].properties.length ? "," : ""} ...__props`);
901
880
  }
902
881
  } else if (macros.defineModel?.length) s.appendRight(getParamsStart(root, s.original), propsName);
903
882
  if (macros.defineComponent) transformDefineComponent(root, propsName, macros, s);
@@ -974,77 +953,76 @@ function getMacroExpression(node, options) {
974
953
  ].includes(node.callee.name)) return node;
975
954
  }
976
955
  }
977
-
978
956
  //#endregion
979
- Object.defineProperty(exports, '__toESM', {
980
- enumerable: true,
981
- get: function () {
982
- return __toESM;
983
- }
957
+ Object.defineProperty(exports, "__toESM", {
958
+ enumerable: true,
959
+ get: function() {
960
+ return __toESM;
961
+ }
984
962
  });
985
- Object.defineProperty(exports, 'getMacroExpression', {
986
- enumerable: true,
987
- get: function () {
988
- return getMacroExpression;
989
- }
963
+ Object.defineProperty(exports, "getMacroExpression", {
964
+ enumerable: true,
965
+ get: function() {
966
+ return getMacroExpression;
967
+ }
990
968
  });
991
- Object.defineProperty(exports, 'getRequire', {
992
- enumerable: true,
993
- get: function () {
994
- return getRequire;
995
- }
969
+ Object.defineProperty(exports, "getRequire", {
970
+ enumerable: true,
971
+ get: function() {
972
+ return getRequire;
973
+ }
996
974
  });
997
- Object.defineProperty(exports, 'isFunctionalNode', {
998
- enumerable: true,
999
- get: function () {
1000
- return isFunctionalNode;
1001
- }
975
+ Object.defineProperty(exports, "isFunctionalNode", {
976
+ enumerable: true,
977
+ get: function() {
978
+ return isFunctionalNode;
979
+ }
1002
980
  });
1003
- Object.defineProperty(exports, 'restructure', {
1004
- enumerable: true,
1005
- get: function () {
1006
- return restructure;
1007
- }
981
+ Object.defineProperty(exports, "restructure", {
982
+ enumerable: true,
983
+ get: function() {
984
+ return restructure;
985
+ }
1008
986
  });
1009
- Object.defineProperty(exports, 'transformJsxMacros', {
1010
- enumerable: true,
1011
- get: function () {
1012
- return transformJsxMacros;
1013
- }
987
+ Object.defineProperty(exports, "transformJsxMacros", {
988
+ enumerable: true,
989
+ get: function() {
990
+ return transformJsxMacros;
991
+ }
992
+ });
993
+ Object.defineProperty(exports, "useModelHelperId", {
994
+ enumerable: true,
995
+ get: function() {
996
+ return useModelHelperId;
997
+ }
1014
998
  });
1015
- Object.defineProperty(exports, 'useModelHelperId', {
1016
- enumerable: true,
1017
- get: function () {
1018
- return useModelHelperId;
1019
- }
999
+ Object.defineProperty(exports, "useSlotsHelperId", {
1000
+ enumerable: true,
1001
+ get: function() {
1002
+ return useSlotsHelperId;
1003
+ }
1020
1004
  });
1021
- Object.defineProperty(exports, 'useSlotsHelperId', {
1022
- enumerable: true,
1023
- get: function () {
1024
- return useSlotsHelperId;
1025
- }
1005
+ Object.defineProperty(exports, "use_model_default", {
1006
+ enumerable: true,
1007
+ get: function() {
1008
+ return use_model_default;
1009
+ }
1026
1010
  });
1027
- Object.defineProperty(exports, 'use_model_default', {
1028
- enumerable: true,
1029
- get: function () {
1030
- return use_model_default;
1031
- }
1011
+ Object.defineProperty(exports, "use_slots_default", {
1012
+ enumerable: true,
1013
+ get: function() {
1014
+ return use_slots_default;
1015
+ }
1032
1016
  });
1033
- Object.defineProperty(exports, 'use_slots_default', {
1034
- enumerable: true,
1035
- get: function () {
1036
- return use_slots_default;
1037
- }
1017
+ Object.defineProperty(exports, "withDefaultsHelperId", {
1018
+ enumerable: true,
1019
+ get: function() {
1020
+ return withDefaultsHelperId;
1021
+ }
1038
1022
  });
1039
- Object.defineProperty(exports, 'withDefaultsHelperId', {
1040
- enumerable: true,
1041
- get: function () {
1042
- return withDefaultsHelperId;
1043
- }
1023
+ Object.defineProperty(exports, "with_defaults_default", {
1024
+ enumerable: true,
1025
+ get: function() {
1026
+ return with_defaults_default;
1027
+ }
1044
1028
  });
1045
- Object.defineProperty(exports, 'with_defaults_default', {
1046
- enumerable: true,
1047
- get: function () {
1048
- return with_defaults_default;
1049
- }
1050
- });
package/dist/esbuild.cjs CHANGED
@@ -1,10 +1,8 @@
1
- Object.defineProperty(exports, '__esModule', { value: true });
2
- require('./core-CyGS7Va2.cjs');
3
- require('./raw-C-xS65ku.cjs');
4
- const require_src = require('./src-Qjj50LHy.cjs');
5
-
1
+ Object.defineProperties(exports, {
2
+ __esModule: { value: true },
3
+ [Symbol.toStringTag]: { value: "Module" }
4
+ });
6
5
  //#region src/esbuild.ts
7
- var esbuild_default = require_src.src_default.esbuild;
8
-
6
+ var esbuild_default = require("./index.cjs").default.esbuild;
9
7
  //#endregion
10
- exports.default = esbuild_default;
8
+ exports.default = esbuild_default;
@@ -1,6 +1,6 @@
1
- import { n as Options } from "./options-BOh4R4y_.cjs";
2
- import * as esbuild0 from "esbuild";
1
+ import { n as Options } from "./options-qs66-MV7.cjs";
2
+ import * as _$unplugin from "unplugin";
3
3
 
4
4
  //#region src/esbuild.d.ts
5
- declare const _default: (options?: Options | undefined) => esbuild0.Plugin;
5
+ declare const _default: (options?: Options | undefined) => _$unplugin.EsbuildPlugin;
6
6
  export = _default;
package/dist/esbuild.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { n as Options } from "./options-BV2zYeKi.js";
2
- import * as esbuild0 from "esbuild";
1
+ import { n as Options } from "./options-CtTcew0x.js";
2
+ import * as _$unplugin from "unplugin";
3
3
 
4
4
  //#region src/esbuild.d.ts
5
- declare const _default: (options?: Options | undefined) => esbuild0.Plugin;
5
+ declare const _default: (options?: Options | undefined) => _$unplugin.EsbuildPlugin;
6
6
  //#endregion
7
7
  export { _default as default };
package/dist/esbuild.js CHANGED
@@ -1,9 +1,5 @@
1
- import "./core-Qf0K0TQC.js";
2
- import "./raw-BTUP7Cbc.js";
3
- import { t as src_default } from "./src-BoqluMMt.js";
4
-
1
+ import unplugin from "./index.js";
5
2
  //#region src/esbuild.ts
6
- var esbuild_default = src_default.esbuild;
7
-
3
+ var esbuild_default = unplugin.esbuild;
8
4
  //#endregion
9
- export { esbuild_default as default };
5
+ export { esbuild_default as default };
package/dist/index.cjs CHANGED
@@ -1,8 +1,12 @@
1
- Object.defineProperty(exports, '__esModule', { value: true });
2
- require('./core-CyGS7Va2.cjs');
3
- require('./raw-C-xS65ku.cjs');
4
- const require_options = require('./options-BMD1qLwt.cjs');
5
- const require_src = require('./src-Qjj50LHy.cjs');
6
-
7
- exports.default = require_src.src_default;
8
- exports.resolveOptions = require_options.resolveOptions;
1
+ Object.defineProperties(exports, {
2
+ __esModule: { value: true },
3
+ [Symbol.toStringTag]: { value: "Module" }
4
+ });
5
+ require("./core-j6kwFyf2.cjs");
6
+ const require_raw = require("./raw-B-nh3eEu.cjs");
7
+ const require_options = require("./options.cjs");
8
+ //#region src/index.ts
9
+ const unplugin$1 = (0, require("unplugin").createUnplugin)(require_raw.plugin);
10
+ //#endregion
11
+ exports.default = unplugin$1;
12
+ exports.resolveOptions = require_options.resolveOptions;
package/dist/index.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { i as resolveOptions, n as Options, r as OptionsResolved, t as BaseOptions } from "./options-BOh4R4y_.cjs";
1
+ import { i as resolveOptions, n as Options, r as OptionsResolved, t as BaseOptions } from "./options-qs66-MV7.cjs";
2
2
  import { UnpluginInstance } from "unplugin";
3
3
 
4
4
  //#region src/index.d.ts
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { i as resolveOptions, n as Options, r as OptionsResolved, t as BaseOptions } from "./options-BV2zYeKi.js";
1
+ import { i as resolveOptions, n as Options, r as OptionsResolved, t as BaseOptions } from "./options-CtTcew0x.js";
2
2
  import { UnpluginInstance } from "unplugin";
3
3
 
4
4
  //#region src/index.d.ts
package/dist/index.js CHANGED
@@ -1,6 +1,7 @@
1
- import "./core-Qf0K0TQC.js";
2
- import "./raw-BTUP7Cbc.js";
3
- import { t as resolveOptions } from "./options-CmJjcwvr.js";
4
- import { t as src_default } from "./src-BoqluMMt.js";
5
-
6
- export { src_default as default, resolveOptions };
1
+ import { t as plugin } from "./raw-CrS9IkfP.js";
2
+ import { resolveOptions } from "./options.js";
3
+ import { createUnplugin } from "unplugin";
4
+ //#region src/index.ts
5
+ const unplugin = createUnplugin(plugin);
6
+ //#endregion
7
+ export { unplugin as default, resolveOptions };
package/dist/nuxt.cjs CHANGED
@@ -1,16 +1,16 @@
1
- Object.defineProperty(exports, '__esModule', { value: true });
2
- const require_core = require('./core-CyGS7Va2.cjs');
3
- require('./raw-C-xS65ku.cjs');
4
- require('./src-Qjj50LHy.cjs');
5
- const require_vite = require('./vite.cjs');
6
- const require_webpack = require('./webpack.cjs');
1
+ Object.defineProperties(exports, {
2
+ __esModule: { value: true },
3
+ [Symbol.toStringTag]: { value: "Module" }
4
+ });
5
+ require("./core-j6kwFyf2.cjs");
6
+ const require_vite = require("./vite.cjs");
7
+ const require_webpack = require("./webpack.cjs");
7
8
  let _nuxt_kit = require("@nuxt/kit");
8
9
  require("@nuxt/schema");
9
-
10
10
  //#region src/nuxt.ts
11
11
  var nuxt_default = (0, _nuxt_kit.defineNuxtModule)({
12
12
  meta: {
13
- name: "nuxt-vue-jsx-vapor",
13
+ name: "nuxt-vue-jsx-vapor-macros",
14
14
  configKey: "unpluginStarter"
15
15
  },
16
16
  setup(options) {
@@ -18,6 +18,5 @@ var nuxt_default = (0, _nuxt_kit.defineNuxtModule)({
18
18
  (0, _nuxt_kit.addWebpackPlugin)(() => require_webpack.default(options));
19
19
  }
20
20
  });
21
-
22
21
  //#endregion
23
- exports.default = nuxt_default;
22
+ exports.default = nuxt_default;
package/dist/nuxt.d.cts CHANGED
@@ -1,8 +1,8 @@
1
- import { n as Options } from "./options-BOh4R4y_.cjs";
2
- import * as _nuxt_schema0 from "@nuxt/schema";
1
+ import { n as Options } from "./options-qs66-MV7.cjs";
2
+ import * as _$_nuxt_schema0 from "@nuxt/schema";
3
3
 
4
4
  //#region src/nuxt.d.ts
5
5
  interface ModuleOptions extends Options {}
6
- declare const _default: _nuxt_schema0.NuxtModule<ModuleOptions, ModuleOptions, false>;
6
+ declare const _default: _$_nuxt_schema0.NuxtModule<ModuleOptions, ModuleOptions, false>;
7
7
  //#endregion
8
8
  export { ModuleOptions, _default as default };
package/dist/nuxt.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- import { n as Options } from "./options-BV2zYeKi.js";
2
- import * as _nuxt_schema0 from "@nuxt/schema";
1
+ import { n as Options } from "./options-CtTcew0x.js";
2
+ import * as _$_nuxt_schema0 from "@nuxt/schema";
3
3
 
4
4
  //#region src/nuxt.d.ts
5
5
  interface ModuleOptions extends Options {}
6
- declare const _default: _nuxt_schema0.NuxtModule<ModuleOptions, ModuleOptions, false>;
6
+ declare const _default: _$_nuxt_schema0.NuxtModule<ModuleOptions, ModuleOptions, false>;
7
7
  //#endregion
8
8
  export { ModuleOptions, _default as default };
package/dist/nuxt.js CHANGED
@@ -1,15 +1,11 @@
1
- import "./core-Qf0K0TQC.js";
2
- import "./raw-BTUP7Cbc.js";
3
- import "./src-BoqluMMt.js";
4
1
  import vite_default from "./vite.js";
5
2
  import webpack_default from "./webpack.js";
6
3
  import { addVitePlugin, addWebpackPlugin, defineNuxtModule } from "@nuxt/kit";
7
4
  import "@nuxt/schema";
8
-
9
5
  //#region src/nuxt.ts
10
6
  var nuxt_default = defineNuxtModule({
11
7
  meta: {
12
- name: "nuxt-vue-jsx-vapor",
8
+ name: "nuxt-vue-jsx-vapor-macros",
13
9
  configKey: "unpluginStarter"
14
10
  },
15
11
  setup(options) {
@@ -17,6 +13,5 @@ var nuxt_default = defineNuxtModule({
17
13
  addWebpackPlugin(() => webpack_default(options));
18
14
  }
19
15
  });
20
-
21
16
  //#endregion
22
- export { nuxt_default as default };
17
+ export { nuxt_default as default };
package/dist/options.cjs CHANGED
@@ -1,3 +1,29 @@
1
- const require_options = require('./options-BMD1qLwt.cjs');
2
-
3
- exports.resolveOptions = require_options.resolveOptions;
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ //#region src/options.ts
3
+ const REGEX_NODE_MODULES = /node_modules/;
4
+ const REGEX_SRC_FILE = /\.[cm]?[jt]sx?$/;
5
+ const REGEX_SETUP_SFC = /\.setup\.[cm]?[jt]sx?$/;
6
+ function resolveOptions(options) {
7
+ const version = options.version || 3.6;
8
+ return {
9
+ include: [REGEX_SRC_FILE],
10
+ exclude: [REGEX_SETUP_SFC, REGEX_NODE_MODULES],
11
+ ...options,
12
+ version,
13
+ defineComponent: {
14
+ ...options.defineComponent,
15
+ alias: options.defineComponent?.alias ?? [
16
+ "defineComponent",
17
+ "defineVaporComponent",
18
+ "defineCustomElement",
19
+ "defineVaporCustomElement"
20
+ ]
21
+ },
22
+ defineModel: { alias: options.defineModel?.alias ?? ["defineModel"] },
23
+ defineSlots: { alias: options.defineSlots?.alias ?? ["defineSlots"] },
24
+ defineExpose: { alias: options.defineExpose?.alias ?? ["defineExpose"] },
25
+ defineStyle: { alias: options.defineStyle?.alias ?? ["defineStyle"] }
26
+ };
27
+ }
28
+ //#endregion
29
+ exports.resolveOptions = resolveOptions;
@@ -1,2 +1,2 @@
1
- import { i as resolveOptions, n as Options, r as OptionsResolved, t as BaseOptions } from "./options-BOh4R4y_.cjs";
1
+ import { i as resolveOptions, n as Options, r as OptionsResolved, t as BaseOptions } from "./options-qs66-MV7.cjs";
2
2
  export { BaseOptions, Options, OptionsResolved, resolveOptions };
package/dist/options.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { i as resolveOptions, n as Options, r as OptionsResolved, t as BaseOptions } from "./options-BV2zYeKi.js";
1
+ import { i as resolveOptions, n as Options, r as OptionsResolved, t as BaseOptions } from "./options-CtTcew0x.js";
2
2
  export { BaseOptions, Options, OptionsResolved, resolveOptions };
package/dist/options.js CHANGED
@@ -1,3 +1,28 @@
1
- import { t as resolveOptions } from "./options-CmJjcwvr.js";
2
-
3
- export { resolveOptions };
1
+ //#region src/options.ts
2
+ const REGEX_NODE_MODULES = /node_modules/;
3
+ const REGEX_SRC_FILE = /\.[cm]?[jt]sx?$/;
4
+ const REGEX_SETUP_SFC = /\.setup\.[cm]?[jt]sx?$/;
5
+ function resolveOptions(options) {
6
+ const version = options.version || 3.6;
7
+ return {
8
+ include: [REGEX_SRC_FILE],
9
+ exclude: [REGEX_SETUP_SFC, REGEX_NODE_MODULES],
10
+ ...options,
11
+ version,
12
+ defineComponent: {
13
+ ...options.defineComponent,
14
+ alias: options.defineComponent?.alias ?? [
15
+ "defineComponent",
16
+ "defineVaporComponent",
17
+ "defineCustomElement",
18
+ "defineVaporCustomElement"
19
+ ]
20
+ },
21
+ defineModel: { alias: options.defineModel?.alias ?? ["defineModel"] },
22
+ defineSlots: { alias: options.defineSlots?.alias ?? ["defineSlots"] },
23
+ defineExpose: { alias: options.defineExpose?.alias ?? ["defineExpose"] },
24
+ defineStyle: { alias: options.defineStyle?.alias ?? ["defineStyle"] }
25
+ };
26
+ }
27
+ //#endregion
28
+ export { resolveOptions };
@@ -1,6 +1,5 @@
1
- const require_core = require('./core-CyGS7Va2.cjs');
2
- const require_options = require('./options-BMD1qLwt.cjs');
3
-
1
+ const require_core = require("./core-j6kwFyf2.cjs");
2
+ const require_options = require("./options.cjs");
4
3
  //#region src/core/style.ts
5
4
  let compileStyleAsync;
6
5
  async function getCompileStyleAsync() {
@@ -25,7 +24,6 @@ async function transformStyle(code, id, options) {
25
24
  scoped: query.get("scoped") === "true"
26
25
  })).code;
27
26
  }
28
-
29
27
  //#endregion
30
28
  //#region src/raw.ts
31
29
  const plugin = (userOptions = {}) => {
@@ -90,12 +88,10 @@ const plugin = (userOptions = {}) => {
90
88
  }
91
89
  }];
92
90
  };
93
- var raw_default = plugin;
94
-
95
91
  //#endregion
96
- Object.defineProperty(exports, 'raw_default', {
97
- enumerable: true,
98
- get: function () {
99
- return raw_default;
100
- }
101
- });
92
+ Object.defineProperty(exports, "plugin", {
93
+ enumerable: true,
94
+ get: function() {
95
+ return plugin;
96
+ }
97
+ });