vite 3.0.0-alpha.0 → 3.0.0-alpha.11
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/LICENSE.md +26 -4
- package/bin/vite.js +5 -5
- package/client.d.ts +16 -2
- package/dist/client/client.mjs +34 -20
- package/dist/client/client.mjs.map +1 -1
- package/dist/node/chunks/{dep-a9015192.js → dep-17430d09.js} +20 -20
- package/dist/node/chunks/{dep-fafc4143.js → dep-46501b7a.js} +38000 -36456
- package/dist/node/chunks/{dep-2d9eaf08.js → dep-4e458630.js} +27 -29
- package/dist/node/chunks/{dep-63fe0f22.js → dep-d6e255b8.js} +111 -52
- package/dist/node/chunks/{dep-2056ae8a.js → dep-e8ca8d40.js} +9 -3
- package/dist/node/chunks/{dep-dfbd0b0c.js → dep-fb927717.js} +41 -37
- package/dist/node/cli.js +46 -48
- package/dist/node/constants.js +99 -0
- package/dist/node/index.d.ts +108 -17
- package/dist/node/index.js +38 -60
- package/dist/node-cjs/publicUtils.cjs +4174 -0
- package/index.cjs +33 -0
- package/package.json +48 -29
- package/src/client/client.ts +34 -17
- package/src/client/tsconfig.json +1 -1
- package/types/importGlob.d.ts +1 -3
- package/dist/node/terser.js +0 -32876
|
@@ -1,15 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import require$$0 from 'postcss';
|
|
2
|
+
import { x as commonjsGlobal } from './dep-46501b7a.js';
|
|
3
|
+
import path$2 from 'path';
|
|
4
|
+
import require$$1 from 'crypto';
|
|
5
|
+
import fs__default from 'fs';
|
|
6
|
+
import require$$0$1 from 'util';
|
|
7
|
+
import { l as lib$1 } from './dep-e8ca8d40.js';
|
|
8
|
+
|
|
9
|
+
import { fileURLToPath as __cjs_fileURLToPath } from 'url';
|
|
10
|
+
import { dirname as __cjs_dirname } from 'path';
|
|
11
|
+
import { createRequire as __cjs_createRequire } from 'module';
|
|
12
|
+
|
|
13
|
+
const __filename = __cjs_fileURLToPath(import.meta.url);
|
|
14
|
+
const __dirname = __cjs_dirname(__filename);
|
|
15
|
+
const require = __cjs_createRequire(import.meta.url);
|
|
16
|
+
const __require = require;
|
|
13
17
|
function _mergeNamespaces(n, m) {
|
|
14
18
|
for (var i = 0; i < m.length; i++) {
|
|
15
19
|
var e = m[i];
|
|
@@ -22,12 +26,6 @@ function _mergeNamespaces(n, m) {
|
|
|
22
26
|
return n;
|
|
23
27
|
}
|
|
24
28
|
|
|
25
|
-
var require$$0__default = /*#__PURE__*/_interopDefaultLegacy(require$$0);
|
|
26
|
-
var path__default = /*#__PURE__*/_interopDefaultLegacy(path$2);
|
|
27
|
-
var require$$1__default = /*#__PURE__*/_interopDefaultLegacy(require$$1);
|
|
28
|
-
var fs__default = /*#__PURE__*/_interopDefaultLegacy(fs);
|
|
29
|
-
var require$$0__default$1 = /*#__PURE__*/_interopDefaultLegacy(require$$0$1);
|
|
30
|
-
|
|
31
29
|
var build$1 = {exports: {}};
|
|
32
30
|
|
|
33
31
|
/**
|
|
@@ -181,7 +179,7 @@ var deburredLetters = {
|
|
|
181
179
|
};
|
|
182
180
|
|
|
183
181
|
/** Detect free variable `global` from Node.js. */
|
|
184
|
-
var freeGlobal = typeof
|
|
182
|
+
var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
|
|
185
183
|
|
|
186
184
|
/** Detect free variable `self`. */
|
|
187
185
|
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
|
|
@@ -1138,7 +1136,7 @@ function getHashDigest$1(buffer, algorithm, digestType, maxLength) {
|
|
|
1138
1136
|
hash = new BatchedHash(createMd4());
|
|
1139
1137
|
} else if (algorithm === "native-md4") {
|
|
1140
1138
|
if (typeof crypto === "undefined") {
|
|
1141
|
-
crypto = require$$
|
|
1139
|
+
crypto = require$$1;
|
|
1142
1140
|
|
|
1143
1141
|
if (BulkUpdateDecorator === undefined) {
|
|
1144
1142
|
BulkUpdateDecorator = BulkUpdateDecorator_1;
|
|
@@ -1148,7 +1146,7 @@ function getHashDigest$1(buffer, algorithm, digestType, maxLength) {
|
|
|
1148
1146
|
hash = new BulkUpdateDecorator(() => crypto.createHash("md4"), "md4");
|
|
1149
1147
|
} else {
|
|
1150
1148
|
if (typeof crypto === "undefined") {
|
|
1151
|
-
crypto = require$$
|
|
1149
|
+
crypto = require$$1;
|
|
1152
1150
|
|
|
1153
1151
|
if (BulkUpdateDecorator === undefined) {
|
|
1154
1152
|
BulkUpdateDecorator = BulkUpdateDecorator_1;
|
|
@@ -1180,7 +1178,7 @@ function getHashDigest$1(buffer, algorithm, digestType, maxLength) {
|
|
|
1180
1178
|
|
|
1181
1179
|
var getHashDigest_1 = getHashDigest$1;
|
|
1182
1180
|
|
|
1183
|
-
const path$1 =
|
|
1181
|
+
const path$1 = path$2;
|
|
1184
1182
|
const getHashDigest = getHashDigest_1;
|
|
1185
1183
|
|
|
1186
1184
|
function interpolateName$1(loaderContext, name, options = {}) {
|
|
@@ -1296,7 +1294,7 @@ function interpolateName$1(loaderContext, name, options = {}) {
|
|
|
1296
1294
|
var interpolateName_1 = interpolateName$1;
|
|
1297
1295
|
|
|
1298
1296
|
var interpolateName = interpolateName_1;
|
|
1299
|
-
var path =
|
|
1297
|
+
var path = path$2;
|
|
1300
1298
|
|
|
1301
1299
|
/**
|
|
1302
1300
|
* @param {string} pattern
|
|
@@ -1480,7 +1478,7 @@ Object.defineProperty(loader, "__esModule", {
|
|
|
1480
1478
|
value: true
|
|
1481
1479
|
});
|
|
1482
1480
|
|
|
1483
|
-
var _postcss$1 = require$$
|
|
1481
|
+
var _postcss$1 = require$$0;
|
|
1484
1482
|
|
|
1485
1483
|
var _postcss2$1 = _interopRequireDefault$5(_postcss$1);
|
|
1486
1484
|
|
|
@@ -1488,7 +1486,7 @@ var _fs$1 = fs__default;
|
|
|
1488
1486
|
|
|
1489
1487
|
var _fs2 = _interopRequireDefault$5(_fs$1);
|
|
1490
1488
|
|
|
1491
|
-
var _path =
|
|
1489
|
+
var _path = path$2;
|
|
1492
1490
|
|
|
1493
1491
|
var _path2 = _interopRequireDefault$5(_path);
|
|
1494
1492
|
|
|
@@ -3113,7 +3111,7 @@ var attribute$1 = {};
|
|
|
3113
3111
|
* For Node.js, simply re-export the core `util.deprecate` function.
|
|
3114
3112
|
*/
|
|
3115
3113
|
|
|
3116
|
-
var node = require$$
|
|
3114
|
+
var node = require$$0$1.deprecate;
|
|
3117
3115
|
|
|
3118
3116
|
(function (exports) {
|
|
3119
3117
|
|
|
@@ -6001,7 +5999,7 @@ var src$3 = {
|
|
|
6001
5999
|
};
|
|
6002
6000
|
|
|
6003
6001
|
const selectorParser$1 = dist.exports;
|
|
6004
|
-
const valueParser =
|
|
6002
|
+
const valueParser = lib$1;
|
|
6005
6003
|
const { extractICSS } = src$3;
|
|
6006
6004
|
|
|
6007
6005
|
const isSpacing = (node) => node.type === "combinator" && node.value === " ";
|
|
@@ -7315,7 +7313,7 @@ function isValidBehaviour(behaviour) {
|
|
|
7315
7313
|
return Object.keys(behaviours).map(key => behaviours[key]).indexOf(behaviour) > -1;
|
|
7316
7314
|
}
|
|
7317
7315
|
|
|
7318
|
-
var _postcss = require$$
|
|
7316
|
+
var _postcss = require$$0;
|
|
7319
7317
|
|
|
7320
7318
|
var _postcss2 = _interopRequireDefault(_postcss);
|
|
7321
7319
|
|
|
@@ -7504,4 +7502,4 @@ var index = /*#__PURE__*/_mergeNamespaces({
|
|
|
7504
7502
|
postcss: postcss
|
|
7505
7503
|
}, [build$1.exports]);
|
|
7506
7504
|
|
|
7507
|
-
|
|
7505
|
+
export { index as i };
|
|
@@ -1,7 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
import { y as getAugmentedNamespace, z as getDefaultExportFromCjs } from './dep-46501b7a.js';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
import { fileURLToPath as __cjs_fileURLToPath } from 'url';
|
|
4
|
+
import { dirname as __cjs_dirname } from 'path';
|
|
5
|
+
import { createRequire as __cjs_createRequire } from 'module';
|
|
4
6
|
|
|
7
|
+
const __filename = __cjs_fileURLToPath(import.meta.url);
|
|
8
|
+
const __dirname = __cjs_dirname(__filename);
|
|
9
|
+
const require = __cjs_createRequire(import.meta.url);
|
|
10
|
+
const __require = require;
|
|
5
11
|
function _mergeNamespaces(n, m) {
|
|
6
12
|
for (var i = 0; i < m.length; i++) {
|
|
7
13
|
var e = m[i];
|
|
@@ -418,6 +424,11 @@ function looseEqual(a, b) {
|
|
|
418
424
|
if (aValidType || bValidType) {
|
|
419
425
|
return aValidType && bValidType ? a.getTime() === b.getTime() : false;
|
|
420
426
|
}
|
|
427
|
+
aValidType = isSymbol(a);
|
|
428
|
+
bValidType = isSymbol(b);
|
|
429
|
+
if (aValidType || bValidType) {
|
|
430
|
+
return a === b;
|
|
431
|
+
}
|
|
421
432
|
aValidType = isArray(a);
|
|
422
433
|
bValidType = isArray(b);
|
|
423
434
|
if (aValidType || bValidType) {
|
|
@@ -514,7 +525,7 @@ const hasOwn = (val, key) => hasOwnProperty.call(val, key);
|
|
|
514
525
|
const isArray = Array.isArray;
|
|
515
526
|
const isMap = (val) => toTypeString(val) === '[object Map]';
|
|
516
527
|
const isSet = (val) => toTypeString(val) === '[object Set]';
|
|
517
|
-
const isDate = (val) => val
|
|
528
|
+
const isDate = (val) => toTypeString(val) === '[object Date]';
|
|
518
529
|
const isFunction = (val) => typeof val === 'function';
|
|
519
530
|
const isString = (val) => typeof val === 'string';
|
|
520
531
|
const isSymbol = (val) => typeof val === 'symbol';
|
|
@@ -598,7 +609,13 @@ const getGlobalThis = () => {
|
|
|
598
609
|
: typeof global !== 'undefined'
|
|
599
610
|
? global
|
|
600
611
|
: {}));
|
|
601
|
-
};
|
|
612
|
+
};
|
|
613
|
+
const identRE = /^[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*$/;
|
|
614
|
+
function genPropsAccessExp(name) {
|
|
615
|
+
return identRE.test(name)
|
|
616
|
+
? `__props.${name}`
|
|
617
|
+
: `__props[${JSON.stringify(name)}]`;
|
|
618
|
+
}
|
|
602
619
|
|
|
603
620
|
var shared_esmBundler = {
|
|
604
621
|
__proto__: null,
|
|
@@ -613,6 +630,7 @@ var shared_esmBundler = {
|
|
|
613
630
|
escapeHtml: escapeHtml,
|
|
614
631
|
escapeHtmlComment: escapeHtmlComment,
|
|
615
632
|
extend: extend,
|
|
633
|
+
genPropsAccessExp: genPropsAccessExp,
|
|
616
634
|
generateCodeFrame: generateCodeFrame,
|
|
617
635
|
getGlobalThis: getGlobalThis,
|
|
618
636
|
hasChanged: hasChanged,
|
|
@@ -2446,6 +2464,14 @@ function getConstantType(node, context) {
|
|
|
2446
2464
|
// static then they don't need to be blocks since there will be no
|
|
2447
2465
|
// nested updates.
|
|
2448
2466
|
if (codegenNode.isBlock) {
|
|
2467
|
+
// except set custom directives.
|
|
2468
|
+
for (let i = 0; i < node.props.length; i++) {
|
|
2469
|
+
const p = node.props[i];
|
|
2470
|
+
if (p.type === 7 /* DIRECTIVE */) {
|
|
2471
|
+
constantCache.set(node, 0 /* NOT_CONSTANT */);
|
|
2472
|
+
return 0 /* NOT_CONSTANT */;
|
|
2473
|
+
}
|
|
2474
|
+
}
|
|
2449
2475
|
context.removeHelper(OPEN_BLOCK);
|
|
2450
2476
|
context.removeHelper(getVNodeBlockHelper(context.inSSR, codegenNode.isComponent));
|
|
2451
2477
|
codegenNode.isBlock = false;
|
|
@@ -2852,6 +2878,7 @@ function createStructuralDirectiveTransform(name, fn) {
|
|
|
2852
2878
|
}
|
|
2853
2879
|
|
|
2854
2880
|
const PURE_ANNOTATION = `/*#__PURE__*/`;
|
|
2881
|
+
const aliasHelper = (s) => `${helperNameMap[s]}: _${helperNameMap[s]}`;
|
|
2855
2882
|
function createCodegenContext(ast, { mode = 'function', prefixIdentifiers = mode === 'module', sourceMap = false, filename = `template.vue.html`, scopeId = null, optimizeImports = false, runtimeGlobalName = `Vue`, runtimeModuleName = `vue`, ssrRuntimeModuleName = 'vue/server-renderer', ssr = false, isTS = false, inSSR = false }) {
|
|
2856
2883
|
const context = {
|
|
2857
2884
|
mode,
|
|
@@ -2928,9 +2955,7 @@ function generate(ast, options = {}) {
|
|
|
2928
2955
|
// function mode const declarations should be inside with block
|
|
2929
2956
|
// also they should be renamed to avoid collision with user properties
|
|
2930
2957
|
if (hasHelpers) {
|
|
2931
|
-
push(`const { ${ast.helpers
|
|
2932
|
-
.map(s => `${helperNameMap[s]}: _${helperNameMap[s]}`)
|
|
2933
|
-
.join(', ')} } = _Vue`);
|
|
2958
|
+
push(`const { ${ast.helpers.map(aliasHelper).join(', ')} } = _Vue`);
|
|
2934
2959
|
push(`\n`);
|
|
2935
2960
|
newline();
|
|
2936
2961
|
}
|
|
@@ -2990,7 +3015,6 @@ function generate(ast, options = {}) {
|
|
|
2990
3015
|
function genFunctionPreamble(ast, context) {
|
|
2991
3016
|
const { ssr, prefixIdentifiers, push, newline, runtimeModuleName, runtimeGlobalName, ssrRuntimeModuleName } = context;
|
|
2992
3017
|
const VueBinding = runtimeGlobalName;
|
|
2993
|
-
const aliasHelper = (s) => `${helperNameMap[s]}: _${helperNameMap[s]}`;
|
|
2994
3018
|
// Generate const declaration for helpers
|
|
2995
3019
|
// In prefix mode, we place the const declaration at top so it's done
|
|
2996
3020
|
// only once; But if we not prefixing, we place the declaration inside the
|
|
@@ -3708,14 +3732,14 @@ function processIf(node, dir, context, processCodegen) {
|
|
|
3708
3732
|
}
|
|
3709
3733
|
}
|
|
3710
3734
|
function createIfBranch(node, dir) {
|
|
3735
|
+
const isTemplateIf = node.tagType === 3 /* TEMPLATE */;
|
|
3711
3736
|
return {
|
|
3712
3737
|
type: 10 /* IF_BRANCH */,
|
|
3713
3738
|
loc: node.loc,
|
|
3714
3739
|
condition: dir.name === 'else' ? undefined : dir.exp,
|
|
3715
|
-
children:
|
|
3716
|
-
|
|
3717
|
-
|
|
3718
|
-
userKey: findProp(node, `key`)
|
|
3740
|
+
children: isTemplateIf && !findDir(node, 'for') ? node.children : [node],
|
|
3741
|
+
userKey: findProp(node, `key`),
|
|
3742
|
+
isTemplateIf
|
|
3719
3743
|
};
|
|
3720
3744
|
}
|
|
3721
3745
|
function createCodegenNodeForBranch(branch, keyIndex, context) {
|
|
@@ -3751,6 +3775,7 @@ function createChildrenCodegenNode(branch, keyIndex, context) {
|
|
|
3751
3775
|
// check if the fragment actually contains a single valid child with
|
|
3752
3776
|
// the rest being comments
|
|
3753
3777
|
if ((process.env.NODE_ENV !== 'production') &&
|
|
3778
|
+
!branch.isTemplateIf &&
|
|
3754
3779
|
children.filter(c => c.type !== 3 /* COMMENT */).length === 1) {
|
|
3755
3780
|
patchFlag |= 2048 /* DEV_ROOT_FRAGMENT */;
|
|
3756
3781
|
patchFlagText += `, ${PatchFlagNames[2048 /* DEV_ROOT_FRAGMENT */]}`;
|
|
@@ -4327,7 +4352,7 @@ const transformElement = (node, context) => {
|
|
|
4327
4352
|
(tag === 'svg' || tag === 'foreignObject'));
|
|
4328
4353
|
// props
|
|
4329
4354
|
if (props.length > 0) {
|
|
4330
|
-
const propsBuildResult = buildProps(node, context);
|
|
4355
|
+
const propsBuildResult = buildProps(node, context, undefined, isComponent, isDynamicComponent);
|
|
4331
4356
|
vnodeProps = propsBuildResult.props;
|
|
4332
4357
|
patchFlag = propsBuildResult.patchFlag;
|
|
4333
4358
|
dynamicPropNames = propsBuildResult.dynamicPropNames;
|
|
@@ -4469,9 +4494,8 @@ function resolveComponentType(node, context, ssr = false) {
|
|
|
4469
4494
|
context.components.add(tag);
|
|
4470
4495
|
return toValidAssetId(tag, `component`);
|
|
4471
4496
|
}
|
|
4472
|
-
function buildProps(node, context, props = node.props, ssr = false) {
|
|
4497
|
+
function buildProps(node, context, props = node.props, isComponent, isDynamicComponent, ssr = false) {
|
|
4473
4498
|
const { tag, loc: elementLoc, children } = node;
|
|
4474
|
-
const isComponent = node.tagType === 1 /* COMPONENT */;
|
|
4475
4499
|
let properties = [];
|
|
4476
4500
|
const mergeArgs = [];
|
|
4477
4501
|
const runtimeDirectives = [];
|
|
@@ -4490,8 +4514,8 @@ function buildProps(node, context, props = node.props, ssr = false) {
|
|
|
4490
4514
|
if (isStaticExp(key)) {
|
|
4491
4515
|
const name = key.content;
|
|
4492
4516
|
const isEventHandler = isOn(name);
|
|
4493
|
-
if (
|
|
4494
|
-
|
|
4517
|
+
if (isEventHandler &&
|
|
4518
|
+
(!isComponent || isDynamicComponent) &&
|
|
4495
4519
|
// omit the flag for click handlers because hydration gives click
|
|
4496
4520
|
// dedicated fast path.
|
|
4497
4521
|
name.toLowerCase() !== 'onclick' &&
|
|
@@ -4746,10 +4770,11 @@ function buildProps(node, context, props = node.props, ssr = false) {
|
|
|
4746
4770
|
classProp.value = createCallExpression(context.helper(NORMALIZE_CLASS), [classProp.value]);
|
|
4747
4771
|
}
|
|
4748
4772
|
if (styleProp &&
|
|
4749
|
-
!isStaticExp(styleProp.value) &&
|
|
4750
4773
|
// the static style is compiled into an object,
|
|
4751
4774
|
// so use `hasStyleBinding` to ensure that it is a dynamic style binding
|
|
4752
4775
|
(hasStyleBinding ||
|
|
4776
|
+
(styleProp.value.type === 4 /* SIMPLE_EXPRESSION */ &&
|
|
4777
|
+
styleProp.value.content.trim()[0] === `[`) ||
|
|
4753
4778
|
// v-bind:style and style both exist,
|
|
4754
4779
|
// v-bind:style with static literal object
|
|
4755
4780
|
styleProp.value.type === 17 /* JS_ARRAY_EXPRESSION */)) {
|
|
@@ -4947,7 +4972,7 @@ function processSlotOutlet(node, context) {
|
|
|
4947
4972
|
}
|
|
4948
4973
|
}
|
|
4949
4974
|
if (nonNameProps.length > 0) {
|
|
4950
|
-
const { props, directives } = buildProps(node, context, nonNameProps);
|
|
4975
|
+
const { props, directives } = buildProps(node, context, nonNameProps, false, false);
|
|
4951
4976
|
slotProps = props;
|
|
4952
4977
|
if (directives.length) {
|
|
4953
4978
|
context.onError(createCompilerError(36 /* X_V_SLOT_UNEXPECTED_DIRECTIVE_ON_SLOT_OUTLET */, directives[0].loc));
|
|
@@ -5118,11 +5143,7 @@ const transformText = (node, context) => {
|
|
|
5118
5143
|
const next = children[j];
|
|
5119
5144
|
if (isText(next)) {
|
|
5120
5145
|
if (!currentContainer) {
|
|
5121
|
-
currentContainer = children[i] =
|
|
5122
|
-
type: 8 /* COMPOUND_EXPRESSION */,
|
|
5123
|
-
loc: child.loc,
|
|
5124
|
-
children: [child]
|
|
5125
|
-
};
|
|
5146
|
+
currentContainer = children[i] = createCompoundExpression([child], child.loc);
|
|
5126
5147
|
}
|
|
5127
5148
|
// merge adjacent text node into current
|
|
5128
5149
|
currentContainer.children.push(` + `, next);
|
|
@@ -5591,6 +5612,7 @@ var compilerCore_esmBundler = {
|
|
|
5591
5612
|
findProp: findProp,
|
|
5592
5613
|
generate: generate,
|
|
5593
5614
|
getBaseTransformPreset: getBaseTransformPreset,
|
|
5615
|
+
getConstantType: getConstantType,
|
|
5594
5616
|
getInnerRange: getInnerRange,
|
|
5595
5617
|
getMemoedVNodeCall: getMemoedVNodeCall,
|
|
5596
5618
|
getVNodeBlockHelper: getVNodeBlockHelper,
|
|
@@ -5642,9 +5664,9 @@ var compilerCore_esmBundler = {
|
|
|
5642
5664
|
generateCodeFrame: generateCodeFrame
|
|
5643
5665
|
};
|
|
5644
5666
|
|
|
5645
|
-
var require$$0 = /*@__PURE__*/
|
|
5667
|
+
var require$$0 = /*@__PURE__*/getAugmentedNamespace(compilerCore_esmBundler);
|
|
5646
5668
|
|
|
5647
|
-
var require$$1 = /*@__PURE__*/
|
|
5669
|
+
var require$$1 = /*@__PURE__*/getAugmentedNamespace(shared_esmBundler);
|
|
5648
5670
|
|
|
5649
5671
|
(function (exports) {
|
|
5650
5672
|
|
|
@@ -8172,7 +8194,9 @@ const transformVText = (dir, node, context) => {
|
|
|
8172
8194
|
return {
|
|
8173
8195
|
props: [
|
|
8174
8196
|
compilerCore.createObjectProperty(compilerCore.createSimpleExpression(`textContent`, true), exp
|
|
8175
|
-
? compilerCore.
|
|
8197
|
+
? compilerCore.getConstantType(exp, context) > 0
|
|
8198
|
+
? exp
|
|
8199
|
+
: compilerCore.createCallExpression(context.helperString(compilerCore.TO_DISPLAY_STRING), [exp], loc)
|
|
8176
8200
|
: compilerCore.createSimpleExpression('', true))
|
|
8177
8201
|
]
|
|
8178
8202
|
};
|
|
@@ -8384,19 +8408,38 @@ const transformShow = (dir, node, context) => {
|
|
|
8384
8408
|
};
|
|
8385
8409
|
};
|
|
8386
8410
|
|
|
8387
|
-
const
|
|
8411
|
+
const transformTransition = (node, context) => {
|
|
8388
8412
|
if (node.type === 1 /* ELEMENT */ &&
|
|
8389
8413
|
node.tagType === 1 /* COMPONENT */) {
|
|
8390
8414
|
const component = context.isBuiltInComponent(node.tag);
|
|
8391
8415
|
if (component === TRANSITION) {
|
|
8392
8416
|
return () => {
|
|
8393
|
-
if (node.children.length
|
|
8417
|
+
if (!node.children.length) {
|
|
8418
|
+
return;
|
|
8419
|
+
}
|
|
8420
|
+
// warn multiple transition children
|
|
8421
|
+
if (hasMultipleChildren(node)) {
|
|
8394
8422
|
context.onError(createDOMCompilerError(59 /* X_TRANSITION_INVALID_CHILDREN */, {
|
|
8395
8423
|
start: node.children[0].loc.start,
|
|
8396
8424
|
end: node.children[node.children.length - 1].loc.end,
|
|
8397
8425
|
source: ''
|
|
8398
8426
|
}));
|
|
8399
8427
|
}
|
|
8428
|
+
// check if it's s single child w/ v-show
|
|
8429
|
+
// if yes, inject "persisted: true" to the transition props
|
|
8430
|
+
const child = node.children[0];
|
|
8431
|
+
if (child.type === 1 /* ELEMENT */) {
|
|
8432
|
+
for (const p of child.props) {
|
|
8433
|
+
if (p.type === 7 /* DIRECTIVE */ && p.name === 'show') {
|
|
8434
|
+
node.props.push({
|
|
8435
|
+
type: 6 /* ATTRIBUTE */,
|
|
8436
|
+
name: 'persisted',
|
|
8437
|
+
value: undefined,
|
|
8438
|
+
loc: node.loc
|
|
8439
|
+
});
|
|
8440
|
+
}
|
|
8441
|
+
}
|
|
8442
|
+
}
|
|
8400
8443
|
};
|
|
8401
8444
|
}
|
|
8402
8445
|
}
|
|
@@ -8612,6 +8655,7 @@ function stringifyNode(node, context) {
|
|
|
8612
8655
|
}
|
|
8613
8656
|
function stringifyElement(node, context) {
|
|
8614
8657
|
let res = `<${node.tag}`;
|
|
8658
|
+
let innerHTML = '';
|
|
8615
8659
|
for (let i = 0; i < node.props.length; i++) {
|
|
8616
8660
|
const p = node.props[i];
|
|
8617
8661
|
if (p.type === 6 /* ATTRIBUTE */) {
|
|
@@ -8620,25 +8664,35 @@ function stringifyElement(node, context) {
|
|
|
8620
8664
|
res += `="${shared.escapeHtml(p.value.content)}"`;
|
|
8621
8665
|
}
|
|
8622
8666
|
}
|
|
8623
|
-
else if (p.type === 7 /* DIRECTIVE */
|
|
8624
|
-
|
|
8625
|
-
|
|
8626
|
-
|
|
8627
|
-
|
|
8628
|
-
|
|
8629
|
-
|
|
8630
|
-
|
|
8631
|
-
// constant v-bind, e.g. :foo="1"
|
|
8632
|
-
let evaluated = evaluateConstant(exp);
|
|
8633
|
-
if (evaluated != null) {
|
|
8634
|
-
const arg = p.arg && p.arg.content;
|
|
8635
|
-
if (arg === 'class') {
|
|
8636
|
-
evaluated = shared.normalizeClass(evaluated);
|
|
8667
|
+
else if (p.type === 7 /* DIRECTIVE */) {
|
|
8668
|
+
if (p.name === 'bind') {
|
|
8669
|
+
const exp = p.exp;
|
|
8670
|
+
if (exp.content[0] === '_') {
|
|
8671
|
+
// internally generated string constant references
|
|
8672
|
+
// e.g. imported URL strings via compiler-sfc transformAssetUrl plugin
|
|
8673
|
+
res += ` ${p.arg.content}="__VUE_EXP_START__${exp.content}__VUE_EXP_END__"`;
|
|
8674
|
+
continue;
|
|
8637
8675
|
}
|
|
8638
|
-
|
|
8639
|
-
|
|
8676
|
+
// constant v-bind, e.g. :foo="1"
|
|
8677
|
+
let evaluated = evaluateConstant(exp);
|
|
8678
|
+
if (evaluated != null) {
|
|
8679
|
+
const arg = p.arg && p.arg.content;
|
|
8680
|
+
if (arg === 'class') {
|
|
8681
|
+
evaluated = shared.normalizeClass(evaluated);
|
|
8682
|
+
}
|
|
8683
|
+
else if (arg === 'style') {
|
|
8684
|
+
evaluated = shared.stringifyStyle(shared.normalizeStyle(evaluated));
|
|
8685
|
+
}
|
|
8686
|
+
res += ` ${p.arg.content}="${shared.escapeHtml(evaluated)}"`;
|
|
8640
8687
|
}
|
|
8641
|
-
|
|
8688
|
+
}
|
|
8689
|
+
else if (p.name === 'html') {
|
|
8690
|
+
// #5439 v-html with constant value
|
|
8691
|
+
// not sure why would anyone do this but it can happen
|
|
8692
|
+
innerHTML = evaluateConstant(p.exp);
|
|
8693
|
+
}
|
|
8694
|
+
else if (p.name === 'text') {
|
|
8695
|
+
innerHTML = shared.escapeHtml(shared.toDisplayString(evaluateConstant(p.exp)));
|
|
8642
8696
|
}
|
|
8643
8697
|
}
|
|
8644
8698
|
}
|
|
@@ -8646,8 +8700,13 @@ function stringifyElement(node, context) {
|
|
|
8646
8700
|
res += ` ${context.scopeId}`;
|
|
8647
8701
|
}
|
|
8648
8702
|
res += `>`;
|
|
8649
|
-
|
|
8650
|
-
res +=
|
|
8703
|
+
if (innerHTML) {
|
|
8704
|
+
res += innerHTML;
|
|
8705
|
+
}
|
|
8706
|
+
else {
|
|
8707
|
+
for (let i = 0; i < node.children.length; i++) {
|
|
8708
|
+
res += stringifyNode(node.children[i], context);
|
|
8709
|
+
}
|
|
8651
8710
|
}
|
|
8652
8711
|
if (!shared.isVoidTag(node.tag)) {
|
|
8653
8712
|
res += `</${node.tag}>`;
|
|
@@ -8660,7 +8719,7 @@ function stringifyElement(node, context) {
|
|
|
8660
8719
|
// here, e.g. `{{ 1 }}` or `{{ 'foo' }}`
|
|
8661
8720
|
// in addition, constant exps bail on presence of parens so you can't even
|
|
8662
8721
|
// run JSFuck in here. But we mark it unsafe for security review purposes.
|
|
8663
|
-
// (see compiler-core/src/
|
|
8722
|
+
// (see compiler-core/src/transforms/transformExpression)
|
|
8664
8723
|
function evaluateConstant(exp) {
|
|
8665
8724
|
if (exp.type === 4 /* SIMPLE_EXPRESSION */) {
|
|
8666
8725
|
return new Function(`return ${exp.content}`)();
|
|
@@ -8697,7 +8756,7 @@ const ignoreSideEffectTags = (node, context) => {
|
|
|
8697
8756
|
|
|
8698
8757
|
const DOMNodeTransforms = [
|
|
8699
8758
|
transformStyle,
|
|
8700
|
-
...([
|
|
8759
|
+
...([transformTransition] )
|
|
8701
8760
|
];
|
|
8702
8761
|
const DOMDirectiveTransforms = {
|
|
8703
8762
|
cloak: compilerCore.noopDirectiveTransform,
|
|
@@ -8747,11 +8806,11 @@ exports.parserOptions = parserOptions;
|
|
|
8747
8806
|
exports.transformStyle = transformStyle;
|
|
8748
8807
|
}(compilerDom_cjs$2));
|
|
8749
8808
|
|
|
8750
|
-
var compilerDom_cjs = /*@__PURE__*/
|
|
8809
|
+
var compilerDom_cjs = /*@__PURE__*/getDefaultExportFromCjs(compilerDom_cjs$2);
|
|
8751
8810
|
|
|
8752
8811
|
var compilerDom_cjs$1 = /*#__PURE__*/_mergeNamespaces({
|
|
8753
8812
|
__proto__: null,
|
|
8754
8813
|
'default': compilerDom_cjs
|
|
8755
8814
|
}, [compilerDom_cjs$2]);
|
|
8756
8815
|
|
|
8757
|
-
|
|
8816
|
+
export { compilerDom_cjs$1 as c };
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { fileURLToPath as __cjs_fileURLToPath } from 'url';
|
|
2
|
+
import { dirname as __cjs_dirname } from 'path';
|
|
3
|
+
import { createRequire as __cjs_createRequire } from 'module';
|
|
4
|
+
|
|
5
|
+
const __filename = __cjs_fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __cjs_dirname(__filename);
|
|
7
|
+
const require = __cjs_createRequire(import.meta.url);
|
|
8
|
+
const __require = require;
|
|
3
9
|
var openParentheses = "(".charCodeAt(0);
|
|
4
10
|
var closeParentheses = ")".charCodeAt(0);
|
|
5
11
|
var singleQuote = "'".charCodeAt(0);
|
|
@@ -544,4 +550,4 @@ ValueParser.stringify = stringify;
|
|
|
544
550
|
|
|
545
551
|
var lib = ValueParser;
|
|
546
552
|
|
|
547
|
-
|
|
553
|
+
export { lib as l };
|
|
@@ -1,35 +1,39 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
1
|
+
import { x as commonjsGlobal } from './dep-46501b7a.js';
|
|
2
|
+
import require$$1 from 'crypto';
|
|
3
|
+
import 'fs';
|
|
4
|
+
import 'path';
|
|
5
|
+
import 'url';
|
|
6
|
+
import 'perf_hooks';
|
|
7
|
+
import 'module';
|
|
8
|
+
import 'tty';
|
|
9
|
+
import 'esbuild';
|
|
10
|
+
import 'events';
|
|
11
|
+
import 'assert';
|
|
12
|
+
import 'resolve';
|
|
13
|
+
import 'util';
|
|
14
|
+
import 'net';
|
|
15
|
+
import 'http';
|
|
16
|
+
import 'stream';
|
|
17
|
+
import 'os';
|
|
18
|
+
import 'child_process';
|
|
19
|
+
import 'dns';
|
|
20
|
+
import '../constants.js';
|
|
21
|
+
import 'buffer';
|
|
22
|
+
import 'querystring';
|
|
23
|
+
import 'zlib';
|
|
24
|
+
import 'https';
|
|
25
|
+
import 'tls';
|
|
26
|
+
import 'worker_threads';
|
|
27
|
+
import 'readline';
|
|
28
|
+
|
|
29
|
+
import { fileURLToPath as __cjs_fileURLToPath } from 'url';
|
|
30
|
+
import { dirname as __cjs_dirname } from 'path';
|
|
31
|
+
import { createRequire as __cjs_createRequire } from 'module';
|
|
32
|
+
|
|
33
|
+
const __filename = __cjs_fileURLToPath(import.meta.url);
|
|
34
|
+
const __dirname = __cjs_dirname(__filename);
|
|
35
|
+
const require = __cjs_createRequire(import.meta.url);
|
|
36
|
+
const __require = require;
|
|
33
37
|
/**
|
|
34
38
|
* Node.js module for Forge.
|
|
35
39
|
*
|
|
@@ -353,7 +357,7 @@ util$1.isNodejs =
|
|
|
353
357
|
// is not available.
|
|
354
358
|
util$1.globalScope = (function() {
|
|
355
359
|
if(util$1.isNodejs) {
|
|
356
|
-
return
|
|
360
|
+
return commonjsGlobal;
|
|
357
361
|
}
|
|
358
362
|
|
|
359
363
|
return typeof self === 'undefined' ? window : self;
|
|
@@ -7506,7 +7510,7 @@ var pkcs5 = forge$i.pkcs5 = forge$i.pkcs5 || {};
|
|
|
7506
7510
|
|
|
7507
7511
|
var crypto;
|
|
7508
7512
|
if(forge$i.util.isNodejs && !forge$i.options.usePureJavaScript) {
|
|
7509
|
-
crypto = require$$
|
|
7513
|
+
crypto = require$$1;
|
|
7510
7514
|
}
|
|
7511
7515
|
|
|
7512
7516
|
/**
|
|
@@ -8286,7 +8290,7 @@ var forge$f = forge$s;
|
|
|
8286
8290
|
var _crypto$1 = null;
|
|
8287
8291
|
if(forge$f.util.isNodejs && !forge$f.options.usePureJavaScript &&
|
|
8288
8292
|
!process.versions['node-webkit']) {
|
|
8289
|
-
_crypto$1 = require$$
|
|
8293
|
+
_crypto$1 = require$$1;
|
|
8290
8294
|
}
|
|
8291
8295
|
|
|
8292
8296
|
/* PRNG API */
|
|
@@ -11508,7 +11512,7 @@ if(typeof BigInteger === 'undefined') {
|
|
|
11508
11512
|
var BigInteger = forge$8.jsbn.BigInteger;
|
|
11509
11513
|
}
|
|
11510
11514
|
|
|
11511
|
-
var _crypto = forge$8.util.isNodejs ? require$$
|
|
11515
|
+
var _crypto = forge$8.util.isNodejs ? require$$1 : null;
|
|
11512
11516
|
|
|
11513
11517
|
// shortcut for asn.1 API
|
|
11514
11518
|
var asn1$5 = forge$8.asn1;
|
|
@@ -19597,4 +19601,4 @@ function createCertificate() {
|
|
|
19597
19601
|
return privateKeyPem + certPem;
|
|
19598
19602
|
}
|
|
19599
19603
|
|
|
19600
|
-
|
|
19604
|
+
export { createCertificate };
|