@teambit/docs 1.0.1262 → 1.0.1264
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/dist/docs.main.runtime.d.ts +11 -0
- package/dist/docs.main.runtime.js +14 -1
- package/dist/docs.main.runtime.js.map +1 -1
- package/dist/docs.main.runtime.spec.d.ts +1 -0
- package/dist/docs.main.runtime.spec.js +87 -0
- package/dist/docs.main.runtime.spec.js.map +1 -0
- package/dist/docs.preview.runtime.d.ts +1 -1
- package/dist/{preview-1793198771448.js → preview-1793213596565.js} +2 -2
- package/package.json +16 -15
|
@@ -63,6 +63,17 @@ export declare class DocsMain {
|
|
|
63
63
|
* compute a doc for a component.
|
|
64
64
|
*/
|
|
65
65
|
computeDoc(component: Component): Promise<Doc | null>;
|
|
66
|
+
/**
|
|
67
|
+
* the docs data of a component that a scope re-calculates (e.g. when it snaps a lane merge).
|
|
68
|
+
* a scope can fail to read a docs file that a workspace reads. e.g. the default doc reader loads the compiled docs
|
|
69
|
+
* file from the workspace node_modules. then, return undefined to keep the stored doc, instead of an empty one.
|
|
70
|
+
*/
|
|
71
|
+
computeDocDataInScope(component: Component): Promise<{
|
|
72
|
+
doc: {
|
|
73
|
+
filePath: string;
|
|
74
|
+
props: import("@teambit/docs.entities.doc").DocProp[];
|
|
75
|
+
} | undefined;
|
|
76
|
+
} | undefined>;
|
|
66
77
|
getDoc(component: IComponent): Doc | null;
|
|
67
78
|
getPatterns(): string[];
|
|
68
79
|
getComponentDevPatterns(component: Component): {
|
|
@@ -214,6 +214,19 @@ class DocsMain {
|
|
|
214
214
|
}
|
|
215
215
|
return null;
|
|
216
216
|
}
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* the docs data of a component that a scope re-calculates (e.g. when it snaps a lane merge).
|
|
220
|
+
* a scope can fail to read a docs file that a workspace reads. e.g. the default doc reader loads the compiled docs
|
|
221
|
+
* file from the workspace node_modules. then, return undefined to keep the stored doc, instead of an empty one.
|
|
222
|
+
*/
|
|
223
|
+
async computeDocDataInScope(component) {
|
|
224
|
+
const doc = await this.computeDoc(component);
|
|
225
|
+
if (!doc && this.getDocsFiles(component).length) return undefined;
|
|
226
|
+
return {
|
|
227
|
+
doc: doc?.toObject()
|
|
228
|
+
};
|
|
229
|
+
}
|
|
217
230
|
getDoc(component) {
|
|
218
231
|
const docData = component.get(_docs().DocsAspect.id)?.data?.doc;
|
|
219
232
|
if (!docData) return null;
|
|
@@ -262,7 +275,7 @@ class DocsMain {
|
|
|
262
275
|
workspace.registerOnComponentLoad(computeDocsOnLoad);
|
|
263
276
|
}
|
|
264
277
|
if (scope) {
|
|
265
|
-
scope.registerOnCompAspectReCalc(
|
|
278
|
+
scope.registerOnCompAspectReCalc(component => docs.computeDocDataInScope(component));
|
|
266
279
|
}
|
|
267
280
|
graphql.register(() => (0, _docs3().docsSchema)(docs));
|
|
268
281
|
preview.registerDefinition(new (_docs2().DocsPreviewDefinition)(docs));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_harmony","data","require","_harmonyModules","_logger","_compiler","_component","_scope","_pkg","_graphql","_preview","_devFiles","_workspace","_docsEntities","_lodash","_envs","_docs","_docs2","_docs3","_defaultDocReader","_exceptions","_defineProperty","e","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","DocsMain","constructor","patterns","preview","pkg","compiler","workspace","logger","devFiles","envs","docPropSlot","docReaderSlot","getDocsMap","components","ComponentMap","as","component","getDocsFiles","getDevFiles","docFiles","get","DocsAspect","id","state","filesystem","files","filter","file","includes","relative","getDescription","componentDoc","getDoc","desc","description","getTemplate","env","getDocsTemplate","isFunction","undefined","getDocReader","extension","values","find","docReader","isFormatSupported","computeDoc","length","docFile","extname","FileExtensionNotSupported","doc","read","contents","err","debug","message","docData","Doc","filePath","DocPropList","props","getPatterns","getComponentDevPatterns","calculateEnv","skipWarnings","inInstallContext","componentEnvDocsDevPatterns","getDocsDevPatterns","componentPatterns","concat","name","pattern","getDevPatternToRegister","bind","registerDocReader","register","provider","graphql","loggerAspect","scope","config","createLogger","docs","DefaultDocReader","registerDevPattern","computeDocsOnLoad","opts","loadDocs","toObject","registerOnComponentLoad","registerOnCompAspectReCalc","docsSchema","registerDefinition","DocsPreviewDefinition","exports","Slot","withType","MainRuntime","PreviewAspect","GraphqlAspect","WorkspaceAspect","PkgAspect","CompilerAspect","LoggerAspect","DevFilesAspect","EnvsAspect","ScopeAspect","addRuntime"],"sources":["docs.main.runtime.ts"],"sourcesContent":["import type { SlotRegistry } from '@teambit/harmony';\nimport { Slot } from '@teambit/harmony';\nimport { MainRuntime } from '@teambit/harmony.modules.runtimes';\nimport type { LoggerMain, Logger } from '@teambit/logger';\nimport { LoggerAspect } from '@teambit/logger';\nimport type { CompilerMain } from '@teambit/compiler';\nimport { CompilerAspect } from '@teambit/compiler';\nimport type { Component, IComponent } from '@teambit/component';\nimport { ComponentMap } from '@teambit/component';\nimport type { ScopeMain } from '@teambit/scope';\nimport { ScopeAspect } from '@teambit/scope';\nimport type { PkgMain } from '@teambit/pkg';\nimport { PkgAspect } from '@teambit/pkg';\nimport type { Environment, EnvsMain } from '@teambit/envs';\nimport type { GraphqlMain } from '@teambit/graphql';\nimport { GraphqlAspect } from '@teambit/graphql';\nimport type { PreviewMain } from '@teambit/preview';\nimport { PreviewAspect } from '@teambit/preview';\nimport type { DevFilesMain } from '@teambit/dev-files';\nimport { DevFilesAspect } from '@teambit/dev-files';\nimport type { ComponentLoadOptions } from '@teambit/legacy.consumer-component';\nimport type { AbstractVinyl } from '@teambit/component.sources';\nimport type { Workspace } from '@teambit/workspace';\nimport { WorkspaceAspect } from '@teambit/workspace';\nimport { Doc, DocPropList } from '@teambit/docs.entities.doc';\nimport { isFunction } from 'lodash';\nimport { EnvsAspect } from '@teambit/envs';\nimport { DocsAspect } from './docs.aspect';\nimport { DocsPreviewDefinition } from './docs.preview-definition';\nimport { docsSchema } from './docs.graphql';\nimport type { DocReader } from './doc-reader';\nimport { DefaultDocReader } from './default-doc-reader';\nimport { FileExtensionNotSupported } from './exceptions';\n\nexport type ComponentDocs = {\n files: string[];\n component: Component;\n};\n\nexport type DocProp = {};\n\nexport type DocPropSlot = SlotRegistry<DocProp>;\n\nexport type DocReaderSlot = SlotRegistry<DocReader>;\n\nexport type DocsConfig = {\n /**\n * glob patterns to identify doc files.\n */\n patterns: string[];\n};\n\n/**\n * the component documentation extension.\n */\nexport class DocsMain {\n constructor(\n private patterns: string[],\n /**\n * envs extension.\n */\n private preview: PreviewMain,\n\n private pkg: PkgMain,\n\n private compiler: CompilerMain,\n\n private workspace: Workspace,\n\n private logger: Logger,\n\n private devFiles: DevFilesMain,\n\n private envs: EnvsMain,\n\n private docPropSlot: DocPropSlot,\n\n private docReaderSlot: DocReaderSlot\n ) {}\n\n /**\n * returns an array of doc file paths for a set of components.\n */\n getDocsMap(components: Component[]): ComponentMap<AbstractVinyl[]> {\n return ComponentMap.as<AbstractVinyl[]>(components, (component) => {\n return this.getDocsFiles(component);\n });\n }\n\n getDocsFiles(component: Component): AbstractVinyl[] {\n const devFiles = this.devFiles.getDevFiles(component);\n const docFiles = devFiles.get(DocsAspect.id);\n return component.state.filesystem.files.filter((file) => docFiles.includes(file.relative));\n }\n\n /**\n * compute the description of the component from its source code and docs file.\n */\n async getDescription(component: Component): Promise<string> {\n const componentDoc = this.getDoc(component);\n const desc = componentDoc?.description;\n return desc || '';\n }\n\n async getTemplate(env: Environment): Promise<string | undefined> {\n if (env.getDocsTemplate && isFunction(env.getDocsTemplate)) {\n return env.getDocsTemplate();\n }\n return undefined;\n }\n\n getDocReader(extension: string) {\n return this.docReaderSlot.values().find((docReader) => docReader.isFormatSupported(extension));\n }\n\n /**\n * compute a doc for a component.\n */\n async computeDoc(component: Component) {\n const docFiles = this.getDocsFiles(component);\n if (docFiles.length) {\n // currently taking the the first docs file found with an abstract. (we support only one)\n const docFile = docFiles[0];\n\n try {\n const docReader = this.getDocReader(docFile.extname);\n if (!docReader) throw new FileExtensionNotSupported(docFile.relative, docFile.extname);\n const doc = await docReader.read(docFile.relative, docFile.contents, component);\n return doc;\n } catch (err: any) {\n // it's ok to fail here.\n this.logger.debug(`docs.main.runtime.computeDoc caught an error: ${err.message}`);\n return null;\n }\n }\n\n return null;\n }\n\n getDoc(component: IComponent) {\n const docData = component.get(DocsAspect.id)?.data?.doc;\n if (!docData) return null;\n return new Doc(docData.filePath, new DocPropList(docData.props));\n }\n\n getPatterns() {\n return this.patterns;\n }\n\n getComponentDevPatterns(component: Component) {\n const env = this.envs.calculateEnv(component, { skipWarnings: !!this.workspace?.inInstallContext }).env;\n const componentEnvDocsDevPatterns: string[] = env.getDocsDevPatterns ? env.getDocsDevPatterns(component) : [];\n const componentPatterns = componentEnvDocsDevPatterns.concat(this.getPatterns());\n return { name: 'docs', pattern: componentPatterns };\n }\n\n getDevPatternToRegister() {\n return this.getComponentDevPatterns.bind(this);\n }\n /**\n * register a new doc reader. this allows to support further\n * documentation file formats.\n */\n registerDocReader(docReader: DocReader) {\n this.docReaderSlot.register(docReader);\n return this;\n }\n\n static slots = [Slot.withType<DocProp>(), Slot.withType<DocReader>()];\n\n static runtime = MainRuntime;\n static dependencies = [\n PreviewAspect,\n GraphqlAspect,\n WorkspaceAspect,\n PkgAspect,\n CompilerAspect,\n LoggerAspect,\n DevFilesAspect,\n EnvsAspect,\n ScopeAspect,\n ];\n\n static defaultConfig = {\n patterns: ['**/*.docs.*'],\n };\n\n static async provider(\n [preview, graphql, workspace, pkg, compiler, loggerAspect, devFiles, envs, scope]: [\n PreviewMain,\n GraphqlMain,\n Workspace,\n PkgMain,\n CompilerMain,\n LoggerMain,\n DevFilesMain,\n EnvsMain,\n ScopeMain,\n ],\n config: DocsConfig,\n [docPropSlot, docReaderSlot]: [DocPropSlot, DocReaderSlot]\n ) {\n const logger = loggerAspect.createLogger(DocsAspect.id);\n const docs = new DocsMain(\n config.patterns,\n preview,\n pkg,\n compiler,\n workspace,\n logger,\n devFiles,\n envs,\n docPropSlot,\n docReaderSlot\n );\n docs.registerDocReader(new DefaultDocReader(pkg, compiler, workspace));\n devFiles.registerDevPattern(docs.getDevPatternToRegister());\n\n const computeDocsOnLoad = async (component: Component, opts?: ComponentLoadOptions) => {\n if (opts?.loadDocs === false) return undefined;\n // const docFiles = await docs.computeDocs(component);\n const doc = await docs.computeDoc(component);\n\n return {\n doc: doc?.toObject(),\n // docFiles\n };\n };\n\n if (workspace) {\n workspace.registerOnComponentLoad(computeDocsOnLoad);\n }\n if (scope) {\n scope.registerOnCompAspectReCalc(computeDocsOnLoad);\n }\n\n graphql.register(() => docsSchema(docs));\n\n preview.registerDefinition(new DocsPreviewDefinition(docs));\n return docs;\n }\n}\n\nDocsAspect.addRuntime(DocsMain);\n"],"mappings":";;;;;;AACA,SAAAA,SAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,QAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,gBAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,eAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAG,QAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,OAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAI,UAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,SAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAK,WAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,UAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAM,OAAA;EAAA,MAAAN,IAAA,GAAAC,OAAA;EAAAK,MAAA,YAAAA,C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HJ,CAACgG,eAAI,CAACC,QAAQ,CAAU,CAAC,EAAED,eAAI,CAACC,QAAQ,CAAY,CAAC,CAAC;AAAApH,eAAA,CAjH1DmB,QAAQ,aAmHFkG,6BAAW;AAAArH,eAAA,CAnHjBmB,QAAQ,kBAoHG,CACpBmG,wBAAa,EACbC,wBAAa,EACbC,4BAAe,EACfC,gBAAS,EACTC,0BAAc,EACdC,sBAAY,EACZC,0BAAc,EACdC,kBAAU,EACVC,oBAAW,CACZ;AAAA9H,eAAA,CA9HUmB,QAAQ,mBAgII;EACrBE,QAAQ,EAAE,CAAC,aAAa;AAC1B,CAAC;AA0DHmB,kBAAU,CAACuF,UAAU,CAAC5G,QAAQ,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_harmony","data","require","_harmonyModules","_logger","_compiler","_component","_scope","_pkg","_graphql","_preview","_devFiles","_workspace","_docsEntities","_lodash","_envs","_docs","_docs2","_docs3","_defaultDocReader","_exceptions","_defineProperty","e","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","DocsMain","constructor","patterns","preview","pkg","compiler","workspace","logger","devFiles","envs","docPropSlot","docReaderSlot","getDocsMap","components","ComponentMap","as","component","getDocsFiles","getDevFiles","docFiles","get","DocsAspect","id","state","filesystem","files","filter","file","includes","relative","getDescription","componentDoc","getDoc","desc","description","getTemplate","env","getDocsTemplate","isFunction","undefined","getDocReader","extension","values","find","docReader","isFormatSupported","computeDoc","length","docFile","extname","FileExtensionNotSupported","doc","read","contents","err","debug","message","computeDocDataInScope","toObject","docData","Doc","filePath","DocPropList","props","getPatterns","getComponentDevPatterns","calculateEnv","skipWarnings","inInstallContext","componentEnvDocsDevPatterns","getDocsDevPatterns","componentPatterns","concat","name","pattern","getDevPatternToRegister","bind","registerDocReader","register","provider","graphql","loggerAspect","scope","config","createLogger","docs","DefaultDocReader","registerDevPattern","computeDocsOnLoad","opts","loadDocs","registerOnComponentLoad","registerOnCompAspectReCalc","docsSchema","registerDefinition","DocsPreviewDefinition","exports","Slot","withType","MainRuntime","PreviewAspect","GraphqlAspect","WorkspaceAspect","PkgAspect","CompilerAspect","LoggerAspect","DevFilesAspect","EnvsAspect","ScopeAspect","addRuntime"],"sources":["docs.main.runtime.ts"],"sourcesContent":["import type { SlotRegistry } from '@teambit/harmony';\nimport { Slot } from '@teambit/harmony';\nimport { MainRuntime } from '@teambit/harmony.modules.runtimes';\nimport type { LoggerMain, Logger } from '@teambit/logger';\nimport { LoggerAspect } from '@teambit/logger';\nimport type { CompilerMain } from '@teambit/compiler';\nimport { CompilerAspect } from '@teambit/compiler';\nimport type { Component, IComponent } from '@teambit/component';\nimport { ComponentMap } from '@teambit/component';\nimport type { ScopeMain } from '@teambit/scope';\nimport { ScopeAspect } from '@teambit/scope';\nimport type { PkgMain } from '@teambit/pkg';\nimport { PkgAspect } from '@teambit/pkg';\nimport type { Environment, EnvsMain } from '@teambit/envs';\nimport type { GraphqlMain } from '@teambit/graphql';\nimport { GraphqlAspect } from '@teambit/graphql';\nimport type { PreviewMain } from '@teambit/preview';\nimport { PreviewAspect } from '@teambit/preview';\nimport type { DevFilesMain } from '@teambit/dev-files';\nimport { DevFilesAspect } from '@teambit/dev-files';\nimport type { ComponentLoadOptions } from '@teambit/legacy.consumer-component';\nimport type { AbstractVinyl } from '@teambit/component.sources';\nimport type { Workspace } from '@teambit/workspace';\nimport { WorkspaceAspect } from '@teambit/workspace';\nimport { Doc, DocPropList } from '@teambit/docs.entities.doc';\nimport { isFunction } from 'lodash';\nimport { EnvsAspect } from '@teambit/envs';\nimport { DocsAspect } from './docs.aspect';\nimport { DocsPreviewDefinition } from './docs.preview-definition';\nimport { docsSchema } from './docs.graphql';\nimport type { DocReader } from './doc-reader';\nimport { DefaultDocReader } from './default-doc-reader';\nimport { FileExtensionNotSupported } from './exceptions';\n\nexport type ComponentDocs = {\n files: string[];\n component: Component;\n};\n\nexport type DocProp = {};\n\nexport type DocPropSlot = SlotRegistry<DocProp>;\n\nexport type DocReaderSlot = SlotRegistry<DocReader>;\n\nexport type DocsConfig = {\n /**\n * glob patterns to identify doc files.\n */\n patterns: string[];\n};\n\n/**\n * the component documentation extension.\n */\nexport class DocsMain {\n constructor(\n private patterns: string[],\n /**\n * envs extension.\n */\n private preview: PreviewMain,\n\n private pkg: PkgMain,\n\n private compiler: CompilerMain,\n\n private workspace: Workspace,\n\n private logger: Logger,\n\n private devFiles: DevFilesMain,\n\n private envs: EnvsMain,\n\n private docPropSlot: DocPropSlot,\n\n private docReaderSlot: DocReaderSlot\n ) {}\n\n /**\n * returns an array of doc file paths for a set of components.\n */\n getDocsMap(components: Component[]): ComponentMap<AbstractVinyl[]> {\n return ComponentMap.as<AbstractVinyl[]>(components, (component) => {\n return this.getDocsFiles(component);\n });\n }\n\n getDocsFiles(component: Component): AbstractVinyl[] {\n const devFiles = this.devFiles.getDevFiles(component);\n const docFiles = devFiles.get(DocsAspect.id);\n return component.state.filesystem.files.filter((file) => docFiles.includes(file.relative));\n }\n\n /**\n * compute the description of the component from its source code and docs file.\n */\n async getDescription(component: Component): Promise<string> {\n const componentDoc = this.getDoc(component);\n const desc = componentDoc?.description;\n return desc || '';\n }\n\n async getTemplate(env: Environment): Promise<string | undefined> {\n if (env.getDocsTemplate && isFunction(env.getDocsTemplate)) {\n return env.getDocsTemplate();\n }\n return undefined;\n }\n\n getDocReader(extension: string) {\n return this.docReaderSlot.values().find((docReader) => docReader.isFormatSupported(extension));\n }\n\n /**\n * compute a doc for a component.\n */\n async computeDoc(component: Component) {\n const docFiles = this.getDocsFiles(component);\n if (docFiles.length) {\n // currently taking the the first docs file found with an abstract. (we support only one)\n const docFile = docFiles[0];\n\n try {\n const docReader = this.getDocReader(docFile.extname);\n if (!docReader) throw new FileExtensionNotSupported(docFile.relative, docFile.extname);\n const doc = await docReader.read(docFile.relative, docFile.contents, component);\n return doc;\n } catch (err: any) {\n // it's ok to fail here.\n this.logger.debug(`docs.main.runtime.computeDoc caught an error: ${err.message}`);\n return null;\n }\n }\n\n return null;\n }\n\n /**\n * the docs data of a component that a scope re-calculates (e.g. when it snaps a lane merge).\n * a scope can fail to read a docs file that a workspace reads. e.g. the default doc reader loads the compiled docs\n * file from the workspace node_modules. then, return undefined to keep the stored doc, instead of an empty one.\n */\n async computeDocDataInScope(component: Component) {\n const doc = await this.computeDoc(component);\n if (!doc && this.getDocsFiles(component).length) return undefined;\n return { doc: doc?.toObject() };\n }\n\n getDoc(component: IComponent) {\n const docData = component.get(DocsAspect.id)?.data?.doc;\n if (!docData) return null;\n return new Doc(docData.filePath, new DocPropList(docData.props));\n }\n\n getPatterns() {\n return this.patterns;\n }\n\n getComponentDevPatterns(component: Component) {\n const env = this.envs.calculateEnv(component, { skipWarnings: !!this.workspace?.inInstallContext }).env;\n const componentEnvDocsDevPatterns: string[] = env.getDocsDevPatterns ? env.getDocsDevPatterns(component) : [];\n const componentPatterns = componentEnvDocsDevPatterns.concat(this.getPatterns());\n return { name: 'docs', pattern: componentPatterns };\n }\n\n getDevPatternToRegister() {\n return this.getComponentDevPatterns.bind(this);\n }\n /**\n * register a new doc reader. this allows to support further\n * documentation file formats.\n */\n registerDocReader(docReader: DocReader) {\n this.docReaderSlot.register(docReader);\n return this;\n }\n\n static slots = [Slot.withType<DocProp>(), Slot.withType<DocReader>()];\n\n static runtime = MainRuntime;\n static dependencies = [\n PreviewAspect,\n GraphqlAspect,\n WorkspaceAspect,\n PkgAspect,\n CompilerAspect,\n LoggerAspect,\n DevFilesAspect,\n EnvsAspect,\n ScopeAspect,\n ];\n\n static defaultConfig = {\n patterns: ['**/*.docs.*'],\n };\n\n static async provider(\n [preview, graphql, workspace, pkg, compiler, loggerAspect, devFiles, envs, scope]: [\n PreviewMain,\n GraphqlMain,\n Workspace,\n PkgMain,\n CompilerMain,\n LoggerMain,\n DevFilesMain,\n EnvsMain,\n ScopeMain,\n ],\n config: DocsConfig,\n [docPropSlot, docReaderSlot]: [DocPropSlot, DocReaderSlot]\n ) {\n const logger = loggerAspect.createLogger(DocsAspect.id);\n const docs = new DocsMain(\n config.patterns,\n preview,\n pkg,\n compiler,\n workspace,\n logger,\n devFiles,\n envs,\n docPropSlot,\n docReaderSlot\n );\n docs.registerDocReader(new DefaultDocReader(pkg, compiler, workspace));\n devFiles.registerDevPattern(docs.getDevPatternToRegister());\n\n const computeDocsOnLoad = async (component: Component, opts?: ComponentLoadOptions) => {\n if (opts?.loadDocs === false) return undefined;\n // const docFiles = await docs.computeDocs(component);\n const doc = await docs.computeDoc(component);\n\n return {\n doc: doc?.toObject(),\n // docFiles\n };\n };\n\n if (workspace) {\n workspace.registerOnComponentLoad(computeDocsOnLoad);\n }\n if (scope) {\n scope.registerOnCompAspectReCalc((component) => docs.computeDocDataInScope(component));\n }\n\n graphql.register(() => docsSchema(docs));\n\n preview.registerDefinition(new DocsPreviewDefinition(docs));\n return docs;\n }\n}\n\nDocsAspect.addRuntime(DocsMain);\n"],"mappings":";;;;;;AACA,SAAAA,SAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,QAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,gBAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,eAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAG,QAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,OAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAI,UAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,SAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAK,WAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,UAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA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IAAIpD,SAAS,EAAE;MACbA,SAAS,CAACqF,uBAAuB,CAACH,iBAAiB,CAAC;IACtD;IACA,IAAIN,KAAK,EAAE;MACTA,KAAK,CAACU,0BAA0B,CAAE5E,SAAS,IAAKqE,IAAI,CAAC5B,qBAAqB,CAACzC,SAAS,CAAC,CAAC;IACxF;IAEAgE,OAAO,CAACF,QAAQ,CAAC,MAAM,IAAAe,mBAAU,EAACR,IAAI,CAAC,CAAC;IAExClF,OAAO,CAAC2F,kBAAkB,CAAC,KAAIC,8BAAqB,EAACV,IAAI,CAAC,CAAC;IAC3D,OAAOA,IAAI;EACb;AACF;AAACW,OAAA,CAAAhG,QAAA,GAAAA,QAAA;AAAAnB,eAAA,CArMYmB,QAAQ,WA4HJ,CAACiG,eAAI,CAACC,QAAQ,CAAU,CAAC,EAAED,eAAI,CAACC,QAAQ,CAAY,CAAC,CAAC;AAAArH,eAAA,CA5H1DmB,QAAQ,aA8HFmG,6BAAW;AAAAtH,eAAA,CA9HjBmB,QAAQ,kBA+HG,CACpBoG,wBAAa,EACbC,wBAAa,EACbC,4BAAe,EACfC,gBAAS,EACTC,0BAAc,EACdC,sBAAY,EACZC,0BAAc,EACdC,kBAAU,EACVC,oBAAW,CACZ;AAAA/H,eAAA,CAzIUmB,QAAQ,mBA2II;EACrBE,QAAQ,EAAE,CAAC,aAAa;AAC1B,CAAC;AA0DHmB,kBAAU,CAACwF,UAAU,CAAC7G,QAAQ,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _chai() {
|
|
4
|
+
const data = require("chai");
|
|
5
|
+
_chai = function () {
|
|
6
|
+
return data;
|
|
7
|
+
};
|
|
8
|
+
return data;
|
|
9
|
+
}
|
|
10
|
+
function _docsEntities() {
|
|
11
|
+
const data = require("@teambit/docs.entities.doc");
|
|
12
|
+
_docsEntities = function () {
|
|
13
|
+
return data;
|
|
14
|
+
};
|
|
15
|
+
return data;
|
|
16
|
+
}
|
|
17
|
+
function _docsMain() {
|
|
18
|
+
const data = require("./docs.main.runtime");
|
|
19
|
+
_docsMain = function () {
|
|
20
|
+
return data;
|
|
21
|
+
};
|
|
22
|
+
return data;
|
|
23
|
+
}
|
|
24
|
+
function createDocsMain(docFiles, docReader) {
|
|
25
|
+
const devFiles = {
|
|
26
|
+
getDevFiles: () => ({
|
|
27
|
+
get: () => docFiles
|
|
28
|
+
})
|
|
29
|
+
};
|
|
30
|
+
const logger = {
|
|
31
|
+
debug: () => {}
|
|
32
|
+
};
|
|
33
|
+
const docReaderSlot = {
|
|
34
|
+
values: () => [docReader]
|
|
35
|
+
};
|
|
36
|
+
return Object.assign(Object.create(_docsMain().DocsMain.prototype), {
|
|
37
|
+
logger,
|
|
38
|
+
devFiles,
|
|
39
|
+
docReaderSlot
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
function createComponent(filePaths) {
|
|
43
|
+
const files = filePaths.map(relative => ({
|
|
44
|
+
relative,
|
|
45
|
+
extname: '.tsx',
|
|
46
|
+
contents: Buffer.from('')
|
|
47
|
+
}));
|
|
48
|
+
return {
|
|
49
|
+
state: {
|
|
50
|
+
filesystem: {
|
|
51
|
+
files
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
const failingReader = {
|
|
57
|
+
read: async () => {
|
|
58
|
+
throw new Error('the compiled docs file is not in node_modules');
|
|
59
|
+
},
|
|
60
|
+
isFormatSupported: () => true
|
|
61
|
+
};
|
|
62
|
+
describe('DocsMain.computeDocDataInScope', () => {
|
|
63
|
+
it('should return undefined, to keep the stored doc, when a docs file exists but cannot be read', async () => {
|
|
64
|
+
const docs = createDocsMain(['button.docs.tsx'], failingReader);
|
|
65
|
+
(0, _chai().expect)(await docs.computeDocDataInScope(createComponent(['button.tsx', 'button.docs.tsx']))).to.be.undefined;
|
|
66
|
+
});
|
|
67
|
+
it('should return an empty doc when the component has no docs file', async () => {
|
|
68
|
+
const docs = createDocsMain([], failingReader);
|
|
69
|
+
(0, _chai().expect)(await docs.computeDocDataInScope(createComponent(['button.tsx']))).to.deep.equal({
|
|
70
|
+
doc: undefined
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
it('should return the doc when the docs file is read', async () => {
|
|
74
|
+
const reader = {
|
|
75
|
+
read: async path => _docsEntities().Doc.from(path, {
|
|
76
|
+
description: 'a button',
|
|
77
|
+
displayName: 'Button'
|
|
78
|
+
}),
|
|
79
|
+
isFormatSupported: () => true
|
|
80
|
+
};
|
|
81
|
+
const docs = createDocsMain(['button.docs.tsx'], reader);
|
|
82
|
+
const data = await docs.computeDocDataInScope(createComponent(['button.tsx', 'button.docs.tsx']));
|
|
83
|
+
(0, _chai().expect)(data?.doc?.filePath).to.equal('button.docs.tsx');
|
|
84
|
+
});
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
//# sourceMappingURL=docs.main.runtime.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_chai","data","require","_docsEntities","_docsMain","createDocsMain","docFiles","docReader","devFiles","getDevFiles","get","logger","debug","docReaderSlot","values","Object","assign","create","DocsMain","prototype","createComponent","filePaths","files","map","relative","extname","contents","Buffer","from","state","filesystem","failingReader","read","Error","isFormatSupported","describe","it","docs","expect","computeDocDataInScope","to","be","undefined","deep","equal","doc","reader","path","Doc","description","displayName","filePath"],"sources":["docs.main.runtime.spec.ts"],"sourcesContent":["import { expect } from 'chai';\nimport type { Component } from '@teambit/component';\nimport { Doc } from '@teambit/docs.entities.doc';\nimport { DocsMain } from './docs.main.runtime';\nimport type { DocReader } from './doc-reader';\n\nfunction createDocsMain(docFiles: string[], docReader: DocReader) {\n const devFiles: any = { getDevFiles: () => ({ get: () => docFiles }) };\n const logger: any = { debug: () => {} };\n const docReaderSlot: any = { values: () => [docReader] };\n return Object.assign(Object.create(DocsMain.prototype), { logger, devFiles, docReaderSlot }) as DocsMain;\n}\n\nfunction createComponent(filePaths: string[]): Component {\n const files = filePaths.map((relative) => ({ relative, extname: '.tsx', contents: Buffer.from('') }));\n return { state: { filesystem: { files } } } as any;\n}\n\nconst failingReader: DocReader = {\n read: async () => {\n throw new Error('the compiled docs file is not in node_modules');\n },\n isFormatSupported: () => true,\n};\n\ndescribe('DocsMain.computeDocDataInScope', () => {\n it('should return undefined, to keep the stored doc, when a docs file exists but cannot be read', async () => {\n const docs = createDocsMain(['button.docs.tsx'], failingReader);\n expect(await docs.computeDocDataInScope(createComponent(['button.tsx', 'button.docs.tsx']))).to.be.undefined;\n });\n it('should return an empty doc when the component has no docs file', async () => {\n const docs = createDocsMain([], failingReader);\n expect(await docs.computeDocDataInScope(createComponent(['button.tsx']))).to.deep.equal({ doc: undefined });\n });\n it('should return the doc when the docs file is read', async () => {\n const reader: DocReader = {\n read: async (path: string) => Doc.from(path, { description: 'a button', displayName: 'Button' }),\n isFormatSupported: () => true,\n };\n const docs = createDocsMain(['button.docs.tsx'], reader);\n const data = await docs.computeDocDataInScope(createComponent(['button.tsx', 'button.docs.tsx']));\n expect(data?.doc?.filePath).to.equal('button.docs.tsx');\n });\n});\n"],"mappings":";;AAAA,SAAAA,MAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,KAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAE,cAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,aAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,UAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,SAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAASI,cAAcA,CAACC,QAAkB,EAAEC,SAAoB,EAAE;EAChE,MAAMC,QAAa,GAAG;IAAEC,WAAW,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EAAgE,EAAE,YAAY;IAC/E,MAAMC,IAAI,GAAGhC,cAAc,CAAC,EAAE,EAAE0B,aAAa,CAAC;IAC9C,IAAAO,cAAM,EAAC,MAAMD,IAAI,CAACE,qBAAqB,CAACnB,eAAe,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAACoB,EAAE,CAACG,IAAI,CAACC,KAAK,CAAC;MAAEC,GAAG,EAAEH;IAAU,CAAC,CAAC;EAC7G,CAAC,CAAC;EACFN,EAAE,CAAC,kDAAkD,EAAE,YAAY;IACjE,MAAMU,MAAiB,GAAG;MACxBd,IAAI,EAAE,MAAOe,IAAY,IAAKC,mBAAG,CAACpB,IAAI,CAACmB,IAAI,EAAE;QAAEE,WAAW,EAAE,UAAU;QAAEC,WAAW,EAAE;MAAS,CAAC,CAAC;MAChGhB,iBAAiB,EAAEA,CAAA,KAAM;IAC3B,CAAC;IACD,MAAMG,IAAI,GAAGhC,cAAc,CAAC,CAAC,iBAAiB,CAAC,EAAEyC,MAAM,CAAC;IACxD,MAAM7C,IAAI,GAAG,MAAMoC,IAAI,CAACE,qBAAqB,CAACnB,eAAe,CAAC,CAAC,YAAY,EAAE,iBAAiB,CAAC,CAAC,CAAC;IACjG,IAAAkB,cAAM,EAACrC,IAAI,EAAE4C,GAAG,EAAEM,QAAQ,CAAC,CAACX,EAAE,CAACI,KAAK,CAAC,iBAAiB,CAAC;EACzD,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -20,7 +20,7 @@ export declare class DocsPreview {
|
|
|
20
20
|
*/
|
|
21
21
|
preview: PreviewPreview);
|
|
22
22
|
render: (componentId: ComponentID, envId: string, modules: PreviewModule, [compositionsFromParams]: [any], context: RenderingContext) => void;
|
|
23
|
-
selectPreviewModel(componentId: string, modules: PreviewModule): import("@teambit/preview
|
|
23
|
+
selectPreviewModel(componentId: string, modules: PreviewModule): import("@teambit/preview").ModuleFile<any> | undefined;
|
|
24
24
|
static runtime: import("@teambit/harmony").RuntimeDefinition;
|
|
25
25
|
static dependencies: import("@teambit/harmony").Aspect[];
|
|
26
26
|
static provider([preview]: [PreviewPreview]): Promise<DocsPreview>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.docs_docs@1.0.
|
|
2
|
-
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.docs_docs@1.0.
|
|
1
|
+
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.docs_docs@1.0.1264/dist/docs.composition.js';
|
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.docs_docs@1.0.1264/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,45 +1,45 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/docs",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1264",
|
|
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.
|
|
9
|
+
"version": "1.0.1264"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"graphql-tag": "2.12.1",
|
|
13
13
|
"lodash": "4.18.1",
|
|
14
14
|
"classnames": "^2.5.1",
|
|
15
|
+
"@teambit/compiler": "1.0.1260",
|
|
16
|
+
"@teambit/component": "1.0.1243",
|
|
15
17
|
"@teambit/docs.entities.doc": "0.0.12",
|
|
18
|
+
"@teambit/pkg": "1.0.1260",
|
|
19
|
+
"@teambit/workspace": "1.0.1260",
|
|
16
20
|
"@teambit/harmony": "0.4.12",
|
|
17
21
|
"@teambit/component.sources": "0.0.246",
|
|
22
|
+
"@teambit/dev-files": "1.0.1260",
|
|
23
|
+
"@teambit/envs": "1.0.1243",
|
|
18
24
|
"@teambit/graphql": "1.0.1210",
|
|
19
25
|
"@teambit/harmony.modules.runtimes": "0.0.4",
|
|
20
26
|
"@teambit/legacy.consumer-component": "0.0.195",
|
|
21
27
|
"@teambit/logger": "0.0.1502",
|
|
28
|
+
"@teambit/preview": "1.0.1261",
|
|
29
|
+
"@teambit/scope": "1.0.1259",
|
|
22
30
|
"@teambit/component-id": "1.2.5",
|
|
31
|
+
"@teambit/api-reference": "1.0.1263",
|
|
32
|
+
"@teambit/component-compare": "1.0.1261",
|
|
23
33
|
"@teambit/docs.ui.overview-compare-section": "0.0.102",
|
|
24
34
|
"@teambit/docs.ui.overview-compare": "1.0.12",
|
|
25
35
|
"@teambit/preview.ui.component-preview": "1.0.45",
|
|
26
36
|
"@teambit/pubsub": "1.0.1214",
|
|
27
37
|
"@teambit/component.ui.component-meta": "0.0.386",
|
|
28
38
|
"@teambit/compositions.panels.composition-gallery": "0.0.232",
|
|
39
|
+
"@teambit/compositions": "1.0.1262",
|
|
29
40
|
"@teambit/design.ui.surfaces.status-message-card": "0.0.18",
|
|
30
41
|
"@teambit/workspace.ui.use-workspace-mode": "0.0.8",
|
|
31
|
-
"@teambit/base-ui.loaders.skeleton": "1.0.2"
|
|
32
|
-
"@teambit/compiler": "1.0.1259",
|
|
33
|
-
"@teambit/component": "1.0.1242",
|
|
34
|
-
"@teambit/pkg": "1.0.1259",
|
|
35
|
-
"@teambit/workspace": "1.0.1259",
|
|
36
|
-
"@teambit/dev-files": "1.0.1259",
|
|
37
|
-
"@teambit/envs": "1.0.1242",
|
|
38
|
-
"@teambit/preview": "1.0.1260",
|
|
39
|
-
"@teambit/scope": "1.0.1258",
|
|
40
|
-
"@teambit/api-reference": "1.0.1262",
|
|
41
|
-
"@teambit/component-compare": "1.0.1260",
|
|
42
|
-
"@teambit/compositions": "1.0.1261"
|
|
42
|
+
"@teambit/base-ui.loaders.skeleton": "1.0.2"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@types/lodash": "4.14.165",
|
|
@@ -50,7 +50,8 @@
|
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
52
|
"react": "^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
53
|
-
"react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0"
|
|
53
|
+
"react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
54
|
+
"chai": "5.2.1"
|
|
54
55
|
},
|
|
55
56
|
"license": "Apache-2.0",
|
|
56
57
|
"optionalDependencies": {},
|