@gitpagedocs/tools 0.0.7 → 0.0.9

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitpagedocs/tools",
3
- "version": "0.0.7",
3
+ "version": "0.0.9",
4
4
  "type": "module",
5
5
  "description": "Shared business-logic core for Git Page Docs (consumed by frontend, cli and mcp). Ships TypeScript source; consume via tsx or a TS-aware bundler.",
6
6
  "main": "./src/index.ts",
@@ -19,6 +19,7 @@ export const ROUTE_LIST_KEYS = [
19
19
  "routes-html",
20
20
  "routes-video",
21
21
  "routes-audio",
22
+ "routes-pdf",
22
23
  "routes",
23
24
  ] as const;
24
25
 
@@ -31,7 +31,35 @@ export interface CommandDoc {
31
31
  /** Markdown list of CLI commands. */
32
32
  export function cliCommandsSection(commands: readonly CommandDoc[]): string {
33
33
  const items = commands.map((c) => `- \`gitpagedocs ${c.name}\` — ${c.summary}`);
34
- return ["### CLI commands", "", ...items].join("\n");
34
+ return [
35
+ "### CLI commands",
36
+ "",
37
+ ...items,
38
+ "",
39
+ "### User references",
40
+ "",
41
+ "The generated versioned documentation includes dedicated pages for configuration, CLI, MCP, recursive navigation, focus mode, accessibility/narration, PDF documents, deployment, architecture, themes and troubleshooting. Each page is available in English, Portuguese and Spanish; Markdown filenames stay in English across languages.",
42
+ "",
43
+ "Configure language, theme, focus and Ctrl+K control icons through `gitpagedocs/config.json` → `site.icons`. Set `reactIcon` independently on `LanguageSelector`, `ThemeSelector`, `FocusMode` and `QuickNavigation`; `false` keeps the text controls. Customize `tag`, `size`, `colorDark` and `colorLight` per entry.",
44
+ "",
45
+ "`site.nestedMenusEnabled` selects recursive or flat navigation. Breadcrumbs use `RouteGuide` with route > version defaults > site precedence. `site.FocusMode` enables reading mode; `site.focusMode` controls copy, download, section navigation and document navigation independently.",
46
+ "",
47
+ "`site.accessibility.narration` configures native browser reading. Voices and offline availability depend on the browser and operating system. `site.mediaExclusivePlayback` coordinates narration, radio, audio and video so only one audible source plays by default.",
48
+ "",
49
+ "See [the MCP reference](mcp/README.md) for installation, client configuration, all 20 tools, all 7 resources, provider variables and limits. Start with `gitpagedocs mcp start` from the target project; on a source checkout the direct entry is `node --import tsx mcp/src/bin.ts`.",
50
+ "",
51
+ "### PDF documents",
52
+ "",
53
+ "Read or download the [GitPageDocs project guide (PDF, English)](cli/content/assets/gitpagedocs-project-guide.pdf). The CLI includes this real PDF in each generated version under `en/gitpagedocs-project-guide.pdf`; the example route points all three languages to the English document.",
54
+ "",
55
+ "Configure `site.pdf` with `enabled`, `previewEnabled`, `downloadEnabled` and `openInNewTabEnabled` (all default to `true`). The version config uses `routes-pdf`, `pdf.pathPdf` per language and `menus-header-pdf` with `page:23` for the bundled example. Route-level preview/download/new-tab options go inside `pdf`; `hierarchyPage.pdf` and `hierarchyMenu.pdf` order the content and menu sections.",
56
+ "",
57
+ "```json",
58
+ '{ "id": 23, "pdf": { "pathPdf": { "en": "gitpagedocs/docs/versions/0.0.9/en/gitpagedocs-project-guide.pdf", "pt": "gitpagedocs/docs/versions/0.0.9/en/gitpagedocs-project-guide.pdf", "es": "gitpagedocs/docs/versions/0.0.9/en/gitpagedocs-project-guide.pdf" }, "previewEnabled": true, "downloadEnabled": true, "openInNewTabEnabled": true } }',
59
+ "```",
60
+ "",
61
+ "The native browser viewer handles PDF previews through temporary Blob URLs after the file signature is validated. Both preview and download require CORS permission when the file comes from another origin. The new-tab link opens the original URL directly, where browser support and the server's Content-Type/Content-Disposition can cause a download instead of inline display. Next.js dev/build stages repository PDFs from `gitpagedocs/` into public assets and respects the Pages subpath; other local files must be in `frontend/public/`. See the generated PDF documents page for complete site, route and menu examples.",
62
+ ].join("\n");
35
63
  }
36
64
 
37
65
  /** Markdown block documenting the monorepo dev workflow (deterministic). */
@@ -42,9 +70,9 @@ export function devWorkflowSection(): string {
42
70
  ["pnpm run lint", "lint the project"],
43
71
  ["pnpm run test:unit", "run the Vitest unit/integration suite"],
44
72
  ["pnpm run test:cov", "unit tests with coverage"],
45
- ["pnpm run test:e2e", "Playwright frontend E2E"],
73
+ ["pnpm exec cross-env PORT=3100 pnpm run test:e2e", "Playwright frontend E2E on ports 3100 and 3101"],
46
74
  ["pnpm run smoke:all", "CLI/contract/tools/mcp regression wall"],
47
- ["pnpm run build", "build the static site"],
75
+ ["pnpm run build", "build the Next.js production runtime; Pages export additionally requires its build environment"],
48
76
  ];
49
77
  return [
50
78
  "### Development",
@@ -77,11 +105,13 @@ export const CLI_COMMANDS: readonly CommandDoc[] = [
77
105
  { name: "models [provider]", summary: "list catalog models" },
78
106
  { name: "ai", summary: "interactive AI docs generator (writes pages in the gitpagedocs pattern)" },
79
107
  { name: "chat [question]", summary: "streaming AI chat in the terminal (REPL on a TTY; one-shot with a question or piped stdin)" },
80
- { name: "document[:repo|:file|:folder]", summary: "generate documentation with AI in the gitpagedocs pattern" },
108
+ { name: "document[:repo|:file|:folder]", summary: "aliases of the interactive documentation generator; select input directories in its prompts" },
81
109
  { name: "password", summary: "set a documentation access password (writes the public key to config.json)" },
82
110
  { name: "config clear", summary: "delete the stored .gitpagedocsconfig and the encrypted key vault" },
83
111
  { name: "docs", summary: "refresh the managed regions of README, CONTRIBUTING and SECURITY" },
84
112
  { name: "deploy | pages", summary: "configure GitHub Pages via Actions and push" },
113
+ { name: "pages actions", summary: "switch the repository's GitHub Pages source to GitHub Actions (no docs generation or push)" },
114
+ { name: "pages deploy", summary: "detect owner/repo, confirm, then generate, commit, push and print the site URL" },
85
115
  { name: "doctor", summary: "diagnose the environment" },
86
116
  { name: "mcp start", summary: "start the MCP server over stdio" },
87
117
  { name: "version", summary: "print the CLI version" },