vue-component-meta 1.0.0-alpha.5 → 1.0.0-beta.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.
package/out/index.d.ts CHANGED
@@ -2,7 +2,7 @@ import * as vue from '@volar/vue-language-core';
2
2
  import * as ts from 'typescript/lib/tsserverlibrary';
3
3
  import type { MetaCheckerOptions, ComponentMeta, EventMeta, ExposeMeta, MetaCheckerSchemaOptions, PropertyMeta, PropertyMetaSchema, SlotMeta } from './types';
4
4
  export type { MetaCheckerOptions, ComponentMeta, EventMeta, ExposeMeta, MetaCheckerSchemaOptions, PropertyMeta, PropertyMetaSchema, SlotMeta };
5
- export declare type ComponentMetaChecker = ReturnType<typeof createComponentMetaCheckerBase>;
5
+ export type ComponentMetaChecker = ReturnType<typeof createComponentMetaCheckerBase>;
6
6
  export declare function createComponentMetaCheckerByJsonConfig(root: string, json: any, checkerOptions?: MetaCheckerOptions): {
7
7
  getExportNames: (componentPath: string) => string[];
8
8
  getComponentMeta: (componentPath: string, exportName?: string) => ComponentMeta;
package/out/index.js CHANGED
@@ -3,16 +3,13 @@ exports.createComponentMetaChecker = exports.createComponentMetaCheckerByJsonCon
3
3
  const vue = require("@volar/vue-language-core");
4
4
  const embedded = require("@volar/language-core");
5
5
  const ts = require("typescript/lib/tsserverlibrary");
6
- const parseConfigHost = {
7
- useCaseSensitiveFileNames: ts.sys.useCaseSensitiveFileNames,
8
- readDirectory: (path, extensions, exclude, include, depth) => {
9
- return ts.sys.readDirectory(path, [...extensions, '.vue'], exclude, include, depth);
10
- },
11
- fileExists: ts.sys.fileExists,
12
- readFile: ts.sys.readFile,
13
- };
6
+ const extraFileExtensions = [{
7
+ extension: 'vue',
8
+ isMixedContent: true,
9
+ scriptKind: ts.ScriptKind.Deferred,
10
+ }];
14
11
  function createComponentMetaCheckerByJsonConfig(root, json, checkerOptions = {}) {
15
- const parsedCommandLine = vue.createParsedCommandLineByJson(ts, parseConfigHost, root, json);
12
+ const parsedCommandLine = vue.createParsedCommandLineByJson(ts, ts.sys, root, json, extraFileExtensions);
16
13
  for (const error of parsedCommandLine.errors) {
17
14
  console.error(error);
18
15
  }
@@ -20,7 +17,7 @@ function createComponentMetaCheckerByJsonConfig(root, json, checkerOptions = {})
20
17
  }
21
18
  exports.createComponentMetaCheckerByJsonConfig = createComponentMetaCheckerByJsonConfig;
22
19
  function createComponentMetaChecker(tsconfigPath, checkerOptions = {}) {
23
- const parsedCommandLine = vue.createParsedCommandLine(ts, parseConfigHost, tsconfigPath);
20
+ const parsedCommandLine = vue.createParsedCommandLine(ts, ts.sys, tsconfigPath, extraFileExtensions);
24
21
  for (const error of parsedCommandLine.errors) {
25
22
  console.error(error);
26
23
  }
package/out/types.d.ts CHANGED
@@ -1,67 +1,68 @@
1
1
  import type * as ts from 'typescript/lib/tsserverlibrary';
2
2
  export interface ComponentMeta {
3
- props: PropertyMeta[];
4
- events: EventMeta[];
5
- slots: SlotMeta[];
6
- exposed: ExposeMeta[];
3
+ props: PropertyMeta[];
4
+ events: EventMeta[];
5
+ slots: SlotMeta[];
6
+ exposed: ExposeMeta[];
7
7
  }
8
8
  export interface PropertyMeta {
9
- name: string;
10
- default?: string;
11
- description: string;
12
- global: boolean;
13
- required: boolean;
14
- type: string;
15
- rawType?: ts.Type;
16
- tags: {
17
- name: string;
18
- text?: string;
19
- }[];
20
- schema?: PropertyMetaSchema;
9
+ name: string;
10
+ default?: string;
11
+ description: string;
12
+ global: boolean;
13
+ required: boolean;
14
+ type: string;
15
+ rawType?: ts.Type;
16
+ tags: {
17
+ name: string;
18
+ text?: string;
19
+ }[];
20
+ schema?: PropertyMetaSchema;
21
21
  }
22
22
  export interface EventMeta {
23
- name: string;
24
- type: string;
25
- rawType?: ts.Type;
26
- signature: string;
27
- schema?: PropertyMetaSchema[];
23
+ name: string;
24
+ type: string;
25
+ rawType?: ts.Type;
26
+ signature: string;
27
+ schema?: PropertyMetaSchema[];
28
28
  }
29
29
  export interface SlotMeta {
30
- name: string;
31
- type: string;
32
- rawType?: ts.Type;
33
- description: string;
34
- schema?: PropertyMetaSchema;
30
+ name: string;
31
+ type: string;
32
+ rawType?: ts.Type;
33
+ description: string;
34
+ schema?: PropertyMetaSchema;
35
35
  }
36
36
  export interface ExposeMeta {
37
- name: string;
38
- description: string;
39
- type: string;
40
- rawType?: ts.Type;
41
- schema?: PropertyMetaSchema;
37
+ name: string;
38
+ description: string;
39
+ type: string;
40
+ rawType?: ts.Type;
41
+ schema?: PropertyMetaSchema;
42
42
  }
43
- export declare type PropertyMetaSchema = {
44
- kind: 'const';
45
- displayString: string;
43
+ export type PropertyMetaSchema = string | {
44
+ kind: 'enum';
45
+ type: string;
46
+ schema?: PropertyMetaSchema[];
46
47
  } | {
47
- kind: 'enum';
48
- displayString: string;
49
- members: PropertyMetaSchema[];
48
+ kind: 'array';
49
+ type: string;
50
+ schema?: PropertyMetaSchema[];
50
51
  } | {
51
- kind: 'array';
52
- displayString: string;
53
- element: PropertyMetaSchema ;
52
+ kind: 'event';
53
+ type: string;
54
+ schema?: PropertyMetaSchema[];
54
55
  } | {
55
- kind: 'object';
56
- displayString: string;
57
- properties: Record<string, PropertyMetaSchema>;
56
+ kind: 'object';
57
+ type: string;
58
+ schema?: Record<string, PropertyMeta>;
58
59
  };
59
- export declare type MetaCheckerSchemaOptions = boolean | {
60
- ignore?: string[];
60
+ export type MetaCheckerSchemaOptions = boolean | {
61
+ ignore?: string[];
61
62
  };
62
63
  export interface MetaCheckerOptions {
63
- schema?: MetaCheckerSchemaOptions;
64
- forceUseTs?: boolean;
65
- printer?: import('typescript').PrinterOptions;
66
- rawType?: boolean;
64
+ schema?: MetaCheckerSchemaOptions;
65
+ forceUseTs?: boolean;
66
+ printer?: import('typescript').PrinterOptions;
67
+ rawType?: boolean;
67
68
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue-component-meta",
3
- "version": "1.0.0-alpha.5",
3
+ "version": "1.0.0-beta.1",
4
4
  "main": "out/index.js",
5
5
  "license": "MIT",
6
6
  "files": [
@@ -13,11 +13,11 @@
13
13
  "directory": "packages/vue-component-meta"
14
14
  },
15
15
  "dependencies": {
16
- "@volar/language-core": "1.0.0-alpha.5",
17
- "@volar/vue-language-core": "1.0.0-alpha.5"
16
+ "@volar/language-core": "1.0.0-beta.1",
17
+ "@volar/vue-language-core": "1.0.0-beta.1"
18
18
  },
19
19
  "peerDependencies": {
20
20
  "typescript": "*"
21
21
  },
22
- "gitHead": "dd3efd3f7458aca9ba5dcdf549ce80999cb7affd"
22
+ "gitHead": "3421929c584e8fafd772b2386c12ffe9b48355f2"
23
23
  }