@theholocron/holocron-plugin-fern 3.49.0 → 3.51.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/dist/index.mjs +7 -5
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -80,12 +80,13 @@ async function writeFernDocsYml({ repoRoot, fernOrg, repo, name, domain }) {
|
|
|
80
80
|
customDomain = domain;
|
|
81
81
|
}
|
|
82
82
|
} else instanceUrl = `${resolvedFernOrg}.docs.buildwithfern.com`;
|
|
83
|
+
const repoOwner = repo?.split("/")[0];
|
|
83
84
|
let existing = null;
|
|
84
85
|
try {
|
|
85
86
|
existing = await readFile(docsPath, "utf8");
|
|
86
87
|
} catch {}
|
|
87
88
|
if (existing !== null) {
|
|
88
|
-
const updated = updateInstancesBlock(existing, instanceUrl, customDomain, multiSource);
|
|
89
|
+
const updated = updateInstancesBlock(existing, instanceUrl, customDomain, multiSource, repoOwner, repoName);
|
|
89
90
|
if (updated !== existing) {
|
|
90
91
|
await writeFile(docsPath, updated, "utf8");
|
|
91
92
|
const domainPart = customDomain ? `, domain=${customDomain}${multiSource ? " (multi-source)" : ""}` : "";
|
|
@@ -110,17 +111,18 @@ async function writeFernDocsYml({ repoRoot, fernOrg, repo, name, domain }) {
|
|
|
110
111
|
* Replace the `instances:` block in an existing docs.yml, preserving
|
|
111
112
|
* everything else (navigation, colors, layout, title, etc.).
|
|
112
113
|
*
|
|
113
|
-
*
|
|
114
|
-
*
|
|
115
|
-
*
|
|
114
|
+
* Includes `edit-this-page:` nested under the instance when owner and
|
|
115
|
+
* repoName are provided. Returns the original string unchanged when the
|
|
116
|
+
* block already matches.
|
|
116
117
|
*/
|
|
117
|
-
function updateInstancesBlock(content, instanceUrl, customDomain, multiSource) {
|
|
118
|
+
function updateInstancesBlock(content, instanceUrl, customDomain, multiSource, repoOwner, repoName) {
|
|
118
119
|
const blockRe = /^instances:(?:\n[ \t][^\n]*)*/m;
|
|
119
120
|
const match = content.match(blockRe);
|
|
120
121
|
if (!match) return content;
|
|
121
122
|
const newLines = [`instances:`, ` - url: ${instanceUrl}`];
|
|
122
123
|
if (customDomain) newLines.push(` custom-domain: ${customDomain}`);
|
|
123
124
|
if (multiSource) newLines.push(` multi-source: true`);
|
|
125
|
+
if (repoOwner && repoName) newLines.push(` edit-this-page:`, ` github:`, ` owner: ${repoOwner}`, ` repo: ${repoName}`, ` branch: main`);
|
|
124
126
|
const newBlock = newLines.join("\n");
|
|
125
127
|
if (match[0] === newBlock) return content;
|
|
126
128
|
return content.replace(blockRe, newBlock);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theholocron/holocron-plugin-fern",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.51.0",
|
|
4
4
|
"description": "Holocron plugin for Fern. Implements the wiki capability for engineering knowledge publishing.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"fern",
|
|
@@ -44,10 +44,10 @@
|
|
|
44
44
|
"tsx": "4.23.12",
|
|
45
45
|
"typescript": "^5.9.3",
|
|
46
46
|
"vitest": "^4.1.11",
|
|
47
|
-
"@theholocron/cli": "3.
|
|
47
|
+
"@theholocron/cli": "3.51.0"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
|
-
"@theholocron/cli": "3.
|
|
50
|
+
"@theholocron/cli": "3.51.0"
|
|
51
51
|
},
|
|
52
52
|
"engines": {
|
|
53
53
|
"node": ">=22"
|