@opentf/afw-cli 1.34.0 → 1.36.0
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 +4 -4
- package/src/shared.js +7 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opentf/afw-cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.36.0",
|
|
4
4
|
"description": "Static generation for AFW apps, run as an esdev build step.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -16,11 +16,11 @@
|
|
|
16
16
|
"esdev": ">=0.16.0"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@opentf/afw-build": "0.
|
|
20
|
-
"@opentf/esdev-plugin-afw": "0.
|
|
19
|
+
"@opentf/afw-build": "0.3.0",
|
|
20
|
+
"@opentf/esdev-plugin-afw": "0.8.0"
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|
|
23
|
-
"@opentf/afw": "0.
|
|
23
|
+
"@opentf/afw": "0.37.0"
|
|
24
24
|
},
|
|
25
25
|
"keywords": [
|
|
26
26
|
"afw",
|
package/src/shared.js
CHANGED
|
@@ -76,7 +76,10 @@ export async function loadDocsPlugins(root, appDir, config, exclude = new Set())
|
|
|
76
76
|
if (!docs && !blog) return [];
|
|
77
77
|
try {
|
|
78
78
|
const entry = await resolveFrom("@opentf/afw-docs/build", root);
|
|
79
|
-
const { docsNavPlugin, blogPostsPlugin, lastUpdatedPlugin } = await import(toFileURL(entry).href);
|
|
79
|
+
const { afwDocsPlugin, docsNavPlugin, blogPostsPlugin, lastUpdatedPlugin, codeHighlightPlugin } = await import(toFileURL(entry).href);
|
|
80
|
+
// The same set the project's `esdev.json` entry gets: afw-docs decides it from the
|
|
81
|
+
// config. An older afw-docs has no `afwDocsPlugin`; assemble the set here instead.
|
|
82
|
+
if (afwDocsPlugin) return await afwDocsPlugin({ appDir, exclude: [...exclude], root, config });
|
|
80
83
|
const plugins = [];
|
|
81
84
|
// Resolves `@opentf/afw-docs/nav` to a section map — one generated tree per top-level
|
|
82
85
|
// folder under app/. Any folder with a DocsLayout becomes a section automatically.
|
|
@@ -86,6 +89,9 @@ export async function loadDocsPlugins(root, appDir, config, exclude = new Set())
|
|
|
86
89
|
// Resolves `@opentf/afw-docs/updated` to the per-page last-updated map (every route),
|
|
87
90
|
// when last-updated is turned on anywhere.
|
|
88
91
|
if (wantsLastUpdated(config)) plugins.push(lastUpdatedPlugin({ appDir, exclude, blogDir: blog ? blog.dir ?? "blog" : undefined }));
|
|
92
|
+
// Highlights the code fences of compiled `.md`/`.mdx` pages (an older afw-docs
|
|
93
|
+
// without it leaves them as plain text).
|
|
94
|
+
if (codeHighlightPlugin) plugins.push(codeHighlightPlugin());
|
|
89
95
|
return plugins;
|
|
90
96
|
} catch (e) {
|
|
91
97
|
console.warn(
|