@vue/language-core 2.0.0 → 2.0.1

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 (63) hide show
  1. package/index.d.ts +13 -0
  2. package/index.js +31 -0
  3. package/lib/generators/script.d.ts +13 -0
  4. package/lib/generators/script.js +1060 -0
  5. package/lib/generators/template.d.ts +9 -0
  6. package/lib/generators/template.js +1567 -0
  7. package/lib/generators/utils.d.ts +6 -0
  8. package/lib/generators/utils.js +58 -0
  9. package/lib/languageModule.d.ts +5 -0
  10. package/lib/languageModule.js +114 -0
  11. package/lib/parsers/scriptRanges.d.ts +15 -0
  12. package/lib/parsers/scriptRanges.js +63 -0
  13. package/lib/parsers/scriptSetupRanges.d.ts +57 -0
  14. package/lib/parsers/scriptSetupRanges.js +298 -0
  15. package/lib/plugins/file-html.d.ts +3 -0
  16. package/lib/plugins/file-html.js +81 -0
  17. package/lib/plugins/file-md.d.ts +3 -0
  18. package/lib/plugins/file-md.js +71 -0
  19. package/lib/plugins/file-vue.d.ts +3 -0
  20. package/lib/plugins/file-vue.js +47 -0
  21. package/lib/plugins/vue-sfc-customblocks.d.ts +3 -0
  22. package/lib/plugins/vue-sfc-customblocks.js +28 -0
  23. package/lib/plugins/vue-sfc-scripts.d.ts +3 -0
  24. package/lib/plugins/vue-sfc-scripts.js +36 -0
  25. package/lib/plugins/vue-sfc-styles.d.ts +3 -0
  26. package/lib/plugins/vue-sfc-styles.js +28 -0
  27. package/lib/plugins/vue-sfc-template.d.ts +3 -0
  28. package/lib/plugins/vue-sfc-template.js +29 -0
  29. package/lib/plugins/vue-template-html.d.ts +3 -0
  30. package/lib/plugins/vue-template-html.js +169 -0
  31. package/lib/plugins/vue-tsx.d.ts +80 -0
  32. package/lib/plugins/vue-tsx.js +212 -0
  33. package/lib/plugins.d.ts +37 -0
  34. package/lib/plugins.js +64 -0
  35. package/lib/types.d.ts +142 -0
  36. package/lib/types.js +5 -0
  37. package/lib/utils/parseCssClassNames.d.ts +4 -0
  38. package/lib/utils/parseCssClassNames.js +19 -0
  39. package/lib/utils/parseCssVars.d.ts +5 -0
  40. package/lib/utils/parseCssVars.js +28 -0
  41. package/lib/utils/parseSfc.d.ts +2 -0
  42. package/lib/utils/parseSfc.js +121 -0
  43. package/lib/utils/shared.d.ts +3 -0
  44. package/lib/utils/shared.js +20 -0
  45. package/lib/utils/transform.d.ts +8 -0
  46. package/lib/utils/transform.js +195 -0
  47. package/lib/utils/ts.d.ts +8 -0
  48. package/lib/utils/ts.js +225 -0
  49. package/lib/utils/vue2TemplateCompiler.d.ts +2 -0
  50. package/lib/utils/vue2TemplateCompiler.js +89 -0
  51. package/lib/virtualFile/computedFiles.d.ts +3 -0
  52. package/lib/virtualFile/computedFiles.js +217 -0
  53. package/lib/virtualFile/computedMappings.d.ts +4 -0
  54. package/lib/virtualFile/computedMappings.js +36 -0
  55. package/lib/virtualFile/computedSfc.d.ts +4 -0
  56. package/lib/virtualFile/computedSfc.js +197 -0
  57. package/lib/virtualFile/computedVueSfc.d.ts +4 -0
  58. package/lib/virtualFile/computedVueSfc.js +41 -0
  59. package/lib/virtualFile/embeddedFile.d.ts +12 -0
  60. package/lib/virtualFile/embeddedFile.js +15 -0
  61. package/lib/virtualFile/vueFile.d.ts +25 -0
  62. package/lib/virtualFile/vueFile.js +43 -0
  63. package/package.json +4 -4
package/index.d.ts ADDED
@@ -0,0 +1,13 @@
1
+ export * from './lib/generators/template';
2
+ export * from './lib/languageModule';
3
+ export * from './lib/parsers/scriptSetupRanges';
4
+ export * from './lib/plugins';
5
+ export * from './lib/virtualFile/vueFile';
6
+ export * from './lib/types';
7
+ export * from './lib/utils/ts';
8
+ export * from './lib/utils/parseSfc';
9
+ export * as scriptRanges from './lib/parsers/scriptRanges';
10
+ export * from './lib/utils/shared';
11
+ export { tsCodegen } from './lib/plugins/vue-tsx';
12
+ export * from '@volar/language-core';
13
+ export type * as CompilerDOM from '@vue/compiler-dom';
package/index.js ADDED
@@ -0,0 +1,31 @@
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.tsCodegen = exports.scriptRanges = void 0;
18
+ __exportStar(require("./lib/generators/template"), exports);
19
+ __exportStar(require("./lib/languageModule"), exports);
20
+ __exportStar(require("./lib/parsers/scriptSetupRanges"), exports);
21
+ __exportStar(require("./lib/plugins"), exports);
22
+ __exportStar(require("./lib/virtualFile/vueFile"), exports);
23
+ __exportStar(require("./lib/types"), exports);
24
+ __exportStar(require("./lib/utils/ts"), exports);
25
+ __exportStar(require("./lib/utils/parseSfc"), exports);
26
+ exports.scriptRanges = require("./lib/parsers/scriptRanges");
27
+ __exportStar(require("./lib/utils/shared"), exports);
28
+ var vue_tsx_1 = require("./lib/plugins/vue-tsx");
29
+ Object.defineProperty(exports, "tsCodegen", { enumerable: true, get: function () { return vue_tsx_1.tsCodegen; } });
30
+ __exportStar(require("@volar/language-core"), exports);
31
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,13 @@
1
+ import type { Mapping } from '@volar/language-core';
2
+ import type * as ts from 'typescript';
3
+ import type { ScriptRanges } from '../parsers/scriptRanges';
4
+ import type { ScriptSetupRanges } from '../parsers/scriptSetupRanges';
5
+ import type { Code, CodeAndStack, Sfc, VueCompilerOptions } from '../types';
6
+ export declare function generate(ts: typeof import('typescript'), fileName: string, script: Sfc['script'], scriptSetup: Sfc['scriptSetup'], styles: Sfc['styles'], // TODO: computed it
7
+ lang: string, scriptRanges: ScriptRanges | undefined, scriptSetupRanges: ScriptSetupRanges | undefined, templateCodegen: {
8
+ tsCodes: Code[];
9
+ tsCodegenStacks: string[];
10
+ tagNames: Set<string>;
11
+ accessedGlobalVariables: Set<string>;
12
+ hasSlot: boolean;
13
+ } | undefined, compilerOptions: ts.CompilerOptions, vueCompilerOptions: VueCompilerOptions, globalTypesHolder: string | undefined, getGeneratedLength: () => number, linkedCodeMappings: Mapping<any>[] | undefined, codegenStack: boolean): Generator<CodeAndStack>;