@travetto/doc 5.0.0-rc.6 → 5.0.0-rc.7
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/package.json +3 -3
- package/src/render/renderer.ts +2 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@travetto/doc",
|
|
3
|
-
"version": "5.0.0-rc.
|
|
3
|
+
"version": "5.0.0-rc.7",
|
|
4
4
|
"description": "Documentation support for the Travetto framework",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"docs",
|
|
@@ -24,12 +24,12 @@
|
|
|
24
24
|
"directory": "module/doc"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@travetto/runtime": "^5.0.0-rc.
|
|
27
|
+
"@travetto/runtime": "^5.0.0-rc.7",
|
|
28
28
|
"@types/prismjs": "^1.26.4",
|
|
29
29
|
"prismjs": "^1.29.0"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
|
-
"@travetto/cli": "^5.0.0-rc.
|
|
32
|
+
"@travetto/cli": "^5.0.0-rc.7"
|
|
33
33
|
},
|
|
34
34
|
"peerDependenciesMeta": {
|
|
35
35
|
"@travetto/cli": {
|
package/src/render/renderer.ts
CHANGED
|
@@ -2,7 +2,7 @@ import path from 'node:path';
|
|
|
2
2
|
|
|
3
3
|
import { type ManifestContext, PackageUtil } from '@travetto/manifest';
|
|
4
4
|
import { isJSXElement, JSXElement, JSXFragmentType } from '@travetto/doc/jsx-runtime';
|
|
5
|
-
import {
|
|
5
|
+
import { Runtime } from '@travetto/runtime';
|
|
6
6
|
|
|
7
7
|
import { EMPTY_ELEMENT, getComponentName, JSXElementByFn, c } from '../jsx';
|
|
8
8
|
import { DocumentShape, RenderProvider, RenderState } from '../types';
|
|
@@ -20,12 +20,7 @@ const providers = { [Html.ext]: Html, [Markdown.ext]: Markdown };
|
|
|
20
20
|
export class DocRenderer {
|
|
21
21
|
|
|
22
22
|
static async get(file: string, manifest: Pick<ManifestContext, 'workspace'>): Promise<DocRenderer> {
|
|
23
|
-
const
|
|
24
|
-
if (!mod) {
|
|
25
|
-
throw new Error(`Unable to render ${file}, not in the manifest`);
|
|
26
|
-
}
|
|
27
|
-
const res: DocumentShape = await import(mod);
|
|
28
|
-
|
|
23
|
+
const res = await Runtime.importFrom<DocumentShape>(file);
|
|
29
24
|
const pkg = PackageUtil.readPackage(manifest.workspace.path);
|
|
30
25
|
const repoBaseUrl = pkg.travetto?.doc?.baseUrl ?? manifest.workspace.path;
|
|
31
26
|
return new DocRenderer(res,
|