@vue/language-core 3.3.4 → 3.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/index.d.ts +1 -0
- package/index.js +1 -0
- package/lib/codegen/codeFeatures.d.ts +24 -84
- package/lib/codegen/codeFeatures.js +46 -4
- package/lib/codegen/names.d.ts +4 -5
- package/lib/codegen/names.js +4 -5
- package/lib/codegen/script/index.js +5 -5
- package/lib/codegen/script/scriptSetup.js +4 -4
- package/lib/codegen/style/common.js +7 -11
- package/lib/codegen/style/index.d.ts +55 -27
- package/lib/codegen/style/index.js +3 -3
- package/lib/codegen/template/context.d.ts +55 -124
- package/lib/codegen/template/context.js +187 -269
- package/lib/codegen/template/element.js +16 -15
- package/lib/codegen/template/elementDirectives.js +11 -11
- package/lib/codegen/template/elementEvents.js +76 -73
- package/lib/codegen/template/elementProps.js +12 -12
- package/lib/codegen/template/index.d.ts +55 -27
- package/lib/codegen/template/index.js +7 -7
- package/lib/codegen/template/interpolation.js +28 -28
- package/lib/codegen/template/objectProperty.js +5 -5
- package/lib/codegen/template/propertyAccess.js +1 -1
- package/lib/codegen/template/slotOutlet.js +8 -10
- package/lib/codegen/template/styleScopedClasses.js +4 -4
- package/lib/codegen/template/vFor.js +3 -3
- package/lib/codegen/template/vIf.js +4 -4
- package/lib/codegen/template/vSlot.js +9 -9
- package/lib/codegen/utils/boundary.d.ts +7 -2
- package/lib/codegen/utils/boundary.js +15 -9
- package/lib/codegen/utils/camelized.js +5 -13
- package/lib/codegen/utils/escaped.js +4 -9
- package/lib/codegen/utils/index.d.ts +1 -1
- package/lib/codegen/utils/index.js +3 -3
- package/lib/codegen/utils/stringLiteralKey.js +3 -3
- package/lib/codegen/utils/unicode.d.ts +1 -1
- package/lib/codegen/utils/unicode.js +4 -4
- package/lib/languagePlugin.js +2 -1
- package/lib/parsers/scriptRanges.d.ts +2 -2
- package/lib/parsers/scriptRanges.js +3 -10
- package/lib/parsers/scriptSetupRanges.d.ts +2 -2
- package/lib/parsers/scriptSetupRanges.js +3 -10
- package/lib/parsers/utils.d.ts +1 -0
- package/lib/parsers/utils.js +10 -0
- package/lib/parsers/vueCompilerOptions.js +2 -2
- package/lib/plugins/file-html.js +4 -4
- package/lib/plugins/file-md.js +15 -15
- package/lib/plugins/file-vue.js +2 -2
- package/lib/plugins/vue-root-tags.js +3 -3
- package/lib/plugins/vue-sfc-customblocks.js +2 -2
- package/lib/plugins/vue-sfc-scripts.js +2 -4
- package/lib/plugins/vue-sfc-styles.js +3 -3
- package/lib/plugins/vue-sfc-template.js +2 -2
- package/lib/plugins/vue-style-css.js +86 -33
- package/lib/plugins/vue-template-html.js +3 -3
- package/lib/plugins/vue-template-inline-css.js +2 -7
- package/lib/plugins/vue-template-inline-ts.js +4 -5
- package/lib/plugins/vue-tsx.d.ts +61 -31
- package/lib/plugins/vue-tsx.js +26 -23
- package/lib/plugins.d.ts +0 -1
- package/lib/plugins.js +0 -15
- package/lib/utils/forEachTemplateNode.js +36 -43
- package/lib/virtualCode/index.js +2 -2
- package/package.json +2 -2
- package/types/template-helpers.d.ts +15 -25
- package/lib/plugins/shared.d.ts +0 -2
- package/lib/plugins/shared.js +0 -12
package/index.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -15,6 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
exports.tsCodegen = exports.names = void 0;
|
|
18
|
+
__exportStar(require("./lib/codegen/codeFeatures"), exports);
|
|
18
19
|
__exportStar(require("./lib/codegen/template"), exports);
|
|
19
20
|
__exportStar(require("./lib/compilerOptions"), exports);
|
|
20
21
|
__exportStar(require("./lib/languagePlugin"), exports);
|
|
@@ -1,86 +1,26 @@
|
|
|
1
1
|
import type { VueCodeInformation } from '../types';
|
|
2
|
-
declare const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
navigation: true;
|
|
25
|
-
};
|
|
26
|
-
navigationWithoutRename: {
|
|
27
|
-
navigation: {
|
|
28
|
-
shouldRename: () => false;
|
|
29
|
-
};
|
|
30
|
-
};
|
|
31
|
-
navigationAndCompletion: {
|
|
32
|
-
navigation: true;
|
|
33
|
-
completion: true;
|
|
34
|
-
};
|
|
35
|
-
navigationAndVerification: {
|
|
36
|
-
navigation: true;
|
|
37
|
-
verification: true;
|
|
38
|
-
};
|
|
39
|
-
withoutNavigation: {
|
|
40
|
-
verification: true;
|
|
41
|
-
completion: true;
|
|
42
|
-
semantic: true;
|
|
43
|
-
};
|
|
44
|
-
semanticWithoutHighlight: {
|
|
45
|
-
semantic: {
|
|
46
|
-
shouldHighlight: () => false;
|
|
47
|
-
};
|
|
48
|
-
};
|
|
49
|
-
withoutHighlight: {
|
|
50
|
-
semantic: {
|
|
51
|
-
shouldHighlight: () => false;
|
|
52
|
-
};
|
|
53
|
-
verification: true;
|
|
54
|
-
navigation: true;
|
|
55
|
-
completion: true;
|
|
56
|
-
};
|
|
57
|
-
withoutHighlightAndCompletion: {
|
|
58
|
-
semantic: {
|
|
59
|
-
shouldHighlight: () => false;
|
|
60
|
-
};
|
|
61
|
-
verification: true;
|
|
62
|
-
navigation: true;
|
|
63
|
-
};
|
|
64
|
-
withoutSemantic: {
|
|
65
|
-
verification: true;
|
|
66
|
-
navigation: true;
|
|
67
|
-
completion: true;
|
|
68
|
-
};
|
|
69
|
-
doNotReportTs2339AndTs2551: {
|
|
70
|
-
verification: {
|
|
71
|
-
shouldReport: (_source: string | undefined, code: string | number | undefined) => boolean;
|
|
72
|
-
};
|
|
73
|
-
};
|
|
74
|
-
doNotReportTs2353AndTs2561: {
|
|
75
|
-
verification: {
|
|
76
|
-
shouldReport: (_source: string | undefined, code: string | number | undefined) => boolean;
|
|
77
|
-
};
|
|
78
|
-
};
|
|
79
|
-
doNotReportTs6133: {
|
|
80
|
-
verification: {
|
|
81
|
-
shouldReport: (_source: string | undefined, code: string | number | undefined) => boolean;
|
|
82
|
-
};
|
|
83
|
-
};
|
|
2
|
+
export declare const codeFeatures: {
|
|
3
|
+
full: VueCodeInformation;
|
|
4
|
+
all: VueCodeInformation;
|
|
5
|
+
importCompletionOnly: VueCodeInformation;
|
|
6
|
+
verification: VueCodeInformation;
|
|
7
|
+
completion: VueCodeInformation;
|
|
8
|
+
withoutCompletion: VueCodeInformation;
|
|
9
|
+
navigation: VueCodeInformation;
|
|
10
|
+
navigationWithoutRename: VueCodeInformation;
|
|
11
|
+
navigationAndCompletion: VueCodeInformation;
|
|
12
|
+
navigationAndVerification: VueCodeInformation;
|
|
13
|
+
withoutNavigation: VueCodeInformation;
|
|
14
|
+
semanticWithoutHighlight: VueCodeInformation;
|
|
15
|
+
withoutHighlight: VueCodeInformation;
|
|
16
|
+
withoutHighlightAndCompletion: VueCodeInformation;
|
|
17
|
+
withoutSemantic: VueCodeInformation;
|
|
18
|
+
structure: VueCodeInformation;
|
|
19
|
+
structureAndFormat: VueCodeInformation;
|
|
20
|
+
format: VueCodeInformation;
|
|
21
|
+
doNotReportTs2339AndTs2551: VueCodeInformation;
|
|
22
|
+
doNotReportTs2353AndTs2561: VueCodeInformation;
|
|
23
|
+
doNotReportTs6133: VueCodeInformation;
|
|
84
24
|
};
|
|
85
|
-
|
|
86
|
-
export
|
|
25
|
+
/** @deprecated use `codeFeatures.full` instead */
|
|
26
|
+
export declare const allCodeFeatures: VueCodeInformation;
|
|
@@ -1,65 +1,101 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.codeFeatures = void 0;
|
|
4
|
-
|
|
3
|
+
exports.allCodeFeatures = exports.codeFeatures = void 0;
|
|
4
|
+
exports.codeFeatures = defineCodeFeatures({
|
|
5
|
+
full: {
|
|
6
|
+
verification: true,
|
|
7
|
+
completion: true,
|
|
8
|
+
semantic: true,
|
|
9
|
+
navigation: true,
|
|
10
|
+
structure: true,
|
|
11
|
+
format: true,
|
|
12
|
+
},
|
|
13
|
+
/** @internal */
|
|
5
14
|
all: {
|
|
6
15
|
verification: true,
|
|
7
16
|
completion: true,
|
|
8
17
|
semantic: true,
|
|
9
18
|
navigation: true,
|
|
10
19
|
},
|
|
20
|
+
/** @internal */
|
|
11
21
|
importCompletionOnly: {
|
|
12
22
|
__importCompletion: true,
|
|
13
23
|
},
|
|
24
|
+
/** @internal */
|
|
14
25
|
verification: {
|
|
15
26
|
verification: true,
|
|
16
27
|
},
|
|
28
|
+
/** @internal */
|
|
17
29
|
completion: {
|
|
18
30
|
completion: true,
|
|
19
31
|
},
|
|
32
|
+
/** @internal */
|
|
20
33
|
withoutCompletion: {
|
|
21
34
|
verification: true,
|
|
22
35
|
semantic: true,
|
|
23
36
|
navigation: true,
|
|
24
37
|
},
|
|
38
|
+
/** @internal */
|
|
25
39
|
navigation: {
|
|
26
40
|
navigation: true,
|
|
27
41
|
},
|
|
42
|
+
/** @internal */
|
|
28
43
|
navigationWithoutRename: {
|
|
29
44
|
navigation: { shouldRename: () => false },
|
|
30
45
|
},
|
|
46
|
+
/** @internal */
|
|
31
47
|
navigationAndCompletion: {
|
|
32
48
|
navigation: true,
|
|
33
49
|
completion: true,
|
|
34
50
|
},
|
|
51
|
+
/** @internal */
|
|
35
52
|
navigationAndVerification: {
|
|
36
53
|
navigation: true,
|
|
37
54
|
verification: true,
|
|
38
55
|
},
|
|
56
|
+
/** @internal */
|
|
39
57
|
withoutNavigation: {
|
|
40
58
|
verification: true,
|
|
41
59
|
completion: true,
|
|
42
60
|
semantic: true,
|
|
43
61
|
},
|
|
62
|
+
/** @internal */
|
|
44
63
|
semanticWithoutHighlight: {
|
|
45
64
|
semantic: { shouldHighlight: () => false },
|
|
46
65
|
},
|
|
66
|
+
/** @internal */
|
|
47
67
|
withoutHighlight: {
|
|
48
68
|
semantic: { shouldHighlight: () => false },
|
|
49
69
|
verification: true,
|
|
50
70
|
navigation: true,
|
|
51
71
|
completion: true,
|
|
52
72
|
},
|
|
73
|
+
/** @internal */
|
|
53
74
|
withoutHighlightAndCompletion: {
|
|
54
75
|
semantic: { shouldHighlight: () => false },
|
|
55
76
|
verification: true,
|
|
56
77
|
navigation: true,
|
|
57
78
|
},
|
|
79
|
+
/** @internal */
|
|
58
80
|
withoutSemantic: {
|
|
59
81
|
verification: true,
|
|
60
82
|
navigation: true,
|
|
61
83
|
completion: true,
|
|
62
84
|
},
|
|
85
|
+
/** @internal */
|
|
86
|
+
structure: {
|
|
87
|
+
structure: true,
|
|
88
|
+
},
|
|
89
|
+
/** @internal */
|
|
90
|
+
structureAndFormat: {
|
|
91
|
+
structure: true,
|
|
92
|
+
format: true,
|
|
93
|
+
},
|
|
94
|
+
/** @internal */
|
|
95
|
+
format: {
|
|
96
|
+
format: true,
|
|
97
|
+
},
|
|
98
|
+
/** @internal */
|
|
63
99
|
doNotReportTs2339AndTs2551: {
|
|
64
100
|
verification: {
|
|
65
101
|
// https://typescript.tv/errors/#ts2339
|
|
@@ -67,6 +103,7 @@ const raw = {
|
|
|
67
103
|
shouldReport: (_source, code) => String(code) !== '2339' && String(code) !== '2551',
|
|
68
104
|
},
|
|
69
105
|
},
|
|
106
|
+
/** @internal */
|
|
70
107
|
doNotReportTs2353AndTs2561: {
|
|
71
108
|
verification: {
|
|
72
109
|
// https://typescript.tv/errors/#ts2353
|
|
@@ -74,12 +111,17 @@ const raw = {
|
|
|
74
111
|
shouldReport: (_source, code) => String(code) !== '2353' && String(code) !== '2561',
|
|
75
112
|
},
|
|
76
113
|
},
|
|
114
|
+
/** @internal */
|
|
77
115
|
doNotReportTs6133: {
|
|
78
116
|
verification: {
|
|
79
117
|
// https://typescript.tv/errors/#ts6133
|
|
80
118
|
shouldReport: (_source, code) => String(code) !== '6133',
|
|
81
119
|
},
|
|
82
120
|
},
|
|
83
|
-
};
|
|
84
|
-
|
|
121
|
+
});
|
|
122
|
+
/** @deprecated use `codeFeatures.full` instead */
|
|
123
|
+
exports.allCodeFeatures = exports.codeFeatures.full;
|
|
124
|
+
function defineCodeFeatures(features) {
|
|
125
|
+
return features;
|
|
126
|
+
}
|
|
85
127
|
//# sourceMappingURL=codeFeatures.js.map
|
package/lib/codegen/names.d.ts
CHANGED
|
@@ -50,13 +50,11 @@ declare const raw: {
|
|
|
50
50
|
ConstructorOverloads: string;
|
|
51
51
|
Elements: string;
|
|
52
52
|
EmitsToProps: string;
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
FunctionalComponentProps: string;
|
|
53
|
+
ExtractComponentContext: string;
|
|
54
|
+
ExtractComponentProps: string;
|
|
55
|
+
FunctionalComponent: string;
|
|
57
56
|
IsAny: string;
|
|
58
57
|
IsFunction: string;
|
|
59
|
-
NormalizeComponentEvent: string;
|
|
60
58
|
NormalizeEmits: string;
|
|
61
59
|
OverloadUnion: string;
|
|
62
60
|
OverloadUnionInner: string;
|
|
@@ -64,6 +62,7 @@ declare const raw: {
|
|
|
64
62
|
PrettifyGlobal: string;
|
|
65
63
|
ResolveDirectives: string;
|
|
66
64
|
ResolveEmits: string;
|
|
65
|
+
ResolveEvent: string;
|
|
67
66
|
ShortEmits: string;
|
|
68
67
|
ShortEmitsToObject: string;
|
|
69
68
|
SpreadMerge: string;
|
package/lib/codegen/names.js
CHANGED
|
@@ -54,13 +54,11 @@ const raw = {
|
|
|
54
54
|
ConstructorOverloads: '',
|
|
55
55
|
Elements: '',
|
|
56
56
|
EmitsToProps: '',
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
FunctionalComponentProps: '',
|
|
57
|
+
ExtractComponentContext: '',
|
|
58
|
+
ExtractComponentProps: '',
|
|
59
|
+
FunctionalComponent: '',
|
|
61
60
|
IsAny: '',
|
|
62
61
|
IsFunction: '',
|
|
63
|
-
NormalizeComponentEvent: '',
|
|
64
62
|
NormalizeEmits: '',
|
|
65
63
|
OverloadUnion: '',
|
|
66
64
|
OverloadUnionInner: '',
|
|
@@ -68,6 +66,7 @@ const raw = {
|
|
|
68
66
|
PrettifyGlobal: '',
|
|
69
67
|
ResolveDirectives: '',
|
|
70
68
|
ResolveEmits: '',
|
|
69
|
+
ResolveEvent: '',
|
|
71
70
|
ShortEmits: '',
|
|
72
71
|
ShortEmitsToObject: '',
|
|
73
72
|
SpreadMerge: '',
|
|
@@ -61,15 +61,15 @@ function* generateWorker(options, ctx) {
|
|
|
61
61
|
src = src.slice(0, -'.tsx'.length) + '.jsx';
|
|
62
62
|
}
|
|
63
63
|
yield `import ${names_1.names.src} from `;
|
|
64
|
-
const
|
|
64
|
+
const boundary = yield* boundary_1.Boundary.start('main', script.src.offset, {
|
|
65
65
|
...codeFeatures_1.codeFeatures.all,
|
|
66
66
|
...src !== script.src.text ? codeFeatures_1.codeFeatures.navigationWithoutRename : {},
|
|
67
67
|
});
|
|
68
68
|
yield `'`;
|
|
69
|
-
yield [src.slice(0, script.src.text.length), 'main', script.src.offset,
|
|
69
|
+
yield [src.slice(0, script.src.text.length), 'main', script.src.offset, boundary.features];
|
|
70
70
|
yield src.slice(script.src.text.length);
|
|
71
71
|
yield `'`;
|
|
72
|
-
yield
|
|
72
|
+
yield boundary.end(script.src.offset + script.src.text.length);
|
|
73
73
|
yield utils_1.endOfLine;
|
|
74
74
|
yield `export default ${names_1.names.src}${utils_1.endOfLine}`;
|
|
75
75
|
yield* (0, template_1.generateTemplate)(options, ctx, names_1.names.src);
|
|
@@ -194,9 +194,9 @@ function* generateGlobalTypesReference({ typesRoot, lib, target, checkUnknownPro
|
|
|
194
194
|
}
|
|
195
195
|
function* generateExportDeclareEqual(block, name) {
|
|
196
196
|
yield `const `;
|
|
197
|
-
const
|
|
197
|
+
const boundary = yield* boundary_1.Boundary.start(block.name, 0, codeFeatures_1.codeFeatures.doNotReportTs6133);
|
|
198
198
|
yield name;
|
|
199
|
-
yield
|
|
199
|
+
yield boundary.end(block.content.length);
|
|
200
200
|
yield ` = `;
|
|
201
201
|
}
|
|
202
202
|
//# sourceMappingURL=index.js.map
|
|
@@ -90,7 +90,7 @@ function* generateGeneric(options, ctx, scriptSetup, scriptSetupRanges, generic,
|
|
|
90
90
|
yield ` emit: ${emitTypes.length ? emitTypes.join(` & `) : `{}`}${utils_1.endOfLine}`;
|
|
91
91
|
yield `}${utils_1.endOfLine}`;
|
|
92
92
|
yield `})(),${utils_1.newLine}`; // __VLS_setup = (async () => {
|
|
93
|
-
yield `) => ({} as import('${vueCompilerOptions.lib}').VNode & { __ctx?: Awaited<typeof ${names_1.names.setup}
|
|
93
|
+
yield `) => ({} as import('${vueCompilerOptions.lib}').VNode & { __ctx?: NonNullable<Awaited<typeof ${names_1.names.setup}>> }))${utils_1.endOfLine}`;
|
|
94
94
|
}
|
|
95
95
|
function* generateSetupFunction(options, ctx, scriptSetup, scriptSetupRanges, body, output) {
|
|
96
96
|
const transforms = [];
|
|
@@ -161,9 +161,9 @@ function* generateSetupFunction(options, ctx, scriptSetup, scriptSetupRanges, bo
|
|
|
161
161
|
else {
|
|
162
162
|
transforms.push((0, transform_1.insert)(callExp.end, function* () {
|
|
163
163
|
yield ` as ${type}[`;
|
|
164
|
-
const
|
|
164
|
+
const boundary = yield* boundary_1.Boundary.start(scriptSetup.name, exp.start, codeFeatures_1.codeFeatures.verification);
|
|
165
165
|
yield `'$style'`;
|
|
166
|
-
yield
|
|
166
|
+
yield boundary.end(exp.end);
|
|
167
167
|
yield `])`;
|
|
168
168
|
}));
|
|
169
169
|
}
|
|
@@ -270,7 +270,7 @@ function* generateDefineWithTypeTransforms(scriptSetup, statement, callExp, type
|
|
|
270
270
|
});
|
|
271
271
|
}
|
|
272
272
|
}
|
|
273
|
-
else if (!utils_1.
|
|
273
|
+
else if (!utils_1.identifierRE.test(name)) {
|
|
274
274
|
yield (0, transform_1.replace)(statement.start, callExp.start, function* () {
|
|
275
275
|
yield `const ${defaultName} = `;
|
|
276
276
|
});
|
|
@@ -7,26 +7,22 @@ const utils_1 = require("../utils");
|
|
|
7
7
|
const boundary_1 = require("../utils/boundary");
|
|
8
8
|
function* generateClassProperty(source, classNameWithDot, offset, propertyType) {
|
|
9
9
|
yield `${utils_1.newLine} & { `;
|
|
10
|
-
const
|
|
10
|
+
const boundary = yield* boundary_1.Boundary.start(source, offset, codeFeatures_1.codeFeatures.navigation);
|
|
11
11
|
yield `'`;
|
|
12
|
-
yield [classNameWithDot.slice(1), source, offset + 1,
|
|
12
|
+
yield [classNameWithDot.slice(1), source, offset + 1, boundary.features];
|
|
13
13
|
yield `'`;
|
|
14
|
-
yield
|
|
14
|
+
yield boundary.end(offset + classNameWithDot.length);
|
|
15
15
|
yield `: ${propertyType}`;
|
|
16
16
|
yield ` }`;
|
|
17
17
|
}
|
|
18
18
|
function* generateStyleImports(style) {
|
|
19
|
-
const features = {
|
|
20
|
-
navigation: true,
|
|
21
|
-
verification: true,
|
|
22
|
-
};
|
|
23
19
|
if (typeof style.src === 'object') {
|
|
24
20
|
yield `${utils_1.newLine} & typeof import(`;
|
|
25
|
-
const
|
|
21
|
+
const boundary = yield* boundary_1.Boundary.start('main', style.src.offset, codeFeatures_1.codeFeatures.navigationAndVerification);
|
|
26
22
|
yield `'`;
|
|
27
|
-
yield [style.src.text, 'main', style.src.offset,
|
|
23
|
+
yield [style.src.text, 'main', style.src.offset, boundary.features];
|
|
28
24
|
yield `'`;
|
|
29
|
-
yield
|
|
25
|
+
yield boundary.end(style.src.offset + style.src.text.length);
|
|
30
26
|
yield `).default`;
|
|
31
27
|
}
|
|
32
28
|
for (const { text, offset } of style.imports) {
|
|
@@ -35,7 +31,7 @@ function* generateStyleImports(style) {
|
|
|
35
31
|
text,
|
|
36
32
|
style.name,
|
|
37
33
|
offset,
|
|
38
|
-
|
|
34
|
+
codeFeatures_1.codeFeatures.navigationAndVerification,
|
|
39
35
|
];
|
|
40
36
|
yield `').default`;
|
|
41
37
|
}
|
|
@@ -8,8 +8,7 @@ export interface StyleCodegenOptions {
|
|
|
8
8
|
}
|
|
9
9
|
export { generate as generateStyle };
|
|
10
10
|
declare function generate(options: StyleCodegenOptions): {
|
|
11
|
-
|
|
12
|
-
currentInfo: {
|
|
11
|
+
getCommentInfo: () => {
|
|
13
12
|
ignoreError?: boolean;
|
|
14
13
|
expectError?: {
|
|
15
14
|
token: number;
|
|
@@ -20,41 +19,70 @@ declare function generate(options: StyleCodegenOptions): {
|
|
|
20
19
|
offset: number;
|
|
21
20
|
};
|
|
22
21
|
};
|
|
22
|
+
enter: (node: import("@vue/compiler-dom").RootNode | import("@vue/compiler-dom").TemplateChildNode | import("@vue/compiler-dom").SimpleExpressionNode) => boolean;
|
|
23
|
+
exit: () => Generator<Code>;
|
|
23
24
|
resolveCodeFeatures: (features: import("../../types").VueCodeInformation) => import("../../types").VueCodeInformation;
|
|
24
|
-
|
|
25
|
+
getInternalVariable: () => string;
|
|
26
|
+
scopes: {
|
|
27
|
+
add(value: string): /*elided*/ any;
|
|
28
|
+
declare(...variables: string[]): void;
|
|
29
|
+
end(): Generator<Code, any, any>;
|
|
30
|
+
clear(): void;
|
|
31
|
+
delete(value: string): boolean;
|
|
32
|
+
forEach(callbackfn: (value: string, value2: string, set: Set<string>) => void, thisArg?: any): void;
|
|
33
|
+
has(value: string): boolean;
|
|
34
|
+
readonly size: number;
|
|
35
|
+
[Symbol.iterator](): SetIterator<string>;
|
|
36
|
+
entries(): SetIterator<[string, string]>;
|
|
37
|
+
keys(): SetIterator<string>;
|
|
38
|
+
values(): SetIterator<string>;
|
|
39
|
+
readonly [Symbol.toStringTag]: string;
|
|
40
|
+
}[];
|
|
41
|
+
scope: () => {
|
|
42
|
+
add(value: string): any;
|
|
43
|
+
declare(...variables: string[]): void;
|
|
44
|
+
end(): Generator<Code, any, any>;
|
|
45
|
+
clear(): void;
|
|
46
|
+
delete(value: string): boolean;
|
|
47
|
+
forEach(callbackfn: (value: string, value2: string, set: Set<string>) => void, thisArg?: any): void;
|
|
48
|
+
has(value: string): boolean;
|
|
49
|
+
readonly size: number;
|
|
50
|
+
[Symbol.iterator](): SetIterator<string>;
|
|
51
|
+
entries(): SetIterator<[string, string]>;
|
|
52
|
+
keys(): SetIterator<string>;
|
|
53
|
+
values(): SetIterator<string>;
|
|
54
|
+
readonly [Symbol.toStringTag]: string;
|
|
55
|
+
};
|
|
56
|
+
contextAccesses: Map<string, Map<string, Set<number>>>;
|
|
57
|
+
accessVariable: (source: string, name: string, offset?: number) => void;
|
|
58
|
+
generateAutoImport: () => Generator<Code>;
|
|
59
|
+
conditions: string[];
|
|
60
|
+
generateConditionGuards: () => Generator<string, void, unknown>;
|
|
61
|
+
hoistVars: Map<string, string>;
|
|
62
|
+
getHoistVariable: (originalVar: string) => string;
|
|
63
|
+
generateHoistVariables: () => Generator<string, void, unknown>;
|
|
64
|
+
templateRefs: Map<string, {
|
|
65
|
+
typeExp: string;
|
|
66
|
+
offset: number;
|
|
67
|
+
}[]>;
|
|
68
|
+
addTemplateRef: (name: string, typeExp: string, offset: number) => void;
|
|
69
|
+
components: (() => string)[];
|
|
70
|
+
dollarVars: Set<string>;
|
|
71
|
+
inlayHints: import("../inlayHints").InlayHintInfo[];
|
|
72
|
+
generatedTypes: Set<string>;
|
|
73
|
+
inheritedAttrVars: Set<string>;
|
|
74
|
+
singleRootElTypes: Set<string>;
|
|
75
|
+
singleRootNodes: Set<import("@vue/compiler-dom").ElementNode | null>;
|
|
25
76
|
slots: {
|
|
26
77
|
name: string;
|
|
27
78
|
offset?: number;
|
|
28
79
|
tagRange: [number, number];
|
|
29
|
-
nodeLoc: any;
|
|
30
80
|
propsVar: string;
|
|
31
81
|
}[];
|
|
32
82
|
dynamicSlots: {
|
|
33
83
|
expVar: string;
|
|
34
84
|
propsVar: string;
|
|
35
85
|
}[];
|
|
36
|
-
|
|
37
|
-
componentAccessMap: Map<string, Map<string, Set<number>>>;
|
|
38
|
-
blockConditions: string[];
|
|
39
|
-
inlayHints: import("../inlayHints").InlayHintInfo[];
|
|
40
|
-
inheritedAttrVars: Set<string>;
|
|
41
|
-
templateRefs: Map<string, {
|
|
42
|
-
typeExp: string;
|
|
43
|
-
offset: number;
|
|
44
|
-
}[]>;
|
|
45
|
-
singleRootElTypes: Set<string>;
|
|
46
|
-
singleRootNodes: Set<import("@vue/compiler-dom").ElementNode | null>;
|
|
47
|
-
addTemplateRef(name: string, typeExp: string, offset: number): void;
|
|
48
|
-
recordComponentAccess(source: string, name: string, offset?: number): void;
|
|
49
|
-
scopes: Set<string>[];
|
|
50
|
-
components: (() => string)[];
|
|
51
|
-
declare(...varNames: string[]): void;
|
|
52
|
-
startScope(): () => Generator<Code, any, any>;
|
|
53
|
-
getInternalVariable(): string;
|
|
54
|
-
getHoistVariable(originalVar: string): string;
|
|
55
|
-
generateHoistVariables(): Generator<string, void, unknown>;
|
|
56
|
-
generateConditionGuards(): Generator<string, void, unknown>;
|
|
57
|
-
enter(node: import("@vue/compiler-dom").RootNode | import("@vue/compiler-dom").TemplateChildNode | import("@vue/compiler-dom").SimpleExpressionNode): boolean;
|
|
58
|
-
exit(): Generator<Code>;
|
|
86
|
+
inVFor: boolean;
|
|
59
87
|
codes: Code[];
|
|
60
88
|
};
|
|
@@ -20,12 +20,12 @@ function generate(options) {
|
|
|
20
20
|
return { ...ctx, codes };
|
|
21
21
|
}
|
|
22
22
|
function* generateWorker(options, ctx) {
|
|
23
|
-
const
|
|
24
|
-
|
|
23
|
+
const scope = ctx.scope();
|
|
24
|
+
scope.declare(...options.setupConsts);
|
|
25
25
|
yield* (0, scopedClasses_1.generateStyleScopedClasses)(options);
|
|
26
26
|
yield* (0, modules_1.generateStyleModules)(options, ctx);
|
|
27
27
|
yield* generateCssVars(options, ctx);
|
|
28
|
-
yield*
|
|
28
|
+
yield* scope.end();
|
|
29
29
|
}
|
|
30
30
|
function* generateCssVars(options, ctx) {
|
|
31
31
|
for (const style of options.styles) {
|