@vue/language-core 1.8.7 → 1.8.10

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.
Files changed (48) hide show
  1. package/out/generators/script.d.ts +3 -3
  2. package/out/generators/script.js +30 -7
  3. package/out/generators/template.d.ts +3 -2
  4. package/out/generators/template.js +55 -19
  5. package/out/index.d.ts +3 -0
  6. package/out/index.js +15 -2
  7. package/out/languageModule.d.ts +2 -1
  8. package/out/languageModule.js +25 -2
  9. package/out/parsers/scriptRanges.d.ts +1 -0
  10. package/out/parsers/scriptSetupRanges.d.ts +1 -0
  11. package/out/plugins/file-html.d.ts +2 -1
  12. package/out/plugins/file-html.js +2 -1
  13. package/out/plugins/file-md.d.ts +2 -1
  14. package/out/plugins/file-md.js +2 -1
  15. package/out/plugins/file-vue.d.ts +2 -1
  16. package/out/plugins/file-vue.js +2 -1
  17. package/out/plugins/vue-sfc-customblocks.d.ts +2 -1
  18. package/out/plugins/vue-sfc-customblocks.js +2 -1
  19. package/out/plugins/vue-sfc-scripts.d.ts +2 -1
  20. package/out/plugins/vue-sfc-scripts.js +2 -1
  21. package/out/plugins/vue-sfc-styles.d.ts +2 -1
  22. package/out/plugins/vue-sfc-styles.js +2 -1
  23. package/out/plugins/vue-sfc-template.d.ts +2 -1
  24. package/out/plugins/vue-sfc-template.js +2 -1
  25. package/out/plugins/vue-template-html.d.ts +2 -1
  26. package/out/plugins/vue-template-html.js +2 -1
  27. package/out/plugins/vue-tsx.d.ts +3 -3
  28. package/out/plugins/vue-tsx.js +27 -4
  29. package/out/plugins.d.ts +1 -0
  30. package/out/plugins.js +51 -20
  31. package/out/sourceFile.d.ts +9 -8
  32. package/out/sourceFile.js +24 -1
  33. package/out/types.d.ts +8 -7
  34. package/out/utils/globalTypes.d.ts +1 -0
  35. package/out/utils/parseCssClassNames.d.ts +1 -0
  36. package/out/utils/parseCssVars.d.ts +1 -0
  37. package/out/utils/parseSfc.d.ts +1 -0
  38. package/out/utils/parseSfc.js +24 -1
  39. package/out/utils/shared.d.ts +3 -0
  40. package/out/utils/shared.js +13 -1
  41. package/out/utils/transform.d.ts +1 -0
  42. package/out/utils/ts.d.ts +2 -1
  43. package/out/utils/ts.js +33 -6
  44. package/out/utils/vue2TemplateCompiler.d.ts +3 -3
  45. package/out/utils/vue2TemplateCompiler.js +23 -15
  46. package/package.json +2 -2
  47. package/out/utils/directorySharedTypes.d.ts +0 -4
  48. package/out/utils/directorySharedTypes.js +0 -150
@@ -1,14 +1,14 @@
1
- import { Segment } from '@volar/source-map';
2
1
  import { FileRangeCapabilities, MirrorBehaviorCapabilities } from '@volar/language-core';
3
2
  import * as SourceMaps from '@volar/source-map';
4
3
  import type * as ts from 'typescript/lib/tsserverlibrary';
5
4
  import type * as templateGen from '../generators/template';
6
5
  import type { ScriptRanges } from '../parsers/scriptRanges';
7
6
  import type { ScriptSetupRanges } from '../parsers/scriptSetupRanges';
8
- import { Sfc } from '../types';
9
7
  import type { VueCompilerOptions } from '../types';
8
+ import { Sfc } from '../types';
10
9
  export declare function generate(ts: typeof import('typescript/lib/tsserverlibrary'), fileName: string, _sfc: Sfc, lang: string, scriptRanges: ScriptRanges | undefined, scriptSetupRanges: ScriptSetupRanges | undefined, htmlGen: ReturnType<typeof templateGen['generate']> | undefined, compilerOptions: ts.CompilerOptions, vueCompilerOptions: VueCompilerOptions, codegenStack: boolean): {
11
- codes: Segment<FileRangeCapabilities>[];
10
+ codes: SourceMaps.Segment<FileRangeCapabilities>[];
12
11
  codeStacks: SourceMaps.StackNode[];
13
12
  mirrorBehaviorMappings: SourceMaps.Mapping<[MirrorBehaviorCapabilities, MirrorBehaviorCapabilities]>[];
14
13
  };
14
+ //# sourceMappingURL=script.d.ts.map
@@ -1,14 +1,36 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
2
25
  Object.defineProperty(exports, "__esModule", { value: true });
3
26
  exports.generate = void 0;
4
- const source_map_1 = require("@volar/source-map");
5
27
  const language_core_1 = require("@volar/language-core");
6
- const shared_1 = require("@vue/shared");
28
+ const source_map_1 = require("@volar/source-map");
29
+ const muggle = __importStar(require("muggle-string"));
7
30
  const path_1 = require("path");
8
- const shared_2 = require("../utils/shared");
31
+ const sharedTypes = __importStar(require("../utils/globalTypes"));
32
+ const shared_1 = require("../utils/shared");
9
33
  const transform_1 = require("../utils/transform");
10
- const sharedTypes = require("../utils/globalTypes");
11
- const muggle = require("muggle-string");
12
34
  function generate(ts, fileName, _sfc, lang, scriptRanges, scriptSetupRanges, htmlGen, compilerOptions, vueCompilerOptions, codegenStack) {
13
35
  const [codes, codeStacks] = codegenStack ? muggle.track([]) : [[], []];
14
36
  const mirrorBehaviorMappings = [];
@@ -273,6 +295,7 @@ function generate(ts, fileName, _sfc, lang, scriptRanges, scriptSetupRanges, htm
273
295
  codes.push('(\n');
274
296
  codes.push(`__VLS_props: Awaited<typeof __VLS_setup>['props']`, `& import('${vueCompilerOptions.lib}').VNodeProps`, `& import('${vueCompilerOptions.lib}').AllowedComponentProps`, `& import('${vueCompilerOptions.lib}').ComponentCustomProps,\n`);
275
297
  codes.push(`__VLS_ctx?: Pick<Awaited<typeof __VLS_setup>, 'attrs' | 'emit' | 'slots'>,\n`);
298
+ codes.push(`__VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>['expose'],\n`);
276
299
  codes.push('__VLS_setup = (async () => {\n');
277
300
  scriptSetupGeneratedOffset = generateSetupFunction(true, 'none', definePropMirrors);
278
301
  //#region exposed
@@ -733,7 +756,7 @@ declare function defineProp<T>(value?: T | (() => T), required?: boolean, rest?:
733
756
  /* Components */
734
757
  codes.push('/* Components */\n');
735
758
  codes.push(`let __VLS_otherComponents!: NonNullable<typeof __VLS_internalComponent extends { components: infer C } ? C : {}> & typeof __VLS_componentsOption;\n`);
736
- codes.push(`let __VLS_own!: __VLS_SelfComponent<typeof __VLS_name, typeof __VLS_internalComponent & typeof __VLS_publicComponent & (new () => { ${(0, shared_2.getSlotsPropertyName)(vueCompilerOptions.target)}: typeof __VLS_slots })>;\n`);
759
+ codes.push(`let __VLS_own!: __VLS_SelfComponent<typeof __VLS_name, typeof __VLS_internalComponent & typeof __VLS_publicComponent & (new () => { ${(0, shared_1.getSlotsPropertyName)(vueCompilerOptions.target)}: typeof __VLS_slots })>;\n`);
737
760
  codes.push(`let __VLS_localComponents!: typeof __VLS_otherComponents & Omit<typeof __VLS_own, keyof typeof __VLS_otherComponents>;\n`);
738
761
  codes.push(`let __VLS_components!: typeof __VLS_localComponents & __VLS_GlobalComponents & typeof __VLS_ctx;\n`); // for html completion, TS references...
739
762
  /* Style Scoped */
@@ -847,7 +870,7 @@ declare function defineProp<T>(value?: T | (() => T), required?: boolean, rest?:
847
870
  }
848
871
  // fix import components unused report
849
872
  for (const varName of bindingNames) {
850
- if (!!htmlGen.tagNames[varName] || !!htmlGen.tagNames[(0, shared_1.hyphenate)(varName)]) {
873
+ if (!!htmlGen.tagNames[varName] || !!htmlGen.tagNames[(0, shared_1.hyphenateTag)(varName)]) {
851
874
  usageVars.add(varName);
852
875
  }
853
876
  }
@@ -1,9 +1,9 @@
1
- import { Segment } from '@volar/source-map';
2
1
  import { FileRangeCapabilities } from '@volar/language-core';
2
+ import { Segment } from '@volar/source-map';
3
3
  import * as CompilerDOM from '@vue/compiler-dom';
4
+ import * as muggle from 'muggle-string';
4
5
  import type * as ts from 'typescript/lib/tsserverlibrary';
5
6
  import { Sfc, VueCompilerOptions } from '../types';
6
- import * as muggle from 'muggle-string';
7
7
  type Code = Segment<FileRangeCapabilities>;
8
8
  export declare function generate(ts: typeof import('typescript/lib/tsserverlibrary'), compilerOptions: ts.CompilerOptions, vueCompilerOptions: VueCompilerOptions, sourceTemplate: string, sourceLang: string, sfc: Sfc, hasScriptSetupSlots: boolean, codegenStack: boolean): {
9
9
  codes: Code[];
@@ -18,3 +18,4 @@ export declare function generate(ts: typeof import('typescript/lib/tsserverlibra
18
18
  };
19
19
  export declare function walkElementNodes(node: CompilerDOM.RootNode | CompilerDOM.TemplateChildNode, cb: (node: CompilerDOM.ElementNode) => void): void;
20
20
  export {};
21
+ //# sourceMappingURL=template.d.ts.map
@@ -1,12 +1,36 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
2
25
  Object.defineProperty(exports, "__esModule", { value: true });
3
26
  exports.walkElementNodes = exports.generate = void 0;
4
27
  const language_core_1 = require("@volar/language-core");
5
- const CompilerDOM = require("@vue/compiler-dom");
28
+ const CompilerDOM = __importStar(require("@vue/compiler-dom"));
6
29
  const shared_1 = require("@vue/shared");
7
- const transform_1 = require("../utils/transform");
8
30
  const minimatch_1 = require("minimatch");
9
- const muggle = require("muggle-string");
31
+ const muggle = __importStar(require("muggle-string"));
32
+ const shared_2 = require("../utils/shared");
33
+ const transform_1 = require("../utils/transform");
10
34
  const capabilitiesPresets = {
11
35
  all: language_core_1.FileRangeCapabilities.full,
12
36
  allWithHiddenParam: {
@@ -182,7 +206,7 @@ function generate(ts, compilerOptions, vueCompilerOptions, sourceTemplate, sourc
182
206
  ...capabilitiesPresets.tagReference,
183
207
  rename: {
184
208
  normalize: tagName === name ? capabilitiesPresets.tagReference.rename.normalize : camelizeComponentName,
185
- apply: getRenameApply(tagName),
209
+ apply: getTagRenameApply(tagName),
186
210
  },
187
211
  },
188
212
  ]), ';');
@@ -547,7 +571,16 @@ function generate(ts, compilerOptions, vueCompilerOptions, sourceTemplate, sourc
547
571
  // diagnostic start
548
572
  tagOffsets.length ? ['', 'template', tagOffsets[0], capabilitiesPresets.diagnosticOnly]
549
573
  : dynamicTagExp ? ['', 'template', startTagOffset, capabilitiesPresets.diagnosticOnly]
550
- : '', '{ ', ...createPropsCode(node, props, 'normal', propsFailedExps), '}',
574
+ : '', '{ ');
575
+ if (!vueCompilerOptions.strictTemplates) {
576
+ // fix https://github.com/vuejs/language-tools/issues/3318
577
+ codes.push('...{ ');
578
+ }
579
+ codes.push(...createPropsCode(node, props, 'normal', propsFailedExps));
580
+ if (!vueCompilerOptions.strictTemplates) {
581
+ codes.push('}, ');
582
+ }
583
+ codes.push('}',
551
584
  // diagnostic end
552
585
  tagOffsets.length ? ['', 'template', tagOffsets[0] + tag.length, capabilitiesPresets.diagnosticOnly]
553
586
  : dynamicTagExp ? ['', 'template', startTagOffset + tag.length, capabilitiesPresets.diagnosticOnly]
@@ -701,8 +734,8 @@ function generate(ts, compilerOptions, vueCompilerOptions, sourceTemplate, sourc
701
734
  },
702
735
  // onClickOutside -> @click-outside
703
736
  apply(newName) {
704
- const hName = (0, shared_1.hyphenate)(newName);
705
- if ((0, shared_1.hyphenate)(newName).startsWith('on-')) {
737
+ const hName = (0, shared_2.hyphenateAttr)(newName);
738
+ if ((0, shared_2.hyphenateAttr)(newName).startsWith('on-')) {
706
739
  return (0, shared_1.camelize)(hName.slice('on-'.length));
707
740
  }
708
741
  return newName;
@@ -843,7 +876,7 @@ function generate(ts, compilerOptions, vueCompilerOptions, sourceTemplate, sourc
843
876
  }
844
877
  let camelized = false;
845
878
  if ((!prop.arg || (prop.arg.type === 4 /* CompilerDOM.NodeTypes.SIMPLE_EXPRESSION */ && prop.arg.isStatic)) // isStatic
846
- && (0, shared_1.hyphenate)(attrNameText) === attrNameText
879
+ && (0, shared_2.hyphenateAttr)(attrNameText) === attrNameText
847
880
  && !vueCompilerOptions.htmlAttributes.some(pattern => (0, minimatch_1.minimatch)(attrNameText, pattern))) {
848
881
  attrNameText = (0, shared_1.camelize)(attrNameText);
849
882
  camelized = true;
@@ -872,7 +905,7 @@ function generate(ts, compilerOptions, vueCompilerOptions, sourceTemplate, sourc
872
905
  ...caps_attr,
873
906
  rename: {
874
907
  normalize: shared_1.camelize,
875
- apply: camelized ? shared_1.hyphenate : noEditApply,
908
+ apply: camelized ? shared_2.hyphenateAttr : noEditApply,
876
909
  },
877
910
  },
878
911
  ], prop.loc.name_2 ?? (prop.loc.name_2 = {})));
@@ -886,7 +919,7 @@ function generate(ts, compilerOptions, vueCompilerOptions, sourceTemplate, sourc
886
919
  ...caps_attr,
887
920
  rename: {
888
921
  normalize: shared_1.camelize,
889
- apply: camelized ? shared_1.hyphenate : noEditApply,
922
+ apply: camelized ? shared_2.hyphenateAttr : noEditApply,
890
923
  },
891
924
  },
892
925
  ], prop.loc.name_2 ?? (prop.loc.name_2 = {})));
@@ -920,7 +953,7 @@ function generate(ts, compilerOptions, vueCompilerOptions, sourceTemplate, sourc
920
953
  continue;
921
954
  }
922
955
  let camelized = false;
923
- if ((0, shared_1.hyphenate)(prop.name) === prop.name
956
+ if ((0, shared_2.hyphenateAttr)(prop.name) === prop.name
924
957
  && !vueCompilerOptions.htmlAttributes.some(pattern => (0, minimatch_1.minimatch)(attrNameText, pattern))) {
925
958
  attrNameText = (0, shared_1.camelize)(prop.name);
926
959
  camelized = true;
@@ -940,7 +973,7 @@ function generate(ts, compilerOptions, vueCompilerOptions, sourceTemplate, sourc
940
973
  ...caps_attr,
941
974
  rename: {
942
975
  normalize: shared_1.camelize,
943
- apply: camelized ? shared_1.hyphenate : noEditApply,
976
+ apply: camelized ? shared_2.hyphenateAttr : noEditApply,
944
977
  },
945
978
  },
946
979
  ], prop.loc.name_1 ?? (prop.loc.name_1 = {})));
@@ -1049,7 +1082,7 @@ function generate(ts, compilerOptions, vueCompilerOptions, sourceTemplate, sourc
1049
1082
  },
1050
1083
  rename: {
1051
1084
  normalize: shared_1.camelize,
1052
- apply: getRenameApply(prop.name),
1085
+ apply: getPropRenameApply(prop.name),
1053
1086
  },
1054
1087
  },
1055
1088
  ], ')', '(');
@@ -1136,7 +1169,7 @@ function generate(ts, compilerOptions, vueCompilerOptions, sourceTemplate, sourc
1136
1169
  ...capabilitiesPresets.slotProp,
1137
1170
  rename: {
1138
1171
  normalize: shared_1.camelize,
1139
- apply: getRenameApply(prop.arg.content),
1172
+ apply: getPropRenameApply(prop.arg.content),
1140
1173
  },
1141
1174
  },
1142
1175
  ], prop.arg.loc), ': ', ...createInterpolationCode(prop.exp.content, prop.exp.loc, prop.exp.loc.start.offset, capabilitiesPresets.attrReference, '(', ')'), ',\n');
@@ -1152,7 +1185,7 @@ function generate(ts, compilerOptions, vueCompilerOptions, sourceTemplate, sourc
1152
1185
  ...capabilitiesPresets.attr,
1153
1186
  rename: {
1154
1187
  normalize: shared_1.camelize,
1155
- apply: getRenameApply(prop.name),
1188
+ apply: getPropRenameApply(prop.name),
1156
1189
  },
1157
1190
  },
1158
1191
  ], prop.loc), ': (', prop.value !== undefined ? `"${toUnicodeIfNeed(prop.value.content)}"` : 'true', '),\n');
@@ -1381,8 +1414,11 @@ function toUnicode(str) {
1381
1414
  function camelizeComponentName(newName) {
1382
1415
  return (0, shared_1.camelize)('-' + newName);
1383
1416
  }
1384
- function getRenameApply(oldName) {
1385
- return oldName === (0, shared_1.hyphenate)(oldName) ? shared_1.hyphenate : noEditApply;
1417
+ function getTagRenameApply(oldName) {
1418
+ return oldName === (0, shared_2.hyphenateTag)(oldName) ? shared_2.hyphenateTag : noEditApply;
1419
+ }
1420
+ function getPropRenameApply(oldName) {
1421
+ return oldName === (0, shared_2.hyphenateAttr)(oldName) ? shared_2.hyphenateAttr : noEditApply;
1386
1422
  }
1387
1423
  function noEditApply(n) {
1388
1424
  return n;
@@ -1391,7 +1427,7 @@ function getModelValuePropName(node, vueVersion, vueCompilerOptions) {
1391
1427
  for (const modelName in vueCompilerOptions.experimentalModelPropName) {
1392
1428
  const tags = vueCompilerOptions.experimentalModelPropName[modelName];
1393
1429
  for (const tag in tags) {
1394
- if (node.tag === tag || node.tag === (0, shared_1.hyphenate)(tag)) {
1430
+ if (node.tag === tag || node.tag === (0, shared_2.hyphenateTag)(tag)) {
1395
1431
  const v = tags[tag];
1396
1432
  if (typeof v === 'object') {
1397
1433
  const arr = Array.isArray(v) ? v : [v];
@@ -1416,7 +1452,7 @@ function getModelValuePropName(node, vueVersion, vueCompilerOptions) {
1416
1452
  for (const modelName in vueCompilerOptions.experimentalModelPropName) {
1417
1453
  const tags = vueCompilerOptions.experimentalModelPropName[modelName];
1418
1454
  for (const tag in tags) {
1419
- if (node.tag === tag || node.tag === (0, shared_1.hyphenate)(tag)) {
1455
+ if (node.tag === tag || node.tag === (0, shared_2.hyphenateTag)(tag)) {
1420
1456
  const attrs = tags[tag];
1421
1457
  if (attrs === true) {
1422
1458
  return modelName || undefined;
package/out/index.d.ts CHANGED
@@ -8,6 +8,9 @@ export * from './utils/ts';
8
8
  export * from './utils/parseSfc';
9
9
  export * as scriptRanges from './parsers/scriptRanges';
10
10
  export * as sharedTypes from './utils/globalTypes';
11
+ export * from './utils/shared';
11
12
  export { tsCodegen } from './plugins/vue-tsx';
12
13
  export * from '@volar/language-core';
13
14
  export * from '@volar/source-map';
15
+ export type * as CompilerDOM from '@vue/compiler-dom';
16
+ //# sourceMappingURL=index.d.ts.map
package/out/index.js CHANGED
@@ -10,9 +10,21 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
10
10
  if (k2 === undefined) k2 = k;
11
11
  o[k2] = m[k];
12
12
  }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
13
18
  var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
19
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
20
  };
21
+ var __importStar = (this && this.__importStar) || function (mod) {
22
+ if (mod && mod.__esModule) return mod;
23
+ var result = {};
24
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
25
+ __setModuleDefault(result, mod);
26
+ return result;
27
+ };
16
28
  Object.defineProperty(exports, "__esModule", { value: true });
17
29
  exports.tsCodegen = exports.sharedTypes = exports.scriptRanges = void 0;
18
30
  __exportStar(require("./generators/template"), exports);
@@ -23,8 +35,9 @@ __exportStar(require("./sourceFile"), exports);
23
35
  __exportStar(require("./types"), exports);
24
36
  __exportStar(require("./utils/ts"), exports);
25
37
  __exportStar(require("./utils/parseSfc"), exports);
26
- exports.scriptRanges = require("./parsers/scriptRanges");
27
- exports.sharedTypes = require("./utils/globalTypes");
38
+ exports.scriptRanges = __importStar(require("./parsers/scriptRanges"));
39
+ exports.sharedTypes = __importStar(require("./utils/globalTypes"));
40
+ __exportStar(require("./utils/shared"), exports);
28
41
  var vue_tsx_1 = require("./plugins/vue-tsx");
29
42
  Object.defineProperty(exports, "tsCodegen", { enumerable: true, get: function () { return vue_tsx_1.tsCodegen; } });
30
43
  __exportStar(require("@volar/language-core"), exports);
@@ -4,6 +4,7 @@ import { VueCompilerOptions } from './types';
4
4
  import type * as ts from 'typescript/lib/tsserverlibrary';
5
5
  export declare function createVueLanguage(ts: typeof import('typescript/lib/tsserverlibrary'), compilerOptions?: ts.CompilerOptions, _vueCompilerOptions?: Partial<VueCompilerOptions>, codegenStack?: boolean): Language<VueFile>;
6
6
  /**
7
- * @deprecated planed to remove in 2.0, please use getOrCreateVueLanguage instead of
7
+ * @deprecated planed to remove in 2.0, please use createVueLanguage instead of
8
8
  */
9
9
  export declare function createLanguages(compilerOptions?: ts.CompilerOptions, vueCompilerOptions?: Partial<VueCompilerOptions>, ts?: typeof import('typescript/lib/tsserverlibrary'), codegenStack?: boolean): Language[];
10
+ //# sourceMappingURL=languageModule.d.ts.map
@@ -1,10 +1,33 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
2
25
  Object.defineProperty(exports, "__esModule", { value: true });
3
26
  exports.createLanguages = exports.createVueLanguage = void 0;
4
27
  const path_1 = require("path");
5
28
  const plugins_1 = require("./plugins");
6
29
  const sourceFile_1 = require("./sourceFile");
7
- const sharedTypes = require("./utils/globalTypes");
30
+ const sharedTypes = __importStar(require("./utils/globalTypes"));
8
31
  const ts_1 = require("./utils/ts");
9
32
  const fileRegistries = [];
10
33
  function getVueFileRegistry(key, plugins) {
@@ -87,7 +110,7 @@ function createVueLanguage(ts, compilerOptions = {}, _vueCompilerOptions = {}, c
87
110
  }
88
111
  exports.createVueLanguage = createVueLanguage;
89
112
  /**
90
- * @deprecated planed to remove in 2.0, please use getOrCreateVueLanguage instead of
113
+ * @deprecated planed to remove in 2.0, please use createVueLanguage instead of
91
114
  */
92
115
  function createLanguages(compilerOptions = {}, vueCompilerOptions = {}, ts = require('typescript'), codegenStack = false) {
93
116
  return [
@@ -13,3 +13,4 @@ export declare function parseScriptRanges(ts: typeof import('typescript/lib/tsse
13
13
  }) | undefined;
14
14
  bindings: TextRange[];
15
15
  };
16
+ //# sourceMappingURL=scriptRanges.d.ts.map
@@ -31,3 +31,4 @@ export declare function getStartEnd(node: ts.Node, sourceFile: ts.SourceFile): {
31
31
  start: number;
32
32
  end: number;
33
33
  };
34
+ //# sourceMappingURL=scriptSetupRanges.d.ts.map
@@ -1,3 +1,4 @@
1
1
  import { VueLanguagePlugin } from '../types';
2
2
  declare const plugin: VueLanguagePlugin;
3
- export = plugin;
3
+ export default plugin;
4
+ //# sourceMappingURL=file-html.d.ts.map
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
2
3
  const sfcBlockReg = /\<(script|style)\b([\s\S]*?)\>([\s\S]*?)\<\/\1\>/g;
3
4
  const langReg = /\blang\s*=\s*(['\"]?)(\S*)\b\1/;
4
5
  const plugin = () => {
@@ -76,5 +77,5 @@ const plugin = () => {
76
77
  }
77
78
  };
78
79
  };
79
- module.exports = plugin;
80
+ exports.default = plugin;
80
81
  //# sourceMappingURL=file-html.js.map
@@ -1,3 +1,4 @@
1
1
  import { VueLanguagePlugin } from '../types';
2
2
  declare const plugin: VueLanguagePlugin;
3
- export = plugin;
3
+ export default plugin;
4
+ //# sourceMappingURL=file-md.d.ts.map
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
2
3
  const source_map_1 = require("@volar/source-map");
3
4
  const parseSfc_1 = require("../utils/parseSfc");
4
5
  const codeblockReg = /```[\s\S]+?```/g;
@@ -63,5 +64,5 @@ const plugin = () => {
63
64
  }
64
65
  };
65
66
  };
66
- module.exports = plugin;
67
+ exports.default = plugin;
67
68
  //# sourceMappingURL=file-md.js.map
@@ -1,3 +1,4 @@
1
1
  import { VueLanguagePlugin } from '../types';
2
2
  declare const plugin: VueLanguagePlugin;
3
- export = plugin;
3
+ export default plugin;
4
+ //# sourceMappingURL=file-vue.d.ts.map
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
2
3
  const parseSfc_1 = require("../utils/parseSfc");
3
4
  const plugin = (_ctx) => {
4
5
  return {
@@ -35,5 +36,5 @@ const plugin = (_ctx) => {
35
36
  },
36
37
  };
37
38
  };
38
- module.exports = plugin;
39
+ exports.default = plugin;
39
40
  //# sourceMappingURL=file-vue.js.map
@@ -1,3 +1,4 @@
1
1
  import { VueLanguagePlugin } from '../types';
2
2
  declare const plugin: VueLanguagePlugin;
3
- export = plugin;
3
+ export default plugin;
4
+ //# sourceMappingURL=vue-sfc-customblocks.d.ts.map
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
2
3
  const language_core_1 = require("@volar/language-core");
3
4
  const customBlockReg = /^(.*)\.customBlock_([^_]+)_(\d+)\.([^.]+)$/;
4
5
  const plugin = () => {
@@ -28,5 +29,5 @@ const plugin = () => {
28
29
  },
29
30
  };
30
31
  };
31
- module.exports = plugin;
32
+ exports.default = plugin;
32
33
  //# sourceMappingURL=vue-sfc-customblocks.js.map
@@ -1,3 +1,4 @@
1
1
  import { VueLanguagePlugin } from '../types';
2
2
  declare const plugin: VueLanguagePlugin;
3
- export = plugin;
3
+ export default plugin;
4
+ //# sourceMappingURL=vue-sfc-scripts.d.ts.map
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
2
3
  const language_core_1 = require("@volar/language-core");
3
4
  const scriptFormatReg = /^(.*)\.script_format\.([^.]+)$/;
4
5
  const scriptSetupFormatReg = /^(.*)\.scriptSetup_format\.([^.]+)$/;
@@ -37,5 +38,5 @@ const plugin = () => {
37
38
  },
38
39
  };
39
40
  };
40
- module.exports = plugin;
41
+ exports.default = plugin;
41
42
  //# sourceMappingURL=vue-sfc-scripts.js.map
@@ -1,3 +1,4 @@
1
1
  import { VueLanguagePlugin } from '../types';
2
2
  declare const plugin: VueLanguagePlugin;
3
- export = plugin;
3
+ export default plugin;
4
+ //# sourceMappingURL=vue-sfc-styles.d.ts.map
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
2
3
  const language_core_1 = require("@volar/language-core");
3
4
  const styleReg = /^(.*)\.style_(\d+)\.([^.]+)$/;
4
5
  const plugin = () => {
@@ -28,5 +29,5 @@ const plugin = () => {
28
29
  },
29
30
  };
30
31
  };
31
- module.exports = plugin;
32
+ exports.default = plugin;
32
33
  //# sourceMappingURL=vue-sfc-styles.js.map
@@ -1,3 +1,4 @@
1
1
  import { VueLanguagePlugin } from '../types';
2
2
  declare const plugin: VueLanguagePlugin;
3
- export = plugin;
3
+ export default plugin;
4
+ //# sourceMappingURL=vue-sfc-template.d.ts.map
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
2
3
  const language_core_1 = require("@volar/language-core");
3
4
  const templateReg = /^(.*)\.template\.([^.]+)$/;
4
5
  const plugin = () => {
@@ -24,5 +25,5 @@ const plugin = () => {
24
25
  },
25
26
  };
26
27
  };
27
- module.exports = plugin;
28
+ exports.default = plugin;
28
29
  //# sourceMappingURL=vue-sfc-template.js.map
@@ -1,3 +1,4 @@
1
1
  import { VueLanguagePlugin } from '../types';
2
2
  declare const plugin: VueLanguagePlugin;
3
- export = plugin;
3
+ export default plugin;
4
+ //# sourceMappingURL=vue-template-html.d.ts.map
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
2
3
  const plugin = ({ modules }) => {
3
4
  return {
4
5
  version: 1,
@@ -164,5 +165,5 @@ const plugin = ({ modules }) => {
164
165
  },
165
166
  };
166
167
  };
167
- module.exports = plugin;
168
+ exports.default = plugin;
168
169
  //# sourceMappingURL=vue-template-html.js.map
@@ -1,14 +1,13 @@
1
1
  import { Sfc, VueLanguagePlugin } from '../types';
2
2
  import * as muggle from 'muggle-string';
3
- import * as ts from 'typescript/lib/tsserverlibrary';
4
3
  export declare const tsCodegen: WeakMap<Sfc, {
5
4
  scriptRanges: import("@vue/reactivity").ComputedRef<{
6
5
  exportDefault: (import("../types").TextRange & {
7
6
  expression: import("../types").TextRange;
8
7
  args: import("../types").TextRange;
9
- argsNode: ts.ObjectLiteralExpression | undefined;
8
+ argsNode: import("typescript/lib/tsserverlibrary").ObjectLiteralExpression | undefined;
10
9
  componentsOption: import("../types").TextRange | undefined;
11
- componentsOptionNode: ts.ObjectLiteralExpression | undefined;
10
+ componentsOptionNode: import("typescript/lib/tsserverlibrary").ObjectLiteralExpression | undefined;
12
11
  nameOption: import("../types").TextRange | undefined;
13
12
  }) | undefined;
14
13
  bindings: import("../types").TextRange[];
@@ -56,3 +55,4 @@ export declare const tsCodegen: WeakMap<Sfc, {
56
55
  }>;
57
56
  declare const plugin: VueLanguagePlugin;
58
57
  export default plugin;
58
+ //# sourceMappingURL=vue-tsx.d.ts.map
@@ -1,14 +1,36 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
2
25
  Object.defineProperty(exports, "__esModule", { value: true });
3
26
  exports.tsCodegen = void 0;
4
27
  const reactivity_1 = require("@vue/reactivity");
5
28
  const script_1 = require("../generators/script");
6
- const templateGen = require("../generators/template");
29
+ const templateGen = __importStar(require("../generators/template"));
7
30
  const scriptRanges_1 = require("../parsers/scriptRanges");
8
31
  const scriptSetupRanges_1 = require("../parsers/scriptSetupRanges");
9
32
  const language_core_1 = require("@volar/language-core");
10
- const muggle = require("muggle-string");
11
- const ts = require("typescript/lib/tsserverlibrary");
33
+ const muggle = __importStar(require("muggle-string"));
12
34
  const templateFormatReg = /^\.template_format\.ts$/;
13
35
  const templateStyleCssReg = /^\.template_style\.css$/;
14
36
  exports.tsCodegen = new WeakMap();
@@ -99,7 +121,8 @@ const plugin = (ctx) => {
99
121
  }
100
122
  };
101
123
  exports.default = plugin;
102
- function createTsx(fileName, _sfc, { vueCompilerOptions, compilerOptions, codegenStack }) {
124
+ function createTsx(fileName, _sfc, { vueCompilerOptions, compilerOptions, codegenStack, modules }) {
125
+ const ts = modules.typescript;
103
126
  const lang = (0, reactivity_1.computed)(() => {
104
127
  return !_sfc.script && !_sfc.scriptSetup ? 'ts'
105
128
  : _sfc.scriptSetup && _sfc.scriptSetup.lang !== 'js' ? _sfc.scriptSetup.lang
package/out/plugins.d.ts CHANGED
@@ -22,3 +22,4 @@ export declare function getDefaultVueLanguagePlugins(ts: typeof import('typescri
22
22
  getEmbeddedFileNames?(fileName: string, sfc: import("./types").Sfc): string[];
23
23
  resolveEmbeddedFile?(fileName: string, sfc: import("./types").Sfc, embeddedFile: import("./sourceFile").VueEmbeddedFile): void;
24
24
  }[];
25
+ //# sourceMappingURL=plugins.d.ts.map