@vue-jsx-vapor/macros 2.2.0 → 2.3.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.
- package/dist/api.cjs +2 -2
- package/dist/api.js +1 -1
- package/dist/astro.cjs +4 -4
- package/dist/astro.js +3 -3
- package/dist/{chunk-LVZNHMZC.js → chunk-AUE5EAQA.js} +1 -1
- package/dist/{chunk-WOWB5VHY.js → chunk-E5WGUCGE.js} +5 -2
- package/dist/{chunk-WZIZSQGW.js → chunk-HBVQYNJJ.js} +1 -1
- package/dist/{chunk-YCL7HGD4.cjs → chunk-KUKYWPEK.cjs} +2 -2
- package/dist/{chunk-JWJVYLYI.cjs → chunk-L26STXZK.cjs} +2 -2
- package/dist/{chunk-NL4CWOW2.cjs → chunk-PWA6BBMQ.cjs} +2 -2
- package/dist/{chunk-TWP2JCYQ.js → chunk-SMWNQXL7.js} +21 -2
- package/dist/{chunk-35H4MC4N.cjs → chunk-UAWFIGPX.cjs} +11 -8
- package/dist/{chunk-LPH34H6O.cjs → chunk-ZQ4GVJKX.cjs} +40 -21
- package/dist/{chunk-RC5ZHWIN.js → chunk-ZXJQCFZZ.js} +1 -1
- package/dist/esbuild.cjs +4 -4
- package/dist/esbuild.js +3 -3
- package/dist/index.cjs +4 -4
- package/dist/index.js +3 -3
- package/dist/nuxt.cjs +7 -7
- package/dist/nuxt.js +5 -5
- package/dist/options.d.cts +1 -0
- package/dist/options.d.ts +1 -0
- package/dist/raw.cjs +3 -3
- package/dist/raw.js +2 -2
- package/dist/rolldown.cjs +4 -4
- package/dist/rolldown.js +3 -3
- package/dist/rollup.cjs +4 -4
- package/dist/rollup.js +3 -3
- package/dist/rspack.cjs +4 -4
- package/dist/rspack.js +3 -3
- package/dist/vite.cjs +5 -5
- package/dist/vite.js +4 -4
- package/dist/webpack.cjs +5 -5
- package/dist/webpack.js +4 -4
- package/package.json +1 -1
package/dist/api.cjs
CHANGED
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkZQ4GVJKXcjs = require('./chunk-ZQ4GVJKX.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
exports.getMacroExpression =
|
|
14
|
+
exports.getMacroExpression = _chunkZQ4GVJKXcjs.getMacroExpression; exports.getParamsStart = _chunkZQ4GVJKXcjs.getParamsStart; exports.isFunctionalNode = _chunkZQ4GVJKXcjs.isFunctionalNode; exports.restructure = _chunkZQ4GVJKXcjs.restructure; exports.transformJsxMacros = _chunkZQ4GVJKXcjs.transformJsxMacros;
|
package/dist/api.js
CHANGED
package/dist/astro.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
5
|
-
require('./chunk-
|
|
3
|
+
var _chunkL26STXZKcjs = require('./chunk-L26STXZK.cjs');
|
|
4
|
+
require('./chunk-UAWFIGPX.cjs');
|
|
5
|
+
require('./chunk-ZQ4GVJKX.cjs');
|
|
6
6
|
require('./chunk-53TNKVYD.cjs');
|
|
7
7
|
|
|
8
8
|
// src/astro.ts
|
|
@@ -11,7 +11,7 @@ var astro_default = (options) => ({
|
|
|
11
11
|
hooks: {
|
|
12
12
|
"astro:config:setup": (astro) => {
|
|
13
13
|
astro.config.vite.plugins ||= [];
|
|
14
|
-
astro.config.vite.plugins.push(
|
|
14
|
+
astro.config.vite.plugins.push(_chunkL26STXZKcjs.index_default.vite(options));
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
});
|
package/dist/astro.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
index_default
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-AUE5EAQA.js";
|
|
4
|
+
import "./chunk-E5WGUCGE.js";
|
|
5
|
+
import "./chunk-SMWNQXL7.js";
|
|
6
6
|
import "./chunk-DANY2WQD.js";
|
|
7
7
|
|
|
8
8
|
// src/astro.ts
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
use_model_default,
|
|
6
6
|
withDefaultsHelperId,
|
|
7
7
|
with_defaults_default
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-SMWNQXL7.js";
|
|
9
9
|
import {
|
|
10
10
|
resolveOptions
|
|
11
11
|
} from "./chunk-DANY2WQD.js";
|
|
@@ -52,7 +52,10 @@ var plugin = (userOptions = {}) => {
|
|
|
52
52
|
if (importMap.get(id)) return true;
|
|
53
53
|
return filter(id);
|
|
54
54
|
},
|
|
55
|
-
transform(code, id) {
|
|
55
|
+
transform(code, id, opt) {
|
|
56
|
+
if (opt?.ssr) {
|
|
57
|
+
options.defineComponent.autoReturnFunction = true;
|
|
58
|
+
}
|
|
56
59
|
if (importMap.get(id)) return transformStyle(code, id, options);
|
|
57
60
|
return transformJsxMacros(code, id, importMap, options);
|
|
58
61
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkL26STXZKcjs = require('./chunk-L26STXZK.cjs');
|
|
4
4
|
|
|
5
5
|
// src/vite.ts
|
|
6
|
-
var vite_default =
|
|
6
|
+
var vite_default = _chunkL26STXZKcjs.index_default.vite;
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkUAWFIGPXcjs = require('./chunk-UAWFIGPX.cjs');
|
|
4
4
|
|
|
5
5
|
// src/index.ts
|
|
6
6
|
var _unplugin = require('unplugin');
|
|
7
|
-
var unplugin = _unplugin.createUnplugin.call(void 0,
|
|
7
|
+
var unplugin = _unplugin.createUnplugin.call(void 0, _chunkUAWFIGPXcjs.raw_default);
|
|
8
8
|
var index_default = unplugin;
|
|
9
9
|
|
|
10
10
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkL26STXZKcjs = require('./chunk-L26STXZK.cjs');
|
|
4
4
|
|
|
5
5
|
// src/webpack.ts
|
|
6
|
-
var webpack_default =
|
|
6
|
+
var webpack_default = _chunkL26STXZKcjs.index_default.webpack;
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
@@ -240,8 +240,18 @@ function processAwait(s, node, needSemi, isStatement) {
|
|
|
240
240
|
);
|
|
241
241
|
}
|
|
242
242
|
|
|
243
|
+
// src/core/define-component/return.ts
|
|
244
|
+
function transformReturn(root, s) {
|
|
245
|
+
const node = root.body.type === "BlockStatement" ? root.body.body.find((node2) => node2.type === "ReturnStatement")?.argument : root.body;
|
|
246
|
+
if (!node || isFunctionalNode(node)) return;
|
|
247
|
+
s.appendRight(
|
|
248
|
+
node.extra?.parenthesized ? node.extra.parenStart : node.start,
|
|
249
|
+
"() => "
|
|
250
|
+
);
|
|
251
|
+
}
|
|
252
|
+
|
|
243
253
|
// src/core/define-component/index.ts
|
|
244
|
-
function transformDefineComponent(root, propsName, map, s) {
|
|
254
|
+
function transformDefineComponent(root, propsName, map, s, autoReturnFunction = false) {
|
|
245
255
|
if (!map.defineComponent) return;
|
|
246
256
|
const defineComponentName = s.sliceNode(map.defineComponent.callee);
|
|
247
257
|
if (defineComponentName && !["defineComponent", "defineVaporComponent"].includes(defineComponentName)) {
|
|
@@ -299,6 +309,9 @@ function transformDefineComponent(root, propsName, map, s) {
|
|
|
299
309
|
}
|
|
300
310
|
}
|
|
301
311
|
transformAwait(root, s);
|
|
312
|
+
if (autoReturnFunction) {
|
|
313
|
+
transformReturn(root, s);
|
|
314
|
+
}
|
|
302
315
|
}
|
|
303
316
|
function prependObjectExpression(argument, name, value, s) {
|
|
304
317
|
if (!argument.properties?.find(
|
|
@@ -463,7 +476,13 @@ function transformJsxMacros(code, id, importMap, options) {
|
|
|
463
476
|
s.appendRight(getParamsStart(root, s.original), propsName);
|
|
464
477
|
}
|
|
465
478
|
if (map.defineComponent) {
|
|
466
|
-
transformDefineComponent(
|
|
479
|
+
transformDefineComponent(
|
|
480
|
+
root,
|
|
481
|
+
propsName,
|
|
482
|
+
map,
|
|
483
|
+
s,
|
|
484
|
+
options.defineComponent?.autoReturnFunction
|
|
485
|
+
);
|
|
467
486
|
}
|
|
468
487
|
if (map.defineModel?.length) {
|
|
469
488
|
map.defineModel.forEach(({ expression }) => {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
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
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _chunkZQ4GVJKXcjs = require('./chunk-ZQ4GVJKX.cjs');
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
var _chunk53TNKVYDcjs = require('./chunk-53TNKVYD.cjs');
|
|
@@ -37,24 +37,27 @@ var plugin = (userOptions = {}) => {
|
|
|
37
37
|
name,
|
|
38
38
|
enforce: "pre",
|
|
39
39
|
resolveId(id) {
|
|
40
|
-
if (_common.normalizePath.call(void 0, id).startsWith(
|
|
40
|
+
if (_common.normalizePath.call(void 0, id).startsWith(_chunkZQ4GVJKXcjs.helperPrefix)) return id;
|
|
41
41
|
},
|
|
42
42
|
loadInclude(id) {
|
|
43
|
-
return _common.normalizePath.call(void 0, id).startsWith(
|
|
43
|
+
return _common.normalizePath.call(void 0, id).startsWith(_chunkZQ4GVJKXcjs.helperPrefix);
|
|
44
44
|
},
|
|
45
45
|
load(_id) {
|
|
46
46
|
const id = _common.normalizePath.call(void 0, _id);
|
|
47
|
-
if (id ===
|
|
48
|
-
else if (id ===
|
|
47
|
+
if (id === _chunkZQ4GVJKXcjs.useModelHelperId) return _chunkZQ4GVJKXcjs.use_model_default;
|
|
48
|
+
else if (id === _chunkZQ4GVJKXcjs.withDefaultsHelperId) return _chunkZQ4GVJKXcjs.with_defaults_default;
|
|
49
49
|
else if (importMap.get(id)) return importMap.get(id);
|
|
50
50
|
},
|
|
51
51
|
transformInclude(id) {
|
|
52
52
|
if (importMap.get(id)) return true;
|
|
53
53
|
return filter(id);
|
|
54
54
|
},
|
|
55
|
-
transform(code, id) {
|
|
55
|
+
transform(code, id, opt) {
|
|
56
|
+
if (_optionalChain([opt, 'optionalAccess', _ => _.ssr])) {
|
|
57
|
+
options.defineComponent.autoReturnFunction = true;
|
|
58
|
+
}
|
|
56
59
|
if (importMap.get(id)) return transformStyle(code, id, options);
|
|
57
|
-
return
|
|
60
|
+
return _chunkZQ4GVJKXcjs.transformJsxMacros.call(void 0, code, id, importMap, options);
|
|
58
61
|
}
|
|
59
62
|
};
|
|
60
63
|
};
|
|
@@ -240,8 +240,18 @@ function processAwait(s, node, needSemi, isStatement) {
|
|
|
240
240
|
);
|
|
241
241
|
}
|
|
242
242
|
|
|
243
|
+
// src/core/define-component/return.ts
|
|
244
|
+
function transformReturn(root, s) {
|
|
245
|
+
const node = root.body.type === "BlockStatement" ? _optionalChain([root, 'access', _13 => _13.body, 'access', _14 => _14.body, 'access', _15 => _15.find, 'call', _16 => _16((node2) => node2.type === "ReturnStatement"), 'optionalAccess', _17 => _17.argument]) : root.body;
|
|
246
|
+
if (!node || isFunctionalNode(node)) return;
|
|
247
|
+
s.appendRight(
|
|
248
|
+
_optionalChain([node, 'access', _18 => _18.extra, 'optionalAccess', _19 => _19.parenthesized]) ? node.extra.parenStart : node.start,
|
|
249
|
+
"() => "
|
|
250
|
+
);
|
|
251
|
+
}
|
|
252
|
+
|
|
243
253
|
// src/core/define-component/index.ts
|
|
244
|
-
function transformDefineComponent(root, propsName, map, s) {
|
|
254
|
+
function transformDefineComponent(root, propsName, map, s, autoReturnFunction = false) {
|
|
245
255
|
if (!map.defineComponent) return;
|
|
246
256
|
const defineComponentName = s.sliceNode(map.defineComponent.callee);
|
|
247
257
|
if (defineComponentName && !["defineComponent", "defineVaporComponent"].includes(defineComponentName)) {
|
|
@@ -270,15 +280,15 @@ function transformDefineComponent(root, propsName, map, s) {
|
|
|
270
280
|
}
|
|
271
281
|
}
|
|
272
282
|
for (const { expression, isRequired } of map.defineModel || []) {
|
|
273
|
-
const modelOptions = _optionalChain([expression, 'access',
|
|
283
|
+
const modelOptions = _optionalChain([expression, 'access', _20 => _20.arguments, 'access', _21 => _21[0], 'optionalAccess', _22 => _22.type]) === "ObjectExpression" ? expression.arguments[0] : _optionalChain([expression, 'access', _23 => _23.arguments, 'access', _24 => _24[1], 'optionalAccess', _25 => _25.type]) === "ObjectExpression" ? expression.arguments[1] : void 0;
|
|
274
284
|
const options = {};
|
|
275
285
|
if (isRequired) options.required = true;
|
|
276
|
-
for (const prop of _optionalChain([modelOptions, 'optionalAccess',
|
|
286
|
+
for (const prop of _optionalChain([modelOptions, 'optionalAccess', _26 => _26.properties]) || []) {
|
|
277
287
|
if (prop.type === "ObjectProperty" && prop.key.type === "Identifier" && ["validator", "type", "required"].includes(prop.key.name)) {
|
|
278
288
|
options[prop.key.name] = s.sliceNode(prop.value);
|
|
279
289
|
}
|
|
280
290
|
}
|
|
281
|
-
const propName = _optionalChain([expression, 'access',
|
|
291
|
+
const propName = _optionalChain([expression, 'access', _27 => _27.arguments, 'access', _28 => _28[0], 'optionalAccess', _29 => _29.type]) === "StringLiteral" ? expression.arguments[0].value : "modelValue";
|
|
282
292
|
props[propName] = Object.keys(options).length ? `{ ${Object.entries(options).map(([key, value]) => `${key}: ${value}`).join(", ")} }` : null;
|
|
283
293
|
props[`onUpdate:${propName}`] = null;
|
|
284
294
|
props[`${propName === "modelValue" ? "model" : propName}Modifiers`] = null;
|
|
@@ -299,9 +309,12 @@ function transformDefineComponent(root, propsName, map, s) {
|
|
|
299
309
|
}
|
|
300
310
|
}
|
|
301
311
|
transformAwait(root, s);
|
|
312
|
+
if (autoReturnFunction) {
|
|
313
|
+
transformReturn(root, s);
|
|
314
|
+
}
|
|
302
315
|
}
|
|
303
316
|
function prependObjectExpression(argument, name, value, s) {
|
|
304
|
-
if (!_optionalChain([argument, 'access',
|
|
317
|
+
if (!_optionalChain([argument, 'access', _30 => _30.properties, 'optionalAccess', _31 => _31.find, 'call', _32 => _32(
|
|
305
318
|
(prop) => prop.type === "ObjectProperty" && prop.key.type === "Identifier" && prop.key.name === name
|
|
306
319
|
)])) {
|
|
307
320
|
s.appendRight(argument.start + 1, `${name}: ${value},`);
|
|
@@ -312,7 +325,7 @@ function getWalkedIds(root, propsName) {
|
|
|
312
325
|
_compilersfc.walkIdentifiers.call(void 0,
|
|
313
326
|
root.body,
|
|
314
327
|
(id, parent) => {
|
|
315
|
-
if (id.name === propsName && (_optionalChain([parent, 'optionalAccess',
|
|
328
|
+
if (id.name === propsName && (_optionalChain([parent, 'optionalAccess', _33 => _33.type]) === "MemberExpression" || _optionalChain([parent, 'optionalAccess', _34 => _34.type]) === "OptionalMemberExpression")) {
|
|
316
329
|
const prop = parent.property.type === "Identifier" ? parent.property.name : parent.property.type === "StringLiteral" ? parent.property.value : "";
|
|
317
330
|
if (prop) walkedIds.add(prop);
|
|
318
331
|
}
|
|
@@ -327,7 +340,7 @@ function getWalkedIds(root, propsName) {
|
|
|
327
340
|
function transformDefineExpose(node, s, version) {
|
|
328
341
|
s.overwriteNode(node.callee, ";");
|
|
329
342
|
s.appendRight(
|
|
330
|
-
_optionalChain([node, 'access',
|
|
343
|
+
_optionalChain([node, 'access', _35 => _35.arguments, 'access', _36 => _36[0], 'optionalAccess', _37 => _37.start]) || node.end - 1,
|
|
331
344
|
version >= 3.6 ? `${_common.importHelperFn.call(void 0, s, 0, "currentInstance")}.exposed = ` : `${_common.importHelperFn.call(void 0, s, 0, "getCurrentInstance")}().exposed = `
|
|
332
345
|
);
|
|
333
346
|
}
|
|
@@ -340,8 +353,8 @@ function transformDefineModel(node, propsName, s) {
|
|
|
340
353
|
_common.importHelperFn.call(void 0, s, 0, "useModel", void 0, useModelHelperId)
|
|
341
354
|
);
|
|
342
355
|
s.appendRight(
|
|
343
|
-
_optionalChain([node, 'access',
|
|
344
|
-
`${propsName}, ${_optionalChain([node, 'access',
|
|
356
|
+
_optionalChain([node, 'access', _38 => _38.arguments, 'access', _39 => _39[0], 'optionalAccess', _40 => _40.start]) || node.end - 1,
|
|
357
|
+
`${propsName}, ${_optionalChain([node, 'access', _41 => _41.arguments, 'access', _42 => _42[0], 'optionalAccess', _43 => _43.type]) !== "StringLiteral" ? `'modelValue',` : ""}`
|
|
345
358
|
);
|
|
346
359
|
}
|
|
347
360
|
|
|
@@ -350,7 +363,7 @@ function transformDefineModel(node, propsName, s) {
|
|
|
350
363
|
function transformDefineSlots(node, s) {
|
|
351
364
|
s.overwrite(
|
|
352
365
|
node.start,
|
|
353
|
-
_optionalChain([node, 'access',
|
|
366
|
+
_optionalChain([node, 'access', _44 => _44.arguments, 'access', _45 => _45[0], 'optionalAccess', _46 => _46.start]) && node.arguments[0].start - 1 || _optionalChain([node, 'access', _47 => _47.typeArguments, 'optionalAccess', _48 => _48.end]) || node.callee.end,
|
|
354
367
|
`Object.assign`
|
|
355
368
|
);
|
|
356
369
|
const slots = `${_common.importHelperFn.call(void 0, s, 0, "useSlots")}()`;
|
|
@@ -362,7 +375,7 @@ function transformDefineSlots(node, s) {
|
|
|
362
375
|
var _hashsum = require('hash-sum'); var _hashsum2 = _interopRequireDefault(_hashsum);
|
|
363
376
|
function transformDefineStyle(defineStyle, index, root, s, importMap) {
|
|
364
377
|
const { expression, lang, isDeclaration } = defineStyle;
|
|
365
|
-
if (_optionalChain([expression, 'access',
|
|
378
|
+
if (_optionalChain([expression, 'access', _49 => _49.arguments, 'access', _50 => _50[0], 'optionalAccess', _51 => _51.type]) !== "TemplateLiteral") return;
|
|
366
379
|
let css = s.sliceNode(expression.arguments[0]).slice(1, -1);
|
|
367
380
|
const scopeId = _hashsum2.default.call(void 0, css);
|
|
368
381
|
const vars = /* @__PURE__ */ new Map();
|
|
@@ -389,7 +402,7 @@ function transformDefineStyle(defineStyle, index, root, s, importMap) {
|
|
|
389
402
|
}
|
|
390
403
|
}
|
|
391
404
|
let scoped = !!root;
|
|
392
|
-
if (_optionalChain([expression, 'access',
|
|
405
|
+
if (_optionalChain([expression, 'access', _52 => _52.arguments, 'access', _53 => _53[1], 'optionalAccess', _54 => _54.type]) === "ObjectExpression") {
|
|
393
406
|
for (const prop of expression.arguments[1].properties) {
|
|
394
407
|
if (prop.type === "ObjectProperty" && prop.key.type === "Identifier" && prop.key.name === "scoped" && prop.value.type === "BooleanLiteral") {
|
|
395
408
|
scoped = prop.value.value;
|
|
@@ -440,7 +453,7 @@ function transformJsxMacros(code, id, importMap, options) {
|
|
|
440
453
|
const rootMap = getRootMap(ast, s, options);
|
|
441
454
|
let defineStyleIndex = 0;
|
|
442
455
|
for (const [root, map] of rootMap) {
|
|
443
|
-
_optionalChain([map, 'access',
|
|
456
|
+
_optionalChain([map, 'access', _55 => _55.defineStyle, 'optionalAccess', _56 => _56.forEach, 'call', _57 => _57((defineStyle) => {
|
|
444
457
|
transformDefineStyle(defineStyle, defineStyleIndex++, root, s, importMap);
|
|
445
458
|
})]);
|
|
446
459
|
if (root === void 0) continue;
|
|
@@ -450,12 +463,12 @@ function transformJsxMacros(code, id, importMap, options) {
|
|
|
450
463
|
propsName = root.params[0].name;
|
|
451
464
|
} else if (root.params[0].type === "ObjectPattern") {
|
|
452
465
|
const lastProp = root.params[0].properties.at(-1);
|
|
453
|
-
if (!map.defineComponent && _optionalChain([lastProp, 'optionalAccess',
|
|
466
|
+
if (!map.defineComponent && _optionalChain([lastProp, 'optionalAccess', _58 => _58.type]) === "RestElement" && lastProp.argument.type === "Identifier") {
|
|
454
467
|
propsName = lastProp.argument.name;
|
|
455
468
|
} else {
|
|
456
469
|
s.appendRight(
|
|
457
|
-
_optionalChain([root, 'access',
|
|
458
|
-
`${!_optionalChain([root, 'access',
|
|
470
|
+
_optionalChain([root, 'access', _59 => _59.params, 'access', _60 => _60[0], 'access', _61 => _61.extra, 'optionalAccess', _62 => _62.trailingComma]) ? _optionalChain([root, 'access', _63 => _63.params, 'access', _64 => _64[0], 'access', _65 => _65.extra, 'optionalAccess', _66 => _66.trailingComma]) + 1 : _optionalChain([lastProp, 'optionalAccess', _67 => _67.end]) || root.params[0].end - 1,
|
|
471
|
+
`${!_optionalChain([root, 'access', _68 => _68.params, 'access', _69 => _69[0], 'access', _70 => _70.extra, 'optionalAccess', _71 => _71.trailingComma]) && root.params[0].properties.length ? "," : ""} ...${_common.HELPER_PREFIX}props`
|
|
459
472
|
);
|
|
460
473
|
}
|
|
461
474
|
}
|
|
@@ -463,9 +476,15 @@ function transformJsxMacros(code, id, importMap, options) {
|
|
|
463
476
|
s.appendRight(getParamsStart(root, s.original), propsName);
|
|
464
477
|
}
|
|
465
478
|
if (map.defineComponent) {
|
|
466
|
-
transformDefineComponent(
|
|
479
|
+
transformDefineComponent(
|
|
480
|
+
root,
|
|
481
|
+
propsName,
|
|
482
|
+
map,
|
|
483
|
+
s,
|
|
484
|
+
_optionalChain([options, 'access', _72 => _72.defineComponent, 'optionalAccess', _73 => _73.autoReturnFunction])
|
|
485
|
+
);
|
|
467
486
|
}
|
|
468
|
-
if (_optionalChain([map, 'access',
|
|
487
|
+
if (_optionalChain([map, 'access', _74 => _74.defineModel, 'optionalAccess', _75 => _75.length])) {
|
|
469
488
|
map.defineModel.forEach(({ expression }) => {
|
|
470
489
|
transformDefineModel(expression, propsName, s);
|
|
471
490
|
});
|
|
@@ -486,13 +505,13 @@ function getRootMap(ast, s, options) {
|
|
|
486
505
|
enter(node, parent) {
|
|
487
506
|
parents.unshift(parent);
|
|
488
507
|
const root = isFunctionalNode(parents[1]) ? parents[1] : void 0;
|
|
489
|
-
if (root && _optionalChain([parents, 'access',
|
|
508
|
+
if (root && _optionalChain([parents, 'access', _76 => _76[2], 'optionalAccess', _77 => _77.type]) === "CallExpression" && options.defineComponent.alias.includes(s.sliceNode(parents[2].callee))) {
|
|
490
509
|
if (!rootMap.has(root)) rootMap.set(root, {});
|
|
491
510
|
if (!rootMap.get(root).defineComponent) {
|
|
492
511
|
rootMap.get(root).defineComponent = parents[2];
|
|
493
512
|
}
|
|
494
513
|
}
|
|
495
|
-
const expression = node.type === "VariableDeclaration" ? _optionalChain([node, 'access',
|
|
514
|
+
const expression = node.type === "VariableDeclaration" ? _optionalChain([node, 'access', _78 => _78.declarations, 'access', _79 => _79[0], 'access', _80 => _80.init, 'optionalAccess', _81 => _81.type]) === "CallExpression" && s.sliceNode(node.declarations[0].init.callee) === "$" ? node.declarations[0].init.arguments[0] : node.declarations[0].init : node.type === "ExpressionStatement" ? node.expression : void 0;
|
|
496
515
|
if (!expression) return;
|
|
497
516
|
const macroExpression = getMacroExpression(expression, options);
|
|
498
517
|
if (!macroExpression) return;
|
|
@@ -549,7 +568,7 @@ function getMacroExpression(node, options) {
|
|
|
549
568
|
}
|
|
550
569
|
}
|
|
551
570
|
function getParamsStart(node, code) {
|
|
552
|
-
return node.params[0] ? node.params[0].start : node.start + (_optionalChain([code, 'access',
|
|
571
|
+
return node.params[0] ? node.params[0].start : node.start + (_optionalChain([code, 'access', _82 => _82.slice, 'call', _83 => _83(node.start, node.body.start), 'access', _84 => _84.match, 'call', _85 => _85(/\(\s*\)/), 'optionalAccess', _86 => _86.index]) || 0) + 1;
|
|
553
572
|
}
|
|
554
573
|
|
|
555
574
|
|
package/dist/esbuild.cjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
5
|
-
require('./chunk-
|
|
3
|
+
var _chunkL26STXZKcjs = require('./chunk-L26STXZK.cjs');
|
|
4
|
+
require('./chunk-UAWFIGPX.cjs');
|
|
5
|
+
require('./chunk-ZQ4GVJKX.cjs');
|
|
6
6
|
require('./chunk-53TNKVYD.cjs');
|
|
7
7
|
|
|
8
8
|
// src/esbuild.ts
|
|
9
|
-
var esbuild_default =
|
|
9
|
+
var esbuild_default = _chunkL26STXZKcjs.index_default.esbuild;
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
exports.default = esbuild_default;
|
package/dist/esbuild.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
index_default
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-AUE5EAQA.js";
|
|
4
|
+
import "./chunk-E5WGUCGE.js";
|
|
5
|
+
import "./chunk-SMWNQXL7.js";
|
|
6
6
|
import "./chunk-DANY2WQD.js";
|
|
7
7
|
|
|
8
8
|
// src/esbuild.ts
|
package/dist/index.cjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
5
|
-
require('./chunk-
|
|
3
|
+
var _chunkL26STXZKcjs = require('./chunk-L26STXZK.cjs');
|
|
4
|
+
require('./chunk-UAWFIGPX.cjs');
|
|
5
|
+
require('./chunk-ZQ4GVJKX.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
var _chunk53TNKVYDcjs = require('./chunk-53TNKVYD.cjs');
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
exports.default =
|
|
12
|
+
exports.default = _chunkL26STXZKcjs.index_default; exports.resolveOptions = _chunk53TNKVYDcjs.resolveOptions;
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
index_default
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-AUE5EAQA.js";
|
|
4
|
+
import "./chunk-E5WGUCGE.js";
|
|
5
|
+
import "./chunk-SMWNQXL7.js";
|
|
6
6
|
import {
|
|
7
7
|
resolveOptions
|
|
8
8
|
} from "./chunk-DANY2WQD.js";
|
package/dist/nuxt.cjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkKUKYWPEKcjs = require('./chunk-KUKYWPEK.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
7
|
-
require('./chunk-
|
|
8
|
-
require('./chunk-
|
|
9
|
-
require('./chunk-
|
|
6
|
+
var _chunkPWA6BBMQcjs = require('./chunk-PWA6BBMQ.cjs');
|
|
7
|
+
require('./chunk-L26STXZK.cjs');
|
|
8
|
+
require('./chunk-UAWFIGPX.cjs');
|
|
9
|
+
require('./chunk-ZQ4GVJKX.cjs');
|
|
10
10
|
require('./chunk-53TNKVYD.cjs');
|
|
11
11
|
|
|
12
12
|
// src/nuxt.ts
|
|
@@ -18,8 +18,8 @@ var nuxt_default = _kit.defineNuxtModule.call(void 0, {
|
|
|
18
18
|
configKey: "unpluginStarter"
|
|
19
19
|
},
|
|
20
20
|
setup(options) {
|
|
21
|
-
_kit.addVitePlugin.call(void 0, () =>
|
|
22
|
-
_kit.addWebpackPlugin.call(void 0, () =>
|
|
21
|
+
_kit.addVitePlugin.call(void 0, () => _chunkKUKYWPEKcjs.vite_default.call(void 0, options));
|
|
22
|
+
_kit.addWebpackPlugin.call(void 0, () => _chunkPWA6BBMQcjs.webpack_default.call(void 0, options));
|
|
23
23
|
}
|
|
24
24
|
});
|
|
25
25
|
|
package/dist/nuxt.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
vite_default
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ZXJQCFZZ.js";
|
|
4
4
|
import {
|
|
5
5
|
webpack_default
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-HBVQYNJJ.js";
|
|
7
|
+
import "./chunk-AUE5EAQA.js";
|
|
8
|
+
import "./chunk-E5WGUCGE.js";
|
|
9
|
+
import "./chunk-SMWNQXL7.js";
|
|
10
10
|
import "./chunk-DANY2WQD.js";
|
|
11
11
|
|
|
12
12
|
// src/nuxt.ts
|
package/dist/options.d.cts
CHANGED
package/dist/options.d.ts
CHANGED
package/dist/raw.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
3
|
+
var _chunkUAWFIGPXcjs = require('./chunk-UAWFIGPX.cjs');
|
|
4
|
+
require('./chunk-ZQ4GVJKX.cjs');
|
|
5
5
|
require('./chunk-53TNKVYD.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
exports.default =
|
|
8
|
+
exports.default = _chunkUAWFIGPXcjs.raw_default;
|
|
9
9
|
|
|
10
10
|
module.exports = exports.default;
|
package/dist/raw.js
CHANGED
package/dist/rolldown.cjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
5
|
-
require('./chunk-
|
|
3
|
+
var _chunkL26STXZKcjs = require('./chunk-L26STXZK.cjs');
|
|
4
|
+
require('./chunk-UAWFIGPX.cjs');
|
|
5
|
+
require('./chunk-ZQ4GVJKX.cjs');
|
|
6
6
|
require('./chunk-53TNKVYD.cjs');
|
|
7
7
|
|
|
8
8
|
// src/rolldown.ts
|
|
9
|
-
var rolldown_default =
|
|
9
|
+
var rolldown_default = _chunkL26STXZKcjs.index_default.rolldown;
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
exports.default = rolldown_default;
|
package/dist/rolldown.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
index_default
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-AUE5EAQA.js";
|
|
4
|
+
import "./chunk-E5WGUCGE.js";
|
|
5
|
+
import "./chunk-SMWNQXL7.js";
|
|
6
6
|
import "./chunk-DANY2WQD.js";
|
|
7
7
|
|
|
8
8
|
// src/rolldown.ts
|
package/dist/rollup.cjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
5
|
-
require('./chunk-
|
|
3
|
+
var _chunkL26STXZKcjs = require('./chunk-L26STXZK.cjs');
|
|
4
|
+
require('./chunk-UAWFIGPX.cjs');
|
|
5
|
+
require('./chunk-ZQ4GVJKX.cjs');
|
|
6
6
|
require('./chunk-53TNKVYD.cjs');
|
|
7
7
|
|
|
8
8
|
// src/rollup.ts
|
|
9
|
-
var rollup_default =
|
|
9
|
+
var rollup_default = _chunkL26STXZKcjs.index_default.rollup;
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
exports.default = rollup_default;
|
package/dist/rollup.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
index_default
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-AUE5EAQA.js";
|
|
4
|
+
import "./chunk-E5WGUCGE.js";
|
|
5
|
+
import "./chunk-SMWNQXL7.js";
|
|
6
6
|
import "./chunk-DANY2WQD.js";
|
|
7
7
|
|
|
8
8
|
// src/rollup.ts
|
package/dist/rspack.cjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
5
|
-
require('./chunk-
|
|
3
|
+
var _chunkL26STXZKcjs = require('./chunk-L26STXZK.cjs');
|
|
4
|
+
require('./chunk-UAWFIGPX.cjs');
|
|
5
|
+
require('./chunk-ZQ4GVJKX.cjs');
|
|
6
6
|
require('./chunk-53TNKVYD.cjs');
|
|
7
7
|
|
|
8
8
|
// src/rspack.ts
|
|
9
|
-
var rspack_default =
|
|
9
|
+
var rspack_default = _chunkL26STXZKcjs.index_default.rspack;
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
exports.default = rspack_default;
|
package/dist/rspack.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
index_default
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-AUE5EAQA.js";
|
|
4
|
+
import "./chunk-E5WGUCGE.js";
|
|
5
|
+
import "./chunk-SMWNQXL7.js";
|
|
6
6
|
import "./chunk-DANY2WQD.js";
|
|
7
7
|
|
|
8
8
|
// src/rspack.ts
|
package/dist/vite.cjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
5
|
-
require('./chunk-
|
|
6
|
-
require('./chunk-
|
|
3
|
+
var _chunkKUKYWPEKcjs = require('./chunk-KUKYWPEK.cjs');
|
|
4
|
+
require('./chunk-L26STXZK.cjs');
|
|
5
|
+
require('./chunk-UAWFIGPX.cjs');
|
|
6
|
+
require('./chunk-ZQ4GVJKX.cjs');
|
|
7
7
|
require('./chunk-53TNKVYD.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
exports.default =
|
|
10
|
+
exports.default = _chunkKUKYWPEKcjs.vite_default;
|
|
11
11
|
|
|
12
12
|
module.exports = exports.default;
|
package/dist/vite.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
vite_default
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-ZXJQCFZZ.js";
|
|
4
|
+
import "./chunk-AUE5EAQA.js";
|
|
5
|
+
import "./chunk-E5WGUCGE.js";
|
|
6
|
+
import "./chunk-SMWNQXL7.js";
|
|
7
7
|
import "./chunk-DANY2WQD.js";
|
|
8
8
|
export {
|
|
9
9
|
vite_default as default
|
package/dist/webpack.cjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
5
|
-
require('./chunk-
|
|
6
|
-
require('./chunk-
|
|
3
|
+
var _chunkPWA6BBMQcjs = require('./chunk-PWA6BBMQ.cjs');
|
|
4
|
+
require('./chunk-L26STXZK.cjs');
|
|
5
|
+
require('./chunk-UAWFIGPX.cjs');
|
|
6
|
+
require('./chunk-ZQ4GVJKX.cjs');
|
|
7
7
|
require('./chunk-53TNKVYD.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
exports.default =
|
|
10
|
+
exports.default = _chunkPWA6BBMQcjs.webpack_default;
|
|
11
11
|
|
|
12
12
|
module.exports = exports.default;
|
package/dist/webpack.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
webpack_default
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-HBVQYNJJ.js";
|
|
4
|
+
import "./chunk-AUE5EAQA.js";
|
|
5
|
+
import "./chunk-E5WGUCGE.js";
|
|
6
|
+
import "./chunk-SMWNQXL7.js";
|
|
7
7
|
import "./chunk-DANY2WQD.js";
|
|
8
8
|
export {
|
|
9
9
|
webpack_default as default
|