@teambit/docs 0.0.549 → 0.0.555

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.
@@ -1,7 +1,21 @@
1
1
  import type { Serializable } from '@teambit/toolbox.types.serializable';
2
2
  export declare class DocProp {
3
+ /**
4
+ * name of the doc property.
5
+ */
3
6
  readonly name: string;
7
+ /**
8
+ * value of the doc property.
9
+ */
4
10
  readonly value: Serializable;
5
- constructor(name: string, value: Serializable);
11
+ constructor(
12
+ /**
13
+ * name of the doc property.
14
+ */
15
+ name: string,
16
+ /**
17
+ * value of the doc property.
18
+ */
19
+ value: Serializable);
6
20
  getAs<T>(): T;
7
21
  }
package/dist/doc/doc.d.ts CHANGED
@@ -8,8 +8,17 @@ export declare class Doc {
8
8
  filePath: string;
9
9
  props: import("./doc-prop").DocProp[];
10
10
  };
11
+ /**
12
+ * shorthand for getting the component description.
13
+ */
11
14
  get description(): string;
15
+ /**
16
+ * shorthand for getting the component labels.
17
+ */
12
18
  get labels(): string[];
19
+ /**
20
+ * shorthand for getting the component labels.
21
+ */
13
22
  get displayName(): import("./doc-prop").DocProp | undefined;
14
23
  static from(path: string, propObject: SerializableMap): Doc;
15
24
  }
@@ -1,6 +1,16 @@
1
1
  export declare class DocModule {
2
2
  readonly path: string;
3
+ /**
4
+ * original doc module.
5
+ */
3
6
  readonly module: any;
4
- constructor(path: string, module: any);
7
+ constructor(path: string,
8
+ /**
9
+ * original doc module.
10
+ */
11
+ module: any);
12
+ /**
13
+ * get the abstract.
14
+ */
5
15
  get abstract(): any;
6
16
  }
@@ -2,6 +2,13 @@
2
2
  import type { Component } from '@teambit/component';
3
3
  import { Doc } from './doc';
4
4
  export interface DocReader {
5
+ /**
6
+ * read a component doc.
7
+ * @TODO refactor to virtual-file component after @david completes.
8
+ */
5
9
  read(path: string, contents: Buffer, component: Component): Promise<Doc>;
10
+ /**
11
+ * determine which file formats are supported by the doc reader.
12
+ */
6
13
  isFormatSupported(ext: string): boolean;
7
14
  }
package/dist/docs.d.ts CHANGED
@@ -1,6 +1,15 @@
1
1
  import React from 'react';
2
2
  export declare type Docs = {
3
+ /**
4
+ * default is the docs content.
5
+ */
3
6
  default: React.ComponentType;
7
+ /**
8
+ * component abstract.
9
+ */
4
10
  abstract: string;
11
+ /**
12
+ * array of labels.
13
+ */
5
14
  labels: string[];
6
15
  };
@@ -19,10 +19,19 @@ export declare type DocProp = {};
19
19
  export declare type DocPropSlot = SlotRegistry<DocProp>;
20
20
  export declare type DocReaderSlot = SlotRegistry<DocReader>;
21
21
  export declare type DocsConfig = {
22
+ /**
23
+ * glob patterns to identify doc files.
24
+ */
22
25
  patterns: string[];
23
26
  };
27
+ /**
28
+ * the component documentation extension.
29
+ */
24
30
  export declare class DocsMain {
25
31
  private patterns;
32
+ /**
33
+ * envs extension.
34
+ */
26
35
  private preview;
27
36
  private pkg;
28
37
  private compiler;
@@ -31,15 +40,32 @@ export declare class DocsMain {
31
40
  private devFiles;
32
41
  private docPropSlot;
33
42
  private docReaderSlot;
34
- constructor(patterns: string[], preview: PreviewMain, pkg: PkgMain, compiler: CompilerMain, workspace: Workspace, logger: Logger, devFiles: DevFilesMain, docPropSlot: DocPropSlot, docReaderSlot: DocReaderSlot);
43
+ constructor(patterns: string[],
44
+ /**
45
+ * envs extension.
46
+ */
47
+ preview: PreviewMain, pkg: PkgMain, compiler: CompilerMain, workspace: Workspace, logger: Logger, devFiles: DevFilesMain, docPropSlot: DocPropSlot, docReaderSlot: DocReaderSlot);
48
+ /**
49
+ * returns an array of doc file paths for a set of components.
50
+ */
35
51
  getDocsMap(components: Component[]): ComponentMap<AbstractVinyl[]>;
36
52
  getDocsFiles(component: Component): AbstractVinyl[];
53
+ /**
54
+ * compute the description of the component from its source code and docs file.
55
+ */
37
56
  getDescription(component: Component): Promise<string>;
38
57
  getTemplate(context: ExecutionContext): Promise<any>;
39
58
  getDocReader(extension: string): DocReader | undefined;
59
+ /**
60
+ * compute a doc for a component.
61
+ */
40
62
  computeDoc(component: Component): Promise<Doc | null>;
41
63
  getDoc(component: Component): Doc | null;
42
64
  getPatterns(): string[];
65
+ /**
66
+ * register a new doc reader. this allows to support further
67
+ * documentation file formats.
68
+ */
43
69
  registerDocReader(docReader: DocReader): this;
44
70
  static slots: ((registerFn: () => string) => SlotRegistry<DocProp>)[];
45
71
  static runtime: import("@teambit/harmony").RuntimeDefinition;
@@ -4,9 +4,16 @@ import { PreviewDefinition } from '@teambit/preview';
4
4
  import { AbstractVinyl } from '@teambit/legacy/dist/consumer/component/sources';
5
5
  import { DocsMain } from './docs.main.runtime';
6
6
  export declare class DocsPreviewDefinition implements PreviewDefinition {
7
+ /**
8
+ * docs extension.
9
+ */
7
10
  private docs;
8
11
  readonly prefix = "overview";
9
- constructor(docs: DocsMain);
12
+ constructor(
13
+ /**
14
+ * docs extension.
15
+ */
16
+ docs: DocsMain);
10
17
  renderTemplatePath(context: ExecutionContext): Promise<string>;
11
18
  getModuleMap(components: Component[]): Promise<ComponentMap<AbstractVinyl[]>>;
12
19
  }
@@ -1,7 +1,14 @@
1
1
  import { RenderingContext, PreviewPreview, PreviewModule } from '@teambit/preview';
2
2
  export declare class DocsPreview {
3
+ /**
4
+ * preview extension.
5
+ */
3
6
  private preview;
4
- constructor(preview: PreviewPreview);
7
+ constructor(
8
+ /**
9
+ * preview extension.
10
+ */
11
+ preview: PreviewPreview);
5
12
  render: (componentId: string, modules: PreviewModule, [compositions]: [any], context: RenderingContext) => void;
6
13
  selectPreviewModel(componentId: string, modules: PreviewModule): import("@teambit/preview").ModuleFile<any> | undefined;
7
14
  static runtime: import("@teambit/harmony").RuntimeDefinition;
@@ -1,8 +1,15 @@
1
1
  import { Section } from '@teambit/component';
2
2
  import { DocsUI } from './docs.ui.runtime';
3
3
  export declare class OverviewSection implements Section {
4
+ /**
5
+ * docs ui extension.
6
+ */
4
7
  private docs;
5
- constructor(docs: DocsUI);
8
+ constructor(
9
+ /**
10
+ * docs ui extension.
11
+ */
12
+ docs: DocsUI);
6
13
  navigationLink: {
7
14
  href: string;
8
15
  exact: boolean;
package/package.json CHANGED
@@ -1,33 +1,33 @@
1
1
  {
2
2
  "name": "@teambit/docs",
3
- "version": "0.0.549",
3
+ "version": "0.0.555",
4
4
  "homepage": "https://bit.dev/teambit/docs/docs",
5
5
  "main": "dist/index.js",
6
6
  "componentId": {
7
7
  "scope": "teambit.docs",
8
8
  "name": "docs",
9
- "version": "0.0.549"
9
+ "version": "0.0.555"
10
10
  },
11
11
  "dependencies": {
12
12
  "@teambit/harmony": "0.2.11",
13
13
  "graphql-tag": "2.12.1",
14
14
  "@babel/runtime": "7.12.18",
15
15
  "core-js": "^3.0.0",
16
- "@teambit/compiler": "0.0.549",
17
- "@teambit/component": "0.0.549",
18
- "@teambit/pkg": "0.0.549",
19
- "@teambit/workspace": "0.0.549",
20
- "@teambit/cli": "0.0.380",
21
- "@teambit/dev-files": "0.0.549",
22
- "@teambit/envs": "0.0.549",
23
- "@teambit/graphql": "0.0.549",
24
- "@teambit/logger": "0.0.465",
25
- "@teambit/preview": "0.0.549",
26
- "@teambit/ui": "0.0.549",
27
- "@teambit/toolbox.types.serializable": "0.0.456",
28
- "@teambit/pubsub": "0.0.549",
16
+ "@teambit/compiler": "0.0.555",
17
+ "@teambit/component": "0.0.555",
18
+ "@teambit/pkg": "0.0.555",
19
+ "@teambit/workspace": "0.0.555",
20
+ "@teambit/cli": "0.0.386",
21
+ "@teambit/dev-files": "0.0.555",
22
+ "@teambit/envs": "0.0.555",
23
+ "@teambit/graphql": "0.0.555",
24
+ "@teambit/logger": "0.0.471",
25
+ "@teambit/preview": "0.0.555",
26
+ "@teambit/ui": "0.0.555",
27
+ "@teambit/toolbox.types.serializable": "0.0.460",
28
+ "@teambit/pubsub": "0.0.555",
29
29
  "@teambit/design.ui.surfaces.status-message-card": "0.0.6",
30
- "@teambit/preview.ui.component-preview": "0.0.459"
30
+ "@teambit/preview.ui.component-preview": "0.0.463"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@types/react-dom": "^17.0.5",
@@ -38,7 +38,7 @@
38
38
  "@types/node": "12.20.4"
39
39
  },
40
40
  "peerDependencies": {
41
- "@teambit/legacy": "1.0.76",
41
+ "@teambit/legacy": "1.0.172",
42
42
  "react-dom": "^16.8.0 || ^17.0.0",
43
43
  "react": "^16.8.0 || ^17.0.0"
44
44
  },
@@ -66,7 +66,7 @@
66
66
  "react": "-"
67
67
  },
68
68
  "peerDependencies": {
69
- "@teambit/legacy": "1.0.76",
69
+ "@teambit/legacy": "1.0.172",
70
70
  "react-dom": "^16.8.0 || ^17.0.0",
71
71
  "react": "^16.8.0 || ^17.0.0"
72
72
  }
package/tsconfig.json CHANGED
@@ -25,7 +25,6 @@
25
25
  "strict": true,
26
26
  "noImplicitAny": false,
27
27
  "rootDir": ".",
28
- "removeComments": true,
29
28
  "preserveConstEnums": true,
30
29
  "resolveJsonModule": true
31
30
  },