vue-jsx-vapor 2.0.0

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 (70) hide show
  1. package/LICENSE +21 -0
  2. package/dist/api.cjs +12 -0
  3. package/dist/api.d.cts +22 -0
  4. package/dist/api.d.ts +22 -0
  5. package/dist/api.js +12 -0
  6. package/dist/astro.cjs +22 -0
  7. package/dist/astro.d.cts +13 -0
  8. package/dist/astro.d.ts +13 -0
  9. package/dist/astro.js +20 -0
  10. package/dist/chunk-2XDZG77D.js +41 -0
  11. package/dist/chunk-44HSQ6SC.js +10 -0
  12. package/dist/chunk-BPYHZ47Y.js +43 -0
  13. package/dist/chunk-CROZ7JES.cjs +41 -0
  14. package/dist/chunk-GODVM7NB.cjs +1 -0
  15. package/dist/chunk-I563YEVV.cjs +10 -0
  16. package/dist/chunk-IZRO67YR.cjs +56 -0
  17. package/dist/chunk-JGG42DZI.js +56 -0
  18. package/dist/chunk-JNAGPWSX.js +0 -0
  19. package/dist/chunk-M735SGJG.cjs +10 -0
  20. package/dist/chunk-MGTJQG6U.cjs +43 -0
  21. package/dist/chunk-YGTVDW3A.js +10 -0
  22. package/dist/esbuild.cjs +14 -0
  23. package/dist/esbuild.d.cts +9 -0
  24. package/dist/esbuild.d.ts +9 -0
  25. package/dist/esbuild.js +12 -0
  26. package/dist/index.cjs +5 -0
  27. package/dist/index.d.cts +1 -0
  28. package/dist/index.d.ts +1 -0
  29. package/dist/index.js +5 -0
  30. package/dist/nuxt.cjs +29 -0
  31. package/dist/nuxt.d.cts +11 -0
  32. package/dist/nuxt.d.ts +11 -0
  33. package/dist/nuxt.js +27 -0
  34. package/dist/options.cjs +1 -0
  35. package/dist/options.d.cts +18 -0
  36. package/dist/options.d.ts +18 -0
  37. package/dist/options.js +1 -0
  38. package/dist/raw.cjs +9 -0
  39. package/dist/raw.d.cts +9 -0
  40. package/dist/raw.d.ts +9 -0
  41. package/dist/raw.js +7 -0
  42. package/dist/rolldown.cjs +15 -0
  43. package/dist/rolldown.d.cts +9 -0
  44. package/dist/rolldown.d.ts +9 -0
  45. package/dist/rolldown.js +13 -0
  46. package/dist/rollup.cjs +14 -0
  47. package/dist/rollup.d.cts +9 -0
  48. package/dist/rollup.d.ts +9 -0
  49. package/dist/rollup.js +12 -0
  50. package/dist/rspack.cjs +14 -0
  51. package/dist/rspack.d.cts +8 -0
  52. package/dist/rspack.d.ts +8 -0
  53. package/dist/rspack.js +12 -0
  54. package/dist/unplugin.cjs +13 -0
  55. package/dist/unplugin.d.cts +11 -0
  56. package/dist/unplugin.d.ts +11 -0
  57. package/dist/unplugin.js +13 -0
  58. package/dist/vite.cjs +12 -0
  59. package/dist/vite.d.cts +9 -0
  60. package/dist/vite.d.ts +9 -0
  61. package/dist/vite.js +10 -0
  62. package/dist/volar.cjs +20 -0
  63. package/dist/volar.d.cts +9 -0
  64. package/dist/volar.d.ts +9 -0
  65. package/dist/volar.js +18 -0
  66. package/dist/webpack.cjs +12 -0
  67. package/dist/webpack.d.cts +9 -0
  68. package/dist/webpack.d.ts +9 -0
  69. package/dist/webpack.js +10 -0
  70. package/package.json +216 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023 zhiyuanzmj <https://github.com/zhiyuanzmj>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/dist/api.cjs ADDED
@@ -0,0 +1,12 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+
4
+
5
+
6
+ var _chunkCROZ7JEScjs = require('./chunk-CROZ7JES.cjs');
7
+
8
+
9
+
10
+
11
+
12
+ exports.helperCode = _chunkCROZ7JEScjs.helperCode; exports.helperId = _chunkCROZ7JEScjs.helperId; exports.helperPrefix = _chunkCROZ7JEScjs.helperPrefix; exports.transformVueJsxVapor = _chunkCROZ7JEScjs.transformVueJsxVapor;
package/dist/api.d.cts ADDED
@@ -0,0 +1,22 @@
1
+ import { Options } from './options.cjs';
2
+ import '@vue-jsx-vapor/compiler';
3
+ import '@vue-jsx-vapor/macros';
4
+ import 'unplugin-utils';
5
+
6
+ declare const helperCode: string;
7
+ declare const helperId: "vue-jsx-vapor/helper.js";
8
+ declare const helperPrefix: "vue-jsx-vapor/helper";
9
+ declare function transformVueJsxVapor(code: string, id: string, options?: Options): {
10
+ code: string;
11
+ map: {
12
+ version: number;
13
+ sources: string[];
14
+ names: string[];
15
+ sourceRoot?: string | undefined;
16
+ sourcesContent?: string[] | undefined;
17
+ mappings: string;
18
+ file: string;
19
+ } | null | undefined;
20
+ } | undefined;
21
+
22
+ export { Options, helperCode, helperId, helperPrefix, transformVueJsxVapor };
package/dist/api.d.ts ADDED
@@ -0,0 +1,22 @@
1
+ import { Options } from './options.js';
2
+ import '@vue-jsx-vapor/compiler';
3
+ import '@vue-jsx-vapor/macros';
4
+ import 'unplugin-utils';
5
+
6
+ declare const helperCode: string;
7
+ declare const helperId: "vue-jsx-vapor/helper.js";
8
+ declare const helperPrefix: "vue-jsx-vapor/helper";
9
+ declare function transformVueJsxVapor(code: string, id: string, options?: Options): {
10
+ code: string;
11
+ map: {
12
+ version: number;
13
+ sources: string[];
14
+ names: string[];
15
+ sourceRoot?: string | undefined;
16
+ sourcesContent?: string[] | undefined;
17
+ mappings: string;
18
+ file: string;
19
+ } | null | undefined;
20
+ } | undefined;
21
+
22
+ export { Options, helperCode, helperId, helperPrefix, transformVueJsxVapor };
package/dist/api.js ADDED
@@ -0,0 +1,12 @@
1
+ import {
2
+ helperCode,
3
+ helperId,
4
+ helperPrefix,
5
+ transformVueJsxVapor
6
+ } from "./chunk-2XDZG77D.js";
7
+ export {
8
+ helperCode,
9
+ helperId,
10
+ helperPrefix,
11
+ transformVueJsxVapor
12
+ };
package/dist/astro.cjs ADDED
@@ -0,0 +1,22 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+ var _chunkMGTJQG6Ucjs = require('./chunk-MGTJQG6U.cjs');
4
+ require('./chunk-GODVM7NB.cjs');
5
+ require('./chunk-IZRO67YR.cjs');
6
+ require('./chunk-CROZ7JES.cjs');
7
+
8
+ // src/astro.ts
9
+ var astro_default = (options) => ({
10
+ name: "vue-jsx-vapor",
11
+ hooks: {
12
+ "astro:config:setup": (astro) => {
13
+ astro.config.vite.plugins ||= [];
14
+ astro.config.vite.plugins.push(_chunkMGTJQG6Ucjs.unplugin_default.vite(options));
15
+ }
16
+ }
17
+ });
18
+
19
+
20
+ exports.default = astro_default;
21
+
22
+ module.exports = exports.default;
@@ -0,0 +1,13 @@
1
+ import { Options } from './options.cjs';
2
+ import '@vue-jsx-vapor/compiler';
3
+ import '@vue-jsx-vapor/macros';
4
+ import 'unplugin-utils';
5
+
6
+ declare const _default: (options: Options) => {
7
+ name: string;
8
+ hooks: {
9
+ 'astro:config:setup': (astro: any) => void;
10
+ };
11
+ };
12
+
13
+ export = _default;
@@ -0,0 +1,13 @@
1
+ import { Options } from './options.js';
2
+ import '@vue-jsx-vapor/compiler';
3
+ import '@vue-jsx-vapor/macros';
4
+ import 'unplugin-utils';
5
+
6
+ declare const _default: (options: Options) => {
7
+ name: string;
8
+ hooks: {
9
+ 'astro:config:setup': (astro: any) => void;
10
+ };
11
+ };
12
+
13
+ export { _default as default };
package/dist/astro.js ADDED
@@ -0,0 +1,20 @@
1
+ import {
2
+ unplugin_default
3
+ } from "./chunk-BPYHZ47Y.js";
4
+ import "./chunk-JNAGPWSX.js";
5
+ import "./chunk-JGG42DZI.js";
6
+ import "./chunk-2XDZG77D.js";
7
+
8
+ // src/astro.ts
9
+ var astro_default = (options) => ({
10
+ name: "vue-jsx-vapor",
11
+ hooks: {
12
+ "astro:config:setup": (astro) => {
13
+ astro.config.vite.plugins ||= [];
14
+ astro.config.vite.plugins.push(unplugin_default.vite(options));
15
+ }
16
+ }
17
+ });
18
+ export {
19
+ astro_default as default
20
+ };
@@ -0,0 +1,41 @@
1
+ // src/core/index.ts
2
+ import { transformSync } from "@babel/core";
3
+ import babelTypescript from "@babel/plugin-transform-typescript";
4
+ import jsx from "@vue-jsx-vapor/babel";
5
+
6
+ // src/core/helper/code.js?raw
7
+ var code_default = 'import {\n effectScope,\n insert,\n isFragment,\n remove,\n renderEffect,\n VaporFragment\n} from "vue";\nfunction createFragment(nodes) {\n const frag = new VaporFragment(nodes);\n frag.anchor = document.createTextNode("");\n return frag;\n}\nfunction normalizeValue(value) {\n return value == null || typeof value === "boolean" ? document.createTextNode("") : value instanceof Node || isFragment(value) ? value : Array.isArray(value) ? createFragment(value.map(normalizeValue)) : document.createTextNode(String(value));\n}\nfunction resolveValue(current, value) {\n const node = normalizeValue(value);\n if (current) {\n if (isFragment(current)) {\n const { anchor } = current;\n if (anchor.parentNode) {\n remove(current.nodes, anchor.parentNode);\n insert(node, anchor.parentNode, anchor);\n anchor.remove();\n }\n } else if (current.nodeType) {\n if (isFragment(node) && current.parentNode) {\n insert(node, current.parentNode, current);\n current.remove();\n } else if (current.nodeType === 3 && node.nodeType === 3) {\n current.textContent = node.textContent;\n return current;\n } else {\n current.parentNode.replaceChild(node, current);\n }\n }\n }\n return node;\n}\nfunction resolveValues(values = []) {\n const nodes = [];\n const scopes = [];\n for (const [index, value] of values.entries()) {\n if (typeof value === "function") {\n renderEffect(() => {\n if (scopes[index]) {\n scopes[index].stop();\n }\n scopes[index] = effectScope();\n scopes[index].run(() => {\n nodes[index] = resolveValue(nodes[index], value());\n });\n });\n } else {\n nodes[index] = resolveValue(nodes[index], value);\n }\n }\n return nodes;\n}\nexport function setText(parent, ...values) {\n insert(resolveValues(values), parent);\n}\nexport function createTextNode(...values) {\n return resolveValues(values);\n}\n';
8
+
9
+ // src/core/helper/index.ts
10
+ var helperPrefix = `vue-jsx-vapor/helper`;
11
+ var helperId = `${helperPrefix}.js`;
12
+
13
+ // src/core/index.ts
14
+ var helperCode = code_default;
15
+ var helperId2 = helperId;
16
+ var helperPrefix2 = helperPrefix;
17
+ function transformVueJsxVapor(code, id, options) {
18
+ const result = transformSync(code, {
19
+ plugins: [
20
+ [jsx, { compile: options?.compile, interop: options?.interop }],
21
+ id.endsWith(".tsx") ? [babelTypescript, { isTSX: true, allowExtensions: true }] : null
22
+ ].filter((i) => i !== null),
23
+ filename: id,
24
+ sourceMaps: true,
25
+ sourceFileName: id,
26
+ babelrc: false,
27
+ configFile: false
28
+ });
29
+ if (result?.code)
30
+ return {
31
+ code: result.code,
32
+ map: result.map
33
+ };
34
+ }
35
+
36
+ export {
37
+ helperCode,
38
+ helperId2 as helperId,
39
+ helperPrefix2 as helperPrefix,
40
+ transformVueJsxVapor
41
+ };
@@ -0,0 +1,10 @@
1
+ import {
2
+ unplugin_default
3
+ } from "./chunk-BPYHZ47Y.js";
4
+
5
+ // src/webpack.ts
6
+ var webpack_default = unplugin_default.webpack;
7
+
8
+ export {
9
+ webpack_default
10
+ };
@@ -0,0 +1,43 @@
1
+ import {
2
+ raw_default
3
+ } from "./chunk-JGG42DZI.js";
4
+
5
+ // src/unplugin.ts
6
+ import { createUnplugin } from "unplugin";
7
+ import { createFilter, transformWithEsbuild } from "vite";
8
+ var unpluginFactory = (options = {}) => {
9
+ return [
10
+ ...raw_default(options),
11
+ options.interop ? { name: "interop" } : {
12
+ name: "unplugin-esbuild",
13
+ transformInclude: createFilter(
14
+ options?.include || /\.[jt]sx$/,
15
+ options?.exclude
16
+ ),
17
+ transform(code, id) {
18
+ return transformWithEsbuild(code, id, {
19
+ target: "esnext",
20
+ charset: "utf8",
21
+ minify: false,
22
+ minifyIdentifiers: false,
23
+ minifySyntax: false,
24
+ minifyWhitespace: false,
25
+ treeShaking: false,
26
+ keepNames: false,
27
+ supported: {
28
+ "dynamic-import": true,
29
+ "import-meta": true
30
+ }
31
+ });
32
+ }
33
+ }
34
+ ];
35
+ };
36
+ var unplugin = /* @__PURE__ */ createUnplugin(unpluginFactory);
37
+ var unplugin_default = unplugin;
38
+
39
+ export {
40
+ unpluginFactory,
41
+ unplugin,
42
+ unplugin_default
43
+ };
@@ -0,0 +1,41 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 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; }// src/core/index.ts
2
+ var _core = require('@babel/core');
3
+ var _plugintransformtypescript = require('@babel/plugin-transform-typescript'); var _plugintransformtypescript2 = _interopRequireDefault(_plugintransformtypescript);
4
+ var _babel = require('@vue-jsx-vapor/babel'); var _babel2 = _interopRequireDefault(_babel);
5
+
6
+ // src/core/helper/code.js?raw
7
+ var code_default = 'import {\n effectScope,\n insert,\n isFragment,\n remove,\n renderEffect,\n VaporFragment\n} from "vue";\nfunction createFragment(nodes) {\n const frag = new VaporFragment(nodes);\n frag.anchor = document.createTextNode("");\n return frag;\n}\nfunction normalizeValue(value) {\n return value == null || typeof value === "boolean" ? document.createTextNode("") : value instanceof Node || isFragment(value) ? value : Array.isArray(value) ? createFragment(value.map(normalizeValue)) : document.createTextNode(String(value));\n}\nfunction resolveValue(current, value) {\n const node = normalizeValue(value);\n if (current) {\n if (isFragment(current)) {\n const { anchor } = current;\n if (anchor.parentNode) {\n remove(current.nodes, anchor.parentNode);\n insert(node, anchor.parentNode, anchor);\n anchor.remove();\n }\n } else if (current.nodeType) {\n if (isFragment(node) && current.parentNode) {\n insert(node, current.parentNode, current);\n current.remove();\n } else if (current.nodeType === 3 && node.nodeType === 3) {\n current.textContent = node.textContent;\n return current;\n } else {\n current.parentNode.replaceChild(node, current);\n }\n }\n }\n return node;\n}\nfunction resolveValues(values = []) {\n const nodes = [];\n const scopes = [];\n for (const [index, value] of values.entries()) {\n if (typeof value === "function") {\n renderEffect(() => {\n if (scopes[index]) {\n scopes[index].stop();\n }\n scopes[index] = effectScope();\n scopes[index].run(() => {\n nodes[index] = resolveValue(nodes[index], value());\n });\n });\n } else {\n nodes[index] = resolveValue(nodes[index], value);\n }\n }\n return nodes;\n}\nexport function setText(parent, ...values) {\n insert(resolveValues(values), parent);\n}\nexport function createTextNode(...values) {\n return resolveValues(values);\n}\n';
8
+
9
+ // src/core/helper/index.ts
10
+ var helperPrefix = `vue-jsx-vapor/helper`;
11
+ var helperId = `${helperPrefix}.js`;
12
+
13
+ // src/core/index.ts
14
+ var helperCode = code_default;
15
+ var helperId2 = helperId;
16
+ var helperPrefix2 = helperPrefix;
17
+ function transformVueJsxVapor(code, id, options) {
18
+ const result = _core.transformSync.call(void 0, code, {
19
+ plugins: [
20
+ [_babel2.default, { compile: _optionalChain([options, 'optionalAccess', _ => _.compile]), interop: _optionalChain([options, 'optionalAccess', _2 => _2.interop]) }],
21
+ id.endsWith(".tsx") ? [_plugintransformtypescript2.default, { isTSX: true, allowExtensions: true }] : null
22
+ ].filter((i) => i !== null),
23
+ filename: id,
24
+ sourceMaps: true,
25
+ sourceFileName: id,
26
+ babelrc: false,
27
+ configFile: false
28
+ });
29
+ if (_optionalChain([result, 'optionalAccess', _3 => _3.code]))
30
+ return {
31
+ code: result.code,
32
+ map: result.map
33
+ };
34
+ }
35
+
36
+
37
+
38
+
39
+
40
+
41
+ exports.helperCode = helperCode; exports.helperId = helperId2; exports.helperPrefix = helperPrefix2; exports.transformVueJsxVapor = transformVueJsxVapor;
@@ -0,0 +1 @@
1
+ "use strict";
@@ -0,0 +1,10 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+ var _chunkMGTJQG6Ucjs = require('./chunk-MGTJQG6U.cjs');
4
+
5
+ // src/vite.ts
6
+ var vite_default = _chunkMGTJQG6Ucjs.unplugin_default.vite;
7
+
8
+
9
+
10
+ exports.vite_default = vite_default;
@@ -0,0 +1,56 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); 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; }
2
+
3
+
4
+
5
+
6
+ var _chunkCROZ7JEScjs = require('./chunk-CROZ7JES.cjs');
7
+
8
+ // src/raw.ts
9
+ var _raw = require('@vue-jsx-vapor/macros/raw'); var _raw2 = _interopRequireDefault(_raw);
10
+ var _unpluginutils = require('unplugin-utils');
11
+ var plugin = (options = {}) => {
12
+ const transformInclude = _unpluginutils.createFilter.call(void 0,
13
+ _optionalChain([options, 'optionalAccess', _ => _.include]) || /\.[cm]?[jt]sx?$/,
14
+ _optionalChain([options, 'optionalAccess', _2 => _2.exclude])
15
+ );
16
+ return [
17
+ {
18
+ name: "vue-jsx-vapor",
19
+ vite: {
20
+ config(config) {
21
+ return {
22
+ // only apply esbuild to ts files
23
+ // since we are handling jsx and tsx now
24
+ esbuild: {
25
+ include: /\.ts$/
26
+ },
27
+ define: {
28
+ __VUE_OPTIONS_API__: _nullishCoalesce(_optionalChain([config, 'access', _3 => _3.define, 'optionalAccess', _4 => _4.__VUE_OPTIONS_API__]), () => ( true)),
29
+ __VUE_PROD_DEVTOOLS__: _nullishCoalesce(_optionalChain([config, 'access', _5 => _5.define, 'optionalAccess', _6 => _6.__VUE_PROD_DEVTOOLS__]), () => ( false)),
30
+ __VUE_PROD_HYDRATION_MISMATCH_DETAILS__: _nullishCoalesce(_optionalChain([config, 'access', _7 => _7.define, 'optionalAccess', _8 => _8.__VUE_PROD_HYDRATION_MISMATCH_DETAILS__]), () => ( false))
31
+ }
32
+ };
33
+ }
34
+ },
35
+ resolveId(id) {
36
+ if (_unpluginutils.normalizePath.call(void 0, id).startsWith(_chunkCROZ7JEScjs.helperPrefix)) return id;
37
+ },
38
+ loadInclude(id) {
39
+ return _unpluginutils.normalizePath.call(void 0, id).startsWith(_chunkCROZ7JEScjs.helperPrefix);
40
+ },
41
+ load(id) {
42
+ if (_unpluginutils.normalizePath.call(void 0, id) === _chunkCROZ7JEScjs.helperId) return _chunkCROZ7JEScjs.helperCode;
43
+ },
44
+ transformInclude,
45
+ transform(code, id) {
46
+ return _chunkCROZ7JEScjs.transformVueJsxVapor.call(void 0, code, id, options);
47
+ }
48
+ },
49
+ ...options.macros === false ? [] : options.macros ? [_raw2.default.call(void 0, options.macros === true ? void 0 : options.macros)] : []
50
+ ];
51
+ };
52
+ var raw_default = plugin;
53
+
54
+
55
+
56
+ exports.raw_default = raw_default;
@@ -0,0 +1,56 @@
1
+ import {
2
+ helperCode,
3
+ helperId,
4
+ helperPrefix,
5
+ transformVueJsxVapor
6
+ } from "./chunk-2XDZG77D.js";
7
+
8
+ // src/raw.ts
9
+ import Macros from "@vue-jsx-vapor/macros/raw";
10
+ import { createFilter, normalizePath } from "unplugin-utils";
11
+ var plugin = (options = {}) => {
12
+ const transformInclude = createFilter(
13
+ options?.include || /\.[cm]?[jt]sx?$/,
14
+ options?.exclude
15
+ );
16
+ return [
17
+ {
18
+ name: "vue-jsx-vapor",
19
+ vite: {
20
+ config(config) {
21
+ return {
22
+ // only apply esbuild to ts files
23
+ // since we are handling jsx and tsx now
24
+ esbuild: {
25
+ include: /\.ts$/
26
+ },
27
+ define: {
28
+ __VUE_OPTIONS_API__: config.define?.__VUE_OPTIONS_API__ ?? true,
29
+ __VUE_PROD_DEVTOOLS__: config.define?.__VUE_PROD_DEVTOOLS__ ?? false,
30
+ __VUE_PROD_HYDRATION_MISMATCH_DETAILS__: config.define?.__VUE_PROD_HYDRATION_MISMATCH_DETAILS__ ?? false
31
+ }
32
+ };
33
+ }
34
+ },
35
+ resolveId(id) {
36
+ if (normalizePath(id).startsWith(helperPrefix)) return id;
37
+ },
38
+ loadInclude(id) {
39
+ return normalizePath(id).startsWith(helperPrefix);
40
+ },
41
+ load(id) {
42
+ if (normalizePath(id) === helperId) return helperCode;
43
+ },
44
+ transformInclude,
45
+ transform(code, id) {
46
+ return transformVueJsxVapor(code, id, options);
47
+ }
48
+ },
49
+ ...options.macros === false ? [] : options.macros ? [Macros(options.macros === true ? void 0 : options.macros)] : []
50
+ ];
51
+ };
52
+ var raw_default = plugin;
53
+
54
+ export {
55
+ raw_default
56
+ };
File without changes
@@ -0,0 +1,10 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+ var _chunkMGTJQG6Ucjs = require('./chunk-MGTJQG6U.cjs');
4
+
5
+ // src/webpack.ts
6
+ var webpack_default = _chunkMGTJQG6Ucjs.unplugin_default.webpack;
7
+
8
+
9
+
10
+ exports.webpack_default = webpack_default;
@@ -0,0 +1,43 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); 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; }
2
+
3
+ var _chunkIZRO67YRcjs = require('./chunk-IZRO67YR.cjs');
4
+
5
+ // src/unplugin.ts
6
+ var _unplugin = require('unplugin');
7
+ var _vite = require('vite');
8
+ var unpluginFactory = (options = {}) => {
9
+ return [
10
+ ..._chunkIZRO67YRcjs.raw_default.call(void 0, options),
11
+ options.interop ? { name: "interop" } : {
12
+ name: "unplugin-esbuild",
13
+ transformInclude: _vite.createFilter.call(void 0,
14
+ _optionalChain([options, 'optionalAccess', _ => _.include]) || /\.[jt]sx$/,
15
+ _optionalChain([options, 'optionalAccess', _2 => _2.exclude])
16
+ ),
17
+ transform(code, id) {
18
+ return _vite.transformWithEsbuild.call(void 0, code, id, {
19
+ target: "esnext",
20
+ charset: "utf8",
21
+ minify: false,
22
+ minifyIdentifiers: false,
23
+ minifySyntax: false,
24
+ minifyWhitespace: false,
25
+ treeShaking: false,
26
+ keepNames: false,
27
+ supported: {
28
+ "dynamic-import": true,
29
+ "import-meta": true
30
+ }
31
+ });
32
+ }
33
+ }
34
+ ];
35
+ };
36
+ var unplugin = /* @__PURE__ */ _unplugin.createUnplugin.call(void 0, unpluginFactory);
37
+ var unplugin_default = unplugin;
38
+
39
+
40
+
41
+
42
+
43
+ exports.unpluginFactory = unpluginFactory; exports.unplugin = unplugin; exports.unplugin_default = unplugin_default;
@@ -0,0 +1,10 @@
1
+ import {
2
+ unplugin_default
3
+ } from "./chunk-BPYHZ47Y.js";
4
+
5
+ // src/vite.ts
6
+ var vite_default = unplugin_default.vite;
7
+
8
+ export {
9
+ vite_default
10
+ };
@@ -0,0 +1,14 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+ var _chunkMGTJQG6Ucjs = require('./chunk-MGTJQG6U.cjs');
4
+ require('./chunk-GODVM7NB.cjs');
5
+ require('./chunk-IZRO67YR.cjs');
6
+ require('./chunk-CROZ7JES.cjs');
7
+
8
+ // src/esbuild.ts
9
+ var esbuild_default = _chunkMGTJQG6Ucjs.unplugin_default.esbuild;
10
+
11
+
12
+ exports.default = esbuild_default;
13
+
14
+ module.exports = exports.default;
@@ -0,0 +1,9 @@
1
+ import * as esbuild from 'esbuild';
2
+ import { Options } from './options.cjs';
3
+ import '@vue-jsx-vapor/compiler';
4
+ import '@vue-jsx-vapor/macros';
5
+ import 'unplugin-utils';
6
+
7
+ declare const _default: (options?: Options | undefined) => esbuild.Plugin;
8
+
9
+ export = _default;
@@ -0,0 +1,9 @@
1
+ import * as esbuild from 'esbuild';
2
+ import { Options } from './options.js';
3
+ import '@vue-jsx-vapor/compiler';
4
+ import '@vue-jsx-vapor/macros';
5
+ import 'unplugin-utils';
6
+
7
+ declare const _default: (options?: Options | undefined) => esbuild.Plugin;
8
+
9
+ export { _default as default };
@@ -0,0 +1,12 @@
1
+ import {
2
+ unplugin_default
3
+ } from "./chunk-BPYHZ47Y.js";
4
+ import "./chunk-JNAGPWSX.js";
5
+ import "./chunk-JGG42DZI.js";
6
+ import "./chunk-2XDZG77D.js";
7
+
8
+ // src/esbuild.ts
9
+ var esbuild_default = unplugin_default.esbuild;
10
+ export {
11
+ esbuild_default as default
12
+ };
package/dist/index.cjs ADDED
@@ -0,0 +1,5 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/index.ts
2
+ var _vue = require('vue');
3
+
4
+
5
+ exports.useRef = _vue.shallowRef;
@@ -0,0 +1 @@
1
+ export { shallowRef as useRef } from 'vue';
@@ -0,0 +1 @@
1
+ export { shallowRef as useRef } from 'vue';
package/dist/index.js ADDED
@@ -0,0 +1,5 @@
1
+ // src/index.ts
2
+ import { shallowRef } from "vue";
3
+ export {
4
+ shallowRef as useRef
5
+ };
package/dist/nuxt.cjs ADDED
@@ -0,0 +1,29 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+ var _chunkI563YEVVcjs = require('./chunk-I563YEVV.cjs');
4
+
5
+
6
+ var _chunkM735SGJGcjs = require('./chunk-M735SGJG.cjs');
7
+ require('./chunk-MGTJQG6U.cjs');
8
+ require('./chunk-GODVM7NB.cjs');
9
+ require('./chunk-IZRO67YR.cjs');
10
+ require('./chunk-CROZ7JES.cjs');
11
+
12
+ // src/nuxt.ts
13
+ var _kit = require('@nuxt/kit');
14
+ require('@nuxt/schema');
15
+ var nuxt_default = _kit.defineNuxtModule.call(void 0, {
16
+ meta: {
17
+ name: "nuxt-vue-jsx-vapor",
18
+ configKey: "unpluginStarter"
19
+ },
20
+ setup(options) {
21
+ _kit.addVitePlugin.call(void 0, () => _chunkI563YEVVcjs.vite_default.call(void 0, options));
22
+ _kit.addWebpackPlugin.call(void 0, () => _chunkM735SGJGcjs.webpack_default.call(void 0, options));
23
+ }
24
+ });
25
+
26
+
27
+ exports.default = nuxt_default;
28
+
29
+ module.exports = exports.default;
@@ -0,0 +1,11 @@
1
+ import * as _nuxt_schema from '@nuxt/schema';
2
+ import { Options } from './options.cjs';
3
+ import '@vue-jsx-vapor/compiler';
4
+ import '@vue-jsx-vapor/macros';
5
+ import 'unplugin-utils';
6
+
7
+ interface ModuleOptions extends Options {
8
+ }
9
+ declare const _default: _nuxt_schema.NuxtModule<ModuleOptions, ModuleOptions, false>;
10
+
11
+ export { type ModuleOptions, _default as default };
package/dist/nuxt.d.ts ADDED
@@ -0,0 +1,11 @@
1
+ import * as _nuxt_schema from '@nuxt/schema';
2
+ import { Options } from './options.js';
3
+ import '@vue-jsx-vapor/compiler';
4
+ import '@vue-jsx-vapor/macros';
5
+ import 'unplugin-utils';
6
+
7
+ interface ModuleOptions extends Options {
8
+ }
9
+ declare const _default: _nuxt_schema.NuxtModule<ModuleOptions, ModuleOptions, false>;
10
+
11
+ export { type ModuleOptions, _default as default };