@vue-jsx-vapor/compiler 0.1.4 → 0.1.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/index.cjs +32 -47
- package/dist/index.d.cts +5 -8
- package/dist/index.d.ts +5 -8
- package/dist/index.js +31 -46
- package/package.json +6 -6
package/dist/index.cjs
CHANGED
@@ -1,4 +1,4 @@
|
|
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; }// src/index.ts
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); 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; }// src/index.ts
|
2
2
|
var _compilervapor = require('@vue/compiler-vapor');
|
3
3
|
|
4
4
|
// src/compile.ts
|
@@ -20,7 +20,6 @@ var _parser = require('@babel/parser');
|
|
20
20
|
|
21
21
|
|
22
22
|
|
23
|
-
|
24
23
|
// src/transforms/utils.ts
|
25
24
|
|
26
25
|
|
@@ -83,14 +82,11 @@ var isConstant = (node) => {
|
|
83
82
|
}
|
84
83
|
return false;
|
85
84
|
};
|
86
|
-
function isLiteralExpressionContainer(node) {
|
87
|
-
return _optionalChain([node, 'optionalAccess', _2 => _2.type]) === "JSXExpressionContainer" && node.expression.type !== "JSXEmptyExpression" && isConstant(node.expression);
|
88
|
-
}
|
89
85
|
var EMPTY_TEXT_REGEX = /^\s*[\n\r]\s*$/;
|
90
86
|
var START_EMPTY_TEXT_REGEX = /^\s*[\n\r]/;
|
91
87
|
var END_EMPTY_TEXT_REGEX = /[\n\r]\s*$/;
|
92
88
|
function resolveJSXText(node) {
|
93
|
-
if (EMPTY_TEXT_REGEX.test(`${_optionalChain([node, 'access',
|
89
|
+
if (EMPTY_TEXT_REGEX.test(`${_optionalChain([node, 'access', _2 => _2.extra, 'optionalAccess', _3 => _3.raw])}`)) {
|
94
90
|
return "";
|
95
91
|
}
|
96
92
|
let value = node.value;
|
@@ -103,27 +99,26 @@ function resolveJSXText(node) {
|
|
103
99
|
return value;
|
104
100
|
}
|
105
101
|
function isEmptyText(node) {
|
106
|
-
return node.type === "JSXText" && EMPTY_TEXT_REGEX.test(`${_optionalChain([node, 'access',
|
102
|
+
return node.type === "JSXText" && EMPTY_TEXT_REGEX.test(`${_optionalChain([node, 'access', _4 => _4.extra, 'optionalAccess', _5 => _5.raw])}`) || node.type === "JSXExpressionContainer" && node.expression.type === "JSXEmptyExpression";
|
107
103
|
}
|
108
104
|
function resolveExpression(node, context, effect = false) {
|
105
|
+
node = _optionalChain([node, 'optionalAccess', _6 => _6.type]) === "JSXExpressionContainer" ? node.expression : node;
|
109
106
|
const isStatic = !!node && (node.type === "StringLiteral" || node.type === "JSXText" || node.type === "JSXIdentifier");
|
110
|
-
let source = !node ? "" : node.type === "JSXIdentifier" ? node.name : node.type === "StringLiteral" ? node.value : node.type === "JSXText" ? resolveJSXText(node) : node.type === "
|
111
|
-
node.expression.start,
|
112
|
-
node.expression.end
|
113
|
-
) : context.ir.source.slice(node.start, node.end);
|
107
|
+
let source = !node || node.type === "JSXEmptyExpression" ? "" : node.type === "JSXIdentifier" ? node.name : node.type === "StringLiteral" ? node.value : node.type === "JSXText" ? resolveJSXText(node) : node.type === "Identifier" ? node.name : context.ir.source.slice(node.start, node.end);
|
114
108
|
const location = node ? node.loc : null;
|
115
|
-
|
109
|
+
let ast;
|
110
|
+
if (source && !isStatic && effect && !isConstant(node)) {
|
116
111
|
source = `() => (${source})`;
|
117
112
|
}
|
118
|
-
return resolveSimpleExpression(source, isStatic, location);
|
113
|
+
return resolveSimpleExpression(source, isStatic, location, ast);
|
119
114
|
}
|
120
|
-
function resolveSimpleExpression(source, isStatic, location) {
|
115
|
+
function resolveSimpleExpression(source, isStatic, location, ast) {
|
121
116
|
const result = _compilerdom.createSimpleExpression.call(void 0,
|
122
117
|
source,
|
123
118
|
isStatic,
|
124
119
|
resolveLocation(location, source)
|
125
120
|
);
|
126
|
-
result.ast = null;
|
121
|
+
result.ast = _nullishCoalesce(ast, () => ( null));
|
127
122
|
return result;
|
128
123
|
}
|
129
124
|
function resolveLocation(location, context) {
|
@@ -417,24 +412,21 @@ var TransformContext = class _TransformContext {
|
|
417
412
|
if (this.inVOnce || expressions.length === 0) {
|
418
413
|
return this.registerOperation(...operations);
|
419
414
|
}
|
420
|
-
const ids = /* @__PURE__ */ new Set();
|
421
|
-
expressions.forEach((exp) => extractIdentifiers(ids, exp));
|
422
415
|
const existing = this.block.effect.find(
|
423
|
-
(e) =>
|
416
|
+
(e) => isSameExpression(e.expressions, expressions)
|
424
417
|
);
|
425
418
|
if (existing) {
|
426
419
|
existing.operations.push(...operations);
|
427
420
|
} else {
|
428
421
|
this.block.effect.push({
|
429
422
|
expressions,
|
430
|
-
operations
|
431
|
-
earlyCheckExps: [],
|
432
|
-
declareNames: /* @__PURE__ */ new Set(),
|
433
|
-
rewrittenNames: /* @__PURE__ */ new Set(),
|
434
|
-
inVFor: this.inVFor > 0,
|
435
|
-
identifiers: Array.from(ids)
|
423
|
+
operations
|
436
424
|
});
|
437
425
|
}
|
426
|
+
function isSameExpression(a, b) {
|
427
|
+
if (a.length !== b.length) return false;
|
428
|
+
return a.every((exp, i) => exp.content === b[i].content);
|
429
|
+
}
|
438
430
|
}
|
439
431
|
registerOperation(...node) {
|
440
432
|
this.block.operation.push(...node);
|
@@ -492,13 +484,6 @@ function transformNode(context) {
|
|
492
484
|
context.registerTemplate();
|
493
485
|
}
|
494
486
|
}
|
495
|
-
function extractIdentifiers(ids, node) {
|
496
|
-
if (node.ast) {
|
497
|
-
_compilerdom.walkIdentifiers.call(void 0, node.ast, (n) => ids.add(n.name), true);
|
498
|
-
} else if (node.ast === null) {
|
499
|
-
ids.add(node.content);
|
500
|
-
}
|
501
|
-
}
|
502
487
|
|
503
488
|
// src/transforms/transformElement.ts
|
504
489
|
|
@@ -1307,10 +1292,6 @@ var transformVHtml = (dir, node, context) => {
|
|
1307
1292
|
function compile(source, options = {}) {
|
1308
1293
|
const onError = options.onError || _compilerdom.defaultOnError;
|
1309
1294
|
const isModuleMode = options.mode === "module";
|
1310
|
-
const __BROWSER__3 = false;
|
1311
|
-
if (__BROWSER__3 && isModuleMode) {
|
1312
|
-
onError(_compilerdom.createCompilerError.call(void 0, _compilerdom.ErrorCodes.X_MODULE_MODE_NOT_SUPPORTED));
|
1313
|
-
}
|
1314
1295
|
if (options.scopeId && !isModuleMode) {
|
1315
1296
|
onError(_compilerdom.createCompilerError.call(void 0, _compilerdom.ErrorCodes.X_SCOPE_ID_NOT_SUPPORTED));
|
1316
1297
|
}
|
@@ -1318,7 +1299,7 @@ function compile(source, options = {}) {
|
|
1318
1299
|
prefixIdentifiers: false,
|
1319
1300
|
expressionPlugins: options.expressionPlugins || ["jsx"]
|
1320
1301
|
});
|
1321
|
-
if (
|
1302
|
+
if (options.isTS) {
|
1322
1303
|
const { expressionPlugins } = resolvedOptions;
|
1323
1304
|
if (!expressionPlugins.includes("typescript")) {
|
1324
1305
|
resolvedOptions.expressionPlugins = [
|
@@ -1327,21 +1308,25 @@ function compile(source, options = {}) {
|
|
1327
1308
|
];
|
1328
1309
|
}
|
1329
1310
|
}
|
1330
|
-
|
1331
|
-
|
1332
|
-
|
1333
|
-
|
1334
|
-
|
1335
|
-
|
1336
|
-
|
1337
|
-
|
1338
|
-
|
1311
|
+
let expression;
|
1312
|
+
if (_shared.isString.call(void 0, source)) {
|
1313
|
+
const {
|
1314
|
+
body: [statement]
|
1315
|
+
} = _parser.parse.call(void 0, source, {
|
1316
|
+
sourceType: "module",
|
1317
|
+
plugins: resolvedOptions.expressionPlugins
|
1318
|
+
}).program;
|
1319
|
+
if (statement.type === "ExpressionStatement") {
|
1320
|
+
expression = statement.expression;
|
1321
|
+
}
|
1322
|
+
} else {
|
1323
|
+
expression = source;
|
1339
1324
|
}
|
1325
|
+
const children = expression.type === "JSXFragment" ? expression.children : expression.type === "JSXElement" ? [expression] : [];
|
1340
1326
|
const ast = {
|
1341
1327
|
type: 0 /* ROOT */,
|
1342
1328
|
children,
|
1343
|
-
source: _shared.isString.call(void 0, source) ? source : "",
|
1344
|
-
// TODO
|
1329
|
+
source: _shared.isString.call(void 0, source) ? source : options.source || "",
|
1345
1330
|
components: [],
|
1346
1331
|
directives: [],
|
1347
1332
|
helpers: /* @__PURE__ */ new Set(),
|
package/dist/index.d.cts
CHANGED
@@ -2,7 +2,7 @@ import { IRFor as IRFor$1, VaporCodegenResult as VaporCodegenResult$1 } from '@v
|
|
2
2
|
export { generate } from '@vue/compiler-vapor';
|
3
3
|
import { SimpleExpressionNode, BindingTypes, DirectiveNode, CompoundExpressionNode, TransformOptions as TransformOptions$1, CompilerCompatOptions, CommentNode, CompilerOptions as CompilerOptions$1, ElementNode } from '@vue/compiler-dom';
|
4
4
|
import * as _vue_runtime_vapor from '@vue/runtime-vapor';
|
5
|
-
import { JSXFragment, Node, JSXAttribute, JSXElement
|
5
|
+
import { JSXFragment, Node, JSXAttribute, JSXElement } from '@babel/types';
|
6
6
|
import { Prettify } from '@vue/shared';
|
7
7
|
|
8
8
|
interface IRProp extends Omit<DirectiveTransformResult, 'value'> {
|
@@ -272,12 +272,7 @@ interface IRDynamicInfo {
|
|
272
272
|
}
|
273
273
|
interface IREffect {
|
274
274
|
expressions: SimpleExpressionNode[];
|
275
|
-
identifiers: string[];
|
276
275
|
operations: OperationNode[];
|
277
|
-
declareNames: Set<string>;
|
278
|
-
rewrittenNames: Set<string>;
|
279
|
-
earlyCheckExps: string[];
|
280
|
-
inVFor: boolean;
|
281
276
|
}
|
282
277
|
type Overwrite<T, U> = Pick<T, Exclude<keyof T, keyof U>> & Pick<U, Extract<keyof U, keyof T>>;
|
283
278
|
type HackOptions<T> = Prettify<Overwrite<T, {
|
@@ -335,8 +330,10 @@ declare function transformNode(context: TransformContext<BlockIRNode['node']>):
|
|
335
330
|
interface VaporCodegenResult extends Omit<VaporCodegenResult$1, 'ast'> {
|
336
331
|
ast: RootIRNode;
|
337
332
|
}
|
338
|
-
declare function compile(source: string |
|
339
|
-
type CompilerOptions = HackOptions<CompilerOptions$1
|
333
|
+
declare function compile(source: string | JSXElement | JSXFragment, options?: CompilerOptions): VaporCodegenResult;
|
334
|
+
type CompilerOptions = HackOptions<CompilerOptions$1> & {
|
335
|
+
source?: string;
|
336
|
+
};
|
340
337
|
type TransformPreset = [
|
341
338
|
NodeTransform[],
|
342
339
|
Record<string, DirectiveTransform>
|
package/dist/index.d.ts
CHANGED
@@ -2,7 +2,7 @@ import { IRFor as IRFor$1, VaporCodegenResult as VaporCodegenResult$1 } from '@v
|
|
2
2
|
export { generate } from '@vue/compiler-vapor';
|
3
3
|
import { SimpleExpressionNode, BindingTypes, DirectiveNode, CompoundExpressionNode, TransformOptions as TransformOptions$1, CompilerCompatOptions, CommentNode, CompilerOptions as CompilerOptions$1, ElementNode } from '@vue/compiler-dom';
|
4
4
|
import * as _vue_runtime_vapor from '@vue/runtime-vapor';
|
5
|
-
import { JSXFragment, Node, JSXAttribute, JSXElement
|
5
|
+
import { JSXFragment, Node, JSXAttribute, JSXElement } from '@babel/types';
|
6
6
|
import { Prettify } from '@vue/shared';
|
7
7
|
|
8
8
|
interface IRProp extends Omit<DirectiveTransformResult, 'value'> {
|
@@ -272,12 +272,7 @@ interface IRDynamicInfo {
|
|
272
272
|
}
|
273
273
|
interface IREffect {
|
274
274
|
expressions: SimpleExpressionNode[];
|
275
|
-
identifiers: string[];
|
276
275
|
operations: OperationNode[];
|
277
|
-
declareNames: Set<string>;
|
278
|
-
rewrittenNames: Set<string>;
|
279
|
-
earlyCheckExps: string[];
|
280
|
-
inVFor: boolean;
|
281
276
|
}
|
282
277
|
type Overwrite<T, U> = Pick<T, Exclude<keyof T, keyof U>> & Pick<U, Extract<keyof U, keyof T>>;
|
283
278
|
type HackOptions<T> = Prettify<Overwrite<T, {
|
@@ -335,8 +330,10 @@ declare function transformNode(context: TransformContext<BlockIRNode['node']>):
|
|
335
330
|
interface VaporCodegenResult extends Omit<VaporCodegenResult$1, 'ast'> {
|
336
331
|
ast: RootIRNode;
|
337
332
|
}
|
338
|
-
declare function compile(source: string |
|
339
|
-
type CompilerOptions = HackOptions<CompilerOptions$1
|
333
|
+
declare function compile(source: string | JSXElement | JSXFragment, options?: CompilerOptions): VaporCodegenResult;
|
334
|
+
type CompilerOptions = HackOptions<CompilerOptions$1> & {
|
335
|
+
source?: string;
|
336
|
+
};
|
340
337
|
type TransformPreset = [
|
341
338
|
NodeTransform[],
|
342
339
|
Record<string, DirectiveTransform>
|
package/dist/index.js
CHANGED
@@ -16,10 +16,9 @@ import { parse } from "@babel/parser";
|
|
16
16
|
// src/transform.ts
|
17
17
|
import {
|
18
18
|
defaultOnError,
|
19
|
-
defaultOnWarn
|
20
|
-
walkIdentifiers
|
19
|
+
defaultOnWarn
|
21
20
|
} from "@vue/compiler-dom";
|
22
|
-
import { EMPTY_OBJ, NOOP, extend, isArray
|
21
|
+
import { EMPTY_OBJ, NOOP, extend, isArray } from "@vue/shared";
|
23
22
|
|
24
23
|
// src/transforms/utils.ts
|
25
24
|
import {
|
@@ -83,9 +82,6 @@ var isConstant = (node) => {
|
|
83
82
|
}
|
84
83
|
return false;
|
85
84
|
};
|
86
|
-
function isLiteralExpressionContainer(node) {
|
87
|
-
return node?.type === "JSXExpressionContainer" && node.expression.type !== "JSXEmptyExpression" && isConstant(node.expression);
|
88
|
-
}
|
89
85
|
var EMPTY_TEXT_REGEX = /^\s*[\n\r]\s*$/;
|
90
86
|
var START_EMPTY_TEXT_REGEX = /^\s*[\n\r]/;
|
91
87
|
var END_EMPTY_TEXT_REGEX = /[\n\r]\s*$/;
|
@@ -106,24 +102,23 @@ function isEmptyText(node) {
|
|
106
102
|
return node.type === "JSXText" && EMPTY_TEXT_REGEX.test(`${node.extra?.raw}`) || node.type === "JSXExpressionContainer" && node.expression.type === "JSXEmptyExpression";
|
107
103
|
}
|
108
104
|
function resolveExpression(node, context, effect = false) {
|
105
|
+
node = node?.type === "JSXExpressionContainer" ? node.expression : node;
|
109
106
|
const isStatic = !!node && (node.type === "StringLiteral" || node.type === "JSXText" || node.type === "JSXIdentifier");
|
110
|
-
let source = !node ? "" : node.type === "JSXIdentifier" ? node.name : node.type === "StringLiteral" ? node.value : node.type === "JSXText" ? resolveJSXText(node) : node.type === "
|
111
|
-
node.expression.start,
|
112
|
-
node.expression.end
|
113
|
-
) : context.ir.source.slice(node.start, node.end);
|
107
|
+
let source = !node || node.type === "JSXEmptyExpression" ? "" : node.type === "JSXIdentifier" ? node.name : node.type === "StringLiteral" ? node.value : node.type === "JSXText" ? resolveJSXText(node) : node.type === "Identifier" ? node.name : context.ir.source.slice(node.start, node.end);
|
114
108
|
const location = node ? node.loc : null;
|
115
|
-
|
109
|
+
let ast;
|
110
|
+
if (source && !isStatic && effect && !isConstant(node)) {
|
116
111
|
source = `() => (${source})`;
|
117
112
|
}
|
118
|
-
return resolveSimpleExpression(source, isStatic, location);
|
113
|
+
return resolveSimpleExpression(source, isStatic, location, ast);
|
119
114
|
}
|
120
|
-
function resolveSimpleExpression(source, isStatic, location) {
|
115
|
+
function resolveSimpleExpression(source, isStatic, location, ast) {
|
121
116
|
const result = createSimpleExpression(
|
122
117
|
source,
|
123
118
|
isStatic,
|
124
119
|
resolveLocation(location, source)
|
125
120
|
);
|
126
|
-
result.ast = null;
|
121
|
+
result.ast = ast ?? null;
|
127
122
|
return result;
|
128
123
|
}
|
129
124
|
function resolveLocation(location, context) {
|
@@ -417,24 +412,21 @@ var TransformContext = class _TransformContext {
|
|
417
412
|
if (this.inVOnce || expressions.length === 0) {
|
418
413
|
return this.registerOperation(...operations);
|
419
414
|
}
|
420
|
-
const ids = /* @__PURE__ */ new Set();
|
421
|
-
expressions.forEach((exp) => extractIdentifiers(ids, exp));
|
422
415
|
const existing = this.block.effect.find(
|
423
|
-
(e) =>
|
416
|
+
(e) => isSameExpression(e.expressions, expressions)
|
424
417
|
);
|
425
418
|
if (existing) {
|
426
419
|
existing.operations.push(...operations);
|
427
420
|
} else {
|
428
421
|
this.block.effect.push({
|
429
422
|
expressions,
|
430
|
-
operations
|
431
|
-
earlyCheckExps: [],
|
432
|
-
declareNames: /* @__PURE__ */ new Set(),
|
433
|
-
rewrittenNames: /* @__PURE__ */ new Set(),
|
434
|
-
inVFor: this.inVFor > 0,
|
435
|
-
identifiers: Array.from(ids)
|
423
|
+
operations
|
436
424
|
});
|
437
425
|
}
|
426
|
+
function isSameExpression(a, b) {
|
427
|
+
if (a.length !== b.length) return false;
|
428
|
+
return a.every((exp, i) => exp.content === b[i].content);
|
429
|
+
}
|
438
430
|
}
|
439
431
|
registerOperation(...node) {
|
440
432
|
this.block.operation.push(...node);
|
@@ -492,13 +484,6 @@ function transformNode(context) {
|
|
492
484
|
context.registerTemplate();
|
493
485
|
}
|
494
486
|
}
|
495
|
-
function extractIdentifiers(ids, node) {
|
496
|
-
if (node.ast) {
|
497
|
-
walkIdentifiers(node.ast, (n) => ids.add(n.name), true);
|
498
|
-
} else if (node.ast === null) {
|
499
|
-
ids.add(node.content);
|
500
|
-
}
|
501
|
-
}
|
502
487
|
|
503
488
|
// src/transforms/transformElement.ts
|
504
489
|
import { extend as extend2, isBuiltInDirective, isVoidTag, makeMap as makeMap2 } from "@vue/shared";
|
@@ -1307,10 +1292,6 @@ var transformVHtml = (dir, node, context) => {
|
|
1307
1292
|
function compile(source, options = {}) {
|
1308
1293
|
const onError = options.onError || defaultOnError2;
|
1309
1294
|
const isModuleMode = options.mode === "module";
|
1310
|
-
const __BROWSER__3 = false;
|
1311
|
-
if (__BROWSER__3 && isModuleMode) {
|
1312
|
-
onError(createCompilerError2(ErrorCodes2.X_MODULE_MODE_NOT_SUPPORTED));
|
1313
|
-
}
|
1314
1295
|
if (options.scopeId && !isModuleMode) {
|
1315
1296
|
onError(createCompilerError2(ErrorCodes2.X_SCOPE_ID_NOT_SUPPORTED));
|
1316
1297
|
}
|
@@ -1318,7 +1299,7 @@ function compile(source, options = {}) {
|
|
1318
1299
|
prefixIdentifiers: false,
|
1319
1300
|
expressionPlugins: options.expressionPlugins || ["jsx"]
|
1320
1301
|
});
|
1321
|
-
if (
|
1302
|
+
if (options.isTS) {
|
1322
1303
|
const { expressionPlugins } = resolvedOptions;
|
1323
1304
|
if (!expressionPlugins.includes("typescript")) {
|
1324
1305
|
resolvedOptions.expressionPlugins = [
|
@@ -1327,21 +1308,25 @@ function compile(source, options = {}) {
|
|
1327
1308
|
];
|
1328
1309
|
}
|
1329
1310
|
}
|
1330
|
-
|
1331
|
-
|
1332
|
-
|
1333
|
-
|
1334
|
-
|
1335
|
-
|
1336
|
-
|
1337
|
-
|
1338
|
-
|
1311
|
+
let expression;
|
1312
|
+
if (isString2(source)) {
|
1313
|
+
const {
|
1314
|
+
body: [statement]
|
1315
|
+
} = parse(source, {
|
1316
|
+
sourceType: "module",
|
1317
|
+
plugins: resolvedOptions.expressionPlugins
|
1318
|
+
}).program;
|
1319
|
+
if (statement.type === "ExpressionStatement") {
|
1320
|
+
expression = statement.expression;
|
1321
|
+
}
|
1322
|
+
} else {
|
1323
|
+
expression = source;
|
1339
1324
|
}
|
1325
|
+
const children = expression.type === "JSXFragment" ? expression.children : expression.type === "JSXElement" ? [expression] : [];
|
1340
1326
|
const ast = {
|
1341
1327
|
type: 0 /* ROOT */,
|
1342
1328
|
children,
|
1343
|
-
source: isString2(source) ? source : "",
|
1344
|
-
// TODO
|
1329
|
+
source: isString2(source) ? source : options.source || "",
|
1345
1330
|
components: [],
|
1346
1331
|
directives: [],
|
1347
1332
|
helpers: /* @__PURE__ */ new Set(),
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@vue-jsx-vapor/compiler",
|
3
|
-
"version": "0.1.
|
3
|
+
"version": "0.1.6",
|
4
4
|
"description": "Vue JSX Vapor Compiler",
|
5
5
|
"type": "module",
|
6
6
|
"keywords": [
|
@@ -51,11 +51,11 @@
|
|
51
51
|
"@babel/parser": "^7.26.7",
|
52
52
|
"@babel/types": "^7.26.7",
|
53
53
|
"@vue-macros/common": "^1.10.4",
|
54
|
-
"@vue/compiler-core": "https://pkg.pr.new/vuejs/vue-vapor/@vue/compiler-core@
|
55
|
-
"@vue/compiler-dom": "https://pkg.pr.new/vuejs/vue-vapor/@vue/compiler-dom@
|
56
|
-
"@vue/compiler-vapor": "https://pkg.pr.new/vuejs/vue-vapor/@vue/compiler-vapor@
|
57
|
-
"@vue/runtime-vapor": "https://pkg.pr.new/vuejs/vue-vapor/@vue/runtime-vapor@
|
58
|
-
"@vue/shared": "https://pkg.pr.new/vuejs/vue-vapor/@vue/shared@
|
54
|
+
"@vue/compiler-core": "https://pkg.pr.new/vuejs/vue-vapor/@vue/compiler-core@6d5bc43",
|
55
|
+
"@vue/compiler-dom": "https://pkg.pr.new/vuejs/vue-vapor/@vue/compiler-dom@6d5bc43",
|
56
|
+
"@vue/compiler-vapor": "https://pkg.pr.new/vuejs/vue-vapor/@vue/compiler-vapor@6d5bc43",
|
57
|
+
"@vue/runtime-vapor": "https://pkg.pr.new/vuejs/vue-vapor/@vue/runtime-vapor@6d5bc43",
|
58
|
+
"@vue/shared": "https://pkg.pr.new/vuejs/vue-vapor/@vue/shared@6d5bc43"
|
59
59
|
},
|
60
60
|
"scripts": {
|
61
61
|
"build": "tsup",
|