@vue-jsx-vapor/macros 2.3.4 → 2.3.6
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 +1 -1
- package/dist/api.d.cts +8 -5
- package/dist/api.d.ts +8 -5
- package/dist/api.js +1 -1
- package/dist/astro.cjs +3 -3
- package/dist/astro.js +3 -3
- package/dist/{core-CdPKEM79.cjs → core-C740HxiF.cjs} +36 -23
- package/dist/{core-B_EM_kTA.js → core-CHBxRAvb.js} +36 -23
- package/dist/esbuild.cjs +3 -3
- package/dist/esbuild.js +3 -3
- package/dist/index.cjs +3 -3
- package/dist/index.js +3 -3
- package/dist/nuxt.cjs +5 -5
- package/dist/nuxt.js +5 -5
- package/dist/{raw-CgNsul_i.cjs → raw-BXpT71mV.cjs} +1 -1
- package/dist/{raw-BKMhH7EF.js → raw-Hr7QYA0U.js} +1 -1
- package/dist/raw.cjs +2 -2
- package/dist/raw.js +2 -2
- package/dist/rolldown.cjs +3 -3
- package/dist/rolldown.js +3 -3
- package/dist/rollup.cjs +3 -3
- package/dist/rollup.js +3 -3
- package/dist/rspack.cjs +3 -3
- package/dist/rspack.js +3 -3
- package/dist/{src-BSxhhMQG.cjs → src-2EUAmvRo.cjs} +1 -1
- package/dist/{src-Biftgb4Y.js → src-BDMVJUXS.js} +1 -1
- package/dist/{vite-BOk2nx8R.js → vite-CS2vynmi.js} +1 -1
- package/dist/{vite-DduBOkgt.cjs → vite-DP98E6od.cjs} +1 -1
- package/dist/vite.cjs +4 -4
- package/dist/vite.js +4 -4
- package/dist/volar.cjs +69 -56
- package/dist/volar.js +69 -56
- package/dist/{webpack-D_e7IjTv.js → webpack-C78RZrII.js} +1 -1
- package/dist/{webpack-DoGvibWq.cjs → webpack-qmJC3FBB.cjs} +1 -1
- package/dist/webpack.cjs +4 -4
- package/dist/webpack.js +4 -4
- package/package.json +6 -7
package/dist/api.cjs
CHANGED
package/dist/api.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { OptionsResolved } from "./options.d-CXMsJZSo.cjs";
|
|
2
2
|
import { CodeTransform, MagicStringAST } from "@vue-macros/common";
|
|
3
|
-
import { ArrowFunctionExpression, CallExpression, FunctionDeclaration, FunctionExpression, Node } from "@babel/types";
|
|
3
|
+
import { ArrowFunctionExpression, CallExpression, FunctionDeclaration, FunctionExpression, LVal, Node } from "@babel/types";
|
|
4
4
|
|
|
5
5
|
//#region src/core/restructure.d.ts
|
|
6
6
|
type Options = {
|
|
@@ -22,16 +22,19 @@ declare function restructure(s: MagicStringAST, node: FunctionalNode, options?:
|
|
|
22
22
|
type FunctionalNode = FunctionDeclaration | FunctionExpression | ArrowFunctionExpression;
|
|
23
23
|
type DefineStyle = {
|
|
24
24
|
expression: CallExpression;
|
|
25
|
-
|
|
25
|
+
isCssModules: boolean;
|
|
26
26
|
lang: string;
|
|
27
27
|
};
|
|
28
|
-
type
|
|
28
|
+
type Macros = {
|
|
29
29
|
defineComponent?: CallExpression;
|
|
30
30
|
defineModel?: {
|
|
31
31
|
expression: CallExpression;
|
|
32
32
|
isRequired: boolean;
|
|
33
33
|
}[];
|
|
34
|
-
defineSlots?:
|
|
34
|
+
defineSlots?: {
|
|
35
|
+
expression: CallExpression;
|
|
36
|
+
id?: LVal;
|
|
37
|
+
};
|
|
35
38
|
defineExpose?: CallExpression;
|
|
36
39
|
defineStyle?: DefineStyle[];
|
|
37
40
|
};
|
|
@@ -41,4 +44,4 @@ declare function getMacroExpression(node: Node, options: OptionsResolved): CallE
|
|
|
41
44
|
declare function getParamsStart(node: FunctionalNode, code: string): number;
|
|
42
45
|
|
|
43
46
|
//#endregion
|
|
44
|
-
export { DefineStyle, FunctionalNode,
|
|
47
|
+
export { DefineStyle, FunctionalNode, Macros, getMacroExpression, getParamsStart, isFunctionalNode, restructure, transformJsxMacros };
|
package/dist/api.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { OptionsResolved } from "./options.d-DNWXuL_g.js";
|
|
2
2
|
import { CodeTransform, MagicStringAST } from "@vue-macros/common";
|
|
3
|
-
import { ArrowFunctionExpression, CallExpression, FunctionDeclaration, FunctionExpression, Node } from "@babel/types";
|
|
3
|
+
import { ArrowFunctionExpression, CallExpression, FunctionDeclaration, FunctionExpression, LVal, Node } from "@babel/types";
|
|
4
4
|
|
|
5
5
|
//#region src/core/restructure.d.ts
|
|
6
6
|
type Options = {
|
|
@@ -22,16 +22,19 @@ declare function restructure(s: MagicStringAST, node: FunctionalNode, options?:
|
|
|
22
22
|
type FunctionalNode = FunctionDeclaration | FunctionExpression | ArrowFunctionExpression;
|
|
23
23
|
type DefineStyle = {
|
|
24
24
|
expression: CallExpression;
|
|
25
|
-
|
|
25
|
+
isCssModules: boolean;
|
|
26
26
|
lang: string;
|
|
27
27
|
};
|
|
28
|
-
type
|
|
28
|
+
type Macros = {
|
|
29
29
|
defineComponent?: CallExpression;
|
|
30
30
|
defineModel?: {
|
|
31
31
|
expression: CallExpression;
|
|
32
32
|
isRequired: boolean;
|
|
33
33
|
}[];
|
|
34
|
-
defineSlots?:
|
|
34
|
+
defineSlots?: {
|
|
35
|
+
expression: CallExpression;
|
|
36
|
+
id?: LVal;
|
|
37
|
+
};
|
|
35
38
|
defineExpose?: CallExpression;
|
|
36
39
|
defineStyle?: DefineStyle[];
|
|
37
40
|
};
|
|
@@ -41,4 +44,4 @@ declare function getMacroExpression(node: Node, options: OptionsResolved): CallE
|
|
|
41
44
|
declare function getParamsStart(node: FunctionalNode, code: string): number;
|
|
42
45
|
|
|
43
46
|
//#endregion
|
|
44
|
-
export { DefineStyle, FunctionalNode,
|
|
47
|
+
export { DefineStyle, FunctionalNode, Macros, getMacroExpression, getParamsStart, isFunctionalNode, restructure, transformJsxMacros };
|
package/dist/api.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { getMacroExpression, getParamsStart, isFunctionalNode, restructure, transformJsxMacros } from "./core-
|
|
1
|
+
import { getMacroExpression, getParamsStart, isFunctionalNode, restructure, transformJsxMacros } from "./core-CHBxRAvb.js";
|
|
2
2
|
|
|
3
3
|
export { getMacroExpression, getParamsStart, isFunctionalNode, restructure, transformJsxMacros };
|
package/dist/astro.cjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
3
|
-
require('./core-
|
|
4
|
-
require('./raw-
|
|
3
|
+
require('./core-C740HxiF.cjs');
|
|
4
|
+
require('./raw-BXpT71mV.cjs');
|
|
5
5
|
require('./options-BSX_vMxh.cjs');
|
|
6
|
-
const require_src = require('./src-
|
|
6
|
+
const require_src = require('./src-2EUAmvRo.cjs');
|
|
7
7
|
|
|
8
8
|
//#region src/astro.ts
|
|
9
9
|
var astro_default = (options) => ({
|
package/dist/astro.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import "./core-
|
|
2
|
-
import "./raw-
|
|
1
|
+
import "./core-CHBxRAvb.js";
|
|
2
|
+
import "./raw-Hr7QYA0U.js";
|
|
3
3
|
import "./options-BWRkHmm5.js";
|
|
4
|
-
import { src_default } from "./src-
|
|
4
|
+
import { src_default } from "./src-BDMVJUXS.js";
|
|
5
5
|
|
|
6
6
|
//#region src/astro.ts
|
|
7
7
|
var astro_default = (options) => ({
|
|
@@ -163,9 +163,9 @@ function transformReturn(root, s) {
|
|
|
163
163
|
|
|
164
164
|
//#endregion
|
|
165
165
|
//#region src/core/define-component/index.ts
|
|
166
|
-
function transformDefineComponent(root, propsName,
|
|
167
|
-
if (!
|
|
168
|
-
const defineComponentName = s.sliceNode(
|
|
166
|
+
function transformDefineComponent(root, propsName, macros, s, autoReturnFunction = false) {
|
|
167
|
+
if (!macros.defineComponent) return;
|
|
168
|
+
const defineComponentName = s.sliceNode(macros.defineComponent.callee);
|
|
169
169
|
if (defineComponentName && !["defineComponent", "defineVaporComponent"].includes(defineComponentName)) (0, __vue_macros_common.importHelperFn)(s, 0, "defineComponent", defineComponentName);
|
|
170
170
|
let hasRestProp = false;
|
|
171
171
|
const props = {};
|
|
@@ -205,10 +205,10 @@ function transformDefineComponent(root, propsName, map, s, autoReturnFunction =
|
|
|
205
205
|
});
|
|
206
206
|
}
|
|
207
207
|
}
|
|
208
|
-
transformDefineModel$1(s,
|
|
208
|
+
transformDefineModel$1(s, macros.defineModel, props);
|
|
209
209
|
const propsString = Object.entries(props).map(([key, value]) => `'${key}': ${value}`).join(", \n");
|
|
210
210
|
if (propsString) {
|
|
211
|
-
const argument =
|
|
211
|
+
const argument = macros.defineComponent.arguments[1];
|
|
212
212
|
if (!argument) s.appendRight(root.end, `, {${hasRestProp ? "inheritAttrs: false," : ""} props: {\n${propsString}\n} }`);
|
|
213
213
|
else if (argument.type === "ObjectExpression") {
|
|
214
214
|
prependObjectExpression(argument, "props", `{\n${propsString}\n}`, s);
|
|
@@ -317,8 +317,8 @@ function transformDefineSlots(node, s) {
|
|
|
317
317
|
|
|
318
318
|
//#endregion
|
|
319
319
|
//#region src/core/define-style.ts
|
|
320
|
-
function transformDefineStyle(defineStyle, index, root, s, importMap) {
|
|
321
|
-
const { expression, lang,
|
|
320
|
+
function transformDefineStyle(defineStyle, index, root, s, importMap, { defineSlots }) {
|
|
321
|
+
const { expression, lang, isCssModules } = defineStyle;
|
|
322
322
|
if (expression.arguments[0]?.type !== "TemplateLiteral") return;
|
|
323
323
|
let css = s.sliceNode(expression.arguments[0]).slice(1, -1);
|
|
324
324
|
const scopeId = (0, hash_sum.default)(css);
|
|
@@ -340,15 +340,25 @@ function transformDefineStyle(defineStyle, index, root, s, importMap) {
|
|
|
340
340
|
if (expression.arguments[1]?.type === "ObjectExpression") {
|
|
341
341
|
for (const prop of expression.arguments[1].properties) if (prop.type === "ObjectProperty" && prop.key.type === "Identifier" && prop.key.name === "scoped" && prop.value.type === "BooleanLiteral") scoped = prop.value.value;
|
|
342
342
|
}
|
|
343
|
-
if (scoped &&
|
|
344
|
-
|
|
345
|
-
|
|
343
|
+
if (scoped && root) {
|
|
344
|
+
const slotNames = defineSlots?.id ? defineSlots.id.type === "Identifier" ? defineSlots.id.name : defineSlots.id.type === "ObjectPattern" ? defineSlots.id.properties.map((prop) => s.sliceNode(prop.type === "RestElement" ? prop.argument : prop.value)) : [] : [];
|
|
345
|
+
(0, __vue_macros_common.walkAST)(root, { enter(node) {
|
|
346
|
+
if (node.type === "JSXElement" && s.sliceNode(node.openingElement.name) !== "template") {
|
|
347
|
+
let subfix = "";
|
|
348
|
+
if (slotNames.length) {
|
|
349
|
+
const name = s.sliceNode(node.openingElement.name.type === "JSXMemberExpression" ? node.openingElement.name.object : node.openingElement.name);
|
|
350
|
+
subfix = slotNames.includes(name) ? "-s" : "";
|
|
351
|
+
}
|
|
352
|
+
s.appendRight(node.openingElement.name.end, ` data-v-${scopeId}${subfix}=""`);
|
|
353
|
+
}
|
|
354
|
+
} });
|
|
355
|
+
}
|
|
346
356
|
css = s.sliceNode(expression.arguments[0]).slice(1, -1).replaceAll(/\/\/(.*)(?=\n)/g, "/*$1*/");
|
|
347
|
-
const module$1 =
|
|
357
|
+
const module$1 = isCssModules ? "module." : "";
|
|
348
358
|
const importId = `${helperPrefix}/define-style/${index}?scopeId=${scopeId}&scoped=${scoped}&lang.${module$1}${lang}`;
|
|
349
359
|
importMap.set(importId, css);
|
|
350
|
-
s.appendLeft(0,
|
|
351
|
-
s.overwriteNode(expression,
|
|
360
|
+
s.appendLeft(0, isCssModules ? `import style${index} from "${importId}";` : `import "${importId}";`);
|
|
361
|
+
s.overwriteNode(expression, isCssModules ? `style${index}` : "");
|
|
352
362
|
}
|
|
353
363
|
function getReturnStatement(root) {
|
|
354
364
|
if (root.body.type === "BlockStatement") {
|
|
@@ -369,9 +379,9 @@ function transformJsxMacros(code, id, importMap, options) {
|
|
|
369
379
|
const ast = (0, __vue_macros_common.babelParse)(s.original, (0, __vue_macros_common.getLang)(id));
|
|
370
380
|
const rootMap = getRootMap(ast, s, options);
|
|
371
381
|
let defineStyleIndex = 0;
|
|
372
|
-
for (const [root,
|
|
373
|
-
|
|
374
|
-
transformDefineStyle(defineStyle, defineStyleIndex++, root, s, importMap);
|
|
382
|
+
for (const [root, macros] of rootMap) {
|
|
383
|
+
macros.defineStyle?.forEach((defineStyle) => {
|
|
384
|
+
transformDefineStyle(defineStyle, defineStyleIndex++, root, s, importMap, macros);
|
|
375
385
|
});
|
|
376
386
|
if (root === void 0) continue;
|
|
377
387
|
let propsName = `${__vue_macros_common.HELPER_PREFIX}props`;
|
|
@@ -379,16 +389,16 @@ function transformJsxMacros(code, id, importMap, options) {
|
|
|
379
389
|
if (root.params[0].type === "Identifier") propsName = root.params[0].name;
|
|
380
390
|
else if (root.params[0].type === "ObjectPattern") {
|
|
381
391
|
const lastProp = root.params[0].properties.at(-1);
|
|
382
|
-
if (!
|
|
392
|
+
if (!macros.defineComponent && lastProp?.type === "RestElement" && lastProp.argument.type === "Identifier") propsName = lastProp.argument.name;
|
|
383
393
|
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 ? "," : ""} ...${__vue_macros_common.HELPER_PREFIX}props`);
|
|
384
394
|
}
|
|
385
395
|
} else s.appendRight(getParamsStart(root, s.original), propsName);
|
|
386
|
-
if (
|
|
387
|
-
if (
|
|
396
|
+
if (macros.defineComponent) transformDefineComponent(root, propsName, macros, s, options.defineComponent?.autoReturnFunction);
|
|
397
|
+
if (macros.defineModel?.length) macros.defineModel.forEach(({ expression }) => {
|
|
388
398
|
transformDefineModel(expression, propsName, s);
|
|
389
399
|
});
|
|
390
|
-
if (
|
|
391
|
-
if (
|
|
400
|
+
if (macros.defineSlots) transformDefineSlots(macros.defineSlots.expression, s);
|
|
401
|
+
if (macros.defineExpose) transformDefineExpose(macros.defineExpose, s, options.version);
|
|
392
402
|
}
|
|
393
403
|
return (0, __vue_macros_common.generateTransform)(s, id);
|
|
394
404
|
}
|
|
@@ -418,10 +428,13 @@ function getRootMap(ast, s, options) {
|
|
|
418
428
|
const lang = macroExpression.callee.type === "MemberExpression" && macroExpression.callee.property.type === "Identifier" ? macroExpression.callee.property.name : "css";
|
|
419
429
|
(rootMap.get(root).defineStyle ??= []).push({
|
|
420
430
|
expression: macroExpression,
|
|
421
|
-
|
|
431
|
+
isCssModules: node.type === "VariableDeclaration",
|
|
422
432
|
lang
|
|
423
433
|
});
|
|
424
|
-
} else if (options.defineSlots.alias.includes(macroName)) rootMap.get(root).defineSlots =
|
|
434
|
+
} else if (options.defineSlots.alias.includes(macroName)) rootMap.get(root).defineSlots = {
|
|
435
|
+
expression: macroExpression,
|
|
436
|
+
id: node.type === "VariableDeclaration" ? node.declarations[0].id : void 0
|
|
437
|
+
};
|
|
425
438
|
else if (options.defineExpose.alias.includes(macroName)) rootMap.get(root).defineExpose = macroExpression;
|
|
426
439
|
}
|
|
427
440
|
},
|
|
@@ -161,9 +161,9 @@ function transformReturn(root, s) {
|
|
|
161
161
|
|
|
162
162
|
//#endregion
|
|
163
163
|
//#region src/core/define-component/index.ts
|
|
164
|
-
function transformDefineComponent(root, propsName,
|
|
165
|
-
if (!
|
|
166
|
-
const defineComponentName = s.sliceNode(
|
|
164
|
+
function transformDefineComponent(root, propsName, macros, s, autoReturnFunction = false) {
|
|
165
|
+
if (!macros.defineComponent) return;
|
|
166
|
+
const defineComponentName = s.sliceNode(macros.defineComponent.callee);
|
|
167
167
|
if (defineComponentName && !["defineComponent", "defineVaporComponent"].includes(defineComponentName)) importHelperFn(s, 0, "defineComponent", defineComponentName);
|
|
168
168
|
let hasRestProp = false;
|
|
169
169
|
const props = {};
|
|
@@ -203,10 +203,10 @@ function transformDefineComponent(root, propsName, map, s, autoReturnFunction =
|
|
|
203
203
|
});
|
|
204
204
|
}
|
|
205
205
|
}
|
|
206
|
-
transformDefineModel$1(s,
|
|
206
|
+
transformDefineModel$1(s, macros.defineModel, props);
|
|
207
207
|
const propsString = Object.entries(props).map(([key, value]) => `'${key}': ${value}`).join(", \n");
|
|
208
208
|
if (propsString) {
|
|
209
|
-
const argument =
|
|
209
|
+
const argument = macros.defineComponent.arguments[1];
|
|
210
210
|
if (!argument) s.appendRight(root.end, `, {${hasRestProp ? "inheritAttrs: false," : ""} props: {\n${propsString}\n} }`);
|
|
211
211
|
else if (argument.type === "ObjectExpression") {
|
|
212
212
|
prependObjectExpression(argument, "props", `{\n${propsString}\n}`, s);
|
|
@@ -315,8 +315,8 @@ function transformDefineSlots(node, s) {
|
|
|
315
315
|
|
|
316
316
|
//#endregion
|
|
317
317
|
//#region src/core/define-style.ts
|
|
318
|
-
function transformDefineStyle(defineStyle, index, root, s, importMap) {
|
|
319
|
-
const { expression, lang,
|
|
318
|
+
function transformDefineStyle(defineStyle, index, root, s, importMap, { defineSlots }) {
|
|
319
|
+
const { expression, lang, isCssModules } = defineStyle;
|
|
320
320
|
if (expression.arguments[0]?.type !== "TemplateLiteral") return;
|
|
321
321
|
let css = s.sliceNode(expression.arguments[0]).slice(1, -1);
|
|
322
322
|
const scopeId = hash(css);
|
|
@@ -338,15 +338,25 @@ function transformDefineStyle(defineStyle, index, root, s, importMap) {
|
|
|
338
338
|
if (expression.arguments[1]?.type === "ObjectExpression") {
|
|
339
339
|
for (const prop of expression.arguments[1].properties) if (prop.type === "ObjectProperty" && prop.key.type === "Identifier" && prop.key.name === "scoped" && prop.value.type === "BooleanLiteral") scoped = prop.value.value;
|
|
340
340
|
}
|
|
341
|
-
if (scoped &&
|
|
342
|
-
|
|
343
|
-
|
|
341
|
+
if (scoped && root) {
|
|
342
|
+
const slotNames = defineSlots?.id ? defineSlots.id.type === "Identifier" ? defineSlots.id.name : defineSlots.id.type === "ObjectPattern" ? defineSlots.id.properties.map((prop) => s.sliceNode(prop.type === "RestElement" ? prop.argument : prop.value)) : [] : [];
|
|
343
|
+
walkAST(root, { enter(node) {
|
|
344
|
+
if (node.type === "JSXElement" && s.sliceNode(node.openingElement.name) !== "template") {
|
|
345
|
+
let subfix = "";
|
|
346
|
+
if (slotNames.length) {
|
|
347
|
+
const name = s.sliceNode(node.openingElement.name.type === "JSXMemberExpression" ? node.openingElement.name.object : node.openingElement.name);
|
|
348
|
+
subfix = slotNames.includes(name) ? "-s" : "";
|
|
349
|
+
}
|
|
350
|
+
s.appendRight(node.openingElement.name.end, ` data-v-${scopeId}${subfix}=""`);
|
|
351
|
+
}
|
|
352
|
+
} });
|
|
353
|
+
}
|
|
344
354
|
css = s.sliceNode(expression.arguments[0]).slice(1, -1).replaceAll(/\/\/(.*)(?=\n)/g, "/*$1*/");
|
|
345
|
-
const module =
|
|
355
|
+
const module = isCssModules ? "module." : "";
|
|
346
356
|
const importId = `${helperPrefix}/define-style/${index}?scopeId=${scopeId}&scoped=${scoped}&lang.${module}${lang}`;
|
|
347
357
|
importMap.set(importId, css);
|
|
348
|
-
s.appendLeft(0,
|
|
349
|
-
s.overwriteNode(expression,
|
|
358
|
+
s.appendLeft(0, isCssModules ? `import style${index} from "${importId}";` : `import "${importId}";`);
|
|
359
|
+
s.overwriteNode(expression, isCssModules ? `style${index}` : "");
|
|
350
360
|
}
|
|
351
361
|
function getReturnStatement(root) {
|
|
352
362
|
if (root.body.type === "BlockStatement") {
|
|
@@ -367,9 +377,9 @@ function transformJsxMacros(code, id, importMap, options) {
|
|
|
367
377
|
const ast = babelParse(s.original, getLang(id));
|
|
368
378
|
const rootMap = getRootMap(ast, s, options);
|
|
369
379
|
let defineStyleIndex = 0;
|
|
370
|
-
for (const [root,
|
|
371
|
-
|
|
372
|
-
transformDefineStyle(defineStyle, defineStyleIndex++, root, s, importMap);
|
|
380
|
+
for (const [root, macros] of rootMap) {
|
|
381
|
+
macros.defineStyle?.forEach((defineStyle) => {
|
|
382
|
+
transformDefineStyle(defineStyle, defineStyleIndex++, root, s, importMap, macros);
|
|
373
383
|
});
|
|
374
384
|
if (root === void 0) continue;
|
|
375
385
|
let propsName = `${HELPER_PREFIX}props`;
|
|
@@ -377,16 +387,16 @@ function transformJsxMacros(code, id, importMap, options) {
|
|
|
377
387
|
if (root.params[0].type === "Identifier") propsName = root.params[0].name;
|
|
378
388
|
else if (root.params[0].type === "ObjectPattern") {
|
|
379
389
|
const lastProp = root.params[0].properties.at(-1);
|
|
380
|
-
if (!
|
|
390
|
+
if (!macros.defineComponent && lastProp?.type === "RestElement" && lastProp.argument.type === "Identifier") propsName = lastProp.argument.name;
|
|
381
391
|
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`);
|
|
382
392
|
}
|
|
383
393
|
} else s.appendRight(getParamsStart(root, s.original), propsName);
|
|
384
|
-
if (
|
|
385
|
-
if (
|
|
394
|
+
if (macros.defineComponent) transformDefineComponent(root, propsName, macros, s, options.defineComponent?.autoReturnFunction);
|
|
395
|
+
if (macros.defineModel?.length) macros.defineModel.forEach(({ expression }) => {
|
|
386
396
|
transformDefineModel(expression, propsName, s);
|
|
387
397
|
});
|
|
388
|
-
if (
|
|
389
|
-
if (
|
|
398
|
+
if (macros.defineSlots) transformDefineSlots(macros.defineSlots.expression, s);
|
|
399
|
+
if (macros.defineExpose) transformDefineExpose(macros.defineExpose, s, options.version);
|
|
390
400
|
}
|
|
391
401
|
return generateTransform(s, id);
|
|
392
402
|
}
|
|
@@ -416,10 +426,13 @@ function getRootMap(ast, s, options) {
|
|
|
416
426
|
const lang = macroExpression.callee.type === "MemberExpression" && macroExpression.callee.property.type === "Identifier" ? macroExpression.callee.property.name : "css";
|
|
417
427
|
(rootMap.get(root).defineStyle ??= []).push({
|
|
418
428
|
expression: macroExpression,
|
|
419
|
-
|
|
429
|
+
isCssModules: node.type === "VariableDeclaration",
|
|
420
430
|
lang
|
|
421
431
|
});
|
|
422
|
-
} else if (options.defineSlots.alias.includes(macroName)) rootMap.get(root).defineSlots =
|
|
432
|
+
} else if (options.defineSlots.alias.includes(macroName)) rootMap.get(root).defineSlots = {
|
|
433
|
+
expression: macroExpression,
|
|
434
|
+
id: node.type === "VariableDeclaration" ? node.declarations[0].id : void 0
|
|
435
|
+
};
|
|
423
436
|
else if (options.defineExpose.alias.includes(macroName)) rootMap.get(root).defineExpose = macroExpression;
|
|
424
437
|
}
|
|
425
438
|
},
|
package/dist/esbuild.cjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
3
|
-
require('./core-
|
|
4
|
-
require('./raw-
|
|
3
|
+
require('./core-C740HxiF.cjs');
|
|
4
|
+
require('./raw-BXpT71mV.cjs');
|
|
5
5
|
require('./options-BSX_vMxh.cjs');
|
|
6
|
-
const require_src = require('./src-
|
|
6
|
+
const require_src = require('./src-2EUAmvRo.cjs');
|
|
7
7
|
|
|
8
8
|
//#region src/esbuild.ts
|
|
9
9
|
var esbuild_default = require_src.src_default.esbuild;
|
package/dist/esbuild.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import "./core-
|
|
2
|
-
import "./raw-
|
|
1
|
+
import "./core-CHBxRAvb.js";
|
|
2
|
+
import "./raw-Hr7QYA0U.js";
|
|
3
3
|
import "./options-BWRkHmm5.js";
|
|
4
|
-
import { src_default } from "./src-
|
|
4
|
+
import { src_default } from "./src-BDMVJUXS.js";
|
|
5
5
|
|
|
6
6
|
//#region src/esbuild.ts
|
|
7
7
|
var esbuild_default = src_default.esbuild;
|
package/dist/index.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
|
-
require('./core-
|
|
3
|
-
require('./raw-
|
|
2
|
+
require('./core-C740HxiF.cjs');
|
|
3
|
+
require('./raw-BXpT71mV.cjs');
|
|
4
4
|
const require_options = require('./options-BSX_vMxh.cjs');
|
|
5
|
-
const require_src = require('./src-
|
|
5
|
+
const require_src = require('./src-2EUAmvRo.cjs');
|
|
6
6
|
|
|
7
7
|
exports.default = require_src.src_default
|
|
8
8
|
exports.resolveOptions = require_options.resolveOptions
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import "./core-
|
|
2
|
-
import "./raw-
|
|
1
|
+
import "./core-CHBxRAvb.js";
|
|
2
|
+
import "./raw-Hr7QYA0U.js";
|
|
3
3
|
import { resolveOptions } from "./options-BWRkHmm5.js";
|
|
4
|
-
import { src_default } from "./src-
|
|
4
|
+
import { src_default } from "./src-BDMVJUXS.js";
|
|
5
5
|
|
|
6
6
|
export { src_default as default, resolveOptions };
|
package/dist/nuxt.cjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
3
3
|
const require_chunk = require('./chunk-BCwAaXi7.cjs');
|
|
4
|
-
require('./core-
|
|
5
|
-
require('./raw-
|
|
4
|
+
require('./core-C740HxiF.cjs');
|
|
5
|
+
require('./raw-BXpT71mV.cjs');
|
|
6
6
|
require('./options-BSX_vMxh.cjs');
|
|
7
|
-
require('./src-
|
|
8
|
-
const require_vite = require('./vite-
|
|
9
|
-
const require_webpack = require('./webpack-
|
|
7
|
+
require('./src-2EUAmvRo.cjs');
|
|
8
|
+
const require_vite = require('./vite-DP98E6od.cjs');
|
|
9
|
+
const require_webpack = require('./webpack-qmJC3FBB.cjs');
|
|
10
10
|
const __nuxt_kit = require_chunk.__toESM(require("@nuxt/kit"));
|
|
11
11
|
require("@nuxt/schema");
|
|
12
12
|
|
package/dist/nuxt.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import "./core-
|
|
2
|
-
import "./raw-
|
|
1
|
+
import "./core-CHBxRAvb.js";
|
|
2
|
+
import "./raw-Hr7QYA0U.js";
|
|
3
3
|
import "./options-BWRkHmm5.js";
|
|
4
|
-
import "./src-
|
|
5
|
-
import { vite_default } from "./vite-
|
|
6
|
-
import { webpack_default } from "./webpack-
|
|
4
|
+
import "./src-BDMVJUXS.js";
|
|
5
|
+
import { vite_default } from "./vite-CS2vynmi.js";
|
|
6
|
+
import { webpack_default } from "./webpack-C78RZrII.js";
|
|
7
7
|
import { addVitePlugin, addWebpackPlugin, defineNuxtModule } from "@nuxt/kit";
|
|
8
8
|
import "@nuxt/schema";
|
|
9
9
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const require_chunk = require('./chunk-BCwAaXi7.cjs');
|
|
3
|
-
const require_core = require('./core-
|
|
3
|
+
const require_core = require('./core-C740HxiF.cjs');
|
|
4
4
|
const require_options = require('./options-BSX_vMxh.cjs');
|
|
5
5
|
const __vue_macros_common = require_chunk.__toESM(require("@vue-macros/common"));
|
|
6
6
|
const __vue_compiler_sfc = require_chunk.__toESM(require("@vue/compiler-sfc"));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { helperPrefix, transformJsxMacros, useModelHelperId, use_model_default, withDefaultsHelperId, with_defaults_default } from "./core-
|
|
1
|
+
import { helperPrefix, transformJsxMacros, useModelHelperId, use_model_default, withDefaultsHelperId, with_defaults_default } from "./core-CHBxRAvb.js";
|
|
2
2
|
import { resolveOptions } from "./options-BWRkHmm5.js";
|
|
3
3
|
import { createFilter, normalizePath } from "@vue-macros/common";
|
|
4
4
|
import { compileStyleAsync } from "@vue/compiler-sfc";
|
package/dist/raw.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
|
-
require('./core-
|
|
3
|
-
const require_raw = require('./raw-
|
|
2
|
+
require('./core-C740HxiF.cjs');
|
|
3
|
+
const require_raw = require('./raw-BXpT71mV.cjs');
|
|
4
4
|
require('./options-BSX_vMxh.cjs');
|
|
5
5
|
|
|
6
6
|
exports.default = require_raw.raw_default
|
package/dist/raw.js
CHANGED
package/dist/rolldown.cjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
3
|
-
require('./core-
|
|
4
|
-
require('./raw-
|
|
3
|
+
require('./core-C740HxiF.cjs');
|
|
4
|
+
require('./raw-BXpT71mV.cjs');
|
|
5
5
|
require('./options-BSX_vMxh.cjs');
|
|
6
|
-
const require_src = require('./src-
|
|
6
|
+
const require_src = require('./src-2EUAmvRo.cjs');
|
|
7
7
|
|
|
8
8
|
//#region src/rolldown.ts
|
|
9
9
|
var rolldown_default = require_src.src_default.rolldown;
|
package/dist/rolldown.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import "./core-
|
|
2
|
-
import "./raw-
|
|
1
|
+
import "./core-CHBxRAvb.js";
|
|
2
|
+
import "./raw-Hr7QYA0U.js";
|
|
3
3
|
import "./options-BWRkHmm5.js";
|
|
4
|
-
import { src_default } from "./src-
|
|
4
|
+
import { src_default } from "./src-BDMVJUXS.js";
|
|
5
5
|
|
|
6
6
|
//#region src/rolldown.ts
|
|
7
7
|
var rolldown_default = src_default.rolldown;
|
package/dist/rollup.cjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
3
|
-
require('./core-
|
|
4
|
-
require('./raw-
|
|
3
|
+
require('./core-C740HxiF.cjs');
|
|
4
|
+
require('./raw-BXpT71mV.cjs');
|
|
5
5
|
require('./options-BSX_vMxh.cjs');
|
|
6
|
-
const require_src = require('./src-
|
|
6
|
+
const require_src = require('./src-2EUAmvRo.cjs');
|
|
7
7
|
|
|
8
8
|
//#region src/rollup.ts
|
|
9
9
|
var rollup_default = require_src.src_default.rollup;
|
package/dist/rollup.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import "./core-
|
|
2
|
-
import "./raw-
|
|
1
|
+
import "./core-CHBxRAvb.js";
|
|
2
|
+
import "./raw-Hr7QYA0U.js";
|
|
3
3
|
import "./options-BWRkHmm5.js";
|
|
4
|
-
import { src_default } from "./src-
|
|
4
|
+
import { src_default } from "./src-BDMVJUXS.js";
|
|
5
5
|
|
|
6
6
|
//#region src/rollup.ts
|
|
7
7
|
var rollup_default = src_default.rollup;
|
package/dist/rspack.cjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
3
|
-
require('./core-
|
|
4
|
-
require('./raw-
|
|
3
|
+
require('./core-C740HxiF.cjs');
|
|
4
|
+
require('./raw-BXpT71mV.cjs');
|
|
5
5
|
require('./options-BSX_vMxh.cjs');
|
|
6
|
-
const require_src = require('./src-
|
|
6
|
+
const require_src = require('./src-2EUAmvRo.cjs');
|
|
7
7
|
|
|
8
8
|
//#region src/rspack.ts
|
|
9
9
|
var rspack_default = require_src.src_default.rspack;
|
package/dist/rspack.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import "./core-
|
|
2
|
-
import "./raw-
|
|
1
|
+
import "./core-CHBxRAvb.js";
|
|
2
|
+
import "./raw-Hr7QYA0U.js";
|
|
3
3
|
import "./options-BWRkHmm5.js";
|
|
4
|
-
import { src_default } from "./src-
|
|
4
|
+
import { src_default } from "./src-BDMVJUXS.js";
|
|
5
5
|
|
|
6
6
|
//#region src/rspack.ts
|
|
7
7
|
var rspack_default = src_default.rspack;
|
package/dist/vite.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
|
-
require('./core-
|
|
3
|
-
require('./raw-
|
|
2
|
+
require('./core-C740HxiF.cjs');
|
|
3
|
+
require('./raw-BXpT71mV.cjs');
|
|
4
4
|
require('./options-BSX_vMxh.cjs');
|
|
5
|
-
require('./src-
|
|
6
|
-
const require_vite = require('./vite-
|
|
5
|
+
require('./src-2EUAmvRo.cjs');
|
|
6
|
+
const require_vite = require('./vite-DP98E6od.cjs');
|
|
7
7
|
|
|
8
8
|
exports.default = require_vite.vite_default
|
package/dist/vite.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import "./core-
|
|
2
|
-
import "./raw-
|
|
1
|
+
import "./core-CHBxRAvb.js";
|
|
2
|
+
import "./raw-Hr7QYA0U.js";
|
|
3
3
|
import "./options-BWRkHmm5.js";
|
|
4
|
-
import "./src-
|
|
5
|
-
import { vite_default } from "./vite-
|
|
4
|
+
import "./src-BDMVJUXS.js";
|
|
5
|
+
import { vite_default } from "./vite-CS2vynmi.js";
|
|
6
6
|
|
|
7
7
|
export { vite_default as default };
|
package/dist/volar.cjs
CHANGED
|
@@ -4,8 +4,6 @@ const require_chunk = require('./chunk-BCwAaXi7.cjs');
|
|
|
4
4
|
const require_options = require('./options-BSX_vMxh.cjs');
|
|
5
5
|
const __vue_macros_common = require_chunk.__toESM(require("@vue-macros/common"));
|
|
6
6
|
const ts_macro = require_chunk.__toESM(require("ts-macro"));
|
|
7
|
-
const __vue_language_core_lib_codegen_style_classProperty_js = require_chunk.__toESM(require("@vue/language-core/lib/codegen/style/classProperty.js"));
|
|
8
|
-
const __vue_language_core_lib_utils_parseCssClassNames_js = require_chunk.__toESM(require("@vue/language-core/lib/utils/parseCssClassNames.js"));
|
|
9
7
|
|
|
10
8
|
//#region src/volar/define-component.ts
|
|
11
9
|
function transformDefineComponent(node, parent, options) {
|
|
@@ -27,16 +25,10 @@ function transformDefineComponent(node, parent, options) {
|
|
|
27
25
|
|
|
28
26
|
//#endregion
|
|
29
27
|
//#region src/volar/define-style.ts
|
|
30
|
-
function transformDefineStyle(
|
|
31
|
-
if (!defineStyles?.length) return;
|
|
28
|
+
function transformDefineStyle({ expression, isCssModules }, index, options) {
|
|
32
29
|
const { ts, codes, ast } = options;
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
addEmbeddedCode(expression, index, options);
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
function* generateCssClassesType(css, offset, index) {
|
|
39
|
-
for (const className of [...(0, __vue_language_core_lib_utils_parseCssClassNames_js.parseCssClassNames)(css)]) yield* (0, __vue_language_core_lib_codegen_style_classProperty_js.generateClassProperty)(index, className.text, className.offset + offset, "string");
|
|
30
|
+
if (isCssModules && expression?.arguments[0] && !expression.typeArguments && ts.isTemplateLiteral(expression.arguments[0])) (0, ts_macro.replaceRange)(codes, expression.arguments.pos - 1, expression.arguments.pos - 1, `<{`, ...parseCssClassNames(expression.arguments[0].getText(ast).slice(1, -1)).map(({ text }) => `\n'${text.slice(1)}': string`), "\n}>");
|
|
31
|
+
addEmbeddedCode(expression, index, options);
|
|
40
32
|
}
|
|
41
33
|
function addEmbeddedCode(expression, index, options) {
|
|
42
34
|
const { ts, ast } = options;
|
|
@@ -67,16 +59,33 @@ function addEmbeddedCode(expression, index, options) {
|
|
|
67
59
|
embeddedCodes: []
|
|
68
60
|
});
|
|
69
61
|
}
|
|
62
|
+
const commentReg = /(?<=\/\*)[\s\S]*?(?=\*\/)|(?<=\/\/)[\s\S]*?(?=\n)/g;
|
|
63
|
+
const cssClassNameReg = /(?=(\.[a-z_][-\w]*)[\s.,+~>:#)[{])/gi;
|
|
64
|
+
const fragmentReg = /(?<=\{)[^{]*(?=(?<!\\);)/g;
|
|
65
|
+
function parseCssClassNames(css) {
|
|
66
|
+
for (const reg of [commentReg, fragmentReg]) css = css.replace(reg, (match) => " ".repeat(match.length));
|
|
67
|
+
const matches = css.matchAll(cssClassNameReg);
|
|
68
|
+
const result = [];
|
|
69
|
+
for (const match of matches) {
|
|
70
|
+
const matchText = match[1];
|
|
71
|
+
if (matchText) result.push({
|
|
72
|
+
offset: match.index,
|
|
73
|
+
text: matchText
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
return result;
|
|
77
|
+
}
|
|
70
78
|
|
|
71
79
|
//#endregion
|
|
72
80
|
//#region src/volar/transform.ts
|
|
73
81
|
function transformJsxMacros(rootMap, options) {
|
|
74
82
|
const { ts, codes, ast } = options;
|
|
75
|
-
|
|
76
|
-
|
|
83
|
+
let defineStyleIndex = 0;
|
|
84
|
+
for (const [root, macros] of rootMap) {
|
|
85
|
+
macros.defineStyle?.forEach((defaultStyle) => transformDefineStyle(defaultStyle, defineStyleIndex++, options));
|
|
77
86
|
if (!root?.body) continue;
|
|
78
87
|
const asyncModifier = root.modifiers?.find((modifier) => modifier.kind === ts.SyntaxKind.AsyncKeyword);
|
|
79
|
-
if (asyncModifier &&
|
|
88
|
+
if (asyncModifier && macros.defineComponent) (0, ts_macro.replaceRange)(codes, asyncModifier.pos, asyncModifier.end);
|
|
80
89
|
const result = `({}) as __VLS_PickNotAny<typeof ${__vue_macros_common.HELPER_PREFIX}ctx.render, {}> & { __ctx: typeof ${__vue_macros_common.HELPER_PREFIX}ctx }`;
|
|
81
90
|
const propsType = root.parameters[0]?.type ? String(root.parameters[0].type.getText(ast)) : "{}";
|
|
82
91
|
(0, ts_macro.replaceRange)(codes, root.parameters.pos, root.parameters.pos, ts.isArrowFunction(root) && root.parameters.pos === root.pos ? "(" : "", `${__vue_macros_common.HELPER_PREFIX}props: typeof ${__vue_macros_common.HELPER_PREFIX}ctx.props & ${propsType}, `, `${__vue_macros_common.HELPER_PREFIX}placeholder?: {}, `, `${__vue_macros_common.HELPER_PREFIX}ctx = {} as Awaited<ReturnType<typeof ${__vue_macros_common.HELPER_PREFIX}setup>>, `, `${__vue_macros_common.HELPER_PREFIX}setup = (${asyncModifier ? "async" : ""}(`);
|
|
@@ -87,16 +96,16 @@ function transformJsxMacros(rootMap, options) {
|
|
|
87
96
|
}
|
|
88
97
|
ts.forEachChild(root.body, (node) => {
|
|
89
98
|
if (ts.isReturnStatement(node) && node.expression) {
|
|
90
|
-
const props = [...
|
|
99
|
+
const props = [...macros.defineModel ?? []];
|
|
91
100
|
const elements = root.parameters[0] && !root.parameters[0].type && ts.isObjectBindingPattern(root.parameters[0].name) ? root.parameters[0].name.elements : [];
|
|
92
101
|
for (const element of elements) if (ts.isIdentifier(element.name)) props.push(`${element.name.escapedText}${element.initializer && ts.isNonNullExpression(element.initializer) ? ":" : "?:"} typeof ${element.name.escapedText}`);
|
|
93
|
-
const shouldWrapByCall = (ts.isArrowFunction(node.expression) || ts.isFunctionExpression(node.expression)) &&
|
|
102
|
+
const shouldWrapByCall = (ts.isArrowFunction(node.expression) || ts.isFunctionExpression(node.expression)) && macros.defineComponent;
|
|
94
103
|
(0, ts_macro.replaceRange)(codes, node.getStart(ast), node.expression.getStart(ast), `const ${__vue_macros_common.HELPER_PREFIX}render = `, shouldWrapByCall ? "(" : "");
|
|
95
104
|
(0, ts_macro.replaceRange)(codes, node.expression.end, node.expression.end, shouldWrapByCall ? ")()" : "", `
|
|
96
105
|
return {
|
|
97
106
|
props: {} as {${props.join(", ")}},
|
|
98
|
-
slots: {} as ${
|
|
99
|
-
expose: (exposed: import('vue').ShallowUnwrapRef<${
|
|
107
|
+
slots: {} as ${macros.defineSlots ?? "{}"},
|
|
108
|
+
expose: (exposed: import('vue').ShallowUnwrapRef<${macros.defineExpose ?? "{}"}>) => {},
|
|
100
109
|
render: ${__vue_macros_common.HELPER_PREFIX}render,
|
|
101
110
|
}`);
|
|
102
111
|
}
|
|
@@ -118,7 +127,6 @@ ${defineSlots}
|
|
|
118
127
|
${defineExpose}
|
|
119
128
|
${defineStyle}
|
|
120
129
|
type ${__vue_macros_common.HELPER_PREFIX}StyleArgs = [style: string, options?: { scoped?: boolean }];
|
|
121
|
-
type ${__vue_macros_common.HELPER_PREFIX}PrettifyLocal<T> = { [K in keyof T]: T[K]; } & {};
|
|
122
130
|
// @ts-ignore
|
|
123
131
|
type __VLS_IsAny<T> = 0 extends 1 & T ? true : false; type __VLS_PickNotAny<A, B> = __VLS_IsAny<A> extends true ? B : A;
|
|
124
132
|
`;
|
|
@@ -165,11 +173,6 @@ function getRootMap(options) {
|
|
|
165
173
|
const { ts, ast, codes } = options;
|
|
166
174
|
const rootMap = new Map();
|
|
167
175
|
function walk(node, parents) {
|
|
168
|
-
ts.forEachChild(node, (child) => {
|
|
169
|
-
parents.unshift(node);
|
|
170
|
-
walk(child, parents);
|
|
171
|
-
parents.shift();
|
|
172
|
-
});
|
|
173
176
|
const root = parents[1] && (ts.isArrowFunction(parents[1]) || ts.isFunctionExpression(parents[1]) || ts.isFunctionDeclaration(parents[1])) ? parents[1] : void 0;
|
|
174
177
|
if (root && parents[2] && ts.isCallExpression(parents[2]) && !parents[2].typeArguments && options.defineComponent.alias.includes(parents[2].expression.getText(ast))) {
|
|
175
178
|
if (!rootMap.has(root)) rootMap.set(root, {});
|
|
@@ -179,40 +182,50 @@ function getRootMap(options) {
|
|
|
179
182
|
}
|
|
180
183
|
}
|
|
181
184
|
const macro = getMacro(node, ts, options);
|
|
182
|
-
if (
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
185
|
+
if (macro) {
|
|
186
|
+
const { expression, initializer } = macro;
|
|
187
|
+
let isRequired = macro.isRequired;
|
|
188
|
+
if (!rootMap.has(root)) rootMap.set(root, {});
|
|
189
|
+
const macroName = expression.expression.getText(ast);
|
|
190
|
+
if (macroName.startsWith("defineStyle")) {
|
|
191
|
+
(rootMap.get(root).defineStyle ??= []).push({
|
|
192
|
+
expression,
|
|
193
|
+
isCssModules: ts.isVariableStatement(node)
|
|
194
|
+
});
|
|
195
|
+
return;
|
|
196
|
+
}
|
|
197
|
+
if (root) {
|
|
198
|
+
if (options.defineModel.alias.includes(macroName)) {
|
|
199
|
+
const modelName = expression.arguments[0] && ts.isStringLiteralLike(expression.arguments[0]) ? expression.arguments[0].text : "modelValue";
|
|
200
|
+
const modelOptions = expression.arguments[0] && ts.isStringLiteralLike(expression.arguments[0]) ? expression.arguments[1] : expression.arguments[0];
|
|
201
|
+
if (modelOptions && ts.isObjectLiteralExpression(modelOptions)) {
|
|
202
|
+
let hasRequired = false;
|
|
203
|
+
for (const prop of modelOptions.properties) if (ts.isPropertyAssignment(prop) && prop.name.getText(ast) === "required") {
|
|
204
|
+
hasRequired = true;
|
|
205
|
+
isRequired = prop.initializer.kind === ts.SyntaxKind.TrueKeyword;
|
|
206
|
+
}
|
|
207
|
+
if (!hasRequired && isRequired) (0, ts_macro.replaceRange)(codes, modelOptions.end - 1, modelOptions.end - 1, `${!modelOptions.properties.hasTrailingComma && modelOptions.properties.length ? "," : ""} required: true`);
|
|
208
|
+
} else if (isRequired) (0, ts_macro.replaceRange)(codes, expression.arguments.end, expression.arguments.end, `${!expression.arguments.hasTrailingComma && expression.arguments.length ? "," : ""} { required: true }`);
|
|
209
|
+
const id = toValidAssetId(modelName, `${__vue_macros_common.HELPER_PREFIX}model`);
|
|
210
|
+
const typeString = `import('vue').UnwrapRef<typeof ${id}>`;
|
|
211
|
+
const defineModel = rootMap.get(root).defineModel ??= [];
|
|
212
|
+
defineModel.push(`${modelName.includes("-") ? `'${modelName}'` : modelName}${isRequired ? ":" : "?:"} ${typeString}`, `'onUpdate:${modelName}'?: ($event: ${typeString}) => any`);
|
|
213
|
+
if (expression.typeArguments?.[1]) defineModel.push(`${modelName}Modifiers?: Partial<Record<${expression.typeArguments[1].getText(ast)}, boolean>>`);
|
|
214
|
+
if (ts.isVariableStatement(node)) (0, ts_macro.replaceRange)(codes, initializer.getStart(ast), initializer.getStart(ast), `// @ts-ignore\n${id};\nlet ${id} = `);
|
|
215
|
+
} else if (options.defineSlots.alias.includes(macroName)) {
|
|
216
|
+
(0, ts_macro.replaceRange)(codes, expression.getStart(ast), expression.getStart(ast), `// @ts-ignore\n${__vue_macros_common.HELPER_PREFIX}slots;\nconst ${__vue_macros_common.HELPER_PREFIX}slots = `);
|
|
217
|
+
rootMap.get(root).defineSlots = `Partial<typeof ${__vue_macros_common.HELPER_PREFIX}slots>`;
|
|
218
|
+
} else if (options.defineExpose.alias.includes(macroName)) {
|
|
219
|
+
(0, ts_macro.replaceRange)(codes, expression.getStart(ast), expression.getStart(ast), `// @ts-ignore\n${__vue_macros_common.HELPER_PREFIX}exposed;\nconst ${__vue_macros_common.HELPER_PREFIX}exposed = `);
|
|
220
|
+
rootMap.get(root).defineExpose = `typeof ${__vue_macros_common.HELPER_PREFIX}exposed`;
|
|
200
221
|
}
|
|
201
|
-
|
|
202
|
-
} else if (isRequired) (0, ts_macro.replaceRange)(codes, expression.arguments.end, expression.arguments.end, `${!expression.arguments.hasTrailingComma && expression.arguments.length ? "," : ""} { required: true }`);
|
|
203
|
-
const id = toValidAssetId(modelName, `${__vue_macros_common.HELPER_PREFIX}model`);
|
|
204
|
-
const typeString = `import('vue').UnwrapRef<typeof ${id}>`;
|
|
205
|
-
const defineModel = rootMap.get(root).defineModel ??= [];
|
|
206
|
-
defineModel.push(`${modelName.includes("-") ? `'${modelName}'` : modelName}${isRequired ? ":" : "?:"} ${typeString}`, `'onUpdate:${modelName}'?: ($event: ${typeString}) => any`);
|
|
207
|
-
if (expression.typeArguments?.[1]) defineModel.push(`${modelName}Modifiers?: Partial<Record<${expression.typeArguments[1].getText(ast)}, boolean>>`);
|
|
208
|
-
(0, ts_macro.replaceRange)(codes, initializer.getStart(ast), initializer.getStart(ast), `// @ts-ignore\n${id};\nlet ${id} = `);
|
|
209
|
-
} else if (options.defineSlots.alias.includes(macroName)) {
|
|
210
|
-
(0, ts_macro.replaceRange)(codes, expression.getStart(ast), expression.getStart(ast), `// @ts-ignore\n${__vue_macros_common.HELPER_PREFIX}slots;\nconst ${__vue_macros_common.HELPER_PREFIX}slots = `);
|
|
211
|
-
rootMap.get(root).defineSlots = `Partial<typeof ${__vue_macros_common.HELPER_PREFIX}slots>`;
|
|
212
|
-
} else if (options.defineExpose.alias.includes(macroName)) {
|
|
213
|
-
(0, ts_macro.replaceRange)(codes, expression.getStart(ast), expression.getStart(ast), `// @ts-ignore\n${__vue_macros_common.HELPER_PREFIX}exposed;\nconst ${__vue_macros_common.HELPER_PREFIX}exposed = `);
|
|
214
|
-
rootMap.get(root).defineExpose = `typeof ${__vue_macros_common.HELPER_PREFIX}exposed`;
|
|
222
|
+
}
|
|
215
223
|
}
|
|
224
|
+
ts.forEachChild(node, (child) => {
|
|
225
|
+
parents.unshift(node);
|
|
226
|
+
walk(child, parents);
|
|
227
|
+
parents.shift();
|
|
228
|
+
});
|
|
216
229
|
}
|
|
217
230
|
ts.forEachChild(ast, (node) => walk(node, []));
|
|
218
231
|
return rootMap;
|
package/dist/volar.js
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { resolveOptions } from "./options-BWRkHmm5.js";
|
|
2
2
|
import { HELPER_PREFIX, createFilter } from "@vue-macros/common";
|
|
3
3
|
import { allCodeFeatures, createPlugin, replaceRange } from "ts-macro";
|
|
4
|
-
import { generateClassProperty } from "@vue/language-core/lib/codegen/style/classProperty.js";
|
|
5
|
-
import { parseCssClassNames } from "@vue/language-core/lib/utils/parseCssClassNames.js";
|
|
6
4
|
|
|
7
5
|
//#region src/volar/define-component.ts
|
|
8
6
|
function transformDefineComponent(node, parent, options) {
|
|
@@ -24,16 +22,10 @@ function transformDefineComponent(node, parent, options) {
|
|
|
24
22
|
|
|
25
23
|
//#endregion
|
|
26
24
|
//#region src/volar/define-style.ts
|
|
27
|
-
function transformDefineStyle(
|
|
28
|
-
if (!defineStyles?.length) return;
|
|
25
|
+
function transformDefineStyle({ expression, isCssModules }, index, options) {
|
|
29
26
|
const { ts, codes, ast } = options;
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
addEmbeddedCode(expression, index, options);
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
function* generateCssClassesType(css, offset, index) {
|
|
36
|
-
for (const className of [...parseCssClassNames(css)]) yield* generateClassProperty(index, className.text, className.offset + offset, "string");
|
|
27
|
+
if (isCssModules && expression?.arguments[0] && !expression.typeArguments && ts.isTemplateLiteral(expression.arguments[0])) replaceRange(codes, expression.arguments.pos - 1, expression.arguments.pos - 1, `<{`, ...parseCssClassNames(expression.arguments[0].getText(ast).slice(1, -1)).map(({ text }) => `\n'${text.slice(1)}': string`), "\n}>");
|
|
28
|
+
addEmbeddedCode(expression, index, options);
|
|
37
29
|
}
|
|
38
30
|
function addEmbeddedCode(expression, index, options) {
|
|
39
31
|
const { ts, ast } = options;
|
|
@@ -64,16 +56,33 @@ function addEmbeddedCode(expression, index, options) {
|
|
|
64
56
|
embeddedCodes: []
|
|
65
57
|
});
|
|
66
58
|
}
|
|
59
|
+
const commentReg = /(?<=\/\*)[\s\S]*?(?=\*\/)|(?<=\/\/)[\s\S]*?(?=\n)/g;
|
|
60
|
+
const cssClassNameReg = /(?=(\.[a-z_][-\w]*)[\s.,+~>:#)[{])/gi;
|
|
61
|
+
const fragmentReg = /(?<=\{)[^{]*(?=(?<!\\);)/g;
|
|
62
|
+
function parseCssClassNames(css) {
|
|
63
|
+
for (const reg of [commentReg, fragmentReg]) css = css.replace(reg, (match) => " ".repeat(match.length));
|
|
64
|
+
const matches = css.matchAll(cssClassNameReg);
|
|
65
|
+
const result = [];
|
|
66
|
+
for (const match of matches) {
|
|
67
|
+
const matchText = match[1];
|
|
68
|
+
if (matchText) result.push({
|
|
69
|
+
offset: match.index,
|
|
70
|
+
text: matchText
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
return result;
|
|
74
|
+
}
|
|
67
75
|
|
|
68
76
|
//#endregion
|
|
69
77
|
//#region src/volar/transform.ts
|
|
70
78
|
function transformJsxMacros(rootMap, options) {
|
|
71
79
|
const { ts, codes, ast } = options;
|
|
72
|
-
|
|
73
|
-
|
|
80
|
+
let defineStyleIndex = 0;
|
|
81
|
+
for (const [root, macros] of rootMap) {
|
|
82
|
+
macros.defineStyle?.forEach((defaultStyle) => transformDefineStyle(defaultStyle, defineStyleIndex++, options));
|
|
74
83
|
if (!root?.body) continue;
|
|
75
84
|
const asyncModifier = root.modifiers?.find((modifier) => modifier.kind === ts.SyntaxKind.AsyncKeyword);
|
|
76
|
-
if (asyncModifier &&
|
|
85
|
+
if (asyncModifier && macros.defineComponent) replaceRange(codes, asyncModifier.pos, asyncModifier.end);
|
|
77
86
|
const result = `({}) as __VLS_PickNotAny<typeof ${HELPER_PREFIX}ctx.render, {}> & { __ctx: typeof ${HELPER_PREFIX}ctx }`;
|
|
78
87
|
const propsType = root.parameters[0]?.type ? String(root.parameters[0].type.getText(ast)) : "{}";
|
|
79
88
|
replaceRange(codes, root.parameters.pos, root.parameters.pos, ts.isArrowFunction(root) && root.parameters.pos === root.pos ? "(" : "", `${HELPER_PREFIX}props: typeof ${HELPER_PREFIX}ctx.props & ${propsType}, `, `${HELPER_PREFIX}placeholder?: {}, `, `${HELPER_PREFIX}ctx = {} as Awaited<ReturnType<typeof ${HELPER_PREFIX}setup>>, `, `${HELPER_PREFIX}setup = (${asyncModifier ? "async" : ""}(`);
|
|
@@ -84,16 +93,16 @@ function transformJsxMacros(rootMap, options) {
|
|
|
84
93
|
}
|
|
85
94
|
ts.forEachChild(root.body, (node) => {
|
|
86
95
|
if (ts.isReturnStatement(node) && node.expression) {
|
|
87
|
-
const props = [...
|
|
96
|
+
const props = [...macros.defineModel ?? []];
|
|
88
97
|
const elements = root.parameters[0] && !root.parameters[0].type && ts.isObjectBindingPattern(root.parameters[0].name) ? root.parameters[0].name.elements : [];
|
|
89
98
|
for (const element of elements) if (ts.isIdentifier(element.name)) props.push(`${element.name.escapedText}${element.initializer && ts.isNonNullExpression(element.initializer) ? ":" : "?:"} typeof ${element.name.escapedText}`);
|
|
90
|
-
const shouldWrapByCall = (ts.isArrowFunction(node.expression) || ts.isFunctionExpression(node.expression)) &&
|
|
99
|
+
const shouldWrapByCall = (ts.isArrowFunction(node.expression) || ts.isFunctionExpression(node.expression)) && macros.defineComponent;
|
|
91
100
|
replaceRange(codes, node.getStart(ast), node.expression.getStart(ast), `const ${HELPER_PREFIX}render = `, shouldWrapByCall ? "(" : "");
|
|
92
101
|
replaceRange(codes, node.expression.end, node.expression.end, shouldWrapByCall ? ")()" : "", `
|
|
93
102
|
return {
|
|
94
103
|
props: {} as {${props.join(", ")}},
|
|
95
|
-
slots: {} as ${
|
|
96
|
-
expose: (exposed: import('vue').ShallowUnwrapRef<${
|
|
104
|
+
slots: {} as ${macros.defineSlots ?? "{}"},
|
|
105
|
+
expose: (exposed: import('vue').ShallowUnwrapRef<${macros.defineExpose ?? "{}"}>) => {},
|
|
97
106
|
render: ${HELPER_PREFIX}render,
|
|
98
107
|
}`);
|
|
99
108
|
}
|
|
@@ -115,7 +124,6 @@ ${defineSlots}
|
|
|
115
124
|
${defineExpose}
|
|
116
125
|
${defineStyle}
|
|
117
126
|
type ${HELPER_PREFIX}StyleArgs = [style: string, options?: { scoped?: boolean }];
|
|
118
|
-
type ${HELPER_PREFIX}PrettifyLocal<T> = { [K in keyof T]: T[K]; } & {};
|
|
119
127
|
// @ts-ignore
|
|
120
128
|
type __VLS_IsAny<T> = 0 extends 1 & T ? true : false; type __VLS_PickNotAny<A, B> = __VLS_IsAny<A> extends true ? B : A;
|
|
121
129
|
`;
|
|
@@ -162,11 +170,6 @@ function getRootMap(options) {
|
|
|
162
170
|
const { ts, ast, codes } = options;
|
|
163
171
|
const rootMap = new Map();
|
|
164
172
|
function walk(node, parents) {
|
|
165
|
-
ts.forEachChild(node, (child) => {
|
|
166
|
-
parents.unshift(node);
|
|
167
|
-
walk(child, parents);
|
|
168
|
-
parents.shift();
|
|
169
|
-
});
|
|
170
173
|
const root = parents[1] && (ts.isArrowFunction(parents[1]) || ts.isFunctionExpression(parents[1]) || ts.isFunctionDeclaration(parents[1])) ? parents[1] : void 0;
|
|
171
174
|
if (root && parents[2] && ts.isCallExpression(parents[2]) && !parents[2].typeArguments && options.defineComponent.alias.includes(parents[2].expression.getText(ast))) {
|
|
172
175
|
if (!rootMap.has(root)) rootMap.set(root, {});
|
|
@@ -176,40 +179,50 @@ function getRootMap(options) {
|
|
|
176
179
|
}
|
|
177
180
|
}
|
|
178
181
|
const macro = getMacro(node, ts, options);
|
|
179
|
-
if (
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
182
|
+
if (macro) {
|
|
183
|
+
const { expression, initializer } = macro;
|
|
184
|
+
let isRequired = macro.isRequired;
|
|
185
|
+
if (!rootMap.has(root)) rootMap.set(root, {});
|
|
186
|
+
const macroName = expression.expression.getText(ast);
|
|
187
|
+
if (macroName.startsWith("defineStyle")) {
|
|
188
|
+
(rootMap.get(root).defineStyle ??= []).push({
|
|
189
|
+
expression,
|
|
190
|
+
isCssModules: ts.isVariableStatement(node)
|
|
191
|
+
});
|
|
192
|
+
return;
|
|
193
|
+
}
|
|
194
|
+
if (root) {
|
|
195
|
+
if (options.defineModel.alias.includes(macroName)) {
|
|
196
|
+
const modelName = expression.arguments[0] && ts.isStringLiteralLike(expression.arguments[0]) ? expression.arguments[0].text : "modelValue";
|
|
197
|
+
const modelOptions = expression.arguments[0] && ts.isStringLiteralLike(expression.arguments[0]) ? expression.arguments[1] : expression.arguments[0];
|
|
198
|
+
if (modelOptions && ts.isObjectLiteralExpression(modelOptions)) {
|
|
199
|
+
let hasRequired = false;
|
|
200
|
+
for (const prop of modelOptions.properties) if (ts.isPropertyAssignment(prop) && prop.name.getText(ast) === "required") {
|
|
201
|
+
hasRequired = true;
|
|
202
|
+
isRequired = prop.initializer.kind === ts.SyntaxKind.TrueKeyword;
|
|
203
|
+
}
|
|
204
|
+
if (!hasRequired && isRequired) replaceRange(codes, modelOptions.end - 1, modelOptions.end - 1, `${!modelOptions.properties.hasTrailingComma && modelOptions.properties.length ? "," : ""} required: true`);
|
|
205
|
+
} else if (isRequired) replaceRange(codes, expression.arguments.end, expression.arguments.end, `${!expression.arguments.hasTrailingComma && expression.arguments.length ? "," : ""} { required: true }`);
|
|
206
|
+
const id = toValidAssetId(modelName, `${HELPER_PREFIX}model`);
|
|
207
|
+
const typeString = `import('vue').UnwrapRef<typeof ${id}>`;
|
|
208
|
+
const defineModel = rootMap.get(root).defineModel ??= [];
|
|
209
|
+
defineModel.push(`${modelName.includes("-") ? `'${modelName}'` : modelName}${isRequired ? ":" : "?:"} ${typeString}`, `'onUpdate:${modelName}'?: ($event: ${typeString}) => any`);
|
|
210
|
+
if (expression.typeArguments?.[1]) defineModel.push(`${modelName}Modifiers?: Partial<Record<${expression.typeArguments[1].getText(ast)}, boolean>>`);
|
|
211
|
+
if (ts.isVariableStatement(node)) replaceRange(codes, initializer.getStart(ast), initializer.getStart(ast), `// @ts-ignore\n${id};\nlet ${id} = `);
|
|
212
|
+
} else if (options.defineSlots.alias.includes(macroName)) {
|
|
213
|
+
replaceRange(codes, expression.getStart(ast), expression.getStart(ast), `// @ts-ignore\n${HELPER_PREFIX}slots;\nconst ${HELPER_PREFIX}slots = `);
|
|
214
|
+
rootMap.get(root).defineSlots = `Partial<typeof ${HELPER_PREFIX}slots>`;
|
|
215
|
+
} else if (options.defineExpose.alias.includes(macroName)) {
|
|
216
|
+
replaceRange(codes, expression.getStart(ast), expression.getStart(ast), `// @ts-ignore\n${HELPER_PREFIX}exposed;\nconst ${HELPER_PREFIX}exposed = `);
|
|
217
|
+
rootMap.get(root).defineExpose = `typeof ${HELPER_PREFIX}exposed`;
|
|
197
218
|
}
|
|
198
|
-
|
|
199
|
-
} else if (isRequired) replaceRange(codes, expression.arguments.end, expression.arguments.end, `${!expression.arguments.hasTrailingComma && expression.arguments.length ? "," : ""} { required: true }`);
|
|
200
|
-
const id = toValidAssetId(modelName, `${HELPER_PREFIX}model`);
|
|
201
|
-
const typeString = `import('vue').UnwrapRef<typeof ${id}>`;
|
|
202
|
-
const defineModel = rootMap.get(root).defineModel ??= [];
|
|
203
|
-
defineModel.push(`${modelName.includes("-") ? `'${modelName}'` : modelName}${isRequired ? ":" : "?:"} ${typeString}`, `'onUpdate:${modelName}'?: ($event: ${typeString}) => any`);
|
|
204
|
-
if (expression.typeArguments?.[1]) defineModel.push(`${modelName}Modifiers?: Partial<Record<${expression.typeArguments[1].getText(ast)}, boolean>>`);
|
|
205
|
-
replaceRange(codes, initializer.getStart(ast), initializer.getStart(ast), `// @ts-ignore\n${id};\nlet ${id} = `);
|
|
206
|
-
} else if (options.defineSlots.alias.includes(macroName)) {
|
|
207
|
-
replaceRange(codes, expression.getStart(ast), expression.getStart(ast), `// @ts-ignore\n${HELPER_PREFIX}slots;\nconst ${HELPER_PREFIX}slots = `);
|
|
208
|
-
rootMap.get(root).defineSlots = `Partial<typeof ${HELPER_PREFIX}slots>`;
|
|
209
|
-
} else if (options.defineExpose.alias.includes(macroName)) {
|
|
210
|
-
replaceRange(codes, expression.getStart(ast), expression.getStart(ast), `// @ts-ignore\n${HELPER_PREFIX}exposed;\nconst ${HELPER_PREFIX}exposed = `);
|
|
211
|
-
rootMap.get(root).defineExpose = `typeof ${HELPER_PREFIX}exposed`;
|
|
219
|
+
}
|
|
212
220
|
}
|
|
221
|
+
ts.forEachChild(node, (child) => {
|
|
222
|
+
parents.unshift(node);
|
|
223
|
+
walk(child, parents);
|
|
224
|
+
parents.shift();
|
|
225
|
+
});
|
|
213
226
|
}
|
|
214
227
|
ts.forEachChild(ast, (node) => walk(node, []));
|
|
215
228
|
return rootMap;
|
package/dist/webpack.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
|
-
require('./core-
|
|
3
|
-
require('./raw-
|
|
2
|
+
require('./core-C740HxiF.cjs');
|
|
3
|
+
require('./raw-BXpT71mV.cjs');
|
|
4
4
|
require('./options-BSX_vMxh.cjs');
|
|
5
|
-
require('./src-
|
|
6
|
-
const require_webpack = require('./webpack-
|
|
5
|
+
require('./src-2EUAmvRo.cjs');
|
|
6
|
+
const require_webpack = require('./webpack-qmJC3FBB.cjs');
|
|
7
7
|
|
|
8
8
|
exports.default = require_webpack.webpack_default
|
package/dist/webpack.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import "./core-
|
|
2
|
-
import "./raw-
|
|
1
|
+
import "./core-CHBxRAvb.js";
|
|
2
|
+
import "./raw-Hr7QYA0U.js";
|
|
3
3
|
import "./options-BWRkHmm5.js";
|
|
4
|
-
import "./src-
|
|
5
|
-
import { webpack_default } from "./webpack-
|
|
4
|
+
import "./src-BDMVJUXS.js";
|
|
5
|
+
import { webpack_default } from "./webpack-C78RZrII.js";
|
|
6
6
|
|
|
7
7
|
export { webpack_default as default };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vue-jsx-vapor/macros",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.6",
|
|
4
4
|
"description": "Macros for Vue JSX Vapor",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|
|
@@ -167,11 +167,10 @@
|
|
|
167
167
|
}
|
|
168
168
|
},
|
|
169
169
|
"dependencies": {
|
|
170
|
-
"@vue-macros/common": "^3.0.0-beta.
|
|
171
|
-
"@vue/compiler-sfc": "https://pkg.pr.new/@vue/compiler-sfc@
|
|
172
|
-
"@vue/language-core": "^2.2.8",
|
|
170
|
+
"@vue-macros/common": "^3.0.0-beta.12",
|
|
171
|
+
"@vue/compiler-sfc": "https://pkg.pr.new/@vue/compiler-sfc@d386396",
|
|
173
172
|
"hash-sum": "^2.0.0",
|
|
174
|
-
"ts-macro": "^0.1.
|
|
173
|
+
"ts-macro": "^0.1.29",
|
|
175
174
|
"unplugin": "^2.2.2"
|
|
176
175
|
},
|
|
177
176
|
"devDependencies": {
|
|
@@ -179,8 +178,8 @@
|
|
|
179
178
|
"@nuxt/kit": "^3.16.0",
|
|
180
179
|
"@nuxt/schema": "^3.16.0",
|
|
181
180
|
"@types/hash-sum": "^1.0.2",
|
|
182
|
-
"@vue-macros/test-utils": "^3.0.0-beta.
|
|
183
|
-
"vue": "https://pkg.pr.new/vue@
|
|
181
|
+
"@vue-macros/test-utils": "^3.0.0-beta.12",
|
|
182
|
+
"vue": "https://pkg.pr.new/vue@d386396"
|
|
184
183
|
},
|
|
185
184
|
"scripts": {
|
|
186
185
|
"build": "tsdown",
|