Skip to content

Dev#1

Merged
Vidigal-code merged 21 commits into
mainfrom
dev
Jun 15, 2026
Merged

Dev#1
Vidigal-code merged 21 commits into
mainfrom
dev

Conversation

@Vidigal-code

Copy link
Copy Markdown
Owner

No description provided.

… icon key

When gitpagedocs/config.json is partial or predates a new icon slot, the
affected resolver computed useReactIcon via Boolean(site.Icon*ReactIcones),
which is false for a missing key. That rendered the broken default image
placeholder instead of the canonical react-icon.

Resolvers now use `site.Icon*ReactIcones ?? !rawImage`: an explicit flag is
still respected, but when the key is absent and no custom image is set, the
default react-icon tag is used (the same icon a complete config.json ships).

Covers ai-chat (10 slots), nav-menu factory, header, route-guide and
audio-popover close/icons resolvers.
…s install

The published @gitpagedocs/cli@1.1.45 and @gitpagedocs/mcp@1.1.44 carried
`@gitpagedocs/tools: workspace:*` / `@gitpagedocs/mcp: workspace:*` in their
dependencies, because they were released with `npm publish`, which (unlike
`pnpm publish`) does not rewrite the `workspace:` protocol. Installing them
then failed with EUNSUPPORTEDPROTOCOL "Unsupported URL Type workspace:".

Replace the internal `workspace:*` deps in cli and mcp with plain semver
ranges (^1.1.47) so the published artifact resolves on npm no matter which
tool publishes it. A root .npmrc with link-workspace-packages keeps pnpm
linking the in-repo packages locally during development despite the ranges.

Bump tools, mcp and cli to 1.1.47 for a clean coordinated re-release
(publish order: tools -> mcp -> cli).
`node --import tsx` resolved the bare "tsx" specifier relative to the current
working directory. When the CLI is installed globally and run from a project
that has no local tsx (e.g. a fresh docs repo), this failed with
ERR_MODULE_NOT_FOUND "Cannot find package 'tsx' imported from <cwd>".

Resolve tsx via import.meta.resolve (relative to cli/index.mjs, where tsx is a
real dependency) and pass the absolute URL to --import, so the loader is found
regardless of the working directory. Falls back to the bare specifier on older
Node without a stable import.meta.resolve.
The published 1.1.47 was cut before the tsx bootstrap fix landed, so its
index.mjs still resolves the bare "tsx" specifier from the cwd and crashes
with ERR_MODULE_NOT_FOUND on a global run. npm forbids overwriting 1.1.47,
so re-release the CLI as 1.1.48 (tools/mcp 1.1.47 are unaffected). Internal
deps stay ^1.1.47.
…repositorySearchHome to false

- Replace the broken IoClose fallback with IoMdClose everywhere (ai-chat
  open/close resolver, audio-popover close, nav-menu close + mobile close,
  and the ai-chat-drawer render fallback). IoClose is not exported by
  react-icons/io, so the fallback rendered nothing; config.json uses IoMdClose.
- Give the header icon a FaGithubAlt fallback (matching config.json) instead of
  an undefined tag when the key is absent, including the no-site branch.
- CLI root-config-builder now emits repositorySearchHome: false by default, and
  the bundled gitpagedocs/config.json is updated to match.

The fallback tags now mirror exactly what a complete config.json ships.
Coordinated release so the icon/config fixes and the tsx-resolution fix ship
together. Internal deps now reference ^1.1.48 (tools, mcp).
Running `gitpagedocs deploy` (or `--push`) without --owner/--repo threw
"`--push` requires owner and repo". In an interactive TTY it now prompts for
them via @clack/prompts, pre-filling from the git `origin` remote when one
exists (detectRepoFromGit). In CI / non-TTY the existing hard error still
guards, so automated pipelines fail fast instead of hanging on a prompt.
1.1.49 was already published to npm before the interactive deploy prompt
landed, and npm versions are immutable. Re-release all three at 1.1.50 so the
deploy/--push owner+repo prompt ships. Internal deps reference ^1.1.50.
…ashing

Extends the deploy/--push interactive recovery so missing prerequisites prompt
(in a TTY) rather than throwing the same class of error as the owner/repo case:

- Offer `git init` when the folder is not a git repository (ensureGitRepoInteractive),
  covering both the prompted path and runs where owner/repo came from flags.
- `pages actions` and `pages deploy` now prompt for owner/repo when they can't be
  detected from the git remote, instead of printing a dead-end message.
- Share one askOwnerRepo helper between the legacy deploy prompt and the pages verbs.
- Fix the `pages deploy` bin path (pkgRoot is already cli/, so spawn cli/index.mjs).

CI/non-TTY keeps the explicit guards (no hangs); verified deploy still fails fast
without a TTY.
…tic)

Add deriveDocAccessKeys + verifyDocAccess in crypto/doc-access.ts: privateKey =
sha256(password), publicKey = sha256(privateKey). verifyDocAccess unlocks with
the password (double hash) or the private key (single hash). Pure, depends only
on a { sha256 } service, with a local constant-time hexEqual (no node:crypto) so
it is safe to bundle for the browser. Re-exported from crypto/index.ts (node) and
crypto/web.ts (browser).
…tion

- New interactive `password` command (run-command REGISTRY): type + confirm a
  password (masked via a new askPassword clack wrapper), derive the double-hash
  keys, write the PUBLIC key into gitpagedocs/config.json via a new
  GitPageDocsConfigRepository (raw-JSON patch that preserves every other key),
  and print the PRIVATE key to copy. Guards non-TTY so it never hangs.
- Generate the gate defaults: site.docsAccess = { enabled:false, publicKey:"" },
  an IconDocsLock* icon block (FiLock), and the full gate/lock/block-popup +
  previously-inline aiChat* langmenu keys in pt/en/es. repositorySearchHome stays
  false.
…config

- New features/docs-access slice: useDocsAccess state machine (loading/locked/
  unlocked) backed by localStorage (caches only the public hash, re-verified
  against config on load), a full-page DocsAccessGate, and a DocsLockButton that
  re-locks via the shared ConfirmPopup. Unlock accepts the password OR the
  private key via @gitpagedocs/tools/crypto/web verifyDocAccess.
- docs-shell renders the gate (after all hooks) when locked, and a sidebar lock
  button when enabled; backward compatible (disabled/empty publicKey ⇒ docs open).
- Reuse the nav-menu icon resolver factory for the docsLock icon; add docsAccess
  + IconDocsLock* to the SiteConfig type and the new labels to use-docs-shell-labels.
- Move remaining hardcoded chat strings ("arquivo(s) anexado(s)", "Remover",
  "Cancelar Resposta", Save & Start button) to config-driven labels (en/pt/es).
Regenerate gitpagedocs/config.json with the docsAccess block, IconDocsLock* and
the new gate/chatbot langmenu keys (en/pt/es); refresh the smoke baseline
snapshot to match. Bump tools, mcp and cli to 1.1.51 (internal deps ^1.1.51).
Teach the AI generator what gitpagedocs is and emit wired, versioned pages instead of
one flat markdown blob: a gitpagedocs-aware system prompt + parseable multi-page format,
a page parser (docs-pattern.ts), and a version-docs writer that writes pages into
gitpagedocs/docs/versions/<latest>/<lang>/<slug>.md and patches the version config.json
(routes-md + menus-header-md, reusing buildMdRoute, tagged aiGenerated + idempotent).
The AI flow scaffolds the base structure first so the config exists before patching.
…aged regions

- Add `ai` and `password` to CLI_COMMANDS (tools sections) and refresh the managed
  regions of README/CONTRIBUTING/SECURITY via `gitpagedocs docs`.
- README + cli/README: document `gitpagedocs password` (docs access gate) and that
  `gitpagedocs ai` now writes wired, versioned pages in the gitpagedocs pattern.
- frontend/README: document the documentation access gate (features/docs-access).
Bump tools/mcp/cli to 1.1.52 (internal deps ^1.1.52). Regenerate the smoke baseline
snapshot — the source-viewer embeds the project source, which changed with the new
AI-pattern modules.
The header control icons (project link, version links, info, preview, audio
play/pause) read their react-icon tag straight from config.json with no fallback,
so a config missing those keys rendered nothing. Default each to the same tag a
complete config ships: FaGithubAlt, FaCodeBranch, BsInfoSquareFill, CiGlobe,
CiPlay1, FaPause. (ai-chat, nav-menu, header, audio-popover and docs-lock
fallbacks already match config.)

Docs: note the doc-access crypto helper (deriveDocAccessKeys / verifyDocAccess) in
tools/README and refresh the README managed region.
…nt icons + langmenu

Old gitpagedocs/config.json files lack newer `site` fields, which broke header
control icons (the Icon*ReactIcones boolean gates defaulted to false, so the
React icon and its inline tag fallback never rendered) and the AI chat en/pt/es
language (missing langmenu fell back to English-only, and defaultLanguage/
supportedLanguages were absent).

Deep-merge the loaded config's `site` UNDER a baseline generated from the
canonical config.json, so any missing field inherits the exact shipped value
instead of rendering empty/github-only. Only `site` is merged; routes, menus,
auth and VersionControl come from the loaded config untouched.

- tools/gen-site-baseline.mjs: regenerates site-baseline.json from config.json
  (single source of truth; wired into `baseline:create` + `baseline:site`)
- frontend/src/entities/docs/lib/with-config-defaults.ts: deep-merge util
- applied at both load chokepoints: resolveDocsSource + loadRemoteDocsData

Verified by building from a stripped (282 site keys removed) config: the static
export still emits the correct distinct icons (FaCodeBranch, BsInfoSquareFill,
CiGlobe, ...) and the full pt/es langmenu, all sourced from the baseline.
…ions for old configs, bump to 1.1.53

Layouts:
- New VSCode Dark+ and Light+ themed layouts (vscode-1 pair) registered in the
  CLI (cli/data/layouts.mjs + theme-colors.mjs) with authentic editor palettes.
  Regenerated gitpagedocs/layouts (layoutsConfig + vscode templates).

Old-config fallback fix:
- withConfigDefaults now also deep-merges the top-level `translations` section
  (navigation/footer/notFound en/pt/es), not just `site`. Old config.json files
  missing `translations` were rendering prev/next/menu/footer labels in English
  only; they now inherit the baseline pt/es text.
- gen-site-baseline.mjs emits translations-baseline.json alongside site-baseline.json.
- Verified by building from a config stripped of `translations` + `langmenu`:
  the static export still emits pt/es nav labels (Voltar/Proximo/Siguiente/...).

Release:
- Bump @gitpagedocs/cli, /mcp, /tools to 1.1.53 (+ interdeps), refresh pnpm-lock.
- Regenerate complete default documentation + baseline snapshot.
@Vidigal-code Vidigal-code merged commit cbd3d0a into main Jun 15, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant