@theholocron/holocron-plugin-fern 3.48.0 → 3.50.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.d.mts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { AuthError, ResolveTokenInput, Wiki, WikiDnsRecord, WikiProvisionOpts, WikiProxyConfig } from "@theholocron/cli";
2
2
  //#region src/capabilities/wiki.d.ts
3
- declare const FERN_VERSION = "5.35.4";
3
+ declare const FERN_VERSION = "5.114.1";
4
4
  interface FernWikiOptions {
5
5
  /** Absolute path to the working repo root. Injected by the loader from RuntimeContext. */
6
6
  repoRoot?: string;
package/dist/index.mjs CHANGED
@@ -2,7 +2,7 @@ import { mkdir, readFile, writeFile } from "node:fs/promises";
2
2
  import { join } from "node:path";
3
3
  import { AuthError, createResolveToken } from "@theholocron/cli";
4
4
  //#region src/capabilities/wiki.ts
5
- const FERN_VERSION = "5.35.4";
5
+ const FERN_VERSION = "5.114.1";
6
6
  var FernWiki = class {
7
7
  opts;
8
8
  key = "wiki";
@@ -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
- * Uses a regex to match the block (the `instances:` key and all following
114
- * indented / list lines) and replaces it in-place. Returns the original
115
- * string unchanged when the block already matches.
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.48.0",
3
+ "version": "3.50.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.48.0"
47
+ "@theholocron/cli": "3.50.0"
48
48
  },
49
49
  "peerDependencies": {
50
- "@theholocron/cli": "3.48.0"
50
+ "@theholocron/cli": "3.50.0"
51
51
  },
52
52
  "engines": {
53
53
  "node": ">=22"