Skip to content

TechFides/tf-doc-vault

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

194 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TechFides

Free from TechFides ❤️

Let's develop the future.

techfides.cz · team.techfides.cz · techfides.eu


@techfides/tf-doc-vault

Shared VitePress tooling for technical and analytical documentation.
Spin up a fully-featured documentation site in under 5 minutes.

npm downloads license node CI

Warning

Preview release — 0.x. This package is under active development. The public API (CLI commands, exported functions, template structure, and config shape) may change between minor versions until the 1.0.0 release. Pin an exact version in production ("@techfides/tf-doc-vault": "0.1.5", not "^0.1.5") and review the CHANGELOG before upgrading.


Why this package exists

Every documentation project needs a similar boilerplate: a VitePress configuration, a versioned sidebar, shared UI components, a CI/CD pipeline, Docker images, and Terraform infrastructure. Setting all of that up from scratch for each project takes long time and produces subtly divergent configurations that are hard to maintain.

@techfides/tf-doc-vault solves this once and shares the solution across all projects. The core idea is factory functions over copied files: consumer repos call makeConfig() and createTheme() — the package owns the implementation, so updates propagate automatically.

What the package includes

Module Purpose
config makeConfig() — complete VitePress config with locales, versioned nav, sidebar, i18n, Mermaid, optional analytics and edit links.
theme createTheme() — shared Vue 3 components: DocMeta, ImageLightbox, PrintLayout, VersionSwitcher, optional WidthToggle.
sidebar Auto-generates nav and sidebar from the docs/<version>/<section>/<group>/ directory structure — no manual config.
scripts CLI commands: validate, normalize, build print page, export to PDF, fix line endings, sync template.
setup/nest setupTechDocs() — NestJS middleware that mounts tech-docs/dist/ at /tech-docs with Basic auth.
setup/express createTechDocsHandler() — same for plain Express.
configs Shared eslint.config.js, prettier.json, tsconfig.base.json for consumer repos to extend.
infra/terraform Reusable GCP module: Cloud Run + Artifact Registry + IAM.
docker Multi-stage Dockerfile with nginx / nginx-auth runtime variants.
template Skeleton repo used by the scaffolder (create command).

Quick start

You don't wire this up by hand — scaffold the flavour you need, then start writing Markdown:

  • Standalone analysis / spec site (its own repo, deployed to Cloud Run):

    pnpm dlx @techfides/tf-doc-vault@latest create my_analysis --gcp-project=tfsa-my-analysis --server=nginx

    Full guide → Analytical documentation

  • Docs inside an existing service (served by the app at /tech-docs):

    pnpm exec tf-doc-vault init-tech-docs --service-id=TST --project=my-service

    Full guide → Technical documentation

  • Migrating from Confluence?Import from Confluence

Configuration

Scaffolding generates the VitePress wiring for you. To customize a site afterwards, edit the two factory calls it writes:

docs/.vitepress/config.ts

import { makeConfig } from "@techfides/tf-doc-vault/config";

export default makeConfig({
  configDir: import.meta.dirname,
  project: "lapa",
  // optional: analytics, editLink, branding, sectionNav, mermaid, …
  analytics: { provider: "umami", websiteId: "...", domain: "..." },
  editLink: { repo: "techfides/tf-analysis/lapa_ana", branch: "master" },
});

docs/.vitepress/theme/index.ts

import { createTheme } from "@techfides/tf-doc-vault/theme";
import "./custom.css"; // overrides on top of base CSS

export default createTheme({ widthToggle: true });

Installing via a git URL? Add "pnpm": { "onlyBuiltDependencies": ["@techfides/tf-doc-vault"] } to the consumer package.json, or pnpm 10 skips the prepare hook and dist/ is never built. (The scaffolders already set this for you.)

To rebrand (colors, logo, fonts, footer) for a non-TechFides project, see BRANDING.md.


Documentation

Task-focused guides live in docs/:

Guide What it covers
Technical documentation (tech-docs) Mount docs inside a service repo, served at /tech-docs with Basic auth (init-tech-docs).
Analytical documentation (*_ana) Standalone analysis docs scaffolded by create, deployed to Cloud Run — including nginx-auth and syncing the template.
Import from Confluence Migrate a Confluence space into Markdown (import-confluence).
Editing & publishing docs The day-to-day edit → preview → validate → publish loop.
Testing How the package itself is tested (unit + smoke).

Contributing & local development

Setup, the playground hot-reload workflow, the file:-consumer flow, and the release process are in CONTRIBUTING.md.

Changelog

See CHANGELOG.md for release notes.

About

Shared VitePress tooling for technical and analytical documentation — CLI scaffolder, theme, Confluence import, Express/NestJS middleware, Docker and Terraform infra.

Topics

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors