sourcey 3.5.1 → 3.5.3
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/README.md +82 -11
- package/dist/cli.js +122 -3
- package/dist/components/layout/Page.d.ts.map +1 -1
- package/dist/components/layout/Page.js +4 -1
- package/dist/config.d.ts +65 -3
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +42 -6
- package/dist/core/godoc-introspector.d.ts +26 -0
- package/dist/core/godoc-introspector.d.ts.map +1 -0
- package/dist/core/godoc-introspector.js +144 -0
- package/dist/core/godoc-loader.d.ts +34 -0
- package/dist/core/godoc-loader.d.ts.map +1 -0
- package/dist/core/godoc-loader.js +491 -0
- package/dist/core/godoc-types.d.ts +109 -0
- package/dist/core/godoc-types.d.ts.map +1 -0
- package/dist/core/godoc-types.js +8 -0
- package/dist/core/markdown-loader.d.ts +10 -0
- package/dist/core/markdown-loader.d.ts.map +1 -1
- package/dist/core/navigation.js +2 -2
- package/dist/core/search-indexer.d.ts.map +1 -1
- package/dist/core/search-indexer.js +13 -9
- package/dist/core/sourcey-godoc/cmd/sourcey-godoc/main.go +736 -0
- package/dist/core/sourcey-godoc/cmd/sourcey-godoc/site.go +497 -0
- package/dist/core/sourcey-godoc/cmd/sourcey-godoc/site_test.go +89 -0
- package/dist/core/sourcey-godoc/doc.go +11 -0
- package/dist/core/sourcey-godoc/go.mod +3 -0
- package/dist/dev-server.d.ts.map +1 -1
- package/dist/dev-server.js +52 -5
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -33
- package/dist/site-assembly.d.ts +3 -0
- package/dist/site-assembly.d.ts.map +1 -1
- package/dist/site-assembly.js +42 -11
- package/dist/site-url.d.ts.map +1 -1
- package/dist/site-url.js +3 -0
- package/dist/themes/default/sourcey.css +244 -0
- package/package.json +14 -4
package/dist/dev-server.js
CHANGED
|
@@ -2,7 +2,7 @@ import { createServer as createViteServer } from "vite";
|
|
|
2
2
|
import { resolve, dirname, extname, basename, relative } from "node:path";
|
|
3
3
|
import { access } from "node:fs/promises";
|
|
4
4
|
import { fileURLToPath } from "node:url";
|
|
5
|
-
import { loadConfig, pageOutputPath, resolveConfigFromRaw,
|
|
5
|
+
import { loadConfig, pageOutputPath, resolveConfigFromRaw, tabIndexOutputPath } from "./config.js";
|
|
6
6
|
import { loadSpec } from "./core/loader.js";
|
|
7
7
|
import { convertToOpenApi3 } from "./core/converter.js";
|
|
8
8
|
import { parseSpec } from "./core/parser.js";
|
|
@@ -11,6 +11,7 @@ import { normalizeMcpSpec } from "./core/mcp-normalizer.js";
|
|
|
11
11
|
import { buildNavFromSpec, buildSiteNavigation, withActivePage } from "./core/navigation.js";
|
|
12
12
|
import { loadDocsPage, slugFromPath } from "./core/markdown-loader.js";
|
|
13
13
|
import { loadDoxygenTab } from "./core/doxygen-loader.js";
|
|
14
|
+
import { loadGodocTab } from "./core/godoc-loader.js";
|
|
14
15
|
import { buildSearchIndex } from "./core/search-indexer.js";
|
|
15
16
|
import { createRenderOptions } from "./renderer/html-builder.js";
|
|
16
17
|
import { assembleSite, buildSiteConfig, collectDocsPagesByTab, enforceChangelogDiagnostics, formatChangelogDiagnostic, rebuildMarkdownTabNavigation, resolveInternalLinks, } from "./site-assembly.js";
|
|
@@ -49,6 +50,12 @@ export async function startDevServer(options) {
|
|
|
49
50
|
watchPaths.push(tab.mcp);
|
|
50
51
|
if (tab.doxygen)
|
|
51
52
|
watchPaths.push(tab.doxygen.xml);
|
|
53
|
+
if (tab.godoc) {
|
|
54
|
+
if (tab.godoc.snapshot)
|
|
55
|
+
watchPaths.push(tab.godoc.snapshot);
|
|
56
|
+
// The Go module directory is large; watching every .go file slows the
|
|
57
|
+
// dev server. Restart manually after broad source edits.
|
|
58
|
+
}
|
|
52
59
|
if (tab.groups) {
|
|
53
60
|
for (const group of tab.groups) {
|
|
54
61
|
for (const page of group.pages) {
|
|
@@ -70,6 +77,9 @@ export async function startDevServer(options) {
|
|
|
70
77
|
if (tab.doxygen) {
|
|
71
78
|
map.set(resolve(tab.doxygen.xml), { kind: "doxygen", tabSlug: tab.slug, xmlDir: tab.doxygen.xml });
|
|
72
79
|
}
|
|
80
|
+
if (tab.godoc?.snapshot) {
|
|
81
|
+
map.set(resolve(tab.godoc.snapshot), { kind: "godoc", tabSlug: tab.slug, snapshotPath: tab.godoc.snapshot });
|
|
82
|
+
}
|
|
73
83
|
if (tab.groups) {
|
|
74
84
|
for (const group of tab.groups) {
|
|
75
85
|
for (const page of group.pages) {
|
|
@@ -182,6 +192,38 @@ export async function startDevServer(options) {
|
|
|
182
192
|
else
|
|
183
193
|
data.siteTabs.push(navTab);
|
|
184
194
|
}
|
|
195
|
+
else if (content.kind === "godoc") {
|
|
196
|
+
const tab = config.tabs.find((candidate) => candidate.slug === content.tabSlug);
|
|
197
|
+
if (!tab?.godoc)
|
|
198
|
+
return;
|
|
199
|
+
log(`rebuilding godoc tab "${tab.label}"`);
|
|
200
|
+
const { pages, navTab } = await loadGodocTab(tab.godoc, tab.slug, tab.label, {
|
|
201
|
+
repo: config.repo,
|
|
202
|
+
editBranch: config.editBranch,
|
|
203
|
+
editBasePath: tab.godoc.sourceBasePath,
|
|
204
|
+
});
|
|
205
|
+
if (cache !== snapshot)
|
|
206
|
+
return;
|
|
207
|
+
for (const [key, page] of data.pageMap) {
|
|
208
|
+
if (page.tabSlug === content.tabSlug)
|
|
209
|
+
data.pageMap.delete(key);
|
|
210
|
+
}
|
|
211
|
+
for (const [slug, page] of pages) {
|
|
212
|
+
const outputPath = pageOutputPath(tab.slug, slug, config.prettyUrls);
|
|
213
|
+
data.pageMap.set(outputPath, {
|
|
214
|
+
outputPath,
|
|
215
|
+
spec: data.primarySpec,
|
|
216
|
+
currentPage: { kind: "markdown", markdown: page },
|
|
217
|
+
tabSlug: tab.slug,
|
|
218
|
+
pageSlug: slug,
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
const idx = data.siteTabs.findIndex((candidate) => candidate.slug === content.tabSlug);
|
|
222
|
+
if (idx !== -1)
|
|
223
|
+
data.siteTabs[idx] = navTab;
|
|
224
|
+
else
|
|
225
|
+
data.siteTabs.push(navTab);
|
|
226
|
+
}
|
|
185
227
|
else if (content.kind === "openapi") {
|
|
186
228
|
log(`reparsing spec ${shortPath(content.specPath)}`);
|
|
187
229
|
const loaded = await loadSpec(content.specPath);
|
|
@@ -191,7 +233,7 @@ export async function startDevServer(options) {
|
|
|
191
233
|
if (cache !== snapshot)
|
|
192
234
|
return;
|
|
193
235
|
data.specsBySlug.set(content.tabSlug, spec);
|
|
194
|
-
const pageKey =
|
|
236
|
+
const pageKey = tabIndexOutputPath(content.tabSlug, config.prettyUrls);
|
|
195
237
|
const existing = data.pageMap.get(pageKey);
|
|
196
238
|
if (existing) {
|
|
197
239
|
existing.currentPage = { kind: "spec", spec };
|
|
@@ -214,7 +256,7 @@ export async function startDevServer(options) {
|
|
|
214
256
|
if (cache !== snapshot)
|
|
215
257
|
return;
|
|
216
258
|
data.specsBySlug.set(content.tabSlug, spec);
|
|
217
|
-
const pageKey =
|
|
259
|
+
const pageKey = tabIndexOutputPath(content.tabSlug, config.prettyUrls);
|
|
218
260
|
const existing = data.pageMap.get(pageKey);
|
|
219
261
|
if (existing) {
|
|
220
262
|
existing.currentPage = { kind: "spec", spec };
|
|
@@ -250,10 +292,15 @@ export async function startDevServer(options) {
|
|
|
250
292
|
pagePath = firstKey;
|
|
251
293
|
}
|
|
252
294
|
if (!pagePath.endsWith(".html")) {
|
|
253
|
-
|
|
295
|
+
if (config.prettyUrls === "strip") {
|
|
296
|
+
pagePath += ".html";
|
|
297
|
+
}
|
|
298
|
+
else {
|
|
299
|
+
pagePath += "/index.html";
|
|
300
|
+
}
|
|
254
301
|
}
|
|
255
302
|
let pageData = data.pageMap.get(pagePath);
|
|
256
|
-
if (!pageData && pagePath.endsWith(".html") && !pagePath.endsWith("/index.html")) {
|
|
303
|
+
if (!pageData && config.prettyUrls === "slash" && pagePath.endsWith(".html") && !pagePath.endsWith("/index.html")) {
|
|
257
304
|
// Fallback for stale `.html` links when prettyUrls is enabled.
|
|
258
305
|
const pretty = pagePath.replace(/\.html$/, "/index.html");
|
|
259
306
|
pageData = data.pageMap.get(pretty);
|
package/dist/index.d.ts
CHANGED
|
@@ -30,6 +30,7 @@ export interface SiteBuildResult {
|
|
|
30
30
|
outputDir: string;
|
|
31
31
|
pageCount: number;
|
|
32
32
|
changelogDiagnostics: ChangelogDiagnostic[];
|
|
33
|
+
godocDiagnostics: import("./core/godoc-loader.js").GodocLoaderDiagnostic[];
|
|
33
34
|
/** @internal specs by tab slug, for buildDocs compat */
|
|
34
35
|
_specs?: Map<string, NormalizedSpec>;
|
|
35
36
|
}
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,mBAAmB,EAA8B,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACvG,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,mBAAmB,EAA8B,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACvG,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAiBlD,MAAM,WAAW,YAAY;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,cAAc,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,oBAAoB,EAAE,mBAAmB,EAAE,CAAC;CAC7C;AAED;;;GAGG;AACH,wBAAsB,SAAS,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,WAAW,CAAC,CAkB3E;AAMD,MAAM,WAAW,gBAAgB;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,oBAAoB,EAAE,mBAAmB,EAAE,CAAC;IAC5C,gBAAgB,EAAE,OAAO,wBAAwB,EAAE,qBAAqB,EAAE,CAAC;IAC3E,wDAAwD;IACxD,MAAM,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;CACtC;AAED,wBAAsB,aAAa,CAAC,OAAO,GAAE,gBAAqB,GAAG,OAAO,CAAC,eAAe,CAAC,CAoF5F;AA4CD,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAG1D,YAAY,EACV,cAAc,EACd,mBAAmB,EACnB,aAAa,EACb,gBAAgB,EAChB,mBAAmB,EACnB,qBAAqB,EACrB,kBAAkB,GACnB,MAAM,iBAAiB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -6,7 +6,6 @@ import { buildSiteNavigation } from "./core/navigation.js";
|
|
|
6
6
|
import { buildSearchIndex } from "./core/search-indexer.js";
|
|
7
7
|
import { generateLlmsTxt, generateLlmsFullTxt } from "./renderer/llms.js";
|
|
8
8
|
import { assembleSite, buildSiteConfig, collectDocsPagesByTab, createMinimalSpec, enforceChangelogDiagnostics, } from "./site-assembly.js";
|
|
9
|
-
import { toPublicPath } from "./site-url.js";
|
|
10
9
|
/**
|
|
11
10
|
* Build API documentation from a single OpenAPI/Swagger spec.
|
|
12
11
|
* Wraps the spec in a single-tab site and renders through the modern layout.
|
|
@@ -42,11 +41,6 @@ export async function buildSiteDocs(options = {}) {
|
|
|
42
41
|
const llmsFullTxt = generateLlmsFullTxt(sitePages, navigation, site);
|
|
43
42
|
const extraFiles = new Map(assembled.extraFiles);
|
|
44
43
|
const ogImages = new Map();
|
|
45
|
-
if (config.prettyUrls === "strip") {
|
|
46
|
-
const rules = buildStripRedirectRules(sitePages, config.baseUrl);
|
|
47
|
-
if (rules)
|
|
48
|
-
extraFiles.set("_redirects", rules);
|
|
49
|
-
}
|
|
50
44
|
if (!config.ogImage) {
|
|
51
45
|
const { generateOgImage } = await import("./og/generate-og-image.js");
|
|
52
46
|
const CONCURRENCY = 8;
|
|
@@ -98,6 +92,7 @@ export async function buildSiteDocs(options = {}) {
|
|
|
98
92
|
outputDir,
|
|
99
93
|
pageCount: sitePages.length,
|
|
100
94
|
changelogDiagnostics: assembled.changelogDiagnostics,
|
|
95
|
+
godocDiagnostics: assembled.godocDiagnostics,
|
|
101
96
|
_specs: assembled.specsBySlug,
|
|
102
97
|
};
|
|
103
98
|
}
|
|
@@ -128,33 +123,6 @@ function describePageForOg(page, defaultSiteName, changelogPermalinkOg) {
|
|
|
128
123
|
}
|
|
129
124
|
return { title: `${defaultSiteName} Reference` };
|
|
130
125
|
}
|
|
131
|
-
/**
|
|
132
|
-
* Build Netlify/Cloudflare-Pages redirect rules that canonicalise every page onto
|
|
133
|
-
* its extensionless, slash-less URL. Emitted only when `prettyUrls === "strip"`.
|
|
134
|
-
*
|
|
135
|
-
* For each page at `dir/slug/index.html` the user sees `/dir/slug`; redirect
|
|
136
|
-
* `/dir/slug/` and (for backwards compatibility with pre-rename bookmarks)
|
|
137
|
-
* `/dir/slug.html` onto it.
|
|
138
|
-
*/
|
|
139
|
-
function buildStripRedirectRules(pages, baseUrl) {
|
|
140
|
-
const lines = [
|
|
141
|
-
"# Generated by Sourcey: pretty URL canonicalisation",
|
|
142
|
-
];
|
|
143
|
-
const seen = new Set();
|
|
144
|
-
for (const page of pages) {
|
|
145
|
-
const canonical = toPublicPath(page.outputPath, baseUrl, "strip");
|
|
146
|
-
if (canonical === "/" || canonical === "")
|
|
147
|
-
continue;
|
|
148
|
-
if (seen.has(canonical))
|
|
149
|
-
continue;
|
|
150
|
-
seen.add(canonical);
|
|
151
|
-
// Trailing-slash variant (what the file system would naturally serve).
|
|
152
|
-
lines.push(`${canonical}/ ${canonical} 301`);
|
|
153
|
-
// Stale `.html` bookmarks from before the migration.
|
|
154
|
-
lines.push(`${canonical}.html ${canonical} 301`);
|
|
155
|
-
}
|
|
156
|
-
return lines.length > 1 ? `${lines.join("\n")}\n` : null;
|
|
157
|
-
}
|
|
158
126
|
function summarizeVersion(version) {
|
|
159
127
|
if (version.summary)
|
|
160
128
|
return version.summary;
|
package/dist/site-assembly.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type GodocLoaderDiagnostic } from "./core/godoc-loader.js";
|
|
1
2
|
import type { PrettyUrls, ResolvedConfig, ResolvedTab } from "./config.js";
|
|
2
3
|
import type { DocsPage } from "./core/markdown-loader.js";
|
|
3
4
|
import type { SiteTab } from "./core/navigation.js";
|
|
@@ -10,9 +11,11 @@ export interface SiteAssembly {
|
|
|
10
11
|
specsBySlug: Map<string, NormalizedSpec>;
|
|
11
12
|
pageMap: Map<string, SitePage>;
|
|
12
13
|
changelogDiagnostics: ChangelogDiagnostic[];
|
|
14
|
+
godocDiagnostics: GodocLoaderDiagnostic[];
|
|
13
15
|
extraFiles: Map<string, string | Buffer>;
|
|
14
16
|
}
|
|
15
17
|
export declare function assembleSite(config: ResolvedConfig): Promise<SiteAssembly>;
|
|
18
|
+
export declare function formatGodocDiagnostic(diag: GodocLoaderDiagnostic): string;
|
|
16
19
|
export declare function collectDocsPagesByTab(pageMap: Map<string, SitePage>, tabs: ResolvedTab[]): Map<string, DocsPage[]>;
|
|
17
20
|
export declare function rebuildMarkdownTabNavigation(pageMap: Map<string, SitePage>, siteTabs: SiteTab[], tabs: ResolvedTab[], tabSlug: string, prettyUrls: PrettyUrls): void;
|
|
18
21
|
export declare function enforceChangelogDiagnostics(diagnostics: ChangelogDiagnostic[], strictChangelog?: boolean): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"site-assembly.d.ts","sourceRoot":"","sources":["../src/site-assembly.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"site-assembly.d.ts","sourceRoot":"","sources":["../src/site-assembly.ts"],"names":[],"mappings":"AASA,OAAO,EAAgB,KAAK,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAIlF,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC3E,OAAO,KAAK,EAAiB,QAAQ,EAAgB,MAAM,2BAA2B,CAAC;AACvF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,KAAK,EAAE,mBAAmB,EAA8B,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACvG,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAGxD,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,WAAW,EAAE,cAAc,CAAC;IAC5B,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;IACzC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IAC/B,oBAAoB,EAAE,mBAAmB,EAAE,CAAC;IAC5C,gBAAgB,EAAE,qBAAqB,EAAE,CAAC;IAC1C,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;CAC1C;AAED,wBAAsB,YAAY,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,YAAY,CAAC,CA0HhF;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,qBAAqB,GAAG,MAAM,CAKzE;AAED,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,EAC9B,IAAI,EAAE,WAAW,EAAE,GAClB,GAAG,CAAC,MAAM,EAAE,QAAQ,EAAE,CAAC,CAgBzB;AAED,wBAAgB,4BAA4B,CAC1C,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,EAC9B,QAAQ,EAAE,OAAO,EAAE,EACnB,IAAI,EAAE,WAAW,EAAE,EACnB,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,UAAU,GACrB,IAAI,CAsBN;AAED,wBAAgB,2BAA2B,CACzC,WAAW,EAAE,mBAAmB,EAAE,EAClC,eAAe,UAAQ,GACtB,IAAI,CAYN;AAED,wBAAgB,yBAAyB,CAAC,UAAU,EAAE,mBAAmB,GAAG,MAAM,CAIjF;AAED,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,mBAAmB,GAAG,MAAM,CAI9E;AAED,wBAAgB,0BAA0B,CAAC,WAAW,EAAE,mBAAmB,EAAE,GAAG,MAAM,EAAE,CAEvF;AAED,wBAAsB,eAAe,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,UAAU,CAAC,CA4BjF;AAED,wBAAgB,iBAAiB,IAAI,cAAc,CAUlD;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE,MAAM,EAAE,cAAc,GAAG,IAAI,CAuEpF"}
|
package/dist/site-assembly.js
CHANGED
|
@@ -7,9 +7,10 @@ import { normalizeSpec } from "./core/normalizer.js";
|
|
|
7
7
|
import { normalizeMcpSpec } from "./core/mcp-normalizer.js";
|
|
8
8
|
import { loadDocsPage, slugFromPath } from "./core/markdown-loader.js";
|
|
9
9
|
import { loadDoxygenTab } from "./core/doxygen-loader.js";
|
|
10
|
+
import { loadGodocTab } from "./core/godoc-loader.js";
|
|
10
11
|
import { buildNavFromSpec, buildNavFromPages } from "./core/navigation.js";
|
|
11
12
|
import { generateChangelogFeeds } from "./renderer/changelog-feed.js";
|
|
12
|
-
import { pageOutputPath, tabPath } from "./config.js";
|
|
13
|
+
import { pageOutputPath, tabIndexOutputPath, tabPath } from "./config.js";
|
|
13
14
|
import { toPublicUrl } from "./site-url.js";
|
|
14
15
|
export async function assembleSite(config) {
|
|
15
16
|
const specsBySlug = await loadSpecs(config.tabs);
|
|
@@ -17,14 +18,16 @@ export async function assembleSite(config) {
|
|
|
17
18
|
const pageMap = new Map();
|
|
18
19
|
const siteTabs = [];
|
|
19
20
|
const changelogDiagnostics = [];
|
|
21
|
+
const godocDiagnostics = [];
|
|
20
22
|
for (const tab of config.tabs) {
|
|
21
23
|
if (tab.openapi || tab.mcp) {
|
|
22
24
|
const spec = specsBySlug.get(tab.slug);
|
|
23
25
|
const navTab = buildNavFromSpec(spec, tab.slug, config.prettyUrls);
|
|
24
26
|
navTab.label = tab.label;
|
|
25
27
|
siteTabs.push(navTab);
|
|
26
|
-
|
|
27
|
-
|
|
28
|
+
const outputPath = tabIndexOutputPath(tab.slug, config.prettyUrls);
|
|
29
|
+
pageMap.set(outputPath, {
|
|
30
|
+
outputPath,
|
|
28
31
|
currentPage: { kind: "spec", spec },
|
|
29
32
|
spec,
|
|
30
33
|
tabSlug: tab.slug,
|
|
@@ -47,6 +50,26 @@ export async function assembleSite(config) {
|
|
|
47
50
|
siteTabs.push(navTab);
|
|
48
51
|
continue;
|
|
49
52
|
}
|
|
53
|
+
if (tab.godoc) {
|
|
54
|
+
const { pages, navTab, diagnostics } = await loadGodocTab(tab.godoc, tab.slug, tab.label, {
|
|
55
|
+
repo: config.repo,
|
|
56
|
+
editBranch: config.editBranch,
|
|
57
|
+
editBasePath: tab.godoc.sourceBasePath,
|
|
58
|
+
});
|
|
59
|
+
godocDiagnostics.push(...diagnostics);
|
|
60
|
+
for (const [slug, page] of pages) {
|
|
61
|
+
const outputPath = pageOutputPath(tab.slug, slug, config.prettyUrls);
|
|
62
|
+
pageMap.set(outputPath, {
|
|
63
|
+
outputPath,
|
|
64
|
+
currentPage: { kind: "markdown", markdown: page },
|
|
65
|
+
spec: primarySpec,
|
|
66
|
+
tabSlug: tab.slug,
|
|
67
|
+
pageSlug: slug,
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
siteTabs.push(navTab);
|
|
71
|
+
continue;
|
|
72
|
+
}
|
|
50
73
|
if (!tab.groups)
|
|
51
74
|
continue;
|
|
52
75
|
const pagesByPath = new Map();
|
|
@@ -82,7 +105,7 @@ export async function assembleSite(config) {
|
|
|
82
105
|
siteTabs.push(buildNavFromPages(tab, pagesByPath, config.prettyUrls));
|
|
83
106
|
}
|
|
84
107
|
if (config.changelog.permalinks) {
|
|
85
|
-
addPermalinkPages(pageMap);
|
|
108
|
+
addPermalinkPages(pageMap, config.prettyUrls);
|
|
86
109
|
}
|
|
87
110
|
const sitePages = Array.from(pageMap.values());
|
|
88
111
|
resolveInternalLinks(sitePages, config);
|
|
@@ -93,13 +116,20 @@ export async function assembleSite(config) {
|
|
|
93
116
|
specsBySlug,
|
|
94
117
|
pageMap,
|
|
95
118
|
changelogDiagnostics,
|
|
119
|
+
godocDiagnostics,
|
|
96
120
|
extraFiles,
|
|
97
121
|
};
|
|
98
122
|
}
|
|
123
|
+
export function formatGodocDiagnostic(diag) {
|
|
124
|
+
const sev = diag.severity.toUpperCase();
|
|
125
|
+
const where = diag.package ? ` [${diag.package}]` : "";
|
|
126
|
+
const loc = diag.file ? ` ${diag.file}${diag.line ? `:${diag.line}` : ""}` : "";
|
|
127
|
+
return `[${sev}] ${diag.code}${where}${loc} ${diag.message}`;
|
|
128
|
+
}
|
|
99
129
|
export function collectDocsPagesByTab(pageMap, tabs) {
|
|
100
130
|
const docsPagesByTab = new Map();
|
|
101
131
|
for (const tab of tabs) {
|
|
102
|
-
if (!tab.groups && !tab.doxygen)
|
|
132
|
+
if (!tab.groups && !tab.doxygen && !tab.godoc)
|
|
103
133
|
continue;
|
|
104
134
|
const tabPages = [];
|
|
105
135
|
for (const [, page] of pageMap) {
|
|
@@ -256,7 +286,7 @@ function attachChangelogFeeds(pages, config) {
|
|
|
256
286
|
const changelog = page.currentPage.changelog;
|
|
257
287
|
const versionHref = (version) => {
|
|
258
288
|
if (config.changelog.permalinks) {
|
|
259
|
-
return toPublicUrl(
|
|
289
|
+
return toPublicUrl(pageOutputPath(page.tabSlug, `${changelog.slug}/${version.id}`, config.prettyUrls), config.siteUrl, config.baseUrl, config.prettyUrls);
|
|
260
290
|
}
|
|
261
291
|
return `${toPublicUrl(page.outputPath, config.siteUrl, config.baseUrl, config.prettyUrls)}#${version.id}`;
|
|
262
292
|
};
|
|
@@ -297,7 +327,7 @@ function attachChangelogFeeds(pages, config) {
|
|
|
297
327
|
}
|
|
298
328
|
return extraFiles;
|
|
299
329
|
}
|
|
300
|
-
function addPermalinkPages(pageMap) {
|
|
330
|
+
function addPermalinkPages(pageMap, prettyUrls) {
|
|
301
331
|
const changelogPages = Array.from(pageMap.values()).filter(isMainChangelogSitePage);
|
|
302
332
|
for (const page of changelogPages) {
|
|
303
333
|
const changelog = page.currentPage.changelog;
|
|
@@ -309,7 +339,7 @@ function addPermalinkPages(pageMap) {
|
|
|
309
339
|
headings: [],
|
|
310
340
|
permalinkVersionId: version.id,
|
|
311
341
|
};
|
|
312
|
-
const outputPath =
|
|
342
|
+
const outputPath = pageOutputPath(page.tabSlug, `${changelog.slug}/${version.id}`, prettyUrls);
|
|
313
343
|
pageMap.set(outputPath, {
|
|
314
344
|
outputPath,
|
|
315
345
|
currentPage: { kind: "changelog", changelog: permalinkPage },
|
|
@@ -407,9 +437,7 @@ function resolveInternalHref(href, outputPath, docsSourcePath, pathMap, sourceBa
|
|
|
407
437
|
const [path, hash] = href.split("#", 2);
|
|
408
438
|
const hashSuffix = hash ? `#${hash}` : "";
|
|
409
439
|
const sourcePath = path.replace(/\\/g, "/");
|
|
410
|
-
const clean = sourcePath.replace(/^\/+/, "").replace(/\/+$/, "").replace(/\.(md|mdx)$/, "");
|
|
411
|
-
if (clean.endsWith(".html"))
|
|
412
|
-
return null;
|
|
440
|
+
const clean = sourcePath.replace(/^\/+/, "").replace(/\/+$/, "").replace(/\.(md|mdx|html)$/, "");
|
|
413
441
|
const pageDir = outputPath.includes("/")
|
|
414
442
|
? outputPath.substring(0, outputPath.lastIndexOf("/"))
|
|
415
443
|
: "";
|
|
@@ -457,6 +485,9 @@ function resolveInternalHref(href, outputPath, docsSourcePath, pathMap, sourceBa
|
|
|
457
485
|
function toPrettyLink(target, prettyUrls) {
|
|
458
486
|
if (!prettyUrls)
|
|
459
487
|
return target;
|
|
488
|
+
if (prettyUrls === "strip" && target.endsWith(".html")) {
|
|
489
|
+
return target.slice(0, -(".html".length));
|
|
490
|
+
}
|
|
460
491
|
if (target === "index.html")
|
|
461
492
|
return "";
|
|
462
493
|
if (target.endsWith("/index.html")) {
|
package/dist/site-url.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"site-url.d.ts","sourceRoot":"","sources":["../src/site-url.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,KAAK,GAAG,OAAO,GAAG,OAAO,CAAC;AAEnD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAExD;AAED,wBAAgB,gBAAgB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAMzD;AAED,wBAAgB,gBAAgB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAoBrE;AAED,wBAAgB,YAAY,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,SAAK,EAAE,UAAU,GAAE,UAAkB,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"site-url.d.ts","sourceRoot":"","sources":["../src/site-url.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,KAAK,GAAG,OAAO,GAAG,OAAO,CAAC;AAEnD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAExD;AAED,wBAAgB,gBAAgB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAMzD;AAED,wBAAgB,gBAAgB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAoBrE;AAED,wBAAgB,YAAY,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,SAAK,EAAE,UAAU,GAAE,UAAkB,GAAG,MAAM,CAsBrG;AAED,wBAAgB,aAAa,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAK1E;AAED,wBAAgB,WAAW,CACzB,UAAU,EAAE,MAAM,EAClB,OAAO,CAAC,EAAE,MAAM,EAChB,OAAO,SAAK,EACZ,UAAU,GAAE,UAAkB,GAC7B,MAAM,CAER;AAED,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,SAAK,GAAG,MAAM,CAcnE"}
|
package/dist/site-url.js
CHANGED
|
@@ -41,6 +41,9 @@ export function toPublicPath(outputPath, baseUrl = "", prettyUrls = false) {
|
|
|
41
41
|
}
|
|
42
42
|
return `${prefix}${withSlash}`;
|
|
43
43
|
}
|
|
44
|
+
if (prettyUrls === "strip" && cleanOutputPath.endsWith(".html")) {
|
|
45
|
+
return `${prefix}${cleanOutputPath.slice(0, -(".html".length))}`;
|
|
46
|
+
}
|
|
44
47
|
return `${prefix}${cleanOutputPath}`;
|
|
45
48
|
}
|
|
46
49
|
export function toAbsoluteUrl(publicPath, siteUrl) {
|
|
@@ -1593,3 +1593,247 @@ h1[id], h2[id], h3[id], h4[id], h5[id], h6[id] {
|
|
|
1593
1593
|
color: rgb(var(--color-gray-500));
|
|
1594
1594
|
font-size: 0.8125rem;
|
|
1595
1595
|
}
|
|
1596
|
+
|
|
1597
|
+
/* ── Godoc rendering ─────────────────────────────────────────────── */
|
|
1598
|
+
|
|
1599
|
+
#sourcey .godoc-import,
|
|
1600
|
+
#sourcey .godoc-import-path {
|
|
1601
|
+
font-size: 0.8125rem;
|
|
1602
|
+
color: rgb(var(--color-gray-500));
|
|
1603
|
+
margin: 0.25rem 0 1.5rem;
|
|
1604
|
+
}
|
|
1605
|
+
|
|
1606
|
+
#sourcey .godoc-import code,
|
|
1607
|
+
#sourcey .godoc-import-path code {
|
|
1608
|
+
font-family: var(--font-mono);
|
|
1609
|
+
background: rgba(var(--color-gray-100), 0.6);
|
|
1610
|
+
padding: 0.125rem 0.375rem;
|
|
1611
|
+
border-radius: 3px;
|
|
1612
|
+
}
|
|
1613
|
+
|
|
1614
|
+
#sourcey .godoc-source {
|
|
1615
|
+
margin: -0.25rem 0 0.625rem;
|
|
1616
|
+
font-size: 0.75rem;
|
|
1617
|
+
color: rgb(var(--color-gray-500));
|
|
1618
|
+
}
|
|
1619
|
+
|
|
1620
|
+
#sourcey .godoc-source a {
|
|
1621
|
+
color: inherit;
|
|
1622
|
+
text-decoration: none;
|
|
1623
|
+
}
|
|
1624
|
+
|
|
1625
|
+
#sourcey .godoc-source a:hover {
|
|
1626
|
+
color: rgb(var(--color-primary-ink));
|
|
1627
|
+
}
|
|
1628
|
+
|
|
1629
|
+
#sourcey .godoc-toc {
|
|
1630
|
+
margin: 1.5rem 0 2.5rem;
|
|
1631
|
+
padding: 0.875rem 1rem;
|
|
1632
|
+
border: 1px solid rgb(var(--color-gray-200));
|
|
1633
|
+
border-radius: 6px;
|
|
1634
|
+
background: rgba(var(--color-gray-50), 0.5);
|
|
1635
|
+
}
|
|
1636
|
+
|
|
1637
|
+
#sourcey .godoc-toc h4 {
|
|
1638
|
+
margin: 0 0 0.5rem;
|
|
1639
|
+
font-size: 0.6875rem;
|
|
1640
|
+
font-weight: 700;
|
|
1641
|
+
text-transform: uppercase;
|
|
1642
|
+
letter-spacing: 0.04em;
|
|
1643
|
+
color: rgb(var(--color-gray-500));
|
|
1644
|
+
}
|
|
1645
|
+
|
|
1646
|
+
#sourcey .godoc-toc ul {
|
|
1647
|
+
list-style: none;
|
|
1648
|
+
margin: 0;
|
|
1649
|
+
padding: 0;
|
|
1650
|
+
font-size: 0.8125rem;
|
|
1651
|
+
}
|
|
1652
|
+
|
|
1653
|
+
#sourcey .godoc-toc li {
|
|
1654
|
+
margin: 0.125rem 0;
|
|
1655
|
+
}
|
|
1656
|
+
|
|
1657
|
+
#sourcey .godoc-toc li.godoc-toc-sub {
|
|
1658
|
+
padding-left: 1rem;
|
|
1659
|
+
font-family: var(--font-mono);
|
|
1660
|
+
font-size: 0.75rem;
|
|
1661
|
+
color: rgb(var(--color-gray-600));
|
|
1662
|
+
}
|
|
1663
|
+
|
|
1664
|
+
#sourcey .godoc-toc a {
|
|
1665
|
+
color: inherit;
|
|
1666
|
+
text-decoration: none;
|
|
1667
|
+
border-bottom: 1px dotted transparent;
|
|
1668
|
+
}
|
|
1669
|
+
|
|
1670
|
+
#sourcey .godoc-toc a:hover {
|
|
1671
|
+
color: rgb(var(--color-primary));
|
|
1672
|
+
border-bottom-color: currentColor;
|
|
1673
|
+
}
|
|
1674
|
+
|
|
1675
|
+
#sourcey .godoc-symbol {
|
|
1676
|
+
font-family: var(--font-mono);
|
|
1677
|
+
font-size: 0.95rem;
|
|
1678
|
+
font-weight: 600;
|
|
1679
|
+
margin: 1.75rem 0 0.5rem;
|
|
1680
|
+
color: rgb(var(--color-gray-900));
|
|
1681
|
+
scroll-margin-top: 5rem;
|
|
1682
|
+
}
|
|
1683
|
+
|
|
1684
|
+
#sourcey .godoc-doc {
|
|
1685
|
+
margin: 0.5rem 0 0.75rem;
|
|
1686
|
+
color: rgb(var(--color-gray-700));
|
|
1687
|
+
font-size: 0.9375rem;
|
|
1688
|
+
line-height: 1.65;
|
|
1689
|
+
}
|
|
1690
|
+
|
|
1691
|
+
#sourcey .godoc-doc p:first-child {
|
|
1692
|
+
margin-top: 0;
|
|
1693
|
+
}
|
|
1694
|
+
|
|
1695
|
+
#sourcey .godoc-doc p:last-child {
|
|
1696
|
+
margin-bottom: 0;
|
|
1697
|
+
}
|
|
1698
|
+
|
|
1699
|
+
#sourcey .godoc-value,
|
|
1700
|
+
#sourcey .godoc-func,
|
|
1701
|
+
#sourcey .godoc-type {
|
|
1702
|
+
margin: 1rem 0 1.5rem;
|
|
1703
|
+
scroll-margin-top: 5rem;
|
|
1704
|
+
}
|
|
1705
|
+
|
|
1706
|
+
#sourcey .godoc-type {
|
|
1707
|
+
border-top: 1px solid rgb(var(--color-gray-200));
|
|
1708
|
+
padding-top: 1.25rem;
|
|
1709
|
+
margin-top: 2rem;
|
|
1710
|
+
}
|
|
1711
|
+
|
|
1712
|
+
#sourcey .godoc-anchor {
|
|
1713
|
+
display: block;
|
|
1714
|
+
height: 0;
|
|
1715
|
+
scroll-margin-top: 5rem;
|
|
1716
|
+
}
|
|
1717
|
+
|
|
1718
|
+
#sourcey .godoc-fields {
|
|
1719
|
+
margin: 0.75rem 0 1rem;
|
|
1720
|
+
padding: 0;
|
|
1721
|
+
border: 1px solid rgb(var(--color-gray-200));
|
|
1722
|
+
border-radius: 6px;
|
|
1723
|
+
background: rgba(var(--color-gray-50), 0.4);
|
|
1724
|
+
}
|
|
1725
|
+
|
|
1726
|
+
#sourcey .godoc-fields > summary {
|
|
1727
|
+
cursor: pointer;
|
|
1728
|
+
padding: 0.5rem 0.875rem;
|
|
1729
|
+
font-size: 0.75rem;
|
|
1730
|
+
font-weight: 600;
|
|
1731
|
+
text-transform: uppercase;
|
|
1732
|
+
letter-spacing: 0.04em;
|
|
1733
|
+
color: rgb(var(--color-gray-600));
|
|
1734
|
+
list-style: none;
|
|
1735
|
+
}
|
|
1736
|
+
|
|
1737
|
+
#sourcey .godoc-fields > summary::-webkit-details-marker {
|
|
1738
|
+
display: none;
|
|
1739
|
+
}
|
|
1740
|
+
|
|
1741
|
+
#sourcey .godoc-fields > ul {
|
|
1742
|
+
list-style: none;
|
|
1743
|
+
margin: 0;
|
|
1744
|
+
padding: 0;
|
|
1745
|
+
border-top: 1px solid rgb(var(--color-gray-200));
|
|
1746
|
+
}
|
|
1747
|
+
|
|
1748
|
+
#sourcey .godoc-field {
|
|
1749
|
+
padding: 0.625rem 0.875rem;
|
|
1750
|
+
border-bottom: 1px solid rgb(var(--color-gray-200));
|
|
1751
|
+
font-size: 0.875rem;
|
|
1752
|
+
}
|
|
1753
|
+
|
|
1754
|
+
#sourcey .godoc-field:last-child {
|
|
1755
|
+
border-bottom: none;
|
|
1756
|
+
}
|
|
1757
|
+
|
|
1758
|
+
#sourcey .godoc-field-sig {
|
|
1759
|
+
font-family: var(--font-mono);
|
|
1760
|
+
font-size: 0.8125rem;
|
|
1761
|
+
font-weight: 600;
|
|
1762
|
+
color: rgb(var(--color-gray-900));
|
|
1763
|
+
background: transparent;
|
|
1764
|
+
padding: 0;
|
|
1765
|
+
}
|
|
1766
|
+
|
|
1767
|
+
#sourcey .godoc-field-type {
|
|
1768
|
+
font-weight: 400;
|
|
1769
|
+
color: rgb(var(--color-gray-700));
|
|
1770
|
+
}
|
|
1771
|
+
|
|
1772
|
+
#sourcey .godoc-tag {
|
|
1773
|
+
font-family: var(--font-mono);
|
|
1774
|
+
font-size: 0.75rem;
|
|
1775
|
+
color: rgb(var(--color-gray-500));
|
|
1776
|
+
background: transparent;
|
|
1777
|
+
padding: 0;
|
|
1778
|
+
margin-left: 0.5rem;
|
|
1779
|
+
}
|
|
1780
|
+
|
|
1781
|
+
#sourcey .godoc-field-doc {
|
|
1782
|
+
margin-top: 0.25rem;
|
|
1783
|
+
font-size: 0.8125rem;
|
|
1784
|
+
color: rgb(var(--color-gray-600));
|
|
1785
|
+
line-height: 1.55;
|
|
1786
|
+
}
|
|
1787
|
+
|
|
1788
|
+
#sourcey .godoc-example {
|
|
1789
|
+
margin: 0.75rem 0 1.25rem;
|
|
1790
|
+
padding: 0;
|
|
1791
|
+
border: 1px solid rgb(var(--color-gray-200));
|
|
1792
|
+
border-radius: 6px;
|
|
1793
|
+
background: rgba(var(--color-gray-50), 0.4);
|
|
1794
|
+
}
|
|
1795
|
+
|
|
1796
|
+
#sourcey .godoc-example > summary {
|
|
1797
|
+
cursor: pointer;
|
|
1798
|
+
padding: 0.5rem 0.875rem;
|
|
1799
|
+
font-size: 0.75rem;
|
|
1800
|
+
font-weight: 600;
|
|
1801
|
+
text-transform: uppercase;
|
|
1802
|
+
letter-spacing: 0.04em;
|
|
1803
|
+
color: rgb(var(--color-gray-600));
|
|
1804
|
+
list-style: none;
|
|
1805
|
+
}
|
|
1806
|
+
|
|
1807
|
+
#sourcey .godoc-example > summary::-webkit-details-marker {
|
|
1808
|
+
display: none;
|
|
1809
|
+
}
|
|
1810
|
+
|
|
1811
|
+
#sourcey .godoc-example > summary::before {
|
|
1812
|
+
content: "▸ ";
|
|
1813
|
+
color: rgb(var(--color-gray-400));
|
|
1814
|
+
margin-right: 0.25rem;
|
|
1815
|
+
}
|
|
1816
|
+
|
|
1817
|
+
#sourcey .godoc-example[open] > summary::before {
|
|
1818
|
+
content: "▾ ";
|
|
1819
|
+
}
|
|
1820
|
+
|
|
1821
|
+
#sourcey .godoc-example > pre,
|
|
1822
|
+
#sourcey .godoc-example > .godoc-doc,
|
|
1823
|
+
#sourcey .godoc-example > p {
|
|
1824
|
+
margin: 0.5rem 0.875rem;
|
|
1825
|
+
}
|
|
1826
|
+
|
|
1827
|
+
#sourcey .godoc-example-output-label {
|
|
1828
|
+
margin: 0.5rem 0.875rem 0;
|
|
1829
|
+
font-size: 0.6875rem;
|
|
1830
|
+
font-weight: 700;
|
|
1831
|
+
text-transform: uppercase;
|
|
1832
|
+
letter-spacing: 0.04em;
|
|
1833
|
+
color: rgb(var(--color-gray-500));
|
|
1834
|
+
}
|
|
1835
|
+
|
|
1836
|
+
#sourcey .godoc-func .godoc-symbol,
|
|
1837
|
+
#sourcey .godoc-type .godoc-symbol {
|
|
1838
|
+
word-break: break-word;
|
|
1839
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sourcey",
|
|
3
|
-
"version": "3.5.
|
|
4
|
-
"description": "Precision documentation from OpenAPI, MCP, Doxygen, and Markdown. Static HTML you own.",
|
|
3
|
+
"version": "3.5.3",
|
|
4
|
+
"description": "Precision documentation from OpenAPI, MCP, Doxygen, godoc, and Markdown. Static HTML you own.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
7
7
|
"node": ">=20"
|
|
@@ -20,13 +20,16 @@
|
|
|
20
20
|
"LICENSE"
|
|
21
21
|
],
|
|
22
22
|
"scripts": {
|
|
23
|
-
"build": "tsc && cp -r src/themes dist/ && cp src/client/*.js dist/client/ && cp -r src/og/fonts dist/og/",
|
|
23
|
+
"build": "tsc && cp -r src/themes dist/ && cp src/client/*.js dist/client/ && cp -r src/og/fonts dist/og/ && rm -rf dist/core/sourcey-godoc dist/core/godoc-introspect && mkdir -p dist/core/sourcey-godoc && cp -R go/sourcey-godoc/go.mod go/sourcey-godoc/doc.go go/sourcey-godoc/cmd dist/core/sourcey-godoc/",
|
|
24
24
|
"watch": "npm run build && tsc --watch --preserveWatchOutput",
|
|
25
25
|
"test": "vitest run",
|
|
26
26
|
"test:watch": "vitest",
|
|
27
27
|
"lint": "eslint src/ test/",
|
|
28
28
|
"lint:fix": "eslint src/ test/ --fix",
|
|
29
29
|
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
|
|
30
|
+
"godoc:go:test": "cd go/sourcey-godoc && go test ./...",
|
|
31
|
+
"godoc:go:vet": "cd go/sourcey-godoc && go vet ./...",
|
|
32
|
+
"godoc:packages:test": "packaging/sourcey-godoc/render-package-managers.test.sh",
|
|
30
33
|
"typecheck": "tsc --noEmit",
|
|
31
34
|
"prepublishOnly": "npm run build"
|
|
32
35
|
},
|
|
@@ -72,7 +75,14 @@
|
|
|
72
75
|
"markdown",
|
|
73
76
|
"api-docs",
|
|
74
77
|
"developer-documentation",
|
|
75
|
-
"doxygen"
|
|
78
|
+
"doxygen",
|
|
79
|
+
"godoc",
|
|
80
|
+
"golang",
|
|
81
|
+
"go-docs",
|
|
82
|
+
"go-documentation",
|
|
83
|
+
"mcp",
|
|
84
|
+
"llms-txt",
|
|
85
|
+
"static-docs"
|
|
76
86
|
],
|
|
77
87
|
"funding": {
|
|
78
88
|
"url": "https://sourcey.com"
|