@teambit/docs 1.0.226 → 1.0.228

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,5 @@
1
- import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.docs_docs@1.0.226/dist/docs.composition.js';
2
- import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.docs_docs@1.0.226/dist/docs.docs.mdx';
1
+ import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.docs_docs@1.0.228/dist/docs.composition.js';
2
+ import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.docs_docs@1.0.228/dist/docs.docs.mdx';
3
3
 
4
4
  export const compositions = [compositions_0];
5
5
  export const overview = [overview_0];
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@teambit/docs",
3
- "version": "1.0.226",
3
+ "version": "1.0.228",
4
4
  "homepage": "https://bit.cloud/teambit/docs/docs",
5
5
  "main": "dist/index.js",
6
6
  "componentId": {
7
7
  "scope": "teambit.docs",
8
8
  "name": "docs",
9
- "version": "1.0.226"
9
+ "version": "1.0.228"
10
10
  },
11
11
  "dependencies": {
12
12
  "graphql-tag": "2.12.1",
@@ -19,21 +19,21 @@
19
19
  "@teambit/base-react.themes.theme-switcher": "1.0.2",
20
20
  "@teambit/component.ui.component-meta": "0.0.358",
21
21
  "@teambit/base-ui.loaders.skeleton": "1.0.1",
22
- "@teambit/compiler": "1.0.226",
23
- "@teambit/component": "1.0.226",
24
- "@teambit/pkg": "1.0.226",
25
- "@teambit/workspace": "1.0.226",
26
- "@teambit/cli": "0.0.859",
27
- "@teambit/dev-files": "1.0.226",
28
- "@teambit/envs": "1.0.226",
29
- "@teambit/graphql": "1.0.226",
30
- "@teambit/logger": "0.0.952",
31
- "@teambit/preview": "1.0.226",
32
- "@teambit/scope": "1.0.226",
33
- "@teambit/api-reference": "1.0.226",
34
- "@teambit/component-compare": "1.0.226",
35
- "@teambit/ui": "1.0.226",
36
- "@teambit/pubsub": "1.0.226",
22
+ "@teambit/compiler": "1.0.228",
23
+ "@teambit/component": "1.0.228",
24
+ "@teambit/pkg": "1.0.228",
25
+ "@teambit/workspace": "1.0.228",
26
+ "@teambit/cli": "0.0.861",
27
+ "@teambit/dev-files": "1.0.228",
28
+ "@teambit/envs": "1.0.228",
29
+ "@teambit/graphql": "1.0.228",
30
+ "@teambit/logger": "0.0.954",
31
+ "@teambit/preview": "1.0.228",
32
+ "@teambit/scope": "1.0.228",
33
+ "@teambit/api-reference": "1.0.228",
34
+ "@teambit/component-compare": "1.0.228",
35
+ "@teambit/ui": "1.0.228",
36
+ "@teambit/pubsub": "1.0.228",
37
37
  "@teambit/compositions.panels.composition-gallery": "0.0.211",
38
38
  "@teambit/preview.ui.component-preview": "1.0.5"
39
39
  },
@@ -44,7 +44,7 @@
44
44
  "chai": "4.3.0",
45
45
  "@teambit/docs.content.docs-overview": "1.95.9",
46
46
  "@teambit/component-id": "1.2.0",
47
- "@teambit/harmony.envs.core-aspect-env": "0.0.27"
47
+ "@teambit/harmony.envs.core-aspect-env": "0.0.30"
48
48
  },
49
49
  "peerDependencies": {
50
50
  "react": "^17.0.0 || ^18.0.0",
package/tsconfig.json CHANGED
@@ -20,7 +20,8 @@
20
20
  "emitDeclarationOnly": true,
21
21
  "strict": true,
22
22
  "strictPropertyInitialization": false,
23
- "noImplicitAny": false
23
+ "noImplicitAny": false,
24
+ "composite": true
24
25
  },
25
26
  "exclude": [
26
27
  "artifacts",
@@ -35,5 +36,52 @@
35
36
  "include": [
36
37
  "**/*",
37
38
  "**/*.json"
39
+ ],
40
+ "references": [
41
+ {
42
+ "path": "/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.compilation_compiler@1.0.228"
43
+ },
44
+ {
45
+ "path": "/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.component_component@1.0.228"
46
+ },
47
+ {
48
+ "path": "/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.pkg_pkg@1.0.228"
49
+ },
50
+ {
51
+ "path": "/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.workspace_workspace@1.0.228"
52
+ },
53
+ {
54
+ "path": "/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.harmony_cli@0.0.861"
55
+ },
56
+ {
57
+ "path": "/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.component_dev-files@1.0.228"
58
+ },
59
+ {
60
+ "path": "/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.envs_envs@1.0.228"
61
+ },
62
+ {
63
+ "path": "/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.harmony_graphql@1.0.228"
64
+ },
65
+ {
66
+ "path": "/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.harmony_logger@0.0.954"
67
+ },
68
+ {
69
+ "path": "/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.preview_preview@1.0.228"
70
+ },
71
+ {
72
+ "path": "/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.scope_scope@1.0.228"
73
+ },
74
+ {
75
+ "path": "/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.api-reference_api-reference@1.0.228"
76
+ },
77
+ {
78
+ "path": "/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.component_component-compare@1.0.228"
79
+ },
80
+ {
81
+ "path": "/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.ui-foundation_ui@1.0.228"
82
+ },
83
+ {
84
+ "path": "/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.harmony_pubsub@1.0.228"
85
+ }
38
86
  ]
39
87
  }
@@ -1,16 +0,0 @@
1
- /// <reference types="node" />
2
- import type { PkgMain } from '@teambit/pkg';
3
- import type { Component } from '@teambit/component';
4
- import type { CompilerMain } from '@teambit/compiler';
5
- import type { Workspace } from '@teambit/workspace';
6
- import { Doc } from '@teambit/docs.entities.doc';
7
- import { DocReader } from './doc-reader';
8
- export declare class DefaultDocReader implements DocReader {
9
- private pkg;
10
- private compiler;
11
- private workspace;
12
- constructor(pkg: PkgMain, compiler: CompilerMain, workspace: Workspace);
13
- read(path: string, contents: Buffer, component: Component): Promise<Doc>;
14
- readonly supportedExtensions: string[];
15
- isFormatSupported(format: string): boolean;
16
- }
@@ -1,16 +0,0 @@
1
- export declare class DocModule {
2
- readonly path: string;
3
- /**
4
- * original doc module.
5
- */
6
- readonly module: any;
7
- constructor(path: string,
8
- /**
9
- * original doc module.
10
- */
11
- module: any);
12
- /**
13
- * get the abstract.
14
- */
15
- get abstract(): any;
16
- }
@@ -1,14 +0,0 @@
1
- /// <reference types="node" />
2
- import type { Component } from '@teambit/component';
3
- import { Doc } from '@teambit/docs.entities.doc';
4
- export interface DocReader {
5
- /**
6
- * read a component doc.
7
- * @TODO refactor to virtual-file component after @david completes.
8
- */
9
- read(path: string, contents: Buffer, component: Component): Promise<Doc>;
10
- /**
11
- * determine which file formats are supported by the doc reader.
12
- */
13
- isFormatSupported(ext: string): boolean;
14
- }
@@ -1 +0,0 @@
1
- export declare function addDocs(docs: any[]): void;
@@ -1,3 +0,0 @@
1
- import { Aspect } from '@teambit/harmony';
2
- export declare const DocsAspect: Aspect;
3
- export default DocsAspect;
@@ -1 +0,0 @@
1
- export declare const Logo: () => import("react/jsx-runtime").JSX.Element;
package/dist/docs.d.ts DELETED
@@ -1,29 +0,0 @@
1
- import React, { ReactElement } from 'react';
2
- export type Example = {
3
- title?: string;
4
- description?: ReactElement;
5
- scope?: {
6
- [key: string]: any;
7
- };
8
- jsx?: JSX.Element;
9
- code: string;
10
- };
11
- export type Docs = {
12
- /**
13
- * default is the docs content.
14
- */
15
- default: React.ComponentType;
16
- /**
17
- * component abstract.
18
- */
19
- abstract: string;
20
- /**
21
- * array of labels.
22
- */
23
- labels: string[];
24
- /**
25
- * @deprecated
26
- */
27
- examples: Example[];
28
- };
29
- export declare const defaultDocs: Docs;
@@ -1,9 +0,0 @@
1
- export declare const docsMock: {
2
- title: string;
3
- subTitle: string;
4
- labels: string[];
5
- installMethods: {
6
- title: string;
7
- content: string;
8
- }[];
9
- };
@@ -1,11 +0,0 @@
1
- import { Component } from '@teambit/component';
2
- import { DocsMain } from './docs.main.runtime';
3
- export declare function docsSchema(docs: DocsMain): {
4
- typeDefs: import("graphql").DocumentNode;
5
- resolvers: {
6
- Component: {
7
- description: (component: Component) => Promise<string>;
8
- labels: (component: Component) => string[];
9
- };
10
- };
11
- };
@@ -1,98 +0,0 @@
1
- import { SlotRegistry } from '@teambit/harmony';
2
- import { LoggerMain, Logger } from '@teambit/logger';
3
- import { CompilerMain } from '@teambit/compiler';
4
- import { Component, ComponentMap, IComponent } from '@teambit/component';
5
- import { ScopeMain } from '@teambit/scope';
6
- import { PkgMain } from '@teambit/pkg';
7
- import type { Environment } from '@teambit/envs';
8
- import { GraphqlMain } from '@teambit/graphql';
9
- import { PreviewMain } from '@teambit/preview';
10
- import { DevFilesMain } from '@teambit/dev-files';
11
- import { AbstractVinyl } from '@teambit/legacy/dist/consumer/component/sources';
12
- import { Workspace } from '@teambit/workspace';
13
- import { Doc } from '@teambit/docs.entities.doc';
14
- import { EnvsMain } from '@teambit/envs';
15
- import { DocReader } from './doc-reader';
16
- export type ComponentDocs = {
17
- files: string[];
18
- component: Component;
19
- };
20
- export type DocProp = {};
21
- export type DocPropSlot = SlotRegistry<DocProp>;
22
- export type DocReaderSlot = SlotRegistry<DocReader>;
23
- export type DocsConfig = {
24
- /**
25
- * glob patterns to identify doc files.
26
- */
27
- patterns: string[];
28
- };
29
- /**
30
- * the component documentation extension.
31
- */
32
- export declare class DocsMain {
33
- private patterns;
34
- /**
35
- * envs extension.
36
- */
37
- private preview;
38
- private pkg;
39
- private compiler;
40
- private workspace;
41
- private logger;
42
- private devFiles;
43
- private envs;
44
- private docPropSlot;
45
- private docReaderSlot;
46
- constructor(patterns: string[],
47
- /**
48
- * envs extension.
49
- */
50
- preview: PreviewMain, pkg: PkgMain, compiler: CompilerMain, workspace: Workspace, logger: Logger, devFiles: DevFilesMain, envs: EnvsMain, docPropSlot: DocPropSlot, docReaderSlot: DocReaderSlot);
51
- /**
52
- * returns an array of doc file paths for a set of components.
53
- */
54
- getDocsMap(components: Component[]): ComponentMap<AbstractVinyl[]>;
55
- getDocsFiles(component: Component): AbstractVinyl[];
56
- /**
57
- * compute the description of the component from its source code and docs file.
58
- */
59
- getDescription(component: Component): Promise<string>;
60
- getTemplate(env: Environment): Promise<string | undefined>;
61
- getDocReader(extension: string): DocReader | undefined;
62
- /**
63
- * compute a doc for a component.
64
- */
65
- computeDoc(component: Component): Promise<Doc | null>;
66
- getDoc(component: IComponent): Doc | null;
67
- getPatterns(): string[];
68
- getComponentDevPatterns(component: Component): {
69
- name: string;
70
- pattern: string[];
71
- };
72
- getDevPatternToRegister(): (component: Component) => {
73
- name: string;
74
- pattern: string[];
75
- };
76
- /**
77
- * register a new doc reader. this allows to support further
78
- * documentation file formats.
79
- */
80
- registerDocReader(docReader: DocReader): this;
81
- static slots: ((registerFn: () => string) => SlotRegistry<DocProp>)[];
82
- static runtime: import("@teambit/harmony").RuntimeDefinition;
83
- static dependencies: import("@teambit/harmony").Aspect[];
84
- static defaultConfig: {
85
- patterns: string[];
86
- };
87
- static provider([preview, graphql, workspace, pkg, compiler, loggerAspect, devFiles, envs, scope]: [
88
- PreviewMain,
89
- GraphqlMain,
90
- Workspace,
91
- PkgMain,
92
- CompilerMain,
93
- LoggerMain,
94
- DevFilesMain,
95
- EnvsMain,
96
- ScopeMain
97
- ], config: DocsConfig, [docPropSlot, docReaderSlot]: [DocPropSlot, DocReaderSlot]): Promise<DocsMain>;
98
- }
@@ -1,28 +0,0 @@
1
- import { Component, ComponentMap } from '@teambit/component';
2
- import type { Environment, ExecutionContext } from '@teambit/envs';
3
- import { PreviewDefinition } from '@teambit/preview';
4
- import { AbstractVinyl } from '@teambit/legacy/dist/consumer/component/sources';
5
- import { DocsMain } from './docs.main.runtime';
6
- export declare class DocsPreviewDefinition implements PreviewDefinition {
7
- /**
8
- * docs extension.
9
- */
10
- private docs;
11
- readonly prefix = "overview";
12
- readonly include: string[];
13
- readonly includePeers = true;
14
- constructor(
15
- /**
16
- * docs extension.
17
- */
18
- docs: DocsMain);
19
- /**
20
- * application root
21
- */
22
- renderTemplatePath(context: ExecutionContext): Promise<string | undefined>;
23
- renderTemplatePathByEnv(env: Environment): Promise<string | undefined>;
24
- /**
25
- * files to load.
26
- */
27
- getModuleMap(components: Component[]): Promise<ComponentMap<AbstractVinyl[]>>;
28
- }
@@ -1,27 +0,0 @@
1
- import React from 'react';
2
- import { RenderingContext, PreviewPreview, PreviewModule } from '@teambit/preview';
3
- import { ComponentID } from '@teambit/component-id';
4
- import type { Docs } from './docs';
5
- export type DocsRootProps = {
6
- Provider: React.ComponentType | undefined;
7
- componentId: string;
8
- docs: Docs | undefined;
9
- compositions: any;
10
- context: RenderingContext;
11
- };
12
- export declare class DocsPreview {
13
- /**
14
- * preview extension.
15
- */
16
- private preview;
17
- constructor(
18
- /**
19
- * preview extension.
20
- */
21
- preview: PreviewPreview);
22
- render: (componentId: ComponentID, envId: string, modules: PreviewModule, [compositions]: [any], context: RenderingContext) => void;
23
- selectPreviewModel(componentId: string, modules: PreviewModule): import("@teambit/preview").ModuleFile<any> | undefined;
24
- static runtime: import("@teambit/harmony").RuntimeDefinition;
25
- static dependencies: import("@teambit/harmony").Aspect[];
26
- static provider([preview]: [PreviewPreview]): Promise<DocsPreview>;
27
- }
@@ -1,5 +0,0 @@
1
- import { EnvService, ExecutionContext } from '@teambit/envs';
2
- export declare class DocsService implements EnvService<any> {
3
- name: string;
4
- run(context: ExecutionContext): Promise<any>;
5
- }
@@ -1,28 +0,0 @@
1
- import React, { ComponentType } from 'react';
2
- import { ComponentUI } from '@teambit/component';
3
- import { ComponentCompareUI } from '@teambit/component-compare';
4
- import { APIReferenceUI } from '@teambit/api-reference';
5
- import type { TitleBadgeSlot, TitleBadge, OverviewOptionsSlot, OverviewOptions } from './overview';
6
- export declare class DocsUI {
7
- readonly titleBadgeSlot: TitleBadgeSlot;
8
- readonly overviewOptionsSlot: OverviewOptionsSlot;
9
- constructor(titleBadgeSlot: TitleBadgeSlot, overviewOptionsSlot: OverviewOptionsSlot);
10
- /**
11
- * register a new title badge into the overview section of a component.
12
- */
13
- registerTitleBadge(titleBadges: TitleBadge | TitleBadge[]): this;
14
- /**
15
- * list all title badges registered.
16
- */
17
- listTitleBadges(): TitleBadge[];
18
- private _emptyState?;
19
- registerEmptyState(emptyState: ComponentType): React.ComponentType;
20
- getEmptyState(): React.ComponentType | undefined;
21
- getDocsCompare(): import("react/jsx-runtime").JSX.Element;
22
- registerOverviewOptions(options: OverviewOptions): void;
23
- static dependencies: import("@teambit/harmony").Aspect[];
24
- static runtime: import("@teambit/harmony").RuntimeDefinition;
25
- static slots: (((registerFn: () => string) => import("@teambit/harmony").SlotRegistry<TitleBadge>) | ((registerFn: () => string) => import("@teambit/harmony").SlotRegistry<OverviewOptions>))[];
26
- static provider([component, componentCompare, apiRef]: [ComponentUI, ComponentCompareUI, APIReferenceUI], config: any, [titleBadgeSlot, overviewOptionsSlot]: [TitleBadgeSlot, OverviewOptionsSlot]): Promise<DocsUI>;
27
- }
28
- export default DocsUI;
@@ -1,12 +0,0 @@
1
- import { BitBaseEvent } from '@teambit/pubsub';
2
- declare class ClickInsideAnIframeEventData {
3
- private clickEvent;
4
- constructor(clickEvent: any);
5
- }
6
- export declare class ClickInsideAnIframeEvent extends BitBaseEvent<ClickInsideAnIframeEventData> {
7
- readonly timestamp: number;
8
- readonly clickEvent: any;
9
- static readonly TYPE = "click-inside-an-iframe";
10
- constructor(timestamp: number, clickEvent: any);
11
- }
12
- export {};
@@ -1 +0,0 @@
1
- export * from './click-inside-an-iframe';
@@ -1,3 +0,0 @@
1
- export declare class DocReadError extends Error {
2
- constructor(filePath: string, error: Error);
3
- }
@@ -1,3 +0,0 @@
1
- export declare class FileExtensionNotSupported extends Error {
2
- constructor(filePath: string, extension: string);
3
- }
@@ -1,2 +0,0 @@
1
- export { FileExtensionNotSupported } from './file-extension-not-supported';
2
- export { DocReadError } from './doc-read-error';
package/dist/index.d.ts DELETED
@@ -1,17 +0,0 @@
1
- import { DocsAspect } from './docs.aspect';
2
- /**
3
- * Doc entity.
4
- * @deprecated - please dont use this. use directly from @teambit/docs.entities.doc.
5
- */
6
- export { Doc, DocProp, DocPropList } from '@teambit/docs.entities.doc';
7
- export type { DocsMain } from './docs.main.runtime';
8
- export type { DocsUI } from './docs.ui.runtime';
9
- export type { DocsPreview, DocsRootProps } from './docs.preview.runtime';
10
- export type { DocReader } from './doc-reader';
11
- export type { Docs, Example } from './docs';
12
- export { defaultDocs } from './docs';
13
- export type { TitleBadgeSlot, TitleBadge, OverviewOptionsSlot, OverviewOptions } from './overview';
14
- export { BadgePosition } from './overview';
15
- export { Overview } from './overview';
16
- export { DocsAspect };
17
- export default DocsAspect;
@@ -1,2 +0,0 @@
1
- export { Overview, BadgePosition } from './overview';
2
- export type { TitleBadgeSlot, TitleBadge, OverviewOptionsSlot, OverviewOptions } from './overview';
@@ -1,29 +0,0 @@
1
- import React, { ComponentType } from 'react';
2
- import type { SlotRegistry } from '@teambit/harmony';
3
- import { ComponentPreviewProps } from '@teambit/preview.ui.component-preview';
4
- export declare enum BadgePosition {
5
- Title = 0,
6
- SubTitle = 1,
7
- Labels = 2,
8
- Package = 3
9
- }
10
- export type TitleBadge = {
11
- component: ComponentType<any>;
12
- weight?: number;
13
- position?: BadgePosition;
14
- };
15
- export type TitleBadgeSlot = SlotRegistry<TitleBadge[]>;
16
- export type OverviewOptions = () => {
17
- queryParams?: string;
18
- };
19
- export type OverviewOptionsSlot = SlotRegistry<OverviewOptions>;
20
- export type OverviewProps = {
21
- titleBadges: TitleBadgeSlot;
22
- overviewOptions: OverviewOptionsSlot;
23
- previewProps?: Partial<ComponentPreviewProps>;
24
- getEmptyState?: () => ComponentType | undefined;
25
- TaggedAPI?: React.ComponentType<{
26
- componentId: string;
27
- }>;
28
- };
29
- export declare function Overview({ titleBadges, overviewOptions, previewProps, getEmptyState, TaggedAPI }: OverviewProps): import("react/jsx-runtime").JSX.Element;
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- export declare function ReadmeSkeleton({ children }: {
3
- children?: React.ReactNode;
4
- }): import("react/jsx-runtime").JSX.Element;
@@ -1,28 +0,0 @@
1
- import { Section } from '@teambit/component';
2
- import { APIReferenceUI } from '@teambit/api-reference';
3
- import { TitleBadgeSlot, OverviewOptionsSlot } from './overview';
4
- import { DocsUI } from './docs.ui.runtime';
5
- export declare class OverviewSection implements Section {
6
- /**
7
- * title badge slot.
8
- */
9
- private titleBadgeSlot;
10
- private overviewOptionsSlot;
11
- private docs;
12
- private apiRef;
13
- constructor(
14
- /**
15
- * title badge slot.
16
- */
17
- titleBadgeSlot: TitleBadgeSlot, overviewOptionsSlot: OverviewOptionsSlot, docs: DocsUI, apiRef: APIReferenceUI);
18
- navigationLink: {
19
- href: string;
20
- exact: boolean;
21
- children: string;
22
- };
23
- route: {
24
- index: boolean;
25
- element: import("react/jsx-runtime").JSX.Element;
26
- };
27
- order: number;
28
- }