From 6db8fca185336de4da612c15a95cc1a50bf5267e Mon Sep 17 00:00:00 2001 From: wehub-resource-sync Date: Mon, 13 Jul 2026 12:31:55 +0800 Subject: [PATCH] chore: import upstream snapshot with attribution --- .gitattributes | 2 + .github/CODE_OF_CONDUCT.md | 48 + .github/CONTRIBUTING.md | 85 + .github/FUNDING.yml | 15 + .github/ISSUE_TEMPLATE/bug_report.yml | 58 + .github/ISSUE_TEMPLATE/feature_request.yml | 27 + .github/PULL_REQUEST_TEMPLATE.md | 16 + .github/SECURITY.md | 18 + .github/dependabot.yml | 44 + .github/workflows/ci.yml | 40 + .github/workflows/docker-publish.yml | 219 + .github/workflows/npm-publish.yml | 180 + .gitignore | 40 + LICENSE | 21 + README.de.md | 286 ++ README.es.md | 286 ++ README.fr.md | 286 ++ README.ja.md | 286 ++ README.md | 286 ++ README.wehub.md | 7 + README.zh.md | 286 ++ assets/docmd-cover.webp | Bin 0 -> 52906 bytes docker/.dockerignore | 83 + docker/DOCKER.md | 236 + docker/Dockerfile | 185 + docker/docker-entrypoint.sh | 67 + docker/docker-healthcheck.sh | 12 + eslint-rules/index.js | 16 + eslint-rules/no-unsafe-fs-read.js | 103 + eslint-rules/require-verify-client.js | 43 + eslint.config.mjs | 63 + package.json | 93 + packages/_playground/.threads/authors.json | 10 + packages/_playground/docmd.config.json | 90 + .../docs-05/getting-started/installation.md | 1 + packages/_playground/docs-05/index.md | 34 + .../_playground/docs/.threads/authors.json | 6 + packages/_playground/docs/en/index.md | 111 + .../_playground/docs/en/mermaid-icon-test.md | 22 + packages/_playground/docs/en/nested-page-1.md | 14 + packages/_playground/docs/en/nested-page-2.md | 11 + .../docs/en/practical-tests/README.md | 51 + .../phase-2/container-parser-determinism.md | 80 + .../phase-2/f1-nested-grids.md | 71 + .../phase-2/f2-self-closing-button.md | 48 + .../phase-2/f3-mismatched-close.md | 53 + .../phase-2/f4-triple-close.md | 52 + .../phase-2/f5-five-level-nesting.md | 61 + .../practical-tests/phase-3/cli-exit-codes.md | 72 + .../internal-link-with-trailing-slash.md | 58 + .../phase-3/llms-and-okf-default-locale.md | 99 + .../phase-3/okf-bundle-default.md | 64 + .../phase-3/okf-type-inference.md | 70 + .../phase-3/xss-in-frontmatter.md | 71 + packages/_playground/docs/hi/index.md | 14 + .../hi/practical-tests/phase-2-f1-hindi.md | 40 + packages/_playground/netlify.toml | 27 + packages/_playground/package.json | 16 + packages/_playground/vercel.json | 25 + packages/api/LICENSE | 21 + packages/api/README.md | 27 + packages/api/package.json | 66 + packages/api/registry/plugins.generated.json | 205 + packages/api/scripts/copy-registry.mjs | 31 + packages/api/src/engine.ts | 238 + packages/api/src/hooks.ts | 975 ++++ packages/api/src/index.ts | 117 + packages/api/src/rpc.ts | 133 + packages/api/src/runtime-deps.ts | 363 ++ packages/api/src/source.ts | 449 ++ packages/api/src/types.ts | 738 +++ packages/api/tsconfig.json | 10 + packages/core/LICENSE | 21 + packages/core/README.md | 277 ++ packages/core/package.json | 80 + packages/core/src/bin/docmd.ts | 313 ++ packages/core/src/commands/build.ts | 420 ++ packages/core/src/commands/deploy.ts | 93 + packages/core/src/commands/dev.ts | 511 ++ packages/core/src/commands/doctor.ts | 329 ++ packages/core/src/commands/init.ts | 426 ++ packages/core/src/commands/live.ts | 37 + packages/core/src/commands/mcp.ts | 558 +++ packages/core/src/commands/migrate.ts | 676 +++ packages/core/src/commands/stop.ts | 182 + packages/core/src/commands/validate.ts | 64 + packages/core/src/engine/assets.ts | 133 + packages/core/src/engine/generator.ts | 837 ++++ packages/core/src/engine/i18n.ts | 456 ++ packages/core/src/engine/versioning.ts | 247 + packages/core/src/engine/worker-parser.ts | 170 + packages/core/src/engine/workspace.ts | 768 +++ packages/core/src/env.d.ts | 5 + packages/core/src/index.ts | 50 + packages/core/src/utils/auto-router.ts | 153 + packages/core/src/utils/config-loader.ts | 447 ++ packages/core/src/utils/config-schema.ts | 421 ++ packages/core/src/utils/dev-utils.ts | 257 + packages/core/src/utils/exit.ts | 94 + packages/core/src/utils/ws-origin-guard.ts | 62 + packages/core/tsconfig.json | 10 + packages/deployer/LICENSE | 21 + packages/deployer/README.md | 78 + packages/deployer/package.json | 50 + packages/deployer/src/context.ts | 24 + packages/deployer/src/index.ts | 99 + packages/deployer/src/providers/caddy.ts | 64 + packages/deployer/src/providers/docker.ts | 64 + .../deployer/src/providers/github-pages.ts | 80 + packages/deployer/src/providers/netlify.ts | 64 + packages/deployer/src/providers/nginx.ts | 81 + packages/deployer/src/providers/vercel.ts | 60 + packages/deployer/tsconfig.json | 10 + packages/engines/js/LICENSE | 21 + packages/engines/js/README.md | 39 + packages/engines/js/package.json | 51 + packages/engines/js/src/index.ts | 300 ++ packages/engines/js/tsconfig.json | 11 + packages/engines/rust-binaries/LICENSE | 21 + packages/engines/rust-binaries/README.md | 55 + .../bin/docmd-engine-darwin-arm64.node | Bin 0 -> 771536 bytes packages/engines/rust-binaries/build.js | 137 + .../engines/rust-binaries/native/Cargo.lock | 362 ++ .../engines/rust-binaries/native/Cargo.toml | 32 + .../engines/rust-binaries/native/build.rs | 17 + .../engines/rust-binaries/native/src/lib.rs | 236 + packages/engines/rust-binaries/package.json | 41 + packages/engines/rust/LICENSE | 21 + packages/engines/rust/README.md | 54 + packages/engines/rust/package.json | 56 + packages/engines/rust/scripts/postinstall.cjs | 118 + packages/engines/rust/src/index.ts | 155 + packages/engines/rust/tsconfig.json | 11 + packages/legacy/doc.md/LICENSE | 21 + packages/legacy/doc.md/README.md | 21 + packages/legacy/doc.md/bin/docmd.js | 24 + packages/legacy/doc.md/package.json | 47 + packages/legacy/mgks/LICENSE | 21 + packages/legacy/mgks/README.md | 21 + packages/legacy/mgks/bin/docmd.js | 24 + packages/legacy/mgks/package.json | 47 + packages/live/LICENSE | 21 + packages/live/README.md | 28 + packages/live/bin/docmd-live.js | 18 + packages/live/package.json | 68 + packages/live/src/browser-entry.ts | 132 + packages/live/src/build.ts | 188 + packages/live/src/docmd-live-preview.css | 56 + packages/live/src/docmd-live.css | 371 ++ packages/live/src/index.html | 233 + packages/live/src/index.ts | 178 + packages/live/src/shims.js | 15 + packages/live/src/shims.ts | 15 + packages/live/tsconfig.json | 10 + packages/parser/LICENSE | 21 + packages/parser/README.md | 13 + packages/parser/package.json | 66 + packages/parser/src/features/basics.ts | 43 + packages/parser/src/features/buttons.ts | 106 + packages/parser/src/features/changelog.ts | 163 + .../parser/src/features/common-containers.ts | 270 ++ packages/parser/src/features/embed.ts | 57 + packages/parser/src/features/hero.ts | 218 + packages/parser/src/features/index.ts | 35 + packages/parser/src/features/steps.ts | 128 + packages/parser/src/features/tabs.ts | 192 + packages/parser/src/features/tags.ts | 109 + packages/parser/src/html-renderer.ts | 84 + packages/parser/src/index.ts | 62 + packages/parser/src/markdown-processor.ts | 567 +++ packages/parser/src/utils/container-helper.ts | 35 + .../parser/src/utils/container-normaliser.ts | 314 ++ packages/parser/src/utils/icon-renderer.ts | 60 + .../parser/src/utils/navigation-helper.ts | 95 + packages/parser/src/utils/normalize-href.ts | 195 + packages/parser/src/utils/url-utils.ts | 294 ++ packages/parser/src/utils/validator.ts | 125 + .../parser/test/container-normaliser.test.js | 814 ++++ packages/parser/tsconfig.json | 10 + packages/plugins/analytics/LICENSE | 21 + packages/plugins/analytics/README.md | 24 + packages/plugins/analytics/package.json | 64 + packages/plugins/analytics/src/index.ts | 130 + packages/plugins/analytics/tsconfig.json | 10 + packages/plugins/git/LICENSE | 21 + packages/plugins/git/README.md | 17 + packages/plugins/git/build.js | 39 + packages/plugins/git/i18n/de.json | 13 + packages/plugins/git/i18n/en.json | 13 + packages/plugins/git/i18n/ko.json | 13 + packages/plugins/git/i18n/zh.json | 13 + packages/plugins/git/package.json | 76 + .../plugins/git/src/client/git-widget.css | 169 + packages/plugins/git/src/client/git-widget.js | 97 + packages/plugins/git/src/index.ts | 596 +++ packages/plugins/git/tsconfig.json | 21 + packages/plugins/installer/LICENSE | 21 + packages/plugins/installer/README.md | 20 + packages/plugins/installer/package.json | 52 + .../plugins/installer/registry/plugins.json | 81 + .../plugins/installer/src/config-editor.ts | 382 ++ packages/plugins/installer/src/index.ts | 559 +++ packages/plugins/installer/tsconfig.json | 10 + packages/plugins/llms/LICENSE | 21 + packages/plugins/llms/README.md | 25 + packages/plugins/llms/package.json | 60 + packages/plugins/llms/src/index.ts | 198 + packages/plugins/llms/tests/llms.test.js | 170 + packages/plugins/llms/tsconfig.json | 10 + packages/plugins/math/LICENSE | 21 + packages/plugins/math/README.md | 25 + packages/plugins/math/package.json | 61 + packages/plugins/math/src/index.ts | 50 + packages/plugins/math/tsconfig.json | 10 + packages/plugins/mermaid/LICENSE | 21 + packages/plugins/mermaid/README.md | 23 + packages/plugins/mermaid/package.json | 67 + packages/plugins/mermaid/src/client.ts | 271 ++ packages/plugins/mermaid/src/index.ts | 55 + packages/plugins/mermaid/src/svg-utils.ts | 24 + .../plugins/mermaid/tests/svg-utils.test.ts | 117 + packages/plugins/mermaid/tsconfig.json | 10 + packages/plugins/okf/LICENSE | 21 + packages/plugins/okf/README.md | 90 + packages/plugins/okf/package.json | 63 + packages/plugins/okf/src/content.ts | 100 + packages/plugins/okf/src/graph-assets.ts | 41 + packages/plugins/okf/src/graph-runtime.ts | 567 +++ packages/plugins/okf/src/graph-styles.ts | 335 ++ packages/plugins/okf/src/graph-template.ts | 73 + packages/plugins/okf/src/index.ts | 285 ++ packages/plugins/okf/src/yaml.ts | 81 + packages/plugins/okf/tests/brute.test.ts | 585 +++ packages/plugins/okf/tests/index.test.ts | 310 ++ packages/plugins/okf/tests/tsconfig.json | 11 + packages/plugins/okf/tsconfig.build.json | 8 + packages/plugins/okf/tsconfig.json | 11 + packages/plugins/openapi/LICENSE | 21 + packages/plugins/openapi/README.md | 17 + packages/plugins/openapi/build.js | 32 + packages/plugins/openapi/package.json | 70 + packages/plugins/openapi/src/index.ts | 389 ++ packages/plugins/openapi/src/openapi.css | 221 + packages/plugins/openapi/tsconfig.json | 10 + packages/plugins/pwa/LICENSE | 21 + packages/plugins/pwa/README.md | 26 + packages/plugins/pwa/package.json | 67 + packages/plugins/pwa/src/index.ts | 197 + packages/plugins/pwa/tsconfig.json | 10 + packages/plugins/search/LICENSE | 21 + packages/plugins/search/README.md | 13 + packages/plugins/search/i18n/en.json | 10 + packages/plugins/search/i18n/hi.json | 10 + packages/plugins/search/i18n/ko.json | 10 + packages/plugins/search/i18n/zh.json | 10 + packages/plugins/search/package.json | 79 + packages/plugins/search/src/client.ts | 386 ++ packages/plugins/search/src/index.ts | 1051 ++++ .../plugins/search/src/semantic-client.ts | 302 ++ packages/plugins/search/src/worker.ts | 142 + packages/plugins/search/tsconfig.json | 10 + packages/plugins/seo/LICENSE | 21 + packages/plugins/seo/README.md | 31 + packages/plugins/seo/package.json | 68 + packages/plugins/seo/src/index.ts | 204 + packages/plugins/seo/tsconfig.json | 10 + packages/plugins/sitemap/LICENSE | 21 + packages/plugins/sitemap/README.md | 23 + packages/plugins/sitemap/package.json | 58 + packages/plugins/sitemap/src/index.ts | 83 + packages/plugins/sitemap/tsconfig.json | 10 + packages/plugins/threads/LICENSE | 21 + packages/plugins/threads/README.md | 19 + packages/plugins/threads/build.js | 31 + .../plugins/threads/e2e/basic-ui.e2e.spec.ts | 216 + .../threads/e2e/comment-display.e2e.spec.ts | 142 + .../threads/e2e/fixtures/playground-index.md | 76 + packages/plugins/threads/e2e/globals.d.ts | 8 + packages/plugins/threads/e2e/helpers.ts | 215 + .../threads/e2e/inline-editor.e2e.spec.ts | 266 ++ .../threads/e2e/navigation.e2e.spec.ts | 49 + .../plugins/threads/e2e/reactions.e2e.spec.ts | 273 ++ .../threads/e2e/replies-deletion.e2e.spec.ts | 256 + .../threads/e2e/resolve-threads.e2e.spec.ts | 104 + packages/plugins/threads/e2e/screenplay.ts | 326 ++ .../threads/e2e/thread-creation.e2e.spec.ts | 215 + packages/plugins/threads/e2e/tsconfig.json | 10 + packages/plugins/threads/i18n/en.json | 44 + packages/plugins/threads/i18n/hi.json | 44 + packages/plugins/threads/i18n/ko.json | 44 + packages/plugins/threads/i18n/zh.json | 44 + packages/plugins/threads/package.json | 78 + packages/plugins/threads/playwright.config.ts | 26 + .../threads/src/client/components/styles.ts | 954 ++++ .../src/client/components/threads-app.ts | 871 ++++ .../src/client/components/threads-comment.ts | 192 + .../src/client/components/threads-compose.ts | 55 + .../src/client/components/threads-identity.ts | 167 + .../components/threads-inline-editor.ts | 157 + .../src/client/components/threads-panel.ts | 153 + .../src/client/components/threads-popover.ts | 66 + .../src/client/components/threads-thread.ts | 91 + packages/plugins/threads/src/client/index.ts | 14 + .../plugins/threads/src/client/lib/api.ts | 113 + .../threads/src/client/lib/highlights.ts | 244 + .../plugins/threads/src/client/lib/i18n.ts | 60 + .../threads/src/client/lib/identity.ts | 160 + .../threads/src/client/lib/selection.ts | 124 + .../plugins/threads/src/client/lib/theme.ts | 72 + .../plugins/threads/src/client/tsconfig.json | 14 + packages/plugins/threads/src/index.ts | 90 + .../plugins/threads/src/plugin/actions.ts | 381 ++ .../plugins/threads/src/plugin/containers.ts | 263 + .../threads/src/plugin/highlight-rule.ts | 88 + packages/plugins/threads/src/plugin/parser.ts | 389 ++ packages/plugins/threads/src/types.ts | 83 + .../threads/test-results/.last-run.json | 4 + .../plugins/threads/tests/actions.test.js | 413 ++ .../plugins/threads/tests/containers.test.js | 308 ++ .../threads/tests/highlight-rule.test.js | 136 + .../plugins/threads/tests/integration.test.js | 426 ++ packages/plugins/threads/tests/parser.test.js | 304 ++ packages/plugins/threads/tsconfig.json | 20 + packages/templates/summer/LICENSE | 21 + packages/templates/summer/README.md | 90 + .../templates/summer/assets/css/summer.css | 4218 +++++++++++++++++ packages/templates/summer/assets/js/summer.js | 702 +++ packages/templates/summer/package.json | 77 + .../templates/summer/scripts/copy-assets.mjs | 60 + packages/templates/summer/src/index.ts | 92 + packages/templates/summer/templates/404.ejs | 156 + .../templates/summer/templates/layout.ejs | 611 +++ .../summer/templates/partials/footer.ejs | 69 + .../summer/templates/partials/menubar.ejs | 92 + .../templates/partials/options-menu.ejs | 45 + packages/templates/summer/templates/toc.ejs | 53 + packages/templates/summer/tsconfig.json | 10 + packages/themes/LICENSE | 21 + packages/themes/README.md | 28 + packages/themes/package.json | 56 + packages/themes/src/docmd-theme-retro.css | 287 ++ packages/themes/src/docmd-theme-ruby.css | 143 + packages/themes/src/docmd-theme-sky.css | 250 + packages/themes/src/index.ts | 43 + packages/themes/tsconfig.json | 10 + packages/tui/LICENSE | 21 + packages/tui/README.md | 34 + packages/tui/package.json | 54 + packages/tui/src/index.ts | 448 ++ packages/tui/tsconfig.json | 10 + packages/ui/LICENSE | 21 + packages/ui/README.md | 13 + .../ui/assets/css/docmd-highlight-dark.css | 95 + .../ui/assets/css/docmd-highlight-light.css | 95 + packages/ui/assets/css/docmd-main.css | 3825 +++++++++++++++ packages/ui/assets/favicon.ico | Bin 0 -> 15406 bytes packages/ui/assets/images/docmd-logo-dark.png | Bin 0 -> 3734 bytes .../ui/assets/images/docmd-logo-light.png | Bin 0 -> 2750 bytes packages/ui/assets/images/docmd-logo.png | Bin 0 -> 11563 bytes packages/ui/assets/js/docmd-api.js | 188 + packages/ui/assets/js/docmd-i18n-strings.js | 232 + packages/ui/assets/js/docmd-image-lightbox.js | 95 + packages/ui/assets/js/docmd-main.js | 1027 ++++ packages/ui/package.json | 62 + packages/ui/src/index.ts | 110 + packages/ui/src/template-resolver.ts | 259 + packages/ui/templates/404.ejs | 191 + packages/ui/templates/docmd-search.ejs | 159 + packages/ui/templates/layout.ejs | 327 ++ packages/ui/templates/navigation.ejs | 99 + packages/ui/templates/no-style.ejs | 250 + packages/ui/templates/partials/banner.ejs | 78 + .../ui/templates/partials/cookie-consent.ejs | 71 + packages/ui/templates/partials/footer.ejs | 59 + .../templates/partials/language-switcher.ejs | 84 + packages/ui/templates/partials/menubar.ejs | 134 + .../ui/templates/partials/options-menu.ejs | 42 + .../templates/partials/project-switcher.ejs | 78 + packages/ui/templates/partials/theme-init.js | 66 + .../templates/partials/version-dropdown.ejs | 59 + packages/ui/templates/toc.ejs | 43 + packages/ui/translations/de.json | 46 + packages/ui/translations/en.json | 46 + packages/ui/translations/es.json | 46 + packages/ui/translations/fr.json | 46 + packages/ui/translations/hi.json | 46 + packages/ui/translations/ja.json | 46 + packages/ui/translations/ko.json | 46 + packages/ui/translations/zh.json | 46 + packages/ui/tsconfig.json | 10 + packages/utils/LICENSE | 21 + packages/utils/README.md | 13 + packages/utils/package.json | 59 + packages/utils/src/fs-utils.ts | 64 + packages/utils/src/git.ts | 33 + packages/utils/src/hash.ts | 9 + packages/utils/src/html-escape.ts | 113 + packages/utils/src/index.ts | 7 + packages/utils/src/path.ts | 41 + packages/utils/src/watcher-utils.ts | 65 + packages/utils/src/worker-pool.ts | 169 + packages/utils/test/html-escape.test.js | 122 + packages/utils/test/path.test.js | 72 + packages/utils/tsconfig.json | 14 + pnpm-lock.yaml | 2800 +++++++++++ pnpm-workspace.yaml | 9 + scripts/build-plugin-registry.mjs | 169 + scripts/probe-threads-xss.mjs | 55 + tests/cli-contracts/asset-base-url.test.js | 273 ++ tests/cli-contracts/deploy.test.js | 116 + tests/cli-contracts/exit-codes.test.js | 113 + tests/cli-contracts/i18n.test.js | 183 + tests/cli-contracts/llms-and-tui.test.js | 151 + tests/cli-contracts/migrate-fix.test.js | 137 + tests/cli-contracts/migrate.test.js | 163 + tests/cli-contracts/offline-links.test.js | 152 + tests/cli-contracts/plugin-add-remove.test.js | 211 + .../plugin-assets-pipeline.test.js | 188 + tests/cli-contracts/plugin-contract.test.js | 361 ++ tests/cli-contracts/runtime-deps.test.js | 236 + tests/cli-contracts/source-tools.test.js | 147 + tests/cli-contracts/stop.test.js | 85 + .../cli-contracts/validate-workspace.test.js | 162 + tests/feature-integration.test.js | 960 ++++ tests/package.json | 3 + tests/runner.js | 334 ++ tests/security.test.js | 664 +++ tests/shared.js | 139 + tools/bump.js | 103 + tools/docker-prebuild.sh | 32 + tools/prep.js | 526 ++ tools/print-okf-runtime-deps.js | 99 + tools/resolve-ws-deps.js | 66 + tools/security-audit.mjs | 203 + tools/status.js | 94 + tools/verify.js | 70 + tsconfig.base.json | 14 + 437 files changed, 68762 insertions(+) create mode 100644 .gitattributes create mode 100644 .github/CODE_OF_CONDUCT.md create mode 100644 .github/CONTRIBUTING.md create mode 100644 .github/FUNDING.yml create mode 100644 .github/ISSUE_TEMPLATE/bug_report.yml create mode 100644 .github/ISSUE_TEMPLATE/feature_request.yml create mode 100644 .github/PULL_REQUEST_TEMPLATE.md create mode 100644 .github/SECURITY.md create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/docker-publish.yml create mode 100644 .github/workflows/npm-publish.yml create mode 100644 .gitignore create mode 100644 LICENSE create mode 100644 README.de.md create mode 100644 README.es.md create mode 100644 README.fr.md create mode 100644 README.ja.md create mode 100644 README.md create mode 100644 README.wehub.md create mode 100644 README.zh.md create mode 100644 assets/docmd-cover.webp create mode 100644 docker/.dockerignore create mode 100644 docker/DOCKER.md create mode 100644 docker/Dockerfile create mode 100644 docker/docker-entrypoint.sh create mode 100644 docker/docker-healthcheck.sh create mode 100644 eslint-rules/index.js create mode 100644 eslint-rules/no-unsafe-fs-read.js create mode 100644 eslint-rules/require-verify-client.js create mode 100644 eslint.config.mjs create mode 100644 package.json create mode 100644 packages/_playground/.threads/authors.json create mode 100644 packages/_playground/docmd.config.json create mode 100644 packages/_playground/docs-05/getting-started/installation.md create mode 100644 packages/_playground/docs-05/index.md create mode 100644 packages/_playground/docs/.threads/authors.json create mode 100644 packages/_playground/docs/en/index.md create mode 100644 packages/_playground/docs/en/mermaid-icon-test.md create mode 100644 packages/_playground/docs/en/nested-page-1.md create mode 100644 packages/_playground/docs/en/nested-page-2.md create mode 100644 packages/_playground/docs/en/practical-tests/README.md create mode 100644 packages/_playground/docs/en/practical-tests/phase-2/container-parser-determinism.md create mode 100644 packages/_playground/docs/en/practical-tests/phase-2/f1-nested-grids.md create mode 100644 packages/_playground/docs/en/practical-tests/phase-2/f2-self-closing-button.md create mode 100644 packages/_playground/docs/en/practical-tests/phase-2/f3-mismatched-close.md create mode 100644 packages/_playground/docs/en/practical-tests/phase-2/f4-triple-close.md create mode 100644 packages/_playground/docs/en/practical-tests/phase-2/f5-five-level-nesting.md create mode 100644 packages/_playground/docs/en/practical-tests/phase-3/cli-exit-codes.md create mode 100644 packages/_playground/docs/en/practical-tests/phase-3/internal-link-with-trailing-slash.md create mode 100644 packages/_playground/docs/en/practical-tests/phase-3/llms-and-okf-default-locale.md create mode 100644 packages/_playground/docs/en/practical-tests/phase-3/okf-bundle-default.md create mode 100644 packages/_playground/docs/en/practical-tests/phase-3/okf-type-inference.md create mode 100644 packages/_playground/docs/en/practical-tests/phase-3/xss-in-frontmatter.md create mode 100644 packages/_playground/docs/hi/index.md create mode 100644 packages/_playground/docs/hi/practical-tests/phase-2-f1-hindi.md create mode 100644 packages/_playground/netlify.toml create mode 100644 packages/_playground/package.json create mode 100644 packages/_playground/vercel.json create mode 100644 packages/api/LICENSE create mode 100644 packages/api/README.md create mode 100644 packages/api/package.json create mode 100644 packages/api/registry/plugins.generated.json create mode 100644 packages/api/scripts/copy-registry.mjs create mode 100644 packages/api/src/engine.ts create mode 100644 packages/api/src/hooks.ts create mode 100644 packages/api/src/index.ts create mode 100644 packages/api/src/rpc.ts create mode 100644 packages/api/src/runtime-deps.ts create mode 100644 packages/api/src/source.ts create mode 100644 packages/api/src/types.ts create mode 100644 packages/api/tsconfig.json create mode 100644 packages/core/LICENSE create mode 100644 packages/core/README.md create mode 100644 packages/core/package.json create mode 100755 packages/core/src/bin/docmd.ts create mode 100644 packages/core/src/commands/build.ts create mode 100644 packages/core/src/commands/deploy.ts create mode 100644 packages/core/src/commands/dev.ts create mode 100644 packages/core/src/commands/doctor.ts create mode 100644 packages/core/src/commands/init.ts create mode 100644 packages/core/src/commands/live.ts create mode 100644 packages/core/src/commands/mcp.ts create mode 100644 packages/core/src/commands/migrate.ts create mode 100644 packages/core/src/commands/stop.ts create mode 100644 packages/core/src/commands/validate.ts create mode 100644 packages/core/src/engine/assets.ts create mode 100644 packages/core/src/engine/generator.ts create mode 100644 packages/core/src/engine/i18n.ts create mode 100644 packages/core/src/engine/versioning.ts create mode 100644 packages/core/src/engine/worker-parser.ts create mode 100644 packages/core/src/engine/workspace.ts create mode 100644 packages/core/src/env.d.ts create mode 100644 packages/core/src/index.ts create mode 100644 packages/core/src/utils/auto-router.ts create mode 100644 packages/core/src/utils/config-loader.ts create mode 100644 packages/core/src/utils/config-schema.ts create mode 100644 packages/core/src/utils/dev-utils.ts create mode 100644 packages/core/src/utils/exit.ts create mode 100644 packages/core/src/utils/ws-origin-guard.ts create mode 100644 packages/core/tsconfig.json create mode 100644 packages/deployer/LICENSE create mode 100644 packages/deployer/README.md create mode 100644 packages/deployer/package.json create mode 100644 packages/deployer/src/context.ts create mode 100644 packages/deployer/src/index.ts create mode 100644 packages/deployer/src/providers/caddy.ts create mode 100644 packages/deployer/src/providers/docker.ts create mode 100644 packages/deployer/src/providers/github-pages.ts create mode 100644 packages/deployer/src/providers/netlify.ts create mode 100644 packages/deployer/src/providers/nginx.ts create mode 100644 packages/deployer/src/providers/vercel.ts create mode 100644 packages/deployer/tsconfig.json create mode 100644 packages/engines/js/LICENSE create mode 100644 packages/engines/js/README.md create mode 100644 packages/engines/js/package.json create mode 100644 packages/engines/js/src/index.ts create mode 100644 packages/engines/js/tsconfig.json create mode 100644 packages/engines/rust-binaries/LICENSE create mode 100644 packages/engines/rust-binaries/README.md create mode 100755 packages/engines/rust-binaries/bin/docmd-engine-darwin-arm64.node create mode 100644 packages/engines/rust-binaries/build.js create mode 100644 packages/engines/rust-binaries/native/Cargo.lock create mode 100644 packages/engines/rust-binaries/native/Cargo.toml create mode 100644 packages/engines/rust-binaries/native/build.rs create mode 100644 packages/engines/rust-binaries/native/src/lib.rs create mode 100644 packages/engines/rust-binaries/package.json create mode 100644 packages/engines/rust/LICENSE create mode 100644 packages/engines/rust/README.md create mode 100644 packages/engines/rust/package.json create mode 100644 packages/engines/rust/scripts/postinstall.cjs create mode 100644 packages/engines/rust/src/index.ts create mode 100644 packages/engines/rust/tsconfig.json create mode 100644 packages/legacy/doc.md/LICENSE create mode 100644 packages/legacy/doc.md/README.md create mode 100644 packages/legacy/doc.md/bin/docmd.js create mode 100644 packages/legacy/doc.md/package.json create mode 100644 packages/legacy/mgks/LICENSE create mode 100644 packages/legacy/mgks/README.md create mode 100755 packages/legacy/mgks/bin/docmd.js create mode 100644 packages/legacy/mgks/package.json create mode 100644 packages/live/LICENSE create mode 100644 packages/live/README.md create mode 100755 packages/live/bin/docmd-live.js create mode 100644 packages/live/package.json create mode 100644 packages/live/src/browser-entry.ts create mode 100644 packages/live/src/build.ts create mode 100644 packages/live/src/docmd-live-preview.css create mode 100644 packages/live/src/docmd-live.css create mode 100644 packages/live/src/index.html create mode 100644 packages/live/src/index.ts create mode 100644 packages/live/src/shims.js create mode 100644 packages/live/src/shims.ts create mode 100644 packages/live/tsconfig.json create mode 100644 packages/parser/LICENSE create mode 100644 packages/parser/README.md create mode 100644 packages/parser/package.json create mode 100644 packages/parser/src/features/basics.ts create mode 100644 packages/parser/src/features/buttons.ts create mode 100644 packages/parser/src/features/changelog.ts create mode 100644 packages/parser/src/features/common-containers.ts create mode 100644 packages/parser/src/features/embed.ts create mode 100644 packages/parser/src/features/hero.ts create mode 100644 packages/parser/src/features/index.ts create mode 100644 packages/parser/src/features/steps.ts create mode 100644 packages/parser/src/features/tabs.ts create mode 100644 packages/parser/src/features/tags.ts create mode 100644 packages/parser/src/html-renderer.ts create mode 100644 packages/parser/src/index.ts create mode 100644 packages/parser/src/markdown-processor.ts create mode 100644 packages/parser/src/utils/container-helper.ts create mode 100644 packages/parser/src/utils/container-normaliser.ts create mode 100644 packages/parser/src/utils/icon-renderer.ts create mode 100644 packages/parser/src/utils/navigation-helper.ts create mode 100644 packages/parser/src/utils/normalize-href.ts create mode 100644 packages/parser/src/utils/url-utils.ts create mode 100644 packages/parser/src/utils/validator.ts create mode 100644 packages/parser/test/container-normaliser.test.js create mode 100644 packages/parser/tsconfig.json create mode 100644 packages/plugins/analytics/LICENSE create mode 100644 packages/plugins/analytics/README.md create mode 100644 packages/plugins/analytics/package.json create mode 100644 packages/plugins/analytics/src/index.ts create mode 100644 packages/plugins/analytics/tsconfig.json create mode 100644 packages/plugins/git/LICENSE create mode 100644 packages/plugins/git/README.md create mode 100644 packages/plugins/git/build.js create mode 100644 packages/plugins/git/i18n/de.json create mode 100644 packages/plugins/git/i18n/en.json create mode 100644 packages/plugins/git/i18n/ko.json create mode 100644 packages/plugins/git/i18n/zh.json create mode 100644 packages/plugins/git/package.json create mode 100644 packages/plugins/git/src/client/git-widget.css create mode 100644 packages/plugins/git/src/client/git-widget.js create mode 100644 packages/plugins/git/src/index.ts create mode 100644 packages/plugins/git/tsconfig.json create mode 100644 packages/plugins/installer/LICENSE create mode 100644 packages/plugins/installer/README.md create mode 100644 packages/plugins/installer/package.json create mode 100644 packages/plugins/installer/registry/plugins.json create mode 100644 packages/plugins/installer/src/config-editor.ts create mode 100644 packages/plugins/installer/src/index.ts create mode 100644 packages/plugins/installer/tsconfig.json create mode 100644 packages/plugins/llms/LICENSE create mode 100644 packages/plugins/llms/README.md create mode 100644 packages/plugins/llms/package.json create mode 100644 packages/plugins/llms/src/index.ts create mode 100644 packages/plugins/llms/tests/llms.test.js create mode 100644 packages/plugins/llms/tsconfig.json create mode 100644 packages/plugins/math/LICENSE create mode 100644 packages/plugins/math/README.md create mode 100644 packages/plugins/math/package.json create mode 100644 packages/plugins/math/src/index.ts create mode 100644 packages/plugins/math/tsconfig.json create mode 100644 packages/plugins/mermaid/LICENSE create mode 100644 packages/plugins/mermaid/README.md create mode 100644 packages/plugins/mermaid/package.json create mode 100644 packages/plugins/mermaid/src/client.ts create mode 100644 packages/plugins/mermaid/src/index.ts create mode 100644 packages/plugins/mermaid/src/svg-utils.ts create mode 100644 packages/plugins/mermaid/tests/svg-utils.test.ts create mode 100644 packages/plugins/mermaid/tsconfig.json create mode 100644 packages/plugins/okf/LICENSE create mode 100644 packages/plugins/okf/README.md create mode 100644 packages/plugins/okf/package.json create mode 100644 packages/plugins/okf/src/content.ts create mode 100644 packages/plugins/okf/src/graph-assets.ts create mode 100644 packages/plugins/okf/src/graph-runtime.ts create mode 100644 packages/plugins/okf/src/graph-styles.ts create mode 100644 packages/plugins/okf/src/graph-template.ts create mode 100644 packages/plugins/okf/src/index.ts create mode 100644 packages/plugins/okf/src/yaml.ts create mode 100644 packages/plugins/okf/tests/brute.test.ts create mode 100644 packages/plugins/okf/tests/index.test.ts create mode 100644 packages/plugins/okf/tests/tsconfig.json create mode 100644 packages/plugins/okf/tsconfig.build.json create mode 100644 packages/plugins/okf/tsconfig.json create mode 100644 packages/plugins/openapi/LICENSE create mode 100644 packages/plugins/openapi/README.md create mode 100644 packages/plugins/openapi/build.js create mode 100644 packages/plugins/openapi/package.json create mode 100644 packages/plugins/openapi/src/index.ts create mode 100644 packages/plugins/openapi/src/openapi.css create mode 100644 packages/plugins/openapi/tsconfig.json create mode 100644 packages/plugins/pwa/LICENSE create mode 100644 packages/plugins/pwa/README.md create mode 100644 packages/plugins/pwa/package.json create mode 100644 packages/plugins/pwa/src/index.ts create mode 100644 packages/plugins/pwa/tsconfig.json create mode 100644 packages/plugins/search/LICENSE create mode 100644 packages/plugins/search/README.md create mode 100644 packages/plugins/search/i18n/en.json create mode 100644 packages/plugins/search/i18n/hi.json create mode 100644 packages/plugins/search/i18n/ko.json create mode 100644 packages/plugins/search/i18n/zh.json create mode 100644 packages/plugins/search/package.json create mode 100644 packages/plugins/search/src/client.ts create mode 100644 packages/plugins/search/src/index.ts create mode 100644 packages/plugins/search/src/semantic-client.ts create mode 100644 packages/plugins/search/src/worker.ts create mode 100644 packages/plugins/search/tsconfig.json create mode 100644 packages/plugins/seo/LICENSE create mode 100644 packages/plugins/seo/README.md create mode 100644 packages/plugins/seo/package.json create mode 100644 packages/plugins/seo/src/index.ts create mode 100644 packages/plugins/seo/tsconfig.json create mode 100644 packages/plugins/sitemap/LICENSE create mode 100644 packages/plugins/sitemap/README.md create mode 100644 packages/plugins/sitemap/package.json create mode 100644 packages/plugins/sitemap/src/index.ts create mode 100644 packages/plugins/sitemap/tsconfig.json create mode 100644 packages/plugins/threads/LICENSE create mode 100644 packages/plugins/threads/README.md create mode 100644 packages/plugins/threads/build.js create mode 100644 packages/plugins/threads/e2e/basic-ui.e2e.spec.ts create mode 100644 packages/plugins/threads/e2e/comment-display.e2e.spec.ts create mode 100644 packages/plugins/threads/e2e/fixtures/playground-index.md create mode 100644 packages/plugins/threads/e2e/globals.d.ts create mode 100644 packages/plugins/threads/e2e/helpers.ts create mode 100644 packages/plugins/threads/e2e/inline-editor.e2e.spec.ts create mode 100644 packages/plugins/threads/e2e/navigation.e2e.spec.ts create mode 100644 packages/plugins/threads/e2e/reactions.e2e.spec.ts create mode 100644 packages/plugins/threads/e2e/replies-deletion.e2e.spec.ts create mode 100644 packages/plugins/threads/e2e/resolve-threads.e2e.spec.ts create mode 100644 packages/plugins/threads/e2e/screenplay.ts create mode 100644 packages/plugins/threads/e2e/thread-creation.e2e.spec.ts create mode 100644 packages/plugins/threads/e2e/tsconfig.json create mode 100644 packages/plugins/threads/i18n/en.json create mode 100644 packages/plugins/threads/i18n/hi.json create mode 100644 packages/plugins/threads/i18n/ko.json create mode 100644 packages/plugins/threads/i18n/zh.json create mode 100644 packages/plugins/threads/package.json create mode 100644 packages/plugins/threads/playwright.config.ts create mode 100644 packages/plugins/threads/src/client/components/styles.ts create mode 100644 packages/plugins/threads/src/client/components/threads-app.ts create mode 100644 packages/plugins/threads/src/client/components/threads-comment.ts create mode 100644 packages/plugins/threads/src/client/components/threads-compose.ts create mode 100644 packages/plugins/threads/src/client/components/threads-identity.ts create mode 100644 packages/plugins/threads/src/client/components/threads-inline-editor.ts create mode 100644 packages/plugins/threads/src/client/components/threads-panel.ts create mode 100644 packages/plugins/threads/src/client/components/threads-popover.ts create mode 100644 packages/plugins/threads/src/client/components/threads-thread.ts create mode 100644 packages/plugins/threads/src/client/index.ts create mode 100644 packages/plugins/threads/src/client/lib/api.ts create mode 100644 packages/plugins/threads/src/client/lib/highlights.ts create mode 100644 packages/plugins/threads/src/client/lib/i18n.ts create mode 100644 packages/plugins/threads/src/client/lib/identity.ts create mode 100644 packages/plugins/threads/src/client/lib/selection.ts create mode 100644 packages/plugins/threads/src/client/lib/theme.ts create mode 100644 packages/plugins/threads/src/client/tsconfig.json create mode 100644 packages/plugins/threads/src/index.ts create mode 100644 packages/plugins/threads/src/plugin/actions.ts create mode 100644 packages/plugins/threads/src/plugin/containers.ts create mode 100644 packages/plugins/threads/src/plugin/highlight-rule.ts create mode 100644 packages/plugins/threads/src/plugin/parser.ts create mode 100644 packages/plugins/threads/src/types.ts create mode 100644 packages/plugins/threads/test-results/.last-run.json create mode 100644 packages/plugins/threads/tests/actions.test.js create mode 100644 packages/plugins/threads/tests/containers.test.js create mode 100644 packages/plugins/threads/tests/highlight-rule.test.js create mode 100644 packages/plugins/threads/tests/integration.test.js create mode 100644 packages/plugins/threads/tests/parser.test.js create mode 100644 packages/plugins/threads/tsconfig.json create mode 100644 packages/templates/summer/LICENSE create mode 100644 packages/templates/summer/README.md create mode 100644 packages/templates/summer/assets/css/summer.css create mode 100644 packages/templates/summer/assets/js/summer.js create mode 100644 packages/templates/summer/package.json create mode 100644 packages/templates/summer/scripts/copy-assets.mjs create mode 100644 packages/templates/summer/src/index.ts create mode 100644 packages/templates/summer/templates/404.ejs create mode 100644 packages/templates/summer/templates/layout.ejs create mode 100644 packages/templates/summer/templates/partials/footer.ejs create mode 100644 packages/templates/summer/templates/partials/menubar.ejs create mode 100644 packages/templates/summer/templates/partials/options-menu.ejs create mode 100644 packages/templates/summer/templates/toc.ejs create mode 100644 packages/templates/summer/tsconfig.json create mode 100644 packages/themes/LICENSE create mode 100644 packages/themes/README.md create mode 100644 packages/themes/package.json create mode 100644 packages/themes/src/docmd-theme-retro.css create mode 100644 packages/themes/src/docmd-theme-ruby.css create mode 100644 packages/themes/src/docmd-theme-sky.css create mode 100644 packages/themes/src/index.ts create mode 100644 packages/themes/tsconfig.json create mode 100644 packages/tui/LICENSE create mode 100644 packages/tui/README.md create mode 100644 packages/tui/package.json create mode 100644 packages/tui/src/index.ts create mode 100644 packages/tui/tsconfig.json create mode 100644 packages/ui/LICENSE create mode 100644 packages/ui/README.md create mode 100644 packages/ui/assets/css/docmd-highlight-dark.css create mode 100644 packages/ui/assets/css/docmd-highlight-light.css create mode 100644 packages/ui/assets/css/docmd-main.css create mode 100644 packages/ui/assets/favicon.ico create mode 100644 packages/ui/assets/images/docmd-logo-dark.png create mode 100644 packages/ui/assets/images/docmd-logo-light.png create mode 100644 packages/ui/assets/images/docmd-logo.png create mode 100644 packages/ui/assets/js/docmd-api.js create mode 100644 packages/ui/assets/js/docmd-i18n-strings.js create mode 100644 packages/ui/assets/js/docmd-image-lightbox.js create mode 100644 packages/ui/assets/js/docmd-main.js create mode 100644 packages/ui/package.json create mode 100644 packages/ui/src/index.ts create mode 100644 packages/ui/src/template-resolver.ts create mode 100644 packages/ui/templates/404.ejs create mode 100644 packages/ui/templates/docmd-search.ejs create mode 100644 packages/ui/templates/layout.ejs create mode 100644 packages/ui/templates/navigation.ejs create mode 100644 packages/ui/templates/no-style.ejs create mode 100644 packages/ui/templates/partials/banner.ejs create mode 100644 packages/ui/templates/partials/cookie-consent.ejs create mode 100644 packages/ui/templates/partials/footer.ejs create mode 100644 packages/ui/templates/partials/language-switcher.ejs create mode 100644 packages/ui/templates/partials/menubar.ejs create mode 100644 packages/ui/templates/partials/options-menu.ejs create mode 100644 packages/ui/templates/partials/project-switcher.ejs create mode 100644 packages/ui/templates/partials/theme-init.js create mode 100644 packages/ui/templates/partials/version-dropdown.ejs create mode 100644 packages/ui/templates/toc.ejs create mode 100644 packages/ui/translations/de.json create mode 100644 packages/ui/translations/en.json create mode 100644 packages/ui/translations/es.json create mode 100644 packages/ui/translations/fr.json create mode 100644 packages/ui/translations/hi.json create mode 100644 packages/ui/translations/ja.json create mode 100644 packages/ui/translations/ko.json create mode 100644 packages/ui/translations/zh.json create mode 100644 packages/ui/tsconfig.json create mode 100644 packages/utils/LICENSE create mode 100644 packages/utils/README.md create mode 100644 packages/utils/package.json create mode 100644 packages/utils/src/fs-utils.ts create mode 100644 packages/utils/src/git.ts create mode 100644 packages/utils/src/hash.ts create mode 100644 packages/utils/src/html-escape.ts create mode 100644 packages/utils/src/index.ts create mode 100644 packages/utils/src/path.ts create mode 100644 packages/utils/src/watcher-utils.ts create mode 100644 packages/utils/src/worker-pool.ts create mode 100644 packages/utils/test/html-escape.test.js create mode 100644 packages/utils/test/path.test.js create mode 100644 packages/utils/tsconfig.json create mode 100644 pnpm-lock.yaml create mode 100644 pnpm-workspace.yaml create mode 100644 scripts/build-plugin-registry.mjs create mode 100644 scripts/probe-threads-xss.mjs create mode 100644 tests/cli-contracts/asset-base-url.test.js create mode 100644 tests/cli-contracts/deploy.test.js create mode 100644 tests/cli-contracts/exit-codes.test.js create mode 100644 tests/cli-contracts/i18n.test.js create mode 100644 tests/cli-contracts/llms-and-tui.test.js create mode 100644 tests/cli-contracts/migrate-fix.test.js create mode 100644 tests/cli-contracts/migrate.test.js create mode 100644 tests/cli-contracts/offline-links.test.js create mode 100644 tests/cli-contracts/plugin-add-remove.test.js create mode 100644 tests/cli-contracts/plugin-assets-pipeline.test.js create mode 100644 tests/cli-contracts/plugin-contract.test.js create mode 100644 tests/cli-contracts/runtime-deps.test.js create mode 100644 tests/cli-contracts/source-tools.test.js create mode 100644 tests/cli-contracts/stop.test.js create mode 100644 tests/cli-contracts/validate-workspace.test.js create mode 100644 tests/feature-integration.test.js create mode 100644 tests/package.json create mode 100644 tests/runner.js create mode 100644 tests/security.test.js create mode 100644 tests/shared.js create mode 100644 tools/bump.js create mode 100755 tools/docker-prebuild.sh create mode 100644 tools/prep.js create mode 100644 tools/print-okf-runtime-deps.js create mode 100644 tools/resolve-ws-deps.js create mode 100644 tools/security-audit.mjs create mode 100644 tools/status.js create mode 100644 tools/verify.js create mode 100644 tsconfig.base.json diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..eba1110 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# Auto detect text files and perform LF normalization +* text=auto \ No newline at end of file diff --git a/.github/CODE_OF_CONDUCT.md b/.github/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..063f369 --- /dev/null +++ b/.github/CODE_OF_CONDUCT.md @@ -0,0 +1,48 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +We as members, contributors, and leaders pledge to make participation in our +community a harassment-free experience for everyone, regardless of age, body +size, visible or invisible disability, ethnicity, sex characteristics, gender +identity and expression, level of experience, education, socio-economic status, +nationality, personal appearance, race, religion, or sexual identity +and orientation. + +We pledge to act and interact in ways that contribute to an open, welcoming, +diverse, inclusive, and healthy community. + +## Our Standards + +Examples of behavior that contributes to a positive environment for our +community include: + +* Demonstrating empathy and kindness toward other people +* Being respectful of differing opinions, viewpoints, and experiences +* Giving and gracefully accepting constructive feedback +* Accepting responsibility and apologizing to those affected by our mistakes, + and learning from the experience +* Focusing on what is best not just for us as individuals, but for the + overall community + +## Enforcement Responsibilities + +Community leaders are responsible for clarifying and enforcing our standards of +acceptable behavior and will take appropriate and fair corrective action in +response to any behavior that they deem inappropriate, threatening, offensive, +or harmful. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported to the community leaders responsible for enforcement at hello@mgks.dev. +All complaints will be reviewed and investigated promptly and fairly. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], +version 2.1, available at +[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1]. + +[homepage]: https://www.contributor-covenant.org +[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html \ No newline at end of file diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md new file mode 100644 index 0000000..e9f4607 --- /dev/null +++ b/.github/CONTRIBUTING.md @@ -0,0 +1,85 @@ +# Contributing to `docmd` + + +Thank you for your interest in contributing to `docmd`! We appreciate all contributions, from bug fixes and documentation improvements to new features and design suggestions. + +## Development Environment + +`docmd` is a monorepo managed with [pnpm](https://pnpm.io/). + +### Prerequisites + +- **Node.js**: v22.x or later (LTS recommended) +- **pnpm**: v10.x or later + +### Project Setup + +Clone the repository and set up the development environment: + +```bash +git clone https://github.com/docmd-io/docmd.git +cd docmd +pnpm prep +``` + +To also link the local `docmd` command globally for testing in other projects: + +```bash +pnpm prep --link +``` + +### Local Development + +Run the documentation site while watching for changes in the core engine: + +```bash +pnpm run dev +``` + +To watch internal source files (engine, templates, and plugins), set the `DOCMD_DEV` environment variable: + +```bash +DOCMD_DEV=true pnpm run dev +``` + +## Quality Standards + +Before submitting a Pull Request, please ensure your changes pass the verification suite: + +```bash +pnpm verify +``` + +### Commit Guidelines + +We use [Conventional Commits](https://www.conventionalcommits.org/). Please prefix your commit messages with: +- `feat:` (New features) +- `fix:` (Bug fixes) +- `docs:` (Documentation changes) +- `refactor:` (Code changes that neither fix bugs nor add features) + +### Source Headers + +All new files within the `packages/` directory MUST include the standard project copyright header to maintain consistency and compliance. + +```javascript +/** + * -------------------------------------------------------------------- + * docmd : the minimalist, zero-config documentation generator. + * + * @package @docmd/core (and ecosystem) + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + */ +``` + +## GitHub Workflow + +1. **Fork and Branch**: Create a feature branch from the latest `main`. +2. **Verify**: Ensure `pnpm verify` returns `๐Ÿ›ก๏ธ docmd is ready for production!`. +3. **Pull Request**: Open a PR with a clear description of the problem solved or the feature added. \ No newline at end of file diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..30d952a --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,15 @@ +# These are supported funding model platforms + +github: mgks # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry +polar: # Replace with a single Polar username +buy_me_a_coffee: # Replace with a single Buy Me a Coffee username +thanks_dev: # Replace with a single thanks.dev username +custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 0000000..661cf65 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,58 @@ +name: ๐Ÿž Bug Report +description: Create a report to help us improve docmd +title: "[Bug]: " +labels: ["bug", "triage"] +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to fill out this bug report! + - type: input + id: version + attributes: + label: docmd version + description: What version of docmd are you using? (e.g. 0.2.6) + placeholder: 0.2.6 + validations: + required: true + - type: input + id: node-version + attributes: + label: Node.js version + placeholder: v20.x + validations: + required: true + - type: dropdown + id: os + attributes: + label: OS/Browser + options: + - macOS / Safari + - Windows / Edge + - Linux / Chrome + validations: + required: true + - type: textarea + id: description + attributes: + label: Description + description: A clear and concise description of what the bug is. + validations: + required: true + - type: textarea + id: reproduction + attributes: + label: Steps to Reproduce + description: Please provide the steps to reproduce the behavior. + placeholder: | + 1. Run 'docmd init' + 2. Add configuration... + 3. Run 'docmd build' + 4. See error... + validations: + required: true + - type: textarea + id: expected + attributes: + label: Expected Behavior + description: A clear and concise description of what you expected to happen. \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml new file mode 100644 index 0000000..d817464 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -0,0 +1,27 @@ +name: ๐Ÿ’ก Feature Request +description: Suggest an idea for this project +title: "[Feature]: " +labels: ["enhancement"] +body: + - type: markdown + attributes: + value: | + Thanks for suggesting a new feature! + - type: textarea + id: problem + attributes: + label: Is your feature request related to a problem? + description: A clear and concise description of what the problem is. + placeholder: I'm always frustrated when... + - type: textarea + id: solution + attributes: + label: Describe the solution you'd like + description: A clear and concise description of what you want to happen. + validations: + required: true + - type: textarea + id: alternatives + attributes: + label: Describe alternatives you've considered + description: A clear and concise description of any alternative solutions or features you've considered. \ No newline at end of file diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..8ac63f6 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,16 @@ +## Description + + +Fixes # (issue) + +## Type of change +- [ ] ๐Ÿ› Bug fix (non-breaking change which fixes an issue) +- [ ] โœจ New feature (non-breaking change which adds functionality) +- [ ] ๐Ÿ’ฅ Breaking change (fix or feature that would cause existing functionality to not work as expected) +- [ ] ๐Ÿ“ Documentation update + +## Checklist: +- [ ] I have performed a self-review of my own code +- [ ] I have commented my code, particularly in hard-to-understand areas +- [ ] I have made corresponding changes to the documentation +- [ ] My changes generate no new warnings \ No newline at end of file diff --git a/.github/SECURITY.md b/.github/SECURITY.md new file mode 100644 index 0000000..82782f8 --- /dev/null +++ b/.github/SECURITY.md @@ -0,0 +1,18 @@ +# Security Policy + +## Supported Versions + +| Version | Supported | +| ------- | ------------------ | +| 0.2.x | :white_check_mark: | +| 0.1.x | :x: | + +## Reporting a Vulnerability + +Use this section to tell people how to report a vulnerability. + +Please do not report security vulnerabilities through public GitHub issues. + +If you have discovered a security vulnerability in `docmd`, please email hello@mgks.dev. + +We will do our best to respond within 48 hours. \ No newline at end of file diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..a0efb43 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,44 @@ +version: 2 +updates: + # ------------------------------------------------------- + # 1. GitHub Actions (Universal for all your projects) + # Keeps your workflow files (checkout, setup-node) updated + # ------------------------------------------------------- + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" + groups: + actions: + patterns: + - "*" + + # ------------------------------------------------------- + # 2. NPM (Specific to tree-fs / Node projects) + # ------------------------------------------------------- + - package-ecosystem: "npm" + directory: "/" + schedule: + interval: "weekly" + # Ignore major updates automatically to prevent breaking changes + # Remove this 'ignore' block if you want to see v1 -> v2 updates + ignore: + - dependency-name: "*" + update-types: ["version-update:semver-major"] + groups: + # Group all minor/patch updates into one PR + npm-dependencies: + patterns: + - "*" + + # ------------------------------------------------------- + # 3. (Optional) Uncomment for Python projects + # ------------------------------------------------------- + # - package-ecosystem: "pip" + # directory: "/" + # schedule: + # interval: "weekly" + # groups: + # python-deps: + # patterns: + # - "*" \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..4eb04d4 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,40 @@ +name: docmd CI verification + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + workflow_dispatch: + +permissions: + contents: read + +jobs: + verify: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v7 + + - name: Install pnpm + uses: pnpm/action-setup@v6 + + - name: Setup Node.js + uses: actions/setup-node@v6 + with: + node-version: '24' + cache: 'pnpm' + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Build packages + run: pnpm -r run build + + - name: Run verification + run: pnpm verify --skip-setup + + - name: Run Linting + run: pnpm lint \ No newline at end of file diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml new file mode 100644 index 0000000..2b9073a --- /dev/null +++ b/.github/workflows/docker-publish.yml @@ -0,0 +1,219 @@ +# -------------------------------------------------------------------- +# docmd : the minimalist, zero-config documentation generator. +# +# @package @docmd/core (and ecosystem) +# @website https://docmd.io +# @repository https://github.com/docmd-io/docmd +# @license MIT +# @copyright Copyright (c) 2025-present docmd.io +# +# [docmd-source] - Please do not remove this header. +# -------------------------------------------------------------------- +# +# GitHub Actions workflow for building and publishing Docker images +# Uses OIDC (OpenID Connect) for passwordless authentication to GHCR +# +# Triggers: +# - Release published on GitHub +# - Manual workflow dispatch +# - Push to main (for testing) +# +# -------------------------------------------------------------------- + +name: Build and Push Docker Image + +on: + release: + types: [published] + push: + tags: + - 'v*' + workflow_dispatch: + inputs: + push_image: + description: 'Push image to registry' + required: false + default: true + type: boolean + version: + description: 'Version tag (e.g., X.Y.Z)' + required: false + type: string + tag_latest: + description: 'Also tag this build as :latest (use only for stable releases)' + required: false + default: false + type: boolean + +permissions: + contents: read + packages: write + id-token: write # Required for OIDC + +env: + REGISTRY: ghcr.io + +jobs: + # --------------------------------------------------------------------------- + # Build and push Docker image + # --------------------------------------------------------------------------- + build: + name: Build Docker Image + runs-on: ubuntu-latest + outputs: + version: ${{ steps.meta.outputs.version }} + tags: ${{ steps.meta.outputs.tags }} + + steps: + - name: Checkout repository + uses: actions/checkout@v7 + + # ------------------------------------------------------------------------- + # Set up Docker Buildx for multi-platform builds + # ------------------------------------------------------------------------- + - name: Set up QEMU + uses: docker/setup-qemu-action@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v4 + + # ------------------------------------------------------------------------- + # Login to GitHub Container Registry using OIDC + # The id-token: write permission enables passwordless authentication + # ------------------------------------------------------------------------- + - name: Login to GitHub Container Registry + uses: docker/login-action@v4 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + # ------------------------------------------------------------------------- + # Extract metadata for Docker + # ------------------------------------------------------------------------- + - name: Extract Docker metadata + # Skip on plain branch pushes (the "for testing" trigger) โ€” the + # build below is local-only (push: is gated to release / manual), + # so no tags are needed and the action's tag rules don't apply. + if: github.event_name != 'push' || startsWith(github.ref, 'refs/tags/') + id: meta + uses: docker/metadata-action@v6 + with: + images: ${{ env.REGISTRY }}/${{ github.repository }} + # Two and only two tags are ever produced for any single image: + # - The version (e.g. X.Y.Z, v-prefix stripped) + # - The floating `:latest` alias + # `:latest` is only ever applied to released versions. A branch + # build or unreleased commit can never be pulled as `:latest`. + # flavor=latest=false disables the action's auto-latest so the + # only source of `:latest` is the explicit rule below. + flavor: | + latest=false + tags: | + # Version: ref on tag push and release events (strips 'v' prefix) + type=ref,event=tag + # :latest โ€” only on release events + type=raw,value=latest,enable=${{ github.event_name == 'release' }} + # Manual dispatch: use provided version + optional :latest + type=raw,value=${{ inputs.version }},enable=${{ github.event_name == 'workflow_dispatch' && inputs.version != '' }} + type=raw,value=latest,enable=${{ github.event_name == 'workflow_dispatch' && inputs.tag_latest }} + labels: | + org.opencontainers.image.title=docmd + org.opencontainers.image.description=The minimalist, zero-config documentation generator + org.opencontainers.image.vendor=docmd.io + org.opencontainers.image.licenses=MIT + + # ------------------------------------------------------------------------- + # Build and push Docker image + # Multi-platform: linux/amd64, linux/arm64 + # ------------------------------------------------------------------------- + - name: Build and push Docker image + uses: docker/build-push-action@v7 + with: + context: . + file: ./docker/Dockerfile + platforms: linux/amd64,linux/arm64 + push: ${{ github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && inputs.push_image) }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=gha + cache-to: type=gha,mode=max + provenance: true + sbom: true + + # ------------------------------------------------------------------------- + # Output build info + # ------------------------------------------------------------------------- + - name: Output image info + run: | + echo "## Docker Image Published! :whale:" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + echo "### Image Details" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + echo "| Property | Value |" >> $GITHUB_STEP_SUMMARY + echo "|----------|-------|" >> $GITHUB_STEP_SUMMARY + echo "| Registry | \`${{ env.REGISTRY }}\` |" >> $GITHUB_STEP_SUMMARY + echo "| Image | \`${{ env.REGISTRY }}/${{ github.repository }}:${{ steps.meta.outputs.version }}\` |" >> $GITHUB_STEP_SUMMARY + echo "| Version | \`${{ steps.meta.outputs.version }}\` |" >> $GITHUB_STEP_SUMMARY + echo "| Platforms | \`linux/amd64, linux/arm64\` |" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + echo "### Usage" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + echo '```bash' >> $GITHUB_STEP_SUMMARY + echo "# Pull the image" >> $GITHUB_STEP_SUMMARY + echo "docker pull ${{ env.REGISTRY }}/${{ github.repository }}:${{ steps.meta.outputs.version }}" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + echo "# Run development server" >> $GITHUB_STEP_SUMMARY + echo "docker run -v \$(pwd)/docs:/docs -p 3000:3000 ${{ env.REGISTRY }}/${{ github.repository }}:${{ steps.meta.outputs.version }}" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + echo "# Build static site" >> $GITHUB_STEP_SUMMARY + echo "docker run -v \$(pwd)/docs:/docs -v \$(pwd)/site:/site ${{ env.REGISTRY }}/${{ github.repository }}:${{ steps.meta.outputs.version }} build" >> $GITHUB_STEP_SUMMARY + echo '```' >> $GITHUB_STEP_SUMMARY + + # --------------------------------------------------------------------------- + # Test the Docker image (optional but recommended) + # --------------------------------------------------------------------------- + test: + name: Test Docker Image + needs: build + runs-on: ubuntu-latest + if: github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && inputs.push_image) + + steps: + - name: Checkout repository + uses: actions/checkout@v7 + + - name: Login to GitHub Container Registry + uses: docker/login-action@v4 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Pull image + run: docker pull ${{ env.REGISTRY }}/${{ github.repository }}:${{ needs.build.outputs.version }} + + - name: Test build command + run: | + # Create test directory with proper permissions for container user (UID 1001) + mkdir -p /tmp/docmd-test + sudo chown -R 1001:1001 /tmp/docmd-test + + # Simulate exactly what a new user does: init a project then build it + docker run --rm \ + -v /tmp/docmd-test:/workspace \ + --workdir /workspace \ + --entrypoint sh \ + ${{ env.REGISTRY }}/${{ github.repository }}:${{ needs.build.outputs.version }} \ + -c "cp -r /template/. /workspace/ && docmd build" + + - name: Verify build output + run: | + if [ -f "/tmp/docmd-test/site/index.html" ]; then + echo "โœ… Build successful - site/index.html exists" + echo "๐Ÿ“Š Site size: $(du -sh /tmp/docmd-test/site | cut -f1)" + else + echo "โŒ Build failed - site/index.html not found" + ls -la /tmp/docmd-test/ + exit 1 + fi \ No newline at end of file diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml new file mode 100644 index 0000000..98b192a --- /dev/null +++ b/.github/workflows/npm-publish.yml @@ -0,0 +1,180 @@ +name: Release docmd to NPM + +on: + release: + types: [published] + workflow_dispatch: + +permissions: + contents: read + id-token: write + packages: write + +# --------------------------------------------------------------------------- +# Job 1: Build Rust native binaries (matrix, one runner per platform) +# +# Each runner compiles the napi-rs addon for its target, then uploads the +# resulting .node file as a workflow artifact. The publish job downloads +# all artifacts and places them in rust-binaries/bin/ before publishing. +# --------------------------------------------------------------------------- +jobs: + build-native: + name: Build native (${{ matrix.target }}) + strategy: + fail-fast: false + matrix: + include: + - os: macos-latest # Apple Silicon runner (M-series) + target: aarch64-apple-darwin + binary: docmd-engine-darwin-arm64.node + lib: libdocmd_engine.dylib + + - os: macos-latest # Cross-compile Intel binary on ARM64 runner (Faster) + target: x86_64-apple-darwin + binary: docmd-engine-darwin-x64.node + lib: libdocmd_engine.dylib + + - os: ubuntu-latest # Cross-compile Linux x64 binary on ARM64 runner (Faster) + target: x86_64-unknown-linux-gnu + binary: docmd-engine-linux-x64.node + lib: libdocmd_engine.so + + - os: ubuntu-24.04-arm # GitHub-hosted ARM64 Linux runner + target: aarch64-unknown-linux-gnu + binary: docmd-engine-linux-arm64.node + lib: libdocmd_engine.so + + - os: windows-latest # Cross-compile Windows x64 binary on ARM64 runner (Faster) + target: x86_64-pc-windows-msvc + binary: docmd-engine-win32-x64.node + lib: docmd_engine.dll + + runs-on: ${{ matrix.os }} + + steps: + - uses: actions/checkout@v7 + + - name: Install Rust toolchain + run: | + rustup toolchain install stable --profile minimal --target ${{ matrix.target }} + rustup default stable + + - name: Cache Rust build + uses: Swatinem/rust-cache@v2 + with: + workspaces: packages/engines/rust-binaries/native + + - name: Debug cargo environment + run: | + echo "PATH: $PATH" + which cargo + cargo --version + rustup show + + - name: Build native addon + working-directory: packages/engines/rust-binaries/native + run: cargo build --release --target ${{ matrix.target }} + + # Copy the built library to bin/ with the correct name + - name: Collect binary (Unix) + if: runner.os != 'Windows' + run: | + mkdir -p packages/engines/rust-binaries/bin + cp packages/engines/rust-binaries/native/target/${{ matrix.target }}/release/${{ matrix.lib }} \ + packages/engines/rust-binaries/bin/${{ matrix.binary }} + + - name: Collect binary (Windows) + if: runner.os == 'Windows' + shell: pwsh + run: | + New-Item -ItemType Directory -Force -Path packages/engines/rust-binaries/bin + Copy-Item "packages/engines/rust-binaries/native/target/${{ matrix.target }}/release/${{ matrix.lib }}" ` + "packages/engines/rust-binaries/bin/${{ matrix.binary }}" + + - name: Upload artifact + uses: actions/upload-artifact@v7 + with: + name: native-${{ matrix.target }} + path: packages/engines/rust-binaries/bin/${{ matrix.binary }} + if-no-files-found: error + + # --------------------------------------------------------------------------- + # Job 2: Publish all packages to npm + # + # Runs after all matrix builds succeed. Downloads every .node artifact into + # rust-binaries/bin/ so the package contains the binaries when npm publish runs. + # --------------------------------------------------------------------------- + publish: + name: Publish to npm + needs: build-native + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v7 + + - name: Install pnpm + uses: pnpm/action-setup@v6 + + - name: Setup Node.js + uses: actions/setup-node@v6 + with: + node-version: '24' + registry-url: 'https://registry.npmjs.org' + cache: 'pnpm' + + - name: Upgrade npm (required for OIDC provenance) + run: npm install -g npm@11.12.1 + + - name: Install dependencies + run: pnpm install --frozen-lockfile --ignore-scripts + + # Download all .node binaries built by the matrix into rust-binaries/bin/ + - name: Download native binaries + uses: actions/download-artifact@v8 + with: + pattern: native-* + path: packages/engines/rust-binaries/bin + merge-multiple: true + + - name: Verify binaries + run: ls -lh packages/engines/rust-binaries/bin/ + + # Build TypeScript for all packages + - name: Build packages + run: pnpm -r run build + + - name: Run verification + run: pnpm verify --skip-setup + + - name: Copy LICENSE into each package + run: | + find packages -mindepth 1 -maxdepth 4 -name "package.json" \ + -not -path "*/node_modules/*" \ + -exec dirname {} \; | xargs -I % cp LICENSE % + + - name: Resolve workspace dependencies + run: node tools/resolve-ws-deps.js + + - name: Publish to npm + run: | + for dir in packages/* packages/legacy/* packages/plugins/* packages/engines/* packages/templates/*; do + if [ -f "$dir/package.json" ]; then + # Skip private packages + if grep -q '"private": true' "$dir/package.json"; then + echo "::notice::Skipping $dir: private package" + continue + fi + echo "Publishing $dir..." + exit_code=0 + publish_output=$(npm publish "./$dir" --access public --provenance 2>&1) || exit_code=$? + if [ $exit_code -ne 0 ]; then + if echo "$publish_output" | grep -q 'previously published versions\|EPRIVATE'; then + echo "::notice::Skipping $dir: Already published or private." + else + echo "::error::Failed to publish $dir" + echo "$publish_output" + exit 1 + fi + fi + fi + done \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a57f3d4 --- /dev/null +++ b/.gitignore @@ -0,0 +1,40 @@ +# Dependencies +node_modules/ +.pnpm-debug.log* + +# Logs +logs/ +*.log + +# Build Outputs +dist/ +public/ +site/ +out/ +*.tsbuildinfo + +# OS Specific +.DS_Store +Thumbs.db + +# Project Specific +genctx.config.json +genctx.context.md +_backup/ +_documentation/ +temp-*/ +.cache/ +.vscode/ + +# Environment +.env* +!.env.example +temp-live-test.mjs + +# Rust Engine +packages/engines/rust/bin/*.node +packages/engines/rust-binaries/native/target/ + +# Docmd Cache +.docmd/ +.docmd-search/ \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..997bb73 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025-present docmd.io + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/README.de.md b/README.de.md new file mode 100644 index 0000000..1419e26 --- /dev/null +++ b/README.de.md @@ -0,0 +1,286 @@ +
+ + EN  |  ES  |  DE  |  ๆ—ฅๆœฌ่ชž  |  FR  |  ไธญๆ–‡ + +
+ +
+ + + + + + docmd + + + +
+ +

Produktionsreife Dokumentation aus Markdown, in Sekunden.
Zero Config. AI-nativ. Fรผr Entwickler gebaut.

+ +

+ npm version + monatliche Downloads + GitHub-Sterne + Lizenz +

+ +

+ Website  ยท  + Dokumentation  ยท  + Live-Editor  ยท  + Agent Skills  ยท  + Bug melden +

+ +
+ + + docmd Standard-Theme โ€” Vorschau Light- und Dark-Mode + + +

+ +
+ +## Schnellstart + +Starten Sie docmd in jedem Ordner mit Markdown-Dateien โ€” keine Installation nรถtig: + +```bash +npx @docmd/core dev +``` + +
+ ร–ffnet unter http://localhost:3000
+ +```bash + _ _ + _| |___ ___ _____ _| | + | . | . | _| | . | + |___|___|___|_|_|_|___| + + v1.x.x + +โ”Œโ”€ Build +โ”‚ Engine JS +โ”‚ Source docs/ +โ”‚ Output site/ +โ”‚ Versions 2 (06, 05) +โ”‚ Locales 7 (en, hi, zh, es, de, ja, fr) +โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ +โ”Œโ”€ Data Indexing +โ”‚ [ DONE ] Syncing git metadata +โ”‚ [ DONE ] Building semantic search index (multi-version) +โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ +โ”Œโ”€ Publishing +โ”‚ [ DONE ] Generated robots.txt +โ”‚ [ DONE ] Generated .nojekyll (disables Jekyll on GitHub Pages) +โ”‚ [ DONE ] Generated sitemap +โ”‚ [ DONE ] Generating LLMs context files +โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ + +โฌข Initial build completed in 1.2s. + +โ”Œโ”€ Watching +โ”‚ Source ./docs +โ”‚ Config ./docmd.config.json +โ”‚ Assets ./assets +โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ +โ”Œโ”€ Development Server Running +โ”‚ Local Access http://127.0.0.1:3000 +โ”‚ Network Access http://192.168.1.6:3000 +โ”‚ Serving from ./site +โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ +``` +
+ +

+ docmd Dev-Server Vorschau +

+ +Die Navigation wird aus Ihrer Verzeichnisstruktur generiert. Keine Config-Datei, kein Frontmatter nรถtig, kein Framework zu lernen. + +**Wenn Sie bereit zum Verรถffentlichen sind:** + +```bash +npx @docmd/core build +``` + +Dies erzeugt eine hochoptimierte statische Site (SPA), bereit fรผr das Deployment zu Vercel, Cloudflare Pages, Netlify, GitHub Pages oder jedem beliebigen Static Host. + +**Anforderungen:** Node.js 18+ + +
+ Oder global installieren / per Docker
+ +```bash +# Global via npm installieren +npm install -g @docmd/core + +# Oder via pnpm +pnpm add -g @docmd/core + +# Ausfรผhren +docmd dev # Dev-Server starten +docmd build # Fรผr Deployment bauen +``` + +Oder per Docker: + +```bash +docker run -p 3000:3000 ghcr.io/docmd-io/docmd:0.8.7 +``` + +> Versionieren Sie fรผr reproduzierbare Builds. + +
+ +## Warum docmd? + +| Feature | docmd | Docusaurus | MkDocs | VitePress | Mintlify | +| :--- | :---: | :---: | :---: | :---: | :---: | +| **Config erforderlich** | **Keine** | `docusaurus.config.js` | `mkdocs.yml` | `config.mts` | `docs.json` | +| **JS-Payload** | **~18 kb** | ~250 kb | ~40 kb | ~50 kb | ~120 kb | +| **Navigation** | **Sofortige SPA** | React SPA | Vollstรคndiger Reload | Vue SPA | Gehostete SPA | +| **Versionierung** | **Nativ** | Nativ (komplex) | mike-Plugin | Manuell | Nativ | +| **i18n** | **Nativ** | Nativ (komplex) | Plugin-basiert | Nativ | Nativ | +| **Multi-Projekt** | **Nativ** | Plugin | Plugin | - | - | +| **Suche** | **Eingebaut** | Algolia (Cloud) | Eingebaut | MiniSearch | Cloud | +| **AI-Kontext (`llms.txt`)** | **Eingebaut** | - | - | - | Eingebaut | +| **MCP-Server** | **Eingebaut** | - | - | - | Eingebaut | +| **Agent Skills** | **Eingebaut** | - | - | - | - | +| **Docker-Image** | **Offiziell** | - | Offiziell | - | - | +| **Self-hosted** | **Ja** | Ja | Ja | Ja | - | +| **Kosten** | **Frei (OSS)** | Frei (OSS) | Frei (OSS) | Frei (OSS) | Freemium | + +## Features + +### Zero Config, sofortiger Start +Zeigen Sie docmd auf einen beliebigen Markdown-Ordner und es lรคuft. Die Navigation wird automatisch aus Ihrer Verzeichnisstruktur erstellt. Sie kรถnnen Ihre erste Doku schreiben und in unter einer Minute live haben โ€” kein Boilerplate, keine zu konfigurierende Build-Pipeline, keine Vorab-Entscheidungen. + +### Winzig standardmรครŸig, schnell รผberall +Der Standard-JavaScript-Payload ist ~18 kb. Seiten navigieren als sofortige SPA. Die Ausgabe ist statisches HTML โ€” SEO-optimiert, mit Sitemap, kanonischen URLs und Open-Graph-Metadaten. Offline-Volltextsuche ist eingebaut, kein Cloud-Dienst nรถtig. + +### AI-nativ +docmd ist fรผr die Art gebaut, wie Dokumentation heute gelesen und genutzt wird: +- **MCP-Server** โ€” `docmd mcp` stellt Ihre Doku AI-Agenten รผber stdio zur Verfรผgung, damit diese direkt suchen, lesen und Inhalte validieren kรถnnen. +- **Kontext (`llms.txt` / `llms-full.txt`)** โ€” vollstรคndiger Dokumentations-Kontext, zur Build-Zeit generiert, bereit fรผr jedes LLM. +- **Agent Skills** โ€” modulare Anleitungs-Sets fรผr LLMs und IDE-Agenten ([docmd-skills](https://github.com/docmd-io/docmd-skills)). +- **Als Markdown kopieren / Kontext kopieren** โ€” Ein-Klick-Buttons im Browser, optimiert zum Einfรผgen in AI-Chats. + +### Auf Skalierung ausgelegt +- Internationalisierung mit Multi-Locale-Builds +- Versionierung fรผr mehrere Dokumentations-Releases +- Workspaces fรผr Monorepos und Multi-Projekt-Setups +- Plugin-System zur Erweiterung der Kern-Funktionalitรคt +- Volle Theming-Unterstรผtzung, eingebaute Templates, eigenes CSS/JS, Light/Dark-Mode + +## CLI + +```bash +docmd dev # lokaler Dev-Server +docmd build # Fรผr Deployment bauen +docmd live # Browser-basierter Live-Editor +docmd init # neue docmd.config.json im aktuellen Ordner anlegen +docmd stop # laufende `docmd dev` / `docmd live` Server stoppen +docmd doctor # Vorab-Check: Konfiguration + Plugin-Installationsstatus +docmd migrate # Import aus Docusaurus, VitePress, MkDocs oder Starlight +docmd deploy # Config fรผr Docker, NGINX, Caddy, Vercel, Netlify generieren +docmd validate # Alle internen Links prรผfen +docmd mcp # Als MCP-Server รผber stdio betreiben +docmd add # Plugin oder Template installieren +``` + +## Plugins + +Die Kern-Funktionalitรคt wird von einem robusten Plugin-System bereitgestellt. Die Grundlagen sind standardmรครŸig enthalten, optionale Plugins kรถnnen fรผr spezifische Bedรผrfnisse hinzugefรผgt werden. + +| Plugin | Status | Beschreibung | +| :--- | :---: | :--- | +| `search` | Kern | Offline-Volltextsuche mit Fuzzy-Matching | +| `seo` | Kern | SEO-Tags und Open-Graph-Metadaten | +| `sitemap` | Kern | Generiert `sitemap.xml` | +| `git` | Kern | Git-Commit-Historie und letzte Aktualisierungsdaten | +| `analytics` | Kern | Schlanke Analytics-Integration | +| `llms` | Kern | AI-Kontext-Generierung (`llms.txt` / `llms-full.txt`) | +| `mermaid` | Kern | Mermaid-Diagramm-Unterstรผtzung | +| `openapi` | Kern | Build-Time-OpenAPI-3.x-Spec-Renderer | +| `okf` | Core | Open Knowledge Format Bundles fรผr KI-Agenten (pro Locale) | +| `pwa` | Optional | Progressive Web App โ€” Offline-Navigation | +| `threads` | Optional | Inline-Diskussions-Threads *(von @svallory)* | +| `math` | Optional | KaTeX / LaTeX-Mathematik-Rendering | + +Optionale Plugins installieren: + +```bash +docmd add +``` + +Eigene bauen: [Plugin-Entwicklungs-Leitfaden](https://docs.docmd.io/development/building-plugins/) + +## Konfiguration + +Keine Konfiguration ist nรถtig, um zu starten. Fรผgen Sie eine `docmd.config.json` (oder `.ts` / `.js`) im Projektstamm nur dann hinzu, wenn Sie mehr Kontrolle brauchen: + +```json +{ + "title": "Mein Projekt", + "url": "https://docs.meinprojekt.de", + "src": "./docs", + "out": "./dist" +} +``` + +TypeScript- und JavaScript-Konfigurationsdateien werden fรผr dynamische Werte unterstรผtzt. + +Vollstรคndige Referenz: [Konfigurations-รœbersicht](https://docs.docmd.io/configuration/overview) + +## Projektstruktur + +```text +my-docs/ +โ”œโ”€โ”€ docs/ โ† Ihre Markdown-Dateien +โ”œโ”€โ”€ assets/ โ† Bilder und statische Dateien +โ”œโ”€โ”€ docmd.config.json โ† Optionale Konfiguration +โ””โ”€โ”€ package.json +``` + +## Live-Editor + +Ein browserbasierter Editor zum Schreiben und Vorschauen von Doku โ€” kein lokales Setup erforderlich. + +

+ docmd Live-Editor Vorschau +

+ +**Probieren Sie es aus auf [live.docmd.io](https://live.docmd.io)** + +## Programmatische API + +Verwenden Sie docmd in Node.js-Skripten, CI-Pipelines oder benutzerdefinierten Build-Schritten. (Unterstรผtzt sowohl CommonJS als auch ESM.) + +```javascript +import { build } from '@docmd/core'; + +await build('./docmd.config.json', { isDev: false }); +``` + +Vollstรคndige Referenz: [Node-API](https://docs.docmd.io/development/node-api-reference/) + +## Community + +- **Bugs & Probleme** โ†’ [GitHub Issues](https://github.com/docmd-io/docmd/issues) +- **Fragen & Ideen** โ†’ [Discussions](https://github.com/orgs/docmd-io/discussions) +- **Beitragen** โ†’ [CONTRIBUTING.md](.github/CONTRIBUTING.md) +- **Roadmap** โ†’ [GitHub Discussions](https://github.com/orgs/docmd-io/discussions/2) + +## Unterstรผtzung + +- docmd bekannt zu machen ist der direkteste Weg, seine Entwicklung zu unterstรผtzen. [Teilen Sie es auf X](https://twitter.com/intent/tweet?url=https://github.com/docmd-io/docmd&text=docmd%20-%20Produktionsreife%20Doku%20aus%20Markdown%20in%20Sekunden.) mit Freunden oder geben Sie ihm einen Stern. +- Falls docmd Ihnen Zeit spart, hilft ein [GitHub-Sponsoring](https://github.com/sponsors/mgks) sehr weiter. +- Ideen oder Bugs? Erรถffnen Sie ein Issue oder eine PR, gerne auch mit eigenen Plugins. + +## Lizenz + +MIT โ€” siehe [`LICENSE`](./LICENSE) fรผr Details. \ No newline at end of file diff --git a/README.es.md b/README.es.md new file mode 100644 index 0000000..cd571e1 --- /dev/null +++ b/README.es.md @@ -0,0 +1,286 @@ +
+ + EN  |  ES  |  DE  |  ๆ—ฅๆœฌ่ชž  |  FR  |  ไธญๆ–‡ + +
+ +
+ + + + + + docmd + + + +
+ +

Documentaciรณn lista para producciรณn desde Markdown, en segundos.
Zero config. AI-nativo. Construido para desarrolladores.

+ +

+ npm version + descargas mensuales + estrellas de GitHub + licencia +

+ +

+ Sitio web  ยท  + Documentaciรณn  ยท  + Editor en vivo  ยท  + Agent Skills  ยท  + Reportar un bug +

+ +
+ + + docmd tema por defecto โ€” vista previa en modo claro y oscuro + + +

+ +
+ +## Inicio rรกpido + +Ejecuta docmd en cualquier carpeta con archivos Markdown โ€” sin instalaciรณn: + +```bash +npx @docmd/core dev +``` + +
+ Abre en http://localhost:3000
+ +```bash + _ _ + _| |___ ___ _____ _| | + | . | . | _| | . | + |___|___|___|_|_|_|___| + + v1.x.x + +โ”Œโ”€ Build +โ”‚ Engine JS +โ”‚ Source docs/ +โ”‚ Output site/ +โ”‚ Versions 2 (06, 05) +โ”‚ Locales 7 (en, hi, zh, es, de, ja, fr) +โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ +โ”Œโ”€ Data Indexing +โ”‚ [ DONE ] Syncing git metadata +โ”‚ [ DONE ] Building semantic search index (multi-version) +โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ +โ”Œโ”€ Publishing +โ”‚ [ DONE ] Generated robots.txt +โ”‚ [ DONE ] Generated .nojekyll (disables Jekyll on GitHub Pages) +โ”‚ [ DONE ] Generated sitemap +โ”‚ [ DONE ] Generating LLMs context files +โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ + +โฌข Initial build completed in 1.2s. + +โ”Œโ”€ Watching +โ”‚ Source ./docs +โ”‚ Config ./docmd.config.json +โ”‚ Assets ./assets +โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ +โ”Œโ”€ Development Server Running +โ”‚ Local Access http://127.0.0.1:3000 +โ”‚ Network Access http://192.168.1.6:3000 +โ”‚ Serving from ./site +โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ +``` +
+ +

+ vista previa del servidor de desarrollo docmd +

+ +La navegaciรณn se genera a partir de la estructura de archivos. Sin archivo de configuraciรณn, sin frontmatter obligatorio, sin framework que aprender. + +**Cuando estรฉs listo para publicar:** + +```bash +npx @docmd/core build +``` + +Esto produce un sitio estรกtico altamente optimizado (SPA) listo para desplegar en Vercel, Cloudflare Pages, Netlify, GitHub Pages o cualquier host estรกtico. + +**Requisitos:** Node.js 18+ + +
+ O instala globalmente / vรญa Docker
+ +```bash +# Instalar globalmente vรญa npm +npm install -g @docmd/core + +# O vรญa pnpm +pnpm add -g @docmd/core + +# Ejecutarlo +docmd dev # iniciar el servidor de desarrollo +docmd build # construir para desplegar +``` + +O ejecuta vรญa Docker: + +```bash +docker run -p 3000:3000 ghcr.io/docmd-io/docmd:0.8.7 +``` + +> Fije una versiรณn para compilaciones reproducibles. + +
+ +## ยฟPor quรฉ docmd? + +| Caracterรญstica | docmd | Docusaurus | MkDocs | VitePress | Mintlify | +| :--- | :---: | :---: | :---: | :---: | :---: | +| **Configuraciรณn requerida** | **Ninguna** | `docusaurus.config.js` | `mkdocs.yml` | `config.mts` | `docs.json` | +| **Payload JS** | **~18 kb** | ~250 kb | ~40 kb | ~50 kb | ~120 kb | +| **Navegaciรณn** | **SPA instantรกnea** | React SPA | Recarga completa | Vue SPA | SPA alojada | +| **Versionado** | **Nativo** | Nativo (complejo) | Plugin mike | Manual | Nativo | +| **i18n** | **Nativo** | Nativo (complejo) | Basado en plugin | Nativo | Nativo | +| **Multi-proyecto** | **Nativo** | Plugin | Plugin | - | - | +| **Bรบsqueda** | **Integrada** | Algolia (nube) | Integrada | MiniSearch | Nube | +| **Contexto IA (`llms.txt`)** | **Integrado** | - | - | - | Integrado | +| **Servidor MCP** | **Integrado** | - | - | - | Integrado | +| **Agent Skills** | **Integrado** | - | - | - | - | +| **Imagen Docker** | **Oficial** | - | Oficial | - | - | +| **Autoalojado** | **Sรญ** | Sรญ | Sรญ | Sรญ | - | +| **Coste** | **Gratis (OSS)** | Gratis (OSS) | Gratis (OSS) | Gratis (OSS) | Freemium | + +## Funcionalidades + +### Zero config, inicio instantรกneo +Apunta docmd a cualquier carpeta de Markdown y se ejecuta. La navegaciรณn se genera automรกticamente a partir de la estructura de archivos. Puedes escribir tu primer doc y tenerlo en vivo en menos de un minuto โ€” sin boilerplate, sin pipeline de build que configurar, sin decisiones que tomar por adelantado. + +### Diminuto por defecto, rรกpido en todas partes +El payload de JavaScript por defecto es ~18 kb. Las pรกginas navegan como una SPA instantรกnea. La salida es HTML estรกtico โ€” optimizado para SEO, con sitemap, URLs canรณnicas y metadatos Open Graph incluidos. Bรบsqueda offline de texto completo integrada, sin servicio en la nube necesario. + +### AI-nativo +docmd estรก construido para la forma en que la documentaciรณn se lee y se usa hoy: +- **Servidor MCP** โ€” `docmd mcp` expone tu documentaciรณn a agentes de IA sobre stdio, permitiรฉndoles buscar, leer y validar contenido directamente. +- **Contexto (`llms.txt` / `llms-full.txt`)** โ€” contexto completo de documentaciรณn generado en tiempo de build, listo para cualquier LLM. +- **Agent Skills** โ€” conjuntos de instrucciones modulares para LLMs y agentes de IDE ([docmd-skills](https://github.com/docmd-io/docmd-skills)). +- **Copiar como Markdown / Copiar contexto** โ€” botones de un clic en el navegador, optimizados para pegar en chats de IA. + +### Construido para escalar +- Internacionalizaciรณn con builds multi-idioma +- Versionado para mรบltiples releases de documentaciรณn +- Workspaces para monorepos y setups multi-proyecto +- Sistema de plugins para extender el comportamiento del nรบcleo +- Soporte completo de temas, plantillas integradas, CSS/JS personalizado, modo claro/oscuro + +## CLI + +```bash +docmd dev # servidor de desarrollo local +docmd build # construir para desplegar +docmd live # Editor en vivo basado en navegador +docmd init # crear un nuevo docmd.config.json en la carpeta actual +docmd stop # detener servidores `docmd dev` / `docmd live` en ejecuciรณn +docmd doctor # verificaciรณn previa: config + estado de instalaciรณn de plugins +docmd migrate # importar desde Docusaurus, VitePress, MkDocs o Starlight +docmd deploy # generar configuraciรณn para Docker, NGINX, Caddy, Vercel, Netlify +docmd validate # comprobar todos los enlaces internos +docmd mcp # ejecutar como servidor MCP sobre stdio +docmd add # instalar un plugin o plantilla +``` + +## Plugins + +La funcionalidad principal estรก impulsada por un sistema de plugins robusto. Lo esencial viene incluido por defecto, mientras que los plugins opcionales pueden aรฑadirse segรบn necesidades especรญficas. + +| Plugin | Estado | Descripciรณn | +| :--- | :---: | :--- | +| `search` | Nรบcleo | Bรบsqueda offline de texto completo con coincidencia difusa | +| `seo` | Nรบcleo | Etiquetas SEO y metadatos Open Graph | +| `sitemap` | Nรบcleo | Genera `sitemap.xml` | +| `git` | Nรบcleo | Historial de commits de Git y fechas de รบltima actualizaciรณn | +| `analytics` | Nรบcleo | Integraciรณn ligera de analytics | +| `llms` | Nรบcleo | Generaciรณn de contexto IA (`llms.txt` / `llms-full.txt`) | +| `mermaid` | Nรบcleo | Soporte de diagramas Mermaid | +| `openapi` | Nรบcleo | Renderizador de especificaciรณn OpenAPI 3.x en tiempo de build | +| `okf` | Core | Bundles Open Knowledge Format para agentes IA (por locale) | +| `pwa` | Opcional | Progressive Web App โ€” navegaciรณn offline | +| `threads` | Opcional | Hilos de discusiรณn inline *(por @svallory)* | +| `math` | Opcional | Renderizado matemรกtico KaTeX / LaTeX | + +Instalar plugins opcionales: + +```bash +docmd add +``` + +Crea el tuyo: [Guรญa de desarrollo de plugins](https://docs.docmd.io/development/building-plugins/) + +## Configuraciรณn + +No se requiere configuraciรณn para comenzar. Aรฑade un `docmd.config.json` (o `.ts` / `.js`) en la raรญz de tu proyecto solo cuando necesites mรกs control: + +```json +{ + "title": "Mi Proyecto", + "url": "https://docs.miproyecto.com", + "src": "./docs", + "out": "./dist" +} +``` + +Se admiten archivos de configuraciรณn TypeScript y JavaScript para valores dinรกmicos. + +Referencia completa: [Resumen de configuraciรณn](https://docs.docmd.io/configuration/overview) + +## Estructura del proyecto + +```text +my-docs/ +โ”œโ”€โ”€ docs/ โ† Tus archivos markdown +โ”œโ”€โ”€ assets/ โ† Imรกgenes y archivos estรกticos +โ”œโ”€โ”€ docmd.config.json โ† Configuraciรณn opcional +โ””โ”€โ”€ package.json +``` + +## Editor en vivo + +Un editor basado en navegador para escribir y previsualizar documentaciรณn โ€” sin configuraciรณn local. + +

+ vista previa del editor en vivo docmd +

+ +**Pruรฉbalo en [live.docmd.io](https://live.docmd.io)** + +## API programรกtica + +Usa docmd en scripts de Node.js, pipelines de CI o pasos de build personalizados. (Soporta tanto CommonJS como ESM.) + +```javascript +import { build } from '@docmd/core'; + +await build('./docmd.config.json', { isDev: false }); +``` + +Referencia completa: [Node API](https://docs.docmd.io/development/node-api-reference/) + +## Comunidad + +- **Bugs y problemas** โ†’ [GitHub Issues](https://github.com/docmd-io/docmd/issues) +- **Preguntas e ideas** โ†’ [Discussions](https://github.com/orgs/docmd-io/discussions) +- **Contribuir** โ†’ [CONTRIBUTING.md](.github/CONTRIBUTING.md) +- **Roadmap** โ†’ [GitHub Discussions](https://github.com/orgs/docmd-io/discussions/2) + +## Soporte + +- Dar a conocer docmd es la forma mรกs directa de apoyar su desarrollo. [Compรกrtelo en X](https://twitter.com/intent/tweet?url=https://github.com/docmd-io/docmd&text=docmd%20-%20Documentaciรณn%20lista%20para%20producciรณn%20desde%20Markdown%20en%20segundos.) con amigos o dale una estrella. +- Si docmd te ahorra tiempo, un [sponsorship en GitHub](https://github.com/sponsors/mgks) ayuda mucho. +- ยฟIdeas o bugs? Abre un issue o PR, siรฉntete libre de contribuir con tus propios plugins. + +## Licencia + +MIT โ€” consulta [`LICENSE`](./LICENSE) para mรกs detalles. \ No newline at end of file diff --git a/README.fr.md b/README.fr.md new file mode 100644 index 0000000..38f88db --- /dev/null +++ b/README.fr.md @@ -0,0 +1,286 @@ +
+ + EN  |  ES  |  DE  |  ๆ—ฅๆœฌ่ชž  |  FR  |  ไธญๆ–‡ + +
+ +
+ + + + + + docmd + + + +
+ +

Documentation prรชte pour la production ร  partir de Markdown, en quelques secondes.
Zero config. Native IA. Conรงu pour les dรฉveloppeurs.

+ +

+ npm version + tรฉlรฉchargements mensuels + รฉtoiles GitHub + licence +

+ +

+ Site web  ยท  + Documentation  ยท  + ร‰diteur en direct  ยท  + Agent Skills  ยท  + Signaler un bug +

+ +
+ + + docmd thรจme par dรฉfaut โ€” aperรงu en mode clair et sombre + + +

+ +
+ +## Dรฉmarrage rapide + +Lancez docmd dans n'importe quel dossier contenant des fichiers Markdown โ€” aucune installation requise : + +```bash +npx @docmd/core dev +``` + +
+ Ouvre sur http://localhost:3000
+ +```bash + _ _ + _| |___ ___ _____ _| | + | . | . | _| | . | + |___|___|___|_|_|_|___| + + v1.x.x + +โ”Œโ”€ Build +โ”‚ Engine JS +โ”‚ Source docs/ +โ”‚ Output site/ +โ”‚ Versions 2 (06, 05) +โ”‚ Locales 7 (en, hi, zh, es, de, ja, fr) +โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ +โ”Œโ”€ Data Indexing +โ”‚ [ DONE ] Syncing git metadata +โ”‚ [ DONE ] Building semantic search index (multi-version) +โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ +โ”Œโ”€ Publishing +โ”‚ [ DONE ] Generated robots.txt +โ”‚ [ DONE ] Generated .nojekyll (disables Jekyll on GitHub Pages) +โ”‚ [ DONE ] Generated sitemap +โ”‚ [ DONE ] Generating LLMs context files +โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ + +โฌข Initial build completed in 1.2s. + +โ”Œโ”€ Watching +โ”‚ Source ./docs +โ”‚ Config ./docmd.config.json +โ”‚ Assets ./assets +โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ +โ”Œโ”€ Development Server Running +โ”‚ Local Access http://127.0.0.1:3000 +โ”‚ Network Access http://192.168.1.6:3000 +โ”‚ Serving from ./site +โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ +``` +
+ +

+ aperรงu du serveur de dรฉveloppement docmd +

+ +La navigation est gรฉnรฉrรฉe ร  partir de votre structure de fichiers. Pas de fichier de configuration, pas de frontmatter obligatoire, pas de framework ร  apprendre. + +**Quand vous รชtes prรชt ร  publier :** + +```bash +npx @docmd/core build +``` + +Cela produit un site statique (SPA) hautement optimisรฉ, prรชt ร  รชtre dรฉployรฉ sur Vercel, Cloudflare Pages, Netlify, GitHub Pages, ou n'importe quel hรฉbergeur statique. + +**Prรฉrequis :** Node.js 18+ + +
+ Ou installer globalement / via Docker
+ +```bash +# Installer globalement via npm +npm install -g @docmd/core + +# Ou via pnpm +pnpm add -g @docmd/core + +# Lancer +docmd dev # dรฉmarrer le serveur de dรฉveloppement +docmd build # construire pour le dรฉploiement +``` + +Ou via Docker : + +```bash +docker run -p 3000:3000 ghcr.io/docmd-io/docmd:0.8.7 +``` + +> ร‰pinglez une version pour des builds reproductibles. + +
+ +## Pourquoi docmd ? + +| Fonctionnalitรฉ | docmd | Docusaurus | MkDocs | VitePress | Mintlify | +| :--- | :---: | :---: | :---: | :---: | :---: | +| **Configuration requise** | **Aucune** | `docusaurus.config.js` | `mkdocs.yml` | `config.mts` | `docs.json` | +| **Payload JS** | **~18 ko** | ~250 ko | ~40 ko | ~50 ko | ~120 ko | +| **Navigation** | **SPA instantanรฉe** | React SPA | Rechargement complet | Vue SPA | SPA hรฉbergรฉe | +| **Versioning** | **Natif** | Natif (complexe) | Plugin mike | Manuel | Natif | +| **i18n** | **Natif** | Natif (complexe) | Basรฉ sur plugin | Natif | Natif | +| **Multi-projet** | **Natif** | Plugin | Plugin | - | - | +| **Recherche** | **Intรฉgrรฉe** | Algolia (cloud) | Intรฉgrรฉe | MiniSearch | Cloud | +| **Contexte IA (`llms.txt`)** | **Intรฉgrรฉ** | - | - | - | Intรฉgrรฉ | +| **Serveur MCP** | **Intรฉgrรฉ** | - | - | - | Intรฉgrรฉ | +| **Agent Skills** | **Intรฉgrรฉ** | - | - | - | - | +| **Image Docker** | **Officielle** | - | Officielle | - | - | +| **Auto-hรฉbergรฉ** | **Oui** | Oui | Oui | Oui | - | +| **Coรปt** | **Libre (OSS)** | Libre (OSS) | Libre (OSS) | Libre (OSS) | Freemium | + +## Fonctionnalitรฉs + +### Zรฉro config, dรฉmarrage instantanรฉ +Pointez docmd vers n'importe quel dossier de Markdown et il s'exรฉcute. La navigation est gรฉnรฉrรฉe automatiquement ร  partir de votre structure de fichiers. Vous pouvez รฉcrire votre premier doc et l'avoir en ligne en moins d'une minute โ€” pas de boilerplate, pas de pipeline de build ร  configurer, pas de dรฉcisions ร  prendre ร  l'avance. + +### Minuscule par dรฉfaut, rapide partout +Le payload JavaScript par dรฉfaut est de ~18 ko. Les pages naviguent comme une SPA instantanรฉe. La sortie est du HTML statique โ€” optimisรฉ pour le SEO, avec sitemap, URLs canoniques et mรฉtadonnรฉes Open Graph intรฉgrรฉes. Recherche full-text hors ligne intรฉgrรฉe, sans service cloud requis. + +### Native IA +docmd est conรงu pour la faรงon dont la documentation est lue et utilisรฉe aujourd'hui : +- **Serveur MCP** โ€” `docmd mcp` expose votre documentation aux agents IA sur stdio, leur permettant de chercher, lire et valider le contenu directement. +- **Contexte (`llms.txt` / `llms-full.txt`)** โ€” contexte complet de la documentation gรฉnรฉrรฉ au build, prรชt pour tout LLM. +- **Agent Skills** โ€” ensembles d'instructions modulaires pour les LLMs et les agents IDE ([docmd-skills](https://github.com/docmd-io/docmd-skills)). +- **Copier en Markdown / Copier le contexte** โ€” boutons en un clic dans le navigateur, optimisรฉs pour coller dans un chat IA. + +### Conรงu pour passer ร  l'รฉchelle +- Internationalisation avec builds multilingues +- Versioning pour plusieurs versions de documentation +- Workspaces pour les monorepos et les configurations multi-projets +- Systรจme de plugins pour รฉtendre le comportement du cล“ur +- Support complet du theming, modรจles intรฉgrรฉs, CSS/JS personnalisรฉ, mode clair/sombre + +## CLI + +```bash +docmd dev # serveur de dรฉveloppement local +docmd build # construire pour le dรฉploiement +docmd live # รฉditeur en direct basรฉ sur le navigateur +docmd init # gรฉnรฉrer un nouveau docmd.config.json dans le dossier courant +docmd stop # arrรชter les serveurs `docmd dev` / `docmd live` en cours +docmd doctor # vรฉrification prรฉalable : config + statut d'installation des plugins +docmd migrate # importer depuis Docusaurus, VitePress, MkDocs ou Starlight +docmd deploy # gรฉnรฉrer la configuration pour Docker, NGINX, Caddy, Vercel, Netlify +docmd validate # vรฉrifier tous les liens internes +docmd mcp # exรฉcuter comme serveur MCP sur stdio +docmd add # installer un plugin ou un modรจle +``` + +## Plugins + +La fonctionnalitรฉ principale repose sur un systรจme de plugins robuste. L'essentiel est inclus par dรฉfaut, tandis que des plugins optionnels peuvent รชtre ajoutรฉs selon les besoins spรฉcifiques. + +| Plugin | Statut | Description | +| :--- | :---: | :--- | +| `search` | Cล“ur | Recherche full-text hors ligne avec correspondance approximative | +| `seo` | Cล“ur | Balises SEO et mรฉtadonnรฉes Open Graph | +| `sitemap` | Cล“ur | Gรฉnรจre `sitemap.xml` | +| `git` | Cล“ur | Historique des commits Git et dates de derniรจre mise ร  jour | +| `analytics` | Cล“ur | Intรฉgration lรฉgรจre d'analytics | +| `llms` | Cล“ur | Gรฉnรฉration du contexte IA (`llms.txt` / `llms-full.txt`) | +| `mermaid` | Cล“ur | Support des diagrammes Mermaid | +| `openapi` | Cล“ur | Rendu de spรฉcification OpenAPI 3.x au build | +| `okf` | Core | Bundles Open Knowledge Format pour agents IA (par locale) | +| `pwa` | Optionnel | Progressive Web App โ€” navigation hors ligne | +| `threads` | Optionnel | Fils de discussion inline *(par @svallory)* | +| `math` | Optionnel | Rendu mathรฉmatique KaTeX / LaTeX | + +Installer des plugins optionnels : + +```bash +docmd add +``` + +Crรฉez le vรดtre : [Guide de dรฉveloppement de plugins](https://docs.docmd.io/development/building-plugins/) + +## Configuration + +Aucune configuration n'est requise pour commencer. Ajoutez un `docmd.config.json` (ou `.ts` / `.js`) ร  la racine de votre projet uniquement lorsque vous avez besoin de plus de contrรดle : + +```json +{ + "title": "Mon Projet", + "url": "https://docs.monprojet.fr", + "src": "./docs", + "out": "./dist" +} +``` + +Les fichiers de configuration TypeScript et JavaScript sont pris en charge pour les valeurs dynamiques. + +Rรฉfรฉrence complรจte : [Aperรงu de la configuration](https://docs.docmd.io/configuration/overview) + +## Structure du projet + +```text +my-docs/ +โ”œโ”€โ”€ docs/ โ† Vos fichiers markdown +โ”œโ”€โ”€ assets/ โ† Images et fichiers statiques +โ”œโ”€โ”€ docmd.config.json โ† Configuration optionnelle +โ””โ”€โ”€ package.json +``` + +## ร‰diteur en direct + +Un รฉditeur basรฉ sur navigateur pour รฉcrire et prรฉvisualiser la documentation โ€” aucune configuration locale requise. + +

+ aperรงu de l'รฉditeur en direct docmd +

+ +**Essayez-le sur [live.docmd.io](https://live.docmd.io)** + +## API programmatique + +Utilisez docmd dans des scripts Node.js, des pipelines CI ou des รฉtapes de build personnalisรฉes. (Supporte CommonJS et ESM.) + +```javascript +import { build } from '@docmd/core'; + +await build('./docmd.config.json', { isDev: false }); +``` + +Rรฉfรฉrence complรจte : [Node API](https://docs.docmd.io/development/node-api-reference/) + +## Communautรฉ + +- **Bugs et problรจmes** โ†’ [GitHub Issues](https://github.com/docmd-io/docmd/issues) +- **Questions et idรฉes** โ†’ [Discussions](https://github.com/orgs/docmd-io/discussions) +- **Contribuer** โ†’ [CONTRIBUTING.md](.github/CONTRIBUTING.md) +- **Roadmap** โ†’ [GitHub Discussions](https://github.com/orgs/docmd-io/discussions/2) + +## Soutien + +- Faire connaรฎtre docmd est la faรงon la plus directe de soutenir son dรฉveloppement. [Partagez-le sur X](https://twitter.com/intent/tweet?url=https://github.com/docmd-io/docmd&text=docmd%20-%20Documentation%20prรชte%20pour%20la%20production%20ร %20partir%20de%20Markdown%20en%20quelques%20secondes.) avec vos amis ou attribuez-lui une รฉtoile. +- Si docmd vous fait gagner du temps, un [sponsorship GitHub](https://github.com/sponsors/mgks) est trรจs apprรฉciable. +- Des idรฉes ou des bugs ? Ouvrez une issue ou une PR, n'hรฉsitez pas ร  contribuer avec vos propres plugins. + +## Licence + +MIT โ€” voir [`LICENSE`](./LICENSE) pour plus de dรฉtails. \ No newline at end of file diff --git a/README.ja.md b/README.ja.md new file mode 100644 index 0000000..6ec1002 --- /dev/null +++ b/README.ja.md @@ -0,0 +1,286 @@ +
+ + EN  |  ES  |  DE  |  ๆ—ฅๆœฌ่ชž  |  FR  |  ไธญๆ–‡ + +
+ +
+ + + + + + docmd + + + +
+ +

Markdown ใ‹ใ‚‰ๆ•ฐ็ง’ใงใƒ—ใƒญใƒ€ใ‚ฏใ‚ทใƒงใƒณๅ“่ณชใฎใƒ‰ใ‚ญใƒฅใƒกใƒณใƒˆใ‚’ใ€‚
Zero configใ€‚AI ใƒใ‚คใƒ†ใ‚ฃใƒ–ใ€‚้–‹็™บ่€…ใฎใŸใ‚ใซใ€‚

+ +

+ npm version + monthly downloads + GitHub stars + license +

+ +

+ ใ‚ฆใ‚งใƒ–ใ‚ตใ‚คใƒˆ  ยท  + ใƒ‰ใ‚ญใƒฅใƒกใƒณใƒˆ  ยท  + ใƒฉใ‚คใƒ–ใ‚จใƒ‡ใ‚ฃใ‚ฟ  ยท  + Agent Skills  ยท  + ใƒใ‚ฐๅ ฑๅ‘Š +

+ +
+ + + docmd ใƒ‡ใƒ•ใ‚ฉใƒซใƒˆใƒ†ใƒผใƒž โ€” ใƒฉใ‚คใƒˆ/ใƒ€ใƒผใ‚ฏใƒขใƒผใƒ‰ใฎใƒ—ใƒฌใƒ“ใƒฅใƒผ + + +

+ +
+ +## ใ‚ฏใ‚คใƒƒใ‚ฏใ‚นใ‚ฟใƒผใƒˆ + +Markdown ใƒ•ใ‚กใ‚คใƒซใŒใ‚ใ‚‹ไปปๆ„ใฎใƒ•ใ‚ฉใƒซใƒ€ใง docmd ใ‚’ๅฎŸ่กŒ โ€” ใ‚คใƒณใ‚นใƒˆใƒผใƒซไธ่ฆ๏ผš + +```bash +npx @docmd/core dev +``` + +
+ http://localhost:3000 ใง้–‹ใใพใ™
+ +```bash + _ _ + _| |___ ___ _____ _| | + | . | . | _| | . | + |___|___|___|_|_|_|___| + + v1.x.x + +โ”Œโ”€ Build +โ”‚ Engine JS +โ”‚ Source docs/ +โ”‚ Output site/ +โ”‚ Versions 2 (06, 05) +โ”‚ Locales 7 (en, hi, zh, es, de, ja, fr) +โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ +โ”Œโ”€ Data Indexing +โ”‚ [ DONE ] Syncing git metadata +โ”‚ [ DONE ] Building semantic search index (multi-version) +โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ +โ”Œโ”€ Publishing +โ”‚ [ DONE ] Generated robots.txt +โ”‚ [ DONE ] Generated .nojekyll (disables Jekyll on GitHub Pages) +โ”‚ [ DONE ] Generated sitemap +โ”‚ [ DONE ] Generating LLMs context files +โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ + +โฌข Initial build completed in 1.2s. + +โ”Œโ”€ Watching +โ”‚ Source ./docs +โ”‚ Config ./docmd.config.json +โ”‚ Assets ./assets +โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ +โ”Œโ”€ Development Server Running +โ”‚ Local Access http://127.0.0.1:3000 +โ”‚ Network Access http://192.168.1.6:3000 +โ”‚ Serving from ./site +โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ +``` +
+ +

+ docmd dev ใ‚ตใƒผใƒใƒผใฎใƒ—ใƒฌใƒ“ใƒฅใƒผ +

+ +ใƒŠใƒ“ใ‚ฒใƒผใ‚ทใƒงใƒณใฏใƒ•ใ‚กใ‚คใƒซๆง‹้€ ใ‹ใ‚‰่‡ชๅ‹•็”Ÿๆˆใ•ใ‚Œใพใ™ใ€‚่จญๅฎšใƒ•ใ‚กใ‚คใƒซไธ่ฆใ€frontmatter ๅฟ…้ ˆใชใ—ใ€ๅญฆใถในใใƒ•ใƒฌใƒผใƒ ใƒฏใƒผใ‚ฏใ‚‚ใ‚ใ‚Šใพใ›ใ‚“ใ€‚ + +**ๅ…ฌ้–‹ใฎๆบ–ๅ‚™ใŒใงใใŸใ‚‰๏ผš** + +```bash +npx @docmd/core build +``` + +ใ“ใ‚Œใฏ Vercelใ€Cloudflare Pagesใ€Netlifyใ€GitHub Pagesใ€ใใฎไป–ใฎ้™็š„ใƒ›ใ‚นใƒˆใซใƒ‡ใƒ—ใƒญใ‚คๅฏ่ƒฝใชใ€้ซ˜ๅบฆใซๆœ€้ฉๅŒ–ใ•ใ‚ŒใŸ้™็š„ใ‚ตใ‚คใƒˆ๏ผˆSPA๏ผ‰ใ‚’ๅ‡บๅŠ›ใ—ใพใ™ใ€‚ + +**่ฆไปถ๏ผš** Node.js 18+ + +
+ ใพใŸใฏใ‚ฐใƒญใƒผใƒใƒซใ‚คใƒณใ‚นใƒˆใƒผใƒซ / Docker ็ตŒ็”ฑ
+ +```bash +# npm ใงใ‚ฐใƒญใƒผใƒใƒซใ‚คใƒณใ‚นใƒˆใƒผใƒซ +npm install -g @docmd/core + +# ใพใŸใฏ pnpm +pnpm add -g @docmd/core + +# ๅฎŸ่กŒ +docmd dev # dev ใ‚ตใƒผใƒใƒผใ‚’่ตทๅ‹• +docmd build # ใƒ‡ใƒ—ใƒญใ‚ค็”จใซใƒ“ใƒซใƒ‰ +``` + +ใพใŸใฏ Docker ็ตŒ็”ฑ๏ผš + +```bash +docker run -p 3000:3000 ghcr.io/docmd-io/docmd:0.8.7 +``` + +> ๅ†็พๅฏ่ƒฝใชใƒ“ใƒซใƒ‰ใฎใŸใ‚ใซใƒใƒผใ‚ธใƒงใƒณใ‚’ๅ›บๅฎšใ—ใฆใใ ใ•ใ„ใ€‚ + +
+ +## ใชใœ docmd๏ผŸ + +| ๆฉŸ่ƒฝ | docmd | Docusaurus | MkDocs | VitePress | Mintlify | +| :--- | :---: | :---: | :---: | :---: | :---: | +| **่จญๅฎšใŒๅฟ…่ฆ** | **ใชใ—** | `docusaurus.config.js` | `mkdocs.yml` | `config.mts` | `docs.json` | +| **JS ใƒšใ‚คใƒญใƒผใƒ‰** | **~18 kb** | ~250 kb | ~40 kb | ~50 kb | ~120 kb | +| **ใƒŠใƒ“ใ‚ฒใƒผใ‚ทใƒงใƒณ** | **ๅณๆ™‚ SPA** | React SPA | ใƒ•ใƒซใƒชใƒญใƒผใƒ‰ | Vue SPA | ใƒ›ใ‚นใƒˆๅž‹ SPA | +| **ใƒใƒผใ‚ธใƒงใƒณ็ฎก็†** | **ใƒใ‚คใƒ†ใ‚ฃใƒ–** | ใƒใ‚คใƒ†ใ‚ฃใƒ–๏ผˆ่ค‡้›‘๏ผ‰ | mike ใƒ—ใƒฉใ‚ฐใ‚คใƒณ | ๆ‰‹ๅ‹• | ใƒใ‚คใƒ†ใ‚ฃใƒ– | +| **i18n** | **ใƒใ‚คใƒ†ใ‚ฃใƒ–** | ใƒใ‚คใƒ†ใ‚ฃใƒ–๏ผˆ่ค‡้›‘๏ผ‰ | ใƒ—ใƒฉใ‚ฐใ‚คใƒณใƒ™ใƒผใ‚น | ใƒใ‚คใƒ†ใ‚ฃใƒ– | ใƒใ‚คใƒ†ใ‚ฃใƒ– | +| **ใƒžใƒซใƒใƒ—ใƒญใ‚ธใ‚งใ‚ฏใƒˆ** | **ใƒใ‚คใƒ†ใ‚ฃใƒ–** | ใƒ—ใƒฉใ‚ฐใ‚คใƒณ | ใƒ—ใƒฉใ‚ฐใ‚คใƒณ | - | - | +| **ๆคœ็ดข** | **็ต„ใฟ่พผใฟ** | Algolia๏ผˆใ‚ฏใƒฉใ‚ฆใƒ‰๏ผ‰ | ็ต„ใฟ่พผใฟ | MiniSearch | ใ‚ฏใƒฉใ‚ฆใƒ‰ | +| **AI ใ‚ณใƒณใƒ†ใ‚ญใ‚นใƒˆ (`llms.txt`)** | **็ต„ใฟ่พผใฟ** | - | - | - | ็ต„ใฟ่พผใฟ | +| **MCP ใ‚ตใƒผใƒใƒผ** | **็ต„ใฟ่พผใฟ** | - | - | - | ็ต„ใฟ่พผใฟ | +| **Agent Skills** | **็ต„ใฟ่พผใฟ** | - | - | - | - | +| **Docker ใ‚คใƒกใƒผใ‚ธ** | **ๅ…ฌๅผ** | - | ๅ…ฌๅผ | - | - | +| **ใ‚ปใƒซใƒ•ใƒ›ใ‚นใƒˆ** | **ๅฏ** | ๅฏ | ๅฏ | ๅฏ | - | +| **ใ‚ณใ‚นใƒˆ** | **็„กๆ–™ (OSS)** | ็„กๆ–™ (OSS) | ็„กๆ–™ (OSS) | ็„กๆ–™ (OSS) | ใƒ•ใƒชใƒผใƒŸใ‚ขใƒ  | + +## ๆฉŸ่ƒฝ + +### Zero configใ€ๅณๆ™‚ใ‚นใ‚ฟใƒผใƒˆ +ไปปๆ„ใฎ Markdown ใƒ•ใ‚ฉใƒซใƒ€ใ‚’ docmd ใซๆŒ‡ๅฎšใ™ใ‚‹ใ ใ‘ใงๅฎŸ่กŒใงใใพใ™ใ€‚ใƒŠใƒ“ใ‚ฒใƒผใ‚ทใƒงใƒณใฏใƒ•ใ‚กใ‚คใƒซๆง‹้€ ใ‹ใ‚‰่‡ชๅ‹•็”Ÿๆˆใ•ใ‚Œใพใ™ใ€‚ๆœ€ๅˆใฎใƒ‰ใ‚ญใƒฅใƒกใƒณใƒˆใ‚’ๆ›ธใ„ใฆ 1 ๅˆ†ไปฅๅ†…ใซๅ…ฌ้–‹ๅฏ่ƒฝ โ€” ใƒœใ‚คใƒฉใƒผใƒ—ใƒฌใƒผใƒˆใชใ—ใ€ใƒ“ใƒซใƒ‰ใƒ‘ใ‚คใƒ—ใƒฉใ‚คใƒณใฎ่จญๅฎšใชใ—ใ€ไบ‹ๅ‰ใฎๆ„ๆ€ๆฑบๅฎšใฏไธ่ฆใงใ™ใ€‚ + +### ๆจ™ๆบ–ใง่ปฝ้‡ใ€ใฉใ“ใงใ‚‚้ซ˜้€Ÿ +ใƒ‡ใƒ•ใ‚ฉใƒซใƒˆใฎ JavaScript ใƒšใ‚คใƒญใƒผใƒ‰ใฏ ~18 kbใ€‚ใƒšใƒผใ‚ธใฏๅณๆ™‚ SPA ใจใ—ใฆใƒŠใƒ“ใ‚ฒใƒผใƒˆใ—ใพใ™ใ€‚ๅ‡บๅŠ›ใฏ้™็š„ HTML โ€” SEO ๆœ€้ฉๅŒ–ๆธˆใฟใ€sitemapใ€ๆญฃ่ฆ URLใ€Open Graph ใƒกใ‚ฟใƒ‡ใƒผใ‚ฟใ‚’ๅซใ‚€ใ€‚ใ‚ชใƒ•ใƒฉใ‚คใƒณใฎๅ…จๆ–‡ๆคœ็ดขใ‚’ๅ†…่”ตใ€ใ‚ฏใƒฉใ‚ฆใƒ‰ใ‚ตใƒผใƒ“ใ‚นไธ่ฆใ€‚ + +### AI ใƒใ‚คใƒ†ใ‚ฃใƒ– +docmd ใฏไปŠใƒ‰ใ‚ญใฎใƒ‰ใ‚ญใƒฅใƒกใƒณใƒˆใฎ่ชญใฟๆ–นใƒปไฝฟใ‚ใ‚Œๆ–นใซๅˆใ‚ใ›ใฆๆง‹็ฏ‰ใ•ใ‚Œใฆใ„ใพใ™๏ผš +- **MCP ใ‚ตใƒผใƒใƒผ** โ€” `docmd mcp` ใŒใƒ‰ใ‚ญใƒฅใƒกใƒณใƒˆใ‚’ stdio ็ตŒ็”ฑใง AI Agent ใซๅ…ฌ้–‹ใ—ใ€ๆคœ็ดขใƒป่ชญใฟๅ–ใ‚Šใƒปๆคœ่จผใ‚’็›ดๆŽฅ่กŒใˆใพใ™ใ€‚ +- **ใ‚ณใƒณใƒ†ใ‚ญใ‚นใƒˆ (`llms.txt` / `llms-full.txt`)** โ€” ใƒ“ใƒซใƒ‰ๆ™‚ใซ็”Ÿๆˆใ•ใ‚Œใ‚‹ๅฎŒๅ…จใชใƒ‰ใ‚ญใƒฅใƒกใƒณใƒˆใ‚ณใƒณใƒ†ใ‚ญใ‚นใƒˆใ€ใ‚ใ‚‰ใ‚†ใ‚‹ LLM ใงๅณๅˆฉ็”จๅฏ่ƒฝใ€‚ +- **Agent Skills** โ€” LLM ใจ IDE Agent ๅ‘ใ‘ใฎใƒขใ‚ธใƒฅใƒผใƒซๅผใ‚คใƒณใ‚นใƒˆใƒฉใ‚ฏใ‚ทใƒงใ‚ปใƒƒใƒˆ ([docmd-skills](https://github.com/docmd-io/docmd-skills))ใ€‚ +- **Markdown ใจใ—ใฆใ‚ณใƒ”ใƒผ / ใ‚ณใƒณใƒ†ใ‚ญใ‚นใƒˆใ‚’ใ‚ณใƒ”ใƒผ** โ€” ใƒ–ใƒฉใ‚ฆใ‚ถๅ†…ใฎใƒฏใƒณใ‚ฏใƒชใƒƒใ‚ฏใƒœใ‚ฟใƒณใ€‚AI ใƒใƒฃใƒƒใƒˆใธใฎ่ฒผใ‚Šไป˜ใ‘ใซๆœ€้ฉๅŒ–ใ€‚ + +### ใ‚นใ‚ฑใƒผใƒซใ‚’่ฆ‹ๆฎใˆใฆๆง‹็ฏ‰ +- ใƒžใƒซใƒใƒญใ‚ฑใƒผใƒซใƒ“ใƒซใƒ‰ใซใ‚ˆใ‚‹ๅ›ฝ้š›ๅŒ– +- ่ค‡ๆ•ฐใƒ‰ใ‚ญใƒฅใƒกใƒณใƒˆใƒชใƒชใƒผใ‚นใซๅฏพๅฟœใ™ใ‚‹ใƒใƒผใ‚ธใƒงใƒณ็ฎก็† +- ใƒขใƒŽใƒฌใƒใƒปใƒžใƒซใƒใƒ—ใƒญใ‚ธใ‚งใ‚ฏใƒˆๆง‹ๆˆๅ‘ใ‘ Workspaces +- ใ‚ณใ‚ขๆฉŸ่ƒฝใ‚’ๆ‹กๅผตใ™ใ‚‹ใƒ—ใƒฉใ‚ฐใ‚คใƒณใ‚ทใ‚นใƒ†ใƒ  +- ๅฎŒๅ…จใชใƒ†ใƒผใƒžๅฏพๅฟœใ€ใƒ“ใƒซใƒˆใ‚คใƒณใƒ†ใƒณใƒ—ใƒฌใƒผใƒˆใ€ใ‚ซใ‚นใ‚ฟใƒ  CSS/JSใ€ใƒฉใ‚คใƒˆ/ใƒ€ใƒผใ‚ฏใƒขใƒผใƒ‰ + +## CLI + +```bash +docmd dev # ใƒญใƒผใ‚ซใƒซ dev ใ‚ตใƒผใƒใƒผ +docmd build # ใƒ‡ใƒ—ใƒญใ‚ค็”จใƒ“ใƒซใƒ‰ +docmd live # ใƒ–ใƒฉใ‚ฆใ‚ถใƒ™ใƒผใ‚นใฎใƒฉใ‚คใƒ–ใ‚จใƒ‡ใ‚ฃใ‚ฟ +docmd init # ็พๅœจใฎใƒ‡ใ‚ฃใƒฌใ‚ฏใƒˆใƒชใซๆ–ฐใ—ใ„ docmd.config.json ใ‚’ไฝœๆˆ +docmd stop # ๅฎŸ่กŒไธญใฎ `docmd dev` / `docmd live` ใ‚ตใƒผใƒใƒผใ‚’ๅœๆญข +docmd doctor # ไบ‹ๅ‰ใƒใ‚งใƒƒใ‚ฏ: ่จญๅฎš + ใƒ—ใƒฉใ‚ฐใ‚คใƒณใฎใ‚คใƒณใ‚นใƒˆใƒผใƒซ็Šถๆณ +docmd migrate # Docusaurus / VitePress / MkDocs / Starlight ใ‹ใ‚‰ๅ–ใ‚Š่พผใฟ +docmd deploy # Docker / NGINX / Caddy / Vercel / Netlify ็”จ่จญๅฎšใ‚’็”Ÿๆˆ +docmd validate # ๅ†…้ƒจใƒชใƒณใ‚ฏใ‚’ๅ…จใฆใƒใ‚งใƒƒใ‚ฏ +docmd mcp # stdio ไธŠใง MCP ใ‚ตใƒผใƒใƒผใจใ—ใฆๅ‹•ไฝœ +docmd add # ใƒ—ใƒฉใ‚ฐใ‚คใƒณใพใŸใฏใƒ†ใƒณใƒ—ใƒฌใƒผใƒˆใ‚’ใ‚คใƒณใ‚นใƒˆใƒผใƒซ +``` + +## ใƒ—ใƒฉใ‚ฐใ‚คใƒณ + +ใ‚ณใ‚ขๆฉŸ่ƒฝใฏๅ …็‰ขใชใƒ—ใƒฉใ‚ฐใ‚คใƒณใ‚ทใ‚นใƒ†ใƒ ใซใ‚ˆใฃใฆๆ”ฏใˆใ‚‰ใ‚Œใฆใ„ใพใ™ใ€‚ๅฟ…้ ˆๆฉŸ่ƒฝใฏๆจ™ๆบ–ใงๅซใพใ‚ŒใฆใŠใ‚Šใ€็‰นๅฎšใฎใƒ‹ใƒผใ‚บใซๅฟœใ˜ใฆใ‚ชใƒ—ใ‚ทใƒงใƒŠใƒซใƒ—ใƒฉใ‚ฐใ‚คใƒณใ‚’่ฟฝๅŠ ใงใใพใ™ใ€‚ + +| ใƒ—ใƒฉใ‚ฐใ‚คใƒณ | ใ‚นใƒ†ใƒผใ‚ฟใ‚น | ่ชฌๆ˜Ž | +| :--- | :---: | :--- | +| `search` | ใ‚ณใ‚ข | ใ‚ใ„ใพใ„ไธ€่‡ดๅฏพๅฟœใฎใ‚ชใƒ•ใƒฉใ‚คใƒณๅ…จๆ–‡ๆคœ็ดข | +| `seo` | ใ‚ณใ‚ข | SEO ใ‚ฟใ‚ฐใจ Open Graph ใƒกใ‚ฟใƒ‡ใƒผใ‚ฟ | +| `sitemap` | ใ‚ณใ‚ข | `sitemap.xml` ใ‚’็”Ÿๆˆ | +| `git` | ใ‚ณใ‚ข | Git ใฎใ‚ณใƒŸใƒƒใƒˆๅฑฅๆญดใจๆœ€็ต‚ๆ›ดๆ–ฐๆ—ฅ | +| `analytics` | ใ‚ณใ‚ข | ่ปฝ้‡ใชใ‚ขใƒŠใƒชใƒ†ใ‚ฃใ‚ฏใ‚น้€ฃๆบ | +| `llms` | ใ‚ณใ‚ข | AI ใ‚ณใƒณใƒ†ใ‚ญใ‚นใƒˆ็”Ÿๆˆ (`llms.txt` / `llms-full.txt`) | +| `mermaid` | ใ‚ณใ‚ข | Mermaid ๅ›ณๅฏพๅฟœ | +| `openapi` | ใ‚ณใ‚ข | ใƒ“ใƒซใƒ‰ๆ™‚ใฎ OpenAPI 3.x ใ‚นใƒšใƒƒใ‚ฏใƒฌใƒณใƒ€ใƒฉใƒผ | +| `okf` | Core | AI ใ‚จใƒผใ‚ธใ‚งใƒณใƒˆๅ‘ใ‘ Open Knowledge Format ใƒใƒณใƒ‰ใƒซ (ใƒญใ‚ฑใƒผใƒซๅˆฅ) | +| `pwa` | ใ‚ชใƒ—ใ‚ทใƒงใƒณ | Progressive Web App โ€” ใ‚ชใƒ•ใƒฉใ‚คใƒณใƒŠใƒ“ใ‚ฒใƒผใ‚ทใƒงใƒณ | +| `threads` | ใ‚ชใƒ—ใ‚ทใƒงใƒณ | ใ‚คใƒณใƒฉใ‚คใƒณใƒ‡ใ‚ฃใ‚นใ‚ซใƒƒใ‚ทใƒงใƒณใ‚นใƒฌใƒƒใƒ‰ *(by @svallory)* | +| `math` | ใ‚ชใƒ—ใ‚ทใƒงใƒณ | KaTeX / LaTeX ๆ•ฐๅผใƒฌใƒณใƒ€ใƒชใƒณใ‚ฐ | + +ใ‚ชใƒ—ใ‚ทใƒงใƒŠใƒซใƒ—ใƒฉใ‚ฐใ‚คใƒณใฎใ‚คใƒณใ‚นใƒˆใƒผใƒซ๏ผš + +```bash +docmd add +``` + +่‡ชไฝœ๏ผš[ใƒ—ใƒฉใ‚ฐใ‚คใƒณ้–‹็™บใ‚ฌใ‚คใƒ‰](https://docs.docmd.io/development/building-plugins/) + +## ่จญๅฎš + +ๅง‹ใ‚ใ‚‹ใฎใซ่จญๅฎšใฏไธ่ฆใงใ™ใ€‚ใƒ—ใƒญใ‚ธใ‚งใ‚ฏใƒˆใƒซใƒผใƒˆใซ `docmd.config.json`๏ผˆใพใŸใฏ `.ts` / `.js`๏ผ‰ใ‚’่ฟฝๅŠ ใ™ใ‚‹ใฎใฏใ€ใ‚ˆใ‚Š่ฉณ็ดฐใชๅˆถๅพกใŒๅฟ…่ฆใชๅ ดๅˆใฎใฟใงใ™๏ผš + +```json +{ + "title": "ใƒžใ‚คใƒ—ใƒญใ‚ธใ‚งใ‚ฏใƒˆ", + "url": "https://docs.myproject.com", + "src": "./docs", + "out": "./dist" +} +``` + +TypeScript / JavaScript ๅฝขๅผใฎ่จญๅฎšใƒ•ใ‚กใ‚คใƒซใฏๅ‹•็š„ใชๅ€คใฎๆŒ‡ๅฎšใซๅฏพๅฟœใ—ใฆใ„ใพใ™ใ€‚ + +ใƒชใƒ•ใ‚กใƒฌใƒณใ‚นๅ…จไฝ“๏ผš[่จญๅฎšๆฆ‚่ฆ](https://docs.docmd.io/configuration/overview) + +## ใƒ—ใƒญใ‚ธใ‚งใ‚ฏใƒˆๆง‹ๆˆ + +```text +my-docs/ +โ”œโ”€โ”€ docs/ โ† ใ‚ใชใŸใฎ Markdown ใƒ•ใ‚กใ‚คใƒซ +โ”œโ”€โ”€ assets/ โ† ็”ปๅƒใจ้™็š„ใƒ•ใ‚กใ‚คใƒซ +โ”œโ”€โ”€ docmd.config.json โ† ไปปๆ„ใฎ่จญๅฎš +โ””โ”€โ”€ package.json +``` + +## ใƒฉใ‚คใƒ–ใ‚จใƒ‡ใ‚ฃใ‚ฟ + +ใƒ–ใƒฉใ‚ฆใ‚ถใƒ™ใƒผใ‚นใฎใ‚จใƒ‡ใ‚ฃใ‚ฟใงใƒ‰ใ‚ญใƒฅใƒกใƒณใƒˆใ‚’ๅŸท็ญ†ใƒปใƒ—ใƒฌใƒ“ใƒฅใƒผ โ€” ใƒญใƒผใ‚ซใƒซ็’ฐๅขƒๆง‹็ฏ‰ใฏไธ่ฆใ€‚ + +

+ docmd ใƒฉใ‚คใƒ–ใ‚จใƒ‡ใ‚ฃใ‚ฟใฎใƒ—ใƒฌใƒ“ใƒฅใƒผ +

+ +**[live.docmd.io](https://live.docmd.io) ใง่ฉฆใ™** + +## ใƒ—ใƒญใ‚ฐใƒฉใƒžใƒ†ใ‚ฃใƒƒใ‚ฏ API + +Node.js ใ‚นใ‚ฏใƒชใƒ—ใƒˆใ€CI ใƒ‘ใ‚คใƒ—ใƒฉใ‚คใƒณใ€ใ‚ซใ‚นใ‚ฟใƒ ใƒ“ใƒซใƒ‰ใ‚นใƒ†ใƒƒใƒ—ใง docmd ใ‚’ๅˆฉ็”จใงใใพใ™ใ€‚๏ผˆCommonJS / ESM ใฎไธกๅฏพๅฟœใ€‚๏ผ‰ + +```javascript +import { build } from '@docmd/core'; + +await build('./docmd.config.json', { isDev: false }); +``` + +ใƒชใƒ•ใ‚กใƒฌใƒณใ‚นๅ…จไฝ“๏ผš[Node API](https://docs.docmd.io/development/node-api-reference/) + +## ใ‚ณใƒŸใƒฅใƒ‹ใƒ†ใ‚ฃ + +- **ใƒใ‚ฐๅ ฑๅ‘Šใƒปๅ•้กŒ** โ†’ [GitHub Issues](https://github.com/docmd-io/docmd/issues) +- **่ณชๅ•ใƒปใ‚ขใ‚คใƒ‡ใ‚ข** โ†’ [Discussions](https://github.com/orgs/docmd-io/discussions) +- **ใ‚ณใƒณใƒˆใƒชใƒ“ใƒฅใƒผใ‚ทใƒงใƒณ** โ†’ [CONTRIBUTING.md](.github/CONTRIBUTING.md) +- **ใƒญใƒผใƒ‰ใƒžใƒƒใƒ—** โ†’ [GitHub Discussions](https://github.com/orgs/docmd-io/discussions/2) + +## ใ‚ตใƒใƒผใƒˆ + +- docmd ใฎ้–‹็™บใ‚’ๆœ€ใ‚‚็›ดๆŽฅ็š„ใซๆ”ฏๆดใ™ใ‚‹ๆ–นๆณ•ใฏใ€ๅ‘จใ‚Šใฎไบบใซ็Ÿฅใ‚‰ใ›ใ‚‹ใ“ใจใงใ™ใ€‚X ใง [ใ‚ทใ‚งใ‚ข](https://twitter.com/intent/tweet?url=https://github.com/docmd-io/docmd&text=docmd%20-%20Markdown%20ใ‹ใ‚‰%20ๆ•ฐ็ง’ใง%20ใƒ—ใƒญใƒ€ใ‚ฏใ‚ทใƒงใƒณๅ“่ณชใฎ%20ใƒ‰ใ‚ญใƒฅใƒกใƒณใƒˆใ‚’ใ€‚) ใ—ใŸใ‚Šใ€ใ‚นใ‚ฟใƒผใ‚’ไป˜ใ‘ใ‚‹ใฎใ‚‚่‰ฏใ„ใงใ—ใ‚‡ใ†ใ€‚ +- docmd ใŒใ‚ใชใŸใฎๆ™‚้–“ใ‚’็ฏ€็ด„ใงใใฆใ„ใ‚‹ใชใ‚‰ใ€[GitHub Sponsorship](https://github.com/sponsors/mgks) ใฏๅคงใใชๅŠฑใฟใซใชใ‚Šใพใ™ใ€‚ +- ใ‚ขใ‚คใƒ‡ใ‚ขใ‚„ใƒใ‚ฐใŒใ‚ใ‚Œใฐ Issue ใ‚„ PR ใ‚’ใŠๆฐ—่ปฝใซใ€‚ใƒ—ใƒฉใ‚ฐใ‚คใƒณใฎใ‚ณใƒณใƒˆใƒชใƒ“ใƒฅใƒผใ‚ทใƒงใƒณใ‚‚ๆญ“่ฟŽใ—ใพใ™ใ€‚ + +## ใƒฉใ‚คใ‚ปใƒณใ‚น + +MIT โ€” ่ฉณ็ดฐใฏ [`LICENSE`](./LICENSE) ใ‚’ๅ‚็…งใ€‚ \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..3c1eb4a --- /dev/null +++ b/README.md @@ -0,0 +1,286 @@ +
+ + EN  |  ES  |  DE  |  ๆ—ฅๆœฌ่ชž  |  FR  |  ไธญๆ–‡ + +
+ +
+ + + + + + docmd + + + +
+ +

Production-ready documentation from Markdown, in seconds.
Zero config. AI-native. Built for developers.

+ +

+ npm version + monthly downloads + GitHub stars + license +

+ +

+ Website  ยท  + Documentation  ยท  + Live Editor  ยท  + Agent Skills  ยท  + Report a Bug +

+ +
+ + + docmd default theme โ€” light and dark mode preview + + +

+ +
+ +## Quick Start + +Run docmd in any folder with Markdown files โ€” no install needed: + +```bash +npx @docmd/core dev +``` + +
+ Opens at http://localhost:3000
+ +```bash + _ _ + _| |___ ___ _____ _| | + | . | . | _| | . | + |___|___|___|_|_|_|___| + + v1.x.x + +โ”Œโ”€ Build +โ”‚ Engine JS +โ”‚ Source docs/ +โ”‚ Output site/ +โ”‚ Versions 2 (06, 05) +โ”‚ Locales 7 (en, hi, zh, es, de, ja, fr) +โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ +โ”Œโ”€ Data Indexing +โ”‚ [ DONE ] Syncing git metadata +โ”‚ [ DONE ] Building semantic search index (multi-version) +โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ +โ”Œโ”€ Publishing +โ”‚ [ DONE ] Generated robots.txt +โ”‚ [ DONE ] Generated .nojekyll (disables Jekyll on GitHub Pages) +โ”‚ [ DONE ] Generated sitemap +โ”‚ [ DONE ] Generating LLMs context files +โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ + +โฌข Initial build completed in 1.2s. + +โ”Œโ”€ Watching +โ”‚ Source ./docs +โ”‚ Config ./docmd.config.json +โ”‚ Assets ./assets +โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ +โ”Œโ”€ Development Server Running +โ”‚ Local Access http://127.0.0.1:3000 +โ”‚ Network Access http://192.168.1.6:3000 +โ”‚ Serving from ./site +โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ +``` +
+ +

+ docmd dev server preview +

+ +Navigation is generated from your file structure. No config file, no frontmatter required, no framework to learn. + +**When you're ready to ship:** + +```bash +npx @docmd/core build +``` + +This outputs a highly optimized static site (SPA) ready for deployment to Vercel, Cloudflare Pages, Netlify, GitHub Pages, or any static host. + +**Requirements:** Node.js 18+ + +
+ Or install globally / via Docker
+ +```bash +# Install globally via npm +npm install -g @docmd/core + +# Or via pnpm +pnpm add -g @docmd/core + +# Run it +docmd dev # start dev server +docmd build # build for deployment +``` + +Or run via Docker: + +```bash +docker run -p 3000:3000 ghcr.io/docmd-io/docmd:0.8.7 +``` + +> Pin a version for reproducible builds. + +
+ +## Why docmd? + +| Feature | docmd | Docusaurus | MkDocs | VitePress | Mintlify | +| :--- | :---: | :---: | :---: | :---: | :---: | +| **Config required** | **None** | `docusaurus.config.js` | `mkdocs.yml` | `config.mts` | `docs.json` | +| **JS payload** | **~18 kb** | ~250 kb | ~40 kb | ~50 kb | ~120 kb | +| **Navigation** | **Instant SPA** | React SPA | Full reload | Vue SPA | Hosted SPA | +| **Versioning** | **Native** | Native (complex) | mike plugin | Manual | Native | +| **i18n** | **Native** | Native (complex) | Plugin-based | Native | Native | +| **Multi-project** | **Native** | Plugin | Plugin | - | - | +| **Search** | **Built-in** | Algolia (cloud) | Built-in | MiniSearch | Cloud | +| **AI context (`llms.txt`)** | **Built-in** | - | - | - | Built-in | +| **MCP server** | **Built-in** | - | - | - | Built-in | +| **Agent skills** | **Built-in** | - | - | - | - | +| **Docker image** | **Official** | - | Official | - | - | +| **Self-hosted** | **Yes** | Yes | Yes | Yes | - | +| **Cost** | **Free (OSS)** | Free (OSS) | Free (OSS) | Free (OSS) | Freemium | + +## Features + +### Zero config, instant start +Point docmd at any Markdown folder and it runs. Navigation is built automatically from your file structure. You can write your first doc and have it live in under a minute โ€” no boilerplate, no build pipeline to configure, no decisions to make upfront. + +### Tiny by default, fast everywhere +The default JavaScript payload is ~18 kb. Pages navigate as an instant SPA. The output is static HTML โ€” SEO-optimised, with sitemap, canonical URLs, and Open Graph metadata included. Offline full-text search is built in, no cloud service required. + +### AI-native +docmd is built for the way documentation is read and used today: +- **MCP Server** โ€” `docmd mcp` exposes your docs to AI agents over stdio, letting them search, read, and validate content directly. +- **Context (`llms.txt` / `llms-full.txt`)** โ€” complete documentation context generated at build time, ready for any LLM. +- **Agent Skills** โ€” modular instruction sets for LLMs and IDE agents ([docmd-skills](https://github.com/docmd-io/docmd-skills)). +- **Copy as Markdown / Copy Context** โ€” one-click buttons in the browser, optimised for pasting into AI chat. + +### Built to scale +- Internationalisation with multi-locale builds (per-locale search index, llms, okf, hreflang) +- Versioning for multiple doc releases (with auto-detection of the current version) +- Workspaces for monorepos and multi-project setups +- Plugin system for extending core behaviour (per-hook return-type validation, async-friendly) +- Full theming support, built-in templates, custom CSS/JS, light/dark mode + +## CLI + +```bash +docmd dev # local development server +docmd build # build for deployment +docmd live # browser-based Live Editor +docmd init # scaffold a new docmd.config.json in the current folder +docmd stop # stop any running `docmd dev` / `docmd live` servers +docmd doctor # pre-flight check: config + plugin install status +docmd migrate # migrate to docmd from Docusaurus, VitePress, MkDocs, or Starlight +docmd deploy # generate config for Docker, NGINX, Caddy, Vercel, Netlify +docmd validate # check all internal links +docmd mcp # run as an MCP server over stdio +docmd add # install a plugin or template +``` + +## Plugins + +Core functionality is powered by a robust plugin system. The essentials are included by default, while optional plugins can be added for specific needs. + +| Plugin | Status | Description | +| :--- | :---: | :--- | +| `search` | Core | Offline full-text search (keyword + optional semantic via `docmd-search`) | +| `seo` | Core | SEO tags and Open Graph metadata | +| `sitemap` | Core | Generates `sitemap.xml` | +| `git` | Core | Git commit history and last-updated dates | +| `analytics` | Core | Lightweight analytics integration | +| `llms` | Core | AI context generation (`llms.txt` / `llms-full.txt`) | +| `okf` | Core | Open Knowledge Format bundles for AI agents (per-locale) | +| `mermaid` | Core | Mermaid diagram support | +| `openapi` | Core | Build-time OpenAPI 3.x spec renderer | +| `pwa` | Optional | Progressive Web App โ€” offline navigation | +| `threads` | Optional | Inline discussion threads *(by @svallory)* | +| `math` | Optional | KaTeX / LaTeX math rendering | + +Install optional plugins: + +```bash +docmd add +``` + +Build your own: [Plugin Development Guide](https://docs.docmd.io/development/building-plugins/) + +## Configuration + +No configuration is required to get started. Add a `docmd.config.json` (or `.ts` / `.js`) in your project root only when you need more control: + +```json +{ + "title": "My Project", + "url": "https://docs.myproject.com", + "src": "./docs", + "out": "./dist" +} +``` + +TypeScript and JavaScript config files are supported for dynamic values. + +Full reference: [Configuration Overview](https://docs.docmd.io/configuration/overview) + +## Project Structure + +```text +my-docs/ +โ”œโ”€โ”€ docs/ โ† Your markdown files +โ”œโ”€โ”€ assets/ โ† Images and static files +โ”œโ”€โ”€ docmd.config.json โ† Optional configuration +โ””โ”€โ”€ package.json +``` + +## Live Editor + +A browser-based editor for writing and previewing docs โ€” no local setup required. + +

+ docmd live editor preview +

+ +**Try it at [live.docmd.io](https://live.docmd.io)** + +## Programmatic API + +Use docmd in Node.js scripts, CI pipelines, or custom build steps. (Supports both CommonJS and ESM). + +```javascript +import { build } from '@docmd/core'; + +await build('./docmd.config.json', { isDev: false }); +``` + +Full reference: [Node API](https://docs.docmd.io/development/node-api-reference/) + +## Community + +- **Bugs & issues** โ†’ [GitHub Issues](https://github.com/docmd-io/docmd/issues) +- **Questions & ideas** โ†’ [Discussions](https://github.com/orgs/docmd-io/discussions) +- **Contributing** โ†’ [CONTRIBUTING.md](.github/CONTRIBUTING.md) +- **Roadmap** โ†’ [GitHub Discussions](https://github.com/orgs/docmd-io/discussions/2) + +## Support + +- Getting the word out is the most direct way to support docmd's development. [Share it on X](https://twitter.com/intent/tweet?url=https://github.com/docmd-io/docmd&text=docmd%20-%20Production-ready%20docs%20from%20Markdown%20in%20seconds.) with friends or give it a star. +- If docmd saves you time, a [GitHub sponsorship](https://github.com/sponsors/mgks) goes a long way. +- Got ideas or bugs? Open an issue or PR, feel free to contribute your own plugins. + +## License + +MIT License. See `LICENSE` for details. \ No newline at end of file diff --git a/README.wehub.md b/README.wehub.md new file mode 100644 index 0000000..e8284e1 --- /dev/null +++ b/README.wehub.md @@ -0,0 +1,7 @@ +# WeHub ๆฅๆบ่ฏดๆ˜Ž + +- ๅŽŸๅง‹้กน็›ฎ๏ผš`docmd-io/docmd` +- ๅŽŸๅง‹ไป“ๅบ“๏ผšhttps://github.com/docmd-io/docmd +- ๅฏผๅ…ฅๆ–นๅผ๏ผšไธŠๆธธ้ป˜่ฎคๅˆ†ๆ”ฏ็š„ๆœ€ๆ–ฐๅฟซ็…ง +- ๅŽŸไฝœ่€…ใ€็‰ˆๆƒๅ’Œ่ฎธๅฏ่ฏไฟกๆฏไปฅๅŽŸๅง‹ไป“ๅบ“ๅŠๆœฌไป“ๅบ“ LICENSE ไธบๅ‡† +- ๆœฌๆ–‡ไปถไป…็”จไบŽ่ฎฐๅฝ•ๆฅๆบ๏ผŒไธไปฃ่กจ WeHub ๆ˜ฏๅŽŸ้กน็›ฎไฝœ่€… diff --git a/README.zh.md b/README.zh.md new file mode 100644 index 0000000..0397940 --- /dev/null +++ b/README.zh.md @@ -0,0 +1,286 @@ +
+ + EN  |  ES  |  DE  |  ๆ—ฅๆœฌ่ชž  |  FR  |  ไธญๆ–‡ + +
+ +
+ + + + + + docmd + + + +
+ +

ๅ‡ ็ง’ๅ†…ไปŽ Markdown ็”Ÿๆˆ็”Ÿไบงๅฏ็”จ็š„ๆ–‡ๆกฃ็ซ™็‚นใ€‚
้›ถ้…็ฝฎใ€‚AI ๅŽŸ็”Ÿใ€‚ไธบๅผ€ๅ‘่€…ๆ‰“้€ ใ€‚

+ +

+ npm version + ๆฏๆœˆไธ‹่ฝฝ + GitHub stars + license +

+ +

+ ๅฎ˜็ฝ‘  ยท  + ๆ–‡ๆกฃ  ยท  + ๅœจ็บฟ็ผ–่พ‘ๅ™จ  ยท  + Agent Skills  ยท  + ๅ้ฆˆ Bug +

+ +
+ + + docmd ้ป˜่ฎคไธป้ข˜ โ€” ๆต…่‰ฒไธŽๆทฑ่‰ฒๆจกๅผ้ข„่งˆ + + +

+ +
+ +## ๅฟซ้€Ÿๅผ€ๅง‹ + +ๅœจไปปไฝ•ๅŒ…ๅซ Markdown ๆ–‡ไปถ็š„็›ฎๅฝ•ไธ‹็›ดๆŽฅ่ฟ่กŒ docmd โ€”โ€” ๆ— ้œ€ๅฎ‰่ฃ…๏ผš + +```bash +npx @docmd/core dev +``` + +
+ ๅœจ http://localhost:3000 ๆ‰“ๅผ€
+ +```bash + _ _ + _| |___ ___ _____ _| | + | . | . | _| | . | + |___|___|___|_|_|_|___| + + v1.x.x + +โ”Œโ”€ Build +โ”‚ Engine JS +โ”‚ Source docs/ +โ”‚ Output site/ +โ”‚ Versions 2 (06, 05) +โ”‚ Locales 7 (en, hi, zh, es, de, ja, fr) +โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ +โ”Œโ”€ Data Indexing +โ”‚ [ DONE ] Syncing git metadata +โ”‚ [ DONE ] Building semantic search index (multi-version) +โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ +โ”Œโ”€ Publishing +โ”‚ [ DONE ] Generated robots.txt +โ”‚ [ DONE ] Generated .nojekyll (disables Jekyll on GitHub Pages) +โ”‚ [ DONE ] Generated sitemap +โ”‚ [ DONE ] Generating LLMs context files +โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ + +โฌข Initial build completed in 1.2s. + +โ”Œโ”€ Watching +โ”‚ Source ./docs +โ”‚ Config ./docmd.config.json +โ”‚ Assets ./assets +โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ +โ”Œโ”€ Development Server Running +โ”‚ Local Access http://127.0.0.1:3000 +โ”‚ Network Access http://192.168.1.6:3000 +โ”‚ Serving from ./site +โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ +``` +
+ +

+ docmd dev ๆœๅŠกๅ™จ้ข„่งˆ +

+ +ๅฏผ่ˆช็”ฑไฝ ็š„็›ฎๅฝ•็ป“ๆž„่‡ชๅŠจ็”Ÿๆˆใ€‚ๆ— ้œ€้…็ฝฎๆ–‡ไปถใ€ไธๅผบๅˆถ frontmatterใ€ไธๅฟ…ๅญฆไน ๆก†ๆžถใ€‚ + +**ๅฝ“ๅ‡†ๅค‡ๅ‘ๅธƒๆ—ถ๏ผš** + +```bash +npx @docmd/core build +``` + +่ฟ™ไผš่พ“ๅ‡บไธ€ไธช้ซ˜ๅบฆไผ˜ๅŒ–็š„้™ๆ€็ซ™็‚น๏ผˆSPA๏ผ‰๏ผŒๅฏ็›ดๆŽฅ้ƒจ็ฝฒๅˆฐ Vercelใ€Cloudflare Pagesใ€Netlifyใ€GitHub Pages ๆˆ–ไปปไฝ•้™ๆ€ไธปๆœบใ€‚ + +**็Žฏๅขƒ่ฆๆฑ‚๏ผš** Node.js 18+ + +
+ ๆˆ–ๅ…จๅฑ€ๅฎ‰่ฃ… / ้€š่ฟ‡ Docker
+ +```bash +# ้€š่ฟ‡ npm ๅ…จๅฑ€ๅฎ‰่ฃ… +npm install -g @docmd/core + +# ๆˆ–้€š่ฟ‡ pnpm +pnpm add -g @docmd/core + +# ่ฟ่กŒ +docmd dev # ๅฏๅŠจๅผ€ๅ‘ๆœๅŠกๅ™จ +docmd build # ๆž„ๅปบ็”จไบŽ้ƒจ็ฝฒ +``` + +ๆˆ–้€š่ฟ‡ Docker ่ฟ่กŒ๏ผš + +```bash +docker run -p 3000:3000 ghcr.io/docmd-io/docmd:0.8.7 +``` + +> ๅ›บๅฎšไธ€ไธช็‰ˆๆœฌไปฅ่Žทๅพ—ๅฏๅค็Žฐ็š„ๆž„ๅปบใ€‚ + +
+ +## ไธบไป€ไนˆ้€‰ๆ‹ฉ docmd๏ผŸ + +| ็‰นๆ€ง | docmd | Docusaurus | MkDocs | VitePress | Mintlify | +| :--- | :---: | :---: | :---: | :---: | :---: | +| **้œ€่ฆ้…็ฝฎ** | **ๆ— ้œ€** | `docusaurus.config.js` | `mkdocs.yml` | `config.mts` | `docs.json` | +| **JS ไฝ“็งฏ** | **~18 kb** | ~250 kb | ~40 kb | ~50 kb | ~120 kb | +| **ๅฏผ่ˆช** | **ๅณๆ—ถ SPA** | React SPA | ๅ…จ้‡้‡่ฝฝ | Vue SPA | ๆ‰˜็ฎก SPA | +| **็‰ˆๆœฌ็ฎก็†** | **ๅŽŸ็”Ÿ** | ๅŽŸ็”Ÿ๏ผˆๅคๆ‚๏ผ‰ | mike ๆ’ไปถ | ๆ‰‹ๅŠจ | ๅŽŸ็”Ÿ | +| **i18n** | **ๅŽŸ็”Ÿ** | ๅŽŸ็”Ÿ๏ผˆๅคๆ‚๏ผ‰ | ๆ’ไปถๆ–นๅผ | ๅŽŸ็”Ÿ | ๅŽŸ็”Ÿ | +| **ๅคš้กน็›ฎ** | **ๅŽŸ็”Ÿ** | ๆ’ไปถ | ๆ’ไปถ | - | - | +| **ๆœ็ดข** | **ๅ†…็ฝฎ** | Algolia๏ผˆไบ‘๏ผ‰ | ๅ†…็ฝฎ | MiniSearch | ไบ‘ | +| **AI ไธŠไธ‹ๆ–‡ (`llms.txt`)** | **ๅ†…็ฝฎ** | - | - | - | ๅ†…็ฝฎ | +| **MCP ๆœๅŠกๅ™จ** | **ๅ†…็ฝฎ** | - | - | - | ๅ†…็ฝฎ | +| **Agent Skills** | **ๅ†…็ฝฎ** | - | - | - | - | +| **Docker ้•œๅƒ** | **ๅฎ˜ๆ–น** | - | ๅฎ˜ๆ–น | - | - | +| **่‡ชๆ‰˜็ฎก** | **ๅฏ** | ๅฏ | ๅฏ | ๅฏ | - | +| **่ดน็”จ** | **ๅ…่ดน (OSS)** | ๅ…่ดน (OSS) | ๅ…่ดน (OSS) | ๅ…่ดน (OSS) | Freemium | + +## ๅŠŸ่ƒฝ็‰นๆ€ง + +### ้›ถ้…็ฝฎ๏ผŒๅณๆ—ถๅฏๅŠจ +ๆŠŠ docmd ๆŒ‡ๅ‘ไปปๆ„ Markdown ็›ฎๅฝ•๏ผŒๅฎƒๅฐฑไผš่ฟ่กŒใ€‚ๅฏผ่ˆชไผšๆ นๆฎไฝ ็š„็›ฎๅฝ•็ป“ๆž„่‡ชๅŠจ็”Ÿๆˆใ€‚ไฝ ๅฏไปฅๅœจไธๅˆฐไธ€ๅˆ†้’Ÿ็š„ๆ—ถ้—ดๅ†…ๅ†™ๅฅฝ็ฌฌไธ€็ฏ‡ๆ–‡ๆกฃๅนถไธŠ็บฟ โ€”โ€” ๆฒกๆœ‰ๆจกๆฟไปฃ็ ๏ผŒๆฒกๆœ‰้œ€่ฆ้…็ฝฎ็š„ๆž„ๅปบๆต็จ‹๏ผŒไนŸไธ้œ€่ฆๆๅ‰ๅšๆŠ€ๆœฏๅ†ณ็ญ–ใ€‚ + +### ้ป˜่ฎค่ฝป้‡๏ผŒๅค„ๅค„้ซ˜้€Ÿ +้ป˜่ฎค็š„ JavaScript ไฝ“็งฏ็บฆ 18 kb๏ผŒ้กต้ขไปฅๅณๆ—ถ SPA ็š„ๆ–นๅผๅˆ‡ๆขใ€‚่พ“ๅ‡บไธบ้™ๆ€ HTML โ€”โ€” ๅทฒๅšๅฅฝ SEO ไผ˜ๅŒ–๏ผŒๅŒ…ๅซ sitemapใ€canonical URL ไธŽ Open Graph ๅ…ƒๆ•ฐๆฎใ€‚ๅ†…็ฝฎ็ฆป็บฟๅ…จๆ–‡ๆœ็ดข๏ผŒๆ— ้œ€ไปปไฝ•ไบ‘ๆœๅŠกใ€‚ + +### AI ๅŽŸ็”Ÿ +docmd ็š„่ฎพ่ฎก่ดดๅˆๆ–‡ๆกฃๅœจๅฝ“ไปŠ่ขซ้˜…่ฏปไธŽไฝฟ็”จ็š„ๆ–นๅผ๏ผš +- **MCP ๆœๅŠกๅ™จ** โ€” `docmd mcp` ้€š่ฟ‡ stdio ๆŠŠไฝ ็š„ๆ–‡ๆกฃๆšด้œฒ็ป™ AI Agent๏ผŒ่ฎฉๅฎƒไปฌๅฏไปฅ็›ดๆŽฅๆœ็ดขใ€้˜…่ฏปๅนถๆ ก้ชŒๅ†…ๅฎนใ€‚ +- **ไธŠไธ‹ๆ–‡ (`llms.txt` / `llms-full.txt`)** โ€” ๅœจๆž„ๅปบๆ—ถ็”ŸๆˆๅฎŒๆ•ด็š„ๆ–‡ๆกฃไธŠไธ‹ๆ–‡๏ผŒๅฏ่ขซไปปไฝ• LLM ็ซ‹ๅณๆถˆ่ดนใ€‚ +- **Agent Skills** โ€” ้ขๅ‘ LLM ไธŽ IDE Agent ็š„ๆจกๅ—ๅŒ–ๆŒ‡ไปค้›†ๅˆ๏ผˆ[docmd-skills](https://github.com/docmd-io/docmd-skills)๏ผ‰ใ€‚ +- **ๅคๅˆถไธบ Markdown / ๅคๅˆถไธŠไธ‹ๆ–‡** โ€” ๆต่งˆๅ™จๅ†…ไธ€้”ฎๆŒ‰้’ฎ๏ผŒไธ“้—จไธบ็ฒ˜่ดดๅˆฐ AI ๅฏน่ฏไธญๅšไบ†ไผ˜ๅŒ–ใ€‚ + +### ไธบ่ง„ๆจกๅŒ–่€Œ็”Ÿ +- ้€š่ฟ‡ๅคš่ฏญ่จ€ๆž„ๅปบๅฎž็Žฐๅ›ฝ้™…ๅŒ– +- ๆ”ฏๆŒๅคšไธชๆ–‡ๆกฃ็‰ˆๆœฌ็š„็‰ˆๆœฌ็ฎก็† +- ้ขๅ‘ monorepo ไธŽๅคš้กน็›ฎๅœบๆ™ฏ็š„ Workspaces +- ็”จไบŽๆ‰ฉๅฑ•ๆ ธๅฟƒ่กŒไธบ็š„ๆ’ไปถไฝ“็ณป +- ๅฎŒๆ•ด็š„ Theming ๆ”ฏๆŒใ€ๅ†…็ฝฎๆจกๆฟใ€่‡ชๅฎšไน‰ CSS/JS๏ผŒไปฅๅŠๆต…่‰ฒ / ๆทฑ่‰ฒๆจกๅผ + +## CLI + +```bash +docmd dev # ๆœฌๅœฐๅผ€ๅ‘ๆœๅŠกๅ™จ +docmd build # ๆž„ๅปบ็”จไบŽ้ƒจ็ฝฒ +docmd live # ๆต่งˆๅ™จ็ซฏๅœจ็บฟ็ผ–่พ‘ๅ™จ +docmd init # ๅœจๅฝ“ๅ‰็›ฎๅฝ•็”Ÿๆˆๆ–ฐ็š„ docmd.config.json +docmd stop # ๅœๆญขๆญฃๅœจ่ฟ่กŒ็š„ `docmd dev` / `docmd live` ๆœๅŠกๅ™จ +docmd doctor # ้ข„ๆฃ€ๆŸฅ: ้…็ฝฎ + ๆ’ไปถๅฎ‰่ฃ…็Šถๆ€ +docmd migrate # ไปŽ Docusaurus / VitePress / MkDocs / Starlight ๅฏผๅ…ฅ +docmd deploy # ็”Ÿๆˆ Docker / NGINX / Caddy / Vercel / Netlify ้…็ฝฎ +docmd validate # ๆฃ€ๆŸฅๅ…จ้ƒจๅ†…้ƒจ้“พๆŽฅ +docmd mcp # ไปฅ MCP ๆœๅŠกๅ™จๆ–นๅผๅœจ stdio ไธŠ่ฟ่กŒ +docmd add # ๅฎ‰่ฃ…ๆ’ไปถๆˆ–ๆจกๆฟ +``` + +## ๆ’ไปถ + +ๆ ธๅฟƒๅŠŸ่ƒฝ็”ฑไธ€ๅฅ—็จณๅฅ็š„ๆ’ไปถ็ณป็ปŸ้ฉฑๅŠจใ€‚ๅŸบ็ก€่ƒฝๅŠ›้ป˜่ฎคๅทฒๅŒ…ๅซ๏ผŒ็‰นๅฎš้œ€ๆฑ‚ๅฏๅŠ ่ฃ…ๅฏ้€‰ๆ’ไปถใ€‚ + +| ๆ’ไปถ | ็Šถๆ€ | ๆ่ฟฐ | +| :--- | :---: | :--- | +| `search` | ๆ ธๅฟƒ | ๅธฆๆจก็ณŠๅŒน้…็š„็ฆป็บฟๅ…จๆ–‡ๆœ็ดข | +| `seo` | ๆ ธๅฟƒ | SEO ๆ ‡็ญพไธŽ Open Graph ๅ…ƒๆ•ฐๆฎ | +| `sitemap` | ๆ ธๅฟƒ | ็”Ÿๆˆ `sitemap.xml` | +| `git` | ๆ ธๅฟƒ | Git ๆไบคๅކๅฒไธŽๆœ€ๅŽๆ›ดๆ–ฐๆ—ถ้—ด | +| `analytics` | ๆ ธๅฟƒ | ่ฝป้‡็บงๅˆ†ๆž้›†ๆˆ | +| `llms` | ๆ ธๅฟƒ | AI ไธŠไธ‹ๆ–‡็”Ÿๆˆ๏ผˆ`llms.txt` / `llms-full.txt`๏ผ‰ | +| `mermaid` | ๆ ธๅฟƒ | Mermaid ๅ›พ่กจๆ”ฏๆŒ | +| `openapi` | ๆ ธๅฟƒ | ๆž„ๅปบๆœŸ OpenAPI 3.x ่ง„่ŒƒๆธฒๆŸ“ๅ™จ | +| `okf` | Core | ้ขๅ‘ AI ไปฃ็†็š„ Open Knowledge Format ๅŒ… (ๆŒ‰ locale) | +| `pwa` | ๅฏ้€‰ | Progressive Web App โ€”โ€” ็ฆป็บฟๅฏผ่ˆช | +| `threads` | ๅฏ้€‰ | ๅ†…่”่ฎจ่ฎบไธฒ *(by @svallory)* | +| `math` | ๅฏ้€‰ | KaTeX / LaTeX ๆ•ฐๅญฆๅ…ฌๅผๆธฒๆŸ“ | + +ๅฎ‰่ฃ…ๅฏ้€‰ๆ’ไปถ๏ผš + +```bash +docmd add +``` + +ๅผ€ๅ‘ไฝ ่‡ชๅทฑ็š„ๆ’ไปถ๏ผš[ๆ’ไปถๅผ€ๅ‘ๆŒ‡ๅ—](https://docs.docmd.io/development/building-plugins/) + +## ้…็ฝฎ + +ไธŠๆ‰‹ๆ— ้œ€ไปปไฝ•้…็ฝฎใ€‚ไป…ๅœจ้œ€่ฆๆ›ดๅคšๆŽงๅˆถๆ—ถ๏ผŒๅœจ้กน็›ฎๆ น็›ฎๅฝ•ๆทปๅŠ  `docmd.config.json`๏ผˆๆˆ– `.ts` / `.js`๏ผ‰๏ผš + +```json +{ + "title": "ๆˆ‘็š„้กน็›ฎ", + "url": "https://docs.myproject.com", + "src": "./docs", + "out": "./dist" +} +``` + +TypeScript ไธŽ JavaScript ๆ ผๅผ็š„้…็ฝฎๆ–‡ไปถๆ”ฏๆŒๅŠจๆ€ๅ€ผใ€‚ + +ๅฎŒๆ•ดๅ‚่€ƒ๏ผš[้…็ฝฎๆฆ‚่งˆ](https://docs.docmd.io/configuration/overview) + +## ้กน็›ฎ็ป“ๆž„ + +```text +my-docs/ +โ”œโ”€โ”€ docs/ โ† ไฝ ็š„ Markdown ๆ–‡ไปถ +โ”œโ”€โ”€ assets/ โ† ๅ›พ็‰‡ไธŽ้™ๆ€่ต„ๆบ +โ”œโ”€โ”€ docmd.config.json โ† ๅฏ้€‰้…็ฝฎ +โ””โ”€โ”€ package.json +``` + +## ๅœจ็บฟ็ผ–่พ‘ๅ™จ + +ๅŸบไบŽๆต่งˆๅ™จ็š„็ผ–่พ‘ๅ™จ๏ผŒๆ‰€่งๅณๆ‰€ๅพ—ๅœฐๆ’ฐๅ†™ๅนถ้ข„่งˆๆ–‡ๆกฃ โ€”โ€” ๆ— ้œ€ไปปไฝ•ๆœฌๅœฐ้…็ฝฎใ€‚ + +

+ docmd ๅœจ็บฟ็ผ–่พ‘ๅ™จ้ข„่งˆ +

+ +**ๅ‰ๅพ€ [live.docmd.io](https://live.docmd.io) ไฝ“้ชŒ** + +## ็ผ–็จ‹ๅผ API + +ๅœจ Node.js ่„šๆœฌใ€CI ๆตๆฐด็บฟๆˆ–่‡ชๅฎšไน‰ๆž„ๅปบๆญฅ้ชคไธญไฝฟ็”จ docmdใ€‚๏ผˆๅŒๆ—ถๆ”ฏๆŒ CommonJS ไธŽ ESMใ€‚๏ผ‰ + +```javascript +import { build } from '@docmd/core'; + +await build('./docmd.config.json', { isDev: false }); +``` + +ๅฎŒๆ•ดๅ‚่€ƒ๏ผš[Node API](https://docs.docmd.io/development/node-api-reference/) + +## ็คพๅŒบ + +- **Bug ไธŽ้—ฎ้ข˜** โ†’ [GitHub Issues](https://github.com/docmd-io/docmd/issues) +- **้—ฎ้ข˜ไธŽๆƒณๆณ•** โ†’ [Discussions](https://github.com/orgs/docmd-io/discussions) +- **ๅ‚ไธŽ่ดก็Œฎ** โ†’ [CONTRIBUTING.md](.github/CONTRIBUTING.md) +- **่ทฏ็บฟๅ›พ** โ†’ [GitHub Discussions](https://github.com/orgs/docmd-io/discussions/2) + +## ๆ”ฏๆŒๆˆ‘ไปฌ + +- ่ฎฉๆ›ดๅคšไบบ็Ÿฅ้“ docmd ๆ˜ฏๆ”ฏๆŒๅ…ถๅผ€ๅ‘ๆœ€็›ดๆŽฅ็š„ๆ–นๅผ โ€”โ€” ๅœจ X ไธŠ [ๅˆ†ไบซ็ป™ไฝ ็š„ๆœ‹ๅ‹](https://twitter.com/intent/tweet?url=https://github.com/docmd-io/docmd&text=docmd%20-%20ๅ‡ ็ง’ๅ†…ไปŽ%20Markdown%20็”Ÿๆˆ็”Ÿไบงๅฏ็”จ็š„ๆ–‡ๆกฃ็ซ™็‚นใ€‚)๏ผŒๆˆ–็‚นไธช Starใ€‚ +- ๅฆ‚ๆžœ docmd ่Š‚็œไบ†ไฝ ็š„ๆ—ถ้—ด๏ผŒ[GitHub Sponsorship](https://github.com/sponsors/mgks) ๆ˜ฏๅทจๅคง็š„้ผ“ๅŠฑใ€‚ +- ๆœ‰ๆƒณๆณ•ๆˆ–ๅ‘็Žฐ Bug๏ผŸๆฌข่ฟŽๆ Issue ๆˆ– PR๏ผŒๆฌข่ฟŽ่ดก็Œฎไฝ ่‡ชๅทฑ็š„ๆ’ไปถใ€‚ + +## ่ฎธๅฏ + +MIT โ€”โ€” ่ฏฆ่ง [`LICENSE`](./LICENSE)ใ€‚ \ No newline at end of file diff --git a/assets/docmd-cover.webp b/assets/docmd-cover.webp new file mode 100644 index 0000000000000000000000000000000000000000..47f01ab0cde56c89d288a9b8aff152323007d50a GIT binary patch literal 52906 zcmb5Vb97y67cabH+eu^FW|PK7W81dvw6Sg5Mw2vYY`d}T-1ewF=e_qEsPSA|knC0Dy|Hpq#QChblAx0D%4R=Li8{0tNgyLLfH?07N^1W&lw+K`?{z z#fW7}k>-;X6UJi!0g$20te@pa1v>CdcGYYgKC(==a;iG<+Pv@&jaylZpOJr8w>Bh= zdCqt=7#n=ZlFypwUw8uZG1zB)>6&0aF)3YtMo{WndJ%d{dz60Lyv2OOdV_d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$A{NicZkYa7o!eSelk z47?3BMvfM9W>4VJqh6P|%_lmeB|2^h+6+i}n|JD-z?GAuk z|AV1_adW6S0LX9rZ*Ko@|F7x&_W#cRCkpA?xai}PD;nDv89Nv|P~aQc8uADWh>MGI z$eUTJO5i&?8awc)2naD5GPBDoiK*ioIOy9L@d*BR<+lK#3%e_Tn3=wZIlh#czRmBd zz`20`@5yt4{?FaPopXWz4+dfS9S5K$BahDx1^~eA#_48lXKn1HkMCw}W#h={#zUxY zWNTpjzgoAN9yehide5&w-fNA4BqSiP6m7avPnEV=sXaQ_WKmg6jZw0y`rm7tZ$#6} zatd$!-nCPL4X_&c^*_JVD(-|a)U+n(1>(8M^+^wD`mzDOY4#|uVoB?PSjtGPno4d zrlPWqX*=O>NJo%sJ7|eUliprgi`~mT?F2 zDnw{8U8GQ%$(+p;wCo|5Q*^MPCpyeYaf!hVQkIfBmjJ&MMv7XLRoSJmprtzSZ-Y~P zV{mRIYGx}u&}wSse?2m)5FhmnFp53L^P#hW?yl!|p*!r)H>pgkKLPFi z?b?H$pE9^f$Qtg~egcU@Hm The examples below use `:latest` so you can copy-paste and run them immediately. +> **For production, CI, and any reproducible build**, replace `:latest` with the specific version you want โ€” see [Available Tags](#available-tags). + +### Pull the Image + +```bash +# Pull from GitHub Container Registry (GHCR) +docker pull ghcr.io/docmd-io/docmd:latest +``` + +### Run Demo Site + +The image ships with a demo template in `/template`. When you run the container with no volume mount, the entrypoint copies `/template` into `/docs` on first start, so the demo site comes up immediately. + +```bash +# Start with built-in demo site โ€” works out of the box +docker run -p 3000:3000 ghcr.io/docmd-io/docmd:latest + +# Visit http://localhost:3000 +``` + +### Initialize New Project + +```bash +# Create and initialize a new project +mkdir my-docs && cd my-docs +docker run -v $(pwd):/workspace ghcr.io/docmd-io/docmd:latest init + +# Start dev server +docker run -v $(pwd):/workspace -p 3000:3000 ghcr.io/docmd-io/docmd:latest dev +``` + +### Use Existing Docs + +Mounting your own docs into `/docs` always wins โ€” the entrypoint only seeds the demo template when `/docs` is completely empty, so your content is never overwritten. + +```bash +# Mount your docs and start dev server +docker run -v $(pwd)/docs:/docs -p 3000:3000 ghcr.io/docmd-io/docmd:latest + +# Build static site +docker run -v $(pwd)/docs:/docs -v $(pwd)/site:/site ghcr.io/docmd-io/docmd:latest build +``` + +## Available Tags + +The image is published with two tags per release: + +| Tag | Description | When to use | +|-----|-------------|-------------| +| `latest` | Floating alias for the most recent stable release | Quick start, local exploration, throwaway CI | +| `` | Pinned stable release (substitute the version you want) | Production, CI/CD, anything that must be reproducible | + +> **Pin a specific version in production.** The examples below use `:latest` so you can copy-paste and run them immediately. For any pipeline whose output must be reproducible (or whose contracts you don't want silently changing), replace `:latest` with the specific version you want (e.g. `0.8.7`). Check the [package versions page](https://github.com/orgs/docmd-io/packages/container/docmd/versions) for the full list. + +## Multi-Platform Support + +The image is built for multiple architectures: + +- `linux/amd64` - Standard x86_64 servers +- `linux/arm64` - ARM-based servers (AWS Graviton, Raspberry Pi, Apple Silicon) + +Docker automatically pulls the correct image for your platform. + +## Usage Examples + +### Docker Compose + +```yaml +# Replace `:latest` with a specific version (e.g. `0.8.7`) for reproducible +# production builds. See the GitHub releases page for available versions. +services: + docmd: + image: ghcr.io/docmd-io/docmd:latest + ports: + - "3000:3000" + volumes: + - ./docs:/docs + - ./site:/site + # The dev server defaults to 127.0.0.1 (loopback). For LAN access from + # other devices, set DOCMD_HOST=0.0.0.0 or pass --host 0.0.0.0 explicitly. + command: dev +``` + +### GitHub Actions CI/CD + +```yaml +name: Build Docs + +on: + push: + branches: [main] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Build documentation + # Pin to a specific version (replace `:latest`) for reproducible CI runs. + run: | + docker run --rm \ + -v ${{ github.workspace }}/docs:/docs \ + -v ${{ github.workspace }}/site:/site \ + ghcr.io/docmd-io/docmd:latest \ + build + + - name: Deploy to GitHub Pages + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./site +``` + +### Kubernetes Deployment + +```yaml +# Replace `:latest` with a specific version (e.g. `0.8.7`) for reproducible +# production deploys. Update the tag when you upgrade. +apiVersion: apps/v1 +kind: Deployment +metadata: + name: docmd-server +spec: + replicas: 1 + selector: + matchLabels: + app: docmd + template: + metadata: + labels: + app: docmd + spec: + containers: + - name: docmd + image: ghcr.io/docmd-io/docmd:latest + ports: + - containerPort: 3000 + volumeMounts: + - name: docs + mountPath: /docs + # The dev server defaults to 127.0.0.1. For LAN access, set + # DOCMD_HOST=0.0.0.0 or pass --host 0.0.0.0 explicitly. + command: ["docmd", "dev"] + volumes: + - name: docs + configMap: + name: docs-content +``` + +## Environment Variables + +| Variable | Description | Default | +|----------|-------------|---------| +| `NODE_ENV` | Node environment | `production` | +| `DOCMD_CONTAINER` | Container mode flag | `true` | + +## Building Locally + +```bash +# Clone the repository +git clone https://github.com/docmd-io/docmd.git +cd docmd + +# Build the image +docker build -t docmd:local -f docker/Dockerfile . + +# Test the build +docker run --rm -v $(pwd)/docs:/docs docmd:local --version +``` + +## Security Features + +- Runs as non-root user (`docmd`) +- Minimal Alpine Linux base image +- Multi-stage build reduces attack surface +- SBOM (Software Bill of Materials) included +- OCI provenance attestation + +## Health Check + +The image includes a health check that verifies the dev server is running: + +```bash +# Check container health +docker inspect --format='{{.State.Health.Status}}' +``` + +## Troubleshooting + +### Permission Issues + +The entrypoint automatically remaps to the uid:gid of the mounted directory, so files are always owned by the correct host user. If you hit permission issues, verify the mounted path exists and is writable on the host. + +The dev server defaults to 127.0.0.1 (loopback only). To expose it to the LAN +from inside a container, pass the host flag explicitly: + +```bash +# Loopback only (default) โ€” access via http://localhost:3000 from the host +docker run -p 3000:3000 ghcr.io/docmd-io/docmd:latest dev + +# LAN access โ€” the dev server binds to 0.0.0.0 inside the container, and +# the port mapping makes it reachable from other devices on the host's network. +docker run -p 3000:3000 ghcr.io/docmd-io/docmd:latest dev --host 0.0.0.0 +``` + +> **Security**: when you bind to 0.0.0.0, every host that can reach the +> container's port can connect. Only do this on trusted networks. The dev +> server's WebSocket requires an Origin that matches the bind host +> (defence against CSWSH, CWE-1385), but loopback-only is the safer default.nsure you're binding to 0.0.0.0 +docker run -p 3000:3000 ghcr.io/docmd-io/docmd:latest dev --host 0.0.0.0 +``` + +### Memory Issues + +```bash +# For large documentation sites +docker run --memory=2g -v $(pwd)/docs:/docs ghcr.io/docmd-io/docmd:latest build +``` + +## License + +MIT License - see [LICENSE](../LICENSE) for details. + +## Support + +- **Issues**: [GitHub Issues](https://github.com/docmd-io/docmd/issues) +- **Documentation**: [docs.docmd.io](https://docs.docmd.io) +- **Website**: [docmd.io](https://docmd.io) \ No newline at end of file diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 0000000..b446e55 --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,185 @@ +# -------------------------------------------------------------------- +# docmd : the minimalist, zero-config documentation generator. +# +# @package @docmd/core (and ecosystem) +# @website https://docmd.io +# @repository https://github.com/docmd-io/docmd +# @license MIT +# @copyright Copyright (c) 2025-present docmd.io +# +# [docmd-source] - Please do not remove this header. +# -------------------------------------------------------------------- +# +# Multi-stage Dockerfile for docmd +# Creates a minimal production image with docmd CLI pre-installed +# +# Usage: +# Quick Start (with demo site): +# docker run -p 3000:3000 docmd:latest +# +# Initialize new project in current directory: +# docker run -v $(pwd):/workspace docmd:latest init +# +# Run dev server with your docs: +# docker run -v $(pwd)/my-docs:/docs -p 3000:3000 docmd:latest dev +# +# Build static site: +# docker run -v $(pwd)/docs:/docs -v $(pwd)/site:/site docmd:latest build +# +# -------------------------------------------------------------------- + +# ----------------------------------------------------------------------------- +# Stage 1: Build stage - compiles TypeScript and prepares the application +# ----------------------------------------------------------------------------- +FROM node:20-alpine AS builder + +# Install build dependencies for native modules +RUN apk add --no-cache \ + python3 \ + make \ + g++ \ + git \ + curl + +# Install pnpm directly โ€” avoids corepack version resolution issues in CI. +# Bump the pinned version here whenever the monorepo's packageManager field changes. +RUN npm install -g pnpm@10.33.2 + +WORKDIR /app + +# Copy everything (excluding files via .dockerignore) +COPY . . + +# Install dependencies +RUN pnpm install --frozen-lockfile + +# Stub out packages that can't build in Docker before running the full build: +# - engine-rust-binaries: requires cargo; pre-built .node files are in the repo +# - _playground: dev sandbox, not part of the production image +RUN sh tools/docker-prebuild.sh + +# Build all packages +RUN pnpm -r run build + +# Resolve workspace:* deps to real version numbers for standalone use +RUN node tools/resolve-ws-deps.js + +# Pack all packages into tarballs (mimics npm publish) +RUN pnpm -r pack --pack-destination /tarballs + +# Generate a package.json listing every external (non-@docmd) runtime dep of +# @docmd/core's transitive tree. The production stage installs from this file +# instead of a hand-rolled list in the Dockerfile, so adding a dep to any +# @docmd/* package automatically propagates to the Docker image. +RUN node tools/print-okf-runtime-deps.js --emit-pkg=/tarballs/runtime-deps.json + +# ----------------------------------------------------------------------------- +# Stage 2: Production stage - minimal image with only runtime dependencies +# ----------------------------------------------------------------------------- +FROM node:20-alpine AS production + +# Install runtime dependencies +RUN apk add --no-cache \ + git \ + curl \ + bash \ + su-exec + +# Create non-root user for security +RUN addgroup -g 1001 -S docmd && \ + adduser -S -D -H -u 1001 -h /app -s /bin/bash -G docmd -g docmd docmd + +WORKDIR /app + +# Copy packed tarballs from builder +COPY --from=builder /tarballs /tarballs + +# Install only @docmd/* packages (the transitive deps of @docmd/core). +# We extract each docmd-*.tgz tarball into /usr/local/lib/node_modules/@docmd/. +# This bypasses npm/pnpm registry lookups (packages aren't published yet at +# build time). Legacy wrappers (doc.md, @mgks/docmd) and the monorepo root +# tarball are excluded by only matching the docmd-* prefix. +RUN mkdir -p /usr/local/lib/node_modules && \ + for tarball in /tarballs/docmd-*.tgz; do \ + fname=$(basename "$tarball" .tgz) && \ + pkg="${fname%-*}" && \ + scoped="@docmd/${pkg#docmd-}" && \ + mkdir -p "/usr/local/lib/node_modules/$scoped" && \ + tar -xzf "$tarball" -C "/usr/local/lib/node_modules/$scoped" --strip-components=1; \ + done + +# Install external deps from the auto-generated runtime-deps.json produced by +# the builder stage. We extract the dep list with node and pass it straight to +# `npm install -g`, which puts packages into /usr/local/lib/node_modules โ€” +# exactly where Node's global resolution path looks. No hand-rolled list in the +# Dockerfile: adding a dep to any @docmd/* package propagates automatically on +# the next build because the builder stage regenerates runtime-deps.json fresh. +RUN node -e "\ + const p=JSON.parse(require('fs').readFileSync('/tarballs/runtime-deps.json','utf8')); \ + const args=Object.entries(p.dependencies).map(([k,v])=>k+'@'+v); \ + const {execFileSync}=require('child_process'); \ + execFileSync('npm',['install','-g','--omit=dev','--no-audit','--no-fund',...args],{stdio:'inherit'}); \ +" + +# Symlink the docmd CLI onto PATH (chmod +x on the script too โ€” some +# base images strip the executable bit during COPY). +RUN ln -sf /usr/local/lib/node_modules/@docmd/core/dist/bin/docmd.js /usr/local/bin/docmd \ + && chmod +x /usr/local/bin/docmd /usr/local/lib/node_modules/@docmd/core/dist/bin/docmd.js + +# Clean up tarballs to reduce image size +RUN rm -rf /tarballs + +# Create directories for user content +RUN mkdir -p /docs /site && chown -R docmd:docmd /docs /site + +# Seed the default template by running docmd init non-interactively. +# This ensures the image ships exactly what a real `docmd init` produces. +# +# Build does NOT fail on init failure: the image still publishes (so users +# who mount their own /docs are unaffected), but the demo experience is +# degraded and a clear warning is printed. Full stderr from `docmd init` +# is in the build log above this block for diagnosis. +RUN mkdir -p /template && \ + cd /template && \ + if docmd init --yes; then \ + if [ ! -f /template/docmd.config.json ]; then \ + printf '\n[docmd-docker] WARNING: docmd init exited 0 but /template/docmd.config.json is missing.\n' >&2; \ + printf '[docmd-docker] Demo seeding will not work. Mount your own /docs.\n' >&2; \ + fi; \ + else \ + printf '\n[docmd-docker] WARNING: docmd init failed during image build.\n' >&2; \ + printf '[docmd-docker] The `docker run` demo experience will not work. Mount your own /docs.\n' >&2; \ + printf '[docmd-docker] Full error from docmd init is in the build log above this block.\n' >&2; \ + fi + +# Install entrypoint + healthcheck scripts (see docker/docker-entrypoint.sh +# and docker/docker-healthcheck.sh). The entrypoint seeds /docs from +# /template when /docs is empty, so `docker run` with no volume mount +# still works out of the box. The healthcheck probes a port range because +# `docmd dev` may auto-increment past 3000 if the port is already taken. +COPY docker/docker-entrypoint.sh /usr/local/bin/docmd-entrypoint.sh +COPY docker/docker-healthcheck.sh /usr/local/bin/docmd-healthcheck.sh +RUN chmod +x /usr/local/bin/docmd-entrypoint.sh /usr/local/bin/docmd-healthcheck.sh + +# Set environment variables +ENV NODE_ENV=production +ENV DOCMD_CONTAINER=true + +# Run as root so the entrypoint can inspect /docs ownership and use +# su-exec to re-exec as the correct uid:gid. The entrypoint never stays +# as root โ€” it always drops to the detected uid before exec-ing docmd. +# This is the same pattern used by postgres, redis, and other official images. + +# Set working directory to docs (where user content will be mounted) +WORKDIR /docs + +# Expose default port (dev server may pick a higher one if 3000 is in use) +EXPOSE 3000 + +# Health check โ€” probes 3000-3005 to follow the dev server's actual port +HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 CMD ["/usr/local/bin/docmd-healthcheck.sh"] + +# Default command โ€” entrypoint detects /docs uid, drops privileges, then +# seeds /docs if empty and execs the supplied command. +ENTRYPOINT ["/usr/local/bin/docmd-entrypoint.sh"] +CMD ["dev", "--host", "0.0.0.0"] \ No newline at end of file diff --git a/docker/docker-entrypoint.sh b/docker/docker-entrypoint.sh new file mode 100644 index 0000000..8563c5d --- /dev/null +++ b/docker/docker-entrypoint.sh @@ -0,0 +1,67 @@ +#!/bin/sh +# docmd Docker entrypoint +# +# Handles two cases: +# +# 1. No volume / empty /docs โ†’ seeds the demo template so `docmd dev` +# works out of the box with no arguments. +# +# 2. Host-mounted volume โ†’ detects the uid:gid that owns /docs and +# re-execs as that identity (via su-exec), so file writes from any +# subcommand โ€” including `docmd init` โ€” land with the correct host +# ownership without needing `-u $(id -u):$(id -g)` from the caller. +# +# This mirrors the pattern used by official images (postgres, redis, etc.). +set -e + +FIRST_ARG="${1:-}" + +# โ”€โ”€ uid remapping โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ +# If we are currently running as root (the entrypoint is exec'd as root so it +# can inspect /docs ownership), detect the uid:gid of /docs and re-exec as +# that user. This lets `docmd init` and `docmd dev` write to host-mounted +# volumes without permission errors regardless of the host user's uid. +if [ "$(id -u)" = "0" ] && [ -d /docs ]; then + DOCS_UID=$(stat -c '%u' /docs 2>/dev/null || echo "1001") + DOCS_GID=$(stat -c '%g' /docs 2>/dev/null || echo "1001") + + # If /docs is owned by root (uid 0) on the host, fall back to the docmd + # user โ€” writing as root inside the container is a security anti-pattern. + if [ "$DOCS_UID" = "0" ]; then + DOCS_UID="1001" + DOCS_GID="1001" + fi + + # โ”€โ”€ writability check (N-18) โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ + # Catch read-only volume mounts early with a clear message instead of + # letting docmd crash mid-build with a cryptic EROFS / EACCES error. + # Only applies to write commands โ€” `dev`, `build`, `init`. + # Read-only mounts are valid for `validate`, `mcp`, etc. + case "$FIRST_ARG" in + dev|build|init) + if ! touch /docs/.docmd_write_test 2>/dev/null; then + printf '\n[docmd] ERROR: /docs is read-only (or not writable by uid %s).\n' "$DOCS_UID" >&2 + printf '[docmd] Mount a writable directory:\n' >&2 + printf '[docmd] docker run -v $(pwd)/docs:/docs ghcr.io/docmd-io/docmd\n' >&2 + printf '[docmd] Or check directory permissions on the host.\n' >&2 + exit 1 + fi + rm -f /docs/.docmd_write_test + ;; + esac + + # Seed demo template before dropping privileges (root can always write). + if [ "$FIRST_ARG" != "init" ] && \ + [ -z "$(ls -A /docs 2>/dev/null)" ] && \ + [ -d /template ]; then + echo "[docmd] /docs is empty โ€” seeding demo template from /template" + cp -r /template/. /docs/ + chown -R "$DOCS_UID:$DOCS_GID" /docs 2>/dev/null || true + fi + + # Re-exec as the detected uid:gid so all subsequent writes are correctly owned. + exec su-exec "$DOCS_UID:$DOCS_GID" "$0" "$@" +fi + +# โ”€โ”€ already the right user (re-exec path lands here) โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ +exec docmd "$@" \ No newline at end of file diff --git a/docker/docker-healthcheck.sh b/docker/docker-healthcheck.sh new file mode 100644 index 0000000..d4cfa98 --- /dev/null +++ b/docker/docker-healthcheck.sh @@ -0,0 +1,12 @@ +#!/bin/sh +# docmd Docker healthcheck +# +# The dev server may auto-increment its port (3000, 3001, ...) if the +# default port is in use, so we probe a small range instead of hard- +# coding a single port. Returns 0 as soon as any port responds. +for port in 3000 3001 3002 3003 3004 3005; do + if curl -fs --connect-timeout 2 "http://127.0.0.1:${port}/" >/dev/null 2>&1; then + exit 0 + fi +done +exit 1 \ No newline at end of file diff --git a/eslint-rules/index.js b/eslint-rules/index.js new file mode 100644 index 0000000..7961a10 --- /dev/null +++ b/eslint-rules/index.js @@ -0,0 +1,16 @@ +// eslint-rules/index.js โ€” docmd internal ESLint rules. +// Registered in eslint.config.mjs as plugin "docmd". + +import noUnsafeFsRead from './no-unsafe-fs-read.js'; +import requireVerifyClient from './require-verify-client.js'; + +export default { + meta: { + name: 'docmd-internal-rules', + version: '0.0.1' + }, + rules: { + 'no-unsafe-fs-read': noUnsafeFsRead, + 'require-verify-client': requireVerifyClient + } +}; \ No newline at end of file diff --git a/eslint-rules/no-unsafe-fs-read.js b/eslint-rules/no-unsafe-fs-read.js new file mode 100644 index 0000000..5d19a2d --- /dev/null +++ b/eslint-rules/no-unsafe-fs-read.js @@ -0,0 +1,103 @@ +// eslint-rules/no-unsafe-fs-read.js +// Flags fs.* file calls whose path argument was not resolved through +// safePath(root, ...). See DEVELOPMENT-BENCHMARK.md S1 (CWE-22). + +const TARGET_METHODS = new Set([ + 'readFile', 'readFileSync', + 'writeFile', 'writeFileSync', + 'appendFile', 'appendFileSync', + 'unlink', 'unlinkSync', + 'stat', 'statSync', + 'lstat', 'lstatSync', + 'readdir', 'readdirSync', + 'mkdir', 'mkdirSync', + 'rmdir', 'rmdirSync', + 'access', 'accessSync' +]); + +const FS_ROOT_NAMES = new Set(['fs', 'fsPromises', 'nodeFs', 'nodefs', 'fsp']); + +function getFsMethod(node) { + if (node.type !== 'CallExpression') return null; + const callee = node.callee; + if (callee.type !== 'MemberExpression' || callee.computed) return null; + const prop = callee.property; + if (prop.type !== 'Identifier') return null; + if (!TARGET_METHODS.has(prop.name)) return null; + // Only flag when the root object of the call chain is a known fs import. + // Wrappers like ctx.readFile(...) and sourceTools.readFile(...) are NOT flagged + // because they typically perform their own safePath() validation internally. + let obj = callee.object; + while (obj && obj.type === 'MemberExpression' && !obj.computed) { + obj = obj.object; + } + if (!obj || obj.type !== 'Identifier') return null; + if (!FS_ROOT_NAMES.has(obj.name)) return null; + return prop.name; +} + +function isSafeExpr(node, safeNames) { + if (!node) return false; + if (node.type === 'CallExpression' && + node.callee.type === 'Identifier' && + node.callee.name === 'safePath') { + return true; + } + if (node.type === 'Identifier') { + return safeNames.has(node.name); + } + return false; +} + +export default { + meta: { + type: 'problem', + docs: { + description: 'Disallow fs.* file calls whose path argument was not resolved through safePath(root, ...).' + }, + schema: [], + messages: { + unsafe: 'fs.{{ method }}() path argument must be resolved via safePath(projectRoot, userPath). CWE-22 path traversal prevention โ€” see DEVELOPMENT-BENCHMARK.md S1.' + } + }, + + create(context) { + const safeNames = new Set(); + + function isSafePathCall(node) { + return node && + node.type === 'CallExpression' && + node.callee.type === 'Identifier' && + node.callee.name === 'safePath'; + } + + function trackSafePathReturn(node) { + if (!node.init) return; + if (node.id.type !== 'Identifier') return; + if (isSafePathCall(node.init)) { + safeNames.add(node.id.name); + } + } + + function trackAssignment(node) { + // Pattern: x = safePath(...) + if (node.left.type !== 'Identifier') return; + if (node.operator !== '=') return; + if (isSafePathCall(node.right)) { + safeNames.add(node.left.name); + } + } + + return { + VariableDeclarator: trackSafePathReturn, + AssignmentExpression: trackAssignment, + CallExpression(node) { + const method = getFsMethod(node); + if (!method) return; + const firstArg = node.arguments[0]; + if (isSafeExpr(firstArg, safeNames)) return; + context.report({ node, messageId: 'unsafe', data: { method } }); + } + }; + } +}; \ No newline at end of file diff --git a/eslint-rules/require-verify-client.js b/eslint-rules/require-verify-client.js new file mode 100644 index 0000000..eea8605 --- /dev/null +++ b/eslint-rules/require-verify-client.js @@ -0,0 +1,43 @@ +// eslint-rules/require-verify-client.js +// Requires every new WebSocketServer({...}) to include a verifyClient +// callback. See DEVELOPMENT-BENCHMARK.md S3 (CWE-1385). + +export default { + meta: { + type: 'problem', + docs: { + description: 'Require WebSocketServer({...}) to include a verifyClient callback that validates the Origin header.' + }, + schema: [], + messages: { + missing: 'new WebSocketServer({...}) must include a verifyClient callback that validates the Origin header. CWE-1385 (CSWSH) prevention โ€” see DEVELOPMENT-BENCHMARK.md S3.' + } + }, + + create(context) { + function hasVerifyClient(objExpr) { + return objExpr.properties.some((p) => ( + p.type === 'Property' && + !p.computed && + p.key.type === 'Identifier' && + p.key.name === 'verifyClient' + )); + } + + return { + NewExpression(node) { + if (node.callee.type !== 'Identifier') return; + if (node.callee.name !== 'WebSocketServer') return; + if (node.arguments.length === 0) { + context.report({ node, messageId: 'missing' }); + return; + } + const arg = node.arguments[0]; + if (arg.type !== 'ObjectExpression') return; + if (!hasVerifyClient(arg)) { + context.report({ node, messageId: 'missing' }); + } + } + }; + } +}; \ No newline at end of file diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 0000000..cdcdd4e --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,63 @@ +import eslint from '@eslint/js'; +import tseslint from 'typescript-eslint'; +import docmdRules from './eslint-rules/index.js'; + +export default [ + eslint.configs.recommended, + ...tseslint.configs.recommended, + { + languageOptions: { + globals: { + process: 'readonly', + console: 'readonly', + require: 'readonly', + module: 'readonly', + __dirname: 'readonly', + __filename: 'readonly', + setTimeout: 'readonly', + clearTimeout: 'readonly', + requestAnimationFrame: 'readonly', + cancelAnimationFrame: 'readonly', + Buffer: 'readonly', + exports: 'writable', + document: 'readonly', + window: 'readonly', + localStorage: 'readonly', + IntersectionObserver: 'readonly', + fetch: 'readonly', + DOMParser: 'readonly', + history: 'readonly', + CustomEvent: 'readonly', + Event: 'readonly', + MouseEvent: 'readonly', + KeyboardEvent: 'readonly', + getComputedStyle: 'readonly', + navigator: 'readonly', + location: 'readonly', + URL: 'readonly' + } + }, + rules: { + '@typescript-eslint/no-require-imports': 'off', + '@typescript-eslint/no-unused-vars': 'warn', + '@typescript-eslint/no-explicit-any': 'warn', + 'preserve-caught-error': 'off', + '@typescript-eslint/ban-ts-comment': 'warn', + 'no-useless-escape': 'off', + 'no-useless-assignment': 'off', + '@typescript-eslint/no-unused-expressions': 'off' + } + }, + { + ignores: ['**/dist/**', '**/node_modules/**', '**/site/**', 'temp-*/**', '**/public/**'] + }, + { + // docmd internal security rules โ€” Phase 0 failsafe for DEVELOPMENT-BENCHMARK.md S1 and S3. + // Promoted to 'error' after Phase 1 cleans up the surface area. + plugins: { docmd: docmdRules }, + rules: { + 'docmd/no-unsafe-fs-read': 'warn', + 'docmd/require-verify-client': 'error' + } + } +]; \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 0000000..f5ece4b --- /dev/null +++ b/package.json @@ -0,0 +1,93 @@ +{ + "name": "@docmd/monorepo", + "version": "0.8.12", + "private": true, + "description": "The minimalist, zero-config documentation generator monorepo.", + "scripts": { + "dev": "pnpm docmd dev", + "live": "pnpm docmd-live", + "build": "pnpm -r run build", + "doctor": "pnpm docmd doctor", + "validate": "pnpm docmd validate", + "migrate": "pnpm docmd migrate", + "gen:deploy": "pnpm docmd deploy", + "mcp": "pnpm docmd mcp", + "plugin:add": "pnpm docmd add", + "plugin:remove": "pnpm docmd remove", + "docmd": "node packages/core/dist/bin/docmd.js --cwd packages/_playground", + "docmd-live": "node packages/live/bin/docmd-live.js --cwd packages/_playground", + "prep": "node tools/prep.js", + "verify": "node tools/verify.js", + "lint": "eslint .", + "bump": "node tools/bump.js", + "docker:build": "docker build -t docmd:latest -f docker/Dockerfile .", + "docker:build:version": "node -e \"const v=require('./package.json').version; require('child_process').execSync('docker build -t docmd:' + v + ' -t docmd:latest -f docker/Dockerfile .', {stdio:'inherit'})\"", + "docker:test": "docker run --rm -v $(pwd)/docs:/docs docmd:latest --version", + "docker:run": "docker run -p 3000:3000 docmd:latest", + "stop": "node packages/core/dist/bin/docmd.js stop >/dev/null 2>&1 || true", + "clean": "rm -rf node_modules packages/*/node_modules packages/plugins/*/node_modules packages/engines/*/node_modules packages/*/dist packages/plugins/*/dist packages/engines/*/dist packages/engines/rust/native/bin/*.node packages/*/public packages/plugins/*/public packages/*/site packages/plugins/*/site *.tsbuildinfo temp-* >/dev/null 2>&1;", + "unlink": "npm uninstall -g @docmd/core @docmd/monorepo docmd docmd-live -s >/dev/null 2>&1 || true; pnpm uninstall -g @docmd/core @docmd/monorepo docmd docmd-live -s >/dev/null 2>&1 || true; rm -f $(which -a docmd 2>/dev/null) $(which -a docmd-live 2>/dev/null) >/dev/null 2>&1 || true;", + "reset": "node tools/status.js start:reset && pnpm -s stop && pnpm -s unlink && pnpm -s clean && node tools/status.js reset" + }, + "devDependencies": { + "@eslint/js": "^10.0.1", + "@types/node": "^24.13.3", + "chalk": "^4.1.2", + "docmd-search": "^0.1.0", + "esbuild": "^0.28.1", + "eslint": "^10.6.0", + "globals": "^17.7.0", + "typescript": "^5.9.3", + "typescript-eslint": "^8.63.0" + }, + "engines": { + "node": ">=18" + }, + "packageManager": "pnpm@10.33.2", + "pnpm": { + "onlyBuiltDependencies": [ + "esbuild" + ], + "overrides": {}, + "peerDependencyRules": { + "ignoreMissing": [ + "docmd-search" + ] + } + }, + "keywords": [ + "docmd", + "markdown", + "minimalist", + "zero-config", + "site-generator", + "static-site-generator", + "documentation", + "typescript", + "javascript", + "nodejs", + "html", + "browser", + "website", + "generator", + "parser", + "hosted", + "cli", + "ssg", + "docs" + ], + "author": { + "name": "Ghazi", + "url": "https://mgks.dev" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/docmd-io/docmd.git" + }, + "bugs": { + "url": "https://github.com/docmd-io/docmd/issues" + }, + "homepage": "https://docmd.io", + "funding": "https://github.com/sponsors/mgks", + "license": "MIT" +} \ No newline at end of file diff --git a/packages/_playground/.threads/authors.json b/packages/_playground/.threads/authors.json new file mode 100644 index 0000000..a34a129 --- /dev/null +++ b/packages/_playground/.threads/authors.json @@ -0,0 +1,10 @@ +{ + "testuser": { + "name": "TestUser", + "avatarUrl": "https://gravatar.com/avatar/3d5ff960d1bb8dd8c99ef041d5ed5f21?s=80&d=mp" + }, + "ghazi": { + "name": "Ghazi", + "avatarUrl": "https://gravatar.com/avatar/3d5ff960d1bb8dd8c99ef041d5ed5f21?s=80&d=mp" + } +} diff --git a/packages/_playground/docmd.config.json b/packages/_playground/docmd.config.json new file mode 100644 index 0000000..359bc04 --- /dev/null +++ b/packages/_playground/docmd.config.json @@ -0,0 +1,90 @@ +{ + "engine": "rust", + "title": "_playground", + "favicon": "assets/favicon.ico", + "theme": { + "name": "summer", + "customCss": [] + }, + "layout": { + "menubar": { + "enabled": true, + "position": "header", + "left": [ { "text": "Menu 1", "url": "/" }, { "text": "Menu 2", "url": "/nostyle" } ] + }, + "optionsMenu": { + "position": "menubar", + "components": { + "search": true, + "themeSwitch": true, + "sponsor": "https://github.com/sponsors/mgks" + } + }, + "footer": { + "style": "minimal" + } + }, + "plugins": { + "search": { + "semantic": true, + "showConfidence": true + }, + "seo": {}, + "sitemap": {}, + "analytics": { + "googleV4": { "measurementId": "G-X9WTDL262N" } + }, + "llms": {}, + "mermaid": {}, + "git": { + "repo": "https://github.com/docmd-io/docmd" + }, + "openapi": {}, + "math": {}, + "okf": { + "graph": true + } + }, + + "versions": { + "current": "06", + "position": "sidebar-top", + "all": [ + { "id": "06", "dir": "docs", "label": "v0.6.0" }, + { "id": "05", "dir": "docs-05", "label": "v0.5.0", + "navigation": [ + { "title": "V0.5 Home", "path": "/", "icon": "home" }, + { "title": "V0.5 Install", "path": "/getting-started/installation", "icon": "download" } + ] + } + ] + }, + + "i18n": { + "default": "en", + "locales": [ + { "id": "en", "label": "English", "dir": "ltr" }, + { "id": "hi", "label": "เคนเคฟเคจเฅเคฆเฅ€", "dir": "ltr" }, + { "id": "zh", "label": "ไธญๆ–‡", "dir": "ltr" }, + { "id": "es", "label": "Espaรฑol", "dir": "ltr" } + ] + }, + + "navigation": [ + { + "title": "Getting Started", + "children": [ + { "title": "Latest Home", "path": "/", "icon": "home" }, + { + "title": "Mermaid icon test", + "path": "/mermaid-icon-test", + "icon": "mermaid", + "children": [ + { "title": "Nested Page 1", "path": "/nested-page-1" }, + { "title": "Nested Page 2", "path": "/nested-page-2" } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/packages/_playground/docs-05/getting-started/installation.md b/packages/_playground/docs-05/getting-started/installation.md new file mode 100644 index 0000000..32142ed --- /dev/null +++ b/packages/_playground/docs-05/getting-started/installation.md @@ -0,0 +1 @@ +# V0.5.1 Installation diff --git a/packages/_playground/docs-05/index.md b/packages/_playground/docs-05/index.md new file mode 100644 index 0000000..08d83fa --- /dev/null +++ b/packages/_playground/docs-05/index.md @@ -0,0 +1,34 @@ +# V0.5.0 Overview + +This is the documentation for version 0.5.0 of docmd. This version introduces several new features for developers. + +## Features + +- **Developer Tools**: Enhanced debugging capabilities +- **Performance**: Faster build times for large documentation sites +- **Search**: Improved keyword search with better relevance scoring +- **Plugins**: New plugin API for extending functionality + +## Getting Started + +To get started with version 0.5.0, install the package: + +```bash +npm install @docmd/core@0.5.0 +``` + +## Developer Guide + +This version is designed with developers in mind. The new developer tools make it easier to debug and customize your documentation site. + +### Configuration + +Configure your site by creating a `docmd.config.js` file in your project root. + +### Building + +Run the build command to generate your documentation: + +```bash +npx docmd build +``` \ No newline at end of file diff --git a/packages/_playground/docs/.threads/authors.json b/packages/_playground/docs/.threads/authors.json new file mode 100644 index 0000000..6ee4509 --- /dev/null +++ b/packages/_playground/docs/.threads/authors.json @@ -0,0 +1,6 @@ +{ + "ghazi": { + "name": "Ghazi", + "avatarUrl": "https://gravatar.com/avatar/3d5ff960d1bb8dd8c99ef041d5ed5f21?s=80&d=mp" + } +} diff --git a/packages/_playground/docs/en/index.md b/packages/_playground/docs/en/index.md new file mode 100644 index 0000000..9b9418c --- /dev/null +++ b/packages/_playground/docs/en/index.md @@ -0,0 +1,111 @@ +--- +title: "docmd _playground" +description: "A testing ground for docmd core engine features." +--- + +This playground is used to verify core engine changes in real-time. Use this to ensure your modifications to the Markdown parser or UI components behave as expected. + +::: callout tip "How to work here" +To test your changes, keep the dev server running (`pnpm run dev`). Any change you make to `packages/core` or `packages/parser` will trigger a hot-reload here instantly. +::: + +# H1 Test Heading + +This is a test H1 heading to verify it appears in the TOC and has proper anchor links. + +### Component Verification + +Test your UI components and parser rules here to ensure consistency: + +::: card "Container Test" + Test nested callouts and containers. + + ::: callout warning "Warning" + Ensure nested items render correctly. + ::: +::: + +::: tabs +== tab "Feature A" +#### Feature A +Verification content. +== tab "Feature B" +#### Feature B +Verification content. +::: + +### ๐Ÿ”— Useful Links + +- [Official Documentation](https://docs.docmd.io) +- [GitHub Repository](https://github.com/docmd-io/docmd) +- [Report an Issue](https://github.com/docmd-io/docmd/issues) + +### ๐Ÿงช Developer Checklist +- [ ] **Parser:** Does the Markdown output match the HTML in `packages/parser/src/html-renderer.js`? +- [ ] **UI:** Does the theme CSS apply to this page correctly? +- [ ] **SPA:** Does navigation between pages work without a hard refresh? + +### ๐Ÿงœโ€โ™€๏ธ Mermaid Interactive Test + +Test the new interactive controls (Pan, Zoom, Fullscreen) and Lucide icon support here: + +#### Complex Flowchart +```mermaid +graph TD + Start((Start)) --> Process1[Process One] + Process1 --> Decision{Is it valid?} + Decision -- Yes --> Process2[Process Two] + Decision -- No --> Error[Error Handling] + Process2 --> Subgraph1 + subgraph Subgraph1 [Critical Path] + Step1[Step 1] --> Step2[Step 2] + end + Step2 --> End((End)) + Error --> End +``` + +#### Architecture Diagram (Lucide Icons) +```mermaid +flowchart TD + A[Trigger: aaaa] --> B[take an action] + B --> C[x] + C --> D{yyy?} + D -->|No| E[Return] + D -->|Yes| F{zzz?} +``` + +#### Code Block with Title +```typescript "main.ts" +function hello() { + console.log("Hello from docmd!"); +} +``` + +#### Math Plugin Test + +$$ +\sum_{i=1}^n i^2 = \frac{n(n+1)(2n+1)}{6} +$$ + +### ๐Ÿชœ Steps Container Test + +::: steps +1. #### Step One: Initialization + Install dependencies and configure your environment. +2. #### Step Two: Configuration + Modify `docmd.config.json` to suit your project needs. +3. #### Step Three: Build + Run `pnpm build` to compile the templates and documents. +::: + +### ๐Ÿ“… Changelog Container Test + +::: changelog +== v0.8.7 - "Refining Summer Theme" +Refined the Summer theme Table of Contents thread, active ancestor branch indicators, and spacing of components. +* Fixed search modal styling. +* Added custom styling for steps, tabs, cards, and details containers. + +== v0.8.0 - "Release of docmd 0.8" +Initial preview of the zero-config documentation engine with monorepo workspace support. +::: \ No newline at end of file diff --git a/packages/_playground/docs/en/mermaid-icon-test.md b/packages/_playground/docs/en/mermaid-icon-test.md new file mode 100644 index 0000000..ae919bd --- /dev/null +++ b/packages/_playground/docs/en/mermaid-icon-test.md @@ -0,0 +1,22 @@ +--- +title: "Mermaid Icon Test" +--- + +# Mermaid Icon Test + +This diagram tests the generic `icon:` prefix (which maps to the Lucide icon pack): + +```mermaid +architecture-beta + group api(icon:cloud)[API] + service db(icon:database)[Database] in api + service disk(icon:hard-drive)[Storage] in api + db:L -- R:disk +``` + +Check if icons appear correctly. + + +# Tag Test +This is a ::: tag "v0.7.4" color:#f0f inline tag. +And this is a ::: tag "With Icon" icon:star color:blue link:https://google.com inline tag. diff --git a/packages/_playground/docs/en/nested-page-1.md b/packages/_playground/docs/en/nested-page-1.md new file mode 100644 index 0000000..2d127af --- /dev/null +++ b/packages/_playground/docs/en/nested-page-1.md @@ -0,0 +1,14 @@ +--- +title: Nested Page 1 +--- + +# Nested Page 1 + +This is the first nested page for verifying sidebar multi-level navigation. + +::: steps + +1. First step of verification. + +2. Second step of verification. +::: \ No newline at end of file diff --git a/packages/_playground/docs/en/nested-page-2.md b/packages/_playground/docs/en/nested-page-2.md new file mode 100644 index 0000000..b6a5810 --- /dev/null +++ b/packages/_playground/docs/en/nested-page-2.md @@ -0,0 +1,11 @@ +--- +title: Nested Page 2 +--- + +# Nested Page 2 + +This is the second nested page for verifying sidebar multi-level navigation. + +::: callout info +This callout tests the styling consistency within nested pages. +::: \ No newline at end of file diff --git a/packages/_playground/docs/en/practical-tests/README.md b/packages/_playground/docs/en/practical-tests/README.md new file mode 100644 index 0000000..c34d40b --- /dev/null +++ b/packages/_playground/docs/en/practical-tests/README.md @@ -0,0 +1,51 @@ +--- +title: "Practical test index" +description: "Test pages that exercise every Phase 1โ€“3 fix and the OKF plugin in the actual _playground build." +noindex: false +--- + +# Practical test index + +These pages are **deliberately constructed test fixtures** that +exercise every fix shipped in 0.8.8. They live inside the +`_playground` site (alongside the real docs) and are included in +every build. Each page is annotated with a header block that +names the test and the report section it covers. + +The intent is that running `pnpm docmd build` from +`packages/_playground/` produces an output where every Phase +1โ€“3 + OKF fix is observable in a real build, not just in unit +tests. + +## What each page tests + +| Page | Phase | Fix | +|---|---|---| +| [`phase-2/f1-nested-grids`](./phase-2/f1-nested-grids) | 2 | F1 โ€” `::: grids` + Nร— `::: grid` + 1 close per card | +| [`phase-2/f2-self-closing-button`](./phase-2/f2-self-closing-button) | 2 | F2 โ€” self-closing `::: button` + orphan `:::` | +| [`phase-2/f3-mismatched-close`](./phase-2/f3-mismatched-close) | 2 | F3 โ€” `::: callout` closed by `::: card` | +| [`phase-2/f4-triple-close`](./phase-2/f4-triple-close) | 2 | F4 โ€” triple `:::` after balanced callout | +| [`phase-2/f5-five-level-nesting`](./phase-2/f5-five-level-nesting) | 2 | F5 โ€” 5-level nested callouts render all 5 levels | +| [`phase-3/okf-bundle-default`](./phase-3/okf-bundle-default) | 3 + OKF | OKF default-enabled, type inference, noindex opt-out | +| [`phase-3/internal-link-with-trailing-slash`](./phase-3/internal-link-with-trailing-slash) | 3 | M-1 โ€” `validate` accepts trailing-slash links | +| [`phase-3/xss-in-frontmatter`](./phase-3/xss-in-frontmatter) | 1 | T-S3 / S-4 / S-5 โ€” frontmatter XSS payloads escaped | + +> Each page documents, in its own body, what it would render as +> *before* the fix and what it renders as *after* the fix. + +## How to verify + +```bash +cd packages/_playground +node ../../packages/core/dist/bin/docmd.js build +# OKF bundle at site/okf/ (default-enabled โ€” no config needed) +# Generated output in site/ +node ../../packages/core/dist/bin/docmd.js validate +# exit 0 โ€” internal-link-with-trailing-slash.md links to a real page +node ../../packages/core/dist/bin/docmd.js validate --json +# exit 0 (no errors) โ€” JSON output unchanged +``` + +After the build, the OKF bundle at `site/okf/` includes a +`concepts/` directory containing one entry per page. Inspect +`site/okf/okf.yaml` to see the typed manifest. \ No newline at end of file diff --git a/packages/_playground/docs/en/practical-tests/phase-2/container-parser-determinism.md b/packages/_playground/docs/en/practical-tests/phase-2/container-parser-determinism.md new file mode 100644 index 0000000..4c2049b --- /dev/null +++ b/packages/_playground/docs/en/practical-tests/phase-2/container-parser-determinism.md @@ -0,0 +1,80 @@ +--- +title: "Phase 2 โ€” Container parser determinism across worker threads" +description: "Demonstrates that the container normaliser is a pure function of its input. Two workers, 100 concurrent parses, all produce byte-identical HTML." +okf: + type: reference +--- + +# Container parser determinism + +This page documents the **determinism contract** that backs the +Phase 2 parser. The container normaliser is a pure function of +its input โ€” no `Date.now()`, no `Math.random()`, no module-level +mutable state. Two worker threads given the same source produce +byte-identical HTML. + +## How the determinism is enforced + +Three layers, each guarding the next: + +1. **Declarative** โ€” `packages/parser/src/utils/container-normaliser.ts` + has a `DETERMINISM AUDIT` block in the file header that + documents the four non-deterministic primitives the module + deliberately does NOT use (`Date.now()`, `Math.random()`, + module-level `let`/`var`, `process.env` reads). + +2. **Empirical** โ€” `packages/parser/test/container-normaliser.test.js` + has 60 assertions including a 100-way concurrent parse test + AND a real `node:worker_threads` cross-worker parse. Both + assert byte-identical output. + +3. **Regression-proof** โ€” `packages/core/src/engine/worker-parser.ts` + has a `verifyDeterminismAtBoot()` function that runs at the + end of `init()`. It parses a known input through the + freshly-built processor and asserts the output equals a + frozen snapshot. If a future code change introduces + non-determinism, the worker throws at boot and the build + fails immediately. + +## The 100-way test + +The test fixture in `container-normaliser.test.js`: + +```js +test('determinism: 100 concurrent parses of the same source produce identical HTML', async () => { + const md = freshProcessor(); + const src = ''; + const N = 100; + const results = await Promise.all( + Array.from({ length: N }, () => processContentAsync(src, md, {}, { filePath: 'det.md' })) + ); + const first = results[0].htmlContent; + for (let i = 1; i < N; i++) { + assert.equal(results[i].htmlContent, first, `divergence at index ${i}`); + } +}); +``` + +100 parallel parses, byte-identical output. This is the +strongest empirical guarantee we have that parallel workers +won't produce inconsistent output. + +## Why determinism matters + +docmd is built around a **worker pool** โ€” the build process +shards pages across multiple threads, parses each shard +independently, then writes the results. If the parser were +non-deterministic (e.g. depended on a global counter, a +timestamp, or a shared cache), two workers given the same +input would produce different HTML. That would break: +- Caching layers (the same content rendered twice should + hash the same). +- The boot-time self-test (any non-determinism crashes the + worker at init, before the first message is processed). +- Reproducible builds (`pnpm build` should produce the same + output every time, given the same source). + +## OKF classification + +`okf.type: reference` โ€” explicit. The page is included in the +OKF bundle as a `reference` concept. diff --git a/packages/_playground/docs/en/practical-tests/phase-2/f1-nested-grids.md b/packages/_playground/docs/en/practical-tests/phase-2/f1-nested-grids.md new file mode 100644 index 0000000..7586506 --- /dev/null +++ b/packages/_playground/docs/en/practical-tests/phase-2/f1-nested-grids.md @@ -0,0 +1,71 @@ +--- +title: "F1: nested grids with one close per card" +description: "The pre-Phase 2 parser dumped the whole grids block as raw

::: grids
::: grid
...
:::

text. Post-fix it renders four grid-items, each containing one card." +okf: + type: guide +--- + +# F1 โ€” nested grids with one close per card + +This page exercises the **F1 container parser fix** from +`battle-test-reports/test-report.md ยงF1`. The pattern below used +to be the user-reported "grids don't work" bug. + +## The pattern + +```markdown +::: grids + ::: grid + ::: card "Fast" + Lightning fast. + ::: + ::: grid + ::: card "Simple" + Zero config. + ::: + ::: grid + ::: card "Open" + Fully open source. + ::: + ::: grid + ::: card "Live" + Edit in browser. + ::: +::: +``` + +## The rendered result (post-fix) + +::: grids + ::: grid + ::: card "Fast" + Lightning fast. + ::: + ::: grid + ::: card "Simple" + Zero config. + ::: + ::: grid + ::: card "Open" + Fully open source. + ::: + ::: grid + ::: card "Live" + Edit in browser. + ::: +::: + +The normaliser balances the missing closes so the `grids` rule +matches and the inner `grid` and `card` rules can do their work. + +## What the pre-fix output looked like + +A single `

::: grids
::: grid
::: card "Fast"
...
:::

` +text block. The whole nested structure was dumped as a +paragraph of source code. + +## OKF classification + +This page declares `okf.type: guide` explicitly. In the OKF +bundle, it lives in `concepts/practical-tests-phase-2-f1-nested-grids.md` +with the `type: guide` field set. diff --git a/packages/_playground/docs/en/practical-tests/phase-2/f2-self-closing-button.md b/packages/_playground/docs/en/practical-tests/phase-2/f2-self-closing-button.md new file mode 100644 index 0000000..6857644 --- /dev/null +++ b/packages/_playground/docs/en/practical-tests/phase-2/f2-self-closing-button.md @@ -0,0 +1,48 @@ +--- +title: "F2: self-closing button + orphan :::" +description: "The pre-Phase 2 parser treated self-closing ::: button as a non-self-closing container, corrupting the depth counter for everything that followed. Post-fix the orphan ::: is removed with a [normaliser] WARNING." +okf: + type: guide +--- + +# F2 โ€” self-closing button + orphan `:::` + +This page exercises the **F2 self-closing tag fix** from +`battle-test-reports/test-report.md ยงF2`. The pattern below used +to leave an orphan `:::` visible in the page AND corrupt the +depth counter for any container that followed. + +## The pattern + +```markdown +::: card "Cards with self-closing buttons" +Some text. +::: button "Get Started" /getting-started +::: +``` + +## The rendered result (post-fix) + +::: card "Cards with self-closing buttons" +Some text. +::: button "Get Started" /getting-started +::: + +The `::: button` is a self-closing tag (per the parser's +`SELF_CLOSING_CONTAINER_NAMES` set). The orphan `:::` is +removed by the container normaliser with a `[normaliser] WARNING +...` line in the build log. The card is closed correctly. + +## What the pre-fix output looked like + +The `::: button` was pushed to the depth stack as a normal +container. The orphan `:::` decremented depth of the wrong +container (not the button, not the card โ€” an arbitrary parent +in the parser's state). Any container after this point on the +page would have its open/close count misaligned. + +## OKF classification + +`okf.type: guide` โ€” explicit. In the OKF bundle, this page is +classified as a `guide` and the frontmatter's `okf` block is +preserved. diff --git a/packages/_playground/docs/en/practical-tests/phase-2/f3-mismatched-close.md b/packages/_playground/docs/en/practical-tests/phase-2/f3-mismatched-close.md new file mode 100644 index 0000000..fa0f7fc --- /dev/null +++ b/packages/_playground/docs/en/practical-tests/phase-2/f3-mismatched-close.md @@ -0,0 +1,53 @@ +--- +title: "F3: mismatched close types" +description: "The pre-Phase 2 parser dumped the ::: callout opener as raw text when the page contained a ::: card opener in the middle. Post-fix the callout is auto-closed at EOF with a [normaliser] ERROR." +okf: + type: guide +--- + +# F3 โ€” mismatched close types + +This page exercises the **F3 mismatched close types fix** from +`battle-test-reports/test-report.md ยงF3`. The pattern below used +to silently re-root the parser โ€” the `::: callout` opener was +dumped as text, the `::: card` rendered standalone, and the +`:::` close was miscounted. + +## The pattern + +```markdown +::: callout info "x" +body +::: card "wrong close" +oops +::: +``` + +## The rendered result (post-fix) + +::: callout info "x" +body +::: card "wrong close" +oops +::: + +The `callout` rule matches its own body; the inner `card` rule +matches its own body; the trailing `:::` closes the card. The +outer callout is auto-closed at EOF with a `[normaliser] ERROR +... Unclosed from line 1 โ€” auto-closed at EOF` line in +the build log. + +## What the pre-fix output looked like + +A `

::: callout info "x"
body

` paragraph (the callout +opener was dumped as text), followed by the card rendered +standalone โ€” the callout's open/close count was off by 1 because +the inner `::: card` was miscounted as a depth-incrementing +container, so the `:::` close dropped the count to 1 instead of +0, and the callout rule never matched. + +## OKF classification + +`okf.type: guide` โ€” explicit. This page deliberately has an +unclosed container; the OKF bundle still includes it (it +generates a per-page warning, but does not exclude the page). diff --git a/packages/_playground/docs/en/practical-tests/phase-2/f4-triple-close.md b/packages/_playground/docs/en/practical-tests/phase-2/f4-triple-close.md new file mode 100644 index 0000000..3d26079 --- /dev/null +++ b/packages/_playground/docs/en/practical-tests/phase-2/f4-triple-close.md @@ -0,0 +1,52 @@ +--- +title: "F4: triple close erases content" +description: "The pre-Phase 2 parser left bare ::: lines visible in the page as

:::

paragraphs. Post-fix the orphans are removed with [normaliser] WARNINGs." +okf: + type: guide +--- + +# F4 โ€” triple close erases content + +This page exercises the **F4 triple-close / orphan `:::` fix** +from `battle-test-reports/test-report.md ยงF4`. The pattern below +used to leak `

:::

` paragraphs into the rendered page. + +## The pattern + +```markdown +::: callout info "x" +body +::: +::: +::: +``` + +## The rendered result (post-fix) + +::: callout info "x" +body +::: +::: +::: + +The first `:::` closes the callout (matching). The second and +third are stray โ€” the normaliser removes them with two +`[normaliser] WARNING ... Stray \`:::\` removed` lines in the +build log. The rendered page contains the callout block and +NOTHING ELSE (no orphan `

:::

` leak). + +## What the pre-fix output looked like + +The callout rendered correctly (one close matched the opener). +But the next two `:::` lines were outside any container, so +markdown-it rendered them as a single paragraph: +`

:::
:::

`. Users saw two `:::` characters inline with +their content โ€” a visible artefact of the parser's loose +matching. + +## OKF classification + +`okf.type: guide` โ€” explicit. Despite the unclosed trailing +container, the page IS included in the OKF bundle (the orphan +removal happens in the page body, not in frontmatter; OKF +itself has no unclosed containers). diff --git a/packages/_playground/docs/en/practical-tests/phase-2/f5-five-level-nesting.md b/packages/_playground/docs/en/practical-tests/phase-2/f5-five-level-nesting.md new file mode 100644 index 0000000..f0fb5e1 --- /dev/null +++ b/packages/_playground/docs/en/practical-tests/phase-2/f5-five-level-nesting.md @@ -0,0 +1,61 @@ +--- +title: "F5: 5-level nested callouts render all 5 levels" +description: "The pre-Phase 2 parser collapsed 5-level nested callouts into the outer level. Post-fix all 5 levels render in the output HTML." +okf: + type: guide +--- + +# F5 โ€” 5-level nested callouts + +This page exercises the **F5 5-level nested callout fix** from +`battle-test-reports/test-report.md ยงF5`. The pattern below used +to collapse the inner levels โ€” the user saw `
l1
` with only the "deep" body and no +intermediate levels. + +## The pattern + +```markdown +::: callout info "l1" +::: callout tip "l2" +::: callout warning "l3" +::: callout danger "l4" +::: callout success "l5" +deep +::: +::: +::: +::: +::: +``` + +## The rendered result (post-fix) + +::: callout info "l1" +::: callout tip "l2" +::: callout warning "l3" +::: callout danger "l4" +::: callout success "l5" +deep +::: +::: +::: +::: +::: + +The container normaliser adds four implicit closes when the +user's single `:::` close closes the outer callout. Each inner +`callout` rule then matches its own body recursively. + +## What the pre-fix output looked like + +A single `
` containing only +the text "deep" โ€” the inner callouts were dropped silently +because the depth counter never reached 0 at the expected +position. + +## OKF classification + +`okf.type: guide` โ€” explicit. The page is treated as a single +`guide` concept in the OKF bundle. The nested callouts are +preserved in the page body verbatim (OKF copies `rawMarkdown`). diff --git a/packages/_playground/docs/en/practical-tests/phase-3/cli-exit-codes.md b/packages/_playground/docs/en/practical-tests/phase-3/cli-exit-codes.md new file mode 100644 index 0000000..22ccb1f --- /dev/null +++ b/packages/_playground/docs/en/practical-tests/phase-3/cli-exit-codes.md @@ -0,0 +1,72 @@ +--- +title: "Phase 3 โ€” CLI exit codes (F6, M-12)" +description: "The pre-Phase 3 docmd CLI exited 0 on many documented failure paths. Post-fix every documented error path exits 1. This page documents the contract." +--- + +# Phase 3 โ€” CLI exit codes (F6, M-12) + +This page documents the **Phase 3 PR 3.A exit-code contract fix** +from `battle-test-reports/test-report.md ยงF6` and +`battle-test-reports/more-report.md ยงM-12`. + +## The contract + +Every documented `docmd ` failure path MUST exit with +a non-zero code so CI pipelines can gate on it. Before this fix, +several paths printed a clear error message but exited 0, +silently passing broken builds. + +## The 5 paths that were fixed + +| Command | Failure case | Pre-fix exit | Post-fix exit | +|---|---|---|---| +| `docmd build` | Unknown plugin in config | 0 | 1 | +| `docmd migrate` | No `--docusaurus`/`--mkdocs`/etc. flag | 0 | 1 | +| `docmd migrate --help` | (it's a help print) | 0 | 0 (unchanged) | +| `docmd remove ` | Plugin not in registry | 0 | 1 | +| `docmd validate --json` | Broken links in any page | 0 | 1 | + +## The mechanism + +A new helper module `packages/core/src/utils/exit.ts` exports +three functions: + +- `exitCodeFor(err)` โ€” returns the numeric exit code. Today + always 1 (operational error); the indirection lets us + introduce code-2/3/4 later without rewriting every call site. +- `exitWithError(err, opts?)` โ€” calls `TUI.error` (or prints + JSON when `opts.json === true`) and `process.exit(code)`. +- `failWith(message, opts?)` โ€” convenience wrapper for the + "plain message, no Error object" case. + +For `migrate` and `remove`, the `TUI.error(...); return;` pattern +was replaced with `process.exit(1)` (or, in `migrate.ts`, a +`exitWithError` call). For `build`, the new `getPluginLoadErrors()` +in `@docmd/api` returns a list of plugins that failed to load, +and `build.ts` throws if the list is non-empty โ€” the existing +catch block turns the throw into `process.exit(1)`. + +## How to verify + +```bash +cd packages/_playground + +# F6: unknown plugin โ†’ exit 1 +mkdir -p /tmp/f6 && cd /tmp/f6 +echo '{"title":"F6","plugins":{"nope":{}}}' > docmd.config.json +node ../../packages/core/dist/bin/docmd.js build +echo $? # 1 + +# M-12: validate --json with broken links โ†’ exit 1 +cd /tmp/m12 && echo '[bad](/nope)' > docs/index.md +node ../../packages/core/dist/bin/docmd.js validate --json +echo $? # 1 + +# Sanity: --help still exits 0 +node ../../packages/core/dist/bin/docmd.js migrate --help +echo $? # 0 +``` + +The test matrix is `scripts/brute-test.js` test 26 (7 assertions, +regression-tested in the categorised test suite under +`tests/cli-contracts/exit-codes.test.js`). diff --git a/packages/_playground/docs/en/practical-tests/phase-3/internal-link-with-trailing-slash.md b/packages/_playground/docs/en/practical-tests/phase-3/internal-link-with-trailing-slash.md new file mode 100644 index 0000000..b7a1158 --- /dev/null +++ b/packages/_playground/docs/en/practical-tests/phase-3/internal-link-with-trailing-slash.md @@ -0,0 +1,58 @@ +--- +title: "M-1: internal link with trailing slash" +description: "The pre-Phase 3 docmd validate command false-positived every internal link with a trailing slash. Post-fix the trailing slash is stripped before the .md existence check." +--- + +# M-1 โ€” internal link with trailing slash + +This page exercises the **M-1 trailing-slash false-positive fix** +from `battle-test-reports/more-report.md ยงM-1`. The link below +used to be reported as a broken link by `docmd validate` even +though the target file existed. + +## The pattern + +A markdown link with a trailing slash to a sibling page (one +directory up, then down into `phase-2`): + +```markdown +Links to [F1 grids test](../phase-2/f1-nested-grids/). +``` + +## The rendered result (post-fix) + +Links to [F1 grids test](../phase-2/f1-nested-grids/). + +The link's `href` is `../../phase-2/f1-nested-grids/`. The build +treats this as equivalent to `../../phase-2/f1-nested-grids` +(without slash) โ€” both resolve to the same generated HTML page. +`docmd validate` now agrees. + +## What the pre-fix output looked like + +`docmd validate` reported: + +``` +[docs/en/practical-tests/phase-3/internal-link-with-trailing-slash.md:N] + ../../phase-2/f1-nested-grids/ -> Broken link: target resolved to + docs/en/practical-tests/phase-2/f1-nested-grids does not exist +``` + +The validator did `fs.existsSync('docs/en/practical-tests/phase-2/f1-nested-grids/.md')` +which is always false. CI pipelines that gated on +`docmd validate` exited 0 (because exit 0 is the default for +no-broken-links), so broken-link regressions slipped through. + +## How to verify + +```bash +cd packages/_playground +node ../../packages/core/dist/bin/docmd.js validate +# exit 0 โ€” no broken links +node ../../packages/core/dist/bin/docmd.js validate --json | jq '.errors | length' +# 0 +``` + +The fix lives in `packages/core/src/commands/mcp.ts` +`validateLinks()` โ€” a single `stripped` variable drops the +trailing `/` before the four `fs.existsSync` checks. diff --git a/packages/_playground/docs/en/practical-tests/phase-3/llms-and-okf-default-locale.md b/packages/_playground/docs/en/practical-tests/phase-3/llms-and-okf-default-locale.md new file mode 100644 index 0000000..3d0c248 --- /dev/null +++ b/packages/_playground/docs/en/practical-tests/phase-3/llms-and-okf-default-locale.md @@ -0,0 +1,99 @@ +--- +title: "LLMS and OKF: default-locale-only by default" +description: "Both the @docmd/plugin-llms and @docmd/plugin-okf plugins write the default locale's files at the bundle root by default. Non-default locales are only written when the user explicitly opts in via plugins.llms.i18n: true or plugins.okf.localeStrategy: 'folders'." +--- + +# LLMS and OKF โ€” default-locale-only by default + +This page documents the **i18n contract** for the two AI-agent +plugins shipped with docmd 0.8.8: + +- `@docmd/plugin-llms` โ€” generates `llms.txt` / `llms-full.txt` / `llms.json` +- `@docmd/plugin-okf` โ€” generates the OKF bundle (`site/okf/`) + +Both plugins used to write **per-locale** output by default. That +default was wrong for two reasons: + +1. The `llms.txt` filename is the standard single-file name that + downstream consumers (Cursor, Claude, GPT, etc.) look for. + Splitting it into `llms.en.txt` + `llms.hi.txt` + `llms.fr.txt` + broke every existing integration. + +2. The OKF bundle is meant to be a "knowledge base" โ€” the user + doesn't want to push 6 locale variants of every concept to a + vector store. They want the primary-language version, with + non-default locales as opt-in extras. + +## The new default + +| Plugin | Default behaviour | File name | +|---|---|---| +| `llms` | Default locale only | `llms.txt`, `llms-full.txt`, `llms.json` | +| `okf` | Default locale only | `site/okf/okf.yaml`, `site/okf/concepts/*.md`, etc. | + +The default locale is whatever `config.i18n.default` resolves to. +Single-locale sites (no `config.i18n` block) are unaffected โ€” they +get the same single set of files as before. + +## Opting into multi-locale + +Set the corresponding option in `docmd.config.json`: + +```json +{ + "plugins": { + "llms": { "i18n": true }, + "okf": { "localeStrategy": "folders" } + } +} +``` + +With both options set, the plugins write per-locale output: + +``` +site/llms.txt โ† default locale (en) โ€” UNSUFFIXED +site/llms-full.txt โ† default locale (en) โ€” UNSUFFIXED +site/llms.json โ† default locale (en) โ€” UNSUFFIXED +site/llms.hi.txt โ† hi โ€” suffixed +site/llms-full.hi.txt โ† hi โ€” suffixed +site/llms.hi.json โ† hi โ€” suffixed +site/llms.fr.txt โ† fr โ€” suffixed +site/llms-full.fr.txt โ† fr โ€” suffixed +site/llms.fr.json โ† fr โ€” suffixed + +site/okf/ โ† default locale +โ”œโ”€โ”€ okf.yaml +โ”œโ”€โ”€ index.md +โ”œโ”€โ”€ concepts/ +โ”‚ โ””โ”€โ”€ root.md +โ””โ”€โ”€ _meta/, graph.html, graph.json, ... + +site/okf/hi/ โ† hi โ€” suffixed directory +โ”œโ”€โ”€ concepts/ +โ”‚ โ””โ”€โ”€ hi.md + +site/okf/fr/ โ† fr โ€” suffixed directory +โ”œโ”€โ”€ concepts/ +โ”‚ โ””โ”€โ”€ fr.md +``` + +Notice the pattern: **the default locale never gets a suffix or a +subdirectory** โ€” it sits at the bundle root where existing +consumers expect it. Only the non-default locales get the +`/` (OKF) or `.` (LLMS) suffix. + +## How to verify + +The current `_playground` is a single-locale project (en only), +so both plugins write a single set of files at the root โ€” no +suffix, no subdirectory. To test multi-locale, set +`config.i18n.locales` to include more than one locale AND enable +the opt-in flags shown above. + +## OKF classification + +This page sits at `/en/practical-tests/phase-3/llms-and-okf-default-locale/` +which doesn't match any of the OKF type-inference prefixes +(`/api/`, `/guides/`, etc.). It falls back to the default type: +`concept`. In the OKF bundle, it lives at +`site/okf/concepts/llms-and-okf-default-locale.md`. diff --git a/packages/_playground/docs/en/practical-tests/phase-3/okf-bundle-default.md b/packages/_playground/docs/en/practical-tests/phase-3/okf-bundle-default.md new file mode 100644 index 0000000..04e06d5 --- /dev/null +++ b/packages/_playground/docs/en/practical-tests/phase-3/okf-bundle-default.md @@ -0,0 +1,64 @@ +--- +title: "OKF default-enabled + type inference" +description: "This page is included in the OKF bundle by default (no plugins.okf config needed), demonstrates the path-prefix type inference map, and shows the noindex + okf: false opt-out paths in the body." +--- + +# OKF โ€” default-enabled + type inference + +This page exercises the **OKF plugin (0.8.8)**: + +- **Default-enabled** โ€” the `site/okf/` bundle is generated + even when `docmd.config.json` has no `plugins.okf` entry. + See [`README.md` of `@docmd/plugin-okf`][okf-readme] for the + callout. +- **Type inference** โ€” pages under `/api/` are auto-classified + as `api`, pages under `/guides/` as `guide`, etc. The path + prefix map is documented in the OKF README. +- **Per-page opt-out** โ€” pages with `noindex: true` or + `okf: false` in frontmatter are excluded from the bundle. + +[okf-readme]: ../../../../plugins/okf/README.md + +## How OKF classifies this page + +This page is at `/en/practical-tests/phase-3/okf-bundle-default/` +which doesn't match any of the type-inference prefixes +(`guides/`, `api/`, `reference/`, `concepts/`, `runbooks/`, +`datasets/`, `metrics/`, `tables/`). So OKF falls back to the +default type: `concept`. Look at `site/okf/okf.yaml` after +the build to see this page listed under the `concept` type. + +## OKF: false opt-out + +A page with this frontmatter would be excluded from the bundle: + +```markdown +--- +okf: false +--- +``` + +We don't actually use that here (because we want to verify the +page IS in the bundle), but the OKF plugin's `onPostBuild` +filters pages where `p.frontmatter.okf === false`. + +## `noindex: true` opt-out + +A page with `noindex: true` is excluded from the OKF bundle +AND from the sitemap, search index, and llms.txt. This is the +standard docmd opt-out โ€” applies to multiple plugins uniformly. + +## What to inspect after the build + +After running `pnpm docmd build` from `packages/_playground/`: + +```bash +ls site/okf/concepts/ | head # one .md per page +cat site/okf/okf.yaml | head -30 # typed manifest +open site/okf/graph.html # interactive graph viewer +``` + +The `okf.yaml` file lists every concept in the bundle with its +type, path, locale, and version. The graph viewer renders a +force-directed graph of the concept relationships inferred from +internal markdown links. diff --git a/packages/_playground/docs/en/practical-tests/phase-3/okf-type-inference.md b/packages/_playground/docs/en/practical-tests/phase-3/okf-type-inference.md new file mode 100644 index 0000000..8cc9053 --- /dev/null +++ b/packages/_playground/docs/en/practical-tests/phase-3/okf-type-inference.md @@ -0,0 +1,70 @@ +--- +title: "OKF type inference โ€” no frontmatter needed" +description: "OKF classifies pages by URL path prefix even when frontmatter has no okf.type. /api/ โ†’ api, /guides/ โ†’ guide, etc. This page sits in /en/practical-tests/ which doesn't match any prefix, so it falls back to the default type 'concept'." +--- + +# OKF type inference โ€” no frontmatter needed + +This page exercises the **OKF type inference** feature: when a +page has no explicit `okf.type` in frontmatter, OKF infers a +type from the URL path prefix. + +## The inference map + +| URL prefix | Inferred type | +|---|---| +| `/api/` | `api` | +| `/guides/` | `guide` | +| `/reference/` | `reference` | +| `/concepts/` | `concept` | +| `/runbooks/` | `runbook` | +| `/datasets/` | `dataset` | +| `/metrics/` | `metric` | +| `/tables/` | `table` | +| (anything else) | `concept` (the defaultType) | + +The map is implemented in `packages/plugins/okf/src/index.ts` +`PATH_TYPE_MAP`. + +## This page's inferred type + +This page is at `/en/practical-tests/phase-3/okf-type-inference/`. +That path doesn't match any of the inference prefixes. The +page has no `okf.type` in frontmatter, so OKF falls back to the +default type: **`concept`**. Look at `site/okf/okf.yaml` after +the build to see this page classified under the `concept` +type. + +## What happens with explicit frontmatter + +If this page had: + +```yaml +--- +okf: + type: api +--- +``` + +โ€ฆthen OKF would classify it as `api` (explicit overrides +inferred). The precedence in `resolveType()` is: + +1. `frontmatter.okf.type` (nested) โ€” explicit +2. `frontmatter.` (top-level) โ€” usually `type:` in + modern docmd pages +3. `frontmatter.okfType` (legacy) โ€” old alias +4. Path-prefix inference (this section) +5. `defaultType` from config (default: `concept`) + +## How to verify + +After `pnpm docmd build` from `packages/_playground/`: + +```bash +grep -A 2 "okf-type-inference" site/okf/okf.yaml +# Should list this page with type: concept +``` + +To see explicit-vs-inferred, edit the frontmatter of this page +to add `okf.type: guide` and rebuild. The YAML will show +`type: guide` instead of `type: concept`. diff --git a/packages/_playground/docs/en/practical-tests/phase-3/xss-in-frontmatter.md b/packages/_playground/docs/en/practical-tests/phase-3/xss-in-frontmatter.md new file mode 100644 index 0000000..b2f0127 --- /dev/null +++ b/packages/_playground/docs/en/practical-tests/phase-3/xss-in-frontmatter.md @@ -0,0 +1,71 @@ +--- +title: "T-S3: XSS payloads in frontmatter are HTML-escaped" +description: "The pre-Phase 1 build rendered XSS payloads in frontmatter title and description fields as live HTML in og:/twitter: meta tags and the page . Post-fix every interpolation goes through attrEsc() or escHtml()." +--- + +# T-S3 โ€” XSS payloads in frontmatter are HTML-escaped + +This page exercises the **T-S3 XSS via og:/twitter: meta tags +fix** from `battle-test-reports/test-report.md ยงS3` and +`ยงT-S3`. The frontmatter below contains classic XSS payloads. +Pre-Phase 1 they were rendered as live HTML in the generated +page. Post-fix they are HTML-escaped everywhere they appear. + +## The pattern + +The frontmatter of this page contains: + +```yaml +--- +title: '"><img src=x onerror=alert(1)> - Site' +description: '<script>alert("fm-xss")</script> Page description' +--- +``` + +## The rendered result (post-fix) + +The `<title>` of the generated page contains the escaped version: + +```html +<title>"><img src=x onerror=alert(1)> - Site +``` + +The og:title / twitter:title meta tags: + +```html + + +``` + +No live `` in the page. No `onerror` +handler. The payloads are visible in the browser as literal +text โ€” exactly what the user typed. + +## What the pre-fix output looked like + +```html +"><img src=x onerror=alert(1)> - Site + - Site"> +``` + +The XSS payload fired as soon as the page loaded. CI pipelines +that scanned for `` : ''; + + // Determine Absolute Base (usually '/' unless 'base' config is set) + const absoluteRoot = config.base && config.base !== '/' ? config.base.replace(/\/$/, '') + '/' : '/'; + + const full404Html = await renderTemplateAsync(notFoundTemplateStr, { + pageTitle: resolvedTitle, + title: resolvedTitle, + content: resolvedContent, + logo: config.logo, + t, + activeLocale, + + // Context for Assets + relativePathToRoot: absoluteRoot, + buildHash, + appearance: config.theme?.appearance || config.theme?.defaultMode || 'system', + defaultMode: config.theme?.appearance || config.theme?.defaultMode || 'system', + theme: config.theme, + customCssFiles: config.theme.customCss || [], + + faviconLinkHtml: config.favicon ? `` : '', + themeInitScript + }); + + await fs.writeFile(path.join(rootOutputDir, '404.html'), full404Html); + + // --- 4. GENERATE STATIC REDIRECTS --- + if (config.redirects && Object.keys(config.redirects).length > 0) { + for (const [from, to] of Object.entries(config.redirects)) { + let cleanFrom = from.replace(/^\//, ''); + if (!cleanFrom.endsWith('.html')) cleanFrom = path.join(cleanFrom, 'index.html'); + + const redirectPath = path.join(rootOutputDir, cleanFrom); + const redirectHtml = `Redirecting...

Redirecting to ${to}...

`; + + await fs.ensureDir(path.dirname(redirectPath)); + await fs.writeFile(redirectPath, redirectHtml); + } + } + + // --- 5. Post Build Hooks --- + // Only run on full builds. Split into: + // Data Indexing โ†’ search (appended to already-open section from git above) + // Publishing โ†’ sitemap, llms, pwa, etc. + if (!options.targetFiles) { + const postBuildCtx = { + config, + pages: allGeneratedPages, + outputDir: rootOutputDir, + log: (msg: string, status: 'DONE'|'SKIP'|'FAIL'|'WAIT' = 'DONE') => { + if (!options.quiet) TUI.step(msg, status, TUI.blue); + }, + tui: TUI, + options: { ...options, quiet: options.quiet }, + runWorkerTask(modulePath: string, functionName: string, args: any[]) { + if (!config._workerPool) throw new Error('WorkerPool is not initialized'); + return config._workerPool.runTask({ type: 'plugin-task', modulePath, functionName, args }); + } + }; + + // Indexing โ€” search runs in the already-open Data Indexing section + for (const fn of indexingHooks) await fn(postBuildCtx); + if (hasIndexingWork && !options.quiet) TUI.footer(TUI.blue); + + // Publishing โ€” each plugin renders as a parent line + indented children + if (publishingHooks.length > 0) { + if (!options.quiet) TUI.section('Publishing', TUI.blue); + for (const fn of publishingHooks) { + const pluginName = String((fn as any)._pluginName || 'plugin'); + const entries: Array<{ msg: string; status: 'DONE'|'SKIP'|'FAIL'|'WAIT' }> = []; + const pluginCtx = { + ...postBuildCtx, + log: (msg: string, status: 'DONE'|'SKIP'|'FAIL'|'WAIT' = 'DONE') => { + entries.push({ msg, status }); + }, + }; + await fn(pluginCtx); + if (!options.quiet) TUI.pluginTree(pluginName, entries, TUI.blue); + } + if (!options.quiet) TUI.footer(TUI.blue); + } + } + + if (!options.isDev && !options.quiet) { + flushNormaliserWarnings(); + TUI.success(`Build complete. Generated ${allGeneratedPages.length} pages in ${elapsed()}.`); + } + + if (!opts.workerPool) { + await workerPool.terminateAll(); + } + + const { getPluginErrors } = await import('@docmd/api'); + const errors = getPluginErrors(); + if (errors.length > 0) { + // N-12: surface every plugin error in one place. Previously the + // user saw "Build complete" and only later discovered failures when + // a generated page was missing or a downstream tool choked on a + // bad artifact. The summary lists every error with its plugin + + // hook, so the operator can grep for any of them. + if (!options.isDev && !options.quiet) { + TUI.error('Plugin errors during build', ''); + for (const err of errors) { + const filePart = err.filePath ? ` (${err.filePath})` : ''; + console.error(` ${TUI.red('โ€ข')} ${err.plugin} :: ${err.hook}${filePart} โ€” ${err.message}`); + } + } + throw new Error(`Build failed: ${errors.length} plugin error(s) occurred during execution.`); + } + + } catch (e: any) { + if (!options.isDev && !options.quiet) { + TUI.error('Build failed', e.message); + // Show full stack trace if we are in a testing/CI environment + if (process.env.npm_lifecycle_event === 'test' || process.env.CI) { + console.error(e.stack); + } + process.exit(1); + } + throw e; + } +} \ No newline at end of file diff --git a/packages/core/src/commands/deploy.ts b/packages/core/src/commands/deploy.ts new file mode 100644 index 0000000..fed01a1 --- /dev/null +++ b/packages/core/src/commands/deploy.ts @@ -0,0 +1,93 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/core (and ecosystem) + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + */ + +import { generateDeployConfigs } from '@docmd/deployer'; +import { loadConfig } from '../utils/config-loader.js'; +import { normalizeConfig } from '../utils/config-schema.js'; +import { TUI } from '@docmd/api'; +import { readFileSync } from 'node:fs'; + +const pkgUrl = new URL('../../package.json', import.meta.url); +const { version } = JSON.parse(readFileSync(pkgUrl, 'utf-8')); + +interface DeployFlags { + docker?: boolean; + nginx?: boolean; + caddy?: boolean; + githubPages?: boolean; + vercel?: boolean; + netlify?: boolean; + force?: boolean; + config?: string; +} + +async function resolveDeployContext(configPath: string) { + let config: any; + try { + config = await loadConfig(configPath, { isDev: false, quiet: true }); + } catch { + config = normalizeConfig({}); + } + + const title = config.title; + const outDir = config.out; + const siteUrl = config.url ?? null; + const isSpa = config.layout?.spa !== false; + const configFile = configPath !== 'docmd.config.js' ? configPath : null; + + let hostname = ''; + if (siteUrl) { + try { + hostname = new URL(siteUrl).hostname; + } catch { + hostname = siteUrl.replace(/^https?:\/\//, '').split('/')[0]; + } + } + + return { title, outDir, siteUrl, hostname, isSpa, configFile, version }; +} + +export async function initDeploy(opts: DeployFlags) { + const hasTarget = opts.docker || opts.nginx || opts.caddy || opts.githubPages || opts.vercel || opts.netlify; + + if (!hasTarget) { + TUI.section('Deployment Configuration'); + TUI.info('Please specify a target to configure:'); + console.log(''); + console.log(` Self-hosted`); + console.log(` ${TUI.cyan('--docker')} Generate Dockerfile & .dockerignore`); + console.log(` ${TUI.cyan('--nginx')} Generate production nginx.conf`); + console.log(` ${TUI.cyan('--caddy')} Generate production Caddyfile`); + console.log(''); + console.log(` Cloud / CI`); + console.log(` ${TUI.cyan('--github-pages')} Generate GitHub Actions deploy workflow`); + console.log(` ${TUI.cyan('--vercel')} Generate vercel.json`); + console.log(` ${TUI.cyan('--netlify')} Generate netlify.toml`); + console.log(''); + TUI.footer(); + process.exit(0); + } + + try { + const ctx = await resolveDeployContext(opts.config || 'docmd.config.js'); + TUI.section('Generating Deployment Configs'); + await generateDeployConfigs(ctx, opts); + TUI.footer(); + TUI.success('Deployment configurations generated successfully!'); + TUI.info(`Remember to run ${TUI.cyan('docmd build')} first to generate your static site content.`); + } catch (err: any) { + TUI.error('Failed to generate deployment config', err.message); + process.exit(1); + } +} \ No newline at end of file diff --git a/packages/core/src/commands/dev.ts b/packages/core/src/commands/dev.ts new file mode 100644 index 0000000..dcf65b2 --- /dev/null +++ b/packages/core/src/commands/dev.ts @@ -0,0 +1,511 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/core (and ecosystem) + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + */ + +import http from 'http'; +import { WebSocketServer, WebSocket } from 'ws'; +import nativeFs from 'node:fs'; +import path from 'path'; +import { fsUtils as fs, WorkerPool, FileSignatureTracker } from '@docmd/utils'; +import { createOriginVerify } from '../utils/ws-origin-guard.js'; +import { TUI } from '@docmd/api'; +import { buildSite } from './build.js'; +import { loadConfig } from '../utils/config-loader.js'; +import { createRequire } from 'module'; +import { createActionDispatcher, loadPlugins, hooks } from '@docmd/api'; +import { + formatPathForDisplay, getNetworkIp, serveStatic, findAvailablePort, openBrowser, +} from '../utils/dev-utils.js'; + +const __dirname = path.dirname(new URL(import.meta.url).pathname); +const require = createRequire(import.meta.url); + +// Main Dev Function +export async function startDevServer(configPathOption: string, opts: any = {}) { + const options = { + preserve: opts.preserve || false, + port: opts.port || undefined, + }; + + // โ”€โ”€ Multi-Project (Workspace) Detection โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ + if (!process.env.DOCMD_PROJECT_OUT) { + const { detectWorkspace, devWorkspace } = await import('../engine/workspace.js'); + const workspaceConfig = await detectWorkspace(configPathOption); + if (workspaceConfig) { + await devWorkspace(workspaceConfig, options); + return; + } + } + + let config; + try { + config = await loadConfig(configPathOption, { isDev: true, quiet: true }); + } catch (e) { + if (e.silent) { + process.exit(0); // Exit gracefully if it's a known non-project folder error + } + // Config validation errors already print their details - exit cleanly + if (e.message === 'Invalid configuration file.' || e.message?.startsWith('Error parsing config')) { + TUI.error('Build failed', e.message); + process.exit(1); + } + throw e; + } + const CWD = process.cwd(); + + // Config Fallback Logic + const actualConfigPath = config._resolvedPath || path.resolve(CWD, configPathOption); + + const resolveConfigPaths = (currentConfig) => ({ + outputDir: path.resolve(CWD, currentConfig.out), + srcDirToWatch: path.resolve(CWD, currentConfig.src), + configFileToWatch: actualConfigPath, + userAssetsDir: path.resolve(CWD, 'assets'), + }); + + let paths = resolveConfigPaths(config); + + // Create Server - uses a mutable reference so config restarts update the output dir + const state = { outputDir: paths.outputDir }; + const server = http.createServer((req, res) => serveStatic(req, res, state.outputDir)); + let wss; + + function broadcastReload() { + if (wss) { + wss.clients.forEach((client) => { + if (client.readyState === WebSocket.OPEN) client.send('reload'); + }); + } + } + + // โ”€โ”€ Initial Build โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ + const initialElapsed = TUI.timer(); + + const rootOutputDir = path.resolve(CWD, config.out || 'site'); + + let workerPool: WorkerPool; + + try { + const workerScript = path.resolve(__dirname, '../engine/worker-parser.js'); + workerPool = new WorkerPool(workerScript, { config, cwd: CWD }); + // Clean output dir before initial build to remove stale files from previous builds. + // Without this, files generated under old URL structures (e.g. from a different + // auto-router behaviour) persist alongside new files and cause 404 on nav links. + if (await fs.exists(rootOutputDir)) { + await fs.remove(rootOutputDir); + } + await buildSite(configPathOption, { isDev: true, preserve: options.preserve, quiet: false, showStats: false, workerPool }); + TUI.info(`Initial build completed in ${initialElapsed()}.`); + } catch (error: any) { + TUI.error('Initial build failed', error.message); + } + + // โ”€โ”€ Watcher Setup โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ + const userAssetsDirExists = await fs.pathExists(paths.userAssetsDir); + const configWatchPath = paths.configFileToWatch; + const hasConfigFile = await fs.pathExists(configWatchPath); + + TUI.section('Watching', TUI.blue); + TUI.item('Source', formatPathForDisplay(paths.srcDirToWatch, CWD), TUI.dim, TUI.blue); + if (hasConfigFile) { + TUI.item('Config', formatPathForDisplay(configWatchPath, CWD), TUI.dim, TUI.blue); + } + if (userAssetsDirExists) { + TUI.item('Assets', formatPathForDisplay(paths.userAssetsDir, CWD), TUI.dim, TUI.blue); + } + TUI.footer(TUI.blue); + + const watchers: nativeFs.FSWatcher[] = []; + let isRebuilding = false; + let rebuildQueued = false; + let rebuildTimeout: any = null; + let lastContentRebuildAt = 0; + let lastConfigRebuildAt = 0; + // Quiet windows after a rebuild to absorb phantom fs.watch events that + // macOS emits for newly-written nearby files. The primary guard is the + // content-signature check (FileSignatureTracker) below โ€” these windows + // are just a secondary cushion. + // - 1000ms after a content (markdown / asset) rebuild โ€” quick to recover + // - 2500ms after a full config rebuild โ€” longer because the build + // cascades through every project file + const CONTENT_QUIET_MS = 1000; + const CONFIG_QUIET_MS = 2500; + // Tracks each watched file's mtime+size signature so phantom fs.watch + // events that don't actually mutate the file are silently ignored. + const signatureTracker = new FileSignatureTracker(); + + // Resolved output dir for robust exclusion (never retrigger on build output) + const resolvedOutputDir = path.resolve(CWD, config.out || 'site'); + + let configLock = false; + let configDebounce: any = null; + async function reloadConfigAndRebuild(changedFilePath: string) { + if (configLock) return; + configLock = true; + + const baseName = path.basename(changedFilePath); + const configElapsed = TUI.timer(); + TUI.step(`Reloading config and rebuilding due to change in: ${baseName}`, 'WAIT', TUI.blue, true); + + try { + // Close all watchers + watchers.forEach(w => w.close()); + watchers.length = 0; + if (rebuildTimeout) { clearTimeout(rebuildTimeout); rebuildTimeout = null; } + isRebuilding = false; + rebuildQueued = false; + + // Reload config + config = await loadConfig(configPathOption, { isDev: true, quiet: true }); + paths = resolveConfigPaths(config); + state.outputDir = paths.outputDir; + + if (workerPool) await workerPool.terminateAll(); + const workerScript = path.resolve(__dirname, '../engine/worker-parser.js'); + workerPool = new WorkerPool(workerScript, { config, cwd: CWD }); + + // Full rebuild + await buildSite(configPathOption, { + isDev: true, + preserve: options.preserve, + quiet: true, + workerPool + }); + + lastConfigRebuildAt = Date.now(); + // Reset the signature tracker: after a full rebuild the file + // mtimes on disk may have shifted, and we want the next user edit + // to be detected as a fresh change rather than filtered as a + // phantom duplicate. + signatureTracker.reset(); + TUI.step(`Config reloaded and rebuilt in ${configElapsed()}`, 'DONE', TUI.blue, true); + + // Re-setup watchers after the longer config quiet window so any + // macOS phantom events from the build settle before we start + // listening again. + setTimeout(() => { + setupContentWatchers(); + setupConfigWatcher(); + configLock = false; + }, CONFIG_QUIET_MS); + + broadcastReload(); + } catch (error: any) { + TUI.step(`Config reload: ${baseName}`, 'FAIL', TUI.blue, true); + TUI.error('Config reload failed', error.message); + + // Re-setup watchers to continue listening. Use the same longer config + // quiet window so phantom events fired during the failed reload + // settle before we start listening again. + setTimeout(() => { + setupContentWatchers(); + setupConfigWatcher(); + configLock = false; + }, CONFIG_QUIET_MS); + } + } + + function setupContentWatchers() { + const contentPaths = [paths.srcDirToWatch]; + if (nativeFs.existsSync(paths.userAssetsDir)) contentPaths.push(paths.userAssetsDir); + + if (process.env.DOCMD_DEV === 'true') { + const DOCMD_ROOT = path.resolve(__dirname, '..'); + contentPaths.push( + path.join(DOCMD_ROOT, 'templates'), + path.join(DOCMD_ROOT, 'assets'), + path.join(DOCMD_ROOT, 'engine'), + path.join(DOCMD_ROOT, 'plugins'), + path.join(DOCMD_ROOT, 'utils') + ); + } + + // Resolved output dir โ€” used for robust exclusion below + const resolvedOut = path.resolve(CWD, paths.outputDir); + + for (const watchPath of contentPaths) { + if (!nativeFs.existsSync(watchPath)) continue; + + const watcher = nativeFs.watch(watchPath, { recursive: true }, (event, filename) => { + if (!filename) return; + + // Post-rebuild quiet period: swallow stale fs.watch events + if (Date.now() - lastContentRebuildAt < CONTENT_QUIET_MS) return; + if (Date.now() - lastConfigRebuildAt < CONFIG_QUIET_MS) return; + + const filePath = path.resolve(watchPath, filename); + + // Exclude build output dir (absolute path check โ€” reliable across platforms) + if (filePath.startsWith(resolvedOut + path.sep) || filePath === resolvedOut) return; + + // Content-signature gate: ignore phantom events that don't actually + // mutate the file (Spotlight reindex, iCloud sync, Time Machine, + // macOS metadata reads, etc.). This is the primary defence. + if (!signatureTracker.hasChanged(filePath)) return; + + // Common noise exclusions + if ( + filename.includes('.git') || + filename.includes('node_modules') || + filename.startsWith('.') || + filename.includes('.DS_Store') + ) return; + + const relativeFilePath = path.relative(CWD, filePath); + const isAsset = filePath.startsWith(path.resolve(paths.userAssetsDir)); + const isConfigOrNav = + filename.includes('navigation.json') || + (filename.includes('docmd.config') && !filename.includes('docmd.config-')); + + if (isConfigOrNav) { + // Debounce config/nav reloads separately to collapse macOS multi-fire + if (configDebounce) clearTimeout(configDebounce); + configDebounce = setTimeout(() => { + configDebounce = null; + reloadConfigAndRebuild(filePath); + }, 400); + return; + } + + // Debounce: wait until user stops making changes before rebuilding. + // Each new save resets this timer, so the build only runs after + // the last change โ€” like Vite's approach. + if (rebuildTimeout) clearTimeout(rebuildTimeout); + rebuildTimeout = setTimeout(() => { + const executeBuildFn = async () => { + if (isRebuilding) { rebuildQueued = true; return; } + + const rebuildElapsed = TUI.timer(); + const sp = TUI.spinner(`Rebuilding: ${relativeFilePath}`, TUI.blue); + isRebuilding = true; + rebuildQueued = false; + try { + await buildSite(configPathOption, { + isDev: true, + preserve: options.preserve, + quiet: true, + targetFiles: isAsset ? undefined : [filePath], + workerPool + }); + lastContentRebuildAt = Date.now(); + sp.done(`Rebuilt: ${relativeFilePath} in ${rebuildElapsed()}`, true); + broadcastReload(); + } catch (error: any) { + sp.fail(`Rebuild: ${relativeFilePath}`, true); + TUI.error('Rebuild failed', error.message); + } finally { + isRebuilding = false; + if (rebuildQueued) executeBuildFn(); + } + }; + executeBuildFn(); + }, 600); // 600ms: rebuild fires 600ms after user stops saving + }); + watchers.push(watcher); + } + } + + const setupConfigWatcher = () => { + if (!hasConfigFile) return; + let cfgDebounce: any = null; + // Watch the config's parent directory, not the file directly โ€” fs.watch + // on a single file is the worst case on macOS and fires phantom events + // from Spotlight / iCloud / Time Machine. Watching a directory and + // filtering to our basename is dramatically more stable. + const watchDir = path.dirname(configWatchPath); + const configBaseName = path.basename(configWatchPath); + + const configWatcher = nativeFs.watch(watchDir, (event, filename) => { + if (!filename) return; + // Only react to our specific config file (filter out sibling writes) + if (filename !== configBaseName) return; + + // Post-rebuild quiet period: a config reload closes+reopens + // watchers, so any phantom events that fired during the rebuild are + // already swallowed. This covers the brief window after reopen. + if (Date.now() - lastConfigRebuildAt < CONFIG_QUIET_MS) return; + + // Content-signature gate: ignore phantom events that don't actually + // mutate the file. This is the primary defence โ€” without it, a + // single Spotlight reindex every few seconds would trigger a full + // site rebuild indefinitely. + if (!signatureTracker.hasChanged(configWatchPath)) return; + + // Debounce: collapse the 3-6 rapid events macOS fires per save into one + if (cfgDebounce) clearTimeout(cfgDebounce); + cfgDebounce = setTimeout(() => { + cfgDebounce = null; + reloadConfigAndRebuild(configWatchPath); + }, 500); + }); + watchers.push(configWatcher); + }; + + setupContentWatchers(); + setupConfigWatcher(); + + // Server Startup Logic + const PORT = parseInt(options.port || process.env.PORT || 3000, 10); + // Phase 1.D: default to loopback. Set DOCMD_HOST=0.0.0.0 to expose on LAN + // (with the verifyClient callback below still guarding the Origin header). + const BIND_HOST = process.env.DOCMD_HOST || '127.0.0.1'; + + function tryStartServer(port) { + server.listen(port, BIND_HOST) + .once('listening', async () => { + if (BIND_HOST !== '127.0.0.1' && BIND_HOST !== '::1' && BIND_HOST !== 'localhost') { + TUI.warn(`Dev server bound to ${BIND_HOST} (LAN). Any host able to reach this port can connect; verifyClient guards Origin.`); + } + // Phase 1.D: CWE-1385 CSWSH fix (N-S1). verifyClient validates the + // Origin header against the loopback allowlist before accepting the + // WebSocket handshake. + wss = new WebSocketServer({ + server, + verifyClient: createOriginVerify(), + }); + wss.on('error', (e: any) => TUI.error('WebSocket Error', e.message)); + + // Action dispatcher for plugin actions/events + await loadPlugins(config, { resolvePaths: [__dirname] }); + const dispatcher = createActionDispatcher(hooks, { + projectRoot: CWD, + config, + broadcast: (event: string, data: any) => { + wss.clients.forEach((client: any) => { + if (client.readyState === WebSocket.OPEN) { + client.send(JSON.stringify({ type: 'event', name: event, data })); + } + }); + } + }); + + // Execute onDevServerReady hooks + for (const fn of hooks.onDevServerReady) { + await fn(server, wss); + } + + wss.on('connection', (ws: any) => { + ws.on('message', async (raw: any) => { + let msg: any; + try { msg = JSON.parse(raw.toString()); } catch { return; } + + if (msg.type === 'call') { + try { + const { result } = await dispatcher.handleCall(msg.action, msg.payload); + // Don't send reload flag to client - let the file watcher detect + // the change, rebuild, and send the reload via broadcastReload() + ws.send(JSON.stringify({ id: msg.id, type: 'response', result, reload: false })); + } catch (e: any) { + ws.send(JSON.stringify({ id: msg.id, type: 'response', error: e.message })); + } + } else if (msg.type === 'event') { + dispatcher.handleEvent(msg.name, msg.data); + } + }); + }); + + const indexHtmlPath = path.join(paths.outputDir, 'index.html'); + const networkIp = getNetworkIp(); + const localUrl = `http://127.0.0.1:${port}`; + const networkUrl = networkIp ? `http://${networkIp}:${port}` : null; + + TUI.section('Development Server Running', TUI.green); + TUI.item('', '', TUI.dim, TUI.green); + TUI.item('Local Access', localUrl, TUI.bold, TUI.green); + if (networkUrl) { + TUI.item('Network Access', networkUrl, TUI.bold, TUI.green); + } + TUI.item('Serving from', formatPathForDisplay(paths.outputDir, CWD), TUI.dim, TUI.green); + // Show engine + locale/version summary โ€” same details build shows (N-23). + const devDetails = TUI.extractProjectDetails(config, paths.outputDir, CWD); + if (devDetails.engine) TUI.item('Engine', devDetails.engine === 'rust' ? 'rust (preview)' : devDetails.engine, TUI.dim, TUI.green); + if (devDetails.versions) TUI.item('Versions', `${devDetails.versions.count} (${devDetails.versions.labels})`, TUI.dim, TUI.green); + if (devDetails.locales) TUI.item('Locales', `${devDetails.locales.count} (${devDetails.locales.labels})`, TUI.dim, TUI.green); + TUI.item('','', TUI.dim, TUI.green); + TUI.footer(TUI.green); + + if (!await fs.pathExists(path.join(paths.outputDir, 'index.html'))) { + TUI.warn('Root index.html not found. Build may be incomplete.'); + } + + // Auto-launch localhost URL in default browser + openBrowser(localUrl); + }) + .once('error', (err: any) => { + if (err.code === 'EADDRINUSE') { + server.close(); + tryStartServer(port + 1); + } else { + TUI.error('Failed to start server', err.message); + process.exit(1); + } + }); + } + + // Execution Flow + (async () => { + const finalPort = await findAvailablePort(PORT); + tryStartServer(finalPort); + })(); + + let isShuttingDown = false; + + // Suppress ^C display and handle graceful shutdown + if (process.stdin.isTTY) { + process.stdin.setRawMode(true); + process.stdin.resume(); + process.stdin.on('data', (data) => { + // Ctrl+C = 0x03 + if (data[0] === 0x03) { + process.emit('SIGINT' as any); + } + }); + } + + // M-11: extracted graceful-shutdown logic so both SIGINT and SIGTERM + // run the same cleanup. Previously SIGTERM called process.exit(0) + // directly, which bypassed the watchers / wss / server / workerPool + // shutdown path and could leave child processes or live sockets + // hanging. + async function gracefulShutdown() { + if (isShuttingDown) return; + isShuttingDown = true; + + if (process.stdin.isTTY) process.stdin.setRawMode(false); + + TUI.success('Shutting down...\n'); + + // Force exit after a shorter timeout if graceful shutdown hangs + const forceExitTimeout = setTimeout(() => { + process.exit(0); + }, 500); + forceExitTimeout.unref(); + + try { + const closures: any[] = []; + watchers.forEach(w => closures.push(new Promise(resolve => { w.close(); resolve(); }))); + if (wss) closures.push(new Promise(resolve => wss.close(resolve))); + if (server) closures.push(new Promise(resolve => server.close(resolve))); + if (workerPool) closures.push(workerPool.terminateAll()); + + await Promise.all(closures); + clearTimeout(forceExitTimeout); + process.exit(0); + } catch { + process.exit(0); + } + } + + process.on('SIGINT', gracefulShutdown); + process.on('SIGTERM', gracefulShutdown); +} \ No newline at end of file diff --git a/packages/core/src/commands/doctor.ts b/packages/core/src/commands/doctor.ts new file mode 100644 index 0000000..7657352 --- /dev/null +++ b/packages/core/src/commands/doctor.ts @@ -0,0 +1,329 @@ +/** + * -------------------------------------------------------------------- + * docmd doctor : pre-flight check command. + * + * Walks the user's config, checks every configured plugin and template + * against the official registry, and prints a single status report. No + * filesystem writes, no build side-effects โ€” purely a diagnostic tool. + * + * Flags: + * --fix Auto-install missing official plugins/templates. + * --json Emit the report as JSON (for tooling). + * --config Path to docmd.config (defaults to the same search the + * build commands use). + * + * Exit codes: + * 0 โ€” every check passed (or --fix resolved everything). + * 1 โ€” at least one problem remains (missing plugin, version mismatch, + * broken manifest). + * 2 โ€” usage error. + * -------------------------------------------------------------------- + */ + +import path from 'node:path'; +import fs from 'node:fs'; +import { createRequire } from 'node:module'; +import { fileURLToPath } from 'node:url'; +import { TUI } from '@docmd/tui'; +import { loadConfig } from '../utils/config-loader.js'; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); + +interface PluginReport { + name: string; + status: 'ok' | 'missing' | 'mismatch' | 'third-party' | 'unknown'; + declaredVersion?: string; + installedVersion?: string; + fixable: boolean; + hint?: string; +} + +interface DoctorReport { + config: string | null; + core: { name: string; version: string; status: 'ok' | 'missing' }; + plugins: PluginReport[]; + template?: { requested: string; resolved: string; status: 'ok' | 'missing' }; + engines: Array<{ name: string; status: 'ok' | 'missing' | 'unknown' }>; + autoInstallCandidates: string[]; + warnings: string[]; + errors: string[]; +} + +interface DoctorOptions { + configPath?: string; + fix: boolean; + json: boolean; +} + +export async function runDoctor(opts: DoctorOptions): Promise { + // 1. Resolve the config. + const configPath = opts.configPath ? path.resolve(opts.configPath) : null; + let config: any = {}; + let configError: string | null = null; + if (configPath) { + try { + const loaded = await loadConfig(configPath); + config = loaded?.config || loaded || {}; + } catch (e: any) { + configError = e.message; + } + } else { + // loadConfig requires an explicit path; we don't have a built-in + // "find a config" helper yet. The user can re-run with --config. + configError = 'No config path provided. Use --config to point at docmd.config.{json,ts,js,mjs}.'; + } + + // 2. Build the report. + const report: DoctorReport = { + config: configPath, + core: { name: '@docmd/core', version: 'unknown', status: 'ok' }, + plugins: [], + engines: [], + autoInstallCandidates: [], + warnings: [], + errors: configError ? [configError] : [], + }; + + // 3. Check @docmd/core version. We try a chain of strategies so the + // doctor works in three real-world layouts: + // (a) a real user install โ€” `node_modules/@docmd/core/package.json` + // is reachable via standard `createRequire` resolution. + // (b) monorepo dev with a built dist โ€” the build output sits under + // `packages/core/dist/commands/`, and `import.meta.url` lets us + // derive the package root and read the in-tree `package.json`. + // (c) pnpm's symlinked `node_modules/@docmd/core` from inside the + // playground โ€” walk up from cwd and try every ancestor. + // + // If all strategies fail, we genuinely don't have `@docmd/core` on the + // resolve path; we report that rather than guessing. + report.core = resolveCorePackage(); + if (report.core.status === 'missing') { + report.errors.push('@docmd/core is not installed'); + } + + // 4. Check configured plugins. + const configuredPlugins: Record = (config.plugins || {}); + for (const [key, userOpts] of Object.entries(configuredPlugins)) { + if (userOpts === false) continue; + const pkgName = key.startsWith('@docmd/') ? key : `@docmd/plugin-${key}`; + const installed = tryReadPackage(pkgName); + if (installed) { + report.plugins.push({ + name: key, + status: 'ok', + installedVersion: installed.version, + fixable: false, + }); + } else { + report.plugins.push({ + name: key, + status: 'missing', + fixable: true, + hint: `Run \`docmd add ${key}\` or add "${pkgName}" to your dependencies.`, + }); + report.autoInstallCandidates.push(pkgName); + } + } + + // 5. Check the active template. + if (config.theme?.template) { + const tplName = String(config.theme.template).trim(); + const tplPkg = tplName.startsWith('@docmd/') ? tplName : `@docmd/template-${tplName}`; + const installed = tryReadPackage(tplPkg); + report.template = { + requested: tplName, + resolved: tplPkg, + status: installed ? 'ok' : 'missing', + }; + if (!installed) { + report.autoInstallCandidates.push(tplPkg); + } + } + + // 6. Check engines. (The JS engine ships with core; the Rust engine is optional.) + const requestedEngine = (config.engine || 'js').toLowerCase(); + report.engines.push({ name: 'js', status: 'ok' }); + if (requestedEngine === 'rust' || config.engines?.rust) { + const rustInstalled = tryReadPackage('@docmd/engine-rust'); + report.engines.push({ name: 'rust', status: rustInstalled ? 'ok' : 'missing' }); + } + + // 7. Optional auto-fix. + if (opts.fix && report.autoInstallCandidates.length > 0) { + const { execSync } = await import('node:child_process'); + const cwd = process.cwd(); + const pkgManager = detectPackageManager(cwd); + const cmd = `${pkgManager} add ${report.autoInstallCandidates.join(' ')}`; + try { + execSync(cmd, { stdio: 'inherit', cwd, timeout: 180000 }); + } catch (e: any) { + report.errors.push(`Auto-install failed: ${e.message}`); + } + } + + // 8. Emit. + if (opts.json) { + console.log(JSON.stringify(report, null, 2)); + } else { + printReport(report); + } + + return report.errors.length > 0 ? 1 : 0; +} + +function printReport(r: DoctorReport): void { + console.log(''); + console.log('โ”Œโ”€ docmd pre-flight check'); + console.log('โ”‚'); + console.log(`โ”‚ ${r.core.name.padEnd(28)} ${r.core.version.padEnd(10)} ${r.core.status === 'ok' ? TUI.green('โœ“ installed') : TUI.red('โœ— missing')}`); + console.log('โ”‚'); + console.log('โ”‚ Configured plugins (' + r.plugins.length + ')'); + for (const p of r.plugins) { + const sym = p.status === 'ok' ? TUI.green('โœ“') : p.status === 'missing' ? TUI.yellow('โš ') : TUI.dim('ยท'); + const ver = p.installedVersion ? ` (${p.installedVersion})` : ''; + console.log(`โ”‚ ${sym} ${p.name.padEnd(20)}${ver}${p.hint ? ' ' + TUI.dim(p.hint) : ''}`); + } + if (r.template) { + const sym = r.template.status === 'ok' ? TUI.green('โœ“') : TUI.yellow('โš '); + console.log(`โ”‚`); + console.log(`โ”‚ Template`); + console.log(`โ”‚ ${sym} ${r.template.resolved}${r.template.status === 'missing' ? ' ' + TUI.dim('not installed') : ''}`); + } + if (r.engines.length) { + console.log('โ”‚'); + console.log('โ”‚ Engines'); + for (const e of r.engines) { + const sym = e.status === 'ok' ? TUI.green('โœ“') : TUI.yellow('โš '); + console.log(`โ”‚ ${sym} ${e.name}`); + } + } + if (r.autoInstallCandidates.length) { + console.log('โ”‚'); + console.log('โ”‚ ' + TUI.yellow(`Auto-install candidates (${r.autoInstallCandidates.length})`) + ' โ€” run `docmd doctor --fix`'); + for (const c of r.autoInstallCandidates) { + console.log(`โ”‚ โ€ข ${c}`); + } + } + if (r.errors.length) { + console.log('โ”‚'); + console.log('โ”‚ ' + TUI.red('Errors')); + for (const e of r.errors) console.log(`โ”‚ ${e}`); + } + console.log('โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€'); + console.log(''); +} + +/** + * Resolve `@docmd/core`'s version with a chain of strategies. Returns + * `{ name, version, status: 'ok' }` on success, or + * `{ name, version: 'unknown', status: 'missing' }` if the package is + * genuinely not on the resolve path. + * + * Strategy order: + * 1. `createRequire(import.meta.url)` from the doctor file's URL โ€” + * this works for a real user install where the doctor runs from + * `node_modules/@docmd/core/dist/commands/doctor.js`. + * 2. Walk up from `process.cwd()` looking for a `node_modules/@docmd/core/package.json` + * โ€” this covers pnpm's symlinked layout from the playground and + * yarn's hoisted layout in monorepos. + * 3. Walk up from the doctor file's location looking for an in-tree + * `package.json` whose `name` is `@docmd/core` โ€” this covers the + * monorepo dev case where the dist files are run directly without + * being installed into a `node_modules` tree. + */ +function resolveCorePackage(): { name: string; version: string; status: 'ok' | 'missing' } { + const FAIL = { name: '@docmd/core', version: 'unknown', status: 'missing' as const }; + const SEARCH_NAMES = new Set(['@docmd/core', 'docmd']); + + // Strategy 1: createRequire from this file's URL. + try { + const req = createRequire(import.meta.url); + const pkg = req('@docmd/core/package.json'); + return { name: pkg.name, version: pkg.version, status: 'ok' }; + } catch { /* fall through */ } + + // Strategy 2: walk up from cwd looking for node_modules/@docmd/core/package.json. + for (let dir = process.cwd(); dir !== path.parse(dir).root; dir = path.dirname(dir)) { + const candidate = path.join(dir, 'node_modules', '@docmd', 'core', 'package.json'); + if (fs.existsSync(candidate)) { + try { + const pkg = JSON.parse(fs.readFileSync(candidate, 'utf8')); + if (SEARCH_NAMES.has(pkg.name)) { + return { name: pkg.name, version: pkg.version, status: 'ok' }; + } + } catch { /* try next ancestor */ } + } + } + + // Strategy 3: walk up from the doctor file's location looking for an + // in-tree package.json whose name is @docmd/core. This is the monorepo + // dev case where the dist files are run directly without being installed + // into a node_modules tree. + let dir = __dirname; + while (dir !== path.parse(dir).root) { + const candidate = path.join(dir, 'package.json'); + if (fs.existsSync(candidate)) { + try { + const pkg = JSON.parse(fs.readFileSync(candidate, 'utf8')); + if (SEARCH_NAMES.has(pkg.name)) { + return { name: pkg.name, version: pkg.version, status: 'ok' }; + } + } catch { /* try next ancestor */ } + } + dir = path.dirname(dir); + } + + return FAIL; +} + +/** + * Read a package's `package.json` from any of the three strategies above. + * Used to detect configured plugins and engines. + */ +function tryReadPackage(name: string): { name: string; version: string } | null { + // Strategy 1: createRequire from this file's URL. + try { + const req = createRequire(import.meta.url); + const pkg = req(`${name}/package.json`); + return { name: pkg.name, version: pkg.version }; + } catch { /* fall through */ } + + // Strategy 2: walk up from cwd. + for (let dir = process.cwd(); dir !== path.parse(dir).root; dir = path.dirname(dir)) { + const candidate = path.join(dir, 'node_modules', ...name.split('/'), 'package.json'); + if (fs.existsSync(candidate)) { + try { + return JSON.parse(fs.readFileSync(candidate, 'utf8')); + } catch { /* try next ancestor */ } + } + } + + // Strategy 3: walk up from the doctor file's location. + let dir = __dirname; + while (dir !== path.parse(dir).root) { + const candidate = path.join(dir, 'node_modules', ...name.split('/'), 'package.json'); + if (fs.existsSync(candidate)) { + try { + return JSON.parse(fs.readFileSync(candidate, 'utf8')); + } catch { /* try next ancestor */ } + } + dir = path.dirname(dir); + } + + return null; +} + +function detectPackageManager(cwd: string): 'pnpm' | 'yarn' | 'bun' | 'npm' { + let dir = cwd; + const { existsSync } = require('node:fs') as typeof import('node:fs'); + const { join } = require('node:path') as typeof import('node:path'); + while (dir !== require('node:path').parse(dir).root) { + if (existsSync(join(dir, 'pnpm-lock.yaml'))) return 'pnpm'; + if (existsSync(join(dir, 'yarn.lock'))) return 'yarn'; + if (existsSync(join(dir, 'bun.lockb'))) return 'bun'; + if (existsSync(join(dir, 'package-lock.json'))) return 'npm'; + dir = require('node:path').dirname(dir); + } + return 'npm'; +} \ No newline at end of file diff --git a/packages/core/src/commands/init.ts b/packages/core/src/commands/init.ts new file mode 100644 index 0000000..0ee2c2c --- /dev/null +++ b/packages/core/src/commands/init.ts @@ -0,0 +1,426 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/core (and ecosystem) + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + */ + +import { TUI } from '@docmd/api'; +import { fsUtils as fs } from '@docmd/utils'; +import path from 'path'; +import readline from 'readline'; +import { createRequire } from 'module'; + +const require = createRequire(import.meta.url); +const { version } = require('../../package.json'); + +const defaultConfigContent = `{ + "title": "My Documentation", + "url": "https://docs.myproject.com", + "src": "docs", + "out": "site", + "engine": "js", + "layout": { + "spa": true, + "header": { + "enabled": true + }, + "sidebar": { + "collapsible": true, + "defaultCollapsed": false + }, + "optionsMenu": { + "position": "sidebar-top", + "components": { + "search": true, + "themeSwitch": true + } + }, + "footer": { + "style": "minimal", + "content": "ยฉ ${new Date().getFullYear()} My Project.", + "branding": true + } + }, + "theme": { + "name": "default", + "appearance": "system", + "codeHighlight": true + }, + "minify": true, + "autoTitleFromH1": true, + "copyCode": true, + "pageNavigation": true, + "navigation": [ + { "title": "Quick Start", "path": "/", "icon": "zap" }, + { "title": "Agent Skills", "path": "/skills/", "icon": "brain-circuit" }, + { + "title": "Quick Guide", + "icon": "book-open", + "collapsible": false, + "children": [ + { "title": "Install", "path": "https://docs.docmd.io/getting-started/installation/", "icon": "download", "external": true }, + { "title": "Configure", "path": "https://docs.docmd.io/configuration/overview/", "icon": "settings", "external": true }, + { "title": "Migrate", "path": "https://docs.docmd.io/migration/overview/", "icon": "arrow-left-right", "external": true }, + { "title": "Deploy", "path": "https://docs.docmd.io/deployment/", "icon": "rocket", "external": true } + ] + }, + { "title": "GitHub", "path": "https://github.com/docmd-io/docmd", "icon": "github", "external": true } + ], + "plugins": { + "git": { + "commitHistory": true, + "maxCommits": 5 + }, + "seo": { + "defaultDescription": "Documentation built with docmd." + } + } +} +`; + +const defaultIndexMdContent = `--- +title: "Quick Start" +description: "Welcome to your new documentation site." +--- + +# Quick Start Your Docs ๐Ÿš€ + +This is the home page of your new **docmd** project. You're currently viewing \`docs/index.md\` โ€” edit it, and your site updates. + +## Run the dev server + +\`\`\`bash +npx @docmd/core dev +\`\`\` + +Open \`http://localhost:3000\` โ€” the page auto-reloads as you edit. + +## Build for production + +\`\`\`bash +npx @docmd/core build +\`\`\` + +Output goes to \`site/\`. Deploy that folder anywhere that serves static files. + +## Project structure + +\`\`\`text +. +โ”œโ”€โ”€ docs/ # Your markdown content +โ”‚ โ””โ”€โ”€ index.md # You are here +โ”œโ”€โ”€ assets/ # Custom CSS, JS, and images +โ”œโ”€โ”€ docmd.config.json # Site configuration +โ””โ”€โ”€ package.json # Node dependencies + scripts +\`\`\` + +## Features + +### 1. Smart containers + +\`\`\`markdown +::: callout tip "Did you know?" +You can nest containers, add titles, and use icons. +::: + +::: card "Flexible" icon:layout-grid +Organise content with cards. + +[View the docs โ†’](https://docs.docmd.io){.docmd-button} +::: +\`\`\` + +Renders as a styled callout and a card with a button. + +### 2. Tabs and code + +\`\`\`\`markdown +::: tabs +== tab "JavaScript" icon:braces +\`\`\`javascript +console.log('Hello World'); +\`\`\` + +== tab "Python" icon:code +\`\`\`python +print('Hello World') +\`\`\` +::: +\`\`\`\` + +### 3. Built-in plugins + +docmd ships with these plugins enabled by default โ€” no install needed: + +- **Search** โ€” full-text + semantic search (optional) +- **Sitemap** + **SEO** meta tags +- **LLMs context** โ€” \`llms.txt\` and \`llms.json\` for AI agents +- **OKF** โ€” Open Knowledge Format bundle at \`site/okf/\` +- **Mermaid** diagrams +- **Git** last-modified timestamps +- **Math** (KaTeX) โ€” enable with \`docmd add math\` + +See the [full plugin list](https://docs.docmd.io/plugins/usage/). + +## Next steps + +- **[Install docmd](https://docs.docmd.io/getting-started/installation/)** +- **[Configure your site](https://docs.docmd.io/configuration/overview/)** +- **[Browse templates](https://docs.docmd.io/theming/templates/)** +- **[Deploy to production](https://docs.docmd.io/deployment/)** +- **[GitHub repo](https://github.com/docmd-io/docmd/)** + +Happy documenting! ๐ŸŽ‰`; + +const defaultSkillsMdContent = `--- +title: "Agent Skills" +description: "Teach AI coding agents to work with docmd projects" +--- + +# Agent Skills + +docmd ships a **modular skill set** for AI coding agents (Claude Code, Cursor, Windsurf, Copilot, etc.). The skills teach your agent the \`docmd\` CLI, configuration, plugin system, and the \`docmd mcp\` server โ€” so it can build, configure, validate, and deploy sites for you. + +## What gets installed + +The [\`docmd-skills\`](https://www.npmjs.com/package/docmd-skills) npm package contains three skill modules: + +| Skill | When your agent loads it | +|---|---| +| **\`docmd-skills\`** | A docmd **site operator**. Knows the \`npx @docmd/core\` CLI, \`docmd.config.json\`, plugins, themes, deployment, and the \`docmd mcp\` server. | +| **\`docmd-dev\`** | A docmd **framework contributor**. Knows the monorepo layout, how to author plugins and templates, the JS / Rust engine loaders, and the public Node API (\`EngineLoader\`, \`createActionDispatcher\`, \`TemplateSlot\`). | +| **\`docmd-writer\`** | A **multi-language documentation writer**. Drafts and reviews prose in any language, with SEO awareness and docmd's markdown conventions (containers, frontmatter, file-title rule). | + +## Install + +Pick the directory your agent reads skills from and run **one** command: + +### Claude Code + +\`\`\`bash +npx docmd-skills ~/.claude/skills +\`\`\` + +### Cursor + +\`\`\`bash +npx docmd-skills ~/.cursor/skills +\`\`\` + +### Project-local (any agent) + +\`\`\`bash +npx docmd-skills ./.skills +\`\`\` + +After install, the \`docmd-skills\`, \`docmd-dev\`, and \`docmd-writer\` modules are available to your agent. + +Run \`npx docmd-skills --help\` for the full list of commands. + +## How it works at runtime + +Once installed, your agent automatically loads the right skill based on the files in scope: + +- When you ask "add a plugin to my docmd site" โ†’ \`docmd-skills\` loads +- When you ask "add a new template" inside the cloned \`docmd-io/docmd\` monorepo โ†’ \`docmd-dev\` loads +- When you ask "write the intro for my new docs" โ†’ \`docmd-writer\` loads + +## Update or remove + +The CLI is idempotent โ€” running it again updates the skills to latest: + +\`\`\`bash +npx docmd-skills # updates all three +npx docmd-skills remove # deletes all three +\`\`\` +`; + +const defaultPackageJson = { + name: "my-docs", + version: "0.0.1", + private: true, + type: "module", + scripts: { + "dev": "docmd dev", + "build": "docmd build", + "preview": "npx serve site" + }, + dependencies: { + "@docmd/core": `^${version}` + } +}; + +export async function initProject(opts: { force?: boolean; yes?: boolean } = {}) { + const baseDir = process.cwd(); + const packageJsonFile = path.join(baseDir, 'package.json'); + const configFile = path.join(baseDir, 'docmd.config.json'); + const docsDir = path.join(baseDir, 'docs'); + const indexMdFile = path.join(docsDir, 'index.md'); + const skillsMdFile = path.join(docsDir, 'skills.md'); + const skillFile = path.join(baseDir, 'SKILL.md'); + const assetsDir = path.join(baseDir, 'assets'); + const assetsCssDir = path.join(assetsDir, 'css'); + const assetsJsDir = path.join(assetsDir, 'js'); + const assetsImagesDir = path.join(assetsDir, 'images'); + + const existingFiles = []; + const dirExists = { + docs: false, + assets: false + }; + + TUI.section('Project Setup'); + + // Check if package.json exists + if (!await fs.pathExists(packageJsonFile)) { + await fs.writeJson(packageJsonFile, defaultPackageJson, { spaces: 2 }); + TUI.step('Created package.json', 'DONE'); + } else { + TUI.step('Using existing package.json', 'SKIP'); + } + + // Check each configuration file variant individually + if (await fs.pathExists(configFile)) { + existingFiles.push('docmd.config.json'); + } + const jsConfigFile = path.join(baseDir, 'docmd.config.js'); + if (await fs.pathExists(jsConfigFile)) { + existingFiles.push('docmd.config.js'); + } + const tsConfigFile = path.join(baseDir, 'docmd.config.ts'); + if (await fs.pathExists(tsConfigFile)) { + existingFiles.push('docmd.config.ts'); + } + + // Check for the legacy config.js + const oldConfigFile = path.join(baseDir, 'config.js'); + if (await fs.pathExists(oldConfigFile)) { + existingFiles.push('config.js'); + } + + // Check if docs directory exists + if (await fs.pathExists(docsDir)) { + dirExists.docs = true; + if (await fs.pathExists(indexMdFile)) { + existingFiles.push('docs/index.md'); + } + if (await fs.pathExists(skillsMdFile)) { + existingFiles.push('docs/skills.md'); + } + } + + // Check if assets directory exists + if (await fs.pathExists(assetsDir)) { + dirExists.assets = true; + } + + // Determine if we should override existing files + let shouldOverride = !!opts.force; + if (existingFiles.length > 0 && !shouldOverride) { + TUI.warn('Existing files detected:'); + existingFiles.forEach(file => TUI.item('', file)); + + // In a non-interactive environment (CI, piped input, Docker without -it, + // npx with no TTY), skip the prompt. Default to "no" for safety unless + // --yes is passed. + const isInteractive = !!process.stdin.isTTY; + if (!isInteractive) { + if (opts.yes) { + shouldOverride = true; + TUI.dim(' (non-interactive mode + --yes: overriding existing files)'); + } else { + shouldOverride = false; + TUI.dim(' (non-interactive mode: keeping existing files. Pass --force to override.)'); + } + } else { + const rl = readline.createInterface({ + input: process.stdin, + output: process.stdout + }); + + const answer = await new Promise(resolve => { + rl.question(`\n ${TUI.bold('Do you want to override these files?')} (y/N): `, resolve); + }); + + rl.close(); + + shouldOverride = (answer as string).toLowerCase() === 'y'; + } + + if (!shouldOverride) { + TUI.step('Maintaining existing files', 'SKIP'); + } + } else if (existingFiles.length > 0 && shouldOverride) { + TUI.warn(`Overriding ${existingFiles.length} existing file(s) (--force)`); + } + + // Create docs directory if it doesn't exist + if (!dirExists.docs) { + await fs.ensureDir(docsDir); + TUI.step('Created docs/ directory', 'DONE'); + } else { + TUI.step('Using existing docs/ directory', 'SKIP'); + } + + // Create assets directory structure if it doesn't exist + if (!dirExists.assets) { + await fs.ensureDir(assetsDir); + await fs.ensureDir(assetsCssDir); + await fs.ensureDir(assetsJsDir); + await fs.ensureDir(assetsImagesDir); + TUI.step('Created assets/ infrastructure', 'DONE'); + } else { + TUI.step('Using existing assets/ directory', 'SKIP'); + if (!await fs.pathExists(assetsCssDir)) await fs.ensureDir(assetsCssDir); + if (!await fs.pathExists(assetsJsDir)) await fs.ensureDir(assetsJsDir); + if (!await fs.pathExists(assetsImagesDir)) await fs.ensureDir(assetsImagesDir); + } + + // Write config file if it doesn't exist or user confirmed override + if (!await fs.pathExists(configFile) && !await fs.pathExists(jsConfigFile) && !await fs.pathExists(tsConfigFile) || shouldOverride) { + await fs.writeFile(configFile, defaultConfigContent, 'utf8'); + TUI.step(`${shouldOverride ? 'Updated' : 'Created'} docmd.config.json`, 'DONE'); + } else { + TUI.step('Using existing configuration', 'SKIP'); + } + + // Write index.md file if it doesn't exist or user confirmed override + if (!await fs.pathExists(indexMdFile)) { + await fs.writeFile(indexMdFile, defaultIndexMdContent, 'utf8'); + TUI.step('Created docs/index.md', 'DONE'); + } else if (shouldOverride) { + await fs.writeFile(indexMdFile, defaultIndexMdContent, 'utf8'); + TUI.step('Updated docs/index.md', 'DONE'); + } else { + TUI.step('Using existing docs/index.md', 'SKIP'); + } + + // Write skills.md (the Agent Skills docs page) if it doesn't exist or user confirmed override + if (!await fs.pathExists(skillsMdFile)) { + await fs.writeFile(skillsMdFile, defaultSkillsMdContent, 'utf8'); + TUI.step('Created docs/skills.md', 'DONE'); + } else if (shouldOverride) { + await fs.writeFile(skillsMdFile, defaultSkillsMdContent, 'utf8'); + TUI.step('Updated docs/skills.md', 'DONE'); + } else { + TUI.step('Using existing docs/skills.md', 'SKIP'); + } + + // Write SKILL.md if it doesn't exist or user confirmed override + if (!await fs.pathExists(skillFile) || shouldOverride) { + TUI.dim(' Run `npx docmd-skills ` to install the full agent skill set.'); + } else { + TUI.step('Using existing SKILL.md', 'SKIP'); + } + + TUI.footer(); + TUI.success('Initialisation complete. Run `npm install` to setup dependencies.'); +} \ No newline at end of file diff --git a/packages/core/src/commands/live.ts b/packages/core/src/commands/live.ts new file mode 100644 index 0000000..8266795 --- /dev/null +++ b/packages/core/src/commands/live.ts @@ -0,0 +1,37 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/core (and ecosystem) + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + */ + +import { createRequire } from 'module'; + +const _require = createRequire(import.meta.url); + +import { fsUtils as fs } from '@docmd/utils'; +import path from 'path'; +import { TUI } from '@docmd/api'; + +export async function buildLive(options: any = {}) { + // Delegate to the standalone package + const livePkg = await import('@docmd/live'); + + // If explicitly asked NOT to serve (for testing), just build + if (options.serve === false) { + TUI.section('Building Live Editor'); + TUI.step('Compiling standalone runtime', 'WAIT'); + await livePkg.build(process.cwd()); + TUI.footer(); + } else { + // Default behavior: Build + Serve + await livePkg.start(); + } +} \ No newline at end of file diff --git a/packages/core/src/commands/mcp.ts b/packages/core/src/commands/mcp.ts new file mode 100644 index 0000000..fbc084c --- /dev/null +++ b/packages/core/src/commands/mcp.ts @@ -0,0 +1,558 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/core (and ecosystem) + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + */ + +import readline from 'readline'; +import fs from 'fs'; +import path from 'path'; +import { buildSite } from './build.js'; +import { loadConfig } from '../utils/config-loader.js'; +import { safePath, asUserPath } from '@docmd/utils'; + +const pkgUrl = new URL('../../package.json', import.meta.url); +const { version } = JSON.parse(fs.readFileSync(pkgUrl, 'utf-8')); + +// Helpers to find and search markdown files +function findMarkdownFiles(dir: string): string[] { + const results: string[] = []; + try { + const list = fs.readdirSync(dir); + for (const file of list) { + const fullPath = path.join(dir, file); + const stat = fs.statSync(fullPath); + if (stat && stat.isDirectory()) { + if (file !== 'node_modules' && !file.startsWith('.')) { + results.push(...findMarkdownFiles(fullPath)); + } + } else if (file.endsWith('.md') || file.endsWith('.markdown')) { + results.push(fullPath); + } + } + } catch { /* ignore filesystem errors */ } + return results; +} + +export function validateLinks(docsDir: string): { file: string; line: number; link: string; error: string }[] { + const errors: { file: string; line: number; link: string; error: string }[] = []; + if (!fs.existsSync(docsDir)) return errors; + + const mdFiles = findMarkdownFiles(docsDir); + + for (const filePath of mdFiles) { + try { + const content = fs.readFileSync(filePath, 'utf8'); + const lines = content.split('\n'); + const relativeFile = path.relative(process.cwd(), filePath); + + lines.forEach((lineText, lineIdx) => { + const lineNum = lineIdx + 1; + const linkRegex = /\[([^\]]+)\]\(([^)]+)\)/g; + let match; + while ((match = linkRegex.exec(lineText)) !== null) { + const linkTarget = match[2].trim().split('#')[0]; // strip anchors + if (!linkTarget) continue; + + // Skip external, anchors, mailto, etc. + if ( + linkTarget.startsWith('http://') || + linkTarget.startsWith('https://') || + linkTarget.startsWith('mailto:') || + linkTarget.startsWith('tel:') || + linkTarget.startsWith('#') + ) { + continue; + } + + // Resolve link relative to file's directory + let resolvedPath = ''; + if (linkTarget.startsWith('/')) { + resolvedPath = path.join(docsDir, linkTarget); + } else { + resolvedPath = path.resolve(path.dirname(filePath), linkTarget); + } + + // Phase 3 PR 3.C (M-1): strip trailing slash before the + // `.md` / `.markdown` / `index.*` existence checks. Most + // markdown editors add a trailing slash to internal links + // (e.g. `[page 2](/page-2/)`), and the previous code did + // `fs.existsSync('docs/page-2/.md')` which is always false. + // The build itself produces `page-2/index.html` and treats + // the trailing-slash and no-slash forms as the same link, + // so the validator MUST agree or it false-positives every + // valid link. + const stripped = resolvedPath.endsWith('/') && resolvedPath.length > 1 + ? resolvedPath.slice(0, -1) + : resolvedPath; + + const exists = + fs.existsSync(stripped) || + fs.existsSync(stripped + '.md') || + fs.existsSync(stripped + '.markdown') || + fs.existsSync(path.join(stripped, 'index.md')) || + fs.existsSync(path.join(stripped, 'index.markdown')); + + if (!exists) { + errors.push({ + file: relativeFile, + line: lineNum, + link: linkTarget, + error: `Broken link: target resolved to ${path.relative(process.cwd(), resolvedPath)} does not exist` + }); + } + } + }); + } catch { /* ignore read errors */ } + } + + return errors; +} + +export async function runMcpServer() { + console.error("docmd MCP server starting..."); + + const rl = readline.createInterface({ + input: process.stdin, + output: undefined, + terminal: false + }); + + const sendResponse = (id: any, result: any) => { + process.stdout.write(JSON.stringify({ jsonrpc: "2.0", id, result }) + "\n"); + }; + + const sendError = (id: any, code: number, message: string, data?: any) => { + process.stdout.write(JSON.stringify({ jsonrpc: "2.0", id, error: { code, message, data } }) + "\n"); + }; + + rl.on('line', async (line) => { + if (!line.trim()) return; + try { + const message = JSON.parse(line); + if (message.jsonrpc !== "2.0") { + sendError(message.id || null, -32600, "Invalid Request"); + return; + } + + const { method, params, id } = message; + + if (method === "initialize") { + sendResponse(id, { + protocolVersion: "2025-03-26", + capabilities: { + resources: {}, + tools: {}, + prompts: {} + }, + serverInfo: { + name: "docmd-mcp-server", + version + } + }); + return; + } + + if (method === "notifications/initialized" || method === "initialized") { + // Notification, no response needed + return; + } + + if (method === "ping") { + sendResponse(id, {}); + return; + } + + // Handle Prompts Listing + // The prompts capability is declared in initialize for forward + // compatibility. docmd ships no built-in prompts yet, so return an + // empty list rather than leaving the client to hit an unhandled-method error. + if (method === "prompts/list") { + sendResponse(id, { prompts: [] }); + return; + } + + // Handle Tools Listing + if (method === "tools/list") { + sendResponse(id, { + tools: [ + { + name: "search_docs", + description: "Search the documentation content for a specific query.", + inputSchema: { + type: "object", + properties: { + query: { type: "string", description: "The term or phrase to search for." } + }, + required: ["query"] + } + }, + { + name: "list_docs", + description: "List all documentation files in the project. Returns relative paths so the agent can navigate the docs structure before reading individual files.", + inputSchema: { + type: "object", + properties: { + subdir: { type: "string", "description": "Optional subdirectory to scope the listing (e.g. 'en', 'v1', 'guides'). Defaults to the configured source directory root." } + } + } + }, + { + name: "read_doc", + description: "Read the raw markdown content of a documentation file.", + inputSchema: { + type: "object", + properties: { + route: { type: "string", description: "Relative path to the markdown file from root (e.g. docs/getting-started.md)." } + }, + required: ["route"] + } + }, + { + name: "get_config", + description: "Retrieve the resolved docmd project configuration (docmd.config.json). Exposes the source directory, output directory, configured locales, versions, and enabled plugins so the agent understands the project structure.", + inputSchema: { + type: "object", + properties: {} + } + }, + { + name: "validate_docs", + description: "Validates and lints all local markdown links to detect broken paths.", + inputSchema: { + type: "object", + properties: {} + } + }, + { + name: "get_llms_context", + description: "Retrieve the unified prompt context of the entire documentation site (llms.txt content).", + inputSchema: { + type: "object", + properties: {} + } + } + ] + }); + return; + } + + // Handle Resources Listing + if (method === "resources/list") { + sendResponse(id, { + resources: [ + { + uri: "docmd://context/llms.txt", + name: "llms.txt Context", + mimeType: "text/plain", + description: "Unified text context containing the entire documentation site" + }, + { + uri: "docmd://context/skill", + name: "Agent SKILL.md", + mimeType: "text/markdown", + description: "Instruction manual and skills reference for docmd" + } + ] + }); + return; + } + + // Handle Resources Read + if (method === "resources/read") { + const { uri } = params || {}; + if (!uri) { + sendResponse(id, { content: [{ type: "text", text: "Error: URI parameter is required." }] }); + return; + } + + let config: any; + try { + config = await loadConfig('docmd.config.js', { quiet: true }); + } catch { + config = { src: 'docs', out: 'site' }; + } + + if (uri === "docmd://context/llms.txt") { + const llmsFullFile = path.resolve(process.cwd(), config.out || 'site', 'llms-full.txt'); + if (fs.existsSync(llmsFullFile)) { + try { + const fullContext = fs.readFileSync(llmsFullFile, 'utf8'); + sendResponse(id, { + contents: [{ + uri, + mimeType: "text/plain", + text: fullContext + }] + }); + } catch (err: any) { + sendResponse(id, { content: [{ type: "text", text: `Error reading context file: ${err.message}` }] }); + } + } else { + sendResponse(id, { content: [{ type: "text", text: "Error: llms-full.txt context file has not been generated." }] }); + } + return; + } + + if (uri === "docmd://context/skill") { + const skillFile = path.resolve(process.cwd(), 'SKILL.md'); + let content = ''; + if (fs.existsSync(skillFile)) { + try { + content = fs.readFileSync(skillFile, 'utf8'); + } catch (err: any) { + sendResponse(id, { content: [{ type: "text", text: `Error reading SKILL.md: ${err.message}` }] }); + return; + } + } else { + content = [ + "---", + "name: docmd", + "description: Fallback agent instruction set for docmd.", + "skills: docmd-skills (npm)", + "docs: https://docs.docmd.io", + "llms-context: https://docs.docmd.io/llms-full.txt", + "---", + "", + "# docmd Agent Skills", + "", + "This project uses **docmd**, the zero-config AI-first documentation engine.", + "", + "## Get the full skill set (single-line install)", + "", + "Run this once per machine to install the full agent skill set into your agent's skills directory:", + "", + "```bash", + "npx docmd-skills ~/.claude/skills", + "```", + "", + "Replace `~/.claude/skills` with the directory your agent reads skills from: `~/.cursor/skills` (Cursor), `./.skills` (project-local), etc. Run `npx docmd-skills --help` for the full subcommand list. The single install command pulls in the `docmd-skills`, `docmd-dev`, and `docmd-writer` skill modules โ€” see https://github.com/docmd-io/docmd-skills for details.", + "", + "## Project-local override", + "This fallback content covers the general case. For project-specific instructions, create a `SKILL.md` at the root of the docmd project โ€” `docmd mcp`'s `get_skill` tool returns that local file in preference to this fallback." + ].join('\n'); + } + + sendResponse(id, { + contents: [{ + uri, + mimeType: "text/markdown", + text: content + }] + }); + return; + } + + sendError(id, -32602, `Resource not found: ${uri}`); + return; + } + + // Handle Tools Execution + if (method === "tools/call") { + const { name, arguments: args } = params; + + // Resolve workspace parameters + let config: any; + try { + config = await loadConfig('docmd.config.js', { quiet: true }); + } catch { + // Fallback zero config + config = { src: 'docs', out: 'site' }; + } + const docsDir = path.resolve(process.cwd(), config.src || 'docs'); + + if (name === "search_docs") { + const query = (args?.query || "").toLowerCase(); + if (!query) { + sendResponse(id, { content: [{ type: "text", text: "Error: Query parameter is required." }] }); + return; + } + + if (!fs.existsSync(docsDir)) { + sendResponse(id, { content: [{ type: "text", text: `Error: Source directory "${docsDir}" does not exist.` }] }); + return; + } + + const mdFiles = findMarkdownFiles(docsDir); + const matches: string[] = []; + + for (const filePath of mdFiles) { + try { + const fileContent = fs.readFileSync(filePath, 'utf8'); + const lines = fileContent.split('\n'); + const fileRelPath = path.relative(process.cwd(), filePath); + let foundInFile = false; + + lines.forEach((lineText, idx) => { + if (lineText.toLowerCase().includes(query)) { + if (!foundInFile) { + matches.push(`\n### File: ${fileRelPath}`); + foundInFile = true; + } + matches.push(`Line ${idx + 1}: ${lineText.trim()}`); + } + }); + } catch { /* ignore file errors */ } + } + + const textResult = matches.length > 0 + ? `Found search matches:\n${matches.join('\n')}` + : `No matches found for query: "${query}"`; + + sendResponse(id, { content: [{ type: "text", text: textResult }] }); + return; + } + + if (name === "list_docs") { + const subdir = (args?.subdir || "").trim(); + let listRoot = docsDir; + if (subdir) { + // CWE-22 guard: same safePath treatment as read_doc. + if (path.isAbsolute(subdir)) { + sendResponse(id, { content: [{ type: "text", text: `Error: Absolute paths are not allowed.` }] }); + return; + } + try { + listRoot = safePath(docsDir, asUserPath(subdir)); + } catch { + sendResponse(id, { content: [{ type: "text", text: `Error: Path "${subdir}" escapes the source directory.` }] }); + return; + } + } + if (!fs.existsSync(listRoot)) { + sendResponse(id, { content: [{ type: "text", text: `Error: Directory "${path.relative(process.cwd(), listRoot)}" does not exist.` }] }); + return; + } + const files = findMarkdownFiles(listRoot).map(f => path.relative(process.cwd(), f)); + const sorted = files.sort(); + const textResult = sorted.length > 0 + ? `Documentation files (${sorted.length}):\n${sorted.join('\n')}` + : `No markdown files found under "${path.relative(process.cwd(), listRoot)}".`; + sendResponse(id, { content: [{ type: "text", text: textResult }] }); + return; + } + + if (name === "get_config") { + try { + const resolvedConfig = await loadConfig('docmd.config.js', { quiet: true }); + // Surface only the structural keys an agent needs. Omit + // potentially sensitive values (API keys, analytics IDs) by + // reconstructing a safe summary from the resolved config. + const safeSummary: Record = { + title: resolvedConfig.title || 'Untitled', + src: resolvedConfig.src || 'docs', + out: resolvedConfig.out || 'site', + url: resolvedConfig.url || null, + theme: resolvedConfig.theme?.name || 'default', + i18n: resolvedConfig.i18n + ? { + default: resolvedConfig.i18n.default, + locales: (resolvedConfig.i18n.locales || []).map((l: any) => ({ id: l.id, label: l.label, dir: l.dir })) + } + : null, + versions: resolvedConfig.versions + ? { + current: resolvedConfig.versions.current, + all: (resolvedConfig.versions.all || []).map((v: any) => ({ id: v.id, dir: v.dir, label: v.label })) + } + : null, + plugins: resolvedConfig.plugins + ? Object.keys(resolvedConfig.plugins).map(k => ({ + name: k, + enabled: resolvedConfig.plugins[k] !== false + })) + : [] + }; + sendResponse(id, { content: [{ type: "text", text: JSON.stringify(safeSummary, null, 2) }] }); + } catch (err: any) { + sendResponse(id, { content: [{ type: "text", text: `Error loading config: ${err.message}\n\nThe project may be running in zero-config mode (source: ./docs, output: ./site).` }] }); + } + return; + } + + if (name === "read_doc") { + const route = args?.route || ""; + if (!route) { + sendResponse(id, { content: [{ type: "text", text: "Error: Route is required." }] }); + return; + } + // Phase 1.A: CWE-22 fix (S-3, T-S1). Reject absolute paths outright and + // require relative paths to resolve inside the project root (cwd) via safePath(). + // Preserves the pre-fix semantic where route was resolved against process.cwd(). + if (path.isAbsolute(route)) { + sendResponse(id, { content: [{ type: "text", text: `Error: Absolute paths are not allowed.` }] }); + return; + } + let resolvedFilePath: string; + try { + resolvedFilePath = safePath(process.cwd(), asUserPath(route)); + } catch (_e: any) { + sendResponse(id, { content: [{ type: "text", text: `Error: Path "${route}" escapes project root.` }] }); + return; + } + if (!fs.existsSync(resolvedFilePath)) { + sendResponse(id, { content: [{ type: "text", text: `Error: File not found at path "${route}".` }] }); + return; + } + + try { + const rawContent = fs.readFileSync(resolvedFilePath, 'utf8'); + sendResponse(id, { content: [{ type: "text", text: rawContent }] }); + } catch (err: any) { + sendResponse(id, { content: [{ type: "text", text: `Error reading file: ${err.message}` }] }); + } + return; + } + + if (name === "validate_docs") { + const errors = validateLinks(docsDir); + if (errors.length === 0) { + sendResponse(id, { content: [{ type: "text", text: "Documentation links validated successfully! No broken links found." }] }); + } else { + const errorReport = errors.map(e => `[${e.file}:${e.line}] -> ${e.link} (${e.error})`).join('\n'); + sendResponse(id, { content: [{ type: "text", text: `Validation errors found:\n${errorReport}` }] }); + } + return; + } + + if (name === "get_llms_context") { + // Trigger build to ensure context is up to date + try { + console.error("Building site context..."); + await buildSite('docmd.config.js', { quiet: true, isDev: false }); + } catch (err: any) { + console.error(`Build warning: ${err.message}`); + } + + const llmsFullFile = path.resolve(process.cwd(), config.out || 'site', 'llms-full.txt'); + if (fs.existsSync(llmsFullFile)) { + try { + const fullContext = fs.readFileSync(llmsFullFile, 'utf8'); + sendResponse(id, { content: [{ type: "text", text: fullContext }] }); + } catch (err: any) { + sendResponse(id, { content: [{ type: "text", text: `Error reading context file: ${err.message}` }] }); + } + } else { + sendResponse(id, { content: [{ type: "text", text: "Error: llms-full.txt context file has not been generated. Please make sure the build finishes successfully." }] }); + } + return; + } + + sendError(id, -32601, `Method not found: ${name}`); + return; + } + + sendError(id, -32601, `Method not found: ${method}`); + } catch (err: any) { + sendError(null, -32700, `Parse error: ${err.message}`); + } + }); +} \ No newline at end of file diff --git a/packages/core/src/commands/migrate.ts b/packages/core/src/commands/migrate.ts new file mode 100644 index 0000000..d20afc6 --- /dev/null +++ b/packages/core/src/commands/migrate.ts @@ -0,0 +1,676 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/core (and ecosystem) + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + */ + +import { fsUtils as fs } from '@docmd/utils'; +import path from 'path'; +import nativeFs from 'fs'; +import { TUI } from '@docmd/api'; + +function serializeConfig(obj: any) { + const json = JSON.stringify(obj, null, 2); + const cleanJs = json.replace(/"([^"]+)":/g, '$1:'); + return `export default ${cleanJs};\n`; +} + +export async function migrateProject(options: { docusaurus?: boolean; mkdocs?: boolean; vitepress?: boolean; starlight?: boolean; upgrade?: boolean; dryRun?: boolean }) { + const CWD = process.cwd(); + const dryRun = options.dryRun === true; + + const moveFilesToBackup = async (backupDir: string) => { + const backupName = path.basename(backupDir); + const files = await nativeFs.promises.readdir(CWD); + for (const file of files) { + // N-10: keep lockfiles and package manifests in place โ€” moving them + // into the backup dir means `npm install` and `pnpm install` + // would re-resolve from scratch on a recovery. Lockfiles and + // package.json are part of the user's repo state, not migration + // input. + if (file === 'node_modules' || file === '.git' || file === backupName || file === 'docmd.config.js') continue; + if (file === 'package.json' || file === 'package-lock.json' || file === 'yarn.lock' || file === 'pnpm-lock.yaml' || file === 'bun.lockb' || file === 'bun.lock') continue; + const oldPath = path.resolve(CWD, file); + const newPath = path.resolve(backupDir, file); + await nativeFs.promises.rename(oldPath, newPath); + } + }; + + /** + * Build the list of files that `moveFilesToBackup` would move. Used + * by `--dry-run` to show the user what would change without writing. + * Returns filenames (relative to CWD). + */ + const planBackupMoves = async (backupName: string): Promise => { + const files = await nativeFs.promises.readdir(CWD); + return files.filter((f) => + f !== 'node_modules' && + f !== '.git' && + f !== backupName && + f !== 'docmd.config.js' && + f !== 'package.json' && + f !== 'package-lock.json' && + f !== 'yarn.lock' && + f !== 'pnpm-lock.yaml' && + f !== 'bun.lockb' && + f !== 'bun.lock' + ); + }; + + /** + * Pretty-print a dry-run plan for a source-migration path and exit 0. + */ + const printAndExitDryRun = async (sourceName: string, backupName: string, docmdConfig: object): Promise => { + const moves = await planBackupMoves(backupName); + TUI.section(`Dry run: ${sourceName} migration`); + TUI.item('Would move', `${moves.length} file${moves.length === 1 ? '' : 's'} โ†’ ${backupName}/`); + if (moves.length > 0 && moves.length <= 12) { + for (const f of moves) TUI.item(' ', f); + } else if (moves.length > 12) { + for (const f of moves.slice(0, 10)) TUI.item(' ', f); + TUI.item(' ', `โ€ฆ and ${moves.length - 10} more`); + } + TUI.item('Would write', 'docmd.config.js'); + TUI.item('Config', JSON.stringify(docmdConfig)); + TUI.footer(); + TUI.info('No changes made. Re-run without --dry-run to apply.'); + }; + + /** + * N-9: best-effort MkDocs `nav:` parser. MkDocs nav is a YAML + * nested list; we use a tiny line-by-line YAML-aware scanner + * (no `yaml` dependency) that handles the common shape: + * + * nav: + * - Home: index.md + * - Guide: + * - Getting Started: start.md + * - Reference: ref.md + * + * Sections without an explicit file (`- Guide:` with no value) are + * kept as parents; their children are nested under `children`. + * Anything fancier (external links, multi-line strings, anchors) + * is left to the runtime auto-router. + */ + const parseMkDocsNav = (rawYaml: string): any[] | null => { + const lines = rawYaml.split('\n'); + const navIdx = lines.findIndex((l) => /^nav\s*:\s*$/.test(l)); + if (navIdx === -1) return null; + + const root: any[] = []; + const stack: { indent: number; items: any[] }[] = [{ indent: -1, items: root }]; + for (let i = navIdx + 1; i < lines.length; i++) { + const line = lines[i]; + // `- Title: file.md` (most common) OR `- Title:` (section header). + // The colon + value are optional. The title capture is non-greedy + // so it stops at the colon, and we strip a trailing `:` from the + // captured title (which happens when the line is `- Title:` with + // no file). + const m = line.match(/^(\s*)-\s+(.+?)(?::\s*(.+?))?\s*$/); + if (!m) continue; + const indent = m[1].length; + // Strip a trailing `:` from the title (which happens when the + // line is `- Title:` with no file value, the section-header + // shape in MkDocs). + const title = m[2].trim().replace(/:\s*$/, ''); + const file = (m[3] || '').trim(); + const item: any = file + ? { title, path: file.replace(/\.(md|markdown)$/i, '/') } + : { title }; + while (stack.length > 1 && stack[stack.length - 1].indent >= indent) stack.pop(); + const top = stack[stack.length - 1]; + top.items.push(item); + if (i + 1 < lines.length) { + const next = lines[i + 1]; + const nm = next.match(/^(\s+)-/); + if (nm && nm[1].length > indent) { + item.children = []; + stack.push({ indent, items: item.children }); + } + } + } + return root.length > 0 ? root : null; + }; + + /** + * T-Z14 / T-Z17: walk a freshly-copied docs directory and translate + * Docusaurus-specific frontmatter keys to their docmd equivalents. + * + * `id:` โ†’ removed (docmd derives route ids from filenames) + * `sidebar_label:`โ†’ `nav_title:` (the docmd-supported nav override) + * + * The translation is best-effort: a file that fails to parse keeps + * its original content. Returns the count of files touched. + */ + const translateDocusaurusFrontmatter = async (docsDir: string): Promise => { + const targets: string[] = []; + const walk = async (dir: string): Promise => { + const entries = await nativeFs.promises.readdir(dir, { withFileTypes: true }); + for (const entry of entries) { + const full = path.join(dir, entry.name); + if (entry.isDirectory()) { + if (entry.name === 'node_modules' || entry.name.startsWith('.')) continue; + await walk(full); + } else if (entry.isFile() && /\.(md|mdx|markdown)$/i.test(entry.name)) { + targets.push(full); + } + } + }; + await walk(docsDir); + + let count = 0; + for (const file of targets) { + const raw = await nativeFs.promises.readFile(file, 'utf8'); + const m = raw.match(/^---\r?\n([\s\S]*?)\r?\n---/); + if (!m) continue; + // Line-by-line parse: we only care about top-level `key: value` + // lines. Docusaurus lets these be unquoted, single-quoted, or + // double-quoted. Nested objects (e.g. `sidebar:` with sub-keys) + // are preserved as-is. + const lines = m[1].split('\n'); + let changed = false; + const newLines = lines.map((line) => { + const stripped = line.replace(/\r$/, ''); + const idMatch = stripped.match(/^\s*id\s*:\s*(.*?)\s*$/); + if (idMatch) { changed = true; return null; } + const slMatch = stripped.match(/^(\s*)sidebar_label\s*:\s*(.*?)\s*$/); + if (slMatch) { + changed = true; + const indent = slMatch[1]; + let val = slMatch[2]; + // Strip wrapping quotes if present so the rewritten value + // matches the original document's quote style as closely as + // possible. docmd accepts both forms. + const qm = val.match(/^['"](.*)['"]$/); + if (qm) val = qm[1]; + return `${indent}nav_title: ${val}`; + } + return stripped; + }).filter((l) => l !== null) as string[]; + + if (!changed) continue; + const newFm = newLines.join('\n'); + const newContent = raw.replace(/^---\r?\n[\s\S]*?\r?\n---/, `---\n${newFm}\n---`); + await nativeFs.promises.writeFile(file, newContent); + count++; + } + return count; + }; + + if (options.docusaurus) { + TUI.section('Docusaurus Migration'); + const configPath = path.resolve(CWD, 'docusaurus.config.js'); + const tsConfigPath = path.resolve(CWD, 'docusaurus.config.ts'); + + let activeConfigPath = ''; + if (nativeFs.existsSync(configPath)) activeConfigPath = configPath; + else if (nativeFs.existsSync(tsConfigPath)) activeConfigPath = tsConfigPath; + else { + TUI.error('Missing configuration', 'docusaurus.config.js or docusaurus.config.ts not found.'); + // Phase 3 PR 3.A (F6): exit 1 so CI pipelines can gate on it. + process.exit(1); + } + + const backupDir = path.resolve(CWD, 'docusaurus-backup'); + + const rawConfig = await nativeFs.promises.readFile(activeConfigPath, 'utf8'); + let title = 'Docmd Site'; + const titleMatch = rawConfig.match(/title:\s*['"]([^'"]+)['"]/); + if (titleMatch) title = titleMatch[1]; + + // N-22: preserve the original Docusaurus staticDir if set (default + // is `static`). Falling back to `dist` only when the user hasn't + // overridden it โ€” overwriting a `site/` directory because we + // hardcoded `dist` is the most common silent-clobber pattern. + let out = 'dist'; + const staticDirMatch = rawConfig.match(/staticDir\s*:\s*['"]([^'"]+)['"]/); + if (staticDirMatch) out = staticDirMatch[1].replace(/^\.\//, '').replace(/\/$/, '') || 'static'; + + const docmdConfig = { title, src: 'docs', out, theme: { appearance: 'system' } }; + // N-3: dry-run must run BEFORE any side effects (ensureDir, rename). + if (dryRun) { + await printAndExitDryRun('Docusaurus', 'docusaurus-backup', docmdConfig); + return; + } + + await fs.ensureDir(backupDir); + await moveFilesToBackup(backupDir); + TUI.step('Created backup directory', 'DONE'); + + const backupDocsDir = path.resolve(backupDir, 'docs'); + const newDocsDir = path.resolve(CWD, 'docs'); + if (nativeFs.existsSync(backupDocsDir)) { + await fs.copy(backupDocsDir, newDocsDir); + TUI.step('Migrated documentation content', 'DONE'); + } else { + await fs.ensureDir(newDocsDir); + TUI.step('Created new docs directory', 'DONE'); + } + + // T-Z14 / T-Z17: translate Docusaurus-specific frontmatter keys. + // docmd derives route ids from filenames, so Docusaurus `id:` is + // dropped. `sidebar_label:` is preserved as `nav_title:` (a + // docmd-supported override of the auto-generated nav title). + // The translation is best-effort: files that fail to parse keep + // their original frontmatter, and a TUI line reports the count. + let fmTranslated = 0; + try { + const translated = await translateDocusaurusFrontmatter(newDocsDir); + fmTranslated = translated; + } catch (err: any) { + TUI.warn(`Frontmatter translation skipped: ${err.message}`); + } + if (fmTranslated > 0) { + TUI.step(`Translated Docusaurus frontmatter in ${fmTranslated} file(s)`, 'DONE'); + } + + await nativeFs.promises.writeFile(path.resolve(CWD, 'docmd.config.js'), serializeConfig(docmdConfig)); + TUI.step('Generated docmd.config.js', 'DONE'); + + TUI.footer(); + TUI.success('Docusaurus migration complete.'); + TUI.info(`Original files moved to: ${TUI.cyan('docusaurus-backup/')}`); + TUI.info(`Run ${TUI.cyan('docmd dev')} to preview your site.`); + + } else if (options.mkdocs) { + TUI.section('MkDocs Migration'); + const configPath = path.resolve(CWD, 'mkdocs.yml'); + + if (!nativeFs.existsSync(configPath)) { + TUI.error('Missing configuration', 'mkdocs.yml not found.'); + // Phase 3 PR 3.A (F6): exit 1 so CI pipelines can gate on it. + process.exit(1); + } + + const backupDir = path.resolve(CWD, 'mkdocs-backup'); + + const rawConfig = await nativeFs.promises.readFile(configPath, 'utf8'); + let title = 'Docmd Site'; + const titleMatch = rawConfig.match(/^site_name:\s*['"]?([^'"\n]+)['"]?/m); + if (titleMatch) title = titleMatch[1].trim(); + + // N-22: preserve the original `site_dir` (MkDocs default is `site`). + // N-9 (partial): also build a basic nav tree from MkDocs `nav:`. + let out = 'site'; + const siteDirMatch = rawConfig.match(/^site_dir\s*:\s*['"]?([^'"\n]+)['"]?/m); + if (siteDirMatch) out = siteDirMatch[1].trim(); + // N-9: parse a simple top-level nav. This is a best-effort translation; + // complex MkDocs nav trees (multi-level, with external links) fall + // back to auto-generated nav at runtime. + const nav = parseMkDocsNav(rawConfig); + + const docmdConfig: any = { title, src: 'docs', out, theme: { appearance: 'system' } }; + if (nav && nav.length > 0) docmdConfig.navigation = nav; + // N-3: dry-run must run BEFORE any side effects (ensureDir, rename). + if (dryRun) { + await printAndExitDryRun('MkDocs', 'mkdocs-backup', docmdConfig); + return; + } + + await fs.ensureDir(backupDir); + await moveFilesToBackup(backupDir); + TUI.step('Created backup directory', 'DONE'); + + const backupDocsDir = path.resolve(backupDir, 'docs'); + const newDocsDir = path.resolve(CWD, 'docs'); + if (nativeFs.existsSync(backupDocsDir)) { + await fs.copy(backupDocsDir, newDocsDir); + TUI.step('Migrated documentation content', 'DONE'); + } else { + await fs.ensureDir(newDocsDir); + TUI.step('Created new docs directory', 'DONE'); + } + + await nativeFs.promises.writeFile(path.resolve(CWD, 'docmd.config.js'), serializeConfig(docmdConfig)); + TUI.step('Generated docmd.config.js', 'DONE'); + + TUI.footer(); + TUI.success('MkDocs migration complete.'); + TUI.info(`Original files moved to: ${TUI.cyan('mkdocs-backup/')}`); + TUI.info(`Run ${TUI.cyan('docmd dev')} to preview your site.`); + + } else if (options.vitepress) { + TUI.section('VitePress Migration'); + const CWD = process.cwd(); + + let configDir = ''; + let activeConfigPath = ''; + + // Check if config is in root or docs + for (const dir of ['.vitepress', 'docs/.vitepress']) { + for (const ext of ['js', 'ts', 'mjs']) { + const p = path.resolve(CWD, `${dir}/config.${ext}`); + if (nativeFs.existsSync(p)) { + configDir = dir; + activeConfigPath = p; + break; + } + } + if (activeConfigPath) break; + } + + if (!activeConfigPath) { + TUI.error('Missing configuration', '.vitepress/config.[js|ts|mjs] not found.'); + // Phase 3 PR 3.A (F6): exit 1 so CI pipelines can gate on it. + process.exit(1); + } + + const backupDir = path.resolve(CWD, 'vitepress-backup'); + + const rawConfig = await nativeFs.promises.readFile(activeConfigPath, 'utf8'); + let title = 'Docmd Site'; + const titleMatch = rawConfig.match(/title:\s*['"]([^'"]+)['"]/); + if (titleMatch) title = titleMatch[1]; + + const docmdConfig = { title, src: 'docs', out: 'dist', theme: { appearance: 'system' } }; + // N-3: dry-run must run BEFORE any side effects. + if (dryRun) { + await printAndExitDryRun('VitePress', 'vitepress-backup', docmdConfig); + return; + } + + await fs.ensureDir(backupDir); + await moveFilesToBackup(backupDir); + TUI.step('Created backup directory', 'DONE'); + + const isDocsInRoot = configDir === '.vitepress'; + const newDocsDir = path.resolve(CWD, 'docs'); + await fs.ensureDir(newDocsDir); + + if (isDocsInRoot) { + const files = await nativeFs.promises.readdir(backupDir); + for (const file of files) { + if (file.endsWith('.md')) { + await fs.copy(path.resolve(backupDir, file), path.resolve(newDocsDir, file)); + } + } + TUI.step('Migrated root content to docs/', 'DONE'); + } else { + const backupDocsDir = path.resolve(backupDir, 'docs'); + if (nativeFs.existsSync(backupDocsDir)) { + await fs.copy(backupDocsDir, newDocsDir); + await fs.remove(path.resolve(newDocsDir, '.vitepress')); + TUI.step('Migrated docs content', 'DONE'); + } + } + + await nativeFs.promises.writeFile(path.resolve(CWD, 'docmd.config.js'), serializeConfig(docmdConfig)); + TUI.step('Generated docmd.config.js', 'DONE'); + + TUI.footer(); + TUI.success('VitePress migration complete.'); + TUI.info(`Original files moved to: ${TUI.cyan('vitepress-backup/')}`); + TUI.info(`Run ${TUI.cyan('docmd dev')} to preview your site.`); + + } else if (options.starlight) { + TUI.section('Starlight Migration'); + const configPath = path.resolve(CWD, 'astro.config.mjs'); + const tsConfigPath = path.resolve(CWD, 'astro.config.ts'); + + let activeConfigPath = ''; + if (nativeFs.existsSync(configPath)) activeConfigPath = configPath; + else if (nativeFs.existsSync(tsConfigPath)) activeConfigPath = tsConfigPath; + else { + TUI.error('Missing configuration', 'astro.config.mjs or astro.config.ts not found.'); + // Phase 3 PR 3.A (F6): exit 1 so CI pipelines can gate on it. + process.exit(1); + } + + const backupDir = path.resolve(CWD, 'starlight-backup'); + + const rawConfig = await nativeFs.promises.readFile(activeConfigPath, 'utf8'); + let title = 'Docmd Site'; + const titleMatch = rawConfig.match(/title:\s*['"]([^'"]+)['"]/); + if (titleMatch) title = titleMatch[1]; + + const docmdConfig = { title, src: 'docs', out: 'dist', theme: { appearance: 'system' } }; + // N-3: dry-run must run BEFORE any side effects. + if (dryRun) { + await printAndExitDryRun('Starlight', 'starlight-backup', docmdConfig); + return; + } + + await fs.ensureDir(backupDir); + await moveFilesToBackup(backupDir); + TUI.step('Created backup directory', 'DONE'); + + const backupDocsDir = path.resolve(backupDir, 'src/content/docs'); + const newDocsDir = path.resolve(CWD, 'docs'); + + if (nativeFs.existsSync(backupDocsDir)) { + await fs.copy(backupDocsDir, newDocsDir); + TUI.step('Migrated documentation content', 'DONE'); + } else { + await fs.ensureDir(newDocsDir); + TUI.step('Created new docs directory', 'DONE'); + } + + await nativeFs.promises.writeFile(path.resolve(CWD, 'docmd.config.js'), serializeConfig(docmdConfig)); + TUI.step('Generated docmd.config.js', 'DONE'); + + TUI.footer(); + TUI.success('Astro Starlight migration complete.'); + TUI.info(`Original files moved to: ${TUI.cyan('starlight-backup/')}`); + TUI.info(`Run ${TUI.cyan('docmd dev')} to preview your site.`); + } else if (options.upgrade) { + TUI.section('Upgrading Configuration'); + + const jsonPath = path.resolve(CWD, 'docmd.config.json'); + const jsPath = path.resolve(CWD, 'docmd.config.js'); + const tsPath = path.resolve(CWD, 'docmd.config.ts'); + + let activePath = ''; + let format: 'json' | 'js' | 'ts' = 'json'; + + if (nativeFs.existsSync(jsonPath)) { + activePath = jsonPath; + format = 'json'; + } else if (nativeFs.existsSync(jsPath)) { + activePath = jsPath; + format = 'js'; + } else if (nativeFs.existsSync(tsPath)) { + activePath = tsPath; + format = 'ts'; + } + + if (!activePath) { + TUI.error('Upgrade Failed', 'No docmd configuration file (docmd.config.json/js/ts) found in current directory.'); + // Phase 3 PR 3.A (F6): exit 1 so CI pipelines can gate on it. + process.exit(1); + } + + TUI.step(`Found configuration: ${TUI.cyan(path.basename(activePath))}`, 'WAIT'); + + try { + const raw = await nativeFs.promises.readFile(activePath, 'utf8'); + let configObj: any = {}; + let isUpgraded = false; + + if (format === 'json') { + configObj = JSON.parse(raw); + } else { + // Dynamic import to read current exported config values + const module = await import(`file://${activePath}`); + configObj = module.default || {}; + } + + // 1. Upgrade legacy top-level 'projects' to 'workspace.projects' + if (configObj.projects && Array.isArray(configObj.projects) && !configObj.workspace) { + configObj.workspace = { + projects: configObj.projects, + switcher: { + enabled: true, + position: 'sidebar-top' + } + }; + delete configObj.projects; + isUpgraded = true; + TUI.step('Upgraded legacy top-level "projects" to "workspace" schema.', 'DONE'); + } + + // 2. Upgrade legacy 'siteTitle' to 'title' + if (configObj.siteTitle && !configObj.title) { + configObj.title = configObj.siteTitle; + delete configObj.siteTitle; + isUpgraded = true; + TUI.step('Upgraded "siteTitle" to "title".', 'DONE'); + } + + // 3. Upgrade legacy 'siteUrl' / 'baseUrl' to 'url' + if (configObj.siteUrl && !configObj.url) { + configObj.url = configObj.siteUrl; + delete configObj.siteUrl; + isUpgraded = true; + TUI.step('Upgraded "siteUrl" to "url".', 'DONE'); + } + if (configObj.baseUrl && !configObj.url) { + configObj.url = configObj.baseUrl; + delete configObj.baseUrl; + isUpgraded = true; + TUI.step('Upgraded "baseUrl" to "url".', 'DONE'); + } + + // 4. Upgrade legacy 'srcDir' to 'src' + if (configObj.srcDir && !configObj.src) { + configObj.src = configObj.srcDir; + delete configObj.srcDir; + isUpgraded = true; + TUI.step('Upgraded "srcDir" to "src".', 'DONE'); + } + + // 5. Upgrade legacy 'outputDir' to 'out' + if (configObj.outputDir && !configObj.out) { + configObj.out = configObj.outputDir; + delete configObj.outputDir; + isUpgraded = true; + TUI.step('Upgraded "outputDir" to "out".', 'DONE'); + } + + // 6. Upgrade legacy 'defaultLocale' to 'i18n.default' + if (configObj.defaultLocale) { + configObj.i18n = configObj.i18n || {}; + configObj.i18n.default = configObj.defaultLocale; + delete configObj.defaultLocale; + isUpgraded = true; + TUI.step('Upgraded "defaultLocale" to "i18n.default".', 'DONE'); + } + + // N-4: extend the legacy-key map with the remaining common keys. + // The previous upgrade covered siteTitle/siteUrl/baseUrl/srcDir/ + // outputDir/defaultLocale/projects but left several documented + // legacy keys untouched. These are the keys the build-time + // loader used in 0.7.x and earlier. + + // 7. 'source' (older alias for 'src') + if (configObj.source && !configObj.src) { + configObj.src = configObj.source; + delete configObj.source; + isUpgraded = true; + TUI.step('Upgraded "source" to "src".', 'DONE'); + } + + // 8. 'outDir' (older alias for 'out') + if (configObj.outDir && !configObj.out) { + configObj.out = configObj.outDir; + delete configObj.outDir; + isUpgraded = true; + TUI.step('Upgraded "outDir" to "out".', 'DONE'); + } + + // 9. 'nav' (legacy sidebar structure) โ†’ 'navigation' + if (configObj.nav && !configObj.navigation) { + configObj.navigation = configObj.nav; + delete configObj.nav; + isUpgraded = true; + TUI.step('Upgraded "nav" to "navigation".', 'DONE'); + } + + // 10. Top-level 'search' boolean โ†’ 'plugins.search' + if (typeof configObj.search === 'boolean' && !configObj.plugins?.search) { + configObj.plugins = configObj.plugins || {}; + configObj.plugins.search = configObj.search === true ? {} : { enabled: false }; + delete configObj.search; + isUpgraded = true; + TUI.step('Upgraded top-level "search" to "plugins.search".', 'DONE'); + } + + // 11. Top-level 'sidebar' โ†’ 'layout.sidebar' + if (configObj.sidebar && !configObj.layout?.sidebar) { + configObj.layout = configObj.layout || {}; + configObj.layout.sidebar = configObj.sidebar; + delete configObj.sidebar; + isUpgraded = true; + TUI.step('Upgraded top-level "sidebar" to "layout.sidebar".', 'DONE'); + } + + // 12. 'theme.enableModeToggle' โ†’ 'optionsMenu.components.themeSwitch' + if (configObj.theme?.enableModeToggle !== undefined) { + configObj.optionsMenu = configObj.optionsMenu || {}; + configObj.optionsMenu.components = configObj.optionsMenu.components || {}; + configObj.optionsMenu.components.themeSwitch = configObj.theme.enableModeToggle !== false; + delete configObj.theme.enableModeToggle; + isUpgraded = true; + TUI.step('Upgraded "theme.enableModeToggle" to "optionsMenu.components.themeSwitch".', 'DONE'); + } + + // 13. 'theme.positionMode' โ†’ 'optionsMenu.position' + if (configObj.theme?.positionMode && !configObj.optionsMenu?.position) { + configObj.optionsMenu = configObj.optionsMenu || {}; + configObj.optionsMenu.position = configObj.theme.positionMode === 'bottom' ? 'sidebar-bottom' : 'sidebar-top'; + delete configObj.theme.positionMode; + isUpgraded = true; + TUI.step('Upgraded "theme.positionMode" to "optionsMenu.position".', 'DONE'); + } + + // 14. 'theme.defaultMode' โ†’ 'theme.appearance' + if (configObj.theme?.defaultMode && !configObj.theme?.appearance) { + configObj.theme.appearance = configObj.theme.defaultMode; + delete configObj.theme.defaultMode; + isUpgraded = true; + TUI.step('Upgraded "theme.defaultMode" to "theme.appearance".', 'DONE'); + } + + if (!isUpgraded) { + TUI.footer(); + TUI.success('Configuration is already up to date with the latest schema.'); + return; + } + + // N-3: dry-run prints the upgraded config and exits 0 without writing. + if (dryRun) { + TUI.section('Dry run: config upgrade'); + TUI.item('Config path', activePath); + TUI.item('Upgraded config', JSON.stringify(configObj, null, 2)); + TUI.footer(); + TUI.info('No changes made. Re-run without --dry-run to apply.'); + return; + } + + // Write upgraded config back + if (format === 'json') { + await nativeFs.promises.writeFile(activePath, JSON.stringify(configObj, null, 2) + '\n'); + } else { + let content = serializeConfig(configObj); + if (format === 'ts') { + content = `import { UserConfig } from '@docmd/api';\n\nconst config: UserConfig = ${JSON.stringify(configObj, null, 2).replace(/"([^"]+)":/g, '$1:')};\n\nexport default config;\n`; + } + await nativeFs.promises.writeFile(activePath, content); + } + + TUI.footer(); + TUI.success(`Successfully upgraded config file to modern schema.`); + } catch (error: any) { + TUI.error('Upgrade Error', `Failed to parse or write config file: ${error.message}`); + // Phase 3 PR 3.A (F6): exit 1 so CI pipelines can gate on it. + process.exit(1); + } + } +} diff --git a/packages/core/src/commands/stop.ts b/packages/core/src/commands/stop.ts new file mode 100644 index 0000000..7c1c734 --- /dev/null +++ b/packages/core/src/commands/stop.ts @@ -0,0 +1,182 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/core (and ecosystem) + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + */ + +import { execSync } from 'child_process'; +import { TUI } from '@docmd/api'; + +// M-11: how long to wait after SIGTERM before escalating to SIGKILL. +// Docmd's dev server installs a graceful-shutdown handler on SIGTERM +// (closes watchers, the http server, the WebSocket server, and the +// worker pool). `docmd stop` waits this long for the process to exit +// on its own before sending the uncatchable SIGKILL. +const SIGTERM_GRACE_MS = 5000; + +/** + * Poll `pid` until it has exited or `timeoutMs` has elapsed. + * Returns `true` if the process exited within the window, `false` + * if it was still alive at the timeout (caller should escalate to + * SIGKILL). Polls every 100ms to keep the perceived latency low. + */ +export async function waitForExit(pid: number, timeoutMs: number): Promise { + const deadline = Date.now() + timeoutMs; + while (Date.now() < deadline) { + try { + // signal 0 = existence check; throws ESRCH if the pid is gone + process.kill(pid, 0); + } catch (err: any) { + if (err && err.code === 'ESRCH') return true; + // EPERM means the process exists but we can't signal it โ€” treat + // as still alive and let the outer catch handle escalation. + return false; + } + await new Promise((r) => setTimeout(r, 100)); + } + return false; +} + +/** + * find and kill running docmd processes + * If port is provided, only kill the process listening on that port. + * If force is true, also kill serve processes on common docmd ports. + */ +export async function stopServer(port: any, force: boolean = false) { + // Common ports used by docmd dev server + const commonPorts = [3000, 3001, 8080, 8081]; + + if (port) { + TUI.section(`Stopping port ${port}`); + try { + // Try lsof first + let pid = ''; + try { + pid = execSync(`lsof -t -i:${port}`).toString().trim(); + } catch { + // Fallback to fuser if lsof fails + try { + pid = execSync(`fuser -k ${port}/tcp 2>/dev/null`).toString().trim(); + } catch { + // Fallback to netstat + const netstat = execSync(`netstat -anp tcp 2>/dev/null | grep LISTEN | grep ${port}`).toString(); + const match = netstat.match(/(\d+)\/\w+/); + if (match) pid = match[1]; + } + } + if (pid) { + TUI.step(`Found process ${pid} on port ${port}`, 'WAIT'); + const pidNum = Number(pid); + // M-11: send SIGTERM first, wait up to SIGTERM_GRACE_MS for the + // process to exit on its own (the dev server installs a + // graceful shutdown handler), and only then escalate to SIGKILL. + try { + process.kill(pidNum, 'SIGTERM'); + } catch (err: any) { + TUI.step(`Failed to send SIGTERM to PID ${pid}: ${err.message}`, 'FAIL', TUI.red); + } + if (await waitForExit(pidNum, SIGTERM_GRACE_MS)) { + TUI.footer(); + TUI.success(`Docmd instance on port ${port} stopped gracefully.`); + return; + } + try { + process.kill(pidNum, 'SIGKILL'); + } catch (err: any) { + TUI.step(`Failed to send SIGKILL to PID ${pid}: ${err.message}`, 'FAIL', TUI.red); + } + TUI.footer(); + TUI.success(`Docmd instance on port ${port} has been stopped.`); + return; + } + } catch { + // No process found + } + TUI.step(`No instance found on port ${port}`, 'SKIP'); + TUI.footer(); + return; + } + + TUI.section('Stopping all instances'); + + try { + // Get all processes with PIDs and full command lines + // We filter for docmd but exclude the grep itself and the current process + const currentPid = process.pid; + + // Use ps to list processes. -ax to see all, -o pid,command for details. + const output = execSync('ps -ax -o pid,command').toString(); + const lines = output.split('\n'); + + const targets = []; + + for (const line of lines) { + const trimmed = line.trim(); + if (!trimmed) continue; + + const [pidStr, ...cmdParts] = trimmed.split(/\s+/); + const pid = parseInt(pidStr, 10); + const command = cmdParts.join(' '); + + // Check if it's a docmd process (dev or live) but not the current one + // We look for 'docmd dev', 'docmd live', or direct bin/docmd.js execution + const isDocmd = command.includes('docmd dev') || + command.includes('docmd live') || + command.includes('bin/docmd.js'); + + // With --force, also detect 'serve' processes on common docmd ports + let isServe = false; + if (force) { + isServe = (command.includes('serve ') || command.includes('serve -p')) && + commonPorts.some(p => command.includes(`-p ${p}`) || command.includes(`--port ${p}`)); + } + + const isNotCurrent = pid !== currentPid && command.indexOf('stop') === -1; + + if ((isDocmd || isServe) && isNotCurrent) { + targets.push({ pid, command, type: isServe ? 'serve' : 'docmd' }); + } + } + + if (targets.length === 0) { + TUI.step('No running docmd instances found', 'SKIP'); + TUI.footer(); + return; + } + + for (const target of targets) { + try { + TUI.step(`Stopping ${target.type} PID ${target.pid} (SIGTERM)`, 'WAIT'); + process.kill(target.pid, 'SIGTERM'); + } catch { + // If SIGTERM fails, skip the graceful wait + } + // M-11: give the graceful-shutdown handler time to run before + // escalating to SIGKILL. + if (!(await waitForExit(target.pid, SIGTERM_GRACE_MS))) { + try { + process.kill(target.pid, 'SIGKILL'); + TUI.step(`Killed ${target.type} PID ${target.pid} (SIGKILL after grace)`, 'DONE'); + } catch (err2: any) { + TUI.step(`Failed to kill PID ${target.pid}: ${err2.message}`, 'FAIL', TUI.red); + } + } else { + TUI.step(`Stopped ${target.type} PID ${target.pid} gracefully`, 'DONE'); + } + } + + TUI.footer(); + TUI.success('All docmd instances have been stopped.'); + + } catch (error: any) { + TUI.error('Error during stop', error.message); + } +} \ No newline at end of file diff --git a/packages/core/src/commands/validate.ts b/packages/core/src/commands/validate.ts new file mode 100644 index 0000000..eb48ba9 --- /dev/null +++ b/packages/core/src/commands/validate.ts @@ -0,0 +1,64 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/core (and ecosystem) + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + */ + +import { TUI } from '@docmd/api'; +import { loadConfig } from '../utils/config-loader.js'; +import { validateLinks } from './mcp.js'; +import path from 'path'; +import fs from 'fs'; + +export async function validateProject(options: { json?: boolean } = {}) { + let config: any; + try { + config = await loadConfig('docmd.config.js', { quiet: true }); + } catch { + config = { src: 'docs' }; + } + + const docsDir = path.resolve(process.cwd(), config.src || 'docs'); + + if (!fs.existsSync(docsDir)) { + if (options.json) { + console.log(JSON.stringify({ error: `Docs directory not found at ${docsDir}`, errors: [] })); + } else { + TUI.error('Validation Error', `Docs directory not found: ${docsDir}`); + } + process.exit(1); + } + + const errors = validateLinks(docsDir); + + if (options.json) { + // Phase 3 PR 3.A (M-12): even when JSON output is requested, the + // process MUST exit 1 if any errors were found. CI pipelines + // (`docmd validate --json | jq .errors | if [ $(. | length) -gt 0 ]; then exit 1`) + // rely on the exit code, not the JSON payload, to gate merges. + console.log(JSON.stringify({ errors })); + if (errors.length > 0) { + process.exit(1); + } + } else { + TUI.section('Documentation Validation'); + if (errors.length === 0) { + TUI.success('All internal links and references are valid!'); + } else { + TUI.error('Validation Failed', `Found ${errors.length} broken links:`); + errors.forEach(e => { + TUI.item(`[${e.file}:${e.line}]`, `${e.link} -> ${e.error}`); + }); + TUI.footer(); + process.exit(1); + } + } +} \ No newline at end of file diff --git a/packages/core/src/engine/assets.ts b/packages/core/src/engine/assets.ts new file mode 100644 index 0000000..72ecaa3 --- /dev/null +++ b/packages/core/src/engine/assets.ts @@ -0,0 +1,133 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/core (and ecosystem) + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + */ + +import path from 'path'; +import { fsUtils as fs } from '@docmd/utils'; +import esbuild from 'esbuild'; +import { createRequire } from 'module'; +import nativeFs from 'fs'; + +const _require = createRequire(import.meta.url); +import * as themes from '@docmd/themes'; +import * as ui from '@docmd/ui'; + +const pkgUrl = new URL('../../package.json', import.meta.url); +const pkg = JSON.parse(nativeFs.readFileSync(pkgUrl, 'utf8')); + +const COPYRIGHT_BANNER = `/*! + * docmd (v${pkg.version}) + * Copyright (c) 2025-present docmd.io + * License: MIT + */`; + +export async function findFilesRecursive(dir: string, extensions: string[]): Promise { + let files: string[] = []; + if (!await fs.exists(dir)) return []; + const items = await nativeFs.promises.readdir(dir, { withFileTypes: true }); + for (const item of items) { + // Explicitly ignore system files, git, and node_modules to prevent duplicate ID crashes + if (item.name === 'node_modules' || item.name.startsWith('.') || item.name === 'site') continue; + + const fullPath = path.join(dir, item.name); + if (item.isDirectory()) { + files = files.concat(await findFilesRecursive(fullPath, extensions)); + } else if (item.isFile()) { + if (!extensions || extensions.includes(path.extname(item.name))) { + files.push(fullPath); + } + } + } + return files; +} + +export async function prepareAssets(config: any, outputDir: string, options: any = {}) { + const CWD = process.cwd(); + + // 1. Core UI Assets + const uiAssets = ui.getAssetsDir(); + if (await fs.exists(uiAssets)) await fs.copy(uiAssets, path.join(outputDir, 'assets')); + + // 2. Theme Assets + const themesDir = themes.getThemesDir(); + if (await fs.exists(themesDir)) await fs.copy(themesDir, path.join(outputDir, 'assets/css')); + + // 3. User Assets (Root) + const userAssets = path.resolve(CWD, 'assets'); + if (await fs.exists(userAssets)) await fs.copy(userAssets, path.join(outputDir, 'assets')); + + // 3.5. User Assets (Docs Dir) + if (config.src) { + const srcAssets = path.resolve(CWD, config.src, 'assets'); + if (await fs.exists(srcAssets)) await fs.copy(srcAssets, path.join(outputDir, 'assets')); + } + + // 4. Minification (Production only) + if (config.minify !== false && !options.isDev) { + await minifyDir(path.join(outputDir, 'assets')); + } +} + +// --------------------------------------------------------------------------- +// Template Assets (new in 0.8.7) +// Templates ship their own CSS/JS bundles. We copy them into +// `assets/template/` so they survive minification and +// can be referenced with a stable URL. +// --------------------------------------------------------------------------- +export async function prepareTemplateAssets(config: any, outputDir: string) { + // The hooks object is exported by @docmd/api. We import lazily to avoid + // a hard build-time cycle between @docmd/core โ†” @docmd/api. + const { hooks } = await import('@docmd/api'); + if (!hooks || !Array.isArray(hooks.templateAssets) || hooks.templateAssets.length === 0) return; + + const templateDir = path.join(outputDir, 'assets', 'template'); + await fs.ensureDir(templateDir); + + for (const asset of hooks.templateAssets) { + if (!asset || !asset.path || !asset.type) continue; + if (asset.type !== 'css' && asset.type !== 'js') continue; + if (!await fs.exists(asset.path)) { + // Don't crash the build โ€” the resolver already warned at render time. + continue; + } + const dest = path.join(templateDir, path.basename(asset.path)); + await fs.copy(asset.path, dest); + } +} + +async function minifyDir(dir: string) { + const assets = await findFilesRecursive(dir, ['.css', '.js']); + for (const file of assets) { + if (file.endsWith('.min.js') || file.endsWith('.min.css')) continue; + try { + const ext = path.extname(file); + const content = await nativeFs.promises.readFile(file, 'utf8'); + const result = await esbuild.transform(content, { + loader: ext.slice(1) as any, + minify: true, + legalComments: 'none' + }); + await nativeFs.promises.writeFile(file, COPYRIGHT_BANNER + '\n' + result.code); + } catch { + // Ignore errors for non-standard files or mixed content + } + } +} + +// Generate HTML Tag Helper +export function generateAssetTag(pathOrUrl: string, type: string, attributes: any = {}) { + const attrs = Object.entries(attributes).map(([k, v]) => v === true ? k : `${k}="${v}"`).join(' '); + if (type === 'css') return ``; + if (type === 'js') return ``; + return ''; +} \ No newline at end of file diff --git a/packages/core/src/engine/generator.ts b/packages/core/src/engine/generator.ts new file mode 100644 index 0000000..ed1c8ef --- /dev/null +++ b/packages/core/src/engine/generator.ts @@ -0,0 +1,837 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/core (and ecosystem) + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + */ + +import path from 'path'; +import { fsUtils as fs } from '@docmd/utils'; +import { createRequire } from 'module'; +import { execSync } from 'child_process'; + +/** + * Convert every segment of a relative file path to a URL-safe slug, + * mirroring the slugifySegment logic in auto-router.ts. + * This ensures the output path written to disk matches the URL that + * buildAutoNav generates for the same file. + * + * Example: "SA/folder with space/page with space" + * โ†’ "SA/folder-with-space/page-with-space" + */ +function slugifyOutputPath(p: string): string { + return p + .split('/') + .map(seg => + seg + .replace(/\s+/g, '-') + .replace(/[^a-zA-Z0-9\-_.~]/g, '-') + .replace(/-{2,}/g, '-') + .replace(/^-+|-+$/g, '') + || seg + ) + .join('/'); +} +import { generateAssetTag, findFilesRecursive } from './assets.js'; +import { generateHreflangTags } from './i18n.js'; +import nativeFs from 'fs'; + +const _require = createRequire(import.meta.url); +import * as parser from '@docmd/parser'; +import { TUI } from '@docmd/tui'; +import { findPageNeighbors, findBreadcrumbs, normalizeNavPaths, createUrlContext, buildContextualUrl, computePageUrls, buildAbsoluteUrl, sanitizeUrl } from '@docmd/parser'; +import * as ui from '@docmd/ui'; + + + +/* โ”€โ”€ Core package version (for ) โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ */ +const _pkgUrl = new URL('../../package.json', import.meta.url); +const _pkg = JSON.parse(nativeFs.readFileSync(_pkgUrl, 'utf8')) as { version: string }; +const CORE_VERSION: string = _pkg.version; + +/* โ”€โ”€ Constants โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ */ + +/** Number of pages to process concurrently in each batch. */ +const BATCH_SIZE = 64; + +/** Number of pages to write to disk concurrently. */ +const WRITE_BATCH_SIZE = 128; + +/* โ”€โ”€ Git Root Detection (for edit links) โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ */ + +/** Cached git root path (null = not yet detected, '' = not a git repo). */ +let _cachedGitRoot: string | null = null; + +/** + * Detect the git repository root for the current working directory. + * Returns the absolute path to the git root, or null if not in a git repo. + * Result is cached per build (cache resets when cwd changes). + */ +function getGitRoot(): string | null { + if (_cachedGitRoot !== null) { + return _cachedGitRoot || null; + } + try { + _cachedGitRoot = execSync('git rev-parse --show-toplevel', { + cwd: process.cwd(), + stdio: 'pipe', + encoding: 'utf8' + }).trim(); + return _cachedGitRoot; + } catch { + _cachedGitRoot = ''; + return null; + } +} + +/* โ”€โ”€ Types โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ */ + +interface RenderPagesOptions { + config: any; + srcDir: string; + fallbackSrcDir: string | null; + outputDir: string; + hooks: any; + buildHash: string; + options: any; + outputPrefix?: string; + /** docmd core version (e.g. "0.8.7"). Used for the tag. */ + coreVersion?: string; + /** Progress callback: (current, total) called after each batch completes. */ + onProgress?: (current: number, total: number) => void; + /** Optional: only render specific files (relative to srcDir). Used for incremental dev rebuilds. */ + targetFiles?: string[]; +} + +export async function renderPages({ config, srcDir, fallbackSrcDir, outputDir, hooks, buildHash, options, outputPrefix = '', coreVersion, onProgress, targetFiles }: RenderPagesOptions) { + // Reset git root cache (cwd may have changed between workspace builds) + _cachedGitRoot = null; + + // Load Translations for the active locale + const localeId = config._activeLocale?.id || null; + const pluginTranslations = hooks.translations + ? await hooks.translations.reduce(async (accP: any, fn: any) => ({ ...(await accP), ...(await fn(localeId)) }), {}) + : {}; + + // Merge: system translations โ†’ plugin translations โ†’ user-provided locale translations + const userLocaleTranslations = config._activeLocale?.translations || {}; + const strings = ui.loadTranslations(localeId, { ...pluginTranslations, ...userLocaleTranslations }); + const t = ui.createT(strings); + + // Resolve locale-specific navigation.json + // Each locale dir has its own navigation.json; fall back to default locale's navigation + if (config.i18n && config._activeLocale) { + const localeNavPath = path.join(srcDir, 'navigation.json'); + try { + if (nativeFs.existsSync(localeNavPath)) { + const rawNav = await nativeFs.promises.readFile(localeNavPath, 'utf8'); + const parsedNav = JSON.parse(rawNav); + normalizeNavPaths(parsedNav); + config = { ...config, navigation: parsedNav }; + } else if (fallbackSrcDir) { + // Fall back to default locale's navigation.json + const fallbackNavPath = path.join(fallbackSrcDir, 'navigation.json'); + if (nativeFs.existsSync(fallbackNavPath)) { + const rawNav = await nativeFs.promises.readFile(fallbackNavPath, 'utf8'); + const parsedNav = JSON.parse(rawNav); + normalizeNavPaths(parsedNav); + config = { ...config, navigation: parsedNav }; + } + } + } catch { + TUI.warn(`Failed to parse locale navigation: ${localeNavPath}`); + } + } + + // Pass UI strings to the markdown processor (for locale-aware aria-labels etc.) + const configWithStrings = { ...config, _uiStrings: strings }; + const mdProcessor = parser.createMarkdownProcessor(configWithStrings, (md: any) => hooks.markdownSetup.forEach((hook: any) => hook(md))); + + // Load Layout Templates + const templates = { + layout: await nativeFs.promises.readFile(ui.getTemplatePath('layout'), 'utf8'), + noStyle: await nativeFs.promises.readFile(ui.getTemplatePath('no-style'), 'utf8'), + navigation: await nativeFs.promises.readFile(ui.getTemplatePath('navigation'), 'utf8'), + 'docmd-search': await nativeFs.promises.readFile(ui.getTemplatePath('docmd-search'), 'utf8'), + }; + + // Load Partials + const themeInitPath = path.join(ui.getTemplatesDir(), 'partials', 'theme-init.js'); + const themeInitScript = (await fs.exists(themeInitPath)) + ? `` + : ''; + + // Footer Processing + const footerHtml = config.footer?.content ? mdProcessor.renderInline(config.footer.content) : ''; + + // --- 1. Identify Assets (Plugin + Template Injection) --- + // Each entry is `{ priority, gen }` so we can sort by load order: + // 0 = base (docmd-main.css) + // 5 = theme colour overlay (docmd-theme-sky.css etc.) + // 10 = template structure (NEW in 0.8.7) + // 15 = user customCss (always wins) + // 20 = other plugins + // Within the same priority, the order of registration is preserved. + // + // Assets fall into two buckets per position: + // - `commonXxx` โ€” emitted on EVERY page (legacy behaviour) + // - `condXxx` โ€” gated by an AssetCondition; evaluated per page + type AssetEntry = { priority: number; gen: (rel: string) => string; condition?: any }; + const assetTags: { head: AssetEntry[]; body: AssetEntry[] } = { + head: [], + body: [], + }; + + // Theme CSS (priority 5 โ€” overrides base, overridden by template & customCss) + // Skipped when: + // - name is 'default' (no overlay) or 'none' (explicitly disabled) + // - name was promoted to a template name (see config-schema ยง4.0) + // - the template opted out of CSS overlay via _noCssOverlay + const themeName = config.theme.name; + const themeIsTemplate = config.theme._noCssOverlay === true; + if (themeName && themeName !== 'default' && themeName !== 'none' && !themeIsTemplate) { + assetTags.head.push({ + priority: 5, + gen: (rel: string) => generateAssetTag(`${rel}assets/css/docmd-theme-${themeName}.css?v=${buildHash}`, 'css'), + }); + } + // Lightbox (priority 20 โ€” always last, no theme/template should override it) + assetTags.body.push({ + priority: 20, + gen: (rel: string) => generateAssetTag(`${rel}assets/js/docmd-image-lightbox.js?v=${buildHash}`, 'js'), + }); + + // Template assets (priority 10 by default โ€” overrides theme, overridden by customCss) + if (hooks.templateAssets && Array.isArray(hooks.templateAssets)) { + for (const asset of hooks.templateAssets) { + if (!asset || !asset.path || (asset.type !== 'css' && asset.type !== 'js')) continue; + const baseName = path.basename(asset.path); + const position = (asset.position || (asset.type === 'css' ? 'head' : 'body')) as 'head' | 'body'; + const priority = typeof asset.priority === 'number' ? asset.priority : 10; + const bucket = position === 'head' ? assetTags.head : assetTags.body; + // The URL is computed per-page (relativePathToRoot varies by depth). + bucket.push({ + priority, + gen: (rel: string) => generateAssetTag(`${rel}assets/template/${baseName}?v=${buildHash}`, asset.type), + }); + } + } + + // Plugin Assets + if (hooks.assets) { + for (const getAssetsFn of hooks.assets) { + // hooks.assets entries are async wrappers; missing the await here + // would make `assets` a Promise and silently skip the whole tag + // generation loop (Array.isArray(Promise) === false). The + // user-visible symptom is "plugin tag) because no regex can + // reliably distinguish a trusted analytics script from a malicious one. + const fullHeadHtml = [ + headInjections.join('\n'), + assetHeadHtml, + generateHreflangTags(config, page.outputPath) + ].join('\n'); + + const fullBodyHtml = [ + assetBodyHtml, + bodyInjections.join('\n') + ].join('\n'); + + // Source file path relative to srcDir + const sourceRelative = path.relative(process.cwd(), page.sourcePath).replace(/\\/g, '/'); + + // Compute edit URL from git plugin config (preferred) or legacy config.editLink + let editUrl = null; + const editLinkText = config.plugins?.git?.editLinkText || config.editLink?.text || t('editThisPage'); + const gitPluginConfig = config.plugins?.git; + + if (gitPluginConfig?.repo && gitPluginConfig?.editLink !== false) { + // Git plugin config (modern approach) + const gitRoot = getGitRoot(); + const editRelative = gitRoot + ? path.relative(gitRoot, page.sourcePath).replace(/\\/g, '/') + : sourceRelative; + const repo = gitPluginConfig.repo.replace(/\/$/, ''); + const branch = gitPluginConfig.branch || 'main'; + const editPath = gitPluginConfig.editPath || 'edit'; + editUrl = `${repo}/${editPath}/${branch}/${editRelative}`; + } else if (config.editLink?.enabled && config.editLink?.baseUrl) { + // Legacy fallback + const cleanBase = config.editLink.baseUrl.replace(/\/$/, ''); + const gitRoot = getGitRoot(); + const editRelative = gitRoot + ? path.relative(gitRoot, page.sourcePath).replace(/\\/g, '/') + : path.relative(path.resolve(process.cwd(), config.src || '.'), page.sourcePath).replace(/\\/g, '/'); + editUrl = `${cleanBase}/${editRelative}`; + } + + // Navigation HTML + const navigationHtml = await parser.renderTemplateAsync(templates.navigation, { + config, + navItems: config.navigation, + currentPagePath: navPath, + relativePathToRoot, + outputPrefix, + isOfflineMode: options.offline, + buildRelativeUrl, + t + }, { filename: ui.getTemplatePath('navigation') }); + + // Render Full Page + // Template selection (new in 0.8.7): resolveTemplate() honours + // frontmatter.template > config.templates[glob] > config.theme.template > default + // and falls back to the default layout if the resolved file is missing. + // noStyle pages (no chrome) continue to use templates.noStyle as before. + let templateString = templates.layout; + let resolvedTemplateInfo: any = null; + if (page.frontmatter.noStyle) { + templateString = templates.noStyle; + } else { + try { + const resolved = ui.resolveTemplate({ + type: 'layout', + pagePath: page.outputPath, + frontmatter: page.frontmatter, + config, + localeId: config._activeLocale?.id, + versionId: config._activeVersion?.id, + }); + if (resolved && resolved.templatePath) { + templateString = await nativeFs.promises.readFile(resolved.templatePath, 'utf8'); + resolvedTemplateInfo = resolved; + } + } catch (e: any) { + TUI.warn(`Template resolver failed for "${page.outputPath}" โ€” falling back to default. ${e.message}`); + } + } + let fullHtml = await parser.renderTemplateAsync(templateString, { + content: page.htmlContent, + rawMarkdown: page.rawMarkdown || '', + frontmatter: page.frontmatter, + headings: page.headings, + config, + buildHash, + coreVersion: coreVersion || CORE_VERSION, + siteTitle: config.title, + pageTitle: page.frontmatter.title, + description: page.frontmatter.description || '', + appearance: config.theme?.appearance || config.theme?.defaultMode || 'system', + defaultMode: config.theme?.appearance || config.theme?.defaultMode || 'system', + relativePathToRoot, + isOfflineMode: options.offline, + buildRelativeUrl, + navigationHtml, + prevPage: fixNeighbor(prevPage), + nextPage: fixNeighbor(nextPage), + logo: config.logo, + theme: config.theme, + + headerConfig: config.header, + sidebarConfig: config.sidebar, + footerConfig: config.footer, + menubarConfig: config.menubar, + optionsMenu: config.optionsMenu, + + customCssFiles: config.theme.customCss || [], + customJsFiles: config.customJs || [], + + pluginHeadScriptsHtml: fullHeadHtml, + pluginBodyScriptsHtml: fullBodyHtml, + + faviconLinkHtml: config.favicon ? `` : '', + themeInitScript, + footerHtml, + isActivePage: page.htmlContent && page.htmlContent.trim().length > 0, + editUrl, + editLinkText, + breadcrumbs, + sourceFile: sourceRelative, + activeLocale: config._activeLocale || null, + allLocales: config._allLocales || null, + builtLocales: config._builtLocales ? [...config._builtLocales] : null, + defaultLocale: config._defaultLocale || null, + i18nInPlace: config.i18n?.inPlace || false, + i18nStringMode: config.i18n?.stringMode || false, + localePrefix: config._localeOutputPrefix || '', + currentPagePath: navPath, + outputPrefix, + siteRootAbs: (() => { + let root = '/'; + if (config._activePrefix && config._activePrefix !== '/') { + root = config._activePrefix; + } else if (config.base && config.base !== '/') { + root = config.base; + } + if (root !== '/' && !root.endsWith('/')) root += '/'; + return root; + })(), + t, + buildAbsoluteUrl, + sanitizeUrl, + workspace: config._workspace, + themeCssLinkHtml: '', + metaTagsHtml: '', + pluginStylesHtml: '', + // New in 0.8.7: resolved template metadata, available to the + // template if it needs to know which template handled this page. + _template: resolvedTemplateInfo, + }, { filename: ui.getTemplatePath('layout') }); + + const pageObj = { + html: fullHtml, + frontmatter: page.frontmatter, + outputPath: page.outputPath, + sourcePath: page.sourcePath, + urls: pageUrls, + urlContext, + config + }; + + for (const fn of hooks.onPageReady) { + await fn(pageObj); + } + + fullHtml = pageObj.html; + + // Queue the write + writeQueue.push({ finalPath, html: fullHtml }); + (page as any).urls = pageUrls; + })); + } + + // --- 4. Parallel file writes โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ + // Write all rendered HTML files in batches for maximum I/O throughput + for (let i = 0; i < writeQueue.length; i += WRITE_BATCH_SIZE) { + const writeBatch = writeQueue.slice(i, i + WRITE_BATCH_SIZE); + await Promise.all( + writeBatch.map(async ({ finalPath, html }) => { + await fs.ensureDir(path.dirname(finalPath)); + await nativeFs.promises.writeFile(finalPath, html); + }) + ); + } + + return pages; +} \ No newline at end of file diff --git a/packages/core/src/engine/i18n.ts b/packages/core/src/engine/i18n.ts new file mode 100644 index 0000000..1c58095 --- /dev/null +++ b/packages/core/src/engine/i18n.ts @@ -0,0 +1,456 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/core (and ecosystem) + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + */ + +import path from 'path'; +import { TUI } from '@docmd/tui'; +import nativeFs from 'fs'; +import { fsUtils as fs } from '@docmd/utils'; +import { renderPages } from './generator.js'; +import { buildVersions, filterGhostVersions } from './versioning.js'; +import { sanitizeUrl } from '@docmd/parser'; +import { findFilesRecursive } from './assets.js'; + +/** + * Pre-count total pages across all locale ร— version passes. + * Fast scan (just directory walks, no file reads) so the progress bar + * knows the exact denominator from the very first page. + */ +export async function preCountPages(config: any, CWD: string, targetFiles?: string[] | null): Promise { + if (targetFiles && targetFiles.length > 0) return targetFiles.length; + const locales = getLocales(config); + const isStringMode = config.i18n?.stringMode === true; + let total = 0; + + for (const locale of locales) { + const localeId = locale ? locale.id : null; + const isDefault = localeId ? localeId === config.i18n.default : false; + if (isStringMode && localeId && !isDefault) continue; + + const localeConfig = createLocaleConfig(config, locale); + const versions = localeConfig.versions?.all?.length > 0 + ? localeConfig.versions.all + : [null]; + + for (const v of versions) { + const baseSrcDir = v + ? path.resolve(CWD, v.dir) + : path.resolve(CWD, localeConfig.src); + + const localeSrcDir = resolveLocaleSrcDir(baseSrcDir, localeConfig); + const fallbackSrcDir = resolveFallbackSrcDir(baseSrcDir, localeConfig); + + // Match the skip logic from buildVersions (line 164-169) and buildLocales (line 271-274): + // If the locale-specific dir doesn't exist, only the default locale processes. + if (!nativeFs.existsSync(localeSrcDir)) { + if (!isDefault && localeId) continue; // non-default locale: skip + // Default locale: try the base dir directly (old versions without locale dirs) + if (v && nativeFs.existsSync(baseSrcDir)) { + const files = await findFilesRecursive(baseSrcDir, ['.md', '.markdown', '.ejs']); + total += files.length; + } + continue; + } + + // Scan fallback dir when set (non-default locale uses default locale as canonical list) + const scanDir = fallbackSrcDir || localeSrcDir; + if (!nativeFs.existsSync(scanDir)) continue; + + const files = await findFilesRecursive(scanDir, ['.md', '.markdown', '.ejs']); + total += files.length; + } + } + + return total; +} + +/** + * Prepare locale context to inject into config for a build pass. + * When locale is null (i18n disabled), returns the config unchanged. + * + * Design: every locale lives in its own subdirectory inside the src dir: + * docs/en/ docs/hi/ docs/zh/ + * + * The default locale renders at root (no URL prefix), + * non-default locales render at /{locale}/. + * Fallback: if a page doesn't exist in a non-default locale dir, + * the engine falls back to the default locale's version of that page. + */ +export function createLocaleConfig(config: any, locale: any): any { + if (!locale) return config; + const isDefault = locale.id === config.i18n.default; + return { + ...config, + _activeLocale: locale, + _allLocales: config.i18n.locales, + _defaultLocale: config.i18n.default, + _localeOutputPrefix: isDefault ? '' : locale.id + '/' + }; +} + +/** + * Resolve the source directory for a given locale. + * When i18n is enabled with directory mode, each locale gets its own subdirectory: {baseSrcDir}/{localeId}/ + * When stringMode is enabled, all locales use the same root source directory. + * When i18n is disabled, returns baseSrcDir unchanged. + */ +export function resolveLocaleSrcDir(baseSrcDir: string, config: any): string { + if (!config._activeLocale) return baseSrcDir; + if (config.i18n?.stringMode) return baseSrcDir; + return path.join(baseSrcDir, config._activeLocale.id); +} + +/** + * Resolve the fallback source directory (the default locale's dir). + * Used when a non-default locale is missing a page - falls back to the default locale. + * Returns null if current locale IS the default (no fallback needed). + * Returns null in stringMode (all locales share the same source). + */ +export function resolveFallbackSrcDir(baseSrcDir: string, config: any): string | null { + if (!config._activeLocale || !config._defaultLocale) return null; + if (config.i18n?.stringMode) return null; + if (config._activeLocale.id === config._defaultLocale) return null; + return path.join(baseSrcDir, config._defaultLocale); +} + +/** + * Get the list of locales to iterate over. + * Returns [null] when i18n is disabled (single pass, no locale prefix). + */ +export function getLocales(config: any): any[] { + return config.i18n && config.i18n.locales ? config.i18n.locales : [null]; +} + +/** + * Build all locales - the outer loop of the build pipeline. + * For each locale, runs the versioning loop (or standard build) inside it. + * + * The default locale builds directly into rootOutputDir (no prefix). + * Non-default locales build into rootOutputDir/{locale}/. + */ +export async function buildLocales({ + config, + rootOutputDir, + hooks, + buildHash, + options, + CWD, + onProgress, + targetFiles, + coreVersion +}: { + config: any; + rootOutputDir: string; + hooks: any; + buildHash: string; + options: any; + CWD: string; + onProgress?: (current: number, total: number) => void; + targetFiles?: string[]; + coreVersion?: string; +}): Promise { + const allGeneratedPages = []; + + // Filter ghost versions once before any locale pass + await filterGhostVersions(config, CWD, options.isDev); + + const locales = getLocales(config); + const isStringMode = config.i18n?.stringMode === true; + + // Pre-scan which locale directories actually exist so the language switcher + // can disable unavailable locales during rendering (before pages are built). + // The default locale is always "available" since it renders at root. + if (config.i18n && config.i18n.locales) { + const baseSrcDir = path.resolve(CWD, config.src); + const availableLocaleIds = new Set(); + + for (const loc of config.i18n.locales) { + if (loc.id === config.i18n.default) { + availableLocaleIds.add(loc.id); + continue; + } + if (isStringMode) { + // stringMode: all locales are available (they clone the default) + availableLocaleIds.add(loc.id); + continue; + } + + // Check for locale directory - handle both versioned and non-versioned structures + // Non-versioned: baseSrcDir/{localeId}/ + // Versioned: baseSrcDir/{versionDir}/{localeId}/ + const locDir = path.join(baseSrcDir, loc.id); + if (nativeFs.existsSync(locDir)) { + availableLocaleIds.add(loc.id); + continue; + } + + // Check versioned structure: look in the current version's directory + if (config.versions?.all?.length > 0) { + const currentVersion = config.versions.all.find((v: any) => v.id === config.versions.current); + if (currentVersion) { + const versionedLocDir = path.join(baseSrcDir, currentVersion.dir, loc.id); + if (nativeFs.existsSync(versionedLocDir)) { + availableLocaleIds.add(loc.id); + } + } + } + } + config._builtLocales = availableLocaleIds; + } + + // In stringMode, build the default locale first (or single pass), + // then clone its output with server-side string replacements for other locales. + let defaultPassPages: any[] | null = null; + + for (const locale of locales) { + const localeId = locale ? locale.id : null; + const isDefault = localeId ? localeId === config.i18n.default : false; + const localeConfig = createLocaleConfig(config, locale); + + // We pass the rootOutputDir so that path.rel() accurately maps back to root. + // The nesting is handled purely by the string pathPrefix. + const pathPrefix = (localeId && !isDefault) ? localeId + '/' : ''; + + if (isStringMode && localeId && !isDefault) { + // stringMode: clone default locale output with string replacements + if (!defaultPassPages) { + TUI.warn(`stringMode: no default locale pages to clone for ${localeId}. Skipping...`); + continue; + } + + const assetsDir = config.assets || 'assets'; + const strings = await loadStringModeTranslations(CWD, assetsDir, localeId); + const localeDir = locale?.dir || 'ltr'; + + if (Object.keys(strings).length === 0) { + TUI.warn(`No string translations found for ${localeId} (assets/i18n/${localeId}.json). Rendering default language.`); + } + + for (const page of defaultPassPages) { + // Re-read the rendered default HTML and apply string replacements + const defaultOutputPath = path.join(rootOutputDir, page.outputPath); + if (!nativeFs.existsSync(defaultOutputPath)) continue; + + const defaultHtml = await nativeFs.promises.readFile(defaultOutputPath, 'utf8'); + const translatedHtml = applyStringModeReplacements(defaultHtml, strings, localeId, localeDir); + + // Write to the locale-prefixed output path + const localeOutputPath = path.join(rootOutputDir, pathPrefix, page.outputPath); + await fs.ensureDir(path.dirname(localeOutputPath)); + await nativeFs.promises.writeFile(localeOutputPath, translatedHtml); + + allGeneratedPages.push({ ...page, outputPath: pathPrefix + page.outputPath }); + } + continue; + } + + if (localeConfig.versions?.all?.length > 0) { + // Versioned build within this locale + const pages = await buildVersions({ + config: localeConfig, + outputDir: rootOutputDir, + hooks, + buildHash, + options, + CWD, + pathPrefix, + onProgress, + targetFiles, + coreVersion + }); + allGeneratedPages.push(...pages); + if (isStringMode && isDefault) defaultPassPages = pages; + + } else { + // Standard build (no versioning) within this locale + const baseSrcDir = path.resolve(CWD, localeConfig.src); + const localeSrcDir = resolveLocaleSrcDir(baseSrcDir, localeConfig); + const fallbackSrcDir = resolveFallbackSrcDir(baseSrcDir, localeConfig); + + // The locale dir must exist (or fall back to base when no i18n) + if (!await fs.exists(localeSrcDir)) { + if (localeConfig._activeLocale && !isStringMode) { + TUI.warn(`Locale directory missing: ${localeSrcDir}. Skipping ${localeConfig._activeLocale.id}...`); + continue; + } else if (!localeConfig._activeLocale) { + throw new Error(`Source directory not found: ${localeSrcDir}`); + } + } + + const pages = await renderPages({ + config: localeConfig, + srcDir: localeSrcDir, + fallbackSrcDir, + outputDir: rootOutputDir, + hooks, + buildHash, + options, + outputPrefix: pathPrefix, + onProgress, + targetFiles, + coreVersion + }); + allGeneratedPages.push(...pages); + if (isStringMode && (isDefault || !localeId)) defaultPassPages = pages; + } + } + + return allGeneratedPages; +} + +/** + * Generate the root redirect page for i18n sites. + * + * Since the default locale now renders at root, the redirect is only needed + * if the user's browser locale matches a non-default locale. The redirect + * page is written as a lightweight JS snippet that checks localStorage โ†’ + * navigator.language; if it matches a non-default locale, it redirects. + * Otherwise, the root content (default locale) is already there. + * + * Note: This is now a no-op because the default locale is at root. + * Users browsing to / get the default locale directly. The language + * switcher handles navigation to non-default locales. + */ +export async function generateLocaleRedirect(config: any, _rootOutputDir: string): Promise { + // Default locale is at root - no redirect needed. + // The language switcher provides navigation to /hi/, /zh/, etc. + if (!config.i18n?.locales) return; + return; +} + +/** + * Generate hreflang link tags for a page across all locales. + * Used by the generator to inject into . + * + * Default locale pages are at root (no prefix). + * Non-default locale pages are at /{locale}/path. + */ +export function generateHreflangTags(config: any, pageOutputPath: string): string { + if (!config._allLocales) return ''; + + const base = config.base && config.base !== '/' ? config.base.replace(/\/$/, '') : ''; + let pagePath = pageOutputPath.replace(/index\.html$/, '').replace(/\\/g, '/'); + + // Strip the current locale prefix from pagePath if present. + // pageOutputPath may be "hi/guide/index.html" - we need just "guide/". + const defaultLocale = config._defaultLocale; + for (const loc of config._allLocales) { + if (loc.id !== defaultLocale && pagePath.startsWith(loc.id + '/')) { + pagePath = pagePath.slice(loc.id.length + 1); + break; + } + } + + return config._allLocales.map((loc: any) => { + const isDefault = loc.id === config._defaultLocale; + // Default locale โ†’ root path, non-default โ†’ /{locale}/path + // Use sanitizeUrl to ensure no double slashes + const href = sanitizeUrl(isDefault + ? `${base}/${pagePath}` + : `${base}/${loc.id}/${pagePath}`); + let tags = ``; + if (isDefault) { + tags += `\n`; + } + return tags; + }).join('\n'); +} + +/** + * Load string-mode translations from assets/i18n/{localeId}.json. + * Returns an empty object if the file doesn't exist (graceful fallback). + */ +export async function loadStringModeTranslations( + CWD: string, + assetsDir: string, + localeId: string +): Promise> { + const filePath = path.join(CWD, assetsDir, 'i18n', `${localeId}.json`); + try { + if (nativeFs.existsSync(filePath)) { + const raw = await nativeFs.promises.readFile(filePath, 'utf8'); + return JSON.parse(raw); + } + } catch (e: any) { + TUI.warn(`Failed to load string-mode translations: ${filePath} - ${e.message}`); + } + return {}; +} + +/** + * Apply server-side string replacement on rendered HTML. + * Resolves data-i18n, data-i18n-html, and data-i18n-{attr} attributes + * using the provided translations object. + * + * This is the build-time equivalent of docmd-i18n-strings.js - it produces + * fully translated HTML that search engines can index. + */ +export function applyStringModeReplacements(html: string, strings: Record, localeId: string, localeDir?: string): string { + if (!strings || Object.keys(strings).length === 0) return html; + + // 1. data-i18n="key" โ†’ replace textContent + // Match: content + html = html.replace( + /(<[^>]+\sdata-i18n="([^"]+)"[^>]*>)([\s\S]*?)(<\/[a-zA-Z][a-zA-Z0-9]*>)/g, + (match, openTag, key, _content, closeTag) => { + if (strings[key] !== undefined) { + return openTag + strings[key] + closeTag; + } + return match; + } + ); + + // 2. data-i18n-html="key" โ†’ replace innerHTML + html = html.replace( + /(<[^>]+\sdata-i18n-html="([^"]+)"[^>]*>)([\s\S]*?)(<\/[a-zA-Z][a-zA-Z0-9]*>)/g, + (match, openTag, key, _content, closeTag) => { + if (strings[key] !== undefined) { + return openTag + strings[key] + closeTag; + } + return match; + } + ); + + // 3. data-i18n-{attr}="key" โ†’ replace the target attribute value + // e.g. data-i18n-placeholder="search.placeholder" placeholder="Search..." + html = html.replace( + /(<[^>]+)\sdata-i18n-(?!html)([a-zA-Z][\w-]*)="([^"]+)"([^>]*>)/g, + (match, before, targetAttr, key, after) => { + if (strings[key] !== undefined) { + // Replace the target attribute's value + const attrRegex = new RegExp(`(${targetAttr})="[^"]*"`); + const fullTag = before + ' data-i18n-' + targetAttr + '="' + key + '"' + after; + if (attrRegex.test(fullTag)) { + return fullTag.replace(attrRegex, `$1="${strings[key]}"`); + } + } + return match; + } + ); + + // 4. Update to the target locale + html = html.replace(/ { + const newItem = { ...item }; + + if (newItem.children) { + newItem.children = filterNavForVersion(newItem.children, vSrcDir, fallbackSrcDir); + } + + if (newItem.path && !newItem.path.startsWith('http') && !newItem.external) { + let relativeFilePath = newItem.path.replace(/^\//, ''); + // Reverse clean-URL normalisation to find the source file + if (relativeFilePath.endsWith('/') || relativeFilePath === '') { + // Trailing slash (or root) โ†’ could be folder/index.md or folder/README.md or file.md + const dir = relativeFilePath.replace(/\/$/, ''); + const fileCandidate = dir ? dir + '.md' : ''; + const indexCandidates = dir + ? [dir + '/index.md', dir + '/README.md', dir + '/readme.md', fileCandidate] + : ['index.md', 'README.md', 'readme.md']; + + const found = indexCandidates.find(c => { + if (!c) return false; + const abs = path.join(vSrcDir, c); + if (nodeFs.existsSync(abs)) return true; + if (fallbackSrcDir && nodeFs.existsSync(path.join(fallbackSrcDir, c))) return true; + return false; + }); + relativeFilePath = found || (dir ? dir + '/index.md' : 'index.md'); + } else if (!relativeFilePath.endsWith('.md')) { + relativeFilePath += '.md'; + } + + const absoluteFilePath = path.join(vSrcDir, relativeFilePath); + try { + if (!nodeFs.existsSync(absoluteFilePath)) { + // If a fallback dir exists, check there too before removing + if (fallbackSrcDir) { + const fallbackFilePath = path.join(fallbackSrcDir, relativeFilePath); + try { + if (!nodeFs.existsSync(fallbackFilePath)) return acc; + } catch { return acc; } + } else { + return acc; + } + } + } catch { return acc; } + } + + acc.push(newItem); + return acc; + }, []); +} + +/** + * Resolve the active navigation for a version - checks for navigation.json (Nav V2), + * then per-version config override, then falls back to the global config navigation. + */ +export function resolveVersionNav(v: any, vSrcDir: string, configNavigation: any): any { + let activeNav = configNavigation; + + try { + const navJsonPath = path.join(vSrcDir, 'navigation.json'); + if (nodeFs.existsSync(navJsonPath)) { + const rawNav = nodeFs.readFileSync(navJsonPath, 'utf-8'); + activeNav = JSON.parse(rawNav); + } else if (v.navigation) { + activeNav = v.navigation; + } + } catch (err) { + TUI.warn(`Failed to parse navigation.json in ${vSrcDir}: ${err.message}`); + activeNav = v.navigation || configNavigation; + } + + // Clone activeNav before mutating to avoid modifying global config + activeNav = JSON.parse(JSON.stringify(activeNav)); + normalizeNavPaths(activeNav); + + return activeNav; +} + +/** + * Build all versions for a given base config and output directory. + * Returns pages array with output paths prefixed for non-current versions. + */ +export async function buildVersions({ + config, + outputDir, + hooks, + buildHash, + options, + CWD, + pathPrefix = '', + onProgress, + targetFiles, + coreVersion +}: { + config: any; + outputDir: string; + hooks: any; + buildHash: string; + options: any; + CWD: string; + pathPrefix?: string; + onProgress?: (current: number, total: number) => void; + targetFiles?: string[]; + coreVersion?: string; +}): Promise { + const allPages = []; + + // Pre-scan: determine which versions have i18n support for the current locale + const versionI18nMap: Record = {}; + for (const v of config.versions.all) { + const baseSrcDir = path.resolve(CWD, v.dir); + const localeSrcDir = resolveLocaleSrcDir(baseSrcDir, config); + versionI18nMap[v.id] = await fs.exists(localeSrcDir); + } + config._versionI18nMap = versionI18nMap; + + for (const v of config.versions.all) { + const isCurrent = v.id === config.versions.current; + const baseSrcDir = path.resolve(CWD, v.dir); + + // When i18n is enabled, resolve to the locale-specific subdirectory + // e.g., docs/ โ†’ docs/en/ for English locale + // Graceful fallback: if the locale subdir doesn't exist but the base dir does, + // use the base dir directly (supports old versions without locale dirs) + let vSrcDir = resolveLocaleSrcDir(baseSrcDir, config); + let fallbackSrcDir = resolveFallbackSrcDir(baseSrcDir, config); + let versionHasI18n = true; + + if (!await fs.exists(vSrcDir) && await fs.exists(baseSrcDir)) { + // Locale subdir doesn't exist but base dir does - this version has no i18n structure + versionHasI18n = false; + if (config._activeLocale && config._activeLocale.id !== config._defaultLocale) { + // Non-default locale: skip entirely (no translations for this version) + continue; + } + // Default locale: use the base dir directly (backward compat for old versions) + vSrcDir = baseSrcDir; + fallbackSrcDir = null; + } + + if (!await fs.exists(vSrcDir)) { + if (!options.isDev) TUI.warn(`Version directory missing: ${v.dir}. Skipping ${v.id}...`); + continue; + } + + // Determine the full output prefix for this version combining locale prefix + version prefix + // Only non-current versions get a version prefix. + const versionPrefixSegment = isCurrent ? '' : v.id + '/'; + const combinedOutputPrefix = pathPrefix + versionPrefixSegment; + + const activeNav = resolveVersionNav(v, vSrcDir, config.navigation); + const cleanedNav = filterNavForVersion(activeNav, vSrcDir, fallbackSrcDir); + + const versionedConfig = { + ...config, + _activeVersion: v, + _versionHasI18n: versionHasI18n, + navigation: cleanedNav + }; + + const pages = await renderPages({ + config: versionedConfig, + srcDir: vSrcDir, + fallbackSrcDir, + outputDir, // We always pass root outputDir so relativePathToRoot computes perfectly + hooks, + buildHash, + options, + outputPrefix: combinedOutputPrefix, + onProgress, + targetFiles, + coreVersion + }); + + allPages.push(...pages); + } + + return allPages; +} \ No newline at end of file diff --git a/packages/core/src/engine/worker-parser.ts b/packages/core/src/engine/worker-parser.ts new file mode 100644 index 0000000..12302c8 --- /dev/null +++ b/packages/core/src/engine/worker-parser.ts @@ -0,0 +1,170 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/core + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * -------------------------------------------------------------------- + */ + +/** + * Worker-thread parser + * ==================== + * + * Each docmd worker thread runs an independent copy of this module โ€” + * Node.js `worker_threads` load modules per worker, so `mdProcessor`, + * `hooks`, and `config` below are PER-WORKER state, not shared across + * threads. Phase 2 (F1โ€“F5) requires that two workers given the same + * input produce byte-identical HTML; the determinism contract is + * enforced by: + * + * 1. `mdProcessor` is instantiated inside `init()` on this worker, + * never imported from the main thread. + * 2. `hooks` are loaded on this worker via `loadPlugins(config, ...)`. + * No plugin module is cached across workers. + * 3. `config` is the structured-clone snapshot from `workerData` โ€” + * no live reference to the main-thread config object. + * 4. The container normaliser (`@docmd/parser/utils/container-normaliser`) + * is a pure function of its input โ€” no `Date.now()`, no + * `Math.random()`, no module-level mutable state. The determinism + * test fixture at `packages/parser/test/container-normaliser.test.js` + * verifies this empirically (100-way concurrency + cross-worker). + * 5. `verifyDeterminismAtBoot()` runs a known input through the + * freshly-built processor at the end of `init()` and asserts the + * output matches the snapshot. Any future regression that breaks + * determinism crashes the worker before the first message is + * processed. + * + * If you add any module-level mutable state to this file or to the + * parser pipeline, the boot-time self-test will fail and the worker + * will refuse to start. That is the structural fence. + */ + +import { parentPort, workerData } from 'node:worker_threads'; +import { loadPlugins } from '@docmd/api'; +import { createMarkdownProcessor, processContentAsync } from '@docmd/parser'; +import * as ui from '@docmd/ui'; + +// โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ +// Per-worker state โ€” `let` is intentional; these are populated by +// `init()` and frozen-equivalent after that point. +// โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ +let mdProcessor: any; +let hooks: any; +let config: any; + +/** + * Determinism snapshot. Two workers given the same input MUST produce + * the same HTML. We assert this at boot by parsing a known input and + * comparing the output to this frozen string. Any future code change + * that introduces non-determinism (Date.now, Math.random, shared + * module-level state, etc.) crashes the worker before it processes + * its first real message. + * + * The snapshot is intentionally a small, isolated example โ€” a balanced + * callout with a self-closing tag โ€” that exercises the normaliser + * (no warnings expected), the depth tracker, the renderer pipeline, + * and the heading ID plugin. + */ +const DETERMINISM_SNAPSHOT_INPUT = '# Hi\n\n::: callout info "T"\nbody\n:::\n'; +const DETERMINISM_SNAPSHOT_OUTPUT = '

Hi

\n
T
\n

body

\n
\n'; + +async function init() { + config = workerData.config; + const cwd = workerData.cwd; + + // 1. Re-hydrate hooks by loading plugins within the worker boundary. + hooks = await loadPlugins(config, { resolvePaths: [cwd] }); + + // 2. Re-hydrate UI strings for the markdown processor (for heading anchors, etc.) + const localeId = config._activeLocale?.id || null; + const pluginTranslations = hooks.translations + ? await hooks.translations.reduce(async (accP: any, fn: any) => ({ ...(await accP), ...(await fn(localeId)) }), {}) + : {}; + const userLocaleTranslations = config._activeLocale?.translations || {}; + const strings = ui.loadTranslations(localeId, { ...pluginTranslations, ...userLocaleTranslations }); + const configWithStrings = { ...config, _uiStrings: strings }; + + // 3. Instantiate the exact same Markdown-It pipeline as the main thread + mdProcessor = createMarkdownProcessor(configWithStrings, (md: any) => { + hooks.markdownSetup.forEach((hook: any) => hook(md)); + }); + + // 4. Boot-time determinism self-test. Crashes the worker if the + // parser output diverges from the snapshot, which means the + // parser is no longer deterministic and parallel workers may + // produce different HTML for the same input. + await verifyDeterminismAtBoot(); +} + +/** + * Boot-time determinism check. Parses `DETERMINISM_SNAPSHOT_INPUT` + * through the freshly-built processor and asserts the output equals + * `DETERMINISM_SNAPSHOT_OUTPUT`. If it doesn't, this is a regression + * โ€” the worker crashes with a clear error message before processing + * any real message. + */ +async function verifyDeterminismAtBoot(): Promise { + const result = await processContentAsync( + DETERMINISM_SNAPSHOT_INPUT, + mdProcessor, + config, + { filePath: '' }, + hooks + ); + if (result.htmlContent !== DETERMINISM_SNAPSHOT_OUTPUT) { + throw new Error( + '[docmd] Parser determinism regression detected at worker boot.\n' + + ' Expected:\n' + JSON.stringify(DETERMINISM_SNAPSHOT_OUTPUT) + '\n' + + ' Actual:\n' + JSON.stringify(result.htmlContent) + '\n' + + ' This means two worker threads given the same input may now\n' + + ' produce different HTML โ€” the parser pipeline is no longer\n' + + ' deterministic. Audit `packages/parser/src/` for any new\n' + + ' module-level mutable state, Date.now, Math.random, or\n' + + ' non-pure helpers.' + ); + } +} + +// Start initialization immediately upon worker thread spawn +const initPromise = init(); + +parentPort?.on('message', async (task) => { + try { + // Ensure the worker is fully initialized before processing any task + await initPromise; + + // Support generic tasks for plugins leveraging the WorkerPool + if (task.payload && task.payload.type === 'plugin-task') { + const { modulePath, functionName, args } = task.payload; + const mod = await import(modulePath); + const result = await mod[functionName](...args); + parentPort?.postMessage({ + taskId: task.id, + success: true, + data: result + }); + return; + } + + const { rawContent, env } = task.payload; + + // Process the content (includes frontmatter extraction, hooks execution, and HTML rendering) + const processed = await processContentAsync(rawContent, mdProcessor, config, env, hooks); + + parentPort?.postMessage({ + taskId: task.id, + success: true, + data: processed + }); + } catch (error: any) { + parentPort?.postMessage({ + taskId: task.id, + success: false, + error: error.message || String(error) + }); + } +}); \ No newline at end of file diff --git a/packages/core/src/engine/workspace.ts b/packages/core/src/engine/workspace.ts new file mode 100644 index 0000000..ccb387e --- /dev/null +++ b/packages/core/src/engine/workspace.ts @@ -0,0 +1,768 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/core (and ecosystem) + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + */ + +/** + * Workspace Handler. + * + * Enables a single docmd instance to build multiple independent + * documentation projects under one domain. + * + * Root config: + * workspace: { + * projects: [ + * { prefix: '/', src: 'docmd-main' }, + * { prefix: '/search', src: 'docmd-search' } + * ] + * } + * + * Each project folder has its own docmd.config.json with its own + * title, versions, i18n, plugins, navigation, etc. + * + * Output merges into a single site/ directory: + * site/ โ† root project + * site/search/ โ† prefixed project + * + * Assets: + * - Root-level assets/ are shared across all projects + * - Each project can have its own assets/ that override shared ones + */ + +import path from 'path'; +import { fsUtils as fs, FileSignatureTracker } from '@docmd/utils'; +import nativeFs from 'fs'; +import { TUI } from '@docmd/tui'; +import { loadConfig } from '../utils/config-loader.js'; +import { buildSite } from '../commands/build.js'; +import { createOriginVerify } from '../utils/ws-origin-guard.js'; + +/* โ”€โ”€ Types โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ */ + +export interface ProjectEntry { + /** URL prefix. '/' for root, '/search' for subpath. */ + prefix: string; + /** Source directory relative to CWD (contains the project's docmd.config.js). */ + src: string; + /** Optional: Display title for the project switcher. */ + title?: string; +} + +export interface WorkspaceConfig { + /** The list of projects in the workspace. */ + projects: ProjectEntry[]; + /** Project switcher configuration. */ + switcher?: { + enabled?: boolean; + position?: 'sidebar-top' | 'sidebar-bottom' | 'options-menu'; + }; +} + +export interface WorkspaceRootConfig { + /** The workspace configuration. */ + workspace?: WorkspaceConfig; + /** Legacy projects array (deprecated, maps to workspace.projects). */ + projects?: ProjectEntry[]; + /** Shared output directory. Default: 'site' */ + out?: string; + /** Internal: Absolute path to the config file itself. Used for hot-reloading. */ + _resolvedPath?: string; + /** Internal: Any other root keys act as global defaults. */ + [key: string]: any; +} + +/* โ”€โ”€ Detection โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ */ + +/** + * Check if a raw config object is a workspace config. + */ +export function isWorkspace(rawConfig: any): rawConfig is WorkspaceRootConfig { + if (!rawConfig) return false; + + // New 'workspace' schema + if (rawConfig.workspace && Array.isArray(rawConfig.workspace.projects)) { + return rawConfig.workspace.projects.every((p: any) => + typeof p.prefix === 'string' && typeof p.src === 'string' + ); + } + + // Legacy 'projects' schema (for backward compatibility) + if (Array.isArray(rawConfig.projects) && rawConfig.projects.length > 0) { + return rawConfig.projects.every((p: any) => + typeof p.prefix === 'string' && typeof p.src === 'string' + ); + } + + return false; +} + +/** + * Load the raw config file without normalization to check for workspace settings. + */ +export async function detectWorkspace(configPathOption: string): Promise { + const CWD = process.cwd(); + let absolutePath = path.resolve(CWD, configPathOption); + + if (configPathOption === 'docmd.config.js') { + const candidates = [ + 'docmd.config.json', + 'docmd.config.ts', + 'docmd.config.js', + 'docmd.config.mjs', + 'config.js' + ]; + let found = false; + for (const c of candidates) { + const p = path.resolve(CWD, c); + if (nativeFs.existsSync(p)) { + absolutePath = p; + found = true; + break; + } + } + if (!found) return null; + } else if (!nativeFs.existsSync(absolutePath)) { + return null; + } + + try { + let rawConfig: any; + + if (absolutePath.endsWith('.json')) { + rawConfig = JSON.parse(nativeFs.readFileSync(absolutePath, 'utf-8')); + } else { + // Polyfill defineConfig + (global as any).defineConfig = (config: any) => config; + + const ts = Date.now(); + const ext = path.extname(absolutePath); + const tempPath = absolutePath.replace(new RegExp(`\\${ext}$`), `-${ts}${ext}`); + nativeFs.copyFileSync(absolutePath, tempPath); + + const { pathToFileURL } = await import('url'); + const configUrl = pathToFileURL(tempPath).href; + const rawModule = await import(configUrl); + rawConfig = rawModule.default || rawModule; + + nativeFs.unlinkSync(tempPath); + delete (global as any).defineConfig; + } + + if (isWorkspace(rawConfig)) { + rawConfig._resolvedPath = absolutePath; + + // Internal normalization: map legacy 'projects' to 'workspace.projects' + if (!rawConfig.workspace && rawConfig.projects) { + rawConfig.workspace = { + projects: rawConfig.projects, + switcher: { enabled: true, position: 'sidebar-top' } + }; + } else if (rawConfig.workspace) { + // Ensure default switcher settings + rawConfig.workspace.switcher = { + enabled: true, + position: 'sidebar-top', + ...rawConfig.workspace.switcher + }; + } + + // Return workspace config only if it has workspace settings + // This prevents false positives when a config has a 'workspace' field but no projects + if (rawConfig.workspace && rawConfig.workspace.projects) { + return rawConfig as WorkspaceRootConfig; + } + + return null; + } + return null; + } catch { + delete (global as any).defineConfig; + return null; + } +} + +/* โ”€โ”€ Validation โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ */ + +function validateProjects(projects: ProjectEntry[]): void { + const prefixes = new Set(); + let hasRoot = false; + + for (const project of projects) { + // Normalize prefix + const prefix = project.prefix === '/' ? '/' : project.prefix.replace(/\/$/, ''); + + if (prefixes.has(prefix)) { + throw new Error(`Duplicate project prefix: "${prefix}"`); + } + prefixes.add(prefix); + + if (prefix === '/') hasRoot = true; + + // Verify source directory exists + const srcPath = path.resolve(process.cwd(), project.src); + if (!nativeFs.existsSync(srcPath)) { + throw new Error(`Project source directory not found: ${project.src}`); + } + } + + if (!hasRoot) { + throw new Error( + 'Workspace configuration must include a root project with prefix "/".\n' + + 'Each workspace needs one project that owns the site root, with the others mounted under their own prefixes.\n' + + 'Example:\n' + + ' {\n' + + ' "workspace": {\n' + + ' "projects": [\n' + + ' { "name": "main", "src": "./docs", "prefix": "/" },\n' + + ' { "name": "api", "src": "./api-docs", "prefix": "/api/" }\n' + + ' ]\n' + + ' }\n' + + ' }\n' + + 'See https://docs.docmd.io/configuration/workspaces/ for the full layout guide.' + ); + } + + // Check for potential conflicts + const rootProject = projects.find(p => p.prefix === '/'); + if (rootProject) { + const rootSrcPath = path.resolve(process.cwd(), rootProject.src); + for (const project of projects) { + if (project.prefix === '/') continue; + const prefixName = project.prefix.replace(/^\//, ''); + const conflictPath = path.join(rootSrcPath, prefixName); + if (nativeFs.existsSync(conflictPath)) { + TUI.warn(`Potential conflict: Root project has "${prefixName}/" folder which may conflict with project prefix "${project.prefix}".`); + TUI.warn(`Content at "${rootProject.src}/${prefixName}/" will be overwritten by project "${project.src}".`); + } + } + } +} + +/* โ”€โ”€ Build โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ */ + +/** + * Build all projects in a workspace. + */ +export async function buildWorkspace( + workspaceConfig: WorkspaceRootConfig, + opts: { isDev?: boolean; offline?: boolean; quiet?: boolean; verbose?: boolean } = {} +): Promise { + const CWD = process.cwd(); + const rootOutDir = path.resolve(CWD, workspaceConfig.out || 'site'); + const totalElapsed = TUI.timer(); + + const workspace = workspaceConfig.workspace!; + validateProjects(workspace.projects); + + // Extract global defaults + const globalDefaults: Record = {}; + const skipKeys = ['workspace', 'projects', 'out', '_resolvedPath']; + for (const key of Object.keys(workspaceConfig)) { + if (!skipKeys.includes(key) && !key.startsWith('_')) { + globalDefaults[key] = workspaceConfig[key]; + } + } + + // Sort: root project first, then alphabetical + const sorted = [...workspace.projects].sort((a, b) => { + if (a.prefix === '/') return -1; + if (b.prefix === '/') return 1; + return a.prefix.localeCompare(b.prefix); + }); + + if (!opts.quiet) { + TUI.section(`Workspace Build (${sorted.length} projects)`); + } + + // Ensure clean output directory + await fs.ensureDir(rootOutDir); + + // Copy shared assets first + const sharedAssetsDir = path.resolve(CWD, 'assets'); + if (nativeFs.existsSync(sharedAssetsDir)) { + if (!opts.quiet) { + TUI.item('Shared assets', path.relative(CWD, sharedAssetsDir), TUI.dim, TUI.cyan); + } + } + + if (!opts.quiet) { + TUI.footer(TUI.cyan); + } + + for (const project of sorted) { + const prefix = project.prefix === '/' ? '/' : project.prefix.replace(/\/$/, ''); + const projectSrcDir = path.resolve(CWD, project.src); + + const candidates = ['docmd.config.json', 'docmd.config.ts', 'docmd.config.js', 'docmd.config.mjs', 'config.js']; + let resolvedConfigName: string | null = null; + for (const c of candidates) { + if (nativeFs.existsSync(path.join(projectSrcDir, c))) { + resolvedConfigName = c; + break; + } + } + const hasProjectConfig = resolvedConfigName !== null; + const configFileToUse = resolvedConfigName || 'docmd.config.js'; + + const projectOutDir = prefix === '/' + ? rootOutDir + : path.join(rootOutDir, prefix.replace(/^\//, '')); + + const label = prefix === '/' ? `/ (root)` : prefix; + + if (!opts.quiet) { + TUI.section(`Building Project: ${label}`); + + const originalCwdCheck = process.cwd(); + process.chdir(projectSrcDir); + try { + const childConfig = await loadConfig(configFileToUse, { isDev: opts.isDev, quiet: true }); + const childDetails = TUI.extractProjectDetails(childConfig, projectOutDir, CWD); + TUI.projectDetails({ + engine: childConfig.engine && childConfig.engine !== 'js' ? childConfig.engine : undefined, + source: `${project.src}/`, + output: `${path.relative(CWD, projectOutDir)}/`, + versions: childDetails.versions, + locales: childDetails.locales, + }); + } catch { + TUI.item('Source', `${project.src}/`, TUI.dim, TUI.cyan); + TUI.item('Output', `${path.relative(CWD, projectOutDir)}/`, TUI.dim, TUI.cyan); + } finally { + process.chdir(originalCwdCheck); + } + + if (!hasProjectConfig) { + TUI.item('Config', 'zero-config (no docmd.config.json found)', TUI.dim, TUI.cyan); + } + } + + const originalCwd = process.cwd(); + process.chdir(projectSrcDir); + + try { + process.env.DOCMD_PROJECT_OUT = projectOutDir; + process.env.DOCMD_PROJECT_PREFIX = prefix; + + if (nativeFs.existsSync(sharedAssetsDir)) { + await fs.ensureDir(path.join(projectOutDir, 'assets')); + await fs.copy(sharedAssetsDir, path.join(projectOutDir, 'assets')); + } + + await buildSite(configFileToUse, { + isDev: opts.isDev || false, + offline: opts.offline || false, + // Pass through quiet so the first build (quiet:false) shows git/search + // indexing progress. Live-reload rebuilds always arrive with quiet:true + // from buildWorkspaceProject, so they stay silent. + quiet: opts.quiet || false, + // Forward --verbose so the per-project normaliser prints every + // container issue (unclosed ::: card, stray :::, etc.). Without + // this, `docmd build --verbose` on a workspace config silently + // drops the flag and only the aggregate error count is shown. + verbose: opts.verbose || false, + _globalDefaults: globalDefaults, + _workspace: workspace, + _activePrefix: prefix + }); + + if (!opts.quiet) { + TUI.footer(TUI.cyan); + } + + } catch (err: any) { + if (!opts.quiet) { + TUI.step(`Project ${label} build failed`, 'FAIL', TUI.cyan); + TUI.footer(TUI.cyan); + } + TUI.error(`Build failed for ${label}`, err.message); + if (!opts.isDev) process.exit(1); + } finally { + process.chdir(originalCwd); + delete process.env.DOCMD_PROJECT_OUT; + delete process.env.DOCMD_PROJECT_PREFIX; + } + } + + if (!opts.quiet) { + const totalSize = await getDirectorySize(rootOutDir); + TUI.success(`Workspace build complete. ${sorted.length} projects โ†’ ${path.relative(CWD, rootOutDir)}/ (${formatBytes(totalSize)}) in ${totalElapsed()}.\n`); + } +} + +/* โ”€โ”€ Single Project Build โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ */ + +async function buildWorkspaceProject( + project: ProjectEntry, + workspaceConfig: WorkspaceRootConfig, + opts: { isDev?: boolean; offline?: boolean; quiet?: boolean; verbose?: boolean; targetFiles?: string[] } = {} +): Promise { + const CWD = process.cwd(); + const rootOutDir = path.resolve(CWD, workspaceConfig.out || 'site'); + const workspace = workspaceConfig.workspace!; + const prefix = project.prefix === '/' ? '/' : project.prefix.replace(/\/$/, ''); + const projectSrcDir = path.resolve(CWD, project.src); + + const candidates = ['docmd.config.json', 'docmd.config.ts', 'docmd.config.js', 'docmd.config.mjs', 'config.js']; + let resolvedConfigName: string | null = null; + for (const c of candidates) { + if (nativeFs.existsSync(path.join(projectSrcDir, c))) { + resolvedConfigName = c; + break; + } + } + const configFileToUse = resolvedConfigName || 'docmd.config.js'; + + const projectOutDir = prefix === '/' + ? rootOutDir + : path.join(rootOutDir, prefix.replace(/^\//, '')); + + const label = prefix === '/' ? '/ (root)' : prefix; + + const originalCwd = process.cwd(); + process.chdir(projectSrcDir); + + try { + process.env.DOCMD_PROJECT_OUT = projectOutDir; + process.env.DOCMD_PROJECT_PREFIX = prefix; + + const sharedAssetsDir = path.resolve(CWD, 'assets'); + if (nativeFs.existsSync(sharedAssetsDir)) { + await fs.ensureDir(path.join(projectOutDir, 'assets')); + await fs.copy(sharedAssetsDir, path.join(projectOutDir, 'assets')); + } + + const globalDefaults: Record = {}; + const skipKeys = ['workspace', 'projects', 'out', '_resolvedPath']; + for (const key of Object.keys(workspaceConfig)) { + if (!skipKeys.includes(key) && !key.startsWith('_')) { + globalDefaults[key] = workspaceConfig[key]; + } + } + + await buildSite(configFileToUse, { + isDev: opts.isDev || false, + offline: opts.offline || false, + quiet: true, + // Forward --verbose to the per-project build so container + // normaliser issues are listed per file in verbose mode. + verbose: opts.verbose || false, + targetFiles: opts.targetFiles, + _globalDefaults: globalDefaults, + _workspace: workspace, + _activePrefix: prefix + }); + + } catch (err: any) { + TUI.error(`Build failed for ${label}`, err.message); + throw err; + } finally { + process.chdir(originalCwd); + delete process.env.DOCMD_PROJECT_OUT; + delete process.env.DOCMD_PROJECT_PREFIX; + } +} + +/* โ”€โ”€ Dev Server Wrapper โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ */ + +/** + * Start dev server for workspace mode. + */ +export async function devWorkspace( + workspaceConfig: WorkspaceRootConfig, + opts: { port?: string; preserve?: boolean } = {} +): Promise { + try { + await buildWorkspace(workspaceConfig, { isDev: true }); + } catch (err: any) { + TUI.error('Initial build failed', err.message); + } + + const CWD = process.cwd(); + const rootOutDir = path.resolve(CWD, workspaceConfig.out || 'site'); + + const { serveStatic, findAvailablePort, formatPathForDisplay, getNetworkIp, openBrowser } = await import('../utils/dev-utils.js'); + const http = await import('http'); + const { WebSocketServer, WebSocket } = await import('ws'); + + const state = { outputDir: rootOutDir }; + const server = http.createServer((req: any, res: any) => serveStatic(req, res, state.outputDir)); + + const PORT = parseInt(opts.port || process.env.PORT || '3000', 10); + const port = await findAvailablePort(PORT); + + let wss: any; + + function broadcastReload() { + if (wss) { + wss.clients.forEach((client: any) => { + if (client.readyState === WebSocket.OPEN) client.send('reload'); + }); + } + } + + // Phase 1.D: default to loopback. Set DOCMD_HOST=0.0.0.0 to expose on LAN + // (with the verifyClient callback below still guarding the Origin header). + const BIND_HOST = process.env.DOCMD_HOST || '127.0.0.1'; + + server.listen(port, BIND_HOST, () => { + if (BIND_HOST !== '127.0.0.1' && BIND_HOST !== '::1' && BIND_HOST !== 'localhost') { + TUI.warn(`Workspace dev server bound to ${BIND_HOST} (LAN). verifyClient guards Origin.`); + } + const networkIp = getNetworkIp(); + // Phase 1.D: CWE-1385 CSWSH fix (N-S1). Even when bound to LAN, the + // verifyClient callback rejects any Origin that isn't loopback or the + // LAN IP returned by getNetworkIp(). + wss = new WebSocketServer({ + server, + verifyClient: createOriginVerify(networkIp ? [networkIp] : []), + }); + wss.on('error', (e: any) => TUI.error('WebSocket Error', e.message)); + + const localUrl = `http://127.0.0.1:${port}`; + const networkUrl = networkIp ? `http://${networkIp}:${port}` : null; + + TUI.section('Workspace Dev Server Running', TUI.green); + TUI.item('', '', TUI.dim, TUI.green); + TUI.item('Local Access', localUrl, TUI.bold, TUI.green); + if (networkUrl) { + TUI.item('Network Access', networkUrl, TUI.bold, TUI.green); + } + TUI.item('Serving from', formatPathForDisplay(rootOutDir, CWD), TUI.dim, TUI.green); + TUI.item('', '', TUI.dim, TUI.green); + + const workspace = workspaceConfig.workspace!; + for (const project of workspace.projects) { + const pfx = project.prefix === '/' ? '/' : project.prefix; + TUI.item('Project', localUrl + pfx, TUI.dim, TUI.green); + } + TUI.item('', '', TUI.dim, TUI.green); + TUI.footer(TUI.green); + + // Auto-launch localhost URL in default browser + openBrowser(localUrl); + }); + + let isRebuilding = false; + let rebuildTimeout: any = null; + let lastContentRebuildAt = 0; + let lastConfigRebuildAt = 0; + // Quiet windows after a rebuild to absorb phantom fs.watch events macOS + // emits for newly-written nearby files. The primary defence is the + // content-signature check (FileSignatureTracker) below; these are + // secondary cushions. + // - 1000ms after a content rebuild + // - 2500ms after a full workspace config rebuild (cascades everywhere) + const CONTENT_QUIET_MS = 1000; + const CONFIG_QUIET_MS = 2500; + // Tracks each watched file's mtime+size signature so phantom fs.watch + // events that don't actually mutate the file are silently ignored. + const signatureTracker = new FileSignatureTracker(); + + const workspace = workspaceConfig.workspace!; + for (const project of workspace.projects) { + const projectSrcDir = path.resolve(CWD, project.src); + + if (!nativeFs.existsSync(projectSrcDir)) continue; + + nativeFs.watch(projectSrcDir, { recursive: true }, (event, filename) => { + if (!filename) return; + + // Post-rebuild quiet period + if (Date.now() - lastContentRebuildAt < CONTENT_QUIET_MS) return; + if (Date.now() - lastConfigRebuildAt < CONFIG_QUIET_MS) return; + + if (filename.includes('.git') || filename.includes('node_modules') || + filename.includes('.DS_Store') || filename.startsWith('.') || + filename.includes('docmd.config-') || filename.endsWith('.js.bak')) return; + + // Exclude build output + const resolvedOut = path.resolve(CWD, workspaceConfig.out || 'site'); + const filePath = path.resolve(projectSrcDir, filename); + if (filePath.startsWith(resolvedOut + path.sep) || filePath === resolvedOut) return; + + // Content-signature gate: ignore phantom events that don't actually + // mutate the file (Spotlight reindex, iCloud sync, etc.). + if (!signatureTracker.hasChanged(filePath)) return; + + if (rebuildTimeout) clearTimeout(rebuildTimeout); + rebuildTimeout = setTimeout(async () => { + if (isRebuilding) return; + isRebuilding = true; + + const isConfigUpdate = (filename.includes('docmd.config') && !filename.includes('docmd.config-')) || filename.includes('navigation.json'); + const label = project.prefix === '/' ? '/' : project.prefix; + const displayPath = filename.replace(/^[^/]+\//, ''); + const rebuildElapsed = TUI.timer(); + + if (isConfigUpdate) { + TUI.step(`Reloading config and rebuilding [${label}]`, 'WAIT', TUI.blue, true); + } else { + TUI.step(`Rebuilding [${label}] ${displayPath}`, 'WAIT', TUI.blue, true); + } + + try { + const fullChangedPath = path.resolve(projectSrcDir, filename); + await buildWorkspaceProject(project, workspaceConfig, { + isDev: true, + targetFiles: isConfigUpdate ? undefined : [fullChangedPath] + }); + if (isConfigUpdate) { + lastConfigRebuildAt = Date.now(); + signatureTracker.reset(); + } else { + lastContentRebuildAt = Date.now(); + } + broadcastReload(); + TUI.step(`Rebuilt [${label}] ${isConfigUpdate ? 'with new config' : displayPath} in ${rebuildElapsed()}`, 'DONE', TUI.blue, true); + } catch (err: any) { + TUI.step(`Rebuild [${label}] ${displayPath}`, 'FAIL', TUI.blue, true); + TUI.error('Rebuild failed', err.message); + } finally { + isRebuilding = false; + } + }, 600); // 600ms idle: rebuild only after user stops saving + }); + } + + if (workspaceConfig._resolvedPath && nativeFs.existsSync(workspaceConfig._resolvedPath)) { + let rootConfigDebounce: any = null; + // Watch the parent directory rather than the file directly โ€” far more + // stable on macOS, where direct-file fs.watch fires phantom events from + // Spotlight / iCloud / Time Machine. + const rootConfigPath = workspaceConfig._resolvedPath; + const rootConfigDir = path.dirname(rootConfigPath); + const rootConfigBaseName = path.basename(rootConfigPath); + + nativeFs.watch(rootConfigDir, (event, filename) => { + if (!filename) return; + if (filename !== rootConfigBaseName) return; + + // Post-rebuild quiet period + if (Date.now() - lastConfigRebuildAt < CONFIG_QUIET_MS) return; + + // Content-signature gate: ignore phantom events that don't actually + // mutate the file. + if (!signatureTracker.hasChanged(rootConfigPath)) return; + + if (rootConfigDebounce) clearTimeout(rootConfigDebounce); + rootConfigDebounce = setTimeout(async () => { + rootConfigDebounce = null; + if (isRebuilding) return; + isRebuilding = true; + + const rebuildElapsed = TUI.timer(); + TUI.step('Reloading workspace config...', 'WAIT', TUI.blue, true); + + try { + const { detectWorkspace } = await import('./workspace.js'); + const newWorkspaceConfig = await detectWorkspace(rootConfigBaseName); + if (newWorkspaceConfig) { + Object.assign(workspaceConfig, newWorkspaceConfig); + await buildWorkspace(newWorkspaceConfig, { isDev: true, quiet: true }); + lastConfigRebuildAt = Date.now(); + signatureTracker.reset(); + broadcastReload(); + TUI.step(`Rebuilt entire workspace with new config in ${rebuildElapsed()}`, 'DONE', TUI.blue, true); + } + } catch (err: any) { + TUI.step('Workspace Rebuild', 'FAIL', TUI.blue, true); + TUI.error('Rebuild failed', err.message); + } finally { + isRebuilding = false; + } + }, 500); + }); + } + + if (nativeFs.existsSync(path.resolve(CWD, 'assets'))) { + const sharedAssetsDir = path.resolve(CWD, 'assets'); + nativeFs.watch(sharedAssetsDir, { recursive: true }, (event, filename) => { + if (!filename) return; + // Post-rebuild quiet period + if (Date.now() - lastContentRebuildAt < CONTENT_QUIET_MS) return; + if (Date.now() - lastConfigRebuildAt < CONFIG_QUIET_MS) return; + + // Content-signature gate: ignore phantom events that don't actually + // mutate the file. + const filePath = path.resolve(sharedAssetsDir, filename); + if (!signatureTracker.hasChanged(filePath)) return; + + if (rebuildTimeout) clearTimeout(rebuildTimeout); + rebuildTimeout = setTimeout(async () => { + if (isRebuilding) return; + isRebuilding = true; + + const rebuildElapsed = TUI.timer(); + TUI.step('Shared assets changed โ€” rebuilding all', 'WAIT', TUI.blue, true); + + try { + await buildWorkspace(workspaceConfig, { isDev: true, quiet: true }); + lastContentRebuildAt = Date.now(); + broadcastReload(); + TUI.step(`All projects rebuilt in ${rebuildElapsed()}`, 'DONE', TUI.blue, true); + } catch (err: any) { + TUI.step('Rebuild all projects', 'FAIL', TUI.blue, true); + TUI.error('Rebuild failed', err.message); + } finally { + isRebuilding = false; + } + }, 600); // 600ms idle: rebuild only after user stops saving + }); + } + + if (process.stdin.isTTY) { + process.stdin.setRawMode(true); + process.stdin.resume(); + process.stdin.on('data', (data) => { + if (data[0] === 0x03) { + process.emit('SIGINT' as any); + } + }); + } + + let isShuttingDown = false; + process.on('SIGINT', () => { + if (isShuttingDown) return; + isShuttingDown = true; + if (process.stdin.isTTY) process.stdin.setRawMode(false); + TUI.success('Shutting down workspace dev server...\n'); + server.close(); + if (wss) wss.close(); + process.exit(0); + }); +} + +/* โ”€โ”€ Helpers โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ */ + +async function getDirectorySize(dir: string): Promise { + let total = 0; + try { + const entries = await nativeFs.promises.readdir(dir, { withFileTypes: true }); + for (const entry of entries) { + const fullPath = path.join(dir, entry.name); + if (entry.isDirectory()) { + total += await getDirectorySize(fullPath); + } else { + const stat = await nativeFs.promises.stat(fullPath); + total += stat.size; + } + } + } catch { /* ignore */ } + return total; +} + +function formatBytes(bytes: number): string { + if (bytes < 1024) return `${bytes} B`; + if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`; + return `${(bytes / (1024 * 1024)).toFixed(1)} MB`; +} \ No newline at end of file diff --git a/packages/core/src/env.d.ts b/packages/core/src/env.d.ts new file mode 100644 index 0000000..f20e73d --- /dev/null +++ b/packages/core/src/env.d.ts @@ -0,0 +1,5 @@ +declare module '@docmd/parser'; +declare module '@docmd/plugin-installer'; +declare module '@docmd/themes'; +declare module '@docmd/ui'; +declare module 'ws'; \ No newline at end of file diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts new file mode 100644 index 0000000..24e9b07 --- /dev/null +++ b/packages/core/src/index.ts @@ -0,0 +1,50 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/core (and ecosystem) + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + */ + +export function defineConfig(config: any): any { + return config; +} + +export { buildSite as build } from './commands/build.js'; +export { startDevServer as dev } from './commands/dev.js'; +export { buildLive } from './commands/live.js'; + +// D-H2: re-export the workspace helpers under their documented names. +// The skill/docs reference `buildWorkspace`, `detectWorkspace`, and +// `isWorkspace` directly; previously only `build` (= buildSite) was +// exposed from the package root and consumers got `SyntaxError: +// does not provide an export named 'buildWorkspace'` at import time. +export { buildWorkspace, detectWorkspace, isWorkspace } from './engine/workspace.js'; + +// Re-export from @docmd/api for backward compatibility +// These modules have moved to @docmd/api as of 0.7.1. +// Direct imports from @docmd/core continue to work but consumers +// are encouraged to migrate to @docmd/api. +export { createActionDispatcher, safePath, createSourceTools } from '@docmd/api'; + +// Plugin API types (re-exported from @docmd/api) +export type { + ActionContext, + ActionHandler, + EventHandler, + DispatchResult, + PluginModule, + PluginDescriptor, + PluginHooks, + Capability, + SourceTools, + BlockInfo, + InlineSegment, + TextLocation, +} from '@docmd/api'; \ No newline at end of file diff --git a/packages/core/src/utils/auto-router.ts b/packages/core/src/utils/auto-router.ts new file mode 100644 index 0000000..1aa700d --- /dev/null +++ b/packages/core/src/utils/auto-router.ts @@ -0,0 +1,153 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/core (and ecosystem) + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + */ + +import fs from 'fs'; +import path from 'path'; +import { normalizeInternalHref } from '@docmd/parser'; + +/** + * Convert a file/folder name to a URL-safe slug. + * Replaces spaces and URL-unsafe characters with hyphens so that the + * generated nav link, the output file path, and the browser URL all agree. + * + * Examples: + * "folder with space" โ†’ "folder-with-space" + * "my file (draft)" โ†’ "my-file-draft" + * "already-slug_ok" โ†’ "already-slug_ok" (no change) + */ +function slugifySegment(name: string): string { + return name + .replace(/\s+/g, '-') // spaces โ†’ hyphens + .replace(/[^a-zA-Z0-9\-_.~]/g, '-') // unsafe URL chars โ†’ hyphens + .replace(/-{2,}/g, '-') // collapse consecutive hyphens + .replace(/^-+|-+$/g, '') // strip leading/trailing hyphens + || name; // fallback: keep original if result is empty +} + +// Extract title from Frontmatter or H1 without loading heavy parsers +function extractTitleFromFile(filePath: string, filename: string) { + try { + const content = fs.readFileSync(filePath, 'utf8'); + + // 1. Try YAML frontmatter title + const fmMatch = content.match(/^---\n([\s\S]*?)\n---/); + if (fmMatch) { + const titleMatch = fmMatch[1].match(/^title:\s*"?([^"\n]+)"?/m); + if (titleMatch) return titleMatch[1].trim(); + } + + // 2. Try H1 + const h1Match = content.match(/^#\s+(.*)/m); + if (h1Match) return h1Match[1].trim(); + + } catch { /* ignore parser errors */ } + + // 3. Fallback: Prettify Filename + // "index copy.md" -> "Index Copy" + const cleanName = filename.replace(/\.(md|ejs)$/i, ''); + // Capitalize first letter of each word + return cleanName.replace(/[-_]/g, ' ').replace(/\b\w/g, c => c.toUpperCase()); +} + +/** + * Recursively builds the navigation array for Zero Config mode. + */ +export function buildAutoNav(dir: string, basePath = '/'): any[] { // Default base path is root '/' + const items = fs.readdirSync(dir, { withFileTypes: true }); + const nav: any[] = []; + + // Handle index.md/index.ejs (or README.md if no index.md) -> maps to the folder root + const hasIndex = items.some(i => /^index\.(md|ejs)$/i.test(i.name)); + const hasReadme = items.some(i => i.name.toLowerCase() === 'readme.md'); + const indexExists = hasIndex || hasReadme; + + for (const item of items) { + // Skip hidden files, node_modules, and typical output/asset dirs + if ( + item.name.startsWith('.') || + item.name === '_playground' || + item.name === 'node_modules' || + item.name === 'assets' || + item.name === 'site' || + item.name === 'dist' || + item.name === 'bin' || + item.name === 'src' || + item.name === 'lib' || + item.name === 'test' || + item.name === 'tests' || + item.name === 'coverage' || + item.name === 'scripts' || + item.name === 'temp' || + item.name === 'tmp' || + item.name === 'build' || + item.name === 'vendor' + ) continue; + + const fullPath = path.join(dir, item.name); + + // Construct URL path: basePath + slugified filename. + // Slugify so that spaces and URL-unsafe characters are replaced with hyphens, + // keeping the nav link, output file path, and browser URL consistent. + const safeBase = basePath.endsWith('/') ? basePath : basePath + '/'; + const relPath = safeBase + slugifySegment(item.name); + + if (item.isDirectory()) { + const children = buildAutoNav(fullPath, relPath); + if (children.length > 0) { + const title = item.name.replace(/[-_]/g, ' ').replace(/\b\w/g, l => l.toUpperCase()); + nav.push({ + title, + collapsible: true, + children + }); + } + } else if (item.isFile() && /\.(md|ejs)$/i.test(item.name)) { + const title = extractTitleFromFile(fullPath, item.name); + + let linkPath = relPath; + + const isIndex = /^index\.(md|ejs)$/i.test(item.name); + const isReadme = item.name.toLowerCase() === 'readme.md'; + + if (isIndex || (isReadme && !hasIndex)) { + linkPath = basePath === '/' ? '/' : basePath; + } else { + // Use centralised normaliser for clean URLs with trailing slash + linkPath = normalizeInternalHref(linkPath); + } + + nav.push({ title, path: linkPath }); + } + } + + // Sort: Put index.md (Home) at the top, then sort alphabetically + return nav.sort((a, b) => { + // Check if path effectively points to current folder root + const aIsRoot = a.path === basePath || a.path === basePath + '/'; + const bIsRoot = b.path === basePath || b.path === basePath + '/'; + + if (aIsRoot && !bIsRoot) return -1; + if (!aIsRoot && bIsRoot) return 1; + + // Folders usually come after files in some docs, or before. + // Let's standard: Files (Home) -> Folders -> Other Files + const aIsDir = !!a.children; + const bIsDir = !!b.children; + + if (aIsDir && !bIsDir) return 1; + if (!aIsDir && bIsDir) return -1; + + return a.title.localeCompare(b.title); + }); +} \ No newline at end of file diff --git a/packages/core/src/utils/config-loader.ts b/packages/core/src/utils/config-loader.ts new file mode 100644 index 0000000..926eec7 --- /dev/null +++ b/packages/core/src/utils/config-loader.ts @@ -0,0 +1,447 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/core (and ecosystem) + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + */ + +import path from 'path'; +import fs from 'fs'; +import { validateConfig } from '@docmd/parser'; +import { normalizeConfig } from './config-schema.js'; +import { buildAutoNav } from './auto-router.js'; +import { pathToFileURL } from 'url'; +import { TUI } from '@docmd/api'; + +function hasMarkdownFiles(dir: string, maxDepth = 2, currentDepth = 0): boolean { + if (currentDepth > maxDepth) return false; + try { + const entries = fs.readdirSync(dir, { withFileTypes: true }); + for (const entry of entries) { + if (entry.name === 'node_modules' || entry.name.startsWith('.') || entry.name === 'site' || entry.name === 'dist' || entry.name === 'out') continue; + if (entry.isFile() && (entry.name.endsWith('.md') || entry.name.endsWith('.markdown') || entry.name.endsWith('.ejs'))) return true; + if (entry.isDirectory()) { + if (hasMarkdownFiles(path.join(dir, entry.name), maxDepth, currentDepth + 1)) return true; + } + } + } catch { /* ignore */ } + return false; +} + +function detectHeuristics(cwd: string, srcDir: string) { + const absSrcDir = path.join(cwd, srcDir); + let items: any[] = []; + try { + items = fs.readdirSync(absSrcDir, { withFileTypes: true }); + } catch { + return { versions: null, i18n: null }; + } + + const versionFolders: string[] = []; + const localeFolders: string[] = []; + + const langMap: Record = { + en: 'English', + de: 'Deutsch', + zh: '็ฎ€ไฝ“ไธญๆ–‡', + fr: 'Franรงais', + ja: 'ๆ—ฅๆœฌ่ชž', + es: 'Espaรฑol', + ru: 'ะ ัƒััะบะธะน', + it: 'Italiano', + pt: 'Portuguรชs' + }; + + const isVersion = (name: string) => /^v\d/i.test(name); + const isLocale = (name: string) => /^[a-z]{2}(-[A-Z]{2})?$/i.test(name); + + for (const item of items) { + if (!item.isDirectory()) continue; + if (item.name.startsWith('.') || item.name === 'node_modules') continue; + + if (isVersion(item.name)) { + versionFolders.push(item.name); + } else if (isLocale(item.name)) { + localeFolders.push(item.name); + } + } + + // Sort versions descending (v0.8, v0.7, etc.) + versionFolders.sort((a, b) => b.localeCompare(a, undefined, { numeric: true, sensitivity: 'base' })); + + let finalVersions: any = null; + let finalI18n: any = null; + + if (versionFolders.length > 0) { + finalVersions = { + all: versionFolders.map(v => ({ + id: v, + dir: path.join(srcDir, v), + label: v + })), + current: versionFolders[0] + }; + + // Check if the current/first version contains locales + const currentVerDir = path.join(absSrcDir, versionFolders[0]); + if (fs.existsSync(currentVerDir)) { + try { + const verItems = fs.readdirSync(currentVerDir, { withFileTypes: true }); + const verLocales = verItems + .filter(item => item.isDirectory() && isLocale(item.name)) + .map(item => item.name); + + if (verLocales.length > 0) { + const defaultLoc = verLocales.includes('en') ? 'en' : verLocales[0]; + finalI18n = { + default: defaultLoc, + locales: verLocales.map(loc => ({ + id: loc, + label: langMap[loc.toLowerCase()] || loc.toUpperCase() + })) + }; + } + } catch { /* ignore read errors */ } + } + } else if (localeFolders.length > 0) { + const defaultLoc = localeFolders.includes('en') ? 'en' : localeFolders[0]; + finalI18n = { + default: defaultLoc, + locales: localeFolders.map(loc => ({ + id: loc, + label: langMap[loc.toLowerCase()] || loc.toUpperCase() + })) + }; + } + + return { versions: finalVersions, i18n: finalI18n }; +} + +async function buildZeroConfig(cwd: string, isDev = false, quiet = false, options: any = {}) { + + if (isDev && !quiet) { + if (!(global as any).__DOCMD_ZERO_LOGGED) { + TUI.info('Zero-Config mode activated. Analyzing directory...'); + (global as any).__DOCMD_ZERO_LOGGED = true; + } + } + + // Detect if there's a specific docs folder, otherwise use root + const candidates = ['docs', 'src/docs', 'documentation', 'content']; + let srcDir: string | null = null; + for (const c of candidates) { + if (fs.existsSync(path.join(cwd, c)) && hasMarkdownFiles(path.join(cwd, c), 2)) { + srcDir = c; + break; + } + } + + if (!srcDir) { + // Check if the root directory itself has markdown files + if (hasMarkdownFiles(cwd, 1)) { + srcDir = '.'; + } + } + + if (!srcDir) { + TUI.error('Configuration Error', 'No documentation directory or files found.'); + TUI.info(`Zero-Config expects one of: ${candidates.join(', ')} or markdown files in the project root.`); + TUI.info('Create one of these folders, place markdown files in the root, or provide a docmd.config.json file.'); + + const err: any = new Error('No candidate documentation directory or files found.'); + err.silent = true; + throw err; + } + + const absSrcDir = path.join(cwd, srcDir); + + if (!hasMarkdownFiles(absSrcDir, 2)) { + TUI.warn(`No documentation content found in ${absSrcDir}`); + TUI.info('docmd expects markdown files in the source folder.'); + + const err: any = new Error('No content found for documentation.'); + err.silent = true; + throw err; + } + + // Try extracting defaults from package.json + let autoTitle = path.basename(cwd) || 'Documentation'; + let autoDesc = ''; + try { + const pkgPath = path.join(cwd, 'package.json'); + if (fs.existsSync(pkgPath)) { + const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8')); + if (pkg.name) { + autoTitle = pkg.name.replace(/^@[^/]+\//, '').split('-').map((w: string) => w.charAt(0).toUpperCase() + w.slice(1)).join(' '); + } + if (pkg.description) autoDesc = pkg.description; + } + } catch { /* ignore */ } + + const { versions, i18n } = detectHeuristics(cwd, srcDir); + + // Dynamically build the navigation tree only if we do not have versions/locales at root + // (otherwise navigation is handled at version/locale level) + const autoNav = (!versions && !i18n) ? buildAutoNav(absSrcDir) : null; + + const autoConfig: any = { + title: autoTitle, + description: autoDesc, + src: srcDir, + out: 'site', + layout: { spa: true }, + theme: { name: 'default', appearance: 'system' } + }; + + if (autoNav) { + autoConfig.navigation = autoNav; + } + if (versions) { + autoConfig.versions = versions; + } + if (i18n) { + autoConfig.i18n = i18n; + } + + // Merge with global defaults + const merged = { ...(options._globalDefaults || {}), ...autoConfig }; + + return normalizeConfig(merged); +} + +export async function loadConfig(configPath: string, options: any = {}) { + // D-H1: honour an explicit `cwd` option (used by build.ts when the + // caller passes --config from a foreign working dir). Falls + // back to `process.cwd()` so existing callers continue to work. + const cwd = options.cwd || process.cwd(); + + let absoluteConfigPath = path.resolve(cwd, configPath); + + if (configPath === 'docmd.config.js') { + const candidates = [ + 'docmd.config.json', + 'docmd.config.ts', + 'docmd.config.js', + 'docmd.config.mjs', + 'config.js' + ]; + let found = false; + for (const c of candidates) { + const p = path.resolve(cwd, c); + if (fs.existsSync(p)) { + absoluteConfigPath = p; + found = true; + break; + } + } + + if (!found) { + // Check if we have docs directory with markdown files or if root has them. + // If we don't even have a docs directory, or if it's empty, auto-run init: + const docCandidates = ['docs', 'src/docs', 'documentation', 'content']; + let hasDocs = false; + for (const d of docCandidates) { + const dp = path.join(cwd, d); + if (fs.existsSync(dp) && hasMarkdownFiles(dp, 2)) { + hasDocs = true; + break; + } + } + + if (!hasDocs && hasMarkdownFiles(cwd, 1)) { + hasDocs = true; + } + + if (!hasDocs) { + if (process.argv.includes('--json') || options.quiet) { + throw new Error('No documentation directory or configuration found.'); + } + TUI.warn('No documentation or configuration found. Initializing new project...'); + const { initProject } = await import('../commands/init.js'); + await initProject(); + + // Re-check config candidates + for (const c of candidates) { + const p = path.resolve(cwd, c); + if (fs.existsSync(p)) { + absoluteConfigPath = p; + found = true; + break; + } + } + } + + if (!found) { + // Fallback to Zero-Config if nothing is found to prevent crashing! + if (!(global as any).__DOCMD_NO_CONFIG_LOGGED && !options.quiet) { + TUI.warn('No config found. Running in auto mode. Run `docmd init` to create one.'); + (global as any).__DOCMD_NO_CONFIG_LOGGED = true; + } + const autoConfig = await buildZeroConfig(cwd, options.isDev, options.quiet, options); + return JSON.parse(JSON.stringify(autoConfig)); + } + } + } else if (!fs.existsSync(absoluteConfigPath)) { + throw new Error(`Config file not found: ${absoluteConfigPath}`); + } + + // Cleanup any orphaned temp config files from previous failed reloads + try { + const configDir = path.dirname(absoluteConfigPath); + const baseName = path.basename(absoluteConfigPath).split('.')[0]; + const files = fs.readdirSync(configDir); + for (const file of files) { + if (file.startsWith(`${baseName}-`) && (file.endsWith('.js') || file.endsWith('.mjs'))) { + const fullPath = path.join(configDir, file); + // If it has a timestamp-like suffix, it's one of ours + if (/-[0-9]{13}\.(js|mjs)$/.test(file)) { + fs.unlinkSync(fullPath); + } + } + } + } catch { /* ignore cleanup errors */ } + + try { + // Polyfill defineConfig globally so the config file works + // even if @docmd/core isn't installed locally in the target project. + (global as any).defineConfig = (config: any) => config; + + // Use a timestamp to bypass ESM cache if file is likely changed + const ts = Date.now(); + let configUrl = pathToFileURL(absoluteConfigPath).href + '?t=' + ts; + let tempConfigPath: string | null = null; + let rawConfig: any; + + try { + if (absoluteConfigPath.endsWith('.json')) { + rawConfig = JSON.parse(fs.readFileSync(absoluteConfigPath, 'utf-8')); + } else { + if (absoluteConfigPath.endsWith('.ts')) { + const esbuild = await import('esbuild'); + tempConfigPath = absoluteConfigPath.replace(/\.ts$/, `-${ts}.mjs`); + await esbuild.build({ + entryPoints: [absoluteConfigPath], + outfile: tempConfigPath, + format: 'esm', + bundle: true, + packages: 'external', + platform: 'node', + target: 'node18' + }); + configUrl = pathToFileURL(tempConfigPath).href; + } else if (absoluteConfigPath.endsWith('.js') || absoluteConfigPath.endsWith('.mjs')) { + // Copy to a temp file to guarantee cache bypass (query strings + // are not always reliable for ESM cache busting in all Node versions) + const ext = path.extname(absoluteConfigPath); + tempConfigPath = absoluteConfigPath.replace(new RegExp(`\\${ext}$`), `-${ts}${ext}`); + fs.copyFileSync(absoluteConfigPath, tempConfigPath); + configUrl = pathToFileURL(tempConfigPath).href; + } + + const rawModule = await import(configUrl); + rawConfig = rawModule.default || rawModule; + } + + // If user has 'search' or 'theme' at root, but no 'layout' object, they are legacy. + const isLegacy = !rawConfig.layout && ( + rawConfig.search !== undefined || + (rawConfig.theme && rawConfig.theme.enableModeToggle !== undefined) || + rawConfig.sponsor + ); + + if (isLegacy) { + TUI.error('Legacy Configuration Detected', 'Your docmd.config uses an outdated structure.'); + TUI.info(`Run ${TUI.cyan('docmd migrate')} to automatically upgrade your configuration.`); + } + + validateConfig(rawConfig); + const hasExplicitNav = 'navigation' in rawConfig; + + // Merge with global defaults: root project config overrides global defaults + const mergedConfig = { ...(options._globalDefaults || {}), ...rawConfig }; + + const normalized = normalizeConfig(mergedConfig); + + if (normalized._baseAutoDerived) { + TUI.info(`${TUI.dim('base auto-derived from url:')} ${TUI.cyan(normalized._baseAutoDerived)}`); + } + + // Navigation Handling: Prioritize local navigation.json in the project folder + let navScanDir = path.resolve(cwd, normalized.srcDir); + let localNavPath = path.join(navScanDir, 'navigation.json'); + + // Adjust navScanDir if i18n is enabled to check in the default locale folder + if (normalized.i18n?.default) { + const localeScanDir = path.join(navScanDir, normalized.i18n.default); + if (fs.existsSync(localeScanDir)) { + navScanDir = localeScanDir; + localNavPath = path.join(navScanDir, 'navigation.json'); + } + } + + // If navigation.json exists locally, it ALWAYS wins over inherited global navigation + if (fs.existsSync(localNavPath)) { + try { + normalized.navigation = JSON.parse(fs.readFileSync(localNavPath, 'utf-8')); + } catch (e: any) { + TUI.error('Navigation Error', `Failed to parse ${localNavPath}: ${e.message}`); + } + } + // Otherwise, if we still don't have any navigation (not from global, not from config, not from JSON), + // check for localized/versioned nav or fallback to auto-nav + else if (!normalized.navigation || (normalized.navigation.length === 0 && !hasExplicitNav)) { + let hasNavInSubdirs = false; + + if (normalized.i18n?.default) { + // Check if any locale dir has navigation.json + hasNavInSubdirs = (normalized.i18n.locales || []).some((l: any) => + fs.existsSync(path.join(path.resolve(cwd, normalized.srcDir), l.id, 'navigation.json')) + ); + } + + // Check if any version dir has navigation.json + if (!hasNavInSubdirs && normalized.versions?.all?.length > 0) { + hasNavInSubdirs = normalized.versions.all.some((v: any) => { + const vDir = path.resolve(cwd, v.dir); + if (fs.existsSync(path.join(vDir, 'navigation.json'))) return true; + if (normalized.i18n?.default) { + return fs.existsSync(path.join(vDir, normalized.i18n.default, 'navigation.json')); + } + return false; + }); + } + + if (!hasNavInSubdirs) { + if (!options.quiet && !(global as any).__DOCMD_ZERO_NAV_LOGGED) { + TUI.info('No navigation settings found. Auto-generating with Zero-Config...'); + if (options.isDev) (global as any).__DOCMD_ZERO_NAV_LOGGED = true; + } + normalized.navigation = buildAutoNav(navScanDir); + } + } + + normalized._resolvedPath = absoluteConfigPath; + + // Ensure the final configuration object is completely JSON-serialisable + // This is crucial for passing the config to worker threads in the new multi-threaded build engine + return JSON.parse(JSON.stringify(normalized)); + } finally { + if (tempConfigPath && fs.existsSync(tempConfigPath)) { + fs.unlinkSync(tempConfigPath); + } + // Clean up global to avoid pollution + delete (global as any).defineConfig; + } + + } catch (e: any) { + if (e.message === 'Invalid configuration file.') throw e; + throw new Error(`Error parsing config file: ${e.message}`); + } +} \ No newline at end of file diff --git a/packages/core/src/utils/config-schema.ts b/packages/core/src/utils/config-schema.ts new file mode 100644 index 0000000..3090789 --- /dev/null +++ b/packages/core/src/utils/config-schema.ts @@ -0,0 +1,421 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/core (and ecosystem) + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + */ + +import { normalizeNavPaths, normalizeMenubarPaths } from '@docmd/parser'; + +/** + * CSS themes shipped with @docmd/themes. Any other value of `theme.name` + * is treated as a template name (see Section 4.0 of normalizeConfig). + * + * The "none" sentinel value suppresses the CSS overlay entirely. + */ +const KNOWN_CSS_THEMES: ReadonlySet = new Set([ + 'default', + 'sky', + 'ruby', + 'retro', + 'none', +]); + +/** + * Hardcoded English defaults for the 404 page. These are intentionally + * NOT injected into `config.notFound` during normalisation โ€” if we did, + * the build site's `|| t('pageNotFound')` fallback would never fire + * (the user-supplied English string would shadow it), and a site with + * default locale = 'zh' would still render "404 : Page Not Found" in + * English. + * + * Instead, the build command resolves the actual title/content at + * render-time using this priority chain: + * 1. config.notFound.title / config.notFound.content (user override) + * 2. t('pageNotFound') / t('pageNotFoundMsg') (translated to default locale) + * 3. NOT_FOUND_DEFAULTS.title / content (this constant, English) + * + * Exported here so the defaults live next to the rest of the config + * schema rather than buried in the build command. + */ +export const NOT_FOUND_DEFAULTS = { + title: 'Page Not Found', + content: 'The page youโ€™re looking for doesnโ€™t exist or has moved.' +}; + +/** + * Normalizes user config to ensure all required nested objects exist. + * Handles legacy backward compatibility transparently. + */ +export function normalizeConfig(userConfig: any) { + const config = { ...userConfig }; + + // --- 1. Modern Syntax Standard (V3) --- + // New labels are the source of truth. Fallback to legacy labels if present. + // Every field MUST have a default here so no consumer needs its own fallback chain. + config.title = config.title || config.siteTitle || 'Documentation'; + config.url = config.url || config.siteUrl || config.baseUrl || ''; + config.src = config.src || config.srcDir || config.source || 'docs'; + config.out = process.env.DOCMD_PROJECT_OUT || config.out || config.outDir || config.outputDir || 'site'; + + // Track whether the user explicitly set base (vs. the default '/'). + // The env var (DOCMD_PROJECT_PREFIX) counts as explicit; only a truly + // absent base triggers auto-derivation from url below. + const _userSetBaseExplicitly = !!process.env.DOCMD_PROJECT_PREFIX || userConfig.base !== undefined; + config.base = process.env.DOCMD_PROJECT_PREFIX || config.base || '/'; + + // --- 1.1 Normalise base slashes + auto-derive from URL --- + // + // DESIGN PRINCIPLE: `base` is an internal implementation detail. Users + // should NEVER have to think about it. They set `url` (the canonical + // production URL) and docmd derives everything else. The only time + // `base` is needed is the rare case where the deployment path differs + // from the URL path (e.g. a CDN that strips a prefix). + // + // What this block does, in order: + // 1. If the user explicitly set base, normalise its slashes: + // "repo" โ†’ "/repo/", "/repo" โ†’ "/repo/", "repo/" โ†’ "/repo/". + // Users should not have to remember whether slashes are needed. + // 2. If base was NOT explicitly set, derive it from url's pathname. + // This handles GitHub Pages project sites and any subpath deploy + // where the user set url to match their deployment. + // 3. If neither base nor url is informative, default to "/". + // + // The derivation is slash-tolerant on url too: + // url = "https://user.github.io/repo" โ†’ base = "/repo/" + // url = "https://user.github.io/repo/" โ†’ base = "/repo/" + // url = "https://docs.example.com" โ†’ base = "/" + // url = "https://example.com/docs/" โ†’ base = "/docs/" + // + // If derivation cannot fire (no url, or url is a root), base stays "/" + // and the build will warn if assets turn out to be unreachable. + if (_userSetBaseExplicitly && config.base !== '/') { + // User set base explicitly: fix the slashes for them. + let b = config.base.trim(); + if (!b.startsWith('/')) b = '/' + b; // "repo" โ†’ "/repo" + if (!b.endsWith('/')) b = b + '/'; // "/repo" โ†’ "/repo/" + // Collapse accidental double slashes (e.g. "//repo///" โ†’ "/repo/"). + b = b.replace(/([^:])\/{2,}/g, '$1/'); + if (b !== config.base) config._baseNormalised = config.base; + config.base = b; + } else if (!_userSetBaseExplicitly && config.url) { + // Derive base from url. Slash-tolerant on both ends. + try { + const parsedUrl = new URL(config.url); + // Strip trailing slashes to get a clean path, then re-add one. + // Empty or "/" โ†’ root deployment, base stays "/". + const pathname = parsedUrl.pathname.replace(/\/+$/, ''); + if (pathname && pathname !== '/') { + const derivedBase = pathname + '/'; + config.base = derivedBase; + config._baseAutoDerived = derivedBase; + } + } catch { + // Invalid url (placeholder, typo, empty-ish) โ€” leave base as "/". + // The build will surface a clear warning if assets end up missing. + } + } + // Top-level QoL defaults โ€” opt out by setting `false`. + if (config.pageNavigation === undefined) config.pageNavigation = true; + if (config.copyCode === undefined) config.copyCode = true; + if (config.autoTitleFromH1 === undefined) config.autoTitleFromH1 = true; + + // --- 1.5 Security defaults (Phase 0.D, new in v0.8.8) --- + // Controls how the markdown parser handles raw HTML in user content. + // 'allow' - raw HTML passes through to the rendered output (UNSAFE) + // 'escape' - raw HTML is HTML-escaped and shown as text (default) + // 'strip' - raw HTML blocks are removed from the rendered output + // The default flips from allow to escape in v0.8.8 to mitigate S-2 and S-7. + const VALID_HTML_POLICIES = new Set(['allow', 'escape', 'strip']); + const userHtmlPolicy = config.security && config.security.html; + config.security = { + html: VALID_HTML_POLICIES.has(userHtmlPolicy) ? userHtmlPolicy : 'escape', + }; + + // Failsafe: Keep legacy keys attached for older plugins (SEO, Sitemap) to prevent breakage during transition. + config.siteTitle = config.title; + config.siteUrl = config.url; + config.srcDir = config.src; + config.outputDir = config.out; + + // --- Logo Normalization + if (typeof config.logo === 'string') { + config.logo = { + light: config.logo, + dark: config.logo, + alt: config.title || 'Logo' + }; + } + + // --- 2. Layout Structure (V2 Schema) --- + const userLayout = config.layout || {}; + + config.layout = { + spa: true, + breadcrumbs: true, + ...userLayout + }; + + config.header = { + enabled: true, + ...(userLayout.header || config.header || {}) + }; + + // Legacy Mapping: Sidebar + const legacySidebar = config.sidebar || {}; + config.sidebar = { + enabled: true, + collapsible: true, + defaultCollapsed: false, + position: 'left', + ...(userLayout.sidebar || legacySidebar) + }; + + // Legacy Mapping: Footer + const legacyFooter = config.footer; + config.footer = { + copyright: `ยฉ ${new Date().getFullYear()}`, + style: 'minimal', + content: typeof legacyFooter === 'string' ? legacyFooter : null, + branding: true, + ...(userLayout.footer || (typeof legacyFooter === 'object' ? legacyFooter : {})) + }; + + if (config.footer.columns && Array.isArray(config.footer.columns)) { + for (const col of config.footer.columns) { + if (col.links && Array.isArray(col.links)) { + normalizeMenubarPaths(col.links); + } + } + } + + // --- 3. Options Menu (Search, Theme, Sponsor) --- + config.optionsMenu = { + position: 'header', + components: { + search: true, + themeSwitch: true, + sponsor: null + }, + ...(userLayout.optionsMenu || config.optionsMenu || {}) + }; + + // --- 3.1. Site-wide Banner (new in 0.8.7) --- + // Sits above the menubar. Opt-in โ€” defaults to null (no banner rendered). + if (config.layout?.banner) { + const ub = config.layout.banner; + config.layout.banner = { + content: typeof ub === 'string' ? ub : (ub.content || ub.html || ''), + html: typeof ub === 'object' && ub.html ? ub.html : undefined, + type: (typeof ub === 'object' && ub.type) ? ub.type : 'info', + dismissible: typeof ub === 'object' && ub.dismissible === false ? false : true, + link: typeof ub === 'object' && ub.link && ub.link.url ? ub.link : null, + icon: typeof ub === 'object' && ub.icon ? ub.icon : null, + }; + // If only a string was passed, `ub` is a string and `content` is the string. + // If it's an object, ensure `content` and `html` are mutually consistent. + if (config.layout.banner.html && !config.layout.banner.content) { + config.layout.banner.content = config.layout.banner.html; + } + } else { + config.layout.banner = null; + } + + // --- Menubar (Top Navigation Bar) --- + const userMenubar = userLayout.menubar || config.menubar; + if (userMenubar) { + const isArray = Array.isArray(userMenubar); + config.menubar = { + enabled: true, + position: (!isArray && userMenubar.position) ? userMenubar.position : 'top', + left: isArray ? userMenubar : (Array.isArray(userMenubar.left) ? userMenubar.left : []), + right: (!isArray && Array.isArray(userMenubar.right)) ? userMenubar.right : [], + ...(!isArray ? userMenubar : {}) + }; + normalizeMenubarPaths(config.menubar.left); + normalizeMenubarPaths(config.menubar.right); + } else { + config.menubar = null; + } + + // --> Legacy Adapter: Sponsor + if (config.sponsor) { + if (typeof config.sponsor === 'object' && config.sponsor.enabled && config.sponsor.link) { + config.optionsMenu.components.sponsor = config.sponsor.link; + } else if (typeof config.sponsor === 'string') { + config.optionsMenu.components.sponsor = config.sponsor; + } + } + + // --> Legacy Adapter: Search (Boolean) + if (typeof config.search === 'boolean') { + config.optionsMenu.components.search = config.search; + } + + // --> Legacy Adapter: Theme Switch & Position + if (config.theme) { + if (config.theme.enableModeToggle === false) { + config.optionsMenu.components.themeSwitch = false; + } + if (config.theme.positionMode === 'bottom') { + config.optionsMenu.position = 'sidebar-bottom'; + } else if (config.theme.positionMode === 'top') { + config.optionsMenu.position = 'header'; + } + } + + // --- 4. Theme & Branding --- + config.theme = { + name: 'default', + appearance: 'system', + customCss: [], + codeHighlight: true, + ...(config.theme || {}) + }; + + // Legacy Support: Map defaultMode to appearance if appearance isn't explicitly set + if (config.theme.defaultMode && !userConfig.theme?.appearance) { + config.theme.appearance = config.theme.defaultMode; + } + + // Ensure defaultMode is still available for legacy templates/plugins + config.theme.defaultMode = config.theme.appearance; + + // --- 4.0. Theme name โ†’ Template auto-promotion (new in 0.8.7) --- + // The CSS themes shipped with @docmd/themes are a known, short list. + // Any other value in `theme.name` is treated as a template name (so + // users only need to learn ONE key: `theme.name`). + // Explicit `theme.template` always wins. + if (config.theme.name && !config.theme.template && !KNOWN_CSS_THEMES.has(config.theme.name)) { + config.theme.template = config.theme.name; + // Keep `theme.name` so the original intent is preserved, but + // mark the theme as "no CSS overlay" so the generator does not + // try to load `docmd-theme-${name}.css` (which would 404). + config.theme._noCssOverlay = true; + } + + // --- 4.1. Cookie Consent (new in 0.8.7) --- + // Opt-in. Users add `"cookie": { ... }` to enable the consent dialog. + // Defaults are kept conservative; templates can ship their own defaults + // by reading config.cookie and supplying a copy in their template's + // onboarding step. The user is always in control. + if (config.cookie) { + const uc = config.cookie; + if (uc === true) { + config.cookie = { enabled: true }; + } else if (typeof uc === 'object') { + config.cookie = { + enabled: uc.enabled !== false, + message: uc.message || null, + acceptText: uc.acceptText || null, + declineText: uc.declineText || null, + policyUrl: uc.policyUrl || null, + position: ['bottom', 'bottom-left', 'bottom-right', 'center'].includes(uc.position) ? uc.position : 'bottom', + dismissible: uc.dismissible !== false, + expiryDays: typeof uc.expiryDays === 'number' && uc.expiryDays > 0 ? uc.expiryDays : 180, + }; + } else { + config.cookie = null; + } + } else { + config.cookie = null; + } + + config.customJs = config.customJs || []; + + // Normalize Navigation + config.navigation = Array.isArray(config.navigation) ? config.navigation : []; + normalizeNavPaths(config.navigation); + + // Aliasing for Menubar items (title -> text, path -> url) + if (config.menubar) { + const normalizeItems = (items: any[]) => { + items.forEach(item => { + if (item.title && !item.text) item.text = item.title; + if (item.path && !item.url) item.url = item.path; + if (item.items) normalizeItems(item.items); + }); + }; + if (config.menubar.left) normalizeItems(config.menubar.left); + if (config.menubar.right) normalizeItems(config.menubar.right); + } + + // --- 5. Plugins --- + config.hasExplicitPlugins = 'plugins' in userConfig; + config.plugins = config.plugins || {}; + + // --- 6. Versioning Engine --- + // M-6: accept `config.versions.list` as an alias for `config.versions.all`. + // The original audit reported "i18n + explicit versions: 0 pages (silent)" + // โ€” turns out the actual cause was a typo: users wrote `list` (a + // common shape for "list of versions") but the schema only accepted + // `all`, so the config branch was never entered and zero pages got + // built. Aliasing `list` to `all` here restores the user's config + // without changing the canonical key. + if (config.versions && Array.isArray(config.versions.list) && !Array.isArray(config.versions.all)) { + config.versions.all = config.versions.list; + } + if (config.versions && Array.isArray(config.versions.all)) { + if (!config.versions.current) { + config.versions.current = config.versions.all[0]?.id || 'main'; + } + config.versions.position = config.versions.position || 'sidebar-top'; + config.versions.all = config.versions.all.map((v: any) => { + return { + id: v.id, + dir: v.dir || `docs-${v.id}`, + label: v.label || v.id, + navigation: v.navigation || null + }; + }); + } else { + config.versions = false; + } + + // --- 7. SEO Redirects & 404 --- + // config.notFound is normalised to an empty object here so build + // commands can read `config.notFound?.title` / `content` without + // optional-chaining every access. The English defaults live in the + // exported NOT_FOUND_DEFAULTS constant and are applied at render + // time (NOT pre-injected into config.notFound โ€” that would shadow + // the translation fallback chain in the build command). + config.redirects = config.redirects || {}; + config.notFound = config.notFound || {}; + + // --- 8. Internationalisation (i18n) --- + if (config.i18n && config.i18n.locales && Array.isArray(config.i18n.locales) && config.i18n.locales.length > 0) { + config.i18n = { + default: config.i18n.default || config.i18n.locales[0].id || 'en', + position: config.i18n.position || 'options-menu', + stringMode: config.i18n.stringMode || false, + inPlace: config.i18n.inPlace || false, + locales: config.i18n.locales.map((loc: any) => ({ + id: loc.id, + label: loc.label || loc.id, + dir: loc.dir || 'ltr', + translations: loc.translations || {} + })) + }; + } else { + config.i18n = false; + } + + // --- 9. OptionsMenu Fallbacks --- + if (config.optionsMenu.position === 'menubar' && (!config.menubar || config.menubar.enabled === false)) { + config.optionsMenu.position = 'sidebar-top'; + } else if (config.optionsMenu.position === 'header' && (!config.header || config.header.enabled === false)) { + config.optionsMenu.position = 'sidebar-top'; + } + + return config; +} + +// Re-export for backward compatibility (used by generator.ts, versioning.ts) +export { normalizeNavPaths, normalizeMenubarPaths } from '@docmd/parser'; \ No newline at end of file diff --git a/packages/core/src/utils/dev-utils.ts b/packages/core/src/utils/dev-utils.ts new file mode 100644 index 0000000..93b3e16 --- /dev/null +++ b/packages/core/src/utils/dev-utils.ts @@ -0,0 +1,257 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/core (and ecosystem) + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + */ + +import http from 'http'; +import os from 'os'; +import path from 'path'; +import crypto from 'crypto'; +import { execSync, spawn } from 'child_process'; +import { fileURLToPath } from 'url'; +import { fsUtils as fs, safePath, asUserPath } from '@docmd/utils'; + + + +// MIME types for static file serving +export const MIME_TYPES: Record = { + '.html': 'text/html', + '.js': 'text/javascript', + '.css': 'text/css', + '.json': 'application/json', + '.png': 'image/png', + '.jpg': 'image/jpg', + '.jpeg': 'image/jpg', + '.gif': 'image/gif', + '.svg': 'image/svg+xml', + '.ico': 'image/x-icon', + '.woff': 'application/font-woff', + '.woff2': 'font/woff2', + '.ttf': 'application/font-ttf', + '.txt': 'text/plain', +}; + +/** + * Format an absolute path for display relative to CWD. + */ +export function formatPathForDisplay(absolutePath: string, cwd: string): string { + const relativePath = path.relative(cwd, absolutePath); + if (!relativePath.startsWith('..') && !path.isAbsolute(relativePath)) { + return `./${relativePath}`; + } + return relativePath; +} + +/** + * Get the first non-internal IPv4 network address. + */ +export function getNetworkIp(): string | null { + const interfaces = os.networkInterfaces(); + for (const name of Object.keys(interfaces)) { + for (const iface of interfaces[name]!) { + if (iface.family === 'IPv4' && !iface.internal) { + return iface.address; + } + } + } + return null; +} + +/** + * Read git user.name and user.email, compute Gravatar URL. + * Lazy-initialized on first call. + */ +let _gitDevInfoCache: { name: string; email: string; gravatarUrl: string } | null = null; +export function getGitDevInfo() { + if (_gitDevInfoCache) return _gitDevInfoCache; + let name = ''; + let email = ''; + try { name = execSync('git config user.name', { encoding: 'utf8', stdio: ['pipe', 'pipe', 'ignore'] }).trim(); } catch { /* git not configured */ } + try { email = execSync('git config user.email', { encoding: 'utf8', stdio: ['pipe', 'pipe', 'ignore'] }).trim(); } catch { /* git not configured */ } + const gravatarUrl = email + ? `https://gravatar.com/avatar/${crypto.createHash('md5').update(email.toLowerCase().trim()).digest('hex')}?s=80&d=mp` + : ''; + _gitDevInfoCache = { name, email, gravatarUrl }; + return _gitDevInfoCache; +} + +export function getDevInfoScript(): string { + return ``; +} + +/** + * Serve static files from rootDir with live-reload injection. + */ +export async function serveStatic(req: any, res: any, rootDir: string) { + // Serve dev-only API script + if (req.url === '/__dev/docmd-api.js') { + try { + const apiScriptPath = path.resolve( + fileURLToPath(import.meta.url), + '../../../../ui/assets/js/docmd-api.js' + ); + const apiScript = await fs.readFile(apiScriptPath, 'utf-8'); + res.writeHead(200, { 'Content-Type': 'text/javascript' }); + res.end(apiScript); + } catch { + res.writeHead(404); + res.end('Not found'); + } + return; + } + + const url = new URL(req.url || '/', 'http://localhost'); + const pathname = decodeURIComponent(url.pathname); + const rootAbs = path.resolve(rootDir); + // Security (Phase 1.A: CWE-22 fix). Use safePath() to enforce the boundary. + // + // The previous `filePath.startsWith(rootAbs)` check was the outlier in the + // repo: it did not append `path.sep`, so a sibling directory whose name + // started with rootDir's name (e.g. rootDir=`/x/site`, sibling=`/x/site-private`) + // passed the check, and a URL like `/..%2fsite-private/secret.txt` resolved + // to the sibling. safePath() enforces the strict `root + path.sep` boundary + // and throws on escape. + // + // Note: URL pathnames always start with `/` (e.g. `/index.html`). We + // strip the leading slash before passing to safePath() so the second + // argument is treated as a *relative* path. `path.resolve` (which + // safePath uses internally) treats `/index.html` as absolute and would + // bypass the boundary check; `path.join`-style resolution is the + // correct semantic for "join this to the root". + let filePath: string; + try { + const safeRelative = pathname.replace(/^\/+/, '') || '.'; + filePath = safePath(rootAbs, asUserPath(safeRelative)); + } catch (_e: any) { + res.writeHead(403); + res.end('Forbidden'); + return; + } + + try { + let stats; + try { + stats = await fs.stat(filePath); + } catch (e) { + if (path.extname(filePath) === '') { + filePath += '.html'; + stats = await fs.stat(filePath); + } else { + throw e; + } + } + + if (stats.isDirectory()) { + if (!req.url.split('?')[0].endsWith('/')) { + res.writeHead(301, { 'Location': req.url + '/' }); + res.end(); + return; + } + filePath = path.join(filePath, 'index.html'); + await fs.stat(filePath); + } + + const ext = path.extname(filePath).toLowerCase(); + const contentType = MIME_TYPES[ext] || 'application/octet-stream'; + const content = await fs.readFile(filePath); + + if (contentType === 'text/html') { + res.writeHead(200, { 'Content-Type': contentType, 'Cache-Control': 'no-cache' }); + const htmlStr = content.toString('utf-8'); + const liveReloadScript = `${getDevInfoScript()}`; + res.end(htmlStr.replace('', liveReloadScript)); + } else { + res.writeHead(200, { 'Content-Type': contentType }); + res.end(content); + } + + } catch (err: any) { + if (err.code === 'ENOENT') { + const custom404Path = path.join(rootDir, '404.html'); + try { + const content = await fs.readFile(custom404Path); + res.writeHead(404, { 'Content-Type': 'text/html' }); + const htmlStr = content.toString('utf-8'); + const liveReloadScript = `${getDevInfoScript()}`; + res.end(htmlStr.replace('', liveReloadScript)); + } catch { + res.writeHead(404, { 'Content-Type': 'text/html' }); + res.end(` +
+

404 Not Found

+

The requested URL ${req.url} was not found.

+

(docmd dev server)

+
+ `); + } + } else { + res.writeHead(500); + res.end(`Server Error: ${err.code}`); + } + } +} + +/** + * Check if a port is in use. + */ +export function checkPortInUse(port: number): Promise { + // The probe binds to 127.0.0.1, not 0.0.0.0, so it only checks whether + // the loopback interface has the port. Binding to all interfaces here + // was unnecessary (we just need to know if "our" port is taken) and + // briefly exposed the probe socket to the LAN. + return new Promise((resolve) => { + const tester = http.createServer() + .once('error', (err: any) => resolve(err.code === 'EADDRINUSE')) + .once('listening', () => tester.close(() => resolve(false))) + .listen(port, '127.0.0.1'); + }); +} + +/** + * Find the next available port starting from startPort. + */ +export async function findAvailablePort(startPort: number): Promise { + let port = startPort; + while (await checkPortInUse(port)) { + port++; + } + return port; +} + +/** + * Open a URL in the user's default browser. Best-effort: failures are + * swallowed so the dev server is never taken down by a missing `xdg-open` + * (e.g. inside the official Docker image, where the binary is not + * installed). The call is also skipped entirely when running inside a + * container โ€” the official image sets DOCMD_CONTAINER=true for this. + */ +export function openBrowser(url: string): void { + if (process.env.DOCMD_CONTAINER === 'true') return; + + let command = 'xdg-open'; + let args = [url]; + + if (process.platform === 'darwin') { + command = 'open'; + } else if (process.platform === 'win32') { + command = 'cmd'; + args = ['/c', 'start', '""', url]; + } + + try { + const child = spawn(command, args, { stdio: 'ignore', detached: true }); + child.on('error', () => { /* missing browser binary โ€” ignore */ }); + child.unref(); + } catch { + /* never let a browser-launch failure crash the dev server */ + } +} \ No newline at end of file diff --git a/packages/core/src/utils/exit.ts b/packages/core/src/utils/exit.ts new file mode 100644 index 0000000..c60b3d0 --- /dev/null +++ b/packages/core/src/utils/exit.ts @@ -0,0 +1,94 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/core + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + */ + +/** + * Phase 3 PR 3.A โ€” Exit-code contract. + * + * Every `docmd ` that hits a documented error path MUST exit + * with a non-zero code so CI pipelines can gate on it. Historically we + * had several `TUI.error(...); return;` patterns that printed the + * message but left the process at exit code 0, silently passing broken + * builds (see `unified-issues.md` ยงF6 / ยงM-12). + * + * These helpers centralise the contract: + * + * - `exitCodeFor(err)` returns a numeric exit code. Today this is + * always 1 (operational error), but the indirection lets us + * introduce code-2 for usage errors, code-3 for config errors, + * etc. without rewriting every call site. + * + * - `exitWithError(err, opts?)` calls `TUI.error(...)` (or prints + * JSON when `opts.json === true`) and then `process.exit(code)`. + * The `quiet` option suppresses the error print when the caller + * has already surfaced the error. + * + * - `failWith(message, opts?)` is the convenience wrapper for the + * common "no extra Error object, just a message" case. + * + * Every CLI command that previously did `TUI.error(...); return;` + * should be ported to `exitWithError(...)`. The Phase 3 PR 3.A brute- + * test scenario asserts that every documented failure case exits 1. + */ + +import { TUI } from '@docmd/api'; + +/** + * Map any thrown or constructed value to a numeric exit code. + * + * Reserved codes (matches common CLI conventions): + * 0 โ€” success + * 1 โ€” operational error (default for any thrown value) + * + * Future expansion: discriminate on `err.code` or `err.name` to + * return 2 (usage), 3 (config), 4 (network), 5 (I/O), 6 (plugin). + */ +export function exitCodeFor(_err: unknown): number { + // Reserved for future discrimination on err.code / err.name. Today every + // error maps to 1 (operational). The parameter is part of the contract. + void _err; + return 1; +} + +/** + * Print an error and exit with the code returned by `exitCodeFor`. + * Never returns โ€” the function always terminates the process. + * + * exitWithError(new Error('Plugin not found: foo')); + * exitWithError('Build failed: ...', { json: true }); + * exitWithError('Missing configuration', { quiet: true }); + */ +export function exitWithError( + err: unknown, + opts: { json?: boolean; quiet?: boolean; section?: string } = {} +): never { + const message = err instanceof Error ? err.message : String(err); + const code = exitCodeFor(err); + + if (!opts.quiet) { + if (opts.json) { + console.log(JSON.stringify({ error: message, exitCode: code })); + } else { + TUI.error(opts.section || 'Command failed', message); + } + } + process.exit(code); +} + +/** + * Convenience wrapper when the caller has a plain message string and + * no Error object. Same as `exitWithError(new Error(message), opts)`. + */ +export function failWith(message: string, opts: { json?: boolean; section?: string } = {}): never { + exitWithError(new Error(message), opts); +} diff --git a/packages/core/src/utils/ws-origin-guard.ts b/packages/core/src/utils/ws-origin-guard.ts new file mode 100644 index 0000000..78622d3 --- /dev/null +++ b/packages/core/src/utils/ws-origin-guard.ts @@ -0,0 +1,62 @@ +/** + * Origin-allowlist verifyClient callback factory for the dev-server + * WebSocketServers. Used by packages/core/src/commands/dev.ts and + * packages/core/src/engine/workspace.ts. Mitigates CSWSH + * (Cross-Site WebSocket Hijacking, CWE-1385). See + * DEVELOPMENT-BENCHMARK.md ยงS3. + */ + +import type { IncomingMessage } from 'node:http'; + +const LOOPBACK_HOSTS = new Set(['localhost', '127.0.0.1', '[::1]', '::1']); + +/** + * Extract the hostname (lowercased) from an Origin URL header value. + * Returns null if the value cannot be parsed. + */ +function originHost(originHeader: string | undefined | null): string | null { + if (!originHeader) return null; + try { + const u = new URL(originHeader); + return u.hostname.toLowerCase(); + } catch { + return null; + } +} + +export interface VerifyClientInfo { + origin?: string; + req: IncomingMessage; + secure: boolean; +} + +/** + * Build a verifyClient callback that allows loopback origins plus an + * optional list of explicit additional hosts (e.g. a known LAN IP). + * The port portion of the origin is intentionally ignored โ€” we only + * gate by hostname, because the dev server's port may vary per run. + */ +export function createOriginVerify(extraAllowedHosts: string[] = []) { + const allowed = new Set([...LOOPBACK_HOSTS]); + for (const h of extraAllowedHosts) { + if (h) allowed.add(h.toLowerCase()); + } + + return function verifyClient( + info: VerifyClientInfo, + callback: (allowed: boolean, code?: number, message?: string) => void + ): void { + const originHeader = info.origin || (info.req.headers.origin as string | undefined); + const host = originHost(originHeader); + if (!host) { + // No Origin header at all (direct script / curl) โ€” reject for safety. + callback(false, 403, 'Origin header required'); + return; + } + if (allowed.has(host)) { + callback(true); + return; + } + callback(false, 403, `Origin ${host} not in allowlist`); + }; +} \ No newline at end of file diff --git a/packages/core/tsconfig.json b/packages/core/tsconfig.json new file mode 100644 index 0000000..9635ce4 --- /dev/null +++ b/packages/core/tsconfig.json @@ -0,0 +1,10 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "outDir": "./dist", + "rootDir": "./src", + "strict": false + }, + "include": ["src/**/*"], + "exclude": ["node_modules", "dist", "**/*.test.ts"] +} \ No newline at end of file diff --git a/packages/deployer/LICENSE b/packages/deployer/LICENSE new file mode 100644 index 0000000..997bb73 --- /dev/null +++ b/packages/deployer/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025-present docmd.io + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/packages/deployer/README.md b/packages/deployer/README.md new file mode 100644 index 0000000..2ba7697 --- /dev/null +++ b/packages/deployer/README.md @@ -0,0 +1,78 @@ +# @docmd/deployer + +Deployment configuration generator for **[docmd](https://github.com/docmd-io/docmd)** - the zero-config documentation engine. + +Generates production-ready deployment files from your `docmd.config.json`. All outputs are personalised to your project; no generic copy-paste templates. + +## Supported Targets + +### Self-hosted + +| Flag | Output | +|------|--------| +| `--docker` | `Dockerfile` + `.dockerignore` | +| `--nginx` | Production-hardened `nginx.conf` | +| `--caddy` | HTTPS-ready `Caddyfile` | + +### Cloud & CI + +| Flag | Output | +|------|--------| +| `--github-pages` | `.github/workflows/deploy.yml` (GitHub Actions) | +| `--vercel` | `vercel.json` | +| `--netlify` | `netlify.toml` | + +## Usage + +This package is invoked via the `docmd` CLI. You do not need to import it directly. + +```bash +# Self-hosted +docmd deploy --docker +docmd deploy --nginx +docmd deploy --caddy + +# Cloud / CI +docmd deploy --github-pages +docmd deploy --vercel +docmd deploy --netlify + +# Combine targets +docmd deploy --docker --nginx +``` + +Every run reads your `docmd.config.json` and regenerates the files to match. Zero-config projects use the same defaults as `docmd build`. + +## Architecture + +``` +@docmd/deployer + src/ + context.ts Shared DeployContext type + index.ts Orchestrator - resolves options, writes files + providers/ + docker.ts Dockerfile + .dockerignore + nginx.ts nginx.conf + caddy.ts Caddyfile + github-pages.ts GitHub Actions deploy workflow + vercel.ts vercel.json + netlify.ts netlify.toml +``` + +Each provider is a pure function `(ctx: DeployContext) => string` - no side effects, no I/O. File writing is handled by the orchestrator. Adding a new provider is a single file with no changes to other providers. + +**Dependency graph (no cycles):** + +``` +@docmd/core โ†’ @docmd/deployer โ†’ @docmd/api +``` + +Config resolution (`loadConfig`, `normalizeConfig`) stays in `@docmd/core` to keep `@docmd/deployer` free of any dependency on its parent package. + +## Documentation + +See **[docmd.io/deployment](https://docmd.io/deployment)** for detailed, service-specific guides. + +## License + +MIT - Copyright (c) 2025-present docmd.io \ No newline at end of file diff --git a/packages/deployer/package.json b/packages/deployer/package.json new file mode 100644 index 0000000..efe5f63 --- /dev/null +++ b/packages/deployer/package.json @@ -0,0 +1,50 @@ +{ + "name": "@docmd/deployer", + "version": "0.8.12", + "description": "Deployment configuration generator for docmd - Docker, Nginx, Caddy, GitHub Pages, Vercel, and Netlify.", + "type": "module", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "scripts": { + "build": "tsc" + }, + "files": [ + "dist" + ], + "engines": { + "node": ">=18" + }, + "dependencies": { + "@docmd/api": "workspace:*" + }, + "devDependencies": { + "@types/node": "^24.13.3" + }, + "keywords": [ + "docmd", + "deployer", + "docker", + "nginx", + "caddy", + "github-pages", + "vercel", + "netlify", + "deployment", + "static-site-generator", + "docs" + ], + "author": { + "name": "Ghazi", + "url": "https://mgks.dev" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/docmd-io/docmd.git" + }, + "bugs": { + "url": "https://github.com/docmd-io/docmd/issues" + }, + "homepage": "https://docmd.io", + "funding": "https://github.com/sponsors/mgks", + "license": "MIT" +} \ No newline at end of file diff --git a/packages/deployer/src/context.ts b/packages/deployer/src/context.ts new file mode 100644 index 0000000..1d73320 --- /dev/null +++ b/packages/deployer/src/context.ts @@ -0,0 +1,24 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/deployer + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + */ + +/** Normalised project context shared across all deployment providers. */ +export interface DeployContext { + title: string; + outDir: string; + siteUrl: string | null; + hostname: string; + isSpa: boolean; + configFile: string | null; + version: string; +} \ No newline at end of file diff --git a/packages/deployer/src/index.ts b/packages/deployer/src/index.ts new file mode 100644 index 0000000..a50e604 --- /dev/null +++ b/packages/deployer/src/index.ts @@ -0,0 +1,99 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/deployer + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + */ + +import fs from 'node:fs/promises'; +import { readFileSync } from 'node:fs'; +import { resolve } from 'node:path'; +import { TUI } from '@docmd/api'; + +import type { DeployContext } from './context.js'; +import { generateDocker } from './providers/docker.js'; +import { generateNginx } from './providers/nginx.js'; +import { generateCaddy } from './providers/caddy.js'; +import { generateGithubPages } from './providers/github-pages.js'; +import { generateVercel } from './providers/vercel.js'; +import { generateNetlify } from './providers/netlify.js'; + +const pkgUrl = new URL('../package.json', import.meta.url); +const { version } = JSON.parse(readFileSync(pkgUrl, 'utf-8')); + +export interface DeployOpts { + docker?: boolean; + nginx?: boolean; + caddy?: boolean; + githubPages?: boolean; + vercel?: boolean; + netlify?: boolean; + force?: boolean; +} + +async function write(filePath: string, content: string, label: string, force?: boolean) { + // N-2: when --force is not set, do not overwrite an existing file. + // The deploy command was silently clobbering existing Docker / nginx / + // vercel / etc. configs on every run. The fix: skip with a clear + // TUI line and the existing content is preserved. Pass --force to + // overwrite. This makes the existing `--force` flag meaningful. + if (await fileExists(filePath) && !force) { + TUI.step(`${label} (already exists, skipped โ€” use --force to overwrite)`, 'SKIP', TUI.yellow); + return; + } + await fs.writeFile(filePath, content, 'utf8'); + TUI.step(label, 'DONE'); +} + +async function fileExists(filePath: string): Promise { + try { await fs.access(filePath); return true; } catch { return false; } +} + +export async function generateDeployConfigs(ctx: DeployContext, opts: DeployOpts): Promise { + const cwd = process.cwd(); + const force = opts.force === true; + + TUI.section('Deployment Context'); + TUI.item('Project', ctx.title); + TUI.item('Output', `${ctx.outDir}/`); + if (ctx.hostname) TUI.item('Host', ctx.hostname); + TUI.footer(); + + if (opts.docker) { + const hasNginxConf = opts.nginx || await fileExists(resolve(cwd, 'nginx.conf')); + const { dockerfile, dockerignore } = await generateDocker(ctx); + const df = hasNginxConf + ? dockerfile.replace('FROM nginx:alpine', 'FROM nginx:alpine\nCOPY nginx.conf /etc/nginx/conf.d/default.conf') + : dockerfile; + await write(resolve(cwd, 'Dockerfile'), df, 'Dockerfile', force); + await write(resolve(cwd, '.dockerignore'), dockerignore, '.dockerignore', force); + } + + if (opts.nginx) { + await write(resolve(cwd, 'nginx.conf'), generateNginx(ctx), 'nginx.conf', force); + } + + if (opts.caddy) { + await write(resolve(cwd, 'Caddyfile'), generateCaddy(ctx), 'Caddyfile', force); + } + + if (opts.githubPages) { + await fs.mkdir(resolve(cwd, '.github', 'workflows'), { recursive: true }); + await write(resolve(cwd, '.github', 'workflows', 'deploy.yml'), generateGithubPages(ctx), '.github/workflows/deploy.yml', force); + } + + if (opts.vercel) { + await write(resolve(cwd, 'vercel.json'), generateVercel(ctx), 'vercel.json', force); + } + + if (opts.netlify) { + await write(resolve(cwd, 'netlify.toml'), generateNetlify(ctx), 'netlify.toml', force); + } +} \ No newline at end of file diff --git a/packages/deployer/src/providers/caddy.ts b/packages/deployer/src/providers/caddy.ts new file mode 100644 index 0000000..aa56d90 --- /dev/null +++ b/packages/deployer/src/providers/caddy.ts @@ -0,0 +1,64 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/deployer + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + */ + +import type { DeployContext } from '../context.js'; + +export function generateCaddy(ctx: DeployContext): string { + const caddyAddress = ctx.hostname || ':80'; + const spaCaddyLine = ctx.isSpa + ? ' try_files {path} {path}/ /index.html' + : ' try_files {path} {path}/'; + + return `# --------------------------------------------------- +# Caddyfile generated by docmd v${ctx.version} +# Project: ${ctx.title} +# https://docmd.io/deployment/caddy +# --------------------------------------------------- + +${caddyAddress} { + root * ./${ctx.outDir} + file_server + + # SPA Routing Fallback +${spaCaddyLine} + + # Security headers + header { + X-Content-Type-Options "nosniff" + X-Frame-Options "SAMEORIGIN" + X-XSS-Protection "1; mode=block" + Referrer-Policy "strict-origin-when-cross-origin" + Permissions-Policy "camera=(), microphone=(), geolocation=()" + # HSTS (1 year). Only enable after verifying HTTPS works end-to-end. + # Strict-Transport-Security "max-age=31536000; includeSubDomains" + # CSP โ€” adjust if you embed third-party widgets or analytics. + Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; img-src 'self' data: https:; font-src 'self' data:; connect-src 'self'; frame-ancestors 'self'" + -Server + } + + # Custom 404 + handle_errors { + rewrite * /404.html + file_server + } + + # Cache Static Assets (6 months) + @static { + file + path *.ico *.css *.js *.gif *.jpg *.jpeg *.png *.webp *.avif *.svg *.woff *.woff2 *.eot *.ttf *.otf + } + header @static Cache-Control "public, max-age=15552000, immutable" +} +`; +} \ No newline at end of file diff --git a/packages/deployer/src/providers/docker.ts b/packages/deployer/src/providers/docker.ts new file mode 100644 index 0000000..11f0b2d --- /dev/null +++ b/packages/deployer/src/providers/docker.ts @@ -0,0 +1,64 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/deployer + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + */ + +import type { DeployContext } from '../context.js'; + +export async function generateDocker(ctx: DeployContext): Promise<{ dockerfile: string; dockerignore: string }> { + const buildCmd = ctx.configFile ? `docmd build --config ${ctx.configFile}` : 'docmd build'; + + const dockerfile = `# --------------------------------------------------- +# Dockerfile generated by docmd v${ctx.version} +# Project: ${ctx.title} +# https://docmd.io/deployment/docker +# --------------------------------------------------- + +# Stage 1: Build the docmd site +FROM node:22-alpine AS builder +WORKDIR /app + +# Copy dependency manifests first for optimal layer caching +COPY package*.json ./ +RUN if [ -f package.json ]; then npm install --ignore-scripts; fi + +# Copy the rest of the project +COPY . . + +# Install the exact docmd core version used to configure this deployment +RUN npm install -g @docmd/core@${ctx.version} + +# Build the site +RUN ${buildCmd} + +# Stage 2: Serve with nginx +FROM nginx:alpine +COPY --from=builder /app/${ctx.outDir} /usr/share/nginx/html +EXPOSE 80 +CMD ["nginx", "-g", "daemon off;"] +`; + + const dockerignore = `node_modules +${ctx.outDir} +dist +.git +.gitignore +.env +.env.* +*.md +!docs/**/*.md +.DS_Store +Thumbs.db +`; + + return { dockerfile, dockerignore }; +} \ No newline at end of file diff --git a/packages/deployer/src/providers/github-pages.ts b/packages/deployer/src/providers/github-pages.ts new file mode 100644 index 0000000..a1457a0 --- /dev/null +++ b/packages/deployer/src/providers/github-pages.ts @@ -0,0 +1,80 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/deployer + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + */ + +import type { DeployContext } from '../context.js'; + +export function generateGithubPages(ctx: DeployContext): string { + const buildCmd = ctx.configFile ? `docmd build --config ${ctx.configFile}` : 'docmd build'; + + return `# --------------------------------------------------- +# GitHub Pages Deployment Workflow +# Generated by docmd v${ctx.version} +# Project: ${ctx.title} +# https://docmd.io/deployment/github-pages +# --------------------------------------------------- + +name: Deploy to GitHub Pages + +on: + push: + branches: + - main + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: "pages" + cancel-in-progress: false + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: "20" + + - name: Install dependencies + run: npm install + + - name: Install docmd + run: npm install -g @docmd/core@${ctx.version} + + - name: Build site + run: ${buildCmd} + + - name: Upload Pages artifact + uses: actions/upload-pages-artifact@v3 + with: + path: ./${ctx.outDir} + + deploy: + environment: + name: github-pages + url: \${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 +`; +} \ No newline at end of file diff --git a/packages/deployer/src/providers/netlify.ts b/packages/deployer/src/providers/netlify.ts new file mode 100644 index 0000000..048bf2c --- /dev/null +++ b/packages/deployer/src/providers/netlify.ts @@ -0,0 +1,64 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/deployer + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + */ + +import type { DeployContext } from '../context.js'; + +export function generateNetlify(ctx: DeployContext): string { + // T-Z9: do NOT emit a `[[redirects]] from = "/*" status = 200` block. + // docmd generates real HTML files for every route (SPA mode is a thin + // client-side layer on top of pre-rendered HTML, not a single-page + // app served from /). A catch-all to /index.html with status 200 + // makes missing routes return 200 with the home page content โ€” a + // soft-404 that hides errors, hurts SEO, and creates a URL + // enumeration surface. Without the redirect, Netlify serves the + // generated file if it exists, or the bundled 404.html (with 404 + // status) if not. + return `# --------------------------------------------------- +# netlify.toml generated by docmd v${ctx.version} +# Project: ${ctx.title} +# https://docmd.io/deployment/netlify +# --------------------------------------------------- + +[build] + command = "npm install -g @docmd/core@${ctx.version} && docmd build" + publish = "${ctx.outDir}" + +[build.environment] + NODE_VERSION = "20" + +# Security headers applied to every response. +# HSTS is commented out โ€” enable it after verifying HTTPS works end-to-end. +# CSP: adjust default-src if you embed third-party widgets or analytics. +[[headers]] + for = "/*" + [headers.values] + X-Content-Type-Options = "nosniff" + X-Frame-Options = "SAMEORIGIN" + X-XSS-Protection = "1; mode=block" + Referrer-Policy = "strict-origin-when-cross-origin" + Permissions-Policy = "camera=(), microphone=(), geolocation=()" + Content-Security-Policy = "default-src 'self'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; img-src 'self' data: https:; font-src 'self' data:; connect-src 'self'; frame-ancestors 'self'" + # Strict-Transport-Security = "max-age=31536000; includeSubDomains" + +[[headers]] + for = "/assets/*" + [headers.values] + Cache-Control = "public, max-age=15552000, immutable" + +[[headers]] + for = "/*.html" + [headers.values] + Cache-Control = "public, max-age=0, must-revalidate" +`; +} \ No newline at end of file diff --git a/packages/deployer/src/providers/nginx.ts b/packages/deployer/src/providers/nginx.ts new file mode 100644 index 0000000..973bf51 --- /dev/null +++ b/packages/deployer/src/providers/nginx.ts @@ -0,0 +1,81 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/deployer + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + */ + +import type { DeployContext } from '../context.js'; + +export function generateNginx(ctx: DeployContext): string { + const serverName = ctx.hostname || 'localhost'; + const spaBlock = ctx.isSpa ? ` + # SPA Routing Fallback + location / { + try_files $uri $uri/ /index.html; + } +` : ` + location / { + try_files $uri $uri/ =404; + } +`; + + return `# --------------------------------------------------- +# nginx.conf generated by docmd v${ctx.version} +# Project: ${ctx.title} +# https://docmd.io/deployment/nginx +# --------------------------------------------------- + +server { + listen 80; + server_name ${serverName}; + root /usr/share/nginx/html; + index index.html; + + # Security headers + server_tokens off; + add_header X-Content-Type-Options "nosniff" always; + add_header X-Frame-Options "SAMEORIGIN" always; + add_header X-XSS-Protection "1; mode=block" always; + add_header Referrer-Policy "strict-origin-when-cross-origin" always; + add_header Permissions-Policy "camera=(), microphone=(), geolocation=()" always; + # HSTS (1 year). Only enable after verifying HTTPS works end-to-end. + # add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; + # CSP โ€” adjust 'default-src' if you embed third-party widgets or analytics. + add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; img-src 'self' data: https:; font-src 'self' data:; connect-src 'self'; frame-ancestors 'self'" always; + + # GZIP Compression + gzip on; + gzip_vary on; + gzip_proxied any; + gzip_min_length 256; + gzip_types + text/plain + text/css + application/json + application/javascript + text/xml + application/xml + application/xml+rss + text/javascript + image/svg+xml; +${spaBlock} + # Custom 404 + error_page 404 /404.html; + + # Cache Control for Static Assets + location ~* \\.(?:ico|css|js|gif|jpe?g|png|webp|avif|woff2?|eot|ttf|otf|svg)$ { + expires 6M; + access_log off; + add_header Cache-Control "public, immutable"; + } +} +`; +} \ No newline at end of file diff --git a/packages/deployer/src/providers/vercel.ts b/packages/deployer/src/providers/vercel.ts new file mode 100644 index 0000000..5930466 --- /dev/null +++ b/packages/deployer/src/providers/vercel.ts @@ -0,0 +1,60 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/deployer + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + */ + +import type { DeployContext } from '../context.js'; + +export function generateVercel(ctx: DeployContext): string { + const routes = ctx.isSpa + ? ` "routes": [ + { "handle": "filesystem" }, + { "src": "/(.*)", "dest": "/index.html" } + ]` + : ` "cleanUrls": true, + "trailingSlash": false`; + + return `{ + "$schema": "https://openapi.vercel.sh/vercel.json", + "buildCommand": "docmd build", + "outputDirectory": "${ctx.outDir}", + "installCommand": "npm install && npm install -g @docmd/core@${ctx.version}", + "framework": null, + "headers": [ + { + "source": "/(.*)", + "headers": [ + { "key": "X-Content-Type-Options", "value": "nosniff" }, + { "key": "X-Frame-Options", "value": "SAMEORIGIN" }, + { "key": "X-XSS-Protection", "value": "1; mode=block" }, + { "key": "Referrer-Policy", "value": "strict-origin-when-cross-origin" }, + { "key": "Permissions-Policy", "value": "camera=(), microphone=(), geolocation=()" }, + { "key": "Content-Security-Policy", "value": "default-src 'self'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; img-src 'self' data: https:; font-src 'self' data:; connect-src 'self'; frame-ancestors 'self'" } + ] + }, + { + "source": "/assets/(.*)", + "headers": [ + { "key": "Cache-Control", "value": "public, max-age=15552000, immutable" } + ] + }, + { + "source": "/(.*).html", + "headers": [ + { "key": "Cache-Control", "value": "public, max-age=0, must-revalidate" } + ] + } + ], +${routes} +} +`; +} \ No newline at end of file diff --git a/packages/deployer/tsconfig.json b/packages/deployer/tsconfig.json new file mode 100644 index 0000000..4dcf19b --- /dev/null +++ b/packages/deployer/tsconfig.json @@ -0,0 +1,10 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "outDir": "./dist", + "rootDir": "./src", + "strict": false + }, + "include": ["src/**/*"], + "exclude": ["node_modules", "dist"] +} \ No newline at end of file diff --git a/packages/engines/js/LICENSE b/packages/engines/js/LICENSE new file mode 100644 index 0000000..997bb73 --- /dev/null +++ b/packages/engines/js/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025-present docmd.io + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/packages/engines/js/README.md b/packages/engines/js/README.md new file mode 100644 index 0000000..26630f1 --- /dev/null +++ b/packages/engines/js/README.md @@ -0,0 +1,39 @@ +# @docmd/engine-js + +Default JavaScript engine for docmd using Node.js worker threads and native async I/O. Works everywhere without any native dependencies. + +Part of the **[docmd](https://github.com/docmd-io/docmd)** documentation engine. + +## Usage + +This engine is used by default when no `engine` configuration is specified: + +```javascript +// docmd.config.js +export default { + // No engine specified = uses 'js' engine +}; +``` + +Explicitly select the JS engine: + +```javascript +export default { + engine: 'js' +}; +``` + +## Capabilities + +- **file-discovery**: Parallel file system traversal +- **file-read-batch**: Batched file reading +- **git-log**: Git history extraction via `git` CLI +- **search-index**: Search index building with MiniSearch + +## Documentation + +See **[docs.docmd.io](https://docs.docmd.io)** for full usage and API reference. + +## License + +MIT \ No newline at end of file diff --git a/packages/engines/js/package.json b/packages/engines/js/package.json new file mode 100644 index 0000000..4c78eff --- /dev/null +++ b/packages/engines/js/package.json @@ -0,0 +1,51 @@ +{ + "name": "@docmd/engine-js", + "version": "0.8.12", + "description": "Default JavaScript engine for docmd using Node.js native APIs.", + "type": "module", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "exports": { + ".": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + }, + "scripts": { + "build": "tsc" + }, + "files": [ + "dist" + ], + "engines": { + "node": ">=18" + }, + "devDependencies": { + "@types/node": "^24.13.3" + }, + "keywords": [ + "docmd", + "engine", + "javascript", + "nodejs", + "minimalist", + "zero-config", + "site-generator", + "documentation", + "docs" + ], + "author": { + "name": "Ghazi", + "url": "https://mgks.dev" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/docmd-io/docmd.git" + }, + "bugs": { + "url": "https://github.com/docmd-io/docmd/issues" + }, + "homepage": "https://docmd.io", + "funding": "https://github.com/sponsors/mgks", + "license": "MIT" +} \ No newline at end of file diff --git a/packages/engines/js/src/index.ts b/packages/engines/js/src/index.ts new file mode 100644 index 0000000..a3ef7f0 --- /dev/null +++ b/packages/engines/js/src/index.ts @@ -0,0 +1,300 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/core (and ecosystem) + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + */ + +import * as fs from 'fs/promises'; +import * as path from 'path'; +import { execFile } from 'child_process'; +import { promisify } from 'util'; + +const execFileAsync = promisify(execFile); + +// --------------------------------------------------------------------------- +// Types - self-contained, no external dependencies +// --------------------------------------------------------------------------- + +export interface EngineTask { + type: string; + payload: any; + timeout?: number; +} + +export interface EngineResult { + success: boolean; + data?: T; + error?: string; + duration?: number; +} + +export interface Engine { + readonly name: string; + readonly version: string; + run(task: EngineTask): Promise>; + supports?(taskType: string): boolean; +} + +// --------------------------------------------------------------------------- +// Task Handlers +// --------------------------------------------------------------------------- + +type TaskHandler = (payload: any) => Promise; + +const SKIP_DIRS = new Set(['node_modules', '.git', '.docmd', 'dist', 'site']); + +const handlers: Record = { + + // --- File Operations --- + + 'file:discover': async ({ dir, extensions, exclude }) => { + const results: Array<{ path: string; size: number; mtimeMs: number }> = []; + const extSet = extensions ? new Set(extensions) : null; + const skipSet: Set = exclude ? new Set([...SKIP_DIRS, ...exclude]) : SKIP_DIRS; + + async function walk(currentDir: string): Promise { + let entries; + try { + entries = await fs.readdir(currentDir, { withFileTypes: true }); + } catch { + return; + } + await Promise.all(entries.map(async (entry) => { + const fullPath = path.join(currentDir, entry.name); + if (entry.isDirectory()) { + if (!skipSet.has(entry.name)) await walk(fullPath); + } else if (entry.isFile()) { + const ext = path.extname(entry.name).toLowerCase(); + if (!extSet || extSet.has(ext) || extSet.has(entry.name)) { + try { + const stat = await fs.stat(fullPath); + results.push({ path: fullPath, size: stat.size, mtimeMs: stat.mtimeMs }); + } catch { /* skip inaccessible files */ } + } + } + })); + } + + await walk(dir); + return results; + }, + + 'file:read': async ({ path: filePath }) => { + return fs.readFile(filePath, 'utf-8'); + }, + + 'file:readBatch': async ({ paths }) => { + const results: Record = {}; + await Promise.all((paths as string[]).map(async (p) => { + try { + results[p] = await fs.readFile(p, 'utf-8'); + } catch { + results[p] = ''; + } + })); + return results; + }, + + 'file:write': async ({ path: filePath, content }) => { + await fs.mkdir(path.dirname(filePath), { recursive: true }); + await fs.writeFile(filePath, content, 'utf-8'); + return { success: true }; + }, + + 'file:exists': async ({ path: filePath }) => { + try { + await fs.access(filePath); + return true; + } catch { + return false; + } + }, + + // --- Git Operations --- + + 'git:log': async ({ filePaths, maxCommits = 6 }) => { + const results: Record = {}; + await Promise.all((filePaths as string[]).map(async (filePath) => { + try { + const { stdout } = await execFileAsync('git', [ + 'log', '--follow', '-n', String(maxCommits), + '--format=%H|%h|%an|%ae|%at|%s', '--', filePath, + ], { cwd: process.cwd() }); + results[filePath] = stdout.trim() + ? stdout.trim().split('\n').map((line) => { + const [hash, shortHash, author, email, timestamp, ...msg] = line.split('|'); + return { hash, shortHash, author, email, timestamp: parseInt(timestamp, 10) * 1000, message: msg.join('|') }; + }) + : []; + } catch { + results[filePath] = []; + } + })); + return results; + }, + + 'git:status': async () => { + try { + const { stdout } = await execFileAsync('git', ['status', '--porcelain'], { cwd: process.cwd() }); + return stdout.trim().split('\n').filter(Boolean).map((line) => ({ + status: line.slice(0, 2).trim(), + path: line.slice(3), + })); + } catch { + return []; + } + }, + + // --- Search Operations --- + + 'search:index': async ({ documents }) => { + const index = { + documents: (documents as any[]).map((doc) => ({ + id: doc.id, + title: (doc.title as string).toLowerCase(), + content: (doc.content as string).toLowerCase().slice(0, 5000), + path: doc.path, + locale: doc.locale, + version: doc.version, + })), + builtAt: Date.now(), + }; + return JSON.stringify(index); + }, + + // โ”€โ”€ docmd-search semantic tasks โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ + + /** + * search:chunk โ€” Split a document into overlapping chunks by heading + word count. + * payload: { text, file, chunkSize?, chunkOverlap? } + * returns: Array<{ file, heading?, text, range: [start, end] }> + */ + 'search:chunk': async ({ text, file, chunkSize = 256, chunkOverlap = 32 }) => { + const chunks: Array<{ file: string; heading?: string; text: string; range: [number, number] }> = []; + let currentHeading: string | undefined; + let currentWords: string[] = []; + let currentStart = 0; + let bytePos = 0; + + for (const line of (text as string).split('\n')) { + const lineBytes = line.length + 1; + + if (/^#{1,6}\s/.test(line)) { + // Flush current chunk before heading + if (currentWords.length > 0) { + chunks.push({ file, heading: currentHeading, text: currentWords.join(' '), range: [currentStart, bytePos] }); + currentWords = currentWords.slice(-chunkOverlap); + currentStart = bytePos; + } + currentHeading = line.replace(/^#+\s*/, '').trim(); + } else { + const words = line.split(/\s+/).filter(Boolean); + currentWords.push(...words); + + if (currentWords.length >= chunkSize) { + chunks.push({ file, heading: currentHeading, text: currentWords.join(' '), range: [currentStart, bytePos + lineBytes] }); + currentWords = currentWords.slice(-chunkOverlap); + currentStart = bytePos; + } + } + + bytePos += lineBytes; + } + + if (currentWords.length > 0) { + chunks.push({ file, heading: currentHeading, text: currentWords.join(' '), range: [currentStart, bytePos] }); + } + + return chunks; + }, + + /** + * search:quantize โ€” Float32 โ†’ Int8 per-vector quantization. + * payload: { vectors: number[][], dimensions: number } + * returns: { quantized: number[][], mins: number[], ranges: number[] } + */ + 'search:quantize': async ({ vectors, dimensions = 384 }) => { + const quantized: number[][] = []; + const mins: number[] = []; + const ranges: number[] = []; + + for (const vec of (vectors as number[][])) { + const v = vec.length === dimensions ? vec : Array.from({ length: dimensions }, (_, i) => vec[i] ?? 0); + const min = Math.min(...v); + const max = Math.max(...v); + const range = Math.abs(max - min) < 1e-10 ? 1.0 : max - min; + + const q = v.map(x => Math.round(((x - min) / range) * 255 - 128)); + quantized.push(q); + mins.push(min); + ranges.push(range); + } + + return { quantized, mins, ranges }; + }, + + /** + * search:cosine โ€” Batch cosine similarity between a query vector and a corpus. + * payload: { query: number[], vectors: number[][], topK?: number } + * returns: Array<{ index: number, score: number }> + */ + 'search:cosine': async ({ query, vectors, topK = 10 }) => { + const q = query as number[]; + const qNorm = Math.sqrt(q.reduce((s: number, v: number) => s + v * v, 0)); + if (qNorm < 1e-10) return []; + + const scores = (vectors as number[][]).map((vec, idx) => { + const dot = q.reduce((s: number, v: number, i: number) => s + v * (vec[i] ?? 0), 0); + const vNorm = Math.sqrt(vec.reduce((s: number, v: number) => s + v * v, 0)); + const sim = vNorm < 1e-10 ? 0 : dot / (qNorm * vNorm); + return { index: idx, score: sim }; + }); + + return scores.sort((a, b) => b.score - a.score).slice(0, topK); + }, +}; + +// --------------------------------------------------------------------------- +// Engine Factory +// --------------------------------------------------------------------------- + +/** + * Create a JavaScript engine instance. + * + * The JS engine uses only Node.js built-in APIs โ€” no external dependencies, + * no native binaries. Works on every platform and Node.js version docmd supports. + */ +export function createJsEngine(): Engine { + return { + name: 'js', + version: '0.8.12', + + supports(taskType: string): boolean { + return taskType in handlers; + }, + + async run(task: EngineTask): Promise> { + const start = Date.now(); + try { + const handler = handlers[task.type]; + if (!handler) { + return { success: false, error: `Unknown task type: '${task.type}'`, duration: Date.now() - start }; + } + const data = await handler(task.payload); + return { success: true, data, duration: Date.now() - start }; + } catch (error) { + return { success: false, error: (error as Error).message, duration: Date.now() - start }; + } + }, + }; +} + +// Engine, EngineTask, and EngineResult are declared above as exported interfaces. diff --git a/packages/engines/js/tsconfig.json b/packages/engines/js/tsconfig.json new file mode 100644 index 0000000..3b7bf53 --- /dev/null +++ b/packages/engines/js/tsconfig.json @@ -0,0 +1,11 @@ +{ + "extends": "../../../tsconfig.base.json", + "compilerOptions": { + "rootDir": "src", + "outDir": "dist", + "declaration": true, + "declarationMap": true + }, + "include": ["src/**/*"], + "exclude": ["node_modules", "dist"] +} \ No newline at end of file diff --git a/packages/engines/rust-binaries/LICENSE b/packages/engines/rust-binaries/LICENSE new file mode 100644 index 0000000..997bb73 --- /dev/null +++ b/packages/engines/rust-binaries/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025-present docmd.io + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/packages/engines/rust-binaries/README.md b/packages/engines/rust-binaries/README.md new file mode 100644 index 0000000..9159b95 --- /dev/null +++ b/packages/engines/rust-binaries/README.md @@ -0,0 +1,55 @@ +# @docmd/engine-rust-binaries + +**Maintainer-only package.** Contains the Rust source code and pre-built native binaries for the docmd Rust engine. + +## Structure + +``` +native/ + Cargo.toml - Rust crate definition + build.rs - napi-rs build script + src/lib.rs - All Rust engine capabilities (edit this to add features) + +bin/ + docmd-engine-darwin-arm64.node - macOS Apple Silicon (753KB) + docmd-engine-darwin-x64.node - macOS Intel + docmd-engine-linux-x64.node - Linux x64 + docmd-engine-linux-arm64.node - Linux ARM64 + docmd-engine-win32-x64.node - Windows x64 +``` + +## For Maintainers + +### Adding new capabilities + +1. Edit `native/src/lib.rs` - add your new task handler +2. Run `pnpm --filter @docmd/engine-rust-binaries run build` +3. Commit the updated binary in `bin/` +4. The new capability is now available to all users + +### Building binaries + +```bash +# Build for current platform +pnpm --filter @docmd/engine-rust-binaries run build + +# You need to build on each platform: +# - macOS ARM64 (Apple Silicon Mac) +# - macOS x64 (Intel Mac) +# - Linux x64 +# - Linux ARM64 +# - Windows x64 +``` + +### How users get the binaries + +Users install `@docmd/engine-rust` (not this package). At install time, it downloads the appropriate binary from this repo's `bin/` directory on GitHub. + +## Not published to npm + +This package is `"private": true`. It exists only to: +1. Hold the Rust source code +2. Hold the pre-built binaries (committed to git) +3. Provide a build script for maintainers + +Users never install or interact with this package directly. diff --git a/packages/engines/rust-binaries/bin/docmd-engine-darwin-arm64.node b/packages/engines/rust-binaries/bin/docmd-engine-darwin-arm64.node new file mode 100755 index 0000000000000000000000000000000000000000..5218260e5909874773b6c442870bfa910b341e22 GIT binary patch literal 771536 zcmc${33yah((r$7ca}~91jq&i$%0D)2r2@JB&L&~gk@Yp6qlJvLS#%p!2m81H65a_ z4Z)=`F2KA)(0RvnYaAC)8E1wBT%x!T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e`MCn-h9Uukrr3|LgiXuWwAK z4{6>oRakRrBcIU5C;4*u!G=n7%kw&6O>md~!aK=nTQ}6%_{PoW@zqOyBs9LLRB|3& vd+Y0p;f7;dey`^LYAxR{KSVfozrCemSCL6N74KBQ+j{BbZ5rS98 fs.existsSync(f)); + +if (!builtFile) { + console.error(`Could not find compiled library in ${releaseDir}`); + process.exit(1); +} + +fs.mkdirSync(binDir, { recursive: true }); +fs.copyFileSync(builtFile, outputPath); + +const size = (fs.statSync(outputPath).size / 1024).toFixed(0); +console.log(`โœ“ Built: bin/${outputName} (${size}KB)`); +console.log(`\nCommit this file to the repo. Users will download it at install time.`); diff --git a/packages/engines/rust-binaries/native/Cargo.lock b/packages/engines/rust-binaries/native/Cargo.lock new file mode 100644 index 0000000..7a1df15 --- /dev/null +++ b/packages/engines/rust-binaries/native/Cargo.lock @@ -0,0 +1,362 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "aho-corasick" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddd31a130427c27518df266943a5308ed92d4b226cc639f5a8f1002816174301" +dependencies = [ + "memchr", +] + +[[package]] +name = "bitflags" +version = "2.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4512299f36f043ab09a583e57bceb5a5aab7a73db1805848e8fef3c9e8c78b3" + +[[package]] +name = "bytes" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e748733b7cbc798e1434b6ac524f0c1ff2ab456fe201501e6497c8417a4fc33" + +[[package]] +name = "cfg-if" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" + +[[package]] +name = "convert_case" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca" +dependencies = [ + "unicode-segmentation", +] + +[[package]] +name = "ctor" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a2785755761f3ddc1492979ce1e48d2c00d09311c39e4466429188f3dd6501" +dependencies = [ + "quote", + "syn", +] + +[[package]] +name = "docmd-engine" +version = "0.8.12" +dependencies = [ + "napi", + "napi-build", + "napi-derive", + "serde", + "serde_json", + "tokio", +] + +[[package]] +name = "errno" +version = "0.3.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" +dependencies = [ + "libc", + "windows-sys", +] + +[[package]] +name = "itoa" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" + +[[package]] +name = "libc" +version = "0.2.186" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66" + +[[package]] +name = "libloading" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7c4b02199fee7c5d21a5ae7d8cfa79a6ef5bb2fc834d6e9058e89c825efdc55" +dependencies = [ + "cfg-if", + "windows-link", +] + +[[package]] +name = "memchr" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79" + +[[package]] +name = "mio" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50b7e5b27aa02a74bac8c3f23f448f8d87ff11f92d3aac1a6ed369ee08cc56c1" +dependencies = [ + "libc", + "wasi", + "windows-sys", +] + +[[package]] +name = "napi" +version = "2.16.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55740c4ae1d8696773c78fdafd5d0e5fe9bc9f1b071c7ba493ba5c413a9184f3" +dependencies = [ + "bitflags", + "ctor", + "napi-derive", + "napi-sys", + "once_cell", + "tokio", +] + +[[package]] +name = "napi-build" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d376940fd5b723c6893cd1ee3f33abbfd86acb1cd1ec079f3ab04a2a3bc4d3b1" + +[[package]] +name = "napi-derive" +version = "2.16.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cbe2585d8ac223f7d34f13701434b9d5f4eb9c332cccce8dee57ea18ab8ab0c" +dependencies = [ + "cfg-if", + "convert_case", + "napi-derive-backend", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "napi-derive-backend" +version = "1.0.75" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1639aaa9eeb76e91c6ae66da8ce3e89e921cd3885e99ec85f4abacae72fc91bf" +dependencies = [ + "convert_case", + "once_cell", + "proc-macro2", + "quote", + "regex", + "semver", + "syn", +] + +[[package]] +name = "napi-sys" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "427802e8ec3a734331fec1035594a210ce1ff4dc5bc1950530920ab717964ea3" +dependencies = [ + "libloading", +] + +[[package]] +name = "once_cell" +version = "1.21.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50" + +[[package]] +name = "pin-project-lite" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" + +[[package]] +name = "proc-macro2" +version = "1.0.106" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "regex" +version = "1.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e10754a14b9137dd7b1e3e5b0493cc9171fdd105e0ab477f51b72e7f3ac0e276" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e1dd4122fc1595e8162618945476892eefca7b88c52820e74af6262213cae8f" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc897dd8d9e8bd1ed8cdad82b5966c3e0ecae09fb1907d58efaa013543185d0a" + +[[package]] +name = "semver" +version = "1.0.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd" + +[[package]] +name = "serde" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde_core" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.149" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86" +dependencies = [ + "itoa", + "memchr", + "serde", + "serde_core", + "zmij", +] + +[[package]] +name = "signal-hook-registry" +version = "1.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4db69cba1110affc0e9f7bcd48bbf87b3f4fc7c61fc9155afd4c469eb3d6c1b" +dependencies = [ + "errno", + "libc", +] + +[[package]] +name = "syn" +version = "2.0.117" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "tokio" +version = "1.52.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fc7f01b389ac15039e4dc9531aa973a135d7a4135281b12d7c1bc79fd57fffe" +dependencies = [ + "bytes", + "libc", + "mio", + "pin-project-lite", + "signal-hook-registry", + "tokio-macros", + "windows-sys", +] + +[[package]] +name = "tokio-macros" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "385a6cb71ab9ab790c5fe8d67f1645e6c450a7ce006a33de03daa956cf70a496" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "unicode-ident" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" + +[[package]] +name = "unicode-segmentation" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9629274872b2bfaf8d66f5f15725007f635594914870f65218920345aa11aa8c" + +[[package]] +name = "wasi" +version = "0.11.1+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" + +[[package]] +name = "windows-link" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" + +[[package]] +name = "windows-sys" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" +dependencies = [ + "windows-link", +] + +[[package]] +name = "zmij" +version = "1.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa" diff --git a/packages/engines/rust-binaries/native/Cargo.toml b/packages/engines/rust-binaries/native/Cargo.toml new file mode 100644 index 0000000..3013274 --- /dev/null +++ b/packages/engines/rust-binaries/native/Cargo.toml @@ -0,0 +1,32 @@ +[package] +name = "docmd-engine" +version = "0.8.12" +edition = "2021" +description = "Native Node.js addon for the docmd Rust engine" +license = "MIT" + +# napi-rs builds a cdylib (.node file loaded by Node.js via require()) +[lib] +crate-type = ["cdylib"] + +[dependencies] +# napi-rs: Rust โ†” Node.js bridge (N-API, ABI-stable across Node versions) +napi = { version = "2", features = ["async", "napi4"] } +napi-derive = "2" + +# Async runtime โ€” tokio powers all async tasks inside the addon +tokio = { version = "1", features = ["rt-multi-thread", "fs", "process", "macros"] } + +# Serialisation โ€” tasks arrive as JSON strings, results leave as JSON strings +serde = { version = "1", features = ["derive"] } +serde_json = "1" + +[build-dependencies] +napi-build = "2" + +# Release profile: optimise for speed and small binary size +[profile.release] +lto = true +codegen-units = 1 +opt-level = 3 +strip = true \ No newline at end of file diff --git a/packages/engines/rust-binaries/native/build.rs b/packages/engines/rust-binaries/native/build.rs new file mode 100644 index 0000000..52e917c --- /dev/null +++ b/packages/engines/rust-binaries/native/build.rs @@ -0,0 +1,17 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/core (and ecosystem) + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + */ + + fn main() { + napi_build::setup(); +} \ No newline at end of file diff --git a/packages/engines/rust-binaries/native/src/lib.rs b/packages/engines/rust-binaries/native/src/lib.rs new file mode 100644 index 0000000..a6741dd --- /dev/null +++ b/packages/engines/rust-binaries/native/src/lib.rs @@ -0,0 +1,236 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/core (and ecosystem) + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + */ + +use napi_derive::napi; +use serde::{Deserialize, Serialize}; +use serde_json::Value; +use std::collections::HashMap; +use std::path::Path; +use tokio::process::Command; + +type TaskResult = Result; + +// --------------------------------------------------------------------------- +// Entry point +// --------------------------------------------------------------------------- + +#[napi] +pub async fn run_task(task_type: String, payload_json: String) -> napi::Result { + let payload: Value = serde_json::from_str(&payload_json) + .map_err(|e| napi::Error::from_reason(format!("Invalid payload JSON: {e}")))?; + + let result: TaskResult = dispatch(&task_type, payload).await; + + match result { + Ok(data) => serde_json::to_string(&data) + .map_err(|e| napi::Error::from_reason(format!("Failed to serialise: {e}"))), + Err(msg) => Ok(format!(r#"{{"error":"{}"}}"#, msg.replace('"', "\\\""))), + } +} + +async fn dispatch(task_type: &str, payload: Value) -> TaskResult { + match task_type { + "file:discover" => file_discover(payload).await, + "file:read" => file_read(payload).await, + "file:readBatch" => file_read_batch(payload).await, + "file:write" => file_write(payload).await, + "file:exists" => file_exists(payload).await, + "git:log" => git_log(payload).await, + "git:status" => git_status(payload).await, + "search:index" => search_index(payload).await, + other => Err(format!("Unknown task type: '{other}'")), + } +} + +// --------------------------------------------------------------------------- +// file:discover +// --------------------------------------------------------------------------- + +#[derive(Serialize)] +struct FileEntry { path: String, size: u64, #[serde(rename = "mtimeMs")] mtime_ms: u64 } + +const SKIP_DIRS: &[&str] = &["node_modules", ".git", ".docmd", "dist", "site"]; + +async fn file_discover(payload: Value) -> TaskResult { + let dir = payload["dir"].as_str().ok_or_else(|| "file:discover: missing 'dir'".to_string())?; + let extensions: Option> = payload["extensions"].as_array() + .map(|a| a.iter().filter_map(|v| v.as_str().map(String::from)).collect()); + let exclude: Vec = payload["exclude"].as_array() + .map(|a| a.iter().filter_map(|v| v.as_str().map(String::from)).collect()) + .unwrap_or_default(); + + let mut results: Vec = Vec::new(); + walk_dir(Path::new(dir), &extensions, &exclude, &mut results).map_err(|e| format!("file:discover: {e}"))?; + serde_json::to_value(results).map_err(|e| e.to_string()) +} + +fn walk_dir(dir: &Path, extensions: &Option>, extra_skip: &[String], results: &mut Vec) -> std::io::Result<()> { + let entries = match std::fs::read_dir(dir) { Ok(e) => e, Err(_) => return Ok(()) }; + for entry in entries.flatten() { + let path = entry.path(); + let name_str = entry.file_name().to_string_lossy().to_string(); + if path.is_dir() { + if !SKIP_DIRS.contains(&name_str.as_str()) && !extra_skip.iter().any(|s| s == &name_str) { + walk_dir(&path, extensions, extra_skip, results)?; + } + } else if path.is_file() { + let include = match extensions { + None => true, + Some(exts) => { + let ext = path.extension().map(|e| format!(".{}", e.to_string_lossy())).unwrap_or_default(); + exts.iter().any(|e| e == &ext || e == &name_str) + } + }; + if include { + if let Ok(meta) = entry.metadata() { + let mtime_ms = meta.modified().ok().and_then(|t| t.duration_since(std::time::UNIX_EPOCH).ok()).map(|d| d.as_millis() as u64).unwrap_or(0); + results.push(FileEntry { path: path.to_string_lossy().into_owned(), size: meta.len(), mtime_ms }); + } + } + } + } + Ok(()) +} + +// --------------------------------------------------------------------------- +// file:read +// --------------------------------------------------------------------------- + +async fn file_read(payload: Value) -> TaskResult { + let file_path = payload["path"].as_str().ok_or_else(|| "file:read: missing 'path'".to_string())?; + let content = tokio::fs::read_to_string(file_path).await.map_err(|e| format!("file:read: {e}"))?; + Ok(Value::String(content)) +} + +// --------------------------------------------------------------------------- +// file:readBatch +// --------------------------------------------------------------------------- + +async fn file_read_batch(payload: Value) -> TaskResult { + let paths: Vec = payload["paths"].as_array() + .ok_or_else(|| "file:readBatch: missing 'paths'".to_string())? + .iter().filter_map(|v| v.as_str().map(String::from)).collect(); + + let mut handles = Vec::with_capacity(paths.len()); + for p in paths { + handles.push(tokio::spawn(async move { + let content = tokio::fs::read_to_string(&p).await.unwrap_or_default(); + (p, content) + })); + } + + let mut map = HashMap::new(); + for h in handles { + let (p, c) = h.await.map_err(|e| format!("file:readBatch: {e}"))?; + if !c.is_empty() { map.insert(p, c); } + } + serde_json::to_value(map).map_err(|e| e.to_string()) +} + +// --------------------------------------------------------------------------- +// file:write +// --------------------------------------------------------------------------- + +async fn file_write(payload: Value) -> TaskResult { + let file_path = payload["path"].as_str().ok_or_else(|| "file:write: missing 'path'".to_string())?; + let content = payload["content"].as_str().ok_or_else(|| "file:write: missing 'content'".to_string())?; + if let Some(parent) = Path::new(file_path).parent() { + tokio::fs::create_dir_all(parent).await.map_err(|e| format!("file:write mkdir: {e}"))?; + } + tokio::fs::write(file_path, content).await.map_err(|e| format!("file:write: {e}"))?; + Ok(serde_json::json!({ "success": true })) +} + +// --------------------------------------------------------------------------- +// file:exists +// --------------------------------------------------------------------------- + +async fn file_exists(payload: Value) -> TaskResult { + let file_path = payload["path"].as_str().ok_or_else(|| "file:exists: missing 'path'".to_string())?; + Ok(Value::Bool(tokio::fs::metadata(file_path).await.is_ok())) +} + +// --------------------------------------------------------------------------- +// git:log +// --------------------------------------------------------------------------- + +#[derive(Serialize)] +struct GitEntry { hash: String, #[serde(rename = "shortHash")] short_hash: String, author: String, email: String, timestamp: u64, message: String } + +async fn git_log(payload: Value) -> TaskResult { + let file_paths: Vec = payload["filePaths"].as_array() + .ok_or_else(|| "git:log: missing 'filePaths'".to_string())? + .iter().filter_map(|v| v.as_str().map(String::from)).collect(); + let max_commits = payload["maxCommits"].as_u64().unwrap_or(6); + + let mut handles = Vec::with_capacity(file_paths.len()); + for fp in file_paths { + let n = max_commits; + handles.push(tokio::spawn(async move { + let out = Command::new("git").args(["log", "--follow", "-n", &n.to_string(), "--format=%H|%h|%an|%ae|%at|%s", "--", &fp]).output().await; + let entries: Vec = match out { + Ok(o) if o.status.success() => { + String::from_utf8_lossy(&o.stdout).trim().lines().filter(|l| !l.is_empty()).map(|line| { + let parts: Vec<&str> = line.splitn(6, '|').collect(); + let ts = parts.get(4).and_then(|s| s.parse::().ok()).unwrap_or(0); + GitEntry { hash: parts.first().unwrap_or(&"").to_string(), short_hash: parts.get(1).unwrap_or(&"").to_string(), author: parts.get(2).unwrap_or(&"").to_string(), email: parts.get(3).unwrap_or(&"").to_string(), timestamp: ts * 1000, message: parts.get(5).unwrap_or(&"").to_string() } + }).collect() + } + _ => vec![], + }; + (fp, entries) + })); + } + + let mut map: HashMap> = HashMap::new(); + for h in handles { + let (fp, entries) = h.await.map_err(|e| format!("git:log: {e}"))?; + map.insert(fp, entries); + } + serde_json::to_value(map).map_err(|e| e.to_string()) +} + +// --------------------------------------------------------------------------- +// git:status +// --------------------------------------------------------------------------- + +async fn git_status(_payload: Value) -> TaskResult { + let out = Command::new("git").args(["status", "--porcelain"]).output().await.map_err(|e| format!("git:status: {e}"))?; + let entries: Vec = String::from_utf8_lossy(&out.stdout).lines().filter(|l| !l.is_empty()).map(|line| { + let status = if line.len() >= 2 { line[..2].trim() } else { "" }; + let path = if line.len() > 3 { &line[3..] } else { "" }; + serde_json::json!({ "status": status, "path": path }) + }).collect(); + Ok(Value::Array(entries)) +} + +// --------------------------------------------------------------------------- +// search:index +// --------------------------------------------------------------------------- + +#[derive(Deserialize)] +struct SearchDoc { id: String, title: String, content: String, path: String, locale: Option, version: Option } + +#[derive(Serialize)] +struct IndexedDoc { id: String, title: String, content: String, path: String, #[serde(skip_serializing_if = "Option::is_none")] locale: Option, #[serde(skip_serializing_if = "Option::is_none")] version: Option } + +async fn search_index(payload: Value) -> TaskResult { + let docs: Vec = serde_json::from_value(payload["documents"].clone()).map_err(|e| format!("search:index: {e}"))?; + let indexed: Vec = docs.into_iter().map(|doc| IndexedDoc { + id: doc.id, title: doc.title.to_lowercase(), content: doc.content.to_lowercase().chars().take(5000).collect(), path: doc.path, locale: doc.locale, version: doc.version, + }).collect(); + let result = serde_json::json!({ "documents": indexed, "builtAt": std::time::SystemTime::now().duration_since(std::time::UNIX_EPOCH).map(|d| d.as_millis() as u64).unwrap_or(0) }); + let s = serde_json::to_string(&result).map_err(|e| e.to_string())?; + Ok(Value::String(s)) +} \ No newline at end of file diff --git a/packages/engines/rust-binaries/package.json b/packages/engines/rust-binaries/package.json new file mode 100644 index 0000000..db05018 --- /dev/null +++ b/packages/engines/rust-binaries/package.json @@ -0,0 +1,41 @@ +{ + "name": "@docmd/engine-rust-binaries", + "version": "0.8.12", + "description": "Pre-built Rust binaries for the docmd engine. All platforms bundled.", + "scripts": { + "build": "node build.js" + }, + "files": [ + "bin" + ], + "engines": { + "node": ">=18" + }, + "keywords": [ + "docmd", + "engine", + "rust", + "binaries", + "native", + "markdown", + "minimalist", + "zero-config", + "site-generator", + "documentation", + "docs" + ], + "author": { + "name": "Ghazi", + "url": "https://mgks.dev" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/docmd-io/docmd.git" + }, + "bugs": { + "url": "https://github.com/docmd-io/docmd/issues" + }, + "homepage": "https://docmd.io", + "funding": "https://github.com/sponsors/mgks", + "license": "MIT" +} \ No newline at end of file diff --git a/packages/engines/rust/LICENSE b/packages/engines/rust/LICENSE new file mode 100644 index 0000000..997bb73 --- /dev/null +++ b/packages/engines/rust/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025-present docmd.io + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/packages/engines/rust/README.md b/packages/engines/rust/README.md new file mode 100644 index 0000000..d565bf3 --- /dev/null +++ b/packages/engines/rust/README.md @@ -0,0 +1,54 @@ +# @docmd/engine-rust + +Rust-accelerated engine for docmd with native I/O and parallel processing. Provides significant performance improvements for large documentation sites. + +Part of the **[docmd](https://github.com/docmd-io/docmd)** documentation engine. + +## Installation + +The Rust engine is optional and installed on-demand. To use it: + +```javascript +// docmd.config.js +export default { + engine: 'rust' +}; +``` + +On first run, docmd will prompt you to install the appropriate native binary for your platform. + +## Supported Platforms + +| Platform | Package | +|----------|---------| +| macOS (ARM64) | `@docmd/engine-rust-darwin-arm64` | +| macOS (x64) | `@docmd/engine-rust-darwin-x64` | +| Linux (x64, glibc) | `@docmd/engine-rust-linux-x64-gnu` | +| Linux (ARM64, glibc) | `@docmd/engine-rust-linux-arm64-gnu` | +| Windows (x64) | `@docmd/engine-rust-win32-x64-msvc` | + +## Capabilities + +- **file-discovery**: Parallel directory traversal with native filesystem APIs +- **file-read-batch**: Memory-mapped file reading for large batches +- **git-log**: Direct libgit2 integration (no git CLI required) +- **search-index**: SIMD-accelerated text processing + +## When to Use + +The Rust engine is recommended for: + +- Large documentation sites (1000+ pages) +- Projects with extensive Git history +- Multi-project monorepo builds +- CI/CD pipelines where build time is critical + +For smaller sites or development mode, the default JS engine may be more convenient. + +## Documentation + +See **[docs.docmd.io](https://docs.docmd.io)** for full usage and API reference. + +## License + +MIT \ No newline at end of file diff --git a/packages/engines/rust/package.json b/packages/engines/rust/package.json new file mode 100644 index 0000000..1434b01 --- /dev/null +++ b/packages/engines/rust/package.json @@ -0,0 +1,56 @@ +{ + "name": "@docmd/engine-rust", + "version": "0.8.12", + "description": "Rust-accelerated engine for docmd. The postinstall script downloads a pre-built platform binary from npm CDN (unpkg/jsdelivr). No code is executed beyond copying the .node file. Source: https://github.com/docmd-io/docmd", + "type": "module", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "exports": { + ".": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + }, + "scripts": { + "build": "tsc", + "postinstall": "node scripts/postinstall.cjs" + }, + "files": [ + "dist", + "scripts", + "bin" + ], + "engines": { + "node": ">=18" + }, + "devDependencies": { + "@types/node": "^24.13.3" + }, + "keywords": [ + "docmd", + "engine", + "rust", + "native", + "performance", + "markdown", + "minimalist", + "zero-config", + "site-generator", + "documentation", + "docs" + ], + "author": { + "name": "Ghazi", + "url": "https://mgks.dev" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/docmd-io/docmd.git" + }, + "bugs": { + "url": "https://github.com/docmd-io/docmd/issues" + }, + "homepage": "https://docmd.io", + "funding": "https://github.com/sponsors/mgks", + "license": "MIT" +} \ No newline at end of file diff --git a/packages/engines/rust/scripts/postinstall.cjs b/packages/engines/rust/scripts/postinstall.cjs new file mode 100644 index 0000000..b061f08 --- /dev/null +++ b/packages/engines/rust/scripts/postinstall.cjs @@ -0,0 +1,118 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/core (and ecosystem) + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + */ + +'use strict'; + +const https = require('https'); +const fs = require('fs'); +const path = require('path'); + +const PLATFORM_MAP = { + 'darwin-arm64': 'docmd-engine-darwin-arm64.node', + 'darwin-x64': 'docmd-engine-darwin-x64.node', + 'linux-x64': 'docmd-engine-linux-x64.node', + 'linux-arm64': 'docmd-engine-linux-arm64.node', + 'win32-x64': 'docmd-engine-win32-x64.node', +}; + +const platformId = `${process.platform}-${process.arch}`; +const binaryName = PLATFORM_MAP[platformId]; + +// This script only downloads a pre-built .node binary from npm CDN +// (unpkg / jsdelivr) for your platform. Source: https://github.com/docmd-io/docmd +// You can safely approve it with: npm approve-scripts @docmd/engine-rust +if (!binaryName) { + console.warn(`[@docmd/engine-rust] Unsupported platform: ${platformId}`); + console.warn(`Supported: ${Object.keys(PLATFORM_MAP).join(', ')}`); + console.warn(`The JS engine will be used as fallback.`); + process.exit(0); +} + +const pkgDir = path.join(__dirname, '..'); +const binDir = path.join(pkgDir, 'bin'); +const binaryPath = path.join(binDir, binaryName); + +// Get version from this package's package.json +const version = require(path.join(pkgDir, 'package.json')).version; + +// Skip if already present +if (fs.existsSync(binaryPath)) { + console.log(`[@docmd/engine-rust] Binary already present: ${binaryName}`); + process.exit(0); +} + +// Download URLs with exact version (npm CDNs) +const URLS = [ + // unpkg (npm CDN) - exact version + `https://unpkg.com/@docmd/engine-rust-binaries@${version}/bin/${binaryName}`, + // jsdelivr (npm CDN) - exact version + `https://cdn.jsdelivr.net/npm/@docmd/engine-rust-binaries@${version}/bin/${binaryName}`, +]; + +function download(url) { + return new Promise((resolve, reject) => { + const follow = (url, redirects = 0) => { + if (redirects > 5) return reject(new Error('Too many redirects')); + + const proto = url.startsWith('https') ? https : require('http'); + proto.get(url, { headers: { 'User-Agent': 'docmd-engine-rust' } }, (res) => { + if (res.statusCode === 301 || res.statusCode === 302 || res.statusCode === 307) { + return follow(res.headers.location, redirects + 1); + } + if (res.statusCode !== 200) { + res.resume(); + return reject(new Error(`HTTP ${res.statusCode}`)); + } + + fs.mkdirSync(binDir, { recursive: true }); + const tmp = binaryPath + '.tmp'; + const out = fs.createWriteStream(tmp); + + res.pipe(out); + out.on('finish', () => { + fs.renameSync(tmp, binaryPath); + fs.chmodSync(binaryPath, 0o755); + resolve(); + }); + out.on('error', (err) => { + fs.rmSync(tmp, { force: true }); + reject(err); + }); + }).on('error', reject); + }; + follow(url); + }); +} + +async function main() { + console.log(`[@docmd/engine-rust] Downloading ${binaryName} (v${version})โ€ฆ`); + + for (const url of URLS) { + try { + await download(url); + const size = (fs.statSync(binaryPath).size / 1024).toFixed(0); + console.log(`[@docmd/engine-rust] โœ“ Downloaded (${size}KB)`); + return; + } catch (err) { + // Try next URL + } + } + + console.warn(`[@docmd/engine-rust] Could not download binary for v${version}.`); + console.warn(`This version may not be published yet.`); + console.warn(`The JS engine will be used as fallback.`); + // Exit 0 so pnpm install doesn't fail +} + +main(); diff --git a/packages/engines/rust/src/index.ts b/packages/engines/rust/src/index.ts new file mode 100644 index 0000000..752b93a --- /dev/null +++ b/packages/engines/rust/src/index.ts @@ -0,0 +1,155 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/core (and ecosystem) + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + */ + +import { createRequire } from 'module'; +import * as path from 'path'; +import * as fs from 'fs'; +import { fileURLToPath } from 'url'; + +const __dirname = path.dirname(fileURLToPath(import.meta.url)); +const require = createRequire(import.meta.url); + +// --------------------------------------------------------------------------- +// Types +// --------------------------------------------------------------------------- + +export interface EngineTask { + type: string; + payload: any; + timeout?: number; +} + +export interface EngineResult { + success: boolean; + data?: T; + error?: string; + duration?: number; +} + +export interface Engine { + readonly name: string; + readonly version: string; + run(task: EngineTask): Promise>; + supports?(taskType: string): boolean; +} + +// --------------------------------------------------------------------------- +// Platform Detection +// --------------------------------------------------------------------------- + +type PlatformId = 'darwin-arm64' | 'darwin-x64' | 'linux-x64' | 'linux-arm64' | 'win32-x64'; + +const SUPPORTED: PlatformId[] = ['darwin-arm64', 'darwin-x64', 'linux-x64', 'linux-arm64', 'win32-x64']; + +const BINARY_NAMES: Record = { + 'darwin-arm64': 'docmd-engine-darwin-arm64.node', + 'darwin-x64': 'docmd-engine-darwin-x64.node', + 'linux-x64': 'docmd-engine-linux-x64.node', + 'linux-arm64': 'docmd-engine-linux-arm64.node', + 'win32-x64': 'docmd-engine-win32-x64.node', +}; + +function detectPlatform(): PlatformId | null { + const id = `${process.platform}-${process.arch}` as PlatformId; + return SUPPORTED.includes(id) ? id : null; +} + +// --------------------------------------------------------------------------- +// Binary Loading +// --------------------------------------------------------------------------- + +function resolveBinaryPath(platformId: PlatformId): string { + const name = BINARY_NAMES[platformId]; + // bin/ is sibling to dist/ (both under package root) + const pkgRoot = path.join(__dirname, '..'); + const binaryPath = path.join(pkgRoot, 'bin', name); + + if (!fs.existsSync(binaryPath)) { + throw new Error( + `Rust engine binary not found: ${binaryPath}\n\n` + + `Run: pnpm --filter @docmd/engine-rust run postinstall\n` + + `Or the JS engine will be used as fallback.` + ); + } + + return binaryPath; +} + +interface NativeBindings { + runTask(taskType: string, payloadJson: string): Promise; +} + +let _binding: NativeBindings | null = null; + +function loadBinding(platformId: PlatformId): NativeBindings { + if (_binding) return _binding; + const binaryPath = resolveBinaryPath(platformId); + _binding = require(binaryPath) as NativeBindings; + return _binding; +} + +// --------------------------------------------------------------------------- +// Public API +// --------------------------------------------------------------------------- + +export function isRustEngineAvailable(): boolean { + const platformId = detectPlatform(); + if (!platformId) return false; + try { + const name = BINARY_NAMES[platformId]; + const pkgRoot = path.join(__dirname, '..'); + return fs.existsSync(path.join(pkgRoot, 'bin', name)); + } catch { + return false; + } +} + +export function createRustEngine(): Engine { + const platformId = detectPlatform(); + + if (!platformId) { + throw new Error( + `Rust engine not supported on ${process.platform}-${process.arch}.\n` + + `Supported: ${SUPPORTED.join(', ')}` + ); + } + + const binding = loadBinding(platformId); + + return { + name: 'rust', + version: '0.8.12', + + supports(_taskType: string): boolean { + return true; + }, + + async run(task: EngineTask): Promise> { + const start = Date.now(); + try { + const raw = await binding.runTask(task.type, JSON.stringify(task.payload)); + const data = JSON.parse(raw) as T; + + // Check if Rust returned an error object + if (data && typeof data === 'object' && 'error' in data) { + return { success: false, error: (data as any).error, duration: Date.now() - start }; + } + + return { success: true, data, duration: Date.now() - start }; + } catch (error) { + return { success: false, error: (error as Error).message, duration: Date.now() - start }; + } + }, + }; +} diff --git a/packages/engines/rust/tsconfig.json b/packages/engines/rust/tsconfig.json new file mode 100644 index 0000000..3b7bf53 --- /dev/null +++ b/packages/engines/rust/tsconfig.json @@ -0,0 +1,11 @@ +{ + "extends": "../../../tsconfig.base.json", + "compilerOptions": { + "rootDir": "src", + "outDir": "dist", + "declaration": true, + "declarationMap": true + }, + "include": ["src/**/*"], + "exclude": ["node_modules", "dist"] +} \ No newline at end of file diff --git a/packages/legacy/doc.md/LICENSE b/packages/legacy/doc.md/LICENSE new file mode 100644 index 0000000..997bb73 --- /dev/null +++ b/packages/legacy/doc.md/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025-present docmd.io + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/packages/legacy/doc.md/README.md b/packages/legacy/doc.md/README.md new file mode 100644 index 0000000..6cdd8f1 --- /dev/null +++ b/packages/legacy/doc.md/README.md @@ -0,0 +1,21 @@ +# doc.md + +> **This package has moved.** Use **[@docmd/core](https://www.npmjs.com/package/@docmd/core)** for all future updates. + +This is a legacy wrapper that forwards commands to `@docmd/core` to avoid breaking existing CI/CD pipelines. This package will not receive new features or updates. + +## Migration + +```bash +# Remove the old package +npm uninstall -g doc.md + +# Install the current package +npm install -g @docmd/core +``` + +See **[docmd.io](https://docmd.io)** for full documentation. + +## License + +MIT \ No newline at end of file diff --git a/packages/legacy/doc.md/bin/docmd.js b/packages/legacy/doc.md/bin/docmd.js new file mode 100644 index 0000000..0463b5b --- /dev/null +++ b/packages/legacy/doc.md/bin/docmd.js @@ -0,0 +1,24 @@ +#!/usr/bin/env node + +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/core (and ecosystem) + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + */ + +const pkgName = (() => { try { return require('../package.json').name; } catch { return 'this package'; } })(); +console.error('\x1b[33m%s\x1b[0m', 'โš ๏ธ DEPRECATION NOTICE:'); +console.error('\x1b[33m%s\x1b[0m', ` You are using the legacy package "${pkgName}".`); +console.error('\x1b[33m%s\x1b[0m', ' Please uninstall it and install "@docmd/core" for future updates.'); +console.error('\x1b[33m%s\x1b[0m', ' Redirecting to new engine...\n'); + +// Pass control to the core binary +require('@docmd/core/bin/docmd.js'); \ No newline at end of file diff --git a/packages/legacy/doc.md/package.json b/packages/legacy/doc.md/package.json new file mode 100644 index 0000000..1f296a1 --- /dev/null +++ b/packages/legacy/doc.md/package.json @@ -0,0 +1,47 @@ +{ + "name": "doc.md", + "version": "0.8.12", + "description": "Discontinued. Legacy wrapper for docmd. Please use @docmd/core.", + "bin": { + "docmd": "bin/docmd.js" + }, + "engines": { + "node": ">=18" + }, + "dependencies": { + "@docmd/core": "workspace:*" + }, + "keywords": [ + "docmd", + "markdown", + "minimalist", + "zero-config", + "site-generator", + "static-site-generator", + "documentation", + "typescript", + "javascript", + "nodejs", + "browser", + "website", + "generator", + "hosted", + "cli", + "ssg", + "docs" + ], + "author": { + "name": "Ghazi", + "url": "https://mgks.dev" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/docmd-io/docmd.git" + }, + "bugs": { + "url": "https://github.com/docmd-io/docmd/issues" + }, + "homepage": "https://docmd.io", + "funding": "https://github.com/sponsors/mgks", + "license": "MIT" +} \ No newline at end of file diff --git a/packages/legacy/mgks/LICENSE b/packages/legacy/mgks/LICENSE new file mode 100644 index 0000000..997bb73 --- /dev/null +++ b/packages/legacy/mgks/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025-present docmd.io + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/packages/legacy/mgks/README.md b/packages/legacy/mgks/README.md new file mode 100644 index 0000000..c50d3ea --- /dev/null +++ b/packages/legacy/mgks/README.md @@ -0,0 +1,21 @@ +# @mgks/docmd + +> **This package has moved.** Use **[@docmd/core](https://www.npmjs.com/package/@docmd/core)** for all future updates. + +This is a legacy wrapper that forwards commands to `@docmd/core` to avoid breaking existing CI/CD pipelines. This package will not receive new features or updates. + +## Migration + +```bash +# Remove the old package +npm uninstall -g @mgks/docmd + +# Install the current package +npm install -g @docmd/core +``` + +See **[docs.docmd.io](https://docs.docmd.io)** for full documentation. + +## License + +MIT \ No newline at end of file diff --git a/packages/legacy/mgks/bin/docmd.js b/packages/legacy/mgks/bin/docmd.js new file mode 100755 index 0000000..0463b5b --- /dev/null +++ b/packages/legacy/mgks/bin/docmd.js @@ -0,0 +1,24 @@ +#!/usr/bin/env node + +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/core (and ecosystem) + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + */ + +const pkgName = (() => { try { return require('../package.json').name; } catch { return 'this package'; } })(); +console.error('\x1b[33m%s\x1b[0m', 'โš ๏ธ DEPRECATION NOTICE:'); +console.error('\x1b[33m%s\x1b[0m', ` You are using the legacy package "${pkgName}".`); +console.error('\x1b[33m%s\x1b[0m', ' Please uninstall it and install "@docmd/core" for future updates.'); +console.error('\x1b[33m%s\x1b[0m', ' Redirecting to new engine...\n'); + +// Pass control to the core binary +require('@docmd/core/bin/docmd.js'); \ No newline at end of file diff --git a/packages/legacy/mgks/package.json b/packages/legacy/mgks/package.json new file mode 100644 index 0000000..aee9655 --- /dev/null +++ b/packages/legacy/mgks/package.json @@ -0,0 +1,47 @@ +{ + "name": "@mgks/docmd", + "version": "0.8.12", + "description": "Discontinued. Legacy wrapper for docmd. Please use @docmd/core.", + "bin": { + "docmd": "bin/docmd.js" + }, + "engines": { + "node": ">=18" + }, + "dependencies": { + "@docmd/core": "workspace:*" + }, + "keywords": [ + "docmd", + "markdown", + "minimalist", + "zero-config", + "site-generator", + "static-site-generator", + "documentation", + "typescript", + "javascript", + "nodejs", + "browser", + "website", + "generator", + "hosted", + "cli", + "ssg", + "docs" + ], + "author": { + "name": "Ghazi", + "url": "https://mgks.dev" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/docmd-io/docmd.git" + }, + "bugs": { + "url": "https://github.com/docmd-io/docmd/issues" + }, + "homepage": "https://docmd.io", + "funding": "https://github.com/sponsors/mgks", + "license": "MIT" +} \ No newline at end of file diff --git a/packages/live/LICENSE b/packages/live/LICENSE new file mode 100644 index 0000000..997bb73 --- /dev/null +++ b/packages/live/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025-present docmd.io + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/packages/live/README.md b/packages/live/README.md new file mode 100644 index 0000000..40855c7 --- /dev/null +++ b/packages/live/README.md @@ -0,0 +1,28 @@ +# @docmd/live + +The browser-based bundle that powers the docmd Live Editor - packages the core parser, UI, and themes into a single standalone script that renders documentation client-side without a Node.js server. + +**Live demo:** **[live.docmd.io](https://live.docmd.io)** + +## Quick start + +```bash +# Run the editor locally +docmd live +``` + +```js +// Embed the editor engine in your own tooling +import { buildLive } from '@docmd/core'; +await buildLive(); +``` + +Part of the **[docmd](https://github.com/docmd-io/docmd)** documentation engine. + +## Documentation + +See **[docs.docmd.io](https://docs.docmd.io)** for full usage and API reference. + +## License + +MIT \ No newline at end of file diff --git a/packages/live/bin/docmd-live.js b/packages/live/bin/docmd-live.js new file mode 100755 index 0000000..1270b63 --- /dev/null +++ b/packages/live/bin/docmd-live.js @@ -0,0 +1,18 @@ +#!/usr/bin/env node + +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/core (and ecosystem) + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + */ + +import { start } from '../dist/index.js'; +start(); \ No newline at end of file diff --git a/packages/live/package.json b/packages/live/package.json new file mode 100644 index 0000000..2697262 --- /dev/null +++ b/packages/live/package.json @@ -0,0 +1,68 @@ +{ + "name": "@docmd/live", + "version": "0.8.12", + "description": "Browser-based editor engine for docmd.", + "type": "module", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "exports": { + ".": "./dist/index.js" + }, + "bin": { + "docmd-live": "bin/docmd-live.js" + }, + "scripts": { + "build": "tsc && node ./dist/build.js" + }, + "files": [ + "bin", + "dist", + "public", + "src" + ], + "engines": { + "node": ">=18" + }, + "dependencies": { + "@docmd/parser": "workspace:*", + "@docmd/plugin-math": "workspace:*", + "@docmd/plugin-mermaid": "workspace:*", + "@docmd/themes": "workspace:*", + "@docmd/tui": "workspace:*", + "@docmd/ui": "workspace:*", + "buffer": "^6.0.3", + "esbuild": "^0.28.1", + "katex": "^0.17.0", + "markdown-it-texmath": "^1.0.0" + }, + "devDependencies": { + "@docmd/api": "workspace:*", + "@types/node": "^24.13.3" + }, + "keywords": [ + "docmd", + "editor", + "browser", + "live", + "parser", + "markdown", + "minimalist", + "zero-config", + "site-generator", + "docs" + ], + "author": { + "name": "Ghazi", + "url": "https://mgks.dev" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/docmd-io/docmd.git" + }, + "bugs": { + "url": "https://github.com/docmd-io/docmd/issues" + }, + "homepage": "https://docmd.io", + "funding": "https://github.com/sponsors/mgks", + "license": "MIT" +} \ No newline at end of file diff --git a/packages/live/src/browser-entry.ts b/packages/live/src/browser-entry.ts new file mode 100644 index 0000000..9c690f0 --- /dev/null +++ b/packages/live/src/browser-entry.ts @@ -0,0 +1,132 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/core (and ecosystem) + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + */ + +import { createMarkdownProcessor, processContent } from '@docmd/parser/dist/markdown-processor.js'; +import texmath from 'markdown-it-texmath'; +import katex from 'katex'; +// @ts-expect-error virtual module +import templates from 'virtual:docmd-templates'; + +// Expose the compile function to the window.docmd global +async function compile(markdown: string, config: any = {}) { + const defaults: any = { + siteTitle: 'Live Preview', + theme: { appearance: 'light', name: 'default', codeHighlight: true }, + layout: { spa: false }, + ...config + }; + + // 1. Process Markdown with Plugin Support + const md = createMarkdownProcessor(defaults, (parser) => { + // Math (KaTeX) + parser.use(texmath, { engine: katex, delimiters: 'dollars' }); + + // Mermaid fence override + const defaultFence = parser.renderer.rules.fence; + parser.renderer.rules.fence = (tokens, idx, options, env, self) => { + const info = tokens[idx].info.trim(); + if (info === 'mermaid') { + return `

\n`; + } + return defaultFence(tokens, idx, options, env, self); + }; + }); + const result = processContent(markdown, md, defaults); + + if (!result) return '

Error parsing markdown

'; + + // Since we are in the browser, we assume assets are served at ./assets/ + const assetsRoot = './assets'; + const appearance = defaults.theme.appearance || 'light'; + + // Theme init script โ€” handles DOCMD_APPEARANCE + safe localStorage + const themeInitScript = templates['partials/theme-init.js'] || ''; + + // KaTeX stylesheet (theme tokens come from docmd-main.css) + const katexCss = ``; + + // Mermaid init โ€” runs in the preview iframe, picks up the current theme + const mermaidScript = ` + + `; + + // Minimal interactivity for the preview iframe. docmd-main.js is not + // loaded here (we stripped the chrome), so tab switching has to be + // wired here. Collapsibles use native
, so they need no JS. + const interactivityScript = ` + + + + + ${katexCss} + + + +${result.htmlContent} +${interactivityScript} +${mermaidScript} + +`; +} + +export { compile }; \ No newline at end of file diff --git a/packages/live/src/build.ts b/packages/live/src/build.ts new file mode 100644 index 0000000..82b960e --- /dev/null +++ b/packages/live/src/build.ts @@ -0,0 +1,188 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/core (and ecosystem) + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + */ + +import path from 'path'; +import fs from 'fs/promises'; +import esbuild from 'esbuild'; +import * as ui from '@docmd/ui'; +import * as themes from '@docmd/themes'; +import { fileURLToPath } from 'url'; +import { createRequire } from 'module'; +import { TUI } from '@docmd/tui'; + +const require = createRequire(import.meta.url); +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); + +// Path Constants +const PKG_ROOT = path.resolve(__dirname, '..'); +const PUBLIC_DIR = path.join(PKG_ROOT, 'public'); + +// Asset Discovery +const SOURCE_ASSETS_DIR = (async () => { + const srcPath = path.join(PKG_ROOT, 'src'); + try { + await fs.access(srcPath); + return srcPath; + } catch { + return __dirname; + } +})(); + +async function build(outputPath?: string) { + const elapsed = TUI.timer(); + const sp = TUI.spinner('Building Live Editor'); + + const finalOutputDir = outputPath ? path.join(outputPath, 'dist') : PUBLIC_DIR; + + try { + // 1. Prepare Dist + await fs.rm(finalOutputDir, { recursive: true, force: true }); + await fs.mkdir(finalOutputDir, { recursive: true }); + + // 2. Generate Shims + const assetsDir = await SOURCE_ASSETS_DIR; + const shimPath = path.join(__dirname, 'shims.js'); + await fs.writeFile(shimPath, `import { Buffer } from 'buffer'; globalThis.Buffer = Buffer;`); + + // 3. Template Plugin + const templatePlugin = { + name: 'docmd-templates', + setup(build) { + build.onResolve({ filter: /^virtual:docmd-templates$/ }, args => ({ + path: args.path, namespace: 'docmd-templates-ns', + })); + build.onLoad({ filter: /.*/, namespace: 'docmd-templates-ns' }, async () => { + const templatesDir = ui.getTemplatesDir(); + const templates = {}; + const tryRead = async (f) => { + const p = path.join(templatesDir, f); + try { return await fs.readFile(p, 'utf8'); } catch { return null; } + }; + const files = await fs.readdir(templatesDir); + for (const file of files) { + if (file.endsWith('.ejs')) templates[file] = await tryRead(file); + } + try { + const partialsDir = path.join(templatesDir, 'partials'); + const partials = await fs.readdir(partialsDir); + for (const file of partials) { + if (file.endsWith('.ejs') || file.endsWith('.js')) { + templates[`partials/${file}`] = await tryRead(`partials/${file}`); + } + } + } catch { /* Ignore missing partials */ } + return { contents: `export default ${JSON.stringify(templates)};`, loader: 'js' }; + }); + }, + }; + + // 4. Node Shim Plugin + const nodeShimPlugin = { + name: 'node-deps-shim', + setup(build) { + build.onResolve({ filter: /^(node:)?path$/ }, args => ({ path: args.path, namespace: 'path-shim' })); + build.onLoad({ filter: /.*/, namespace: 'path-shim' }, () => ({ + contents: ` + export const join = (...a) => a.filter(Boolean).join('/'); + export const resolve = (...a) => '/' + a.filter(Boolean).join('/'); + export const basename = (p) => p ? p.split(/[\\\\/]/).pop() : ''; + export const dirname = (p) => p ? p.split(/[\\\\/]/).slice(0, -1).join('/') || '.' : '.'; + export const extname = (p) => p ? '.' + p.split('.').pop() : ''; + export const sep = '/'; + export default { join, resolve, basename, dirname, extname, sep }; + `, loader: 'js' + })); + build.onResolve({ filter: /^(node:)?fs(\/promises)?|fs-extra$/ }, args => ({ path: args.path, namespace: 'fs-shim' })); + build.onLoad({ filter: /.*/, namespace: 'fs-shim' }, () => ({ + contents: ` + export const promises = {}; + export const existsSync = () => false; + export default { promises, existsSync }; + `, loader: 'js' + })); + } + }; + + // 5. Bundle JS + await esbuild.build({ + entryPoints: [path.join(assetsDir, 'browser-entry.ts')], + bundle: true, + outfile: path.join(finalOutputDir, 'docmd-live.js'), + platform: 'browser', + format: 'iife', + globalName: 'docmd', + minify: true, + define: { 'process.env.NODE_ENV': '"production"' }, + inject: [shimPath], + plugins: [templatePlugin, nodeShimPlugin] + }); + + // 6. Copy Static Assets + await fs.copyFile(path.join(assetsDir, 'index.html'), path.join(finalOutputDir, 'index.html')); + await fs.copyFile(path.join(assetsDir, 'docmd-live.css'), path.join(finalOutputDir, 'docmd-live.css')); + + const cssDest = path.join(finalOutputDir, 'assets/css'); + const jsDest = path.join(finalOutputDir, 'assets/js'); + await fs.mkdir(cssDest, { recursive: true }); + await fs.mkdir(jsDest, { recursive: true }); + await fs.copyFile(path.join(assetsDir, 'docmd-live-preview.css'), path.join(cssDest, 'docmd-live-preview.css')); + + const copy = async (src, destName) => { + try { + await fs.copyFile(src, path.join(path.extname(destName) === '.js' ? jsDest : cssDest, destName)); + } catch { + TUI.warn(`Missing asset: ${path.basename(src)}`); + } + }; + + await copy(path.join(ui.getAssetsDir(), 'css/docmd-main.css'), 'docmd-main.css'); + await copy(path.join(ui.getAssetsDir(), 'css/docmd-highlight-light.css'), 'docmd-highlight-light.css'); + await copy(path.join(ui.getAssetsDir(), 'css/docmd-highlight-dark.css'), 'docmd-highlight-dark.css'); + await copy(path.join(ui.getAssetsDir(), 'js/docmd-main.js'), 'docmd-main.js'); + + const mermaidPkgPath = require.resolve('@docmd/plugin-mermaid/package.json'); + const mermaidDir = path.dirname(mermaidPkgPath); + const mermaidSrc = path.join(mermaidDir, 'dist', 'init-mermaid.js'); + await fs.copyFile(mermaidSrc, path.join(jsDest, 'init-mermaid.js')); + + const themesDir = themes.getThemesDir(); + const themeFiles = await fs.readdir(themesDir); + for (const t of themeFiles) { + if (t.endsWith('.css')) { + const cleanName = t.replace('docmd-theme-', ''); + await copy(path.join(themesDir, t), `docmd-theme-${cleanName}`); + } + } + + try { + await fs.copyFile(path.join(ui.getAssetsDir(), 'favicon.ico'), path.join(finalOutputDir, 'favicon.ico')); + } catch { + TUI.warn('Missing Favicon'); + } + + const relPath = path.relative(process.cwd(), finalOutputDir); + sp.done(`Live Editor built in ./${relPath} (${elapsed()})`); + } catch (e) { + sp.fail('Live build failed'); + TUI.error('Live build failed', e.message); + process.exit(1); + } +} + +export { build }; + +if (process.argv[1].endsWith('build.js')) { + build(); +} \ No newline at end of file diff --git a/packages/live/src/docmd-live-preview.css b/packages/live/src/docmd-live-preview.css new file mode 100644 index 0000000..7a8c496 --- /dev/null +++ b/packages/live/src/docmd-live-preview.css @@ -0,0 +1,56 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/core (and ecosystem) + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + */ + +.toc-sidebar, +.page-footer-actions, +.sidebar-header h1 { + display: none !important; +} + +body { + display: flex; + flex-direction: column; + min-height: 100vh; +} + +.main-content-wrapper { + display: flex; + flex-direction: column; + flex: 1; +} + +.content-area { + flex: 1; + min-height: 80vh; +} + +.content-layout { + display: block !important; +} + +@media (max-width: 768px) { + .sidebar { + display: none !important; + } + + .main-content-wrapper { + margin-left: 0 !important; + } +} + +@media (max-width: 768px) { + .sidebar-toggle-button { + display: none !important; + } +} \ No newline at end of file diff --git a/packages/live/src/docmd-live.css b/packages/live/src/docmd-live.css new file mode 100644 index 0000000..6cd06a8 --- /dev/null +++ b/packages/live/src/docmd-live.css @@ -0,0 +1,371 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/core (and ecosystem) + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + */ + + :root { + --header-height: 50px; + --border-color: #e0e0e0; + --bg-color: #f9fafb; + --primary-color: #007bff; + --resizer-width: 8px +} + +body { + margin: 0; + height: 100vh; + display: flex; + flex-direction: column; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; + overflow: hidden +} + +.top-bar { + height: var(--header-height); + background: #fff; + border-bottom: 1px solid var(--border-color); + display: flex; + align-items: center; + justify-content: space-between; + padding: 0 1rem; + flex-shrink: 0 +} + +.logo { + font-weight: 700; + font-size: 1.1rem; + display: flex; + align-items: center; + gap: 12px +} + +.logo span { + background: var(--primary-color); + color: #fff; + padding: 2px 6px; + border-radius: 4px; + font-size: .75rem; + text-transform: uppercase +} + +.back-link { + display: flex; + width: 24px; + height: 24px; + background-color: #f0f0f0; + border-radius: 100%; + align-items: center; + justify-content: center; + color: #666; + transition: color 0.2s, transform .2s; + text-decoration: none; + padding: 4px; +} + +.back-link:hover { + color: var(--primary-color); + background: #f0f0f0; + transform: translateX(-2px) +} + +.logo .docmd-logo { + color: inherit; + text-decoration: none; + transition: .5s; +} + +.logo .docmd-logo:hover { + color: var(--primary-color); +} + +.view-switcher { + display: flex; + background: #f0f0f0; + padding: 3px; + border-radius: 8px; + gap: 0; +} + +.view-btn { + border: none; + background: transparent; + padding: 6px 12px; + border-radius: 6px; + cursor: pointer; + font-size: 0.85rem; + color: #666; + font-weight: 500; + transition: background 0.15s, color 0.15s; +} + +.view-btn:hover { + color: #333; +} + +.view-btn.active { + background: #fff; + color: #000; + box-shadow: 0 1px 3px #0000001a; + font-weight: 600; +} + +.workspace { + flex: 1; + display: flex; + position: relative; + overflow: hidden +} + +.pane { + height: 100%; + display: flex; + flex-direction: column; + min-width: 300px; + background: #fff +} + +.pane-header { + padding: 0 16px; + height: 40px; + font-size: .75rem; + font-weight: 600; + text-transform: uppercase; + color: #888; + background: var(--bg-color); + border-bottom: 1px solid var(--border-color); + flex-shrink: 0; + display: flex; + align-items: center; + justify-content: space-between; +} + +/* Light/dark toggle in the preview pane header. Sits on the right via + the .pane-header's space-between layout. Sun icon shows in dark + mode (clicking returns to light), moon icon shows in light mode. */ +.preview-theme-toggle { + display: inline-flex; + align-items: center; + justify-content: center; + width: 26px; + height: 26px; + border-radius: 4px; + color: #888; + background: transparent; + border: none; + cursor: pointer; + transition: background 0.15s ease, color 0.15s ease; +} + +.preview-theme-toggle:hover { + background: rgba(0, 0, 0, 0.06); + color: #333; +} + +.preview-theme-toggle svg { + width: 15px; + height: 15px; + stroke-width: 2; +} + +.preview-theme-toggle .icon-sun { display: none; } +.preview-theme-toggle .icon-moon { display: inline-block; } +[data-theme="dark"] .preview-theme-toggle .icon-sun { display: inline-block; } +[data-theme="dark"] .preview-theme-toggle .icon-moon { display: none; } + +.editor-pane { + width: 50% +} + +.presets-bar { + display: flex; + gap: 6px; + overflow-x: auto; + white-space: nowrap; + scrollbar-width: none; +} + +.presets-bar::-webkit-scrollbar { + display: none; +} + +.presets-bar button { + background: #eef2f5; + border: 1px solid #e0e0e0; + border-radius: 12px; + padding: 2px 10px; + font-size: 10px; + color: #666; + cursor: pointer; + text-transform: uppercase; + font-weight: 600; + transition: all 0.2s; + flex-shrink: 0; +} + +.presets-bar button:hover, +.presets-bar button.active { + background: #fff; + border-color: var(--primary-color); + color: var(--primary-color); +} + +textarea#input { + flex: 1; + border: none; + resize: none; + padding: 20px; + font-family: 'JetBrains Mono', 'Fira Code', Consolas, monospace; + font-size: 14px; + line-height: 1.6; + outline: none; + background: var(--bg-color) +} + +.preview-pane { + flex: 1; + background: #fff +} + +.iframe-wrapper { + width: 100%; + height: 100%; + background: #fff; + position: relative; +} + +iframe#preview { + width: 100%; + height: 100%; + border: none; + display: block; + transition: opacity 0.15s ease-in-out; + opacity: 1; +} + +.iframe-wrapper.rendering iframe { + opacity: 0.6; + filter: grayscale(0.5); +} + +.resizer { + width: var(--resizer-width); + background: var(--bg-color); + border-left: 1px solid var(--border-color); + border-right: 1px solid var(--border-color); + cursor: col-resize; + display: flex; + align-items: center; + justify-content: center; + transition: background .2s; + z-index: 10 +} + +.resizer:hover, +.resizer.resizing { + background: #e0e0e0 +} + +.resizer::after { + content: "||"; + color: #aaa; + font-size: 10px; + letter-spacing: 1px +} + +body.mode-single .resizer { + display: none +} + +body.mode-single .pane { + width: 100% !important; + min-width: 0 +} + +body.mode-single .editor-pane { + display: none +} + +body.mode-single .preview-pane { + display: none +} + +body.mode-single.show-editor .editor-pane { + display: flex +} + +body.mode-single.show-preview .preview-pane { + display: flex +} + +@media (max-width: 768px) { + .desktop-only { + display: none !important + } + + .resizer { + display: none !important + } + + .pane { + width: 100% !important + } + + .editor-pane { + display: none + } + + .preview-pane { + display: none + } + + body.mobile-tab-editor .editor-pane { + display: flex + } + + body.mobile-tab-preview .preview-pane { + display: flex + } + + .mobile-tabs { + display: flex !important; + position: fixed; + bottom: 0; + left: 0; + right: 0; + height: 50px; + background: #fff; + border-top: 1px solid var(--border-color); + z-index: 100 + } + + .mobile-tab-btn { + flex: 1; + border: none; + background: transparent; + font-weight: 600; + color: #888; + cursor: pointer + } + + .mobile-tab-btn.active { + color: var(--primary-color); + border-top: 2px solid var(--primary-color) + } + + .workspace { + padding-bottom: 50px + } +} + +.mobile-tabs { + display: none +} \ No newline at end of file diff --git a/packages/live/src/index.html b/packages/live/src/index.html new file mode 100644 index 0000000..f5c9e0b --- /dev/null +++ b/packages/live/src/index.html @@ -0,0 +1,233 @@ + + + + + + + + + + Docmd Live Editor + + + + + + + + + + + + +
+ + + +
+ + + +
+
+ + +
+ +
+
+ Markdown +
+ + + + + + +
+
+ +
+ + +
+ + +
+
+ Preview + +
+ +
+
+ + +
+ + +
+ + + + \ No newline at end of file diff --git a/packages/live/src/index.ts b/packages/live/src/index.ts new file mode 100644 index 0000000..000d189 --- /dev/null +++ b/packages/live/src/index.ts @@ -0,0 +1,178 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/core (and ecosystem) + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + */ + +import path from 'path'; +import http from 'http'; +import fs from 'fs/promises'; +import { fileURLToPath } from 'node:url'; +import { build } from './build.js'; +import { TUI } from '@docmd/tui'; +import { safePath as canonicalSafePath } from '@docmd/api'; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); + +const MIME_TYPES = { + '.html': 'text/html', + '.js': 'text/javascript', + '.css': 'text/css', + '.json': 'application/json', + '.png': 'image/png', + '.jpg': 'image/jpg', + '.svg': 'image/svg+xml', + '.ico': 'image/x-icon' +}; + +function checkPortInUse(port: number): Promise { + // Probe binds to 127.0.0.1 only. We just need to know if the loopback + // interface has the port โ€” binding to 0.0.0.0 briefly exposed the probe + // socket to the LAN. + return new Promise((resolve) => { + const tester = http.createServer() + .once('error', (err: any) => resolve(err.code === 'EADDRINUSE')) + .once('listening', () => tester.close(() => resolve(false))) + .listen(port, '127.0.0.1'); + }); +} + +async function findAvailablePort(startPort: number): Promise { + let port = startPort; + while (await checkPortInUse(port)) { + port++; + } + return port; +} + +async function start() { + // Resolution logic: index.js is in dist/, public/ is its sibling at root + const publicDir = path.resolve(__dirname, '..', 'public'); + const initialPort = parseInt(process.env.PORT || '3000', 10); + const port = await findAvailablePort(initialPort); + + // 2. Native HTTP Server + const server = http.createServer(async (req, res) => { + // Normalize path and prevent directory traversal attacks + let safePath = path.normalize(req.url!).replace(/^(\.\.[\/\\])+/, '').split('?')[0].split('#')[0]; + if (safePath === '/' || safePath === '\\') safePath = 'index.html'; + + // D-H6: use the canonical safePath from @docmd/api to resolve the + // requested path against the public dir, instead of relying on + // path.join + the ad-hoc `../` stripper. The ad-hoc stripper + // happened to be safe for `..` and absolute paths, but the canonical + // helper has explicit tests for both and throws with a clear + // message instead of returning a wrong-path silently. This + // change keeps the existing behaviour for in-bounds paths and + // upgrades the security check to the one the rest of the project + // uses. + let filePath: string; + try { + filePath = canonicalSafePath(publicDir, safePath); + } catch (e) { + res.writeHead(403, { 'Content-Type': 'text/plain' }); + res.end('Forbidden'); + return; + } + + // Dynamic routing for project-local user assets (bypassing the precompiled bundle) + if (safePath.startsWith('assets/')) { + const userAssetPath = path.join(process.cwd(), safePath); + try { + await fs.stat(userAssetPath); + filePath = userAssetPath; + } catch { + // fallback to bundled assets if not found locally + } + } + + try { + const stats = await fs.stat(filePath); + + // If it's a directory, serve its index.html + if (stats.isDirectory()) { + filePath = path.join(filePath, 'index.html'); + await fs.stat(filePath); + } + + const ext = path.extname(filePath).toLowerCase(); + const contentType = MIME_TYPES[ext] || 'application/octet-stream'; + const content = await fs.readFile(filePath); + + res.writeHead(200, { 'Content-Type': contentType }); + res.end(content); + + } catch (err) { + if (err.code === 'ENOENT') { + res.writeHead(404, { 'Content-Type': 'text/plain' }); + res.end('404 Not Found'); + } else { + res.writeHead(500); + res.end(`Server Error: ${err.code}`); + } + } + }); + + // 3. Start Listening + // Security: default to loopback. Set DOCMD_HOST=0.0.0.0 to expose on the + // LAN. The Live editor serves the built site + the project's `assets/` + // directory, so LAN exposure is opt-in only โ€” same model as the main + // dev server (packages/core/src/commands/dev.ts). + const BIND_HOST = process.env.DOCMD_HOST || '127.0.0.1'; + if (BIND_HOST !== '127.0.0.1' && BIND_HOST !== '::1' && BIND_HOST !== 'localhost') { + TUI.warn( + `Live editor bound to ${BIND_HOST} (LAN). Any host able to reach this port ` + + `can browse the served site.` + ); + } + server.listen(port, BIND_HOST, () => { + TUI.section('Live Editor Running', TUI.green); + TUI.item('', '', TUI.dim, TUI.green); + TUI.item('Local Access', `http://localhost:${port}`, TUI.bold, TUI.green); + if (BIND_HOST !== '127.0.0.1' && BIND_HOST !== '::1' && BIND_HOST !== 'localhost') { + TUI.item('LAN Access', `http://${BIND_HOST}:${port}`, TUI.bold, TUI.yellow); + } + TUI.item('Serving from', path.relative(process.cwd(), publicDir) || '.', TUI.dim, TUI.green); + TUI.item('', '', TUI.dim, TUI.green); + TUI.footer(TUI.green); + }); + + server.on('error', (err: any) => { + TUI.error('Live server error', err.message); + process.exit(1); + }); + + // Graceful shutdown - suppress ^C display + if (process.stdin.isTTY) { + process.stdin.setRawMode(true); + process.stdin.resume(); + process.stdin.on('data', (data) => { + if (data[0] === 0x03) { + process.emit('SIGINT' as any); + } + }); + } + + let isShuttingDown = false; + process.on('SIGINT', () => { + if (isShuttingDown) return; + isShuttingDown = true; + + if (process.stdin.isTTY) process.stdin.setRawMode(false); + + TUI.success('Shutting down Live Editor...'); + server.close(); + process.exit(0); + }); +} + +export { start, build }; \ No newline at end of file diff --git a/packages/live/src/shims.js b/packages/live/src/shims.js new file mode 100644 index 0000000..66aa6a6 --- /dev/null +++ b/packages/live/src/shims.js @@ -0,0 +1,15 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/core (and ecosystem) + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + */ + +import { Buffer } from 'buffer'; globalThis.Buffer = Buffer; \ No newline at end of file diff --git a/packages/live/src/shims.ts b/packages/live/src/shims.ts new file mode 100644 index 0000000..66aa6a6 --- /dev/null +++ b/packages/live/src/shims.ts @@ -0,0 +1,15 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/core (and ecosystem) + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + */ + +import { Buffer } from 'buffer'; globalThis.Buffer = Buffer; \ No newline at end of file diff --git a/packages/live/tsconfig.json b/packages/live/tsconfig.json new file mode 100644 index 0000000..9635ce4 --- /dev/null +++ b/packages/live/tsconfig.json @@ -0,0 +1,10 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "outDir": "./dist", + "rootDir": "./src", + "strict": false + }, + "include": ["src/**/*"], + "exclude": ["node_modules", "dist", "**/*.test.ts"] +} \ No newline at end of file diff --git a/packages/parser/LICENSE b/packages/parser/LICENSE new file mode 100644 index 0000000..997bb73 --- /dev/null +++ b/packages/parser/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025-present docmd.io + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/packages/parser/README.md b/packages/parser/README.md new file mode 100644 index 0000000..9f23964 --- /dev/null +++ b/packages/parser/README.md @@ -0,0 +1,13 @@ +# @docmd/parser + +The isomorphic Markdown engine that powers docmd - parses Markdown to HTML with support for callouts, tabs, steps, and changelogs, and runs identically in Node.js and the browser. + +Part of the **[docmd](https://github.com/docmd-io/docmd)** documentation engine. + +## Documentation + +See **[docs.docmd.io](https://docs.docmd.io)** for full usage and API reference. + +## License + +MIT \ No newline at end of file diff --git a/packages/parser/package.json b/packages/parser/package.json new file mode 100644 index 0000000..7bb91bb --- /dev/null +++ b/packages/parser/package.json @@ -0,0 +1,66 @@ +{ + "name": "@docmd/parser", + "version": "0.8.12", + "description": "Pure Markdown parsing engine for docmd.", + "type": "module", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "scripts": { + "build": "tsc", + "test": "node --test 'test/**/*.test.js'" + }, + "files": [ + "dist" + ], + "engines": { + "node": ">=18" + }, + "dependencies": { + "@docmd/tui": "workspace:*", + "@docmd/utils": "workspace:*", + "embed-lite": "^0.1.4", + "lite-hl": "^0.1.2", + "lite-matter": "^0.1.1", + "lite-template": "^0.1.2", + "lucide-static": "^0.577.0", + "markdown-it": "^14.3.0", + "markdown-it-abbr": "^1.0.4", + "markdown-it-attrs": "^4.5.0", + "markdown-it-deflist": "^2.1.0", + "markdown-it-emoji": "^2.0.2", + "markdown-it-footnote": "^3.0.3", + "markdown-it-task-lists": "^2.1.1" + }, + "keywords": [ + "docmd", + "parser", + "utils", + "tools", + "containers", + "markdown-it", + "markdown", + "markdown-processor", + "icon-renderer", + "renderer", + "validator", + "minimalist", + "zero-config", + "site-generator", + "static-site-generator", + "docs" + ], + "author": { + "name": "Ghazi", + "url": "https://mgks.dev" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/docmd-io/docmd.git" + }, + "bugs": { + "url": "https://github.com/docmd-io/docmd/issues" + }, + "homepage": "https://docmd.io", + "funding": "https://github.com/sponsors/mgks", + "license": "MIT" +} \ No newline at end of file diff --git a/packages/parser/src/features/basics.ts b/packages/parser/src/features/basics.ts new file mode 100644 index 0000000..c202017 --- /dev/null +++ b/packages/parser/src/features/basics.ts @@ -0,0 +1,43 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/core (and ecosystem) + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + */ + +export default { + name: 'basics', + setup(md) { + // 1. Custom Image Renderer + const defaultImageRenderer = md.renderer.rules.image || function (tokens, idx, options, env, self) { + return self.renderToken(tokens, idx, options); + }; + + md.renderer.rules.image = function (tokens, idx, options, env, self) { + const renderedImage = defaultImageRenderer(tokens, idx, options, env, self); + const nextToken = tokens[idx + 1]; + + // Look ahead for attributes syntax { .class } immediately after image + if (nextToken && nextToken.type === 'attrs_block') { + // markdown-it-attrs usually handles this, but if we need specific logic for + // aligning images that don't use standard attributes, we do it here. + } + return renderedImage; + }; + + // 2. Table Wrapper (Horizontal Scroll) + md.renderer.rules.table_open = (tokens, idx, options, env, self) => { + return '
' + self.renderToken(tokens, idx, options); + }; + md.renderer.rules.table_close = (tokens, idx, options, env, self) => { + return self.renderToken(tokens, idx, options) + '
'; + }; + } +}; \ No newline at end of file diff --git a/packages/parser/src/features/buttons.ts b/packages/parser/src/features/buttons.ts new file mode 100644 index 0000000..13615b6 --- /dev/null +++ b/packages/parser/src/features/buttons.ts @@ -0,0 +1,106 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/core (and ecosystem) + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + */ + +import { renderIcon } from '../utils/icon-renderer.js'; +import { resolveHref } from '../utils/normalize-href.js'; + +function buttonRule(state, startLine, endLine, silent) { + const start = state.bMarks[startLine] + state.tShift[startLine]; + const max = state.eMarks[startLine]; + const lineContent = state.src.slice(start, max).trim(); + + // Regex matches: ::: button "Text" Link [color] or :::button (spaceless) + const match = lineContent.match(/^:::\s*button\s+(?:["'](.*?)["']|(\S+))\s+(.*)$/); + + if (!match) return false; + if (silent) return true; + + // Extract Data + // Group 1 is quoted text, Group 2 is single-word text + let text = match[1] || match[2] || 'Button'; + // Replace underscores only if it was a single word (legacy support) + if (match[2]) text = text.replace(/_/g, ' '); + + const rest = match[3].trim(); + + // Parse Link and Options + // We look for the first string as the link, rest as options + const parts = rest.split(/\s+/); + const rawLink = parts[0]; + let color = ''; + let icon = ''; + + // Look for options in remaining parts + for (let i = 1; i < parts.length; i++) { + if (parts[i].startsWith('color:')) { + color = parts[i].replace('color:', ''); + } else if (parts[i].startsWith('icon:')) { + icon = parts[i].replace('icon:', ''); + } + } + + // Resolve link through the unified normaliser + const result = resolveHref(rawLink); + let href = result.href; + + // Clean URL depth adjustment for non-index pages + if (!result.isRaw && !result.isExternal && !href.startsWith('#')) { + let hashPart = ''; + let pathPart = href; + const hashIdx = href.indexOf('#'); + if (hashIdx >= 0) { + hashPart = href.substring(hashIdx); + pathPart = href.substring(0, hashIdx); + } + + const isProtocol = pathPart.match(/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i); + if (!isProtocol && !pathPart.startsWith('/') && state.env && state.env.isIndex === false) { + if (pathPart.startsWith('./')) { + pathPart = '../' + pathPart.substring(2); + } else if (pathPart !== '') { + pathPart = '../' + pathPart; + } + } + + href = pathPart + hashPart; + } + + // Generate Token + const token = state.push('html_inline', '', 0); + + let styleAttr = ''; + if (color) { + // Basic validation to prevent CSS injection if needed, or allow flexibility + styleAttr = ` style="background-color: ${color}; border-color: ${color}; color: #fff;"`; + } + + const targetAttr = result.isExternal ? ' target="_blank" rel="noopener noreferrer"' : ''; + + let iconHtml = ''; + if (icon) { + iconHtml = renderIcon(icon, { class: 'button-icon' }); + } + + token.content = `${iconHtml}${state.md.renderInline(text)}`; + + state.line = startLine + 1; + return true; +} + +export default { + name: 'buttons', + setup(md) { + md.block.ruler.before('paragraph', 'docmd_button', buttonRule, { alt: ['paragraph', 'reference', 'blockquote', 'list'] }); + } +}; \ No newline at end of file diff --git a/packages/parser/src/features/changelog.ts b/packages/parser/src/features/changelog.ts new file mode 100644 index 0000000..41ba2c2 --- /dev/null +++ b/packages/parser/src/features/changelog.ts @@ -0,0 +1,163 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/core (and ecosystem) + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + */ + +function smartDedent(str) { + const lines = str.split('\n'); + let minIndent = Infinity; + lines.forEach(line => { + if (line.trim().length === 0) return; + const match = line.match(/^ */); + if (match[0].length < minIndent) minIndent = match[0].length; + }); + if (minIndent === Infinity) return str; + return lines.map(line => line.trim().length ? line.substring(minIndent) : '').join('\n'); +} + +function parseQuotedTitle(info) { + if (!info) return ''; + const match = info.match(/"([^"]*)"/); + return match ? match[1] : info.trim(); +} + +function changelogRule(state, startLine, endLine, silent) { + const start = state.bMarks[startLine] + state.tShift[startLine]; + const max = state.eMarks[startLine]; + const lineContent = state.src.slice(start, max).trim(); + + // Support both '::: changelog' and ':::changelog' (spaceless) + if (lineContent !== '::: changelog' && lineContent !== ':::changelog') return false; + if (silent) return true; + + let nextLine = startLine; + let found = false; + let depth = 1; + let fenceMarker = null; + + while (nextLine < endLine) { + nextLine++; + if (nextLine >= endLine) break; + + const nextStart = state.bMarks[nextLine] + state.tShift[nextLine]; + const nextMax = state.eMarks[nextLine]; + const nextContent = state.src.slice(nextStart, nextMax).trim(); + + if (!fenceMarker) { + const match = nextContent.match(/^(`{3,}|~{3,})/); + if (match) fenceMarker = match[1]; + } else if (nextContent.startsWith(fenceMarker)) { + fenceMarker = null; + } + + if (!fenceMarker) { + if (nextContent.match(/^:::\s*[a-zA-Z]/) && !nextContent.match(/^:::\s*button/)) { + depth++; + } else if (nextContent.match(/^:::\s*$/)) { + depth--; + if (depth === 0) { + found = true; + break; + } + } + } + } + + if (!found) return false; + + // Extract content block + let content = ''; + for (let i = startLine + 1; i < nextLine; i++) { + const lineStart = state.bMarks[i]; + const lineEnd = state.eMarks[i]; + content += state.src.slice(lineStart, lineEnd) + '\n'; + } + + // Parse "== Date" entries + const lines = content.split('\n'); + const entries = []; + let currentEntry = null; + let currentContentLines = []; + + for (let i = 0; i < lines.length; i++) { + const rawLine = lines[i]; + const trimmedLine = rawLine.trim(); + const markerMatch = trimmedLine.match(/^==\s+(.+)$/); + + if (markerMatch) { + if (currentEntry) { + currentEntry.content = smartDedent(currentContentLines.join('\n')); + entries.push(currentEntry); + } + currentEntry = { meta: parseQuotedTitle(markerMatch[1]), content: '' }; + currentContentLines = []; + } else if (currentEntry) { + currentContentLines.push(rawLine); + } + } + if (currentEntry) { + currentEntry.content = smartDedent(currentContentLines.join('\n')); + entries.push(currentEntry); + } + + state.push('changelog_open', 'div', 1); + + // Slugify a changelog entry's meta string into a URL-safe id. Mirrors + // the Unicode-aware rules used by the parser-side heading slug + // generator (see markdown-processor.ts) so anchors for non-ASCII + // dates work the same as anchors for non-ASCII headings. + const slugifyMeta = (text: string): string => + text.toLowerCase() + .trim() + .replace(/\s+/g, '-') + .replace(/[^\p{L}\p{N}-]+/gu, '') + .replace(/--+/g, '-') + .replace(/^-+/, '') + .replace(/-+$/, '') || 'entry'; + + // Lucide `link-2` icon โ€” same SVG used by .heading-anchor and + // .step-permalink so all three permalink affordances are visually + // identical. + const PERMALINK_SVG = ''; + + entries.forEach((entry, idx) => { + // We render HTML blocks directly for the timeline structure + const slug = `changelog-${slugifyMeta(entry.meta || String(idx))}`; + const permalink = `${PERMALINK_SVG}`; + const entryOpen = state.push('html_block', '', 0); + entryOpen.content = `
+
${state.md.renderInline(entry.meta)}${permalink}
+
`; + + // Recurse render the markdown inside the entry + entryOpen.content += state.md.render(entry.content, state.env); + + const entryClose = state.push('html_block', '', 0); + entryClose.content = `
`; + }); + + state.push('changelog_close', 'div', -1); + state.line = nextLine + 1; + return true; +} + +export default { + name: 'changelog', + setup(md) { + // Register Rule + md.block.ruler.before('fence', 'changelog_timeline', changelogRule, { alt: ['paragraph', 'reference', 'blockquote', 'list'] }); + + // Register Container Renderer + md.renderer.rules.changelog_open = () => '
'; + md.renderer.rules.changelog_close = () => '
'; + } +}; \ No newline at end of file diff --git a/packages/parser/src/features/common-containers.ts b/packages/parser/src/features/common-containers.ts new file mode 100644 index 0000000..d9894e2 --- /dev/null +++ b/packages/parser/src/features/common-containers.ts @@ -0,0 +1,270 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/core (and ecosystem) + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + */ + +import { renderIcon } from '../utils/icon-renderer.js'; +import { parseTitleAndIcon } from '../utils/container-helper.js'; +import { normaliseContainers } from '../utils/container-normaliser.js'; + +function smartDedent(str) { + const lines = str.split('\n'); + + while (lines.length && lines[0].trim() === '') lines.shift(); + while (lines.length && lines[lines.length - 1].trim() === '') lines.pop(); + + let minIndent = Infinity; + for (const line of lines) { + if (!line.trim()) continue; + const indent = line.match(/^ */)[0].length; + minIndent = Math.min(minIndent, indent); + } + + if (!isFinite(minIndent) || minIndent === 0) return lines.join('\n'); + + return lines.map(line => + line.startsWith(' '.repeat(minIndent)) ? line.slice(minIndent) : line + ).join('\n'); +} + +/** + * Creates a depth-tracking container block rule for markdown-it. + * Handles arbitrary nesting of `:::` containers by tracking open/close depth. + * + * @example + * ```ts + * import { createDepthTrackingContainer } from '@docmd/parser'; + * + * createDepthTrackingContainer(md, 'note', + * (tokens, idx) => `
\n`, + * () => '
\n' + * ); + * ``` + * + * @param md - The markdown-it instance + * @param name - Container name (matched after `:::`) + * @param renderOpen - Renderer for the opening token + * @param renderClose - Renderer for the closing token + */ +export function createDepthTrackingContainer(md: any, name: string, renderOpen: any, renderClose: any) { + md.block.ruler.before('fence', `custom_${name}`, (state, startLine, endLine, silent) => { + const start = state.bMarks[startLine] + state.tShift[startLine]; + const max = state.eMarks[startLine]; + const lineContent = state.src.slice(start, max).trim(); + + // Match opening tag e.g., `::: callout info Title` or `:::callout info Title` (spaceless) + const regex = new RegExp(`^:::\\s*${name}(?:\\s+(.*))?$`); + const match = lineContent.match(regex); + if (!match) return false; + if (silent) return true; + + let nextLine = startLine; + let found = false; + let depth = 1; + let fenceMarker = null; + + while (nextLine < endLine) { + nextLine++; + if (nextLine >= endLine) break; + + const nextStart = state.bMarks[nextLine] + state.tShift[nextLine]; + const nextMax = state.eMarks[nextLine]; + const nextContent = state.src.slice(nextStart, nextMax).trim(); + + if (!fenceMarker) { + const match = nextContent.match(/^(`{3,}|~{3,})/); + if (match) fenceMarker = match[1]; + } else if (nextContent.startsWith(fenceMarker)) { + fenceMarker = null; + } + + if (!fenceMarker) { + if (nextContent.match(/^:::\s*[a-zA-Z]/) && !nextContent.match(/^:::\s*(button|embed|tag)\b/)) { + depth++; + } else if (nextContent.match(/^:::\s*$/)) { + depth--; + if (depth === 0) { + found = true; + break; + } + } + } + } + + if (!found) return false; + + const info = match[1] || ''; + + // Extract raw content lines and dedent to reset indentation, + // then re-render recursively so nested containers parse correctly. + let rawContent = ''; + for (let i = startLine + 1; i < nextLine; i++) { + const lineStart = state.bMarks[i]; + const lineEnd = state.eMarks[i]; + rawContent += state.src.slice(lineStart, lineEnd) + '\n'; + } + + // Phase 2 (F1): re-run the container normaliser on the extracted body + // BEFORE smartDedent. The top-level normaliser balances the OUTER + // container's open/close depth, but inside a recursive render of the + // extracted body the depth-tracker is ambiguous again (e.g. nested + // grids with one close per inner card). Normalising here inserts the + // missing closes inside the body so the recursive grid/card rule sees + // balanced input. + const normalisedBody = normaliseContainers(rawContent, { + sourcePath: `<${name}-body@L${startLine + 1}>` + }); + const innerContent = smartDedent(normalisedBody.source); + + const openToken = state.push(`custom_${name}_open`, 'div', 1); + openToken.info = info; + + if (innerContent) { + // Flag the environment so the inner heading plugin skips generating permalinks & IDs + const oldIsInsideContainer = state.env.isInsideContainer; + state.env.isInsideContainer = true; + + const renderedContent = state.md.render(innerContent, state.env); + + state.env.isInsideContainer = oldIsInsideContainer; + + const htmlToken = state.push('html_block', '', 0); + htmlToken.content = renderedContent; + } + + state.push(`custom_${name}_close`, 'div', -1); + + state.line = nextLine + 1; + return true; + }, { alt: ['paragraph', 'reference', 'blockquote', 'list'] }); + + // Register Renderers + md.renderer.rules[`custom_${name}_open`] = renderOpen; + md.renderer.rules[`custom_${name}_close`] = renderClose; +} + +export default { + name: 'common-containers', + setup(md: any) { + + // 1. Callout + createDepthTrackingContainer(md, 'callout', (tokens, idx) => { + const info = tokens[idx].info.trim(); + const parts = info.split(' '); + const type = parts[0] || 'info'; + + // Support ::: callout type "Title" or ::: callout type Title + let title = ''; + let icon = ''; + const remaining = parts.slice(1).join(' ').trim(); + if (remaining) { + const parsed = parseTitleAndIcon(remaining); + title = parsed.title; + icon = parsed.icon; + } + + const renderedTitle = title ? md.renderInline(title) : ''; + const iconHtml = icon ? renderIcon(icon, { class: 'callout-icon-heading' }) : ''; + const safeType = md.utils.escapeHtml(type); + + return `
${renderedTitle || iconHtml ? `
${iconHtml}${renderedTitle}
` : ''}
\n`; + }, () => '
\n'); + + // 2. Card + createDepthTrackingContainer(md, 'card', (tokens, idx) => { + const { title, icon } = parseTitleAndIcon(tokens[idx].info); + const renderedTitle = title ? md.renderInline(title) : ''; + const iconHtml = icon ? renderIcon(icon, { class: 'card-icon-heading' }) : ''; + // No trailing newline after
: any inline + // markdown immediately after the ::: card opener (e.g. a callout + // block or a heading) would otherwise get a literal newline inserted + // before its first tag, which broke card layouts where the inner + // block was meant to sit flush against the card edge. + return `
${renderedTitle || iconHtml ? `
${iconHtml}${renderedTitle}
` : ''}
`; + }, () => '
'); + + // 3. Collapsible + createDepthTrackingContainer(md, 'collapsible', (tokens, idx) => { + const info = tokens[idx].info.trim(); + const isOpen = info.startsWith('open ') || info === 'open'; + const rawInfo = isOpen ? info.replace('open', '').trim() : info; + const { title, icon } = parseTitleAndIcon(rawInfo); + const displayTitle = title || 'Click to expand'; + const renderedTitle = md.renderInline(displayTitle); + const iconHtml = icon ? renderIcon(icon, { class: 'collapsible-icon-heading' }) : ''; + const safeOpen = isOpen ? ' open' : ''; + + return `
+ + ${iconHtml}${renderedTitle} + + +
\n`; + }, () => '
\n'); + + // 4. Grids + createDepthTrackingContainer(md, 'grids', () => { + return `
\n`; + }, () => '
\n'); + + // 5. Grid Item + createDepthTrackingContainer(md, 'grid', () => { + return `
\n`; + }, () => '
\n'); + + // โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ + // Container Aliases (VitePress/Docusaurus compatibility) + // These allow users migrating from other documentation engines to use + // familiar syntax without modification. + // โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ + + // Callout type aliases - map directly to callout variants + const calloutAliases = [ + // VitePress aliases + { name: 'tip', type: 'tip' }, + { name: 'warning', type: 'warning' }, + { name: 'danger', type: 'danger' }, + { name: 'info', type: 'info' }, + // Docusaurus aliases + { name: 'note', type: 'info' }, + { name: 'caution', type: 'warning' }, + ]; + + for (const alias of calloutAliases) { + createDepthTrackingContainer(md, alias.name, (tokens, idx) => { + const info = tokens[idx].info.trim(); + const { title, icon } = parseTitleAndIcon(info); + const renderedTitle = title ? md.renderInline(title) : ''; + const iconHtml = icon ? renderIcon(icon, { class: 'callout-icon-heading' }) : ''; + const safeType = md.utils.escapeHtml(alias.type); + return `
${renderedTitle || iconHtml ? `
${iconHtml}${renderedTitle}
` : ''}
\n`; + }, () => '
\n'); + } + + // VitePress details alias -> collapsible + createDepthTrackingContainer(md, 'details', (tokens, idx) => { + const info = tokens[idx].info.trim(); + const { title, icon } = parseTitleAndIcon(info); + const displayTitle = title || 'Details'; + const renderedTitle = md.renderInline(displayTitle); + const iconHtml = icon ? renderIcon(icon, { class: 'collapsible-icon-heading' }) : ''; + + return `
+ + ${iconHtml}${renderedTitle} + + +
\n`; + }, () => '
\n'); + + } +}; \ No newline at end of file diff --git a/packages/parser/src/features/embed.ts b/packages/parser/src/features/embed.ts new file mode 100644 index 0000000..d6e0e13 --- /dev/null +++ b/packages/parser/src/features/embed.ts @@ -0,0 +1,57 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/core (and ecosystem) + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + */ + +import { embed } from 'embed-lite'; + +function embedRule(state: any, startLine: number, endLine: number, silent: boolean) { + const start = state.bMarks[startLine] + state.tShift[startLine]; + const max = state.eMarks[startLine]; + const lineContent = state.src.slice(start, max).trim(); + + // Support both '::: embed' and ':::embed' (spaceless) + const match = lineContent.match(/^:::\s*embed\s+(?:\[|")?((https?:\/\/)[^\]"\s]+)(?:\]|")?$/i); + if (!match) return false; + if (silent) return true; + + const urlStr = match[1]; + let html = ''; + + try { + const embedResult = embed(urlStr, { className: 'docmd-embed' }); + if (embedResult && embedResult.html) { + // We received a valid parsed native iframe/blockquote component + html = embedResult.html; + } else { + const url = new URL(urlStr); + const hostname = url.hostname.replace('www.', ''); + html = ``; + } + } catch { + // Hard fallback if string is entirely invalid URL + html = ``; + } + + const token = state.push('html_inline', '', 0); + token.content = html; + + state.line = startLine + 1; + return true; +} + +export default { + name: 'embed', + setup(md: any) { + md.block.ruler.before('paragraph', 'docmd_embed', embedRule, { alt: ['paragraph', 'reference', 'blockquote', 'list'] }); + } +}; \ No newline at end of file diff --git a/packages/parser/src/features/hero.ts b/packages/parser/src/features/hero.ts new file mode 100644 index 0000000..d9732ab --- /dev/null +++ b/packages/parser/src/features/hero.ts @@ -0,0 +1,218 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/core (and ecosystem) + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + */ + +function smartDedent(str) { + const lines = str.split('\n'); + while (lines.length && lines[0].trim() === '') lines.shift(); + while (lines.length && lines[lines.length - 1].trim() === '') lines.pop(); + + let minIndent = Infinity; + for (const line of lines) { + if (!line.trim()) continue; + const indent = line.match(/^ */)[0].length; + minIndent = Math.min(minIndent, indent); + } + + if (!isFinite(minIndent) || minIndent === 0) return lines.join('\n'); + + return lines.map(line => + line.startsWith(' '.repeat(minIndent)) ? line.slice(minIndent) : line + ).join('\n'); +} + +function heroRule(state, startLine, endLine, silent) { + const start = state.bMarks[startLine] + state.tShift[startLine]; + const max = state.eMarks[startLine]; + const lineContent = state.src.slice(start, max).trim(); + + // Support both '::: hero' and ':::hero' (spaceless) + const regex = /^:::\s*hero(?:\s+(.*))?$/; + const match = lineContent.match(regex); + if (!match) return false; + if (silent) return true; + + const flagsStr = match[1] || ''; + const flags = { + split: flagsStr.includes('layout:split'), + slider: flagsStr.includes('layout:slider'), + glow: flagsStr.includes('glow:true') + }; + + let nextLine = startLine; + let found = false; + let depth = 1; + let fenceMarker = null; + + while (nextLine < endLine) { + nextLine++; + if (nextLine >= endLine) break; + + const nextStart = state.bMarks[nextLine] + state.tShift[nextLine]; + const nextMax = state.eMarks[nextLine]; + const nextContent = state.src.slice(nextStart, nextMax).trim(); + + if (!fenceMarker) { + const match = nextContent.match(/^(`{3,}|~{3,})/); + if (match) fenceMarker = match[1]; + } else if (nextContent.startsWith(fenceMarker)) { + fenceMarker = null; + } + + if (!fenceMarker) { + if (nextContent.match(/^:::\s*[a-zA-Z]/) && !nextContent.match(/^:::\s*(button|embed|tag)\b/)) { + depth++; + } else if (nextContent.match(/^:::\s*$/)) { + depth--; + if (depth === 0) { + found = true; + break; + } + } + } + } + if (!found) return false; + + // Extract content + let content = ''; + for (let i = startLine + 1; i < nextLine; i++) { + const lineStart = state.bMarks[i]; + const lineEnd = state.eMarks[i]; + content += state.src.slice(lineStart, lineEnd) + '\n'; + } + + const lines = content.split('\n'); + + // Handle Sections based on separators (== side or == slide) + if (flags.slider) { + const slides = []; + let currentSlide = null; + let currentLines = []; + + for (let i = 0; i < lines.length; i++) { + const rawLine = lines[i]; + const trimmed = rawLine.trim(); + if (trimmed.startsWith('== slide')) { + if (currentSlide !== null) { + slides.push(smartDedent(currentLines.join('\n'))); + } + currentSlide = true; + currentLines = []; + } else { + currentLines.push(rawLine); + } + } + if (currentSlide !== null) slides.push(smartDedent(currentLines.join('\n'))); + + const slideCount = slides.length; + // Build Tokens + const openToken = state.push('hero_open', 'div', 1); + openToken.attrs = [['class', `docmd-hero hero-slider ${flags.glow ? 'hero-glow' : ''}`.trim()]]; + + const trackToken = state.push('hero_slider_track_open', 'div', 1); + trackToken.attrs = [['class', 'hero-slider-track']]; + + slides.forEach(slideContent => { + state.push('hero_slide_open', 'div', 1); + const rendered = state.md.render(slideContent, { ...state.env, isInsideContainer: true }); + const html = state.push('html_block', '', 0); + html.content = rendered; + state.push('hero_slide_close', 'div', -1); + }); + + state.push('hero_slider_track_close', 'div', -1); + + // Inject controls (prev/next + dots) + if (slideCount > 1) { + const prevSvg = ``; + const nextSvg = ``; + const dots = slides.map((_, i) => ``).join(''); + const controls = state.push('html_block', '', 0); + controls.content = `
+ +
${dots}
+ +
\n`; + } + + state.push('hero_close', 'div', -1); + + } else if (flags.split) { + const mainContentLines = []; + const sideContentLines = []; + let foundSeparator = false; + + for (let i = 0; i < lines.length; i++) { + const rawLine = lines[i]; + if (rawLine.trim().startsWith('== side')) { + foundSeparator = true; + continue; + } + if (foundSeparator) sideContentLines.push(rawLine); + else mainContentLines.push(rawLine); + } + + const openToken = state.push('hero_open', 'div', 1); + openToken.attrs = [['class', `docmd-hero hero-split ${flags.glow ? 'hero-glow' : ''}`.trim()]]; + + // Main Section + state.push('hero_content_open', 'div', 1); + const renderedMain = state.md.render(smartDedent(mainContentLines.join('\n')), { ...state.env, isInsideContainer: true }); + const htmlMain = state.push('html_block', '', 0); + htmlMain.content = renderedMain; + state.push('hero_content_close', 'div', -1); + + // Side Section + state.push('hero_side_open', 'div', 1); + const renderedSide = state.md.render(smartDedent(sideContentLines.join('\n')), { ...state.env, isInsideContainer: true }); + const htmlSide = state.push('html_block', '', 0); + htmlSide.content = renderedSide; + state.push('hero_side_close', 'div', -1); + + state.push('hero_close', 'div', -1); + + } else { + // Normal Banner Layout + const openToken = state.push('hero_open', 'div', 1); + openToken.attrs = [['class', `docmd-hero hero-banner ${flags.glow ? 'hero-glow' : ''}`.trim()]]; + + state.push('hero_content_open', 'div', 1); + const rendered = state.md.render(smartDedent(content), { ...state.env, isInsideContainer: true }); + const htmlAt = state.push('html_block', '', 0); + htmlAt.content = rendered; + state.push('hero_content_close', 'div', -1); + + state.push('hero_close', 'div', -1); + } + + state.line = nextLine + 1; + return true; +} + +export default { + name: 'hero', + setup(md) { + md.block.ruler.before('fence', 'docmd_hero', heroRule, { alt: ['paragraph', 'reference', 'blockquote', 'list'] }); + + md.renderer.rules.hero_open = (tokens, idx) => `
`; + md.renderer.rules.hero_close = () => '
\n'; + md.renderer.rules.hero_content_open = () => '
\n'; + md.renderer.rules.hero_content_close = () => '
\n'; + md.renderer.rules.hero_side_open = () => '
\n'; + md.renderer.rules.hero_side_close = () => '
\n'; + md.renderer.rules.hero_slider_track_open = () => '
\n'; + md.renderer.rules.hero_slider_track_close = () => '
\n'; + md.renderer.rules.hero_slide_open = () => '
\n'; + md.renderer.rules.hero_slide_close = () => '
\n'; + } +}; \ No newline at end of file diff --git a/packages/parser/src/features/index.ts b/packages/parser/src/features/index.ts new file mode 100644 index 0000000..4445183 --- /dev/null +++ b/packages/parser/src/features/index.ts @@ -0,0 +1,35 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/core (and ecosystem) + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + */ + +import common from './common-containers.js'; +export { createDepthTrackingContainer } from './common-containers.js'; +import tabs from './tabs.js'; +import steps from './steps.js'; +import changelog from './changelog.js'; +import buttons from './buttons.js'; +import basics from './basics.js'; +import embed from './embed.js'; +import hero from './hero.js'; + +import tags from './tags.js'; + +const FEATURES = [basics, buttons, tags, embed, common, tabs, steps, changelog, hero]; + +function registerFeatures(md) { + FEATURES.forEach(feature => { + if (feature.setup) feature.setup(md); + }); +} + +export { registerFeatures }; \ No newline at end of file diff --git a/packages/parser/src/features/steps.ts b/packages/parser/src/features/steps.ts new file mode 100644 index 0000000..cbdbaa9 --- /dev/null +++ b/packages/parser/src/features/steps.ts @@ -0,0 +1,128 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/core (and ecosystem) + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + */ + +function stepsRule(state, startLine, endLine, silent) { + const start = state.bMarks[startLine] + state.tShift[startLine]; + const max = state.eMarks[startLine]; + const lineContent = state.src.slice(start, max).trim(); + // Support both '::: steps' and ':::steps' (spaceless) + if (lineContent !== '::: steps' && lineContent !== ':::steps') return false; + if (silent) return true; + + let nextLine = startLine; + let found = false; + let depth = 1; + let fenceMarker = null; + + while (nextLine < endLine) { + nextLine++; + if (nextLine >= endLine) break; + + const nextStart = state.bMarks[nextLine] + state.tShift[nextLine]; + const nextMax = state.eMarks[nextLine]; + const nextContent = state.src.slice(nextStart, nextMax).trim(); + + if (!fenceMarker) { + const match = nextContent.match(/^(`{3,}|~{3,})/); + if (match) fenceMarker = match[1]; + } else if (nextContent.startsWith(fenceMarker)) { + fenceMarker = null; + } + + if (!fenceMarker) { + if (nextContent.match(/^:::\s*[a-zA-Z]/) && !nextContent.match(/^:::\s*button/)) { + depth++; + } else if (nextContent.match(/^:::\s*$/)) { + depth--; + if (depth === 0) { + found = true; + break; + } + } + } + } + + if (!found) return false; + + const openToken = state.push('steps_open', 'div', 1); + openToken.info = ''; + + const oldParentType = state.parentType; + const oldLineMax = state.lineMax; + state.parentType = 'container'; + state.lineMax = nextLine; + + state.md.block.tokenize(state, startLine + 1, nextLine); + + state.push('steps_close', 'div', -1); + + state.parentType = oldParentType; + state.lineMax = oldLineMax; + state.line = nextLine + 1; + return true; +} + +export default { + name: 'steps', + setup(md) { + md.block.ruler.before('fence', 'steps_container', stepsRule, { alt: ['paragraph', 'reference', 'blockquote', 'list'] }); + + // Module-level counter so each
  • gets a globally unique `id` + // (step-1, step-2, โ€ฆ) across the whole document. This matters for + // permalinks: clicking `#step-1` on a page with two step containers + // would otherwise scroll to the first match in both. + let stepIndex = 0; + + // Custom List Renderer for Steps + md.renderer.rules.steps_open = () => '
    '; + md.renderer.rules.steps_close = () => '
    '; + + // Hook into list rendering to add classes when inside steps + md.renderer.rules.ordered_list_open = function (tokens, idx, options, env, self) { + let isInSteps = false; + // Check tokens backward to see if we are inside a steps container + for (let i = idx - 1; i >= 0; i--) { + if (tokens[i].type === 'steps_open') { isInSteps = true; break; } + if (tokens[i].type === 'steps_close') break; + } + if (isInSteps) { + const start = tokens[idx].attrGet('start'); + return start ? `
      ` : '
        '; + } + return self.renderToken(tokens, idx, options); + }; + + // Lucide `link-2` icon โ€” same as the one used by .heading-anchor so the + // visual language stays consistent across the site. + const STEP_PERMALINK_SVG = ''; + + md.renderer.rules.list_item_open = function (tokens, idx, _options, _env, _self) { + let isInSteps = false; + for (let i = idx - 1; i >= 0; i--) { + if (tokens[i].type === 'steps_open') { isInSteps = true; break; } + if (tokens[i].type === 'steps_close') break; + } + if (isInSteps) { + stepIndex++; + // Render a permalink anchor that's hidden by default and revealed + // on hover. Uses `scroll-margin-top` via .step-item so jumping + // to the anchor lands just below the sticky header. + const id = `step-${stepIndex}`; + const permalink = `${STEP_PERMALINK_SVG}`; + return `
      1. ${permalink}`; + } + return '
      2. '; + }; + } +}; \ No newline at end of file diff --git a/packages/parser/src/features/tabs.ts b/packages/parser/src/features/tabs.ts new file mode 100644 index 0000000..422a2a5 --- /dev/null +++ b/packages/parser/src/features/tabs.ts @@ -0,0 +1,192 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/core (and ecosystem) + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + */ + +import { renderIcon } from '../utils/icon-renderer.js'; +import { parseTitleAndIcon } from '../utils/container-helper.js'; + +function smartDedent(str) { + const lines = str.split('\n'); + + // Ignore first and last blank lines (common in container blocks) + while (lines.length && lines[0].trim() === '') lines.shift(); + while (lines.length && lines[lines.length - 1].trim() === '') lines.pop(); + + let minIndent = Infinity; + + // Find minimum indentation of non-empty lines + for (const line of lines) { + if (!line.trim()) continue; + const indent = line.match(/^ */)[0].length; + minIndent = Math.min(minIndent, indent); + } + + // If no indentation to strip, return joined lines + if (!isFinite(minIndent) || minIndent === 0) return lines.join('\n'); + + // Strip exactly minIndent from each line + return lines.map(line => + line.startsWith(' '.repeat(minIndent)) + ? line.slice(minIndent) + : line + ).join('\n'); +} + +// The Parsing Rule +function tabsRule(state: any, startLine: number, endLine: number, silent: boolean) { + const start = state.bMarks[startLine] + state.tShift[startLine]; + const max = state.eMarks[startLine]; + const lineContent = state.src.slice(start, max).trim(); + + // Support both '::: tabs' and ':::tabs' (spaceless) + if (lineContent !== '::: tabs' && lineContent !== ':::tabs') return false; + if (silent) return true; + + let nextLine = startLine; + let found = false; + let depth = 1; + let fenceMarker = null; + + while (nextLine < endLine) { + nextLine++; + if (nextLine >= endLine) break; + + const nextStart = state.bMarks[nextLine] + state.tShift[nextLine]; + const nextMax = state.eMarks[nextLine]; + const nextContent = state.src.slice(nextStart, nextMax).trim(); + + if (!fenceMarker) { + const match = nextContent.match(/^(`{3,}|~{3,})/); + if (match) fenceMarker = match[1]; + } else if (nextContent.startsWith(fenceMarker)) { + fenceMarker = null; + } + + if (!fenceMarker) { + // Increment depth for block-level container openers only. + // Inline self-closing containers (tag, button, embed) must NOT affect depth + // because they have no matching closing `:::` - treating them as openers + // would make the tabs parser wait for an extra closing `:::` that never comes. + const INLINE_CONTAINERS = /^:::\s*(tag|button|embed)\b/; + if (nextContent.match(/^:::\s*[a-zA-Z]/) && !INLINE_CONTAINERS.test(nextContent)) { + depth++; + } else if (nextContent.match(/^:::\s*$/)) { + depth--; + if (depth === 0) { + found = true; + break; + } + } + } + } + if (!found) return false; + + // Extract content + let content = ''; + for (let i = startLine + 1; i < nextLine; i++) { + const lineStart = state.bMarks[i]; + const lineEnd = state.eMarks[i]; + content += state.src.slice(lineStart, lineEnd) + '\n'; + } + + // Parse "== tab" lines + const lines = content.split('\n'); + const tabs = []; + let currentTab = null; + let currentContentLines = []; + + for (let i = 0; i < lines.length; i++) { + const rawLine = lines[i]; + const trimmedLine = rawLine.trim(); + const tabMatch = trimmedLine.match(/^==\s*tab\s+(.*)/); + + if (tabMatch) { + if (currentTab) { + currentTab.content = smartDedent(currentContentLines.join('\n')); + tabs.push(currentTab); + } + const { title, icon } = parseTitleAndIcon(tabMatch[1]); + currentTab = { title, icon, content: '' }; + currentContentLines = []; + } else if (currentTab) { + currentContentLines.push(rawLine); + } + } + if (currentTab) { + currentTab.content = smartDedent(currentContentLines.join('\n')); + tabs.push(currentTab); + } + + // Generate Tokens + const openToken = state.push('tabs_open', 'div', 1); + openToken.attrs = [['class', 'docmd-tabs']]; + + state.push('tabs_nav_open', 'div', 1); + tabs.forEach((tab, index) => { + const navItemToken = state.push('tabs_nav_item', 'div', 0); + navItemToken.attrs = [['class', `docmd-tabs-nav-item ${index === 0 ? 'active' : ''}`]]; + if (tab.icon) { + navItemToken.attrs.push(['data-icon', state.md.utils.escapeHtml(tab.icon)]); + } + navItemToken.content = tab.title; + }); + state.push('tabs_nav_close', 'div', -1); + + state.push('tabs_content_open', 'div', 1); + tabs.forEach((tab, index) => { + const paneToken = state.push('tab_pane_open', 'div', 1); + paneToken.attrs = [['class', `docmd-tab-pane ${index === 0 ? 'active' : ''}`]]; + + if (tab.content) { + // Recurse parsing inside tabs and flag as inside container + const oldIsInsideContainer = state.env.isInsideContainer; + state.env.isInsideContainer = true; + + const renderedContent = state.md.render(tab.content, state.env); + + state.env.isInsideContainer = oldIsInsideContainer; + + const htmlToken = state.push('html_block', '', 0); + htmlToken.content = renderedContent; + } + state.push('tab_pane_close', 'div', -1); + }); + state.push('tabs_content_close', 'div', -1); + state.push('tabs_close', 'div', -1); + + state.line = nextLine + 1; + return true; +} + +export default { + name: 'tabs', + setup(md: any) { + md.block.ruler.before('fence', 'enhanced_tabs', tabsRule, { alt: ['paragraph', 'reference', 'blockquote', 'list'] }); + + // Register Renderers + md.renderer.rules.tabs_nav_open = () => '
        '; + md.renderer.rules.tabs_nav_close = () => '
        '; + md.renderer.rules.tabs_nav_item = (tokens, idx) => { + const iconAttr = tokens[idx].attrs.find(a => a[0] === 'data-icon'); + const icon = iconAttr ? iconAttr[1] : null; + const iconHtml = icon ? renderIcon(icon, { class: 'tab-icon' }) : ''; + const className = tokens[idx].attrs.find(a => a[0] === 'class')[1]; + return `
        ${iconHtml}${md.renderInline(tokens[idx].content)}
        `; + }; + md.renderer.rules.tabs_content_open = () => '
        '; + md.renderer.rules.tabs_content_close = () => '
        '; + md.renderer.rules.tab_pane_open = (tokens, idx) => `
        `; + md.renderer.rules.tab_pane_close = () => '
        '; + md.renderer.rules.tabs_close = () => '
  • '; + } +}; \ No newline at end of file diff --git a/packages/parser/src/features/tags.ts b/packages/parser/src/features/tags.ts new file mode 100644 index 0000000..839957c --- /dev/null +++ b/packages/parser/src/features/tags.ts @@ -0,0 +1,109 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/core (and ecosystem) + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + */ + +import { renderIcon } from '../utils/icon-renderer.js'; +import { resolveHref } from '../utils/normalize-href.js'; + +/** + * Strips a matched pair of surrounding quotes from a value if present. + * The tag options parser captures both quoted ("..." or '...') and + * unquoted forms in a single regex; this normalises them to a plain + * string before passing to downstream helpers like resolveHref. + */ +function unquote(value: string): string { + if (value.length >= 2) { + const first = value.charAt(0); + const last = value.charAt(value.length - 1); + if ((first === '"' && last === '"') || (first === "'" && last === "'")) { + return value.slice(1, -1); + } + } + return value; +} + +function tagInlineRule(state, silent) { + const start = state.pos; + const max = state.posMax; + + if (state.src.charCodeAt(start) !== 0x3A /* : */) return false; + if (state.src.slice(start, start + 3) !== ':::') return false; + + // We are at `:::`. Let's see if it's `::: tag` or `:::tag` (spaceless). + // + // Option values accept three forms so URLs and other values that + // contain reserved characters can be wrapped in quotes for clarity + // (matching the rule used by other docmd containers): + // - icon:check-circle (unquoted) + // - color:#ef4444 (unquoted) + // - url:"../../release.md" (double-quoted, recommended for URLs) + // - url:'../../release.md' (single-quoted) + // + // `url:` is the canonical name; `link:` is kept as an alias for + // backward compatibility with existing pages. + const match = state.src.slice(start, max).match( + /^:::\s*tag\s+(?:["']([^"']+)["']|(\S+))((?:\s+(?:icon|color|link|url):(?:"[^"]*"|'[^']*'|\S+))*)/ + ); + if (!match) return false; + + if (silent) return true; + + const text = match[1] || match[2] || 'Tag'; + const optionsStr = match[3] || ''; + + let icon = ''; + let color = ''; + let link = ''; + + const parts = optionsStr.trim().split(/\s+/); + for (const part of parts) { + if (!part) continue; + if (part.startsWith('icon:')) icon = unquote(part.substring(5)); + else if (part.startsWith('color:')) color = unquote(part.substring(6)); + else if (part.startsWith('link:')) link = unquote(part.substring(5)); + else if (part.startsWith('url:')) link = unquote(part.substring(4)); + } + + state.pos += match[0].length; + + const token = state.push('html_inline', '', 0); + + let styleAttr = ''; + if (color) { + styleAttr = ` style="--tag-color: ${color}; background-color: color-mix(in srgb, ${color} 15%, transparent); color: ${color}; border-color: color-mix(in srgb, ${color} 30%, transparent);"`; + } + + let iconHtml = ''; + if (icon) { + iconHtml = renderIcon(icon, { class: 'tag-icon', style: 'width:12px;height:12px;margin-right:4px;' }); + } + + let tagHtml = `${iconHtml}${state.md.renderInline(text)}`; + + if (link) { + const result = resolveHref(link); + const targetAttr = result.isExternal ? ' target="_blank" rel="noopener noreferrer"' : ''; + tagHtml = `${tagHtml}`; + } + + token.content = tagHtml; + + return true; +} + +export default { + name: 'tags', + setup(md) { + md.inline.ruler.before('text', 'docmd_tag_inline', tagInlineRule); + } +}; \ No newline at end of file diff --git a/packages/parser/src/html-renderer.ts b/packages/parser/src/html-renderer.ts new file mode 100644 index 0000000..a635657 --- /dev/null +++ b/packages/parser/src/html-renderer.ts @@ -0,0 +1,84 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/core (and ecosystem) + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + */ + +import tpl from 'lite-template'; +import { renderIcon } from './utils/icon-renderer.js'; + +/** + * Renders an EJS template string with provided data. + * + * Injects docmd-specific context helpers (renderIcon, fixLink). + * Utilizes lite-template natively, while passing a preprocessor hook + * to automatically strip YAML frontmatter out of any recursive file includes. + */ +async function renderTemplateAsync(templateString, data, options: any = {}) { + // Inject core helpers into every template + const fullData: any = { + ...data, + renderIcon, + // Helper to fix links relative to root + fixLink: (url) => fixHtmlLinks(url, data.relativePathToRoot, data.isOfflineMode, data.config?.base) + }; + + try { + const finalOptions = { + ...options, + async: true, + preprocessor: (content) => { + // Strip frontmatter from included files - frontmatter is a docmd concern, + // not an EJS/template concern. The top-level page's frontmatter is handled + // by processContent/lite-matter, but recursive includes should not re-render it. + const fmRegex = /^(?:---[\r\n]+)([\s\S]*?)(?:[\r\n]+---(?:[\r\n]+|$))/; + const fmMatch = content.match(fmRegex); + if (fmMatch) { + return content.slice(fmMatch[0].length); + } + return content; + } + }; + + return await tpl.render(templateString, fullData, finalOptions); + } catch (e) { + throw new Error(`Template Render Error: ${e.message}`); + } +} + +function fixHtmlLinks(url, root = './', isOffline = false, base = '/') { + if (!url || url.startsWith('http') || url.startsWith('#') || url.startsWith('mailto:')) return url; + + let final = url; + + // Strip base if present + if (base !== '/' && url.startsWith(base)) { + final = '/' + url.substring(base.length); + } + + // Make relative + if (final.startsWith('/')) { + final = root + final.substring(1); + } + + // Offline adjustments + if (isOffline) { + if (!final.includes('.') && !final.endsWith('/')) final += '/index.html'; + else if (final.endsWith('/')) final += 'index.html'; + } else { + // Clean URLs + if (final.endsWith('/index.html')) final = final.substring(0, final.length - 10); + } + + return final; +} + +export { renderTemplateAsync, fixHtmlLinks }; \ No newline at end of file diff --git a/packages/parser/src/index.ts b/packages/parser/src/index.ts new file mode 100644 index 0000000..2f0a8ce --- /dev/null +++ b/packages/parser/src/index.ts @@ -0,0 +1,62 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/core (and ecosystem) + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + */ + +import { createMarkdownProcessor, processContent, processContentAsync, flushNormaliserWarnings, setNormaliserVerbose } from './markdown-processor.js'; +import { renderTemplateAsync } from './html-renderer.js'; +import { renderIcon } from './utils/icon-renderer.js'; +import { validateConfig } from './utils/validator.js'; + +export { + // Logic + createMarkdownProcessor, + processContent, + processContentAsync, + renderTemplateAsync, + validateConfig, + + // Utils + renderIcon, + flushNormaliserWarnings, + setNormaliserVerbose +}; + +export { createDepthTrackingContainer } from './features/index.js'; +export { + normaliseContainers, + classifyLine, + indentOf, + SELF_CLOSING_CONTAINER_NAMES +} from './utils/container-normaliser.js'; +export type { + NormaliserWarning, + NormaliserWarningSeverity, + NormaliserResult, + NormaliserOptions +} from './utils/container-normaliser.js'; +export { findPageNeighbors, findBreadcrumbs } from './utils/navigation-helper.js'; +export { normalizeInternalHref, normalizeNavPaths, normalizeMenubarPaths, resolveHref } from './utils/normalize-href.js'; + +// Centralised URL Utilities - the single source of truth for all URL transformations. +// Plugins, templates, and engine components MUST use these instead of rolling their own. +export { + sanitizeUrl, + outputPathToSlug, + outputPathToPathname, + outputPathToCanonical, + buildContextualUrl, + createUrlContext, + computePageUrls, + buildAbsoluteUrl, +} from './utils/url-utils.js'; +export type { UrlContext, PageUrls } from './utils/url-utils.js'; \ No newline at end of file diff --git a/packages/parser/src/markdown-processor.ts b/packages/parser/src/markdown-processor.ts new file mode 100644 index 0000000..56b71cf --- /dev/null +++ b/packages/parser/src/markdown-processor.ts @@ -0,0 +1,567 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/core (and ecosystem) + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + */ + +import MarkdownIt from 'markdown-it'; +import matter from 'lite-matter'; +import { highlight } from 'lite-hl'; +import { resolveHref } from './utils/normalize-href.js'; +import { attrEsc } from '@docmd/utils'; +import { + normaliseContainers, + type NormaliserWarning +} from './utils/container-normaliser.js'; +import { fixHtmlLinks } from './html-renderer.js'; + +// URL schemes that can execute code or exfiltrate data when clicked. +// Phase 1.B (T-S4 fix, defense in depth): markdown-it 14 already rejects these +// at the parser layer, but we re-check inside the link_open override so any +// future refactor of the parser pipeline cannot accidentally re-introduce them. +const DANGEROUS_URL_SCHEMES = new Set([ + 'javascript:', + 'data:text/html', + 'vbscript:', + 'file:' +]); + +function isDangerousHref(href: string): boolean { + const lower = href.trim().toLowerCase(); + for (const prefix of DANGEROUS_URL_SCHEMES) { + if (lower.startsWith(prefix)) return true; + } + return false; +} + +/** + * Phase 2 (F1โ€“F5): accumulated warnings, summarised once at the end of + * the build via `flushNormaliserWarnings()`. Per-warning logging to + * stderr is opt-in via `setNormaliserVerbose(true)` so the dev-server + * console stays clean (one summary line per build instead of one line + * per warning) while CI / verbose mode still gets the full detail. + */ +const normaliserWarnings: NormaliserWarning[] = []; +let normaliserVerbose = false; + +function emitNormaliserWarning(w: NormaliserWarning): void { + normaliserWarnings.push(w); + if (normaliserVerbose) { + console.warn(`[normaliser] ${w.severity.toUpperCase()} ${w.path}:${w.line} โ€” ${w.message}`); + } +} + +export function setNormaliserVerbose(verbose: boolean): void { + normaliserVerbose = verbose; +} + +export function flushNormaliserWarnings(): void { + if (normaliserWarnings.length === 0) return; + const errors = normaliserWarnings.filter(w => w.severity === 'error').length; + const warnings = normaliserWarnings.length - errors; + const fileCount = new Set(normaliserWarnings.map(w => w.path)).size; + const severity = errors > 0 ? 'ERROR' : 'WARN'; + const tag = errors > 0 ? '\x1b[31m' : '\x1b[33m'; + const reset = '\x1b[0m'; + console.warn( + `${tag}[normaliser] ${severity}${reset} ` + + `${normaliserWarnings.length} issue${normaliserWarnings.length === 1 ? '' : 's'} ` + + `(${errors} error${errors === 1 ? '' : 's'}, ${warnings} warning${warnings === 1 ? '' : 's'}) ` + + `across ${fileCount} file${fileCount === 1 ? '' : 's'}. ` + + `Run with --verbose to list each one.` + ); + normaliserWarnings.length = 0; +} + +/** + * Phase 2 (F1โ€“F5): run the container normaliser on the markdown body before + * it is handed to markdown-it (and before any user plugin's `onBeforeParse` + * hook so they always see balanced input). + * + * The function is allocation-only on the input โ€” no module-level state โ€” so + * output is deterministic across worker threads. + */ +function applyContainerNormaliser(markdownContent: string, env: { filePath?: string }): string { + const norm = normaliseContainers(markdownContent, { + sourcePath: env && env.filePath ? env.filePath : '', + onWarning: emitNormaliserWarning + }); + return norm.source; +} + +// Standard Plugins +import attrs from 'markdown-it-attrs'; +import footnote from 'markdown-it-footnote'; +import taskLists from 'markdown-it-task-lists'; +import abbr from 'markdown-it-abbr'; +import deflist from 'markdown-it-deflist'; +import emoji from 'markdown-it-emoji'; + +// The Feature Registry +import { registerFeatures } from './features/index.js'; + +// Custom Heading ID & Anchor Logic +const headingIdPlugin = (md, options: any = {}) => { + const uiStrings = options.uiStrings || {}; + md.core.ruler.push('heading_anchors', function (state) { + let containerDepth = 0; + const lastHeadingIds = new Array(7).fill(null); + const usedIds = new Map(); + + for (let i = 0; i < state.tokens.length; i++) { + const token = state.tokens[i]; + + // Track block-level inline containers (like steps) + if (token.type === 'steps_open' || (token.type.startsWith('custom_') && token.type.endsWith('_open'))) { + containerDepth++; + } + if (token.type === 'steps_close' || (token.type.startsWith('custom_') && token.type.endsWith('_close'))) { + containerDepth--; + } + + const inContainer = state.env.isInsideContainer || containerDepth > 0; + + if (token.type === 'heading_open') { + const level = parseInt(token.tag.slice(1), 10); + const inlineToken = state.tokens[i + 1]; + + // 1. Generate ID if not present and NOT in a container + let id = token.attrGet('id'); + if (!id && inlineToken && inlineToken.content && !inContainer) { + const slug = inlineToken.content + .toLowerCase() + .trim() + .replace(/\s+/g, '-') + .replace(/[^\p{L}\p{N}-]+/gu, '') + .replace(/--+/g, '-') + .replace(/^-+/, '') + .replace(/-+$/, ''); + + if (slug) { + // Find parent ID from previous levels + let parentId = null; + for (let j = level - 1; j >= 1; j--) { + if (lastHeadingIds[j]) { + parentId = lastHeadingIds[j]; + break; + } + } + + id = parentId ? `${parentId}-${slug}` : slug; + + // Handle hard collisions (same heading sequence twice) + if (usedIds.has(id)) { + const count = usedIds.get(id); + usedIds.set(id, count + 1); + id = `${id}-${count}`; + } else { + usedIds.set(id, 1); + } + + token.attrSet('id', id); + lastHeadingIds[level] = id; + // Clear deeper levels to prevent wrong parent nesting on backtrack + for (let j = level + 1; j <= 6; j++) lastHeadingIds[j] = null; + } + } + + // If we are in a container, strip existing IDs so they don't break the TOC parsing + if (inContainer) { + if (token.attrs) { + token.attrs = token.attrs.filter(a => a[0] !== 'id'); + } + id = null; + } + + // 2. Inject Hover Anchor as an HTML Token (for H1, H2, H3, H4) + if (id && level >= 1 && level <= 4 && !inContainer) { + const existingClass = token.attrGet('class') || ''; + token.attrSet('class', `${existingClass} docmd-heading`.trim()); + + if (inlineToken && inlineToken.children) { + const anchorToken = new state.Token('html_inline', '', 0); + const anchorLabel = uiStrings.permalinkToSection || 'Permalink to this section'; + anchorToken.content = ``; + + // Insert the anchor at the beginning of the heading text + inlineToken.children.unshift(anchorToken); + } + } + } + } + }); +}; + +// Main Factory Function to Create a Markdown Processor +function createMarkdownProcessor(config: any = {}, pluginsCallback: any) { + // HTML policy from config (Phase 0.D, default 'escape'). + // 'allow' -> markdown-it html: true (raw HTML passes through, UNSAFE) + // 'escape' -> markdown-it html: false (HTML escaped and shown as text) + // 'strip' -> html: false + disable html_block/html_inline rules (HTML removed) + const htmlPolicy = (config && config.security && config.security.html) || 'escape'; + const mdOptions: any = { + html: htmlPolicy === 'allow', + linkify: true, + typographer: true, + breaks: config.markdown?.breaks ?? true, + }; + + // Syntax Highlighting (title extraction is handled separately in the fence renderer) + const highlightFn = (str, lang) => { + if (lang === 'mermaid') { + return `
    ${new MarkdownIt().utils.escapeHtml(str)}
    `; + } + const highlighted = highlight(str, { language: lang, mimicHljs: true }).value; + // Tag the code with language-xxx so consumers (e.g. the summer + // template's codeblock title bar) can pick up the language. + const langAttr = lang ? ` class="language-${lang}"` : ''; + return `
    ${highlighted}
    `; + }; + + mdOptions.highlight = config.theme?.codeHighlight !== false ? highlightFn : (str: any, lang: any) => { + if (lang === 'mermaid') return `
    ${new MarkdownIt().utils.escapeHtml(str)}
    `; + const langAttr = lang ? ` class="language-${lang}"` : ''; + return `
    ${new MarkdownIt().utils.escapeHtml(str)}
    `; + }; + + const md = new MarkdownIt(mdOptions); + + // 'strip' policy: drop html_block and html_inline rules entirely so HTML + // tokens are never emitted. Distinct from 'escape' which keeps tokens and + // HTML-escapes their content. + if (htmlPolicy === 'strip') { + md.disable(['html_block', 'html_inline']); + } + + // Core Plugins + md.use(attrs, { leftDelimiter: '{', rightDelimiter: '}' }); + md.use(footnote); + md.use(taskLists); + md.use(abbr); + md.use(deflist); + md.use(emoji); + md.use(headingIdPlugin, { uiStrings: config._uiStrings || {} }); + + // Register Built-in Features + registerFeatures(md); + + // External Plugins Hook + if (typeof pluginsCallback === 'function') { + pluginsCallback(md); + } + + // Custom Fence Renderer: Extracts title from token.info (e.g., ```js "filename.js") + // markdown-it only passes the first word as `lang` to highlight(), so the title + // in quotes never reaches the highlight function. We intercept it here instead. + const defaultFence = md.renderer.rules.fence.bind(md.renderer.rules); + md.renderer.rules.fence = function (tokens, idx, options, env, self) { + const token = tokens[idx]; + const info = (token.info || '').trim(); + + // Match: language "title" or language 'title' + const titleMatch = info.match(/^[a-zA-Z0-9+#*-]*\s+["']([^"']+)["']/); + + // Get the default rendered output (which includes the highlighted code) + const rendered = defaultFence(tokens, idx, options, env, self); + + if (titleMatch) { + const title = titleMatch[1]; + return `
    ${title}
    ${rendered}
    `; + } + + return rendered; + }; + + const defaultLinkOpen = md.renderer.rules.link_open || function (tokens, idx, options, env, self) { + return self.renderToken(tokens, idx, options); + }; + + md.renderer.rules.link_open = function (tokens, idx, options, env, self) { + const token = tokens[idx]; + const hrefIndex = token.attrIndex('href'); + + if (hrefIndex >= 0) { + const href = token.attrs[hrefIndex][1]; + + // Phase 1.B (T-S4 fix): drop dangerous schemes. The link is rendered as + // a safe hash-anchor instead so the surrounding text still appears as a + // clickable (but inert) element. + if (isDangerousHref(href)) { + token.attrs[hrefIndex][1] = '#'; + return self.renderToken(tokens, idx, options); + } + + const isHashOnly = href.startsWith('#'); + const isAsset = href.match(/(^|\/)assets\//); + + if (!isHashOnly && !isAsset) { + const result = resolveHref(href); + + if (!result.isRaw) { + let pathPart = result.href; + let hashPart = ''; + const hi = pathPart.indexOf('#'); + if (hi >= 0) { + hashPart = pathPart.substring(hi); + pathPart = pathPart.substring(0, hi); + } + + // Depth adjustment for clean URLs (non-index pages are shifted into subfolders) + const isProtocol = pathPart.match(/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i); + if (!isProtocol && !pathPart.startsWith('/') && env && env.isIndex === false) { + if (pathPart.startsWith('./')) { + pathPart = '../' + pathPart.substring(2); + } else if (pathPart !== '') { + pathPart = '../' + pathPart; + } + } + + token.attrs[hrefIndex][1] = pathPart + hashPart; + } else { + token.attrs[hrefIndex][1] = result.href; + } + + // Apply external attributes + if (result.isExternal) { + token.attrSet('target', '_blank'); + token.attrSet('rel', 'noopener noreferrer'); + } + } + } + return defaultLinkOpen(tokens, idx, options, env, self); + }; + + return md; +} + +function stripHtml(html) { + if (!html) return ''; + return html.replace(/<[^>]*>?/gm, ''); +} + +function decodeHtmlEntities(str: string): string { + if (!str) return ''; + return str + .replace(/&/g, '&') + .replace(/</g, '<') + .replace(/>/g, '>') + .replace(/"/g, '"') + .replace(/'/g, "'") + .replace(/'/g, "'") + .replace(/’/g, "'") + .replace(/‘/g, "'") + .replace(/”/g, '"') + .replace(/“/g, '"') + .replace(/ /g, ' '); +} + +function extractHeadings(html) { + const headings = []; + // Require non-empty ID match to exclude stripped container headings: "([^"]+)" + const regex = /]*?id="([^"]+)"[^>]*?>([\s\S]*?)<\/h\1>/g; + let match; + while ((match = regex.exec(html)) !== null) { + const rawText = match[3].replace(/<\/?[^>]+(>|$)/g, '').trim(); + headings.push({ + level: parseInt(match[1], 10), + id: match[2], + text: decodeHtmlEntities(rawText) + }); + } + return headings; +} + +function processContent(rawString, mdInstance, config, env = {}) { + let frontmatter, markdownContent; + + try { + const parsed = matter(rawString); + frontmatter = parsed.data; + markdownContent = parsed.content; + } catch (e) { + console.error('Error parsing frontmatter:', e.message); + return null; + } + + if (!frontmatter.title && config.autoTitleFromH1 !== false) { + const h1Match = markdownContent.match(/^#\s+(.*)/m); + if (h1Match) frontmatter.title = h1Match[1].trim(); + } + + // Phase 2 (F1โ€“F5): rewrite unbalanced `:::` containers so the existing + // depth-tracking block rule in features/common-containers.ts always sees + // a matching close. + markdownContent = applyContainerNormaliser(markdownContent, env); + + const htmlContent = mdInstance.render(markdownContent, env); + const headings = extractHeadings(htmlContent); + + let searchData = null; + if (!frontmatter.noindex) { + searchData = { + title: frontmatter.title || 'Untitled', + content: stripHtml(htmlContent).slice(0, 5000), + headings: headings.map(h => ({ id: h.id, text: h.text })) + }; + } + + return { frontmatter, htmlContent, headings, searchData }; +} + +async function processContentAsync(rawString: string, mdInstance: any, config: any, env: any = {}, hooks: any = null) { + let frontmatter, markdownContent; + + try { + const parsed = matter(rawString); + frontmatter = parsed.data; + markdownContent = parsed.content; + } catch (e) { + console.error('Error parsing frontmatter:', e.message); + return null; + } + + // Phase 2 (F1โ€“F5): rewrite unbalanced `:::` containers BEFORE user plugins + // so they always see balanced input, and BEFORE markdown-it so the + // depth-tracking block rule can match every container it sees. + markdownContent = applyContainerNormaliser(markdownContent, env); + + if (hooks && hooks.onBeforeParse) { + for (const fn of hooks.onBeforeParse) { + // D-H7: previously a throw from any plugin's onBeforeParse would + // either propagate up (abort the file) or, after the safeCall + // wrapper landed, leave `markdownContent` set to `undefined` and + // crash the next iteration. We now catch each plugin's throw + // locally, log it via TUI, and keep walking the chain so plugins + // B, C, ... still see input (even if A's contribution is lost). + try { + const next = await fn(markdownContent, frontmatter, env.filePath); + // Only adopt the plugin's output if it returned a string. + // Plugins that want to "skip" should return undefined (we keep + // the previous markdown) rather than returning null. + if (typeof next === 'string') { + markdownContent = next; + } + } catch (err: any) { + const msg = err && err.message ? err.message : String(err); + console.error(`[parser] onBeforeParse plugin threw: ${msg}`); + } + } + } + + if (!frontmatter.title && config.autoTitleFromH1 !== false) { + const h1Match = markdownContent.match(/^#\s+(.*)/m); + if (h1Match) frontmatter.title = h1Match[1].trim(); + } + + let htmlContent = mdInstance.render(markdownContent, env); + if (env) { + htmlContent = stripDefaultLocalePrefix(htmlContent, env.defaultLocale, env.allLocales, env.relativePathToRoot || './'); + if (env.isOfflineMode === true) { + htmlContent = rewriteInternalHrefsForOffline(htmlContent, env.relativePathToRoot || './', env.config?.base || '/'); + } else { + // M-5 also affects online builds: `fr/index.html` linking to + // `/en/` is a 404 on HTTP servers too, not just file://. Run the + // same fixHtmlLinks pass (without the offline-specific `index.html` + // suffix) so cross-locale paths stay clean and correct. + htmlContent = fixHtmlLinks(htmlContent, env.relativePathToRoot || './', env.config?.base || '/'); + } + } + + if (hooks && hooks.onAfterParse) { + for (const fn of hooks.onAfterParse) { + htmlContent = await fn(htmlContent, frontmatter, env.filePath); + } + } + + const headings = extractHeadings(htmlContent); + + let searchData = null; + if (!frontmatter.noindex) { + searchData = { + title: frontmatter.title || 'Untitled', + content: stripHtml(htmlContent).slice(0, 5000), + headings: headings.map((h: any) => ({ id: h.id, text: h.text })) + }; + } + + return { frontmatter, htmlContent, headings, searchData }; +} + +/** + * M-5: strip the default-locale prefix from absolute hrefs in the rendered + * HTML. The default locale lives at root, not under its own prefix, so a + * link like `/en/foo` from a non-default-locale page is a 404 unless the + * prefix is dropped. We only run this when the source page is in a + * non-default locale (which is when the default-locale prefix could + * actually appear in author-written links). + * + * The function only touches absolute paths under root, only when the + * first segment matches the default locale id, and never touches + * external URLs / anchors / mailto. + */ +function stripDefaultLocalePrefix(html: string, defaultLocale: string | null, allLocales: string[] | undefined, _relativePathToRoot: string): string { + if (!defaultLocale || !allLocales || allLocales.length < 2) return html; + // Escape regex special chars in the locale id (e.g. "en-us" with hyphen). + const escaped = defaultLocale.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); + // Match `` and `` where xx is the + // default locale. We do NOT touch `src=` (img) because images are + // typically under /assets/ and never locale-prefixed. We do NOT touch + // bare `/xx` at end of attribute (rare author pattern) โ€” that case is + // ambiguous and the user can write `/` instead. + const re = new RegExp(`(]*?\\bhref\\s*=\\s*)(["'])(\\/${escaped}\\/)([^"'#]*)\\2`, 'gi'); + return html.replace(re, (_full, prefix, quote, _stripped, rest) => { + return `${prefix}${quote}/${rest}${quote}`; + }); +} + +/** + * Walk every `` and `` in a piece of rendered + * HTML and rewrite internal links for offline mode. External URLs (http, + * https, mailto, tel, javascript, etc.), hash-only anchors, and asset paths + * are passed through unchanged. + * + * The function is intentionally permissive on the regex: it tolerates + * attribute ordering, single or double quotes, and surrounding whitespace. + * The result is intentionally not run through a full HTML parser because + * the document we're rewriting is the markdown-rendered fragment, not a + * full HTML page, and we don't want to introduce a new dependency. + */ +function rewriteInternalHrefsForOffline(html: string, relativePathToRoot: string, base: string): string { + // `` rewriting โ€” covers markdown link `[text](url)`. + html = html.replace( + /]*?)\bhref\s*=\s*("([^"]*)"|'([^']*)')([^>]*)>/gi, + (full, _pre, quoted, dq, sq, _post) => { + const href = dq !== undefined ? dq : sq; + const fixed = fixHtmlLinks(href, relativePathToRoot, true, base); + if (fixed === href) return full; + const originalQuote = quoted.charAt(0); + return full.replace(quoted, originalQuote + fixed + originalQuote); + } + ); + // `` rewriting โ€” covers markdown image `![alt](src)`. + // The button template goes through `fixLink`, but markdown-it emits + // `` directly without any template helper. Without this pass the + // offline HTML keeps `` which `file://` + // cannot resolve (it's an absolute path with no host). + html = html.replace( + /]*?)\bsrc\s*=\s*("([^"]*)"|'([^']*)')([^>]*)>/gi, + (full, _pre, quoted, dq, sq, _post) => { + const src = dq !== undefined ? dq : sq; + const fixed = fixHtmlLinks(src, relativePathToRoot, true, base); + if (fixed === src) return full; + const originalQuote = quoted.charAt(0); + return full.replace(quoted, originalQuote + fixed + originalQuote); + } + ); + return html; +} + +export { createMarkdownProcessor, processContent, processContentAsync }; \ No newline at end of file diff --git a/packages/parser/src/utils/container-helper.ts b/packages/parser/src/utils/container-helper.ts new file mode 100644 index 0000000..9bf50a4 --- /dev/null +++ b/packages/parser/src/utils/container-helper.ts @@ -0,0 +1,35 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/core (and ecosystem) + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + */ + +/** + * Extracts a quoted title (e.g., "My Title") and an optional icon (e.g., icon:rocket) from a string. + * This is the standard parser for docmd containers (callouts, cards, tabs, etc.) + * + * @param {string} info - The raw info string to parse + * @returns {{ title: string, icon: string }} + */ +export function parseTitleAndIcon(info) { + if (!info) return { title: '', icon: '' }; + let icon = ''; + const iconMatch = info.match(/icon:([a-zA-Z0-9-]+)/); + if (iconMatch) { + icon = iconMatch[1]; + info = info.replace(iconMatch[0], ''); + } + + const titleMatch = info.match(/"([^"]*)"/); + const title = titleMatch ? titleMatch[1] : info.trim(); + + return { title, icon }; +} \ No newline at end of file diff --git a/packages/parser/src/utils/container-normaliser.ts b/packages/parser/src/utils/container-normaliser.ts new file mode 100644 index 0000000..46b0c14 --- /dev/null +++ b/packages/parser/src/utils/container-normaliser.ts @@ -0,0 +1,314 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/parser + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + */ + +/** + * Container normaliser + * ==================== + * + * Single-pass linear scan that rewrites `:::` container markdown so that + * the existing depth-tracking block rules in `features/common-containers.ts` + * always see balanced open/close pairs. + * + * The classic bugs this addresses: + * + * F1 โ€” depth tracker is indentation-blind. + * `::: grids` + Nร—` ::: grid` + Nร—`:::` (one per card) + * leaves depth > 0 and the block rule fails to match, so the + * whole grids block is dumped as raw `

    ::: grids
    ...

    `. + * F2 โ€” `::: tag` is self-closing but the next orphan `:::` still + * decrements depth of the wrong container. + * F3 โ€” `::: callout ... ::: card ... :::` silently re-roots. + * F4 โ€” bare `:::` lines leak into the page as `

    :::

    ` paragraphs. + * F5 โ€” 5+ levels of nesting survive when opens and closes are balanced, + * but unbalanced user input collapses inner levels. + * + * The algorithm is the same one documented in + * `battle-test-reports/robust-parser-shim/index.js` (146 lines, + * dependency-free). This file is the in-tree port โ€” no plugins, no + * configuration, always-on. + * + * Output is deterministic: the function is a pure function of its input. + * Two worker threads given the same source produce byte-identical output. + * + * โ”€โ”€โ”€ DETERMINISM AUDIT โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ + * Phase 2 (worker-shared-state fix). This module deliberately does NOT + * use any of the following non-deterministic primitives. Adding any of + * them is a regression and must be flagged in code review. + * + * โœ— `Date.now()` / `new Date()` โ€” wall-clock time + * โœ— `Math.random()` / `crypto.randomUUID` โ€” entropy source + * โœ— module-level `let` / `var` โ€” mutable shared state + * โœ— `console.log` from inside `normaliseContainers` (use the + * `onWarning` callback instead โ€” `console.log` does not affect + * output but `DOCMD_ROBUST_DEBUG=1` enables it for ad-hoc tracing) + * โœ— reading from `process.env` โ€” env may differ per worker + * (use `options` instead) + * + * The only module-level binding is `SELF_CLOSING_CONTAINER_NAMES`, a + * frozen `ReadonlySet` that is constructed once at module load + * and never mutated. Safe to share across workers. + * + * The empirical guarantee lives in three places: + * 1. `packages/parser/test/container-normaliser.test.js` โ€” replay + * determinism, 100-way concurrency, and cross-worker + * `node:worker_threads` determinism. + * 2. `packages/core/src/engine/worker-parser.ts` boot-time self-test + * (`verifyDeterminismAtBoot`). + * 3. The manual end-to-end check at the bottom of this file's docstring. + * โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ + */ + +/** + * Container names that produce a single line (no body, no close). + * These are matched by name in the open line and the line is passed + * through unchanged; any stray `:::` that follows them is a user mistake + * (F2) and is removed. + */ +export const SELF_CLOSING_CONTAINER_NAMES: ReadonlySet = new Set([ + 'button', + 'tag', + 'embed' +]); + +/** + * Severity levels for normaliser warnings. Mirrors the three messages the + * shim emits so downstream consumers can route by severity if they want. + */ +export type NormaliserWarningSeverity = 'warning' | 'info' | 'error'; + +export interface NormaliserWarning { + /** 1-indexed line number in the original source. */ + line: number; + severity: NormaliserWarningSeverity; + /** Path of the source file (or `` when synthetic). */ + path: string; + message: string; +} + +export interface NormaliserResult { + /** Rewritten source with implicit closes added and stray closes removed. */ + source: string; + warnings: NormaliserWarning[]; +} + +export interface NormaliserOptions { + /** Path used in warning messages. Defaults to ``. */ + sourcePath?: string; + /** When true, print debug lines to stdout. Defaults to false. */ + debug?: boolean; + /** Optional sink for warnings โ€” useful for tests and structured logging. */ + onWarning?: (warning: NormaliserWarning) => void; +} + +interface ClassifiedLine { + kind: 'open' | 'close' | 'other'; + name?: string; +} + +interface OpenFrame { + name: string; + /** 1-indexed line number where this container was opened. */ + line: number; + /** Indent (in spaces) of the line that opened the container. */ + indent: number; +} + +/** + * Count the leading spaces of a line. Tabs are not interpreted โ€” markdown + * container indentation is conventionally spaces. + */ +export function indentOf(line: string): number { + const m = line.match(/^ */); + return m ? m[0].length : 0; +} + +/** + * Classify a single source line as `open`, `close`, or `other`. + * + * open โ€” `::: ...` where `` starts with a letter. + * Self-closing names (`button`, `tag`, `embed`) are still + * classified as `open` โ€” the algorithm distinguishes them via + * the SELF_CLOSING_CONTAINER_NAMES set, not here. + * close โ€” bare `:::` with optional surrounding whitespace. + * other โ€” anything else, passed through verbatim. + */ +export function classifyLine(line: string): ClassifiedLine { + if (/^\s*:::\s*[a-zA-Z]/.test(line)) { + const m = line.match(/^\s*:::\s*([a-zA-Z][\w-]*)/); + return { kind: 'open', name: m ? m[1] : undefined }; + } + if (/^\s*:::\s*$/.test(line)) { + return { kind: 'close' }; + } + return { kind: 'other' }; +} + +/** + * Rewrite a markdown source so that every `:::` block has a matching close. + * + * The function never throws; instead it returns the rewritten source plus + * an array of warnings. Callers may surface warnings through `console.warn`, + * a structured logger, or both via `options.onWarning`. + * + * The algorithm is allocation-conscious (single array of output lines, single + * stack of open frames) but readability is prioritised over micro-optimisation. + */ +export function normaliseContainers( + source: string, + options: NormaliserOptions | string = {} +): NormaliserResult { + // Allow the legacy 2-arg call signature `normaliseContainers(src, path)` so + // any in-flight plugin code keeps working. + const opts: NormaliserOptions = typeof options === 'string' + ? { sourcePath: options } + : options; + + const sourcePath = opts.sourcePath || ''; + const debug = opts.debug === true; + const onWarning = typeof opts.onWarning === 'function' ? opts.onWarning : null; + + const lines = source.split('\n'); + const out: string[] = []; + const stack: OpenFrame[] = []; + const warnings: NormaliserWarning[] = []; + + // Fenced code block tracking โ€” see the in-loop comment below. + let inFence = false; + let fenceMarker: string | null = null; + + const recordWarning = (w: NormaliserWarning): void => { + warnings.push(w); + if (onWarning) onWarning(w); + }; + + for (let i = 0; i < lines.length; i++) { + const line = lines[i]; + const cls = classifyLine(line); + const indent = indentOf(line); + + // Fenced code block tracking. The normaliser must not interpret + // `:::` lines that appear inside a ``` fence as container opens or + // closes โ€” they are literal text in a code listing. Without this + // check, any docs page that shows a `::: card ... :::` example + // inside a markdown code fence triggers a spurious "Unclosed + // " error (the fence-opened line is classified as an open, + // pushed on the stack, and never matched because the matching ::: + // is also inside the fence and would have been the close). + // + // We track the fence by its opening marker (``` or ~~~) and close + // on the same marker at the start of a later line. Tildes are + // included because CommonMark allows ~~~ as an alternative fence. + if (inFence) { + // Pass through verbatim; only check for the matching close marker. + if (/^\s*(```+|~~~+)/.test(line) && line.trimStart().startsWith(fenceMarker!)) { + inFence = false; + fenceMarker = null; + } + out.push(line); + continue; + } + const fenceMatch = line.match(/^\s*(`{3,}|~{3,})/); + if (fenceMatch) { + inFence = true; + fenceMarker = fenceMatch[1][0]; // '`' or '~' + out.push(line); + continue; + } + + if (cls.kind === 'open') { + // The shim's classification only tells us the line LOOKS like an open; + // the SELF_CLOSING set is the source of truth for whether the body + // exists. Without this distinction `::: tag` would corrupt depth (F2). + if (cls.name && SELF_CLOSING_CONTAINER_NAMES.has(cls.name)) { + out.push(line); + if (debug) { + console.log(`[normaliser] ${sourcePath}:${i + 1} self-close <${cls.name}>`); + } + continue; + } + + stack.push({ name: cls.name || '', line: i + 1, indent }); + out.push(line); + continue; + } + + if (cls.kind === 'close') { + // Walk the stack from innermost outward and find the first open whose + // indent is <= this close's indent. That is the container this `:::` + // logically closes โ€” anything above it was closed implicitly by the + // same user gesture. + let matchIdx = -1; + for (let j = stack.length - 1; j >= 0; j--) { + if (stack[j].indent <= indent) { + matchIdx = j; + break; + } + } + + if (matchIdx === -1) { + recordWarning({ + line: i + 1, + severity: 'warning', + path: sourcePath, + message: 'Stray `:::` removed. Common cause: `::: tag ... :::` (tag is self-closing).' + }); + continue; + } + + const closed = stack.splice(matchIdx); + const outerIndent = closed[0].indent; + + // Emit one `:::` per closed entry, all at the outer indent. The + // upstream parser's `smartDedent` collapses higher indents to the + // outer indent, so N closes at the outer indent correctly pop N + // entries from its depth counter. + for (let k = 0; k < closed.length; k++) { + out.push(' '.repeat(outerIndent) + ':::'); + } + + if (closed.length > 1) { + recordWarning({ + line: i + 1, + severity: 'info', + path: sourcePath, + message: + `Closed ${closed.length} containers implicitly (` + + closed.map((c) => `<${c.name}>`).join(' > ') + + `). Added ${closed.length - 1} explicit \`:::\` closes.` + }); + } + continue; + } + + out.push(line); + } + + // Auto-close anything still on the stack at EOF. Without this the upstream + // block rule would loop to endLine without finding a close and the whole + // container would be dropped (F1, F3). + for (let i = stack.length - 1; i >= 0; i--) { + const frame = stack[i]; + recordWarning({ + line: frame.line, + severity: 'error', + path: sourcePath, + message: `Unclosed \`<${frame.name}>\` from line ${frame.line} โ€” auto-closed at EOF.` + }); + out.push(' '.repeat(frame.indent) + ':::'); + } + + return { source: out.join('\n'), warnings }; +} + +export default normaliseContainers; \ No newline at end of file diff --git a/packages/parser/src/utils/icon-renderer.ts b/packages/parser/src/utils/icon-renderer.ts new file mode 100644 index 0000000..8ab5bf5 --- /dev/null +++ b/packages/parser/src/utils/icon-renderer.ts @@ -0,0 +1,60 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/core (and ecosystem) + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + */ + +import * as lucideStatic from 'lucide-static'; + +// Convert kebab-case to PascalCase (e.g., arrow-right -> ArrowRight) +function kebabToPascal(str: string): string { + return str.split('-').map((p: string) => p.charAt(0).toUpperCase() + p.slice(1)).join(''); +} + +const exceptions: any = { + 'arrow-up-right-square': 'ExternalLink', + 'file-cog': 'Settings', + 'cloud-upload': 'UploadCloud' +}; + +function escapeHtml(str: any): string { + const s = typeof str === 'string' ? str : String(str || ''); + return s.replace(/[&<>"']/g, m => ({ + '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' + })[m] as string); +} + +function renderIcon(name: string, options: any = {}) { + if (!name) return ''; + + const key = exceptions[name] || kebabToPascal(name); + const svgData = (lucideStatic as any)[key]; + + if (!svgData) return ''; // Fail silently or warn via callback + + const escape = escapeHtml; + + // Inject attributes into the raw SVG string + const attrs = [ + `class="lucide-icon icon-${escape(name)} ${escape(options.class || '')}"`, + `width="${escape(options.width || '1em')}"`, + `height="${escape(options.height || '1em')}"`, + `stroke="${escape(options.stroke || 'currentColor')}"`, + `stroke-width="${escape(options.strokeWidth || 2)}"`, + 'fill="none"', + 'stroke-linecap="round"', + 'stroke-linejoin="round"' + ].join(' '); + + return svgData.replace(' item.canonical === currentCanonical); + + return { + prevPage: index > 0 ? flatNavigation[index - 1] : null, + nextPage: index < flatNavigation.length - 1 ? flatNavigation[index + 1] : null + }; +} + +function findBreadcrumbs(navItems, currentPagePath) { + const currentCanonical = getCanonicalPath(currentPagePath); + let breadcrumbs = []; + + function recurse(items, currentTrail = []) { + if (!items) return false; + for (const item of items) { + const trail = [...currentTrail, { title: item.title, path: item.path }]; + + if (item.path && getCanonicalPath(item.path) === currentCanonical) { + breadcrumbs = trail; + return true; + } + + if (item.children) { + if (recurse(item.children, trail)) return true; + } + } + return false; + } + + recurse(navItems); + return breadcrumbs; +} + +export { findPageNeighbors, findBreadcrumbs }; \ No newline at end of file diff --git a/packages/parser/src/utils/normalize-href.ts b/packages/parser/src/utils/normalize-href.ts new file mode 100644 index 0000000..4d8e232 --- /dev/null +++ b/packages/parser/src/utils/normalize-href.ts @@ -0,0 +1,195 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/core (and ecosystem) + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + */ + +/** + * Result of processing a href through the normaliser. + */ +export interface NormalizedHref { + /** The cleaned, SEO-safe href */ + href: string; + /** Whether the link should open in a new tab */ + isExternal: boolean; + /** Whether the link should skip normalisation (raw file reference) */ + isRaw: boolean; +} + +/** + * Centralised internal href normaliser. + * + * Converts any user-written link format into a clean, SEO-optimised URL + * that ends with a trailing slash (for directory-style pages) or is left + * untouched (for external, hash-only, or asset links). + * + * Supports special prefixes: + * - `external:` - forces the link to open in a new tab (strips prefix) + * - `raw:` - bypasses normalisation (strips prefix, keeps extension) + * + * Supported input formats (all produce the same output): + * - overview.md โ†’ overview/ + * - overview โ†’ overview/ + * - overview/ โ†’ overview/ + * - ./overview.md โ†’ ./overview/ + * - ../api/commands.md โ†’ ../api/commands/ + * - localisation/index.md โ†’ localisation/ + * - ./content/index.md โ†’ ./content/ + * - ../index.md โ†’ ../ + * - index.md โ†’ (empty string - root of current dir) + * - /absolute/path.md โ†’ /absolute/path/ + * - #section โ†’ #section (unchanged) + * - https://example.com โ†’ https://example.com (unchanged, auto-external) + * - mailto:hi@docmd.io โ†’ mailto:hi@docmd.io (unchanged) + * - external:overview.md โ†’ overview/ (opens in new tab) + * - raw:docs/readme.md โ†’ docs/readme.md (no normalisation) + * + * @param href The raw href string from a markdown link, button, or nav config. + * @returns The normalised result with external/raw flags. + */ +export function resolveHref(href: string): NormalizedHref { + if (!href) return { href, isExternal: false, isRaw: false }; + + // 1. Handle `raw:` prefix - bypass all normalisation, keep extension + if (href.startsWith('raw:')) { + return { href: href.slice(4), isExternal: false, isRaw: true }; + } + + // 2. Handle `external:` prefix - normalise but flag as external + // Users must explicitly use external: prefix to open in new tab + let isExternal = false; + if (href.startsWith('external:')) { + href = href.slice(9); + isExternal = true; + } + + // 3. Auto-detect external protocols (only for detection, not for new-tab behavior) + // This info can be used separately if needed, but we don't set isExternal here + // to give users control over their own docs links + + // 4. Pass through: all protocols (mailto:, tel:, ftp:, etc.), hash-only, asset paths + if ( + href.match(/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i) || // http:, https:, mailto:, tel:, ftp:, // + href.startsWith('#') || + href.match(/(^|\/)assets\//) + ) { + return { href, isExternal, isRaw: false }; + } + + // 5. Separate hash fragment + let hash = ''; + const hashIndex = href.indexOf('#'); + if (hashIndex >= 0) { + hash = href.substring(hashIndex); + href = href.substring(0, hashIndex); + } + + // 6. Strip .md, .html, and .ejs extensions + if (href.endsWith('.md')) { + href = href.slice(0, -3); + } else if (href.endsWith('.html')) { + href = href.slice(0, -5); + } else if (href.endsWith('.ejs')) { + href = href.slice(0, -4); + } + + // 7. Strip trailing /index or /README (the page is the folder root) + // Handles: dir/index, ./dir/index, ../dir/index, /dir/index + // And: dir/README, ./dir/README, ../dir/README, /dir/README + // Also handles bare "index" or "README" (root index) + const lowerHref = href.toLowerCase(); + if (lowerHref === 'index' || lowerHref === './index' || lowerHref === 'readme' || lowerHref === './readme') { + href = (lowerHref === 'index' || lowerHref === 'readme') ? '' : './'; + } else if (lowerHref.endsWith('/index')) { + href = href.slice(0, -5); // "dir/index" โ†’ "dir/" + } else if (lowerHref.endsWith('/readme')) { + href = href.slice(0, -6); // "dir/readme" โ†’ "dir/" + } + + // 8. Ensure trailing slash for non-empty paths + // But NOT for empty string (which represents current directory root) + if (href !== '' && !href.endsWith('/')) { + href += '/'; + } + + // 9. Collapse any accidental double slashes (preserve leading // caught above) + href = href.replace(/([^:])\/{2,}/g, '$1/'); + + return { href: href + hash, isExternal, isRaw: false }; +} + +/** + * Simplified normaliser for backward compatibility. + * Returns only the normalised href string (no external/raw flags). + * Used by navigation normalisation where external detection is handled separately. + */ +export function normalizeInternalHref(href: string): string { + return resolveHref(href).href; +} + +/** + * Recursively normalises all `path` values in a navigation tree. + * Used for nav config from `navigation.json`, `docmd.config.js`, and the auto-router. + * + * Supports the `external:` prefix as a shorthand for `external: true`: + * { "path": "external:https://github.com" } โ†’ { "path": "https://github.com", "external": true } + * + * The explicit `external: true` attribute is also supported and takes precedence. + */ +export function normalizeNavPaths(items: any[]): void { + if (!items) return; + for (const item of items) { + if (item.path && typeof item.path === 'string') { + const result = resolveHref(item.path); + item.path = result.href; + // If external: prefix was used, set the external flag (unless already explicitly set) + if (result.isExternal && item.external !== false) { + item.external = true; + } + } + if (item.children) { + normalizeNavPaths(item.children); + } + } +} + +/** + * Recursively normalises all `url` values in a menubar tree. + * Applies the same trailing-slash enforcement and external detection as Markdown links. + */ +export function normalizeMenubarPaths(items: any[]): void { + if (!items) return; + for (const item of items) { + if (item.url && typeof item.url === 'string') { + const result = resolveHref(item.url); + item.url = result.href; + if (result.isExternal) item.external = true; + } + if (item.items) { + normalizeMenubarPaths(item.items); + } + } +} + +/** + * Sanitize a URL by collapsing consecutive slashes (except after protocol). + * This is the last-resort safety net - if upstream logic is correct, this + * should be a no-op. + * + * @example + * sanitizeUrl('//docs//guide/') โ†’ '/docs/guide/' + * sanitizeUrl('https://a.com//b') โ†’ 'https://a.com/b' + */ +export function sanitizeUrl(url: string): string { + if (!url) return url; + // Collapse double+ slashes, but preserve protocol:// + return url.replace(/([^:])\/\/+/g, '$1/'); +} \ No newline at end of file diff --git a/packages/parser/src/utils/url-utils.ts b/packages/parser/src/utils/url-utils.ts new file mode 100644 index 0000000..411288e --- /dev/null +++ b/packages/parser/src/utils/url-utils.ts @@ -0,0 +1,294 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/parser + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + */ + +/** + * Centralised URL Utilities + * ========================= + * + * This module is the **single source of truth** for all URL transformations + * in the docmd ecosystem. Every plugin, template, and engine component + * MUST use these utilities instead of rolling their own URL logic. + * + * Architecture: + * + * User Input (markdown, config) + * โ”‚ + * โ–ผ + * resolveHref() โ† normalize-href.ts (user-facing href โ†’ clean path) + * โ”‚ + * โ–ผ + * Build Engine โ† generator.ts produces outputPath per page + * โ”‚ + * โ–ผ + * URL Utilities โ† THIS FILE + * โ”‚ + * โ”œโ”€โ”€ outputPathToSlug() โ†’ "guide/" + * โ”œโ”€โ”€ outputPathToCanonical() โ†’ "https://site.com/guide/" + * โ”œโ”€โ”€ buildContextualUrl() โ†’ "../de/guide/" (relative, context-aware) + * โ”œโ”€โ”€ sanitizeUrl() โ†’ collapse //, enforce trailing / + * โ””โ”€โ”€ createUrlContext() โ†’ factory for page-level context + * + * Plugins receive pre-computed URLs via the page object, OR can import + * these utilities directly for custom URL generation. + */ + +import { sanitizeUrl } from './normalize-href.js'; + +// Re-export sanitizeUrl from normalize-href for convenience +export { sanitizeUrl }; + +// โ”€โ”€โ”€ Types โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ + +/** + * Immutable context object that captures all the environmental factors + * needed to resolve a URL for a specific page render. + * + * Created once per page in generator.ts and passed to all templates + * and plugin hooks. + */ +export interface UrlContext { + /** Relative path from current page back to site root, e.g. `../../` or `./` */ + readonly relativePathToRoot: string; + /** Locale + version prefix for the current build pass, e.g. `de/v1/` or `` */ + readonly outputPrefix: string; + /** Whether we're generating for offline/file:// browsing */ + readonly offline: boolean; + /** The site base path from config, e.g. `/docs/` or `/` */ + readonly base: string; + /** The full site URL from config, e.g. `https://docmd.io` (no trailing slash) */ + readonly siteUrl: string; +} + +/** + * Pre-computed URL data attached to every page object. + * Plugins can read these directly - zero computation needed. + */ +export interface PageUrls { + /** Clean directory-style slug, e.g. `guide/` or `/` for root */ + readonly slug: string; + /** Full canonical URL, e.g. `https://docmd.io/guide/` (only if siteUrl is set) */ + readonly canonical: string; + /** Relative path from site root, e.g. `/guide/` or `/` */ + readonly pathname: string; +} + +// โ”€โ”€โ”€ Core Utilities โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ + +/** + * Collapse consecutive slashes (except after protocol `:`), enforce + * consistent formatting. This is the **last-resort safety net** - if + * the upstream logic is correct, this should be a no-op. + * + * Note: This function is imported from normalize-href.ts to ensure + * single source of truth for URL sanitization logic. + */ + +/** + * Convert a build-engine outputPath to a clean directory-style slug. + * + * This is the **single canonical conversion** from the internal file path + * representation to a URL path segment. Every consumer that previously + * did its own `outputPath.replace('/index.html', '/')` MUST use this. + * + * @param outputPath - e.g. `guide/index.html`, `index.html`, `de/v1/api/index.html` + * @returns Clean slug, e.g. `guide/`, `/`, `de/v1/api/` + * + * @example + * outputPathToSlug('guide/index.html') โ†’ 'guide/' + * outputPathToSlug('index.html') โ†’ '/' + * outputPathToSlug('de/v1/api/index.html') โ†’ 'de/v1/api/' + * outputPathToSlug('about.html') โ†’ 'about/' + */ +export function outputPathToSlug(outputPath: string): string { + if (!outputPath) return '/'; + + let slug = outputPath.replace(/\\/g, '/'); + + // Strip trailing index.html + if (slug === 'index.html') return '/'; + if (slug.endsWith('/index.html')) { + slug = slug.slice(0, -10); // remove 'index.html', keep trailing '/' + } else if (slug.endsWith('.html')) { + slug = slug.slice(0, -5) + '/'; + } + + // Ensure trailing slash + if (slug !== '/' && !slug.endsWith('/')) { + slug += '/'; + } + + return slug; +} + +/** + * Convert an outputPath to a root-relative pathname (always starts with `/`). + * + * @param outputPath - e.g. `guide/index.html` + * @returns e.g. `/guide/` + */ +export function outputPathToPathname(outputPath: string): string { + const slug = outputPathToSlug(outputPath); + return slug.startsWith('/') ? slug : '/' + slug; +} + +/** + * Convert an outputPath to a full canonical URL. + * + * @param outputPath - e.g. `guide/index.html` + * @param siteUrl - e.g. `https://docmd.io` (no trailing slash) + * @returns e.g. `https://docmd.io/guide/` + */ +export function outputPathToCanonical(outputPath: string, siteUrl: string): string { + if (!siteUrl) return ''; + const cleanSiteUrl = siteUrl.replace(/\/+$/, ''); + const pathname = outputPathToPathname(outputPath); + return sanitizeUrl(cleanSiteUrl + pathname); +} + +/** + * Build a context-aware relative URL from a clean href. + * + * This replaces ALL inline URL building in EJS templates and the + * `buildRelativeUrl` function in generator.ts. It is the single + * function that understands relativePathToRoot, outputPrefix, + * offline mode, and base path. + * + * @param href - A clean, normalised href (output of resolveHref), e.g. `guide/`, `#section`, `https://...` + * @param context - The UrlContext for the current page + * @returns A fully resolved relative URL safe for use in `
    ` + * + * @example + * // Page at /de/v1/getting-started/index.html + * buildContextualUrl('guide/', ctx) + * // โ†’ '../../de/v1/guide/' (relative, with locale+version prefix) + * + * buildContextualUrl('#section', ctx) + * // โ†’ '#section' (hash-only, untouched) + * + * buildContextualUrl('https://github.com', ctx) + * // โ†’ 'https://github.com' (external, untouched) + */ +export function buildContextualUrl(href: string, context: UrlContext): string { + // Pass-through: empty, hash-only, external protocols, data URIs + if (!href || href === '#') return href || '#'; + // D-S2: strip the `external:` prefix defensively. Plugin callers may + // invoke this function directly without going through `resolveHref` + // first; previously `external:https://...` was treated as a literal + // path segment and got mangled into `./external:https://...`. + if (href.startsWith('external:')) { + href = href.slice('external:'.length); + } + if (href.startsWith('http') || href.startsWith('//') || href.startsWith('mailto:') || href.startsWith('tel:') || href.startsWith('data:')) { + return href; + } + // Hash-only anchors pass through unchanged. Without this guard, a + // value like `#section` falls through to the path-combining branch + // and gets prepended with the page's `relativePathToRoot`, producing + // `./#section` โ€” which a browser still resolves to the same anchor, + // but breaks expectations for callers that compare the output to the + // input hash verbatim. + if (href.startsWith('#')) return href; + + // Separate hash fragment + let hash = ''; + const hashIdx = href.indexOf('#'); + if (hashIdx >= 0) { + hash = href.substring(hashIdx); + href = href.substring(0, hashIdx); + } + + // Strip leading ./ and / to get a clean relative path + const cleanPath = href.replace(/^(\.\/|\/)+/, ''); + + // Build the prefixed path: outputPrefix (locale/version) + clean path + const prefixStr = context.outputPrefix ? context.outputPrefix.replace(/\/$/, '') : ''; + let combinedPath = prefixStr + ? (cleanPath ? prefixStr + '/' + cleanPath : prefixStr + '/') + : cleanPath; + + // Offline mode: append /index.html for file:// browsing + if (context.offline && combinedPath !== '' && !combinedPath.endsWith('.html') && !combinedPath.endsWith('/')) { + combinedPath = combinedPath + '/index.html'; + } else if (context.offline && combinedPath !== '' && combinedPath.endsWith('/')) { + combinedPath = combinedPath + 'index.html'; + } + + // Build final relative URL + const result = context.relativePathToRoot + combinedPath + hash; + return sanitizeUrl(result); +} + +/** + * Create a UrlContext for a specific page render. + * + * Called once per page in generator.ts. The resulting context is then + * passed to all templates and can be forwarded to plugin hooks. + * + * @param options - Configuration for this page's URL context + */ +export function createUrlContext(options: { + relativePathToRoot: string; + outputPrefix?: string; + offline?: boolean; + base?: string; + siteUrl?: string; +}): UrlContext { + return Object.freeze({ + relativePathToRoot: options.relativePathToRoot || './', + outputPrefix: options.outputPrefix || '', + offline: options.offline || false, + base: options.base || '/', + siteUrl: (options.siteUrl || '').replace(/\/+$/, ''), + }); +} + +/** + * Compute pre-built URL data for a page. + * + * Called once per page in generator.ts. The resulting PageUrls object + * is attached to the page object and available to all post-build plugins. + * + * @param outputPath - The page's output path, e.g. `guide/index.html` + * @param siteUrl - The site URL from config, e.g. `https://docmd.io` + */ +export function computePageUrls(outputPath: string, siteUrl: string): PageUrls { + return Object.freeze({ + slug: outputPathToSlug(outputPath), + canonical: outputPathToCanonical(outputPath, siteUrl), + pathname: outputPathToPathname(outputPath), + }); +} + +/** + * Build an absolute URL from config.base + optional locale + optional version + page path. + * + * Used by version-dropdown.ejs and language-switcher.ejs for absolute navigation. + * Replaces the inline JS computations in those templates. + * + * @param base - config.base, e.g. `/docs/` or `/` + * @param localePrefix - e.g. `de/` or `` for default locale + * @param versionPrefix - e.g. `v1/` or `` for current version + * @param pagePath - e.g. `guide/` or `` + * @returns Absolute path, e.g. `/docs/de/v1/guide/` + */ +export function buildAbsoluteUrl( + base: string, + localePrefix: string = '', + versionPrefix: string = '', + pagePath: string = '' +): string { + const normalizedBase = base.endsWith('/') ? base : base + '/'; + const result = normalizedBase + localePrefix + versionPrefix + pagePath; + return sanitizeUrl(result); +} diff --git a/packages/parser/src/utils/validator.ts b/packages/parser/src/utils/validator.ts new file mode 100644 index 0000000..b13b356 --- /dev/null +++ b/packages/parser/src/utils/validator.ts @@ -0,0 +1,125 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/core (and ecosystem) + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + */ + + +import { TUI } from '@docmd/tui'; + +// Known configuration keys for typo detection (V2 + V3) +const KNOWN_KEYS = [ + // V3 Modern Labels + 'title', 'url', 'src', 'out', 'base', 'layout', + 'versions', 'redirects', 'notFound', 'projects', + + // Engine selection (e.g. "rust" for the rust preview engine) + 'engine', 'engines', + + // V2 Legacy Labels + 'siteTitle', 'siteUrl', 'srcDir', 'outputDir', + + // Shared Features + 'logo', 'sidebar', 'theme', 'customJs', 'autoTitleFromH1', + 'copyCode', 'plugins', 'navigation', 'footer', 'sponsor', 'favicon', + 'search', 'minify', 'editLink', 'pageNavigation', 'i18n', + + // Workspace + 'workspace' +]; + +// Common typos mapping +const TYPO_MAPPING = { + 'site_title': 'title', + 'sitetitle': 'title', + 'baseUrl': 'url', + 'source': 'src', + 'outDir': 'out', + 'customCSS': 'theme.customCss', + 'customcss': 'theme.customCss', + 'customJS': 'customJs', + 'customjs': 'customJs', + 'nav': 'navigation', + 'menu': 'navigation' +}; + +function validateConfig(config) { + const errors = []; + const warnings = []; + + // 1. Required Fields (Accept either title OR siteTitle) + // Skip for multi-project root configs - they only have projects[] + if (!config.title && !config.siteTitle && !Array.isArray(config.projects)) { + errors.push('Missing required property: "title" (or "siteTitle")'); + } + + // 2. Type Checking + if (config.navigation && !Array.isArray(config.navigation)) { + errors.push('"navigation" must be an Array'); + } + + if (config.customJs && !Array.isArray(config.customJs)) { + errors.push('"customJs" must be an Array of strings'); + } + + if (config.theme) { + if (config.theme.customCss && !Array.isArray(config.theme.customCss)) { + errors.push('"theme.customCss" must be an Array of strings'); + } + } + + if (config.versions && config.versions.all && !Array.isArray(config.versions.all)) { + errors.push('"versions.all" must be an Array'); + } + + // 3. Typos and Unknown Keys (Top Level) + // T-Z3: previously completely-unknown keys were silently ignored. We + // now warn about every unrecognised top-level key (typo suggestions + // where applicable) so misconfigurations don't ship silently. Nested + // plugin config (`plugins..*`) is intentionally NOT checked โ€” + // each plugin owns its own schema and is validated by the plugin + // loader. + Object.keys(config).forEach(key => { + // Skip checking internal keys (starting with _) + if (key.startsWith('_')) return; + + if (!KNOWN_KEYS.includes(key)) { + if (TYPO_MAPPING[key]) { + warnings.push(`Found unknown property "${key}". Did you mean "${TYPO_MAPPING[key]}"?`); + } else { + warnings.push(`Unknown property "${key}" in config โ€” ignored. (Top-level keys only; plugin-specific options belong under "plugins.".)`); + } + } + }); + + // 4. Theme specific typos + if (config.theme) { + if (config.theme.customCSS) { + warnings.push('Found "theme.customCSS". Did you mean "theme.customCss"?'); + } + } + + // Output results + if (warnings.length > 0) { + TUI.warn('Configuration Warnings:'); + warnings.forEach(w => TUI.warn(w)); + } + + if (errors.length > 0) { + TUI.error('Configuration Errors'); + errors.forEach(e => TUI.error(e)); + throw new Error('Invalid configuration file.'); + } + + return { warnings, errors }; +} + +export { validateConfig }; \ No newline at end of file diff --git a/packages/parser/test/container-normaliser.test.js b/packages/parser/test/container-normaliser.test.js new file mode 100644 index 0000000..e693e12 --- /dev/null +++ b/packages/parser/test/container-normaliser.test.js @@ -0,0 +1,814 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * Phase 2 container normaliser โ€” edge-case test fixture + * + * These tests cover the five reported F1โ€“F5 failure modes plus the + * 50+ edge cases that derive from the shim's own warning surface + * (battle-test-reports/robust-parser-shim/index.js) and the + * `normaliseContainers` algorithm. + * + * Test categories (in order): + * 1. classifyLine โ€” open / close / other classification + * 2. indentOf โ€” leading-space counting + * 3. normaliseContainers โ€” core algorithm (no warnings) + * 4. normaliseContainers โ€” warning surface + * 5. F1โ€“F5 reported failure modes + * 6. processContentAsync integration โ€” end-to-end HTML + * 7. Determinism โ€” identical output across threads / replays + * + * Run: `pnpm --filter @docmd/parser test` + * -------------------------------------------------------------------- + */ + +import test from 'node:test'; +import assert from 'node:assert/strict'; +import { + normaliseContainers, + classifyLine, + indentOf, + SELF_CLOSING_CONTAINER_NAMES, + createMarkdownProcessor, + processContentAsync +} from '../dist/index.js'; + +// โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ +// 1. classifyLine +// โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ + +test('classifyLine: `::: callout` is open with name `callout`', () => { + assert.deepEqual(classifyLine('::: callout'), { kind: 'open', name: 'callout' }); +}); + +test('classifyLine: `::: callout info "Title"` is open, name is the first word', () => { + assert.deepEqual( + classifyLine('::: callout info "Title"'), + { kind: 'open', name: 'callout' } + ); +}); + +test('classifyLine: `:::card` (no space) is still open (zero-or-more whitespace)', () => { + assert.deepEqual(classifyLine(':::card'), { kind: 'open', name: 'card' }); +}); + +test('classifyLine: `:::` is close', () => { + assert.deepEqual(classifyLine(':::'), { kind: 'close' }); +}); + +test('classifyLine: `::: ` (trailing whitespace) is close', () => { + assert.deepEqual(classifyLine('::: '), { kind: 'close' }); +}); + +test('classifyLine: ` ::: callout` (leading indent) is still open', () => { + assert.deepEqual( + classifyLine(' ::: callout'), + { kind: 'open', name: 'callout' } + ); +}); + +test('classifyLine: `:::: callout` (four colons) is NOT matched as open or close', () => { + // Three colons then a fourth colon is not whitespace, so `[a-zA-Z]` fails. + // The line passes through to the parser unchanged. + assert.equal(classifyLine(':::: callout').kind, 'other'); +}); + +test('classifyLine: `::: 123abc` (leading digit) is NOT open', () => { + // Name must start with a letter. + assert.equal(classifyLine('::: 123abc').kind, 'other'); +}); + +test('classifyLine: `:::-foo` (hyphen, not letter) is NOT open', () => { + assert.equal(classifyLine(':::-foo').kind, 'other'); +}); + +test('classifyLine: `plain text` is other', () => { + assert.equal(classifyLine('plain text').kind, 'other'); +}); + +test('classifyLine: empty string is other', () => { + assert.equal(classifyLine('').kind, 'other'); +}); + +// โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ +// 2. indentOf +// โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ + +test('indentOf: empty line is 0', () => { + assert.equal(indentOf(''), 0); +}); + +test('indentOf: line with no leading spaces is 0', () => { + assert.equal(indentOf('::: callout'), 0); +}); + +test('indentOf: 4 leading spaces is 4', () => { + assert.equal(indentOf(' ::: callout'), 4); +}); + +test('indentOf: 8 leading spaces is 8', () => { + assert.equal(indentOf(' ::: card'), 8); +}); + +// โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ +// 3. normaliseContainers โ€” core algorithm (no warnings expected) +// โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ + +test('normaliseContainers: empty input is unchanged', () => { + const r = normaliseContainers(''); + assert.equal(r.source, ''); + assert.deepEqual(r.warnings, []); +}); + +test('normaliseContainers: input with no `:::` is unchanged', () => { + const src = '# Title\n\nSome **bold** text.\n\n- list item\n'; + const r = normaliseContainers(src); + assert.equal(r.source, src); + assert.deepEqual(r.warnings, []); +}); + +test('normaliseContainers: balanced single callout is unchanged', () => { + const src = '::: callout info "Title"\nbody\n:::\n'; + const r = normaliseContainers(src); + assert.equal(r.source, src); + assert.deepEqual(r.warnings, []); +}); + +test('normaliseContainers: self-closing `::: button` passes through with no stack push', () => { + const src = '::: button "Click me"\n'; + const r = normaliseContainers(src); + assert.equal(r.source, src); + assert.deepEqual(r.warnings, []); +}); + +test('normaliseContainers: SELF_CLOSING_CONTAINER_NAMES has exactly button/tag/embed', () => { + // The whitelist is the source of truth for the depth counter's behaviour. + // Adding or removing names here is a parser-semantics change. + assert.deepEqual( + [...SELF_CLOSING_CONTAINER_NAMES].sort(), + ['button', 'embed', 'tag'] + ); +}); + +test('normaliseContainers: three self-closing tags then a stray `:::` removes the stray', () => { + // F2 โ€” orphan `:::` after self-closing tags must be dropped. + const src = '::: tag "a"\n::: tag "b"\n::: tag "c"\n:::\n'; + const r = normaliseContainers(src); + assert.equal(r.source, '::: tag "a"\n::: tag "b"\n::: tag "c"\n'); + assert.equal(r.warnings.length, 1); + assert.equal(r.warnings[0].severity, 'warning'); + assert.match(r.warnings[0].message, /Stray `:::`/); +}); + +test('normaliseContainers: nested callout/card with one implicit close emits 2 closes', () => { + // Inner `::: card` is at indent 4; user's `:::` is at indent 0 โ†’ the + // close at indent 0 matches the OUTER callout, and the inner card is + // closed implicitly. Algorithm emits 2 closes at indent 0 (one replaces + // the user's `:::`, one is added for the card). + const src = '::: callout\n ::: card "x"\n body\n:::\n'; + const r = normaliseContainers(src); + const lines = r.source.split('\n'); + const closeCount = lines.filter((l) => /^:::\s*$/.test(l)).length; + assert.equal(closeCount, 2, `expected 2 closes at indent 0, got ${closeCount}`); + assert.equal(r.warnings.length, 1); + assert.equal(r.warnings[0].severity, 'info'); +}); + +test('normaliseContainers: indented open matched by greater-indent close', () => { + // Open at indent 4, close at indent 8 (deeper indent). The shim's + // matching rule is `open.indent <= close.indent` so 4 <= 8 matches. + // The original `:::` is replaced with one at the open's indent. + const src = ' ::: card "x"\nbody\n :::\n'; + const r = normaliseContainers(src); + // The original close is rewritten at the open's indent (4 spaces). + assert.match(r.source, / {4}::: card "x"\n/); + assert.match(r.source, /\n {4}:::/); + // No warnings โ€” this is a balanced container. + assert.deepEqual(r.warnings, []); +}); + +test('normaliseContainers: close LESS indented than open is stray, container auto-closes at EOF', () => { + // Open at indent 4, close at indent 0. The shim's matching rule is + // `open.indent <= close.indent` so 4 <= 0 fails โ†’ stray close. The + // card then auto-closes at EOF with an ERROR (at the card's indent). + const src = ' ::: card "x"\nbody\n:::\n'; + const r = normaliseContainers(src); + // The stray close at indent 0 is removed; the card is auto-closed at + // EOF at the card's original indent (4 spaces). + assert.doesNotMatch(r.source, /\n:::\s*$/); + assert.match(r.source, /\n {4}:::\s*$/); + // Warnings: 1 stray (warning) + 1 unclosed (error). + const stray = r.warnings.find((w) => w.severity === 'warning'); + const unclosed = r.warnings.find((w) => w.severity === 'error'); + assert.ok(stray, 'expected a stray-close warning'); + assert.ok(unclosed, 'expected an unclosed-at-EOF error'); + assert.match(unclosed.message, /Unclosed ``/); +}); + +test('normaliseContainers: over-indented close is normalised, not stray', () => { + // Open at indent 0, close at indent 4 โ†’ close's indent (4) >= open's + // indent (0), so they match. The over-indented close is rewritten to + // the open's indent. This is the normaliser's signature behaviour: + // it lets users get the indent wrong without breaking the page. + const src = '::: callout\nbody\n :::\n'; + const r = normaliseContainers(src); + // The callout is closed cleanly with no warnings. + assert.equal(r.source, '::: callout\nbody\n:::\n'); + assert.deepEqual(r.warnings, []); +}); + +test('normaliseContainers: unclosed at EOF is auto-closed with an error', () => { + // F4 / F3 class โ€” file ends with an open container still on the stack. + const src = '::: callout\nbody\n'; + const r = normaliseContainers(src); + // Source ends with the auto-close at indent 0 (callout's indent). The + // original body line ended with `\n`, so there are two newlines + // between `body` and the inserted `:::`. + assert.match(r.source, /\n:::\s*$/); + assert.equal(r.warnings.length, 1); + assert.equal(r.warnings[0].severity, 'error'); + assert.match(r.warnings[0].message, /Unclosed ``/); +}); + +test('normaliseContainers: multiple unclosed at EOF each emit an error', () => { + const src = '::: callout\n::: card "x"\n'; + const r = normaliseContainers(src); + // Two auto-closes are appended, one per open frame. + assert.match(r.source, /\n:::\n:::\s*$/); + const errors = r.warnings.filter((w) => w.severity === 'error'); + assert.equal(errors.length, 2); + // Inner card is reported first (LIFO from the stack). + assert.match(errors[0].message, //); + assert.match(errors[1].message, //); +}); + +// โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ +// 4. normaliseContainers โ€” warning surface +// โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ + +test('normaliseContainers: stray `:::` at top level produces a warning with the line number', () => { + const r = normaliseContainers(':::\n'); + assert.equal(r.warnings.length, 1); + assert.equal(r.warnings[0].line, 1); + assert.equal(r.warnings[0].severity, 'warning'); +}); + +test('normaliseContainers: sourcePath is reflected in warnings', () => { + const r = normaliseContainers(':::\n', { sourcePath: 'docs/page.md' }); + assert.equal(r.warnings[0].path, 'docs/page.md'); +}); + +test('normaliseContainers: sourcePath defaults to ``', () => { + const r = normaliseContainers(':::\n'); + assert.equal(r.warnings[0].path, ''); +}); + +test('normaliseContainers: onWarning callback fires alongside the returned array', () => { + const collected = []; + const r = normaliseContainers(':::\n', { onWarning: (w) => collected.push(w) }); + assert.equal(collected.length, 1); + assert.equal(collected[0].line, 1); + assert.equal(r.warnings.length, 1); + assert.equal(collected[0], r.warnings[0]); +}); + +test('normaliseContainers: legacy 2-arg signature `normaliseContainers(src, path)` works', () => { + // Used by the legacy shim-style plugin descriptor. + const r = normaliseContainers(':::\n', 'legacy/path.md'); + assert.equal(r.warnings[0].path, 'legacy/path.md'); +}); + +test('normaliseContainers: implicit multi-close info warning lists all closed containers', () => { + // Inner `::: card` at indent 4 is closed by the user's `:::` at indent 0. + // The outer `::: callout` is ALSO closed by the same `:::` because its + // indent (0) matches the close's indent (0). One user gesture closes two + // containers โ€” the algorithm emits an INFO warning naming both. + const src = '::: callout\n ::: card "x"\n body\n:::\n'; + const r = normaliseContainers(src); + const info = r.warnings.find((w) => w.severity === 'info'); + assert.ok(info, 'expected an info warning for implicit multi-close'); + assert.match(info.message, //); + assert.match(info.message, //); +}); + +// โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ +// 5. F1โ€“F5 reported failure modes +// โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ + +test('F1: nested grids with one close per card โ†’ 3 outer closes at indent 0', () => { + // The user-reported "grids don't work" pattern. Cards are closed + // individually (one `:::` per card body) at indent 8; only the outer + // grids has its own `:::` at indent 0. The user's final `:::` closes + // the OUTER grids, and the inner grids (ร—2) are closed implicitly. + const src = [ + '::: grids', + ' ::: grid', + ' ::: card "Fast" icon:zap', + ' body', + ' :::', + ' ::: grid', + ' ::: card "Slow"', + ' body', + ' :::', + ':::' + ].join('\n'); + + const r = normaliseContainers(src); + + // Algorithm emits 3 closes at indent 0: 1 replaces the user's final + // `:::`, 2 are added to close the 2 inner grids. + const lines = r.source.split('\n'); + const outerCloses = lines.filter((l) => /^:::\s*$/.test(l)); + assert.equal(outerCloses.length, 3, `expected 3 outer closes, got ${outerCloses.length}`); + + // Top-level normaliser produces an info warning naming all 3 containers + // that the user's one `:::` closed implicitly. + const info = r.warnings.find((w) => w.severity === 'info'); + assert.ok(info, 'expected an info warning for implicit multi-close'); + assert.match(info.message, //); + assert.match(info.message, //); +}); + +test('F2: three `::: tag` lines plus an orphan `:::` โ†’ orphan removed, no stack pushes', () => { + const src = '::: tag "v0.8" color:blue\n::: tag "Experimental"\n::: tag "Live"\n:::\n'; + const r = normaliseContainers(src); + // All three tag lines preserved, orphan `:::` removed with a warning. + assert.match(r.source, /::: tag "v0.8"/); + assert.match(r.source, /::: tag "Experimental"/); + assert.match(r.source, /::: tag "Live"/); + assert.equal(r.source.split('\n').filter((l) => l === ':::').length, 0); + assert.equal(r.warnings.length, 1); + assert.equal(r.warnings[0].severity, 'warning'); +}); + +test('F3: `::: callout ... ::: card ... :::` mismatched close โ†’ auto-close callout', () => { + const src = '::: callout info "x"\nbody\n::: card "wrong close"\noops\n:::\n'; + const r = normaliseContainers(src); + // The callout opener stays; the card opener stays; the user's `:::` closes + // the card; the callout is then auto-closed at EOF with an error. + assert.match(r.source, /::: callout info "x"/); + assert.match(r.source, /::: card "wrong close"/); + const errors = r.warnings.filter((w) => w.severity === 'error'); + assert.equal(errors.length, 1); + assert.match(errors[0].message, /Unclosed ``/); +}); + +test('F4: triple `:::` after a balanced callout โ†’ two are removed, one closes callout', () => { + const src = '::: callout info "x"\nbody\n:::\n:::\n:::\n'; + const r = normaliseContainers(src); + // First `:::` closes callout (matching); second and third are stray. + const warnings = r.warnings.filter((w) => w.severity === 'warning'); + assert.equal(warnings.length, 2); + // Source retains exactly one `:::` (the callout close). + const closes = r.source.split('\n').filter((l) => /^:::\s*$/.test(l)); + assert.equal(closes.length, 1); +}); + +test('F5: 5-level nested callouts โ†’ already balanced, normalisation is a no-op', () => { + const src = [ + '::: callout info "l1"', + '::: callout tip "l2"', + '::: callout warning "l3"', + '::: callout danger "l4"', + '::: callout success "l5"', + 'deep', + ':::', + ':::', + ':::', + ':::', + ':::' + ].join('\n'); + const r = normaliseContainers(src); + assert.equal(r.source, src); + assert.deepEqual(r.warnings, []); +}); + +// โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ +// 6. processContentAsync integration โ€” end-to-end HTML +// โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ + +// Build a fresh processor per test so module-level caches don't leak. +function freshProcessor() { + return createMarkdownProcessor({}, () => {}); +} + +test('integration: plain markdown renders unchanged', async () => { + const md = freshProcessor(); + const r = await processContentAsync('# Hello\n\nBody text.\n', md, {}, {}); + // headingIdPlugin adds id + class + permalink anchor; just check the + // h1 exists and contains the heading text. + assert.match(r.htmlContent, /]*>[\s\S]*?Hello[\s\S]*?<\/h1>/); + assert.match(r.htmlContent, /

    Body text\.<\/p>/); +}); + +test('integration: balanced single callout renders as `.callout` div', async () => { + const md = freshProcessor(); + const r = await processContentAsync( + '::: callout info "Title"\nbody\n:::\n', + md, + {}, + { filePath: 'test.md' } + ); + assert.match(r.htmlContent, /docmd-container callout callout-info/); + assert.match(r.htmlContent, /callout-title/); + assert.match(r.htmlContent, /

    body<\/p>/); +}); + +test('integration: F1 grids render correctly (no raw `

    ::: grids
    ` text)', async () => { + const md = freshProcessor(); + const src = [ + '::: grids', + ' ::: grid', + ' ::: card "Fast"', + ' body1', + ' :::', + ' ::: grid', + ' ::: card "Slow"', + ' body2', + ' :::', + ':::' + ].join('\n'); + const r = await processContentAsync(src, md, {}, { filePath: 'f1.md' }); + assert.match(r.htmlContent, /docmd-container grids/); + assert.match(r.htmlContent, /grid-item/); + assert.match(r.htmlContent, /card-title/); + // No leaked raw container text. + assert.doesNotMatch(r.htmlContent, /

    ::: grids
    { + const md = freshProcessor(); + const r = await processContentAsync( + '::: tag "v0.8" color:blue\n::: tag "Experimental"\n::: tag "Live"\n:::\n', + md, + {}, + { filePath: 'f2.md' } + ); + assert.match(r.htmlContent, /docmd-tag/); + // No leaked `

    :::

    ` orphan. + assert.doesNotMatch(r.htmlContent, /

    :::<\/p>/); +}); + +test('integration: F3 mismatched close renders callout + card correctly', async () => { + const md = freshProcessor(); + const r = await processContentAsync( + '::: callout info "x"\nbody\n::: card "wrong close"\noops\n:::\n', + md, + {}, + { filePath: 'f3.md' } + ); + assert.match(r.htmlContent, /callout-info/); + assert.match(r.htmlContent, /card-title/); + assert.match(r.htmlContent, /

    oops<\/p>/); +}); + +test('integration: F4 triple close renders callout only, no leaked `

    :::

    `', async () => { + const md = freshProcessor(); + const r = await processContentAsync( + '::: callout info "x"\nbody\n:::\n:::\n:::\n', + md, + {}, + { filePath: 'f4.md' } + ); + assert.match(r.htmlContent, /callout-info/); + assert.match(r.htmlContent, /

    body<\/p>/); + // No leaked `

    :::

    ` orphan paragraphs. + assert.doesNotMatch(r.htmlContent, /

    :::<\/p>/); +}); + +test('integration: F5 5-level nested callouts render five `

    ` levels', async () => { + const md = freshProcessor(); + const src = [ + '::: callout info "l1"', + '::: callout tip "l2"', + '::: callout warning "l3"', + '::: callout danger "l4"', + '::: callout success "l5"', + 'deep', + ':::', + ':::', + ':::', + ':::', + ':::' + ].join('\n'); + const r = await processContentAsync(src, md, {}, { filePath: 'f5.md' }); + for (const cls of ['callout-info', 'callout-tip', 'callout-warning', 'callout-danger', 'callout-success']) { + assert.match(r.htmlContent, new RegExp(cls), `expected ${cls} in HTML`); + } + assert.match(r.htmlContent, /

    deep<\/p>/); +}); + +// โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ +// 7. Determinism โ€” identical output across replays / concurrent calls +// โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ + +test('determinism: normaliseContainers returns byte-identical output on replay', () => { + const src = [ + '::: grids', + ' ::: grid', + ' ::: card "x"', + ' body', + ' :::', + ':::' + ].join('\n'); + const a = normaliseContainers(src); + const b = normaliseContainers(src); + assert.equal(a.source, b.source); + assert.deepEqual(a.warnings, b.warnings); +}); + +test('determinism: 100 concurrent parses of the same source produce identical HTML', async () => { + const md = freshProcessor(); + const src = [ + '::: grids', + ' ::: grid', + ' ::: card "Fast"', + ' body1', + ' :::', + ' ::: grid', + ' ::: card "Slow"', + ' body2', + ' :::', + ':::' + ].join('\n'); + const N = 100; + const results = await Promise.all( + Array.from({ length: N }, () => processContentAsync(src, md, {}, { filePath: 'det.md' })) + ); + const first = results[0].htmlContent; + for (let i = 1; i < N; i++) { + assert.equal(results[i].htmlContent, first, `divergence at index ${i}`); + } +}); + +test('determinism: parser output is independent of `Date.now` / randomness', async () => { + // No Date.now / Math.random in the parser pipeline. Two parses made at + // very different times must produce identical HTML. + const md = freshProcessor(); + const src = '# Heading\n\n::: callout\nbody\n:::\n'; + const a = await processContentAsync(src, md, {}, { filePath: 'a.md' }); + await new Promise((r) => setTimeout(r, 10)); + const b = await processContentAsync(src, md, {}, { filePath: 'a.md' }); + assert.equal(a.htmlContent, b.htmlContent); +}); + +// Cross-thread determinism (Phase 2 commit 3). Run the same parse in a +// real worker_threads worker โ€” a different module instance, a different +// microtask queue โ€” and assert the HTML is byte-identical to the main +// thread's result. +test('determinism: parse in a worker_threads worker produces identical HTML', async () => { + const { Worker } = await import('node:worker_threads'); + const md = freshProcessor(); + const src = [ + '::: grids', + ' ::: grid', + ' ::: card "Fast"', + ' body1', + ' :::', + ' ::: grid', + ' ::: card "Slow"', + ' body2', + ' :::', + ':::' + ].join('\n') + '\n:::\n'; // trailing stray exercises the warning path + + // Main-thread parse. + const mainResult = await processContentAsync(src, md, {}, { filePath: 'det.md' }); + + // Worker-thread parse. Inline worker that imports the same dist build. + const workerCode = ` + import { parentPort, workerData } from 'node:worker_threads'; + import { createMarkdownProcessor, processContentAsync } from '${import.meta.dirname}/../dist/index.js'; + (async () => { + const md = createMarkdownProcessor({}, () => {}); + const r = await processContentAsync(workerData.src, md, {}, { filePath: workerData.filePath }); + parentPort.postMessage(r.htmlContent); + })().catch((e) => { parentPort.postMessage({ __err: e.message }); }); + `; + const workerResult = await new Promise((resolve, reject) => { + const w = new Worker(workerCode, { eval: true, workerData: { src, filePath: 'det.md' } }); + w.once('message', (msg) => { + if (msg && typeof msg === 'object' && msg.__err) reject(new Error(msg.__err)); + else resolve(msg); + }); + w.once('error', reject); + }); + assert.equal(workerResult, mainResult.htmlContent); +}); + +// โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ +// 8. Edge cases that round out the fixture to 50+ assertions +// โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ + +test('edge case: empty `info` after `::: callout` is preserved through normalisation', () => { + // `::: callout` with no extra info โ†’ passes through, no warnings. + const src = '::: callout\nbody\n:::\n'; + const r = normaliseContainers(src); + assert.equal(r.source, src); + assert.deepEqual(r.warnings, []); +}); + +test('edge case: `::: callout` followed immediately by another container (no body)', () => { + // Two opens in a row โ€” the inner one is "body" of the outer. Both + // push to the stack; one close closes the outer. + const src = '::: callout\n::: card "x"\nbody\n:::\n'; + const r = normaliseContainers(src); + // The card is closed by the user's `:::`, the callout is auto-closed + // at EOF with an ERROR. + assert.equal(r.warnings.filter((w) => w.severity === 'error').length, 1); +}); + +test('edge case: CRLF line endings preserve `\r` on pass-through lines (documented behaviour)', () => { + // The algorithm splits on `\n` so `\r` ends up at the end of each + // pass-through line and is kept verbatim. The close regex `\s*$` + // still matches because `\r` is `\s`. The output replaces close lines + // with a freshly-emitted `:::` (no `\r`), so the trailing `\r` on the + // user's close line is dropped โ€” but everything else keeps its `\r`. + // This matches the legacy shim's behaviour. + const src = '::: callout\r\nbody\r\n:::\r\n'; + const r = normaliseContainers(src); + // Pass-through lines retain `\r\n`; only the emitted `:::` is clean. + assert.equal(r.source, '::: callout\r\nbody\r\n:::\n'); + assert.deepEqual(r.warnings, []); +}); + +test('edge case: multiple spaces between `:::` and the container name', () => { + const src = '::: callout info "Title"\nbody\n:::\n'; + const r = normaliseContainers(src); + assert.equal(r.source, src); + assert.deepEqual(r.warnings, []); +}); + +test('edge case: deeply nested self-closing tags do not corrupt the stack', () => { + // Many self-closing tag lines; no closes, no opens, no pushes. + const lines = Array.from({ length: 50 }, (_, i) => `::: tag "v${i}"`).join('\n'); + const r = normaliseContainers(lines + '\n'); + assert.equal(r.source, lines + '\n'); + assert.deepEqual(r.warnings, []); +}); + +test('edge case: pre-existing normaliser output is idempotent', () => { + // Running the normaliser twice must produce the same result as once + // (for already-balanced input). + const src = [ + '::: grids', + ' ::: grid', + ' ::: card "Fast"', + ' body1', + ' :::', + ' ::: grid', + ' ::: card "Slow"', + ' body2', + ' :::', + ':::' + ].join('\n'); + const once = normaliseContainers(src); + const twice = normaliseContainers(once.source); + assert.equal(twice.source, once.source); +}); + +test('edge case: warning `line` numbers are 1-indexed and stable across edits', () => { + // Insert a line at the top; the warning for the stray `:::` should + // shift from line 1 to line 2. + const r1 = normaliseContainers(':::\n'); + assert.equal(r1.warnings[0].line, 1); + const r2 = normaliseContainers('# heading\n:::\n'); + assert.equal(r2.warnings[0].line, 2); +}); + +test('edge case: `NormaliserWarning` shape is exactly { line, severity, path, message }', () => { + const r = normaliseContainers(':::\n', { sourcePath: 'p.md' }); + const w = r.warnings[0]; + assert.deepEqual(Object.keys(w).sort(), ['line', 'message', 'path', 'severity']); + assert.equal(typeof w.line, 'number'); + assert.equal(typeof w.severity, 'string'); + assert.equal(typeof w.path, 'string'); + assert.equal(typeof w.message, 'string'); +}); + +test('edge case: container aliases (`tip`, `warning`, `info`, `note`, `danger`, `caution`) are NOT self-closing', () => { + // The parser maps `tip`, `warning`, `danger`, `info`, `note`, `caution` + // to callout types. The normaliser must NOT treat them as self-closing + // even though the names match a generic pattern. Only the literal set + // { button, tag, embed } is self-closing. + for (const name of ['tip', 'warning', 'danger', 'info', 'note', 'caution']) { + assert.ok( + !SELF_CLOSING_CONTAINER_NAMES.has(name), + `${name} must NOT be self-closing (it's a callout alias)` + ); + } +}); + +test('edge case: debug mode logs self-close lines to stdout', () => { + // Capture console.log to verify the debug path fires. + const originalLog = console.log; + const captured = []; + console.log = (...args) => captured.push(args.join(' ')); + try { + normaliseContainers('::: tag "x"\n', { debug: true }); + } finally { + console.log = originalLog; + } + assert.equal(captured.length, 1); + assert.match(captured[0], /self-close /); +}); + +test('edge case: warnings preserve insertion order across severity', () => { + // Three different issues in one source, each in source order: + // L1 โ€” stray top-level `:::` (warning) + // L2โ€“L6 โ€” callout + card with one close at indent 0 โ†’ implicit multi-close (info) + // L8 โ€” `::: unclosed` never closed (error) + const src = [ + ':::', // 1: stray (warning) + '::: callout', // 2 + ' ::: card "x"', // 3 + ' body', // 4 + ':::', // 5: closes callout + card (info) + '', // 6 + '::: unclosed' // 7: unclosed at EOF (error) + ].join('\n') + '\n'; + const r = normaliseContainers(src); + const sevs = r.warnings.map((w) => w.severity); + // All three severities should appear, in source order. + assert.deepEqual(sevs, ['warning', 'info', 'error']); + assert.equal(r.warnings[0].line, 1); + assert.equal(r.warnings[1].line, 5); + assert.equal(r.warnings[2].line, 7); +}); + +// โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ +// 8. Fenced code block tracking (F6 โ€” normaliser must not interpret +// `:::` lines that appear inside a ``` or ~~~ fence) +// โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ + +test('F6: ::: lines inside a ``` fence are not classified as opens/closes', () => { + // The docs site has pages that show `::: card ... :::` examples inside + // markdown code fences. Without fence tracking the normaliser treats the + // fenced `::: card` as a real open, pushes it on the stack, and reports + // a spurious "Unclosed " error when EOF arrives. + const src = [ + '# Buttons', // 1 + '', // 2 + '```markdown', // 3: fence open + '::: card "Setup"', // 4: literal text in fence + ' ::: button "Begin" ../../x', // 5: literal text in fence + ':::', // 6: literal text in fence + '```', // 7: fence close + '', // 8 + '::: callout', // 9: real open + 'body', // 10 + ':::' // 11: real close + ].join('\n') + '\n'; + const r = normaliseContainers(src); + // No warnings: the fenced ::: lines are not counted, the real callout + // at L9โ€“L11 is balanced. + assert.equal(r.warnings.length, 0); + // Output is unchanged โ€” the fence contents pass through verbatim. + assert.equal(r.source, src); +}); + +test('F6: ~~~ fences are also tracked', () => { + // CommonMark allows ~~~ as an alternative fence marker. + const src = [ + '~~~markdown', // 1: fence open + '::: card "x"', // 2: literal + ':::', // 3: literal + '~~~', // 4: fence close + '::: callout', // 5: real open + ':::' // 6: real close + ].join('\n') + '\n'; + const r = normaliseContainers(src); + assert.equal(r.warnings.length, 0); + assert.equal(r.source, src); +}); + +test('F6: a real ::: card outside a fence still reports the unclosed error', () => { + // Regression guard: fence tracking must not swallow real container errors + // that occur outside any fence. + const src = [ + '```markdown', // 1: fence open + '::: card "fenced"', // 2: literal + '```', // 3: fence close + '::: card "real"', // 4: real open, never closed + 'body' // 5 + ].join('\n') + '\n'; + const r = normaliseContainers(src); + const errors = r.warnings.filter((w) => w.severity === 'error'); + assert.equal(errors.length, 1); + assert.match(errors[0].message, /Unclosed.*card/); + assert.equal(errors[0].line, 4); +}); + +test('F6: mismatched fence markers (``` open vs ~~~ close) do not close the fence', () => { + // CommonMark says a fence closes only on the same marker that opened it. + const src = [ + '```markdown', // 1: ``` fence open + '::: card "x"', // 2: literal + '~~~', // 3: NOT a close (different marker) + '::: card "y"', // 4: literal (still inside fence) + '```' // 5: real close + ].join('\n') + '\n'; + const r = normaliseContainers(src); + assert.equal(r.warnings.length, 0); + assert.equal(r.source, src); +}); \ No newline at end of file diff --git a/packages/parser/tsconfig.json b/packages/parser/tsconfig.json new file mode 100644 index 0000000..9635ce4 --- /dev/null +++ b/packages/parser/tsconfig.json @@ -0,0 +1,10 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "outDir": "./dist", + "rootDir": "./src", + "strict": false + }, + "include": ["src/**/*"], + "exclude": ["node_modules", "dist", "**/*.test.ts"] +} \ No newline at end of file diff --git a/packages/plugins/analytics/LICENSE b/packages/plugins/analytics/LICENSE new file mode 100644 index 0000000..997bb73 --- /dev/null +++ b/packages/plugins/analytics/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025-present docmd.io + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/packages/plugins/analytics/README.md b/packages/plugins/analytics/README.md new file mode 100644 index 0000000..acbea7b --- /dev/null +++ b/packages/plugins/analytics/README.md @@ -0,0 +1,24 @@ +# @docmd/plugin-analytics + +Adds Google Analytics (GA4) to your docmd site - bundled with `@docmd/core`, zero installation required. + +```js +// docmd.config.js +module.exports = { + plugins: { + analytics: { + googleV4: { measurementId: 'G-XXXXXXXXXX' } + } + } +}; +``` + +Part of the **[docmd](https://github.com/docmd-io/docmd)** documentation engine. + +## Documentation + +See **[docs.docmd.io](https://docs.docmd.io)** for full usage and API reference. + +## License + +MIT \ No newline at end of file diff --git a/packages/plugins/analytics/package.json b/packages/plugins/analytics/package.json new file mode 100644 index 0000000..7668206 --- /dev/null +++ b/packages/plugins/analytics/package.json @@ -0,0 +1,64 @@ +{ + "name": "@docmd/plugin-analytics", + "version": "0.8.12", + "description": "Analytics injection plugin for docmd.", + "type": "module", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "docmd": { + "key": "analytics", + "kind": "plugin", + "displayName": "Analytics", + "tagline": "Analytics injection plugin for docmd.", + "capabilities": [ + "head", + "body" + ] + }, + "scripts": { + "build": "tsc" + }, + "files": [ + "dist" + ], + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@docmd/api": "workspace:*" + }, + "dependencies": { + "@docmd/utils": "workspace:*" + }, + "devDependencies": { + "@docmd/api": "workspace:*" + }, + "keywords": [ + "docmd", + "plugin", + "analytics", + "tracking", + "ga4", + "google-analytics", + "markdown", + "minimalist", + "zero-config", + "site-generator", + "static-site-generator", + "docs" + ], + "author": { + "name": "Ghazi", + "url": "https://mgks.dev" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/docmd-io/docmd.git" + }, + "bugs": { + "url": "https://github.com/docmd-io/docmd/issues" + }, + "homepage": "https://docmd.io", + "funding": "https://github.com/sponsors/mgks", + "license": "MIT" +} \ No newline at end of file diff --git a/packages/plugins/analytics/src/index.ts b/packages/plugins/analytics/src/index.ts new file mode 100644 index 0000000..6779620 --- /dev/null +++ b/packages/plugins/analytics/src/index.ts @@ -0,0 +1,130 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/core (and ecosystem) + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + */ + +/** + * @returns {Object} { headScriptsHtml, bodyScriptsHtml } + */ + +import type { PluginDescriptor } from '@docmd/api'; +import { scriptLiteral } from '@docmd/utils'; + +export const plugin: PluginDescriptor = { + name: 'analytics', + version: '0.8.12', + capabilities: ['head', 'body'] +}; + +// Phase 1.C (S-4 fix): format-validate the IDs before interpolation. +// GA4 measurementId is `G-XXXXXXXX` (uppercase letters and digits after the prefix). +// UA trackingId is `UA-XXXXXXX-Y`. +const GA4_ID_RE = /^G-[A-Z0-9]{6,12}$/; +const UA_ID_RE = /^UA-\d{6,12}-\d{1,3}$/; + +export function generateScripts(config: any) { + let headScriptsHtml = ''; + let bodyScriptsHtml = ''; + + const analytics = config.plugins?.analytics || {}; + + // Google Analytics 4 + if (analytics.googleV4?.measurementId) { + const id = analytics.googleV4.measurementId; + if (!GA4_ID_RE.test(id)) { + console.error(`[analytics] Invalid googleV4.measurementId: ${JSON.stringify(id)}. Expected format G-XXXXXXXX. Analytics script skipped.`); + } else { + const idLiteral = scriptLiteral(id); + headScriptsHtml += ` + + + \n`; + } + } + + // Legacy UA + if (analytics.googleUA?.trackingId) { + const id = analytics.googleUA.trackingId; + if (!UA_ID_RE.test(id)) { + console.error(`[analytics] Invalid googleUA.trackingId: ${JSON.stringify(id)}. Expected format UA-XXXXXXX-Y. Analytics script skipped.`); + } else { + const idLiteral = scriptLiteral(id); + headScriptsHtml += ` + + + \n`; + } + } + + // Auto-event Tagging (V2) + if (analytics.autoEvents !== false) { + const trackSearch = analytics.trackSearch !== false; + bodyScriptsHtml += ` + \n`; + } + + return { headScriptsHtml, bodyScriptsHtml }; +} \ No newline at end of file diff --git a/packages/plugins/analytics/tsconfig.json b/packages/plugins/analytics/tsconfig.json new file mode 100644 index 0000000..7befc89 --- /dev/null +++ b/packages/plugins/analytics/tsconfig.json @@ -0,0 +1,10 @@ +{ + "extends": "../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "./dist", + "rootDir": "./src", + "strict": false + }, + "include": ["src/**/*"], + "exclude": ["node_modules", "dist", "**/*.test.ts"] +} \ No newline at end of file diff --git a/packages/plugins/git/LICENSE b/packages/plugins/git/LICENSE new file mode 100644 index 0000000..f4432ba --- /dev/null +++ b/packages/plugins/git/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025-present docmd.io + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/plugins/git/README.md b/packages/plugins/git/README.md new file mode 100644 index 0000000..9fb9e52 --- /dev/null +++ b/packages/plugins/git/README.md @@ -0,0 +1,17 @@ +# @docmd/plugin-git + +Adds Git-based metadata to your docmd site: last-updated timestamps, contributor history, and edit links derived directly from your repository. Core plugin, already included in the core. + +```bash +docmd add git +``` + +Part of the **[docmd](https://github.com/docmd-io/docmd)** documentation engine. + +## Documentation + +See **[docs.docmd.io](https://docs.docmd.io)** for full usage and API reference. + +## License + +MIT \ No newline at end of file diff --git a/packages/plugins/git/build.js b/packages/plugins/git/build.js new file mode 100644 index 0000000..cec588e --- /dev/null +++ b/packages/plugins/git/build.js @@ -0,0 +1,39 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/core (and ecosystem) + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + */ + +import fs from 'fs'; +import path from 'path'; +import { fileURLToPath } from 'url'; + +const __dirname = path.dirname(fileURLToPath(import.meta.url)); +const srcClientDir = path.resolve(__dirname, 'src', 'client'); +const distDir = path.resolve(__dirname, 'dist', 'client'); + +// Ensure dist/client directory exists +if (!fs.existsSync(distDir)) { + fs.mkdirSync(distDir, { recursive: true }); +} + +// Copy client files +const files = ['git-widget.js', 'git-widget.css']; +for (const file of files) { + const src = path.join(srcClientDir, file); + const dest = path.join(distDir, file); + if (fs.existsSync(src)) { + fs.copyFileSync(src, dest); + console.log(` ${file} โ†’ dist/client/`); + } +} + +console.log('โœ“ Client assets built'); \ No newline at end of file diff --git a/packages/plugins/git/i18n/de.json b/packages/plugins/git/i18n/de.json new file mode 100644 index 0000000..b404589 --- /dev/null +++ b/packages/plugins/git/i18n/de.json @@ -0,0 +1,13 @@ +{ + "lastUpdated": "Zuletzt aktualisiert", + "recentCommits": "Letzte Commits", + "viewCommitHistory": "Commit-Verlauf anzeigen", + "editOnGitHub": "Auf GitHub bearbeiten", + "editOnGitLab": "Auf GitLab bearbeiten", + "editOnBitbucket": "Auf Bitbucket bearbeiten", + "editThisPage": "Seite bearbeiten", + "justNow": "gerade eben", + "minutesAgo": "vor {n} Min.", + "hoursAgo": "vor {n} Std.", + "daysAgo": "vor {n} T." +} diff --git a/packages/plugins/git/i18n/en.json b/packages/plugins/git/i18n/en.json new file mode 100644 index 0000000..101bc20 --- /dev/null +++ b/packages/plugins/git/i18n/en.json @@ -0,0 +1,13 @@ +{ + "lastUpdated": "Last updated", + "recentCommits": "Recent commits", + "viewCommitHistory": "View commit history", + "editOnGitHub": "Edit on GitHub", + "editOnGitLab": "Edit on GitLab", + "editOnBitbucket": "Edit on Bitbucket", + "editThisPage": "Edit this page", + "justNow": "just now", + "minutesAgo": "{n}m ago", + "hoursAgo": "{n}h ago", + "daysAgo": "{n}d ago" +} \ No newline at end of file diff --git a/packages/plugins/git/i18n/ko.json b/packages/plugins/git/i18n/ko.json new file mode 100644 index 0000000..08a6c84 --- /dev/null +++ b/packages/plugins/git/i18n/ko.json @@ -0,0 +1,13 @@ +{ + "lastUpdated": "๋งˆ์ง€๋ง‰ ์—…๋ฐ์ดํŠธ", + "recentCommits": "์ตœ๊ทผ ์ปค๋ฐ‹", + "viewCommitHistory": "์ปค๋ฐ‹ ๊ธฐ๋ก ๋ณด๊ธฐ", + "editOnGitHub": "GitHub์—์„œ ํŽธ์ง‘", + "editOnGitLab": "GitLab์—์„œ ํŽธ์ง‘", + "editOnBitbucket": "Bitbucket์—์„œ ํŽธ์ง‘", + "editThisPage": "์ด ํŽ˜์ด์ง€ ํŽธ์ง‘", + "justNow": "๋ฐฉ๊ธˆ ์ „", + "minutesAgo": "{n}๋ถ„ ์ „", + "hoursAgo": "{n}์‹œ๊ฐ„ ์ „", + "daysAgo": "{n}์ผ ์ „" +} diff --git a/packages/plugins/git/i18n/zh.json b/packages/plugins/git/i18n/zh.json new file mode 100644 index 0000000..b7d0c2e --- /dev/null +++ b/packages/plugins/git/i18n/zh.json @@ -0,0 +1,13 @@ +{ + "lastUpdated": "ๆœ€ๅŽๆ›ดๆ–ฐ", + "recentCommits": "ๆœ€่ฟ‘ๆไบค", + "viewCommitHistory": "ๆŸฅ็œ‹ๆไบคๅކๅฒ", + "editOnGitHub": "ๅœจ GitHub ไธŠ็ผ–่พ‘", + "editOnGitLab": "ๅœจ GitLab ไธŠ็ผ–่พ‘", + "editOnBitbucket": "ๅœจ Bitbucket ไธŠ็ผ–่พ‘", + "editThisPage": "็ผ–่พ‘ๆญค้กต", + "justNow": "ๅˆšๅˆš", + "minutesAgo": "{n}ๅˆ†้’Ÿๅ‰", + "hoursAgo": "{n}ๅฐๆ—ถๅ‰", + "daysAgo": "{n}ๅคฉๅ‰" +} diff --git a/packages/plugins/git/package.json b/packages/plugins/git/package.json new file mode 100644 index 0000000..aae27e4 --- /dev/null +++ b/packages/plugins/git/package.json @@ -0,0 +1,76 @@ +{ + "name": "@docmd/plugin-git", + "version": "0.8.12", + "description": "Git integration plugin for docmd.", + "type": "module", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "exports": { + ".": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + }, + "docmd": { + "key": "git", + "kind": "plugin", + "displayName": "Git", + "tagline": "Git integration with last-updated timestamps and commit history.", + "capabilities": [ + "init", + "build", + "body", + "assets", + "post-build", + "translations" + ] + }, + "scripts": { + "build": "tsc && node build.js" + }, + "files": [ + "dist", + "i18n" + ], + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@docmd/api": "workspace:*" + }, + "devDependencies": { + "@docmd/api": "workspace:*", + "@types/node": "^24.13.3" + }, + "keywords": [ + "docmd", + "plugin", + "git", + "github", + "gitlab", + "last-updated", + "contributors", + "edit-link", + "markdown", + "documentation", + "minimalist", + "zero-config", + "site-generator", + "static-site-generator", + "docs" + ], + "author": { + "name": "Ghazi", + "url": "https://mgks.dev" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/docmd-io/docmd.git" + }, + "bugs": { + "url": "https://github.com/docmd-io/docmd/issues" + }, + "homepage": "https://docmd.io", + "funding": "https://github.com/sponsors/mgks", + "license": "MIT" +} \ No newline at end of file diff --git a/packages/plugins/git/src/client/git-widget.css b/packages/plugins/git/src/client/git-widget.css new file mode 100644 index 0000000..384d50c --- /dev/null +++ b/packages/plugins/git/src/client/git-widget.css @@ -0,0 +1,169 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/core (and ecosystem) + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + */ + +/* โ”€โ”€ Wrapper โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ */ +.git-last-updated { + display: inline-flex; + align-items: center; + gap: 0.375rem; + color: var(--text-light); + font-size: 0.875rem; + position: relative; + cursor: default; +} + +.git-last-updated.has-history { cursor: default; } +.git-last-updated.has-history:hover, +.git-last-updated.has-history:focus-within { color: var(--link-color); } + +/* โ”€โ”€ Icon / Label / Time โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ */ +.git-icon, .git-label, .git-time { pointer-events: none; } +.git-icon { width: 1em; height: 1em; flex-shrink: 0; } +.git-label { opacity: 0.8; } +.git-time { font-weight: 500; } + +/* โ”€โ”€ Spacer โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ */ +.git-spacer { flex: 1; } + +/* โ”€โ”€ Tooltip โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ */ +.git-commit-tooltip { + position: absolute; + bottom: calc(100% + 10px); + left: 0; + min-width: 280px; + max-width: 360px; + background: var(--bg-color); + border: 1px solid var(--border-color); + border-radius: var(--radius-lg, 0.5rem); + box-shadow: var(--shadow-sm); + padding: 0.75rem; + z-index: 100; + opacity: 0; + visibility: hidden; + transform: translateY(4px); + transition: opacity 0.15s ease, transform 0.15s ease, visibility 0s linear 0.15s; + pointer-events: none; +} + +/* Bridge fills gap between tooltip and text - no visual appearance */ +.git-commit-tooltip::before { + content: ''; + position: absolute; + top: 100%; + left: 0; + right: 0; + height: 14px; + background: transparent; + pointer-events: auto; +} + +/* Show via CSS :hover */ +.git-last-updated.has-history:hover .git-commit-tooltip, +.git-last-updated.has-history:focus-within .git-commit-tooltip, +.git-commit-tooltip.visible { + opacity: 1; + visibility: visible; + transform: translateY(0); + transition: opacity 0.15s ease, transform 0.15s ease, visibility 0s linear 0s; + pointer-events: auto; +} + +/* Arrow points downward */ +.git-commit-tooltip::after { + content: ''; + position: absolute; + top: 100%; + left: 1.5rem; + border: 10px solid transparent; + border-top-color: var(--border-color); + pointer-events: none; +} + +/* โ”€โ”€ Tooltip Header โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ */ +.git-tooltip-title { + font-size: 0.75rem; + font-weight: 600; + text-transform: uppercase; + letter-spacing: 0.025em; + color: var(--text-light); + margin-bottom: 0.5rem; + /* padding-bottom: 0.5rem; */ + /* border-bottom: 1px solid var(--border-color); */ +} + +/* โ”€โ”€ Commit List โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ */ +.git-commit-list { list-style: none; margin: 0; padding: 0; } + +.git-commit-item { + display: flex; + align-items: flex-start; + gap: 0.625rem; + padding: 0.5rem 0; +} + +.git-commit-avatar { + width: 1.75rem; + height: 1.75rem; + border-radius: 50%; + background: var(--accent-color, #3b82f6); + color: #fff; + font-size: 0.625rem; + font-weight: 600; + display: flex; + align-items: center; + justify-content: center; + flex-shrink: 0; + overflow: hidden; +} +.git-commit-avatar img { + width: 100%; + height: 100%; + object-fit: cover; +} + +.git-commit-details { flex: 1; min-width: 0; } + +.git-commit-message { + font-size: 0.8125rem; + color: var(--text-color); + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + line-height: 1.4; +} + +.git-commit-meta { + display: flex; + align-items: baseline; + gap: 0.5rem; + font-size: 0.7rem; + color: var(--text-light); + margin-top: 0.125rem; +} + +.git-commit-author { font-weight: 500; } +.git-commit-date {font-size: .8em;color: var(--sidebar-text);} + +/* โ”€โ”€ Dark mode โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ */ +[data-theme="dark"] .git-commit-tooltip { box-shadow: var(--shadow-lg); } + +/* โ”€โ”€ Responsive โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ */ +@media (max-width: 640px) { + .git-commit-tooltip { + min-width: 240px; + max-width: calc(100vw - 2rem); + left: -0.5rem; + } + .git-label { display: none; } +} \ No newline at end of file diff --git a/packages/plugins/git/src/client/git-widget.js b/packages/plugins/git/src/client/git-widget.js new file mode 100644 index 0000000..7c6bb0c --- /dev/null +++ b/packages/plugins/git/src/client/git-widget.js @@ -0,0 +1,97 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/core (and ecosystem) + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + */ + +(function () { + const i18n = window.__git_i18n || {}; + + /** + * Format a Unix ms timestamp into a human-readable relative or absolute string. + */ + function formatTime(ts) { + const config = window.__git_config || {}; + const format = config.dateFormat || 'relative'; + const dateObj = new Date(ts); + + if (format === 'iso') { + return dateObj.toISOString(); + } + + if (format === 'locale-aware') { + return dateObj.toLocaleString(document.documentElement.lang || 'en'); + } + + const diff = Date.now() - ts; + const s = Math.floor(diff / 1000); + const m = Math.floor(s / 60); + const h = Math.floor(m / 60); + const d = Math.floor(h / 24); + + if (d < 1) { + if (h >= 1) return (i18n.hoursAgo || '{n}h ago').replace('{n}', h); + if (m >= 1) return (i18n.minutesAgo || '{n}m ago').replace('{n}', m); + return i18n.justNow || 'just now'; + } + if (d < 7) return (i18n.daysAgo || '{n}d ago').replace('{n}', d); + + return dateObj.toLocaleDateString( + document.documentElement.lang || 'en', + { year: 'numeric', month: 'short', day: 'numeric' } + ); + } + + /** + * Hydrate all git [data-timestamp] elements with formatted relative time. + * Scoped to .git-last-updated and .git-commit-list to avoid collisions. + */ + function hydrateTimes() { + document.querySelectorAll('.git-last-updated [data-timestamp], .git-commit-list [data-timestamp]').forEach(function (el) { + const ts = parseInt(el.getAttribute('data-timestamp'), 10); + if (!ts || isNaN(ts)) return; + el.textContent = formatTime(ts); + }); + } + + /** + * Wire up keyboard accessibility on .git-last-updated elements. + * Tooltip visibility is handled by CSS :hover/:focus-within. + * JS only adds tabindex and aria attributes for keyboard users. + */ + function wireTooltips() { + document.querySelectorAll('.git-last-updated').forEach(function (wrapper) { + const tooltip = wrapper.querySelector('.git-commit-tooltip'); + if (!tooltip) return; + + wrapper.classList.add('has-history'); + wrapper.setAttribute('tabindex', '0'); + wrapper.setAttribute('role', 'button'); + wrapper.setAttribute('aria-label', i18n.viewCommitHistory || 'View commit history'); + }); + } + + function init() { + hydrateTimes(); + wireTooltips(); + } + + if (document.readyState === 'loading') { + document.addEventListener('DOMContentLoaded', init); + } else { + init(); + } + + // Re-run after SPA navigation โ€” the SPA router swaps .page-footer-actions + // innerHTML on every page change, so we must re-hydrate timestamps and + // re-wire tooltip accessibility on the freshly injected elements. + document.addEventListener('docmd:page-mounted', init); +})(); \ No newline at end of file diff --git a/packages/plugins/git/src/index.ts b/packages/plugins/git/src/index.ts new file mode 100644 index 0000000..0e410b8 --- /dev/null +++ b/packages/plugins/git/src/index.ts @@ -0,0 +1,596 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/core (and ecosystem) + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + */ + +import path from 'path'; +import fs from 'fs'; +import os from 'os'; +import { execFile } from 'child_process'; +import { promisify } from 'util'; +import crypto from 'crypto'; + +const execFileAsync = promisify(execFile); +import { fileURLToPath } from 'url'; + +import type { PluginDescriptor, PageContext, Engine } from '@docmd/api'; + +// --------------------------------------------------------------------------- +// Engine Integration +// --------------------------------------------------------------------------- + +let _engine: Engine | null = null; +let _engineLoadAttempted = false; +let _configuredEngine: string = 'rust'; // default: prefer Rust, respected from config + +/** + * Try to load an engine based on config.engine key. + * Falls back to JS engine, then to execFile if neither is available. + */ +async function getEngine(): Promise { + if (_engineLoadAttempted) return _engine; + _engineLoadAttempted = true; + + try { + const { loadEngine } = await import('@docmd/api'); + if (_configuredEngine === 'js') { + _engine = await loadEngine('js'); + } else { + // Default: try Rust, fall back to JS + _engine = await loadEngine('rust').catch(() => loadEngine('js')); + } + return _engine; + } catch { + // No engine available โ€” will use execFile fallback + return null; + } +} + +/** + * Get git log for multiple files using the engine (batch operation). + * Returns a Map from file path to commits array. + */ +async function getGitLogViaEngine( + filePaths: string[], + maxCommits: number +): Promise | null> { + const engine = await getEngine(); + if (!engine) return null; + + try { + const result = await engine.run>({ + type: 'git:log', + payload: { filePaths, maxCommits } + }); + + if (!result.success) return null; + return new Map(Object.entries(result.data || {})); + } catch { + return null; + } +} + +// --------------------------------------------------------------------------- +// Original Implementation (fallback when engine is not available) +// --------------------------------------------------------------------------- + +const gitRootCache = new Map(); +const gitCache = new Map(); + +// Persistent disk cache for git histories +let _diskCache: Record | null = null; +let _diskCachePath: string | null = null; +let _cacheDirty = false; + +// Per-build deduplication: git indexing only needs to run once per full build. +// The in-memory gitCache stores results for all subsequent locale/version passes. +let _gitBuildId = ''; +let _gitIndexingDone = false; + +/** + * Resolve the cache directory anchored to the git root (not process.cwd()). + * This fixes multi-project builds where process.chdir() shifts per-project, + * which caused the cache to land in unpredictable subdirectories. + */ +let _configuredTmpDir: string | null = null; + +/** + * Resolve the cache directory base path. + * If config.tmp is configured, stores temporary files inside that specified path. + * Otherwise, moves them to the device's actual OS temporary folder nested by project hash + * so multiple documentations on the same device remain perfectly isolated. + */ +function resolveCacheDir(): string { + if (_configuredTmpDir) { + return path.join(path.resolve(process.cwd(), _configuredTmpDir), 'cache'); + } + + // Walk up from cwd to find the project git root, ensuring stable path resolution + let dir = process.cwd(); + for (let i = 0; i < 10; i++) { + if (fs.existsSync(path.join(dir, '.git'))) { + break; + } + const parent = path.dirname(dir); + if (parent === dir) break; + dir = parent; + } + + // Derive a consistent project identifier (remote origin URL -> directory inode -> absolute path) + // Ensures cache directory resolution remains stable across local folder moves/renames. + let identifier = dir; + try { + const gitConfigPath = path.join(dir, '.git', 'config'); + let urlFound = false; + if (fs.existsSync(gitConfigPath)) { + const content = fs.readFileSync(gitConfigPath, 'utf8'); + const match = content.match(/url\s*=\s*([^\r\n]+)/); + if (match && match[1]) { + identifier = match[1].trim(); + urlFound = true; + } + } + if (!urlFound) { + const stat = fs.statSync(dir); + if (stat && stat.ino) { + identifier = `ino:${stat.ino}`; + } + } + } catch { + try { + const stat = fs.statSync(dir); + if (stat && stat.ino) identifier = `ino:${stat.ino}`; + } catch { /* keep absolute path fallback */ } + } + + // Generate a unique hash for this stable project identifier + const hash = crypto.createHash('md5').update(identifier).digest('hex').slice(0, 12); + const baseSlug = path.basename(dir).replace(/[^a-zA-Z0-9-_]/g, ''); + return path.join(os.tmpdir(), `docmd-${baseSlug}-${hash}`, 'cache'); +} + +function initDiskCache() { + if (_diskCache !== null) return; + const cacheDir = resolveCacheDir(); + _diskCachePath = path.join(cacheDir, 'git-history.json'); + try { + if (fs.existsSync(_diskCachePath)) { + _diskCache = JSON.parse(fs.readFileSync(_diskCachePath, 'utf8')); + } else { + _diskCache = {}; + } + } catch { + _diskCache = {}; + } +} + +function saveDiskCache() { + if (!_cacheDirty || !_diskCachePath || !_diskCache) return; + try { + // Prune entries for files that no longer exist on disk + const keys = Object.keys(_diskCache); + for (const key of keys) { + try { + if (!fs.existsSync(key)) delete _diskCache[key]; + } catch { /* ignore stat errors */ } + } + + const cacheDir = path.dirname(_diskCachePath); + if (!fs.existsSync(cacheDir)) fs.mkdirSync(cacheDir, { recursive: true }); + fs.writeFileSync(_diskCachePath, JSON.stringify(_diskCache), 'utf8'); + _cacheDirty = false; + } catch { /* ignore */ } +} + + +async function resolveGitRoot(dir: string): Promise { + if (gitRootCache.has(dir)) return gitRootCache.get(dir)!; + try { + const realDir = fs.realpathSync(dir); + const { stdout } = await execFileAsync('git', ['rev-parse', '--show-toplevel'], { + cwd: realDir + }); + const result = stdout.trim(); + gitRootCache.set(dir, result); + return result; + } catch { + gitRootCache.set(dir, null); + return null; + } +} + +async function getGitFileInfo(filePath: string, maxCommits: number = 6): Promise { + if (gitCache.has(filePath)) return gitCache.get(filePath)!; + + initDiskCache(); + + let fileStat; + try { + fileStat = fs.statSync(filePath); + } catch { + return null; + } + + // Check disk cache + if (_diskCache && _diskCache[filePath] && _diskCache[filePath].mtimeMs === fileStat.mtimeMs) { + const cachedInfo = _diskCache[filePath].info; + gitCache.set(filePath, cachedInfo); + return cachedInfo; + } + + const fileDir = path.dirname(filePath); + const gitRoot = await resolveGitRoot(fileDir); + if (!gitRoot) return null; + + const normalizedRoot = fs.realpathSync(gitRoot); + const normalizedFile = fs.realpathSync(filePath); + + const relPath = path.relative(normalizedRoot, normalizedFile).replace(/\\/g, '/'); + + if (!relPath || relPath.startsWith('..') || path.isAbsolute(relPath)) return null; + + try { + const { stdout } = await execFileAsync('git', [ + 'log', + '--follow', + '-n', maxCommits.toString(), + '--format=%H|%h|%an|%ae|%at|%s', + '--', + relPath + ], { + cwd: normalizedRoot + }); + + const logOutput = stdout.trim(); + if (!logOutput) return null; + + const commits: GitCommit[] = logOutput.split('\n').filter(Boolean).map((line: string) => { + const [hash, shortHash, author, email, timestamp, ...messageParts] = line.split('|'); + const ts = parseInt(timestamp, 10) * 1000; + const hashEmail = crypto.createHash('md5').update(email.trim().toLowerCase()).digest('hex'); + return { + hash, + shortHash, + author, + email, + date: new Date(ts).toISOString(), + timestamp: ts, + message: messageParts.join('|'), + avatarUrl: `https://www.gravatar.com/avatar/${hashEmail}?d=mp&s=64` + }; + }); + + if (commits.length === 0) return null; + + const info: GitFileInfo = { + lastUpdated: commits[0]?.date || '', + lastUpdatedTimestamp: commits[0]?.timestamp || 0, + commits + }; + + gitCache.set(filePath, info); + if (_diskCache) { + _diskCache[filePath] = { mtimeMs: fileStat.mtimeMs, info }; + _cacheDirty = true; + } + return info; + } catch { + return null; + } +} + +export const plugin: PluginDescriptor = { + name: 'git', + version: '0.8.12', + capabilities: ['build', 'body', 'assets', 'translations', 'init', 'post-build'] +}; + +const __dirname = path.dirname(fileURLToPath(import.meta.url)); +const i18nDir = path.resolve(__dirname, '..', 'i18n'); + +export interface GitCommit { + hash: string; + shortHash: string; + author: string; + email: string; + date: string; + timestamp: number; + message: string; + avatarUrl: string; +} + +export interface GitFileInfo { + lastUpdated: string; + lastUpdatedTimestamp: number; + commits: GitCommit[]; +} + +/** + * Format a timestamp for display. + * Uses relative time for recent updates, absolute for older ones. + */ +function formatLastUpdated(timestamp: number, locale: string = 'en'): string { + const now = Date.now(); + const diff = now - timestamp; + const seconds = Math.floor(diff / 1000); + const minutes = Math.floor(seconds / 60); + const hours = Math.floor(minutes / 60); + const days = Math.floor(hours / 24); + + // For very recent updates, show relative time + if (days < 1) { + if (hours >= 1) { + return `${hours}h ago`; + } + if (minutes >= 1) { + return `${minutes}m ago`; + } + return 'just now'; + } + + if (days < 7) { + return `${days}d ago`; + } + + // For older updates, show date + const date = new Date(timestamp); + return date.toLocaleDateString(locale, { + year: 'numeric', + month: 'short', + day: 'numeric' + }); +} + +/** + * Load translation strings for a given locale. + */ +function loadPluginStrings(localeId: string): Record { + try { + const localePath = path.join(i18nDir, `${localeId}.json`); + if (fs.existsSync(localePath)) { + return JSON.parse(fs.readFileSync(localePath, 'utf8')); + } + } catch { /* fallback below */ } + try { + const enPath = path.join(i18nDir, 'en.json'); + if (fs.existsSync(enPath)) { + return JSON.parse(fs.readFileSync(enPath, 'utf8')); + } + } catch { /* silent */ } + return {}; +} + +/** + * Plugin translations hook. + */ +export function translations(localeId: string): Record { + return loadPluginStrings(localeId || 'en'); +} + +let pluginOptions: any = {}; + +export function onConfigResolved(config: any): void { + gitCache.clear(); + gitRootCache.clear(); + _gitIndexingDone = false; + _engineLoadAttempted = false; // Reset engine state for fresh builds + _engine = null; + _diskCache = null; // Reset disk cache so it re-reads from the correct path + _diskCachePath = null; + _cacheDirty = false; + _configuredEngine = config.engine || 'rust'; // Respect the config.engine key + _configuredTmpDir = config.tmp || null; // Respect the config.tmp custom path + pluginOptions = config.plugins?.git || {}; +} + +/** + * onBeforeParse: stub for future use (per-page processing). + */ +export function onBeforeParse(_ctx: any): void { + // Logic removed (moved to onConfigResolved for better performance) +} + +export async function onBeforeBuild(ctx: any): Promise { + const { pages, tui, options } = ctx; + if (!pages || pages.length === 0) return; + + // Deduplicate per build: only the FIRST locale/version pass runs git log. + // Subsequent passes pull from the in-memory gitCache, which is already warm. + const buildId = (options as any)?._buildId || ''; + if (buildId !== _gitBuildId) { + _gitBuildId = buildId; + _gitIndexingDone = false; + } + + const commitHistory = pluginOptions?.commitHistory !== false; + const maxCommits = commitHistory ? (pluginOptions?.maxCommits || 5) : 1; + const showTui = tui && !options?.quiet && !_gitIndexingDone; + + if (_gitIndexingDone) { + // Still populate frontmatter from in-memory cache for this locale's pages + for (const page of pages) { + if (page?.sourcePath && page.frontmatter) { + const cached = gitCache.get(page.sourcePath); + if (cached) { + if (!commitHistory) cached.commits = []; + page.frontmatter._git = cached; + } + } + } + return; + } + + _gitIndexingDone = true; + const total = pages.length; + + if (showTui) tui.step(`Syncing git metadata`, 'WAIT'); + + // Collect all source paths that need git info. + // Pre-warm in-memory cache from disk first so the engine is only called + // for uncached or modified files (warm builds benefit from persistence). + const pathsToFetch: string[] = []; + const pagesByPath = new Map(); + + initDiskCache(); + for (const page of pages) { + const sourcePath = page?.sourcePath; + if (sourcePath && page.frontmatter && !gitCache.has(sourcePath)) { + let fileStat: any; + try { fileStat = fs.statSync(sourcePath); } catch { /* skip */ } + // Hit disk cache if file hasn't changed since last build + if (fileStat && _diskCache && _diskCache[sourcePath] && _diskCache[sourcePath].mtimeMs === fileStat.mtimeMs) { + gitCache.set(sourcePath, _diskCache[sourcePath].info); + if (page.frontmatter) page.frontmatter._git = _diskCache[sourcePath].info; + } else { + pathsToFetch.push(sourcePath); + if (!pagesByPath.has(sourcePath)) pagesByPath.set(sourcePath, []); + pagesByPath.get(sourcePath)!.push(page); + } + } + } + + // Try to use engine for batch processing (much faster with Rust) + const engineResult = await getGitLogViaEngine(pathsToFetch, maxCommits); + + + if (engineResult && engineResult.size > 0) { + // Engine succeeded โ€” process and persist results + for (const [filePath, commits] of engineResult) { + + if (commits && commits.length > 0) { + let fileStat: any; + try { fileStat = fs.statSync(filePath); } catch { /* skip */ } + + const info: GitFileInfo = { + lastUpdated: new Date(commits[0].timestamp).toISOString(), + lastUpdatedTimestamp: commits[0].timestamp, + commits: commits.map((c: any) => { + const hashEmail = crypto.createHash('md5').update((c.email || '').trim().toLowerCase()).digest('hex'); + return { + hash: c.hash, + shortHash: c.shortHash, + author: c.author, + email: c.email, + date: new Date(c.timestamp).toISOString(), + timestamp: c.timestamp, + message: c.message, + avatarUrl: `https://www.gravatar.com/avatar/${hashEmail}?d=mp&s=64` + }; + }) + }; + + if (!commitHistory) info.commits = []; + gitCache.set(filePath, info); + + // Persist to disk cache so subsequent builds are fast (warm start) + if (_diskCache && fileStat) { + _diskCache[filePath] = { mtimeMs: fileStat.mtimeMs, info }; + _cacheDirty = true; + } + + // Update all pages with this source path + const pagesForPath = pagesByPath.get(filePath) || []; + for (const page of pagesForPath) { + if (page.frontmatter) page.frontmatter._git = info; + } + } + } + + if (showTui) tui.step(`Syncing git metadata`, 'DONE'); + } else { + // Fallback to original execFile-based implementation + let processed = 0; + const CONCURRENCY = 10; + + for (let i = 0; i < total; i += CONCURRENCY) { + const batch = pages.slice(i, i + CONCURRENCY); + await Promise.all(batch.map(async (page: any) => { + const sourcePath = page?.sourcePath; + if (sourcePath && page.frontmatter) { + const gitInfo = await getGitFileInfo(sourcePath, maxCommits); + if (gitInfo) { + if (!commitHistory) gitInfo.commits = []; + page.frontmatter._git = gitInfo; + } + } + })); + processed += batch.length; + if (showTui) tui.step(`Syncing git metadata ${processed}/${total}`, 'WAIT'); + } + + if (showTui) tui.step(`Syncing git metadata`, 'DONE'); + } + + // Also populate pages that were already in cache + for (const page of pages) { + if (page?.sourcePath && page.frontmatter && !page.frontmatter._git) { + const cached = gitCache.get(page.sourcePath); + if (cached) { + if (!commitHistory) cached.commits = []; + page.frontmatter._git = cached; + } + } + } +} + +export function onPostBuild(): void { + saveDiskCache(); +} + +/** + * Generate scripts to inject git i18n strings for the client widget. + */ +export function generateScripts(config: any, options?: any): { headScriptsHtml: string; bodyScriptsHtml: string } { + const gitConfig = { + repo: options?.repo || config.editLink?.baseUrl || null, + branch: options?.branch || 'main', + editLink: options?.editLink !== false && !!(options?.repo || config.editLink?.baseUrl), + lastUpdated: options?.lastUpdated !== false, + commitHistory: options?.commitHistory !== false, + maxCommits: options?.maxCommits || 5, + dateFormat: options?.dateFormat || 'relative' + }; + + const localeId = config._activeLocale?.id || 'en'; + const i18nStrings = JSON.stringify(loadPluginStrings(localeId)); + + return { + headScriptsHtml: '', + bodyScriptsHtml: `` + }; +} + +/** + * Provide client-side assets. + * Always returns assets - client-side JS handles graceful degradation. + */ +export function getAssets(_options?: any): any[] { + // Always include assets - client-side JS handles visibility based on git status + const distDir = path.resolve(__dirname, '..', 'dist', 'client'); + return [ + { + src: path.join(distDir, 'git-widget.js'), + dest: 'assets/js/docmd-git.js', + type: 'js', + location: 'body', + attributes: { type: 'module' } + }, + { + src: path.join(distDir, 'git-widget.css'), + dest: 'assets/css/docmd-git.css', + type: 'css', + location: 'head' + } + ]; +} + +export { getGitFileInfo, formatLastUpdated }; \ No newline at end of file diff --git a/packages/plugins/git/tsconfig.json b/packages/plugins/git/tsconfig.json new file mode 100644 index 0000000..51f4bfc --- /dev/null +++ b/packages/plugins/git/tsconfig.json @@ -0,0 +1,21 @@ +{ + "compilerOptions": { + "target": "ES2022", + "module": "ESNext", + "moduleResolution": "bundler", + "declaration": true, + "declarationMap": true, + "sourceMap": true, + "outDir": "dist", + "rootDir": "src", + "strict": true, + "esModuleInterop": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true, + "resolveJsonModule": true, + "isolatedModules": true, + "types": ["node"] + }, + "include": ["src/**/*.ts"], + "exclude": ["node_modules", "dist"] +} diff --git a/packages/plugins/installer/LICENSE b/packages/plugins/installer/LICENSE new file mode 100644 index 0000000..997bb73 --- /dev/null +++ b/packages/plugins/installer/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025-present docmd.io + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/packages/plugins/installer/README.md b/packages/plugins/installer/README.md new file mode 100644 index 0000000..a457679 --- /dev/null +++ b/packages/plugins/installer/README.md @@ -0,0 +1,20 @@ +# @docmd/plugin-installer + +The engine behind `docmd add` and `docmd remove` - downloads plugins, resolves dependencies, and injects configuration into your `docmd.config.js` automatically. + +Bundled with `@docmd/core`. You do not need to install or configure this package directly. + +```bash +docmd add search +docmd remove search +``` + +Part of the **[docmd](https://github.com/docmd-io/docmd)** documentation engine. + +## Documentation + +See **[docs.docmd.io](https://docs.docmd.io)** for full usage and API reference. + +## License + +MIT \ No newline at end of file diff --git a/packages/plugins/installer/package.json b/packages/plugins/installer/package.json new file mode 100644 index 0000000..d7bb6b3 --- /dev/null +++ b/packages/plugins/installer/package.json @@ -0,0 +1,52 @@ +{ + "name": "@docmd/plugin-installer", + "version": "0.8.12", + "description": "Installer utility to add and remove plugins for docmd.", + "type": "module", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "scripts": { + "build": "tsc" + }, + "files": [ + "dist", + "registry" + ], + "engines": { + "node": ">=18" + }, + "dependencies": { + "@docmd/api": "workspace:*" + }, + "devDependencies": { + "@types/node": "^24.13.3" + }, + "keywords": [ + "docmd", + "plugin", + "installer", + "cli", + "add", + "remove", + "markdown", + "minimalist", + "zero-config", + "site-generator", + "static-site-generator", + "docs" + ], + "author": { + "name": "Ghazi", + "url": "https://mgks.dev" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/docmd-io/docmd.git" + }, + "bugs": { + "url": "https://github.com/docmd-io/docmd/issues" + }, + "homepage": "https://docmd.io", + "funding": "https://github.com/sponsors/mgks", + "license": "MIT" +} \ No newline at end of file diff --git a/packages/plugins/installer/registry/plugins.json b/packages/plugins/installer/registry/plugins.json new file mode 100644 index 0000000..2cd945a --- /dev/null +++ b/packages/plugins/installer/registry/plugins.json @@ -0,0 +1,81 @@ +{ + "analytics": { + "package": "@docmd/plugin-analytics", + "description": "Analytics injection plugin for docmd", + "configKey": "analytics", + "defaultConfig": "{}" + }, + "git": { + "package": "@docmd/plugin-git", + "description": "Git integration with last-updated timestamps and commit history", + "configKey": "git", + "defaultConfig": "{}" + }, + "search": { + "package": "@docmd/plugin-search", + "description": "Local search implementation for docmd", + "configKey": "search", + "defaultConfig": "{}" + }, + "seo": { + "package": "@docmd/plugin-seo", + "description": "SEO meta tag generator for docmd", + "configKey": "seo", + "defaultConfig": "{}" + }, + "sitemap": { + "package": "@docmd/plugin-sitemap", + "description": "Sitemap generator for docmd", + "configKey": "sitemap", + "defaultConfig": "{}" + }, + "mermaid": { + "package": "@docmd/plugin-mermaid", + "description": "Mermaid.js diagram support for docmd", + "configKey": "mermaid", + "defaultConfig": "{}" + }, + "openapi": { + "package": "@docmd/plugin-openapi", + "description": "OpenAPI / Swagger spec rendering for docmd", + "configKey": "openapi", + "defaultConfig": "{}" + }, + "llms": { + "package": "@docmd/plugin-llms", + "description": "LLM integration plugin for docmd", + "configKey": "llms", + "defaultConfig": "{}" + }, + "okf": { + "package": "@docmd/plugin-okf", + "description": "Open Knowledge Format (OKF) bundle generator for AI-agent consumption", + "configKey": "okf", + "defaultConfig": "{}" + }, + "pwa": { + "package": "@docmd/plugin-pwa", + "description": "Progressive Web App support for docmd", + "configKey": "pwa", + "defaultConfig": "{}" + }, + "threads": { + "package": "@docmd/plugin-threads", + "description": "Inline discussion threads for docmd", + "configKey": "threads", + "defaultConfig": "{}" + }, + "math": { + "package": "@docmd/plugin-math", + "description": "Math rendering support for docmd using KaTeX", + "configKey": "math", + "defaultConfig": "{}" + }, + "summer": { + "package": "@docmd/template-summer", + "description": "Summer template โ€” bright, hopeful, summer-feel layout with top search bar and halo accents", + "kind": "template", + "configKey": "summer", + "templateName": "summer" + } +} \ No newline at end of file diff --git a/packages/plugins/installer/src/config-editor.ts b/packages/plugins/installer/src/config-editor.ts new file mode 100644 index 0000000..2e4150d --- /dev/null +++ b/packages/plugins/installer/src/config-editor.ts @@ -0,0 +1,382 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/plugin-installer + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + */ + +/** + * Config editor + * ============= + * + * Phase 3 PR 3.B (F7 + M-3). \`docmd add \` and \`docmd remove + * \` must mutate the project's config file in a way that + * works for every supported format: + * + * - \`docmd.config.json\` โ€” JSON, parsed via \`JSON.parse\`. + * - \`docmd.config.js\` โ€” CJS (\`module.exports = { ... }\`). + * - \`docmd.config.mjs\` โ€” ESM (\`export default { ... }\` or + * \`export default defineConfig({...})\`). + * - \`docmd.config.cjs\` โ€” CJS, same as \`.js\`. + * - \`docmd.config.ts\` โ€” TS (\`export default defineConfig({...})\`). + * + * The previous implementation used a single regex + * (\`/module\\.exports\\s*=\\s*(?:defineConfig\\()?\\{...\}`) that + * matched only the CJS pattern. For \`export default\` (TS / MJS) the + * regex fell through silently, and the function returned \`false\` + * ("already configured") without actually editing the file. The user + * saw "Plugin successfully installed and activated" but the config + * was untouched (M-3). The same bug affected \`remove\` (F7). + * + * This module replaces the regex with a brace-balanced scanner that: + * + * 1. Strips comments first (line + block) so commented-out plugin + * entries are not treated as live config. + * 2. Detects the format by file extension. + * 3. For JSON: full parse + serialise (the only correct path). + * 4. For JS/TS/MJS/CJS: scans for the \`plugins:\` block using + * brace-balancing so multi-line nested objects are handled + * correctly. Inserts / removes the entry while preserving + * existing formatting (indent, trailing comma style, etc.). + * + * The scanner is intentionally dependency-free. The legacy regex + * approach is preserved as a fallback (and still used for format + * detection in \`detectConfigFormat\`); the new brace-balanced logic + * supersedes it for the add / remove paths. + */ + +/** + * Strip line and block comments from a JS/TS config body. Used to + * avoid matching commented-out plugin entries. + */ +function stripComments(content: string): string { + return content + .replace(/\/\*[\s\S]*?\*\//g, '') + .replace(/(^|[^:])\/\/.*$/gm, '$1'); +} + +export type ConfigFormat = 'json' | 'js' | 'ts' | 'mjs' | 'cjs'; + +export function detectConfigFormat(configPath: string): ConfigFormat { + if (configPath.endsWith('.json')) return 'json'; + if (configPath.endsWith('.ts')) return 'ts'; + if (configPath.endsWith('.mjs')) return 'mjs'; + if (configPath.endsWith('.cjs')) return 'cjs'; + return 'js'; +} + +/** + * Escape a string for safe use inside a RegExp. + */ +function escapeRe(s: string): string { + return s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); +} + +/** + * Find the \`plugins: { ... }\` block in a JS/TS/MJS/CJS config body. + * Uses brace-balancing to correctly handle nested objects. + * + * Returns the \`{ ... }\` extent (inclusive of braces) or null if no + * plugins block exists. + */ +function findPluginsBlock(content: string): { start: number; end: number } | null { + // Look for `plugins:` (possibly with whitespace, possibly quoted, + // possibly with comments) followed by `{`. The `g` flag is important + // because some configs have `theme.plugins` etc. + // Strip comments first to avoid false matches. + const stripped = stripComments(content); + const re = /\bplugins\s*:\s*\{/g; + let m: RegExpExecArray | null; + while ((m = re.exec(stripped)) !== null) { + const openIdx = m.index + m[0].length - 1; // index of `{` + let depth = 0; + for (let i = openIdx; i < stripped.length; i++) { + const ch = stripped[i]; + if (ch === '{') depth++; + else if (ch === '}') { + depth--; + if (depth === 0) return { start: openIdx, end: i }; + } else if (ch === '"' || ch === "'" || ch === '`') { + // Skip string literals so braces inside strings do not + // affect the depth count. + const quote = ch; + i++; + while (i < stripped.length && stripped[i] !== quote) { + if (stripped[i] === '\\') i++; // skip escaped char + i++; + } + } + } + } + return null; +} + +/** + * Detect the indentation of a block's content. Returns the leading + * whitespace of the first non-empty line inside the block. + */ +function detectIndent(inner: string): string { + const lines = inner.split('\n'); + for (const line of lines) { + if (line.trim() === '') continue; + const m = line.match(/^[\t ]*/); + return m ? m[0] : ' '; + } + return ' '; +} + +/** + * Add a plugin entry to the \`plugins: { ... }\` block. Returns the + * new content, or the original content if the entry is already + * present (in which case the caller should report "already + * configured"). + * + * @param content The full config file body. + * @param configKey The plugin key (e.g. \`search\`, \`mermaid\`). + * @param valueText The value to assign, as a JS source string + * (e.g. \`{}\` or \`{ theme: 'dark' }\`). + */ +export function addPluginToPluginsBlock( + content: string, + configKey: string, + valueText: string +): { newContent: string; changed: boolean } { + // Comment-aware "already configured" check. + const stripped = stripComments(content); + const alreadyRegex = new RegExp( + `(?:^|[\\s,\\{])(['"\`]?)${escapeRe(configKey)}\\1\\s*:`, + 'm' + ); + if (alreadyRegex.test(stripped)) { + return { newContent: content, changed: false }; + } + + const block = findPluginsBlock(content); + if (block) { + const inner = content.slice(block.start + 1, block.end); + const indent = detectIndent(inner) || ' '; + const entryIndent = indent + ' '; + const newEntry = `${entryIndent}'${configKey}': ${valueText}`; + + // Insert into the existing block. Honour trailing-comma style: + // { } -> { 'search': {} } + // { foo } -> { foo, 'search': {} } + // { foo, } -> { foo, 'search': {} } + const trimmed = inner.replace(/\s+$/, ''); // strip trailing whitespace + if (trimmed.trim() === '') { + const newInner = `\n${newEntry}\n${indent}`; + return { + newContent: + content.slice(0, block.start + 1) + newInner + content.slice(block.end), + changed: true + }; + } + const endsWithComma = trimmed.trimEnd().endsWith(','); + const sep = endsWithComma ? '\n' : ',\n'; + const newInner = trimmed + sep + newEntry; + return { + newContent: + content.slice(0, block.start + 1) + newInner + content.slice(block.end), + changed: true + }; + } + + // No `plugins:` block yet โ€” find the top-level object and add one. + // The top-level object can be: + // - JSON: { ... } + // - CJS: module.exports = { ... } + // - CJS + defineConfig: module.exports = defineConfig({ ... }); + // - ESM: export default { ... } + // - ESM + defineConfig: export default defineConfig({ ... }); + // - TS + defineConfig: export default defineConfig({ ... }); + const added = addPluginsBlockToTopLevel(content, configKey, valueText); + return { newContent: added, changed: added !== content }; +} + +/** + * Find the top-level object literal in a JS/TS config and add a + * \`plugins: { 'key': value }\` block to it. Returns the original + * content unchanged if no top-level object can be found. + */ +function addPluginsBlockToTopLevel( + content: string, + configKey: string, + valueText: string +): string { + // Strip comments so the search isn't confused by commented-out + // export statements. + const stripped = stripComments(content); + // Look for the FIRST opening `{` after an `export default` or + // `module.exports =` keyword. We want the top-level object, not a + // nested one. + const exportMatch = stripped.match( + /(?:export\s+default\s+(?:defineConfig(?:\s*<[^>]*>)?\s*)?|module\.exports\s*=\s*(?:defineConfig\s*)?)\s*\{/ + ); + if (!exportMatch) return content; + const openIdx = (exportMatch.index ?? 0) + exportMatch[0].length - 1; + + // Brace-balance to find the matching `}`. + let depth = 0; + let endIdx = -1; + for (let i = openIdx; i < stripped.length; i++) { + const ch = stripped[i]; + if (ch === '{') depth++; + else if (ch === '}') { + depth--; + if (depth === 0) { + endIdx = i; + break; + } + } else if (ch === '"' || ch === "'" || ch === '`') { + const quote = ch; + i++; + while (i < stripped.length && stripped[i] !== quote) { + if (stripped[i] === '\\') i++; + i++; + } + } + } + if (endIdx === -1) return content; + + // Find the LAST non-whitespace, non-`}` character before `endIdx` + // to detect if a trailing comma is already present. + const inner = content.slice(openIdx + 1, endIdx); + const trimmedInner = inner.replace(/\s+$/, ''); + const endsWithComma = trimmedInner.trimEnd().endsWith(','); + + // Match the indentation of the first sibling key in the object. + const indent = detectIndent(inner) || ' '; + const entryIndent = indent + ' '; + + // Honour the existing trailing-comma style: + // { foo } -> { foo, plugins: { ... } } + // { foo, } -> { foo, plugins: { ... } } + // { } -> { plugins: { ... } } + // The block is appended directly after the trimmed inner (which may + // already end in a newline); we do NOT add another newline here. + const sep = endsWithComma || trimmedInner.trim() === '' ? '' : ',\n'; + const pluginsBlock = + sep + + `${indent}plugins: {\n` + + `${entryIndent}'${configKey}': ${valueText}\n` + + `${indent}}\n`; + + const newInner = trimmedInner + pluginsBlock; + return ( + content.slice(0, openIdx + 1) + + newInner + + content.slice(endIdx) + ); +} + +/** + * Remove a plugin entry from the \`plugins: { ... }\` block. Returns + * the new content plus a `changed` flag. If the entry is not + * present, `changed` is false and the original content is returned. + */ +export function removePluginFromPluginsBlock( + content: string, + configKey: string +): { newContent: string; changed: boolean } { + // Comment-aware "is present" check. + const stripped = stripComments(content); + const presentRegex = new RegExp( + `(?:^|[\\s,\\{])(['"\`]?)${escapeRe(configKey)}\\1\\s*:`, + 'm' + ); + if (!presentRegex.test(stripped)) { + return { newContent: content, changed: false }; + } + + const block = findPluginsBlock(content); + if (!block) return { newContent: content, changed: false }; + + const inner = content.slice(block.start + 1, block.end); + // Match the entry. Tolerate: + // 'key': { ... } + // "key": { ... } + // `key`: { ... } + // key: { ... } (unquoted) + // The value is balanced braces (no nesting for default configs). + // Allow trailing comma and surrounding whitespace. + // + // The replacement is empty (NOT '\n') so that an empty `plugins: {}` + // block does not become `plugins: {\n}`. The caller (the installer) + // checks `changed` and only reports success when an actual edit was + // made; the visual rendering of the block is preserved. + const re = new RegExp( + `\\n?\\s*(['"\`]?)${escapeRe(configKey)}\\1\\s*:\\s*\\{[^{}]*\\}[,]?\\s*\\n?`, + 'g' + ); + const newInner = inner.replace(re, ''); + if (newInner === inner) { + return { newContent: content, changed: false }; + } + return { + newContent: + content.slice(0, block.start + 1) + + newInner + + content.slice(block.end), + changed: true + }; +} + +// โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ +// JSON path โ€” uses JSON.parse / JSON.stringify for full safety. +// โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ + +export function addPluginToJsonConfig( + content: string, + configKey: string, + valueText: string +): { newContent: string; changed: boolean } { + let config: any; + try { + config = JSON.parse(content); + } catch (e: any) { + throw new Error(`Could not parse config as JSON: ${e.message}`); + } + config.plugins = config.plugins || {}; + if (configKey in config.plugins) { + return { newContent: content, changed: false }; + } + // Parse the value text. The installer passes JS-ish text like + // `{}` or `{ theme: 'dark' }`; we normalise it to valid JSON by + // quoting unquoted keys and replacing single quotes with double. + const normalised = valueText + .replace(/'/g, '"') + .replace(/([{,]\s*)([A-Za-z_][\w-]*)(\s*:)/g, '$1"$2"$3'); + let value: any; + try { + value = JSON.parse(normalised); + } catch { + // Fall back to a plain object โ€” the value will serialise as `{}`. + value = {}; + } + config.plugins[configKey] = value; + return { newContent: JSON.stringify(config, null, 2) + '\n', changed: true }; +} + +export function removePluginFromJsonConfig( + content: string, + configKey: string +): { newContent: string; changed: boolean } { + let config: any; + try { + config = JSON.parse(content); + } catch (e: any) { + throw new Error(`Could not parse config as JSON: ${e.message}`); + } + if (!config.plugins || !(configKey in config.plugins)) { + return { newContent: content, changed: false }; + } + delete config.plugins[configKey]; + return { newContent: JSON.stringify(config, null, 2) + '\n', changed: true }; +} diff --git a/packages/plugins/installer/src/index.ts b/packages/plugins/installer/src/index.ts new file mode 100644 index 0000000..fcfc20f --- /dev/null +++ b/packages/plugins/installer/src/index.ts @@ -0,0 +1,559 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/core (and ecosystem) + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + */ + +import fs from 'fs'; +import path from 'path'; +import { execSync, execFileSync } from 'child_process'; + +import { createRequire } from 'module'; +import { + detectConfigFormat, + addPluginToJsonConfig, + addPluginToPluginsBlock, + removePluginFromJsonConfig, + removePluginFromPluginsBlock +} from './config-editor.js'; +import { isCorePlugin } from '@docmd/api'; + +const require = createRequire(import.meta.url); + +// Plugin registry resolution. As of 0.8.9 the canonical registry is +// generated into @docmd/api/registry/plugins.generated.json by +// scripts/build-plugin-registry.mjs (single source of truth across the +// docmd monorepo). The bundled registry/plugins.json in this package is +// retained as a fallback for users who install @docmd/plugin-installer +// without @docmd/api, but the generated file is preferred. +// +// The bundled registry/plugins.json is DEPRECATED and will be removed in +// 0.9.0. The auto-install workflow and `docmd add ` both fall +// through to the new generated registry transparently. +let pluginsRegistry: any = {}; +try { + const generatedPath = require.resolve('@docmd/api/registry/plugins.generated.json', { + paths: [process.cwd(), require('path').dirname(require.resolve('@docmd/api/package.json', { paths: [process.cwd()] }))] + }); + pluginsRegistry = require(generatedPath); +} catch { + // Fallback: bundled registry (DEPRECATED, removed in 0.9.0). + try { + pluginsRegistry = require('../registry/plugins.json'); + } catch { + pluginsRegistry = {}; + } +} + +/** + * + * @param err The thrown error from execFileSync. + * @param cmdExe The package-manager binary that was being spawned. + * @param action Human verb describing what was happening, e.g. + * "install" or "remove". Used in the suggestion copy. + * @param opts.verbose If true, return the raw `err.message` so power + * users can still see the full Node error. + */ +function formatSpawnError(err: any, cmdExe: string, action: string, opts: { verbose?: boolean } = {}): string { + const isMissingBinary = err && err.code === 'ENOENT' && + typeof err.syscall === 'string' && err.syscall.startsWith('spawn'); + + if (isMissingBinary) { + const binary = err.path || cmdExe; + + // Special case: if the failing binary is a package manager but Node itself + // is reachable, the issue is likely that docmd was launched through npx + // and the spawned child process can't see the parent's PATH. Suggest + // installing the plugin via the host package manager directly. + const nodeReachable = (() => { + try { require('child_process').execFileSync(process.execPath, ['--version'], { stdio: 'pipe' }); return true; } + catch { return false; } + })(); + const isPkgManager = /^(npm|pnpm|yarn|bun)(\.cmd)?$/i.test(path.basename(binary)); + + if (nodeReachable && isPkgManager) { + return [ + `Could not spawn ${binary} โ€” it was not found on PATH when running through npx.`, + ``, + `This is a common issue when @docmd/core itself was launched via npx on`, + `Windows or in restricted shells. Install the plugin directly using your`, + `package manager, then run the build again:`, + ``, + ` npm install `, + ``, + `If you still see this after a direct install, run with --verbose for the`, + `full spawn error.`, + ].join('\n'); + } + + return [ + `The package manager '${binary}' was not found on your system PATH.`, + ``, + `To fix it:`, + ` 1. Install ${binary} (e.g. \`npm install -g ${binary}\`, or use a`, + ` Node version manager like nvm / volta / fnm)`, + ` 2. Verify it's reachable: \`${binary} --version\` should print a version`, + ` 3. Retry: \`npx @docmd/core ${action} \``, + ``, + `If you just installed ${binary}, restart your terminal so the updated`, + `PATH takes effect.`, + ].join('\n'); + } + + if (opts.verbose && err && err.message) return err.message; + return 'Run with --verbose for detailed logs.'; +} + +/** + * Resolves the absolute path to a package-manager binary, falling back + * to PATH lookup if not found next to Node. + * + * On Windows, `npm`/`pnpm`/`yarn` are `.cmd` shims that may not be on + * PATH when `@docmd/core` is itself launched through `npx`. Since all + * major package managers ship their CLI scripts in Node's install + * directory (e.g. `node_modules/npm/bin/npm-cli.js`), resolving from + * `process.execPath` works reliably across all platforms and invocation + * methods (including `npx`). + */ +function resolvePackageManagerBin(name: string): string { + const nodeDir = path.dirname(process.execPath); + + // Candidate scripts to look for, in priority order. + const candidates: Record = { + npm: ['npm-cli.js', `npm${process.platform === 'win32' ? '.cmd' : ''}`], + pnpm: ['pnpm.js', `pnpm${process.platform === 'win32' ? '.cmd' : ''}`], + yarn: ['yarn.js', `yarn${process.platform === 'win32' ? '.cmd' : ''}`], + bun: ['bun.js', `bun${process.platform === 'win32' ? '.cmd' : ''}`], + }; + + const files = candidates[name] || [name]; + + // 1. Look next to the running Node binary (npm ships here, pnpm global does too). + for (const file of files) { + const candidate = path.join(nodeDir, file); + if (fs.existsSync(candidate)) return candidate; + } + + // 2. Look in Node's lib/node_modules (npm/pnpm install here on most setups). + const libModules = path.join(nodeDir, 'lib', 'node_modules'); + for (const file of files) { + const candidate = path.join(libModules, name, file === `${name}.cmd` ? 'bin' : 'bin', file); + if (fs.existsSync(candidate)) return candidate; + } + + // 3. Last resort: return the bare name and let PATH resolve it. + return files[files.length - 1]; +} + +/** + * Detects the package manager used in the current project by looking for lockfiles upwards. + * Defaults to 'npm' if no lockfile is found. + */ +function getPackageManager(cwd) { + let dir = cwd; + while (dir !== path.parse(dir).root) { + if (fs.existsSync(path.join(dir, 'pnpm-lock.yaml'))) return 'pnpm'; + if (fs.existsSync(path.join(dir, 'yarn.lock'))) return 'yarn'; + if (fs.existsSync(path.join(dir, 'bun.lockb'))) return 'bun'; + if (fs.existsSync(path.join(dir, 'package-lock.json'))) return 'npm'; + dir = path.dirname(dir); + } + return 'npm'; +} + +/** + * Resolves the project's config file path. Phase 3 PR 3.B (M-3): + * checks all five supported formats in preference order (JSON > JS > + * MJS > CJS > TS) and falls back to JSON when no config exists. + * + * The previous implementation only looked at `.json` and `.js`, so a + * project with `docmd.config.ts` would silently scaffold a new + * `docmd.config.json` instead of editing the existing TS file. + */ +function resolveConfigPath(cwd) { + const candidates = [ + 'docmd.config.json', + 'docmd.config.js', + 'docmd.config.mjs', + 'docmd.config.cjs', + 'docmd.config.ts' + ]; + for (const name of candidates) { + const p = path.join(cwd, name); + if (fs.existsSync(p)) return p; + } + return path.join(cwd, 'docmd.config.json'); +} + +function detectConfigFormatLegacy(configPath) { + return configPath.endsWith('.json') ? 'json' : 'js'; +} + +/** + * Resolves plugin metadata from the registry, or builds a fallback object. + */ +function resolvePluginMeta(name) { + if (pluginsRegistry[name]) { + return pluginsRegistry[name]; + } + + throw new Error(`Plugin "${name}" not found in the official registry. For custom plugins, please install via your package manager and configure manually.`); +} + +/** + * Reads config and safely injects the plugin to the `plugins` object. + * + * Phase 3 PR 3.B (F7 + M-3): replaced the legacy regex-based injector + * (which only matched `module.exports = { ... }` and silently no-op'd + * for `export default defineConfig({...})` configs) with the + * brace-balanced scanner in `./config-editor.js`. JSON configs are + * handled via `JSON.parse` for full safety; JS / TS / MJS / CJS + * configs use a scanner that finds the `plugins:` block by + * brace-balancing and adds the entry while preserving the existing + * indentation and trailing-comma style. + */ +function injectPluginToConfig(configPath, meta) { + const configKey = meta.configKey; + const valueText = meta.defaultConfig || '{}'; + + let content = ''; + if (fs.existsSync(configPath)) { + content = fs.readFileSync(configPath, 'utf8'); + } else { + // Scaffold a minimal config in the matching format. + const fmt = detectConfigFormat(configPath); + if (fmt === 'json') { + content = '{\n "plugins": {}\n}\n'; + } else if (fmt === 'mjs' || fmt === 'ts') { + content = "export default {\n plugins: {}\n};\n"; + } else { + content = "module.exports = {\n plugins: {}\n};\n"; + } + } + + const fmt = detectConfigFormat(configPath); + let result: { newContent: string; changed: boolean }; + if (fmt === 'json') { + result = addPluginToJsonConfig(content, configKey, valueText); + } else { + result = addPluginToPluginsBlock(content, configKey, valueText); + } + + if (!result.changed) { + return false; // Already present + } + + fs.writeFileSync(configPath, result.newContent, 'utf8'); + return true; +} + +/** + * Removes the plugin from the config file. Phase 3 PR 3.B (F7) fix: + * the legacy regex only matched CJS-style configs; the brace-balanced + * scanner handles all five supported formats. + */ +function removePluginFromConfig(configPath, meta) { + if (!fs.existsSync(configPath)) return false; + + const content = fs.readFileSync(configPath, 'utf8'); + const configKey = meta.configKey; + const fmt = detectConfigFormat(configPath); + + let result: { newContent: string; changed: boolean }; + if (fmt === 'json') { + result = removePluginFromJsonConfig(content, configKey); + } else { + result = removePluginFromPluginsBlock(content, configKey); + } + + if (!result.changed) { + return false; // Not present + } + + fs.writeFileSync(configPath, result.newContent, 'utf8'); + return true; +} + +/** + * Sets `theme.template` in the config. Replaces any existing template value. + * Returns true if a change was made. Handles both JSON and JS config formats. + * Templates do NOT stack โ€” re-running with a different template overwrites. + */ +function injectTemplateToConfig(configPath, meta) { + const format = detectConfigFormat(configPath); + const templateName = meta.templateName || meta.configKey; + + let content = ''; + if (fs.existsSync(configPath)) { + content = fs.readFileSync(configPath, 'utf8'); + } else { + content = format === 'json' + ? '{\n "theme": {}\n}\n' + : 'module.exports = {\n theme: {}\n};\n'; + } + + if (format === 'json') { + let config; + try { config = JSON.parse(content); } + catch (err) { + TUI.warn(`Could not parse ${configPath} as JSON. Skipping template injection.`); + return false; + } + config.theme = config.theme || {}; + if (config.theme.template === templateName) return false; + config.theme.template = templateName; + fs.writeFileSync(configPath, JSON.stringify(config, null, 2) + '\n', 'utf8'); + return true; + } + + // JS config (regex-based, matching the existing plugin injector) + const escaped = templateName.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); + if (new RegExp(`template\\s*:\\s*['"\`]${escaped}['"\`]`).test(content)) return false; + + const themeRegex = /theme\s*:\s*\{([\s\S]*?)\}/; + const themeMatch = content.match(themeRegex); + + if (themeMatch) { + const inner = themeMatch[1]; + let newInner; + if (/template\s*:/.test(inner)) { + // Replace existing `template: "..."` value + newInner = inner.replace(/template\s*:\s*['"`][^'"`]*['"`]/, `template: "${templateName}"`); + } else { + const trimmed = inner.trim(); + if (trimmed === '') { + newInner = `\n template: "${templateName}"\n `; + } else { + // Strip trailing whitespace + optional comma, then add comma + template + const stripped = inner.replace(/[\s,]+$/, ''); + newInner = `${stripped},\n template: "${templateName}"\n `; + } + } + content = content.replace(themeMatch[0], `theme: {${newInner}}`); + } else { + // No `theme: { ... }` yet โ€” create one in module.exports + const moduleExportsRegex = /module\.exports\s*=\s*(?:defineConfig\()?\{([\s\S]*?)\}(?:\))?;?/g; + let matchE, lastMatch; + while ((matchE = moduleExportsRegex.exec(content)) !== null) lastMatch = matchE; + if (lastMatch) { + const closingBraceIndex = lastMatch.index + lastMatch[0].lastIndexOf('}'); + const prefixRaw = content.substring(0, closingBraceIndex); + const suffix = content.substring(closingBraceIndex); + // Strip trailing whitespace from prefix so the separator lands cleanly after the last value + const prefix = prefixRaw.replace(/\s+$/, ''); + const lastChar = prefix.slice(-1); + const separator = (lastChar === ',' || lastChar === '{') ? '\n ' : ',\n '; + const insert = `${separator}theme: {\n template: "${templateName}"\n }\n`; + content = prefix + insert + suffix; + } else { + TUI.warn(`Could not automatically inject template into ${configPath}. Please set theme.template = "${templateName}" manually.`); + return false; + } + } + + fs.writeFileSync(configPath, content, 'utf8'); + return true; +} + +/** + * Clears `theme.template` from the config (reverts to default). + * Returns true if a change was made. + */ +function removeTemplateFromConfig(configPath) { + if (!fs.existsSync(configPath)) return false; + const format = detectConfigFormat(configPath); + const content = fs.readFileSync(configPath, 'utf8'); + + if (format === 'json') { + let config; + try { config = JSON.parse(content); } + catch { return false; } + if (!config.theme || !('template' in config.theme)) return false; + delete config.theme.template; + fs.writeFileSync(configPath, JSON.stringify(config, null, 2) + '\n', 'utf8'); + return true; + } + + // JS config + if (!/template\s*:/.test(content)) return false; + const newContent = content.replace(/\s*template\s*:\s*['"`][^'"`]*['"`]\s*,?\s*/, ''); + if (content === newContent) return false; + fs.writeFileSync(configPath, newContent, 'utf8'); + return true; +} + + +import { TUI } from '@docmd/api'; + +async function installPlugin(pluginInput: string, opts: { verbose?: boolean } = {}) { + const cwd = process.cwd(); + const pkgManager = getPackageManager(cwd); + + let meta; + try { + meta = resolvePluginMeta(pluginInput); + } catch (err: any) { + TUI.error('Installation Aborted', err.message); + return; + } + + // Core plugins (search, seo, sitemap, analytics, llms, mermaid, git, + // openapi, okf) ship with @docmd/core โ€” they're already installed + // and auto-loaded. `docmd add` for a core plugin would be a no-op at + // best and a config corruption at worst (it would inject the entry + // even though the package is a workspace dep already, leading to a + // duplicate install on user systems). The list lives in @docmd/api + // as CORE_PLUGINS so it stays in sync with hooks.ts. + if (!meta.kind && isCorePlugin(meta.configKey)) { + TUI.error( + 'Installation Aborted (Plugin Already Present)', + `Plugin "${meta.configKey}" is a core plugin that ships with @docmd/core. ` + + `You can customise plugin behaviour via "plugins.${meta.configKey}" in your config.` + ); + process.exit(1); + } + + const packageName = meta.package; + const isTemplate = meta.kind === 'template'; + + TUI.section(isTemplate ? 'Template Installation' : 'Plugin Installation'); + TUI.step(`Installing ${packageName} via ${pkgManager}`, 'WAIT'); + + let cmdExe = ''; + let cmdArgs: string[] = []; + if (pkgManager === 'npm') { cmdExe = resolvePackageManagerBin('npm'); cmdArgs = ['install', packageName]; } + else if (pkgManager === 'yarn') { cmdExe = resolvePackageManagerBin('yarn'); cmdArgs = ['add', packageName]; } + else if (pkgManager === 'pnpm') { cmdExe = resolvePackageManagerBin('pnpm'); cmdArgs = ['add', packageName]; } + else if (pkgManager === 'bun') { cmdExe = resolvePackageManagerBin('bun'); cmdArgs = ['add', packageName]; } + + if (pkgManager === 'npm' && !fs.existsSync(path.join(cwd, 'package.json'))) { + cmdArgs.push('--no-save'); + } + + try { + const stdioMode = opts.verbose ? 'inherit' : 'pipe'; + execFileSync(cmdExe, cmdArgs, { stdio: stdioMode, cwd }); + + TUI.step(packageName, 'DONE'); + + const configPath = resolveConfigPath(cwd); + TUI.divider('Configuration'); + + let injected; + if (isTemplate) { + TUI.step(`Setting theme.template to "${meta.configKey}"`, 'WAIT', TUI.blue); + injected = injectTemplateToConfig(configPath, meta); + } else { + TUI.step(`Activating ${meta.configKey}`, 'WAIT', TUI.blue); + injected = injectPluginToConfig(configPath, meta); + } + if (injected) { + TUI.step(isTemplate ? 'Template activated' : 'Activation completed', 'DONE', TUI.blue); + } else { + TUI.step(isTemplate ? 'Template already configured' : 'Plugin already configured', 'SKIP', TUI.blue); + } + TUI.footer(); + // M-14: the final success message must reflect what actually happened. + // When the plugin was already configured, the config was untouched โ€” + // calling that "successfully installed" is misleading. Branch on the + // `injected` flag from the config editor and emit one of three + // messages: new install, already configured, or core-plugin (which + // is handled above with a hard error so we never reach this line + // for that case). + if (injected) { + TUI.success(isTemplate ? 'Template successfully installed and activated.' : 'Plugin successfully installed and activated.'); + } else { + TUI.info(isTemplate ? 'Template was already configured. Nothing changed.' : 'Plugin was already configured. Nothing changed.'); + } + + } catch (err: any) { + TUI.step(packageName, 'FAIL'); + TUI.footer(); + TUI.error(`Could not install ${packageName}`, formatSpawnError(err, cmdExe, 'add', opts)); + } +} + +async function removePlugin(pluginInput: string, opts: { verbose?: boolean } = {}) { + const cwd = process.cwd(); + const pkgManager = getPackageManager(cwd); + + let meta; + try { + meta = resolvePluginMeta(pluginInput); + } catch (err: any) { + TUI.error('Removal Aborted', err.message); + // Phase 3 PR 3.A (F6): exit 1 so CI pipelines can gate on the + // documented "Removal Aborted" failure path. Previously this + // `return` left the process at exit code 0, silently passing a + // failed removal. + process.exit(1); + } + + // Same gate as installPlugin: core plugins can't be removed because + // they're a workspace dep of @docmd/core, not user-installed. + if (!meta.kind && isCorePlugin(meta.configKey)) { + TUI.error( + 'Removal Aborted (Core Plugin)', + `Plugin "${meta.configKey}" is a core plugin that ships with @docmd/core. ` + + `It cannot be removed โ€” opt out instead via "plugins.${meta.configKey}: false" in your config.` + ); + process.exit(1); + } + + const packageName = meta.package; + const isTemplate = meta.kind === 'template'; + + TUI.section(isTemplate ? 'Template Removal' : 'Plugin Removal'); + TUI.step(`Uninstalling ${packageName} via ${pkgManager}`, 'WAIT'); + + let cmdExe = ''; + let cmdArgs: string[] = []; + if (pkgManager === 'npm') { cmdExe = 'npm'; cmdArgs = ['uninstall', packageName]; } + else if (pkgManager === 'yarn') { cmdExe = 'yarn'; cmdArgs = ['remove', packageName]; } + else if (pkgManager === 'pnpm') { cmdExe = 'pnpm'; cmdArgs = ['remove', packageName]; } + else if (pkgManager === 'bun') { cmdExe = 'bun'; cmdArgs = ['remove', packageName]; } + + try { + const stdioMode = opts.verbose ? 'inherit' : 'pipe'; + execFileSync(cmdExe, cmdArgs, { stdio: stdioMode, cwd }); + + TUI.step(packageName, 'DONE'); + + const configPath = resolveConfigPath(cwd); + TUI.divider('Configuration'); + + let removed; + if (isTemplate) { + TUI.step('Clearing theme.template', 'WAIT', TUI.blue); + removed = removeTemplateFromConfig(configPath); + } else { + TUI.step(`Removing ${meta.configKey}`, 'WAIT', TUI.blue); + removed = removePluginFromConfig(configPath, meta); + } + if (removed) { + TUI.step('Cleanup completed', 'DONE', TUI.blue); + } else { + TUI.step('No config entry found', 'SKIP', TUI.blue); + } + TUI.footer(); + TUI.success(isTemplate ? 'Template successfully uninstalled.' : 'Plugin successfully uninstalled.'); + + } catch (err: any) { + TUI.step(packageName, 'FAIL'); + TUI.footer(); + TUI.error(`Could not remove ${packageName}`, formatSpawnError(err, cmdExe, 'remove', opts)); + } +} + +export { + installPlugin, + removePlugin +}; \ No newline at end of file diff --git a/packages/plugins/installer/tsconfig.json b/packages/plugins/installer/tsconfig.json new file mode 100644 index 0000000..7befc89 --- /dev/null +++ b/packages/plugins/installer/tsconfig.json @@ -0,0 +1,10 @@ +{ + "extends": "../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "./dist", + "rootDir": "./src", + "strict": false + }, + "include": ["src/**/*"], + "exclude": ["node_modules", "dist", "**/*.test.ts"] +} \ No newline at end of file diff --git a/packages/plugins/llms/LICENSE b/packages/plugins/llms/LICENSE new file mode 100644 index 0000000..997bb73 --- /dev/null +++ b/packages/plugins/llms/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025-present docmd.io + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/packages/plugins/llms/README.md b/packages/plugins/llms/README.md new file mode 100644 index 0000000..b523ac6 --- /dev/null +++ b/packages/plugins/llms/README.md @@ -0,0 +1,25 @@ +# @docmd/plugin-llms + +Generates `llms.txt` and `llms-full.txt` at build time so your documentation is immediately accessible to AI agents - ChatGPT, Claude, Cursor, and any tool that follows the [llmstxt.org](https://llmstxt.org/) standard. + +Bundled with `@docmd/core`. Requires `siteUrl` in your config to produce valid absolute links. + +```js +// docmd.config.js +module.exports = { + siteUrl: 'https://your-site.com', + plugins: { + llms: {} + } +}; +``` + +Part of the **[docmd](https://github.com/docmd-io/docmd)** documentation engine. + +## Documentation + +See **[docs.docmd.io](https://docs.docmd.io)** for full usage and API reference. + +## License + +MIT \ No newline at end of file diff --git a/packages/plugins/llms/package.json b/packages/plugins/llms/package.json new file mode 100644 index 0000000..e6dec22 --- /dev/null +++ b/packages/plugins/llms/package.json @@ -0,0 +1,60 @@ +{ + "name": "@docmd/plugin-llms", + "version": "0.8.12", + "description": "Generate llms.txt context files for AI agents from your docmd site.", + "type": "module", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "docmd": { + "key": "llms", + "kind": "plugin", + "displayName": "LLMs", + "tagline": "Generates llms.txt and llms-full.txt for LLM consumption.", + "capabilities": [ + "post-build" + ] + }, + "scripts": { + "build": "tsc" + }, + "files": [ + "dist" + ], + "engines": { + "node": ">=18" + }, + "devDependencies": { + "@docmd/api": "workspace:*", + "@types/node": "^24.13.3" + }, + "keywords": [ + "docmd", + "plugin", + "llms", + "ai", + "context", + "agents", + "text-generation", + "documentation", + "markdown", + "minimalist", + "zero-config", + "site-generator", + "static-site-generator", + "docs" + ], + "author": { + "name": "Ghazi", + "url": "https://mgks.dev" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/docmd-io/docmd.git" + }, + "bugs": { + "url": "https://github.com/docmd-io/docmd/issues" + }, + "homepage": "https://docmd.io", + "funding": "https://github.com/sponsors/mgks", + "license": "MIT" +} \ No newline at end of file diff --git a/packages/plugins/llms/src/index.ts b/packages/plugins/llms/src/index.ts new file mode 100644 index 0000000..25271b6 --- /dev/null +++ b/packages/plugins/llms/src/index.ts @@ -0,0 +1,198 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/core (and ecosystem) + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + */ + +import path from 'path'; +import fs from 'fs/promises'; +import type { PluginDescriptor } from '@docmd/api'; +import { outputPathToPathname, sanitizeUrl } from '@docmd/api'; + +export const plugin: PluginDescriptor = { + name: 'llms', + version: '0.8.12', + capabilities: ['post-build'] +}; + +export async function onPostBuild({ config, pages, outputDir, log }: any) { + const siteUrl = (config.url || '').replace(/\/$/, ''); + const _options = config.plugins?.llms || {}; + + // 0.8.8: opt-in multi-locale mode. + // - Default (`i18n: false`): write `llms.txt` / `llms-full.txt` / + // `llms.json` for the DEFAULT locale only. File names are + // unchanged from prior versions โ€” this is the break-free + // default. + // - Opt-in (`plugins.llms.i18n: true`): also write a + // `llms..txt` / `llms-full..txt` / + // `llms..json` for every non-default locale in + // `config.i18n.locales`. The default-locale files keep the + // unsuffixed names so existing consumers don't break. + // - Single-locale projects (no `config.i18n` block, or only + // one locale) emit a single unsuffixed set regardless of + // the i18n flag. + const i18n = _options.i18n === true; + const localeIds: string[] = (config.i18n?.locales || []).map((l: any) => l.id); + const defaultLocale = config.i18n?.default || localeIds[0] || ''; + + if (log) log('Generating LLMs context files' + (i18n && localeIds.length > 1 ? ' (multi-locale)' : '')); + + // Make sure outputDir exists โ€” guards the case where the plugin + // is invoked directly from a test (the docmd build pipeline + // already creates the dir, but direct callers may not). + await fs.mkdir(outputDir, { recursive: true }); + + /** + * Group pages by their detected locale. Pages without a locale + * prefix in `outputPath` are bucketed under the default locale. + * The `noindex` and `llms: false` opt-outs are honoured here. + */ + function pageLocale(p: any): string { + const parts = String(p.outputPath || '').split('/').filter(Boolean); + if (localeIds.length && parts.length && localeIds.includes(parts[0])) return parts[0]; + return defaultLocale; + } + const grouped: Map = new Map(); + for (const p of pages) { + if (p.frontmatter.noindex) continue; + if (p.frontmatter.llms === false) continue; + const loc = pageLocale(p); + if (!grouped.has(loc)) grouped.set(loc, []); + grouped.get(loc)!.push(p); + } + // Sort each bucket by URL for stable output. + for (const arr of grouped.values()) { + arr.sort((a, b) => a.outputPath.localeCompare(b.outputPath)); + } + + // Determine which locales to write. Default: only the default + // locale. i18n: all configured locales (or just the default + // if no i18n block is configured). + const localesToWrite: string[] = []; + if (i18n && localeIds.length > 1) { + localesToWrite.push(...localeIds); + } else { + localesToWrite.push(defaultLocale); + } + + for (const loc of localesToWrite) { + const bucket = grouped.get(loc) || []; + + // T-Z10 / T-Z11: sanitise any user-controlled string before it lands + // in the markdown list / CSV cell. Two threats: + // - Markdown injection: a title containing `]`, `[`, `\n`, or + // backticks breaks out of the `[title](url)` form, or renders + // as raw HTML in some markdown processors. + // - CSV formula injection: a title starting with `=`, `+`, `-`, + // or `@` is interpreted as a formula when the file is opened + // in a spreadsheet (T-Z11). + // The escape below: + // - Prefixes a single-quote when the string starts with a + // spreadsheet-formula sigil (neutralises CSV formula execution + // in Excel / LibreOffice / Sheets). + // - Escapes backslashes, backticks, and square brackets so the + // string cannot break out of `[title](url)` or render as code. + // - Replaces newlines and carriage returns with spaces so a multi- + // line title doesn't break the markdown list. + // - Truncates the result to a sane length. + const safeForMarkdownAndCsv = (raw: string): string => { + if (typeof raw !== 'string') return ''; + let s = raw.replace(/[\r\n]+/g, ' ').slice(0, 200); + s = s.replace(/\\/g, '\\\\').replace(/`/g, '\\`'); + s = s.replace(/\[/g, '\\[').replace(/\]/g, '\\]'); + if (/^\s*[=+\-@]/.test(s)) s = `'${s}`; + return s; + }; + + // โ”€โ”€ llms.txt โ€” title + description + link list โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ + let content = `# ${safeForMarkdownAndCsv(config.title || 'Documentation')}\n\n`; + content += `> Generated by docmd\n\n`; + if (config.description) content += `${safeForMarkdownAndCsv(config.description)}\n\n`; + content += `## Documentation Files\n\n`; + for (const page of bucket) { + const pathname = outputPathToPathname(page.outputPath); + const fullUrl = sanitizeUrl(siteUrl + pathname); + const title = safeForMarkdownAndCsv(page.frontmatter.title || 'Untitled'); + content += `- [${title}](${fullUrl})\n`; + if (page.frontmatter.description) { + content += ` ${safeForMarkdownAndCsv(page.frontmatter.description)}\n`; + } + } + + // โ”€โ”€ llms-full.txt โ€” full markdown for each page โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ + let fullContent = `# ${safeForMarkdownAndCsv(config.title || 'Documentation')} - Full Context\n\n`; + fullContent += `> Generated by docmd\n\n`; + if (config.description) fullContent += `${safeForMarkdownAndCsv(config.description)}\n\n`; + fullContent += `---\n\n`; + for (const page of bucket) { + const pathname = outputPathToPathname(page.outputPath); + const fullUrl = sanitizeUrl(siteUrl + pathname); + const title = safeForMarkdownAndCsv(page.frontmatter.title || 'Untitled'); + fullContent += `## [${title}](${fullUrl})\n\n`; + try { + if (page.sourcePath) { + // T-Z10: the body of a user markdown file is treated as + // trusted source content (the user wrote it themselves), so + // we don't escape it. Consumers should treat llms-full.txt as + // a "first-party" channel and not render it in an HTML + // context without sanitising the body on the consumer side. + const rawMd = await fs.readFile(page.sourcePath, 'utf8'); + fullContent += `${rawMd}\n\n---\n\n`; + } else { + fullContent += `*(Raw content unavailable)*\n\n---\n\n`; + } + } catch { + if (log) log(`Skipping raw markdown: ${page.sourcePath}`, 'SKIP'); + } + } + + // โ”€โ”€ llms.json โ€” machine-readable manifest โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ + // T-Z10/T-Z11: same sanitisation for JSON output. The JSON parser + // handles strings safely but we still apply the same neutralisation + // so a title that starts with `=cmd|"/c calc"!A1` doesn't execute + // when the file is opened in a spreadsheet, and the JSON stays + // self-consistent. + const llmsJson = { + title: safeForMarkdownAndCsv(config.title || 'Documentation'), + description: safeForMarkdownAndCsv(config.description || ''), + pages: bucket.map((page) => { + const pathname = outputPathToPathname(page.outputPath); + const fullUrl = sanitizeUrl(siteUrl + pathname); + return { + title: safeForMarkdownAndCsv(page.frontmatter.title || 'Untitled'), + url: fullUrl, + description: safeForMarkdownAndCsv(page.frontmatter.description || ''), + priority: page.frontmatter.priority || (pathname === '/' ? 'high' : 'medium') + }; + }) + }; + + // File name strategy: + // - Default locale (or only locale in a single-locale + // project) keeps the unsuffixed names so existing + // consumers don't break. + // - Non-default locales get a `.${locale}` suffix: + // `llms.ja.txt`, `llms-full.ja.txt`, `llms.ja.json`, + // `llms.fr.txt`, etc. + const isDefault = loc === defaultLocale; + const baseTxt = isDefault ? 'llms' : `llms.${loc}`; + const fullBase = isDefault ? 'llms-full' : `llms-full.${loc}`; + const jsonBase = isDefault ? 'llms' : `llms.${loc}`; + + await fs.writeFile(path.join(outputDir, `${baseTxt}.txt`), content); + await fs.writeFile(path.join(outputDir, `${fullBase}.txt`), fullContent); + await fs.writeFile( + path.join(outputDir, `${jsonBase}.json`), + JSON.stringify(llmsJson, null, 2) + ); + } +} \ No newline at end of file diff --git a/packages/plugins/llms/tests/llms.test.js b/packages/plugins/llms/tests/llms.test.js new file mode 100644 index 0000000..d330e82 --- /dev/null +++ b/packages/plugins/llms/tests/llms.test.js @@ -0,0 +1,170 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * LLMS plugin โ€” i18n opt-in tests + * + * The default behaviour writes `llms.txt` / `llms-full.txt` / `llms.json` + * for the **default locale only**. Multi-locale output is opt-in via + * `plugins.llms.i18n: true`, which writes per-locale files + * (`llms..txt`, etc.). + * + * Run with: `node --test tests/llms.test.js` + * -------------------------------------------------------------------- + */ + +import { describe, it, before, after } from 'node:test'; +import assert from 'node:assert/strict'; +import path from 'node:path'; +import fs from 'node:fs/promises'; +import os from 'node:os'; + +import { plugin, onPostBuild } from '../dist/index.js'; + +describe('plugin descriptor', () => { + it('has the expected name', () => { + assert.equal(plugin.name, 'llms'); + }); + + it('declares post-build capability', () => { + assert.ok(Array.isArray(plugin.capabilities)); + assert.ok(plugin.capabilities.includes('post-build')); + }); +}); + +describe('onPostBuild โ€” default behaviour (default locale only)', () => { + let tmpDir; + before(async () => { + tmpDir = await fs.mkdtemp(path.join(os.tmpdir(), 'llms-test-')); + }); + after(async () => { + try { await fs.rm(tmpDir, { recursive: true, force: true }); } catch { /* best-effort cleanup */ } + }); + + it('writes llms.txt for the default locale only (i18n off by default)', async () => { + const out = path.join(tmpDir, 'default'); + await onPostBuild({ + config: { + title: 'Default test', + url: 'https://example.com', + i18n: { + default: 'en', + locales: [ + { id: 'en', label: 'English' }, + { id: 'hi', label: 'Hindi' } + ] + } + // No `plugins.llms` entry โ€” use defaults. + }, + pages: [ + { outputPath: 'en/welcome.html', frontmatter: { title: 'EN Welcome', description: 'Hello' }, sourcePath: '', rawMarkdown: '' }, + { outputPath: 'hi/welcome.html', frontmatter: { title: 'HI Welcome', description: 'Namaste' }, sourcePath: '', rawMarkdown: '' } + ], + outputDir: out, + log: () => {} + }); + + // Single files at the root. + const txt = await fs.readFile(path.join(out, 'llms.txt'), 'utf8'); + assert.match(txt, /\[EN Welcome\]/); + assert.doesNotMatch(txt, /\[HI Welcome\]/); + }); + + it('writes per-locale files when `plugins.llms.i18n: true`', async () => { + const out = path.join(tmpDir, 'i18n'); + await onPostBuild({ + config: { + title: 'I18N test', + url: 'https://example.com', + i18n: { + default: 'en', + locales: [ + { id: 'en', label: 'English' }, + { id: 'hi', label: 'Hindi' } + ] + }, + plugins: { llms: { i18n: true } } + }, + pages: [ + { outputPath: 'en/welcome.html', frontmatter: { title: 'EN Welcome' }, sourcePath: '', rawMarkdown: '' }, + { outputPath: 'hi/welcome.html', frontmatter: { title: 'HI Welcome' }, sourcePath: '', rawMarkdown: '' } + ], + outputDir: out, + log: () => {} + }); + + // Default locale keeps the unsuffixed names (no breaking change + // for existing consumers). + const txt = await fs.readFile(path.join(out, 'llms.txt'), 'utf8'); + assert.match(txt, /\[EN Welcome\]/); + assert.doesNotMatch(txt, /\[HI Welcome\]/); + + // Non-default locale gets a `.` suffix. + const txtHi = await fs.readFile(path.join(out, 'llms.hi.txt'), 'utf8'); + assert.match(txtHi, /\[HI Welcome\]/); + assert.doesNotMatch(txtHi, /\[EN Welcome\]/); + + // Full and JSON files: default โ†’ unsuffixed; non-default โ†’ suffixed. + const json = JSON.parse(await fs.readFile(path.join(out, 'llms.json'), 'utf8')); + assert.equal(json.pages.length, 1); + assert.equal(json.pages[0].title, 'EN Welcome'); + + const jsonHi = JSON.parse(await fs.readFile(path.join(out, 'llms.hi.json'), 'utf8')); + assert.equal(jsonHi.pages.length, 1); + assert.equal(jsonHi.pages[0].title, 'HI Welcome'); + + // `llms-full.txt` and `llms-full.hi.txt` both exist. + await fs.access(path.join(out, 'llms-full.txt')); + await fs.access(path.join(out, 'llms-full.hi.txt')); + }); + + it('default-mode treats a site with no i18n as the default locale', async () => { + // No `i18n` block at all โ€” every page is in the (implicit) + // default locale, so the bundle has all pages. + const out = path.join(tmpDir, 'no-i18n'); + await fs.mkdir(out, { recursive: true }); + await onPostBuild({ + config: { title: 'No i18n', url: 'https://example.com' }, + pages: [ + { outputPath: 'a.html', frontmatter: { title: 'A' }, sourcePath: '', rawMarkdown: '' }, + { outputPath: 'b.html', frontmatter: { title: 'B' }, sourcePath: '', rawMarkdown: '' } + ], + outputDir: out, + log: () => {} + }); + + const txt = await fs.readFile(path.join(out, 'llms.txt'), 'utf8'); + assert.match(txt, /\[A\]/); + assert.match(txt, /\[B\]/); + }); + + it('default-mode with i18n + only-one-locale writes the single unsuffixed set', async () => { + // Edge case: `i18n: false` (default) + only ONE locale configured. + // The bundle has the single set at root with no locale suffix. + const out = path.join(tmpDir, 'single-locale'); + await onPostBuild({ + config: { + title: 'Single', + url: 'https://example.com', + i18n: { + default: 'en', + locales: [{ id: 'en', label: 'English' }] + } + }, + pages: [ + { outputPath: 'a.html', frontmatter: { title: 'A' }, sourcePath: '', rawMarkdown: '' } + ], + outputDir: out, + log: () => {} + }); + + // Unsuffixed files (no `llms.en.txt` is needed because there's + // only one locale โ€” the suffix would just add noise). + const txt = await fs.readFile(path.join(out, 'llms.txt'), 'utf8'); + assert.match(txt, /\[A\]/); + await assert.rejects( + fs.access(path.join(out, 'llms.en.txt')), + /ENOENT/ + ).catch(() => { /* expected: no per-locale suffix for single-locale sites */ }); + }); +}); \ No newline at end of file diff --git a/packages/plugins/llms/tsconfig.json b/packages/plugins/llms/tsconfig.json new file mode 100644 index 0000000..7befc89 --- /dev/null +++ b/packages/plugins/llms/tsconfig.json @@ -0,0 +1,10 @@ +{ + "extends": "../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "./dist", + "rootDir": "./src", + "strict": false + }, + "include": ["src/**/*"], + "exclude": ["node_modules", "dist", "**/*.test.ts"] +} \ No newline at end of file diff --git a/packages/plugins/math/LICENSE b/packages/plugins/math/LICENSE new file mode 100644 index 0000000..997bb73 --- /dev/null +++ b/packages/plugins/math/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025-present docmd.io + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/packages/plugins/math/README.md b/packages/plugins/math/README.md new file mode 100644 index 0000000..cc6a852 --- /dev/null +++ b/packages/plugins/math/README.md @@ -0,0 +1,25 @@ +# @docmd/plugin-math + +Adds LaTeX mathematics to your docmd site via KaTeX - inline `$...$` and block `$$...$$` syntax, rendered client-side with no server overhead. An optional plugin, installed separately. + +```bash +docmd add math +``` + +```js +$E = mc^2$ + +$$ +\sum_{i=1}^n i^2 = \frac{n(n+1)(2n+1)}{6} +$$ +``` + +Part of the **[docmd](https://github.com/docmd-io/docmd)** documentation engine. + +## Documentation + +See **[docs.docmd.io](https://docs.docmd.io)** for full usage and API reference. + +## License + +MIT \ No newline at end of file diff --git a/packages/plugins/math/package.json b/packages/plugins/math/package.json new file mode 100644 index 0000000..afd0a9c --- /dev/null +++ b/packages/plugins/math/package.json @@ -0,0 +1,61 @@ +{ + "name": "@docmd/plugin-math", + "version": "0.8.12", + "description": "Mathematics (KaTeX/LaTeX) plugin for docmd.", + "type": "module", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "docmd": { + "key": "math", + "kind": "plugin", + "displayName": "Math", + "tagline": "Mathematics (KaTeX/LaTeX) plugin for docmd.", + "capabilities": [ + "markdown", + "assets" + ] + }, + "scripts": { + "build": "tsc" + }, + "files": [ + "dist" + ], + "engines": { + "node": ">=18" + }, + "dependencies": { + "katex": "^0.17.0", + "markdown-it-texmath": "^1.0.0" + }, + "devDependencies": { + "@docmd/api": "workspace:*" + }, + "keywords": [ + "docmd", + "plugin", + "math", + "latex", + "katex", + "markdown", + "documentation", + "minimalist", + "zero-config", + "site-generator", + "docs" + ], + "author": { + "name": "Ghazi", + "url": "https://mgks.dev" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/docmd-io/docmd.git" + }, + "bugs": { + "url": "https://github.com/docmd-io/docmd/issues" + }, + "homepage": "https://docmd.io", + "funding": "https://github.com/sponsors/mgks", + "license": "MIT" +} \ No newline at end of file diff --git a/packages/plugins/math/src/index.ts b/packages/plugins/math/src/index.ts new file mode 100644 index 0000000..4ea6d57 --- /dev/null +++ b/packages/plugins/math/src/index.ts @@ -0,0 +1,50 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/plugin-math + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + */ + +import texmath from 'markdown-it-texmath'; +import katex from 'katex'; +import type { PluginDescriptor } from '@docmd/api'; + +export const plugin: PluginDescriptor = { + name: 'math', + version: '0.8.12', + capabilities: ['markdown', 'assets'] +}; + +export function markdownSetup(md: any) { + // Suppress KaTeX's "quirks mode" warning - irrelevant in Node.js + const origWarn = console.warn; + console.warn = (...args: any[]) => { + if (typeof args[0] === 'string' && args[0].includes('quirks mode')) return; + origWarn.apply(console, args); + }; + md.use(texmath, { engine: katex, delimiters: 'dollars', katexOptions: { macros: { "\\RR": "\\mathbb{R}" } } }); + console.warn = origWarn; +} + +export function getAssets() { + return [ + { + url: 'https://cdn.jsdelivr.net/npm/katex@0.16.21/dist/katex.min.css', + type: 'css', + location: 'head', + // Conditional loading (new in 0.8.7): only inject KaTeX's stylesheet + // on pages that actually have rendered math (KaTeX emits `class="katex"` + // on every formula and `class="katex-display"` on display math). On + // pages with no math the CSS request is skipped entirely, saving the + // ~30 KB katex.min.css fetch plus the render cost on mobile. + condition: { pageHtmlMatches: ['class="katex"', 'class="katex-display"'] } + } + ]; +} \ No newline at end of file diff --git a/packages/plugins/math/tsconfig.json b/packages/plugins/math/tsconfig.json new file mode 100644 index 0000000..7befc89 --- /dev/null +++ b/packages/plugins/math/tsconfig.json @@ -0,0 +1,10 @@ +{ + "extends": "../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "./dist", + "rootDir": "./src", + "strict": false + }, + "include": ["src/**/*"], + "exclude": ["node_modules", "dist", "**/*.test.ts"] +} \ No newline at end of file diff --git a/packages/plugins/mermaid/LICENSE b/packages/plugins/mermaid/LICENSE new file mode 100644 index 0000000..997bb73 --- /dev/null +++ b/packages/plugins/mermaid/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025-present docmd.io + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/packages/plugins/mermaid/README.md b/packages/plugins/mermaid/README.md new file mode 100644 index 0000000..62a0b20 --- /dev/null +++ b/packages/plugins/mermaid/README.md @@ -0,0 +1,23 @@ +# @docmd/plugin-mermaid + +Adds [Mermaid.js](https://mermaid.js.org/) diagram support to your docmd site - write flowcharts, sequence diagrams, and more directly in Markdown using a standard code fence. Bundled with `@docmd/core`. + +````md +```mermaid +graph TD; + A-->B; + A-->C; + B-->D; + C-->D; +``` +```` + +Part of the **[docmd](https://github.com/docmd-io/docmd)** documentation engine. + +## Documentation + +See **[docs.docmd.io](https://docs.docmd.io)** for full usage and API reference. + +## License + +MIT \ No newline at end of file diff --git a/packages/plugins/mermaid/package.json b/packages/plugins/mermaid/package.json new file mode 100644 index 0000000..2f67eb2 --- /dev/null +++ b/packages/plugins/mermaid/package.json @@ -0,0 +1,67 @@ +{ + "name": "@docmd/plugin-mermaid", + "version": "0.8.12", + "description": "Mermaid diagram support plugin for docmd.", + "type": "module", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "docmd": { + "key": "mermaid", + "kind": "plugin", + "displayName": "Mermaid", + "tagline": "Mermaid.js diagram support for docmd.", + "capabilities": [ + "markdown", + "assets" + ] + }, + "scripts": { + "build": "tsc && esbuild src/client.ts --bundle --outfile=dist/init-mermaid.js --format=esm --platform=browser --minify --external:https://*", + "test": "tsx --test tests/*.test.ts", + "test:watch": "tsx --test --watch tests/*.test.ts" + }, + "files": [ + "dist" + ], + "engines": { + "node": ">=18" + }, + "devDependencies": { + "@docmd/api": "workspace:*", + "@types/node": "^24.13.3", + "esbuild": "^0.28.1", + "tsx": "^4.23.0" + }, + "keywords": [ + "docmd", + "plugin", + "mermaid", + "diagrams", + "flowchart", + "sequence", + "class", + "graph", + "mindmap", + "syntax", + "markdown", + "minimalist", + "zero-config", + "site-generator", + "static-site-generator", + "docs" + ], + "author": { + "name": "Ghazi", + "url": "https://mgks.dev" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/docmd-io/docmd.git" + }, + "bugs": { + "url": "https://github.com/docmd-io/docmd/issues" + }, + "homepage": "https://docmd.io", + "funding": "https://github.com/sponsors/mgks", + "license": "MIT" +} \ No newline at end of file diff --git a/packages/plugins/mermaid/src/client.ts b/packages/plugins/mermaid/src/client.ts new file mode 100644 index 0000000..edaa3d8 --- /dev/null +++ b/packages/plugins/mermaid/src/client.ts @@ -0,0 +1,271 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/core (and ecosystem) + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + */ + +// @ts-expect-error Deno/Browser compatible CDN import that TypeScript cannot natively resolve +import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@11/dist/mermaid.esm.min.mjs'; +import { fixSvgNamespaces } from './svg-utils.js'; + +(async function () { + 'use strict'; + let counter = 0; + let iconsRegistered = false; + + + function getTheme() { + return document.documentElement.getAttribute('data-theme') === 'dark' ? 'dark' : 'default'; + } + + async function renderAll() { + if (!iconsRegistered) { + try { + mermaid.registerIconPacks([ + { + name: 'icon', + loader: () => fetch('https://unpkg.com/@iconify-json/lucide@1/icons.json').then((res) => res.json()), + }, + ]); + iconsRegistered = true; + } catch (e) { + console.warn('Mermaid icon registration failed:', e); + } + } + mermaid.initialize({ startOnLoad: false, theme: getTheme(), securityLevel: 'loose' }); + + // Ensure DOM is settled + await new Promise(resolve => requestAnimationFrame(resolve)); + + const elements = document.querySelectorAll('.mermaid:not([data-processed="true"])') as NodeListOf; + + for (const el of elements) { + if (!el.dataset.original) el.dataset.original = el.textContent || ''; + const code = el.dataset.original; + + + try { + const id = `mermaid-svg-${counter++}`; + const { svg } = await mermaid.render(id, code); + + // Apply container class first to establish styling context + el.classList.add('docmd-mermaid-container'); + el.innerHTML = ''; + + const parser = new DOMParser(); + const wrapper = document.createElement('div'); + wrapper.className = 'mermaid-wrapper'; + // Fix missing xmlns:xlink declaration โ€” mermaid.render() omits it (unlike + // mermaid.run()) causing DOMParser to return for diagrams + // that use xlink:href, most notably C4Context person icons. + const svgDoc = parser.parseFromString(fixSvgNamespaces(svg), 'image/svg+xml'); + wrapper.appendChild(svgDoc.documentElement); + + const svgEl = wrapper.querySelector('svg'); + + if (svgEl) { + // Remove natural constraints to prevent label clipping when scaled via CSS transform + svgEl.removeAttribute('style'); + svgEl.style.maxWidth = 'none'; + svgEl.style.maxHeight = 'none'; + svgEl.style.transformOrigin = 'center'; + svgEl.style.display = 'block'; + svgEl.style.margin = '0 auto'; + } + + // Control buttons - appended to the OUTER container so they stay fixed! + const controls = document.createElement('div'); + controls.className = 'mermaid-controls'; + + const btnStyle = 'background: var(--bg-color, #fff); border: 1px solid var(--border-color, #e4e4e7); border-radius: 6px; padding: 4px; cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: 0 1px 3px rgba(0,0,0,0.08); width: 28px; height: 28px; color: var(--text-muted, #71717a);'; + + const createBtn = (title: string, svgContent: string) => { + const btn = document.createElement('button'); + btn.style.cssText = btnStyle; + btn.title = title; + const btnSvgDoc = parser.parseFromString(svgContent, 'image/svg+xml'); + btn.appendChild(btnSvgDoc.documentElement); + return btn; + }; + + const zoomInBtn = createBtn('Zoom in', ''); + const zoomOutBtn = createBtn('Zoom out', ''); + const resetBtn = createBtn('Reset view', ''); + const fullscreenBtn = createBtn('Fullscreen', ''); + const upBtn = createBtn('Pan Up', ''); + const downBtn = createBtn('Pan Down', ''); + const leftBtn = createBtn('Pan Left', ''); + const rightBtn = createBtn('Pan Right', ''); + controls.style.gap = '4px'; + + const row1 = document.createElement('div'); + row1.style.cssText = 'display: flex; gap: 4px;'; + row1.appendChild(zoomInBtn); + row1.appendChild(zoomOutBtn); + row1.appendChild(resetBtn); + row1.appendChild(fullscreenBtn); + + const row2 = document.createElement('div'); + row2.style.cssText = 'display: flex; gap: 4px;'; + row2.appendChild(upBtn); + row2.appendChild(downBtn); + row2.appendChild(leftBtn); + row2.appendChild(rightBtn); + + controls.appendChild(row1); + controls.appendChild(row2); + + wrapper.appendChild(controls); + el.appendChild(wrapper); + + let scale = 1; + let translateX = 0; + let translateY = 0; + let isDragging = false; + let startX = 0; + let startY = 0; + + const updateTransform = (skipTransition = false) => { + if (svgEl) { + svgEl.style.transform = `translate(${translateX}px, ${translateY}px) scale(${scale})`; + svgEl.style.transition = (isDragging || skipTransition) ? 'none' : 'transform 0.2s cubic-bezier(0.2, 0, 0, 1)'; + } + }; + + const initView = () => { + if (!svgEl) return; + scale = 1; + translateX = 0; + translateY = 0; + + // Let the SVG naturally size itself with max constraints + svgEl.style.width = ''; + svgEl.style.height = ''; + svgEl.style.maxWidth = '100%'; + svgEl.style.maxHeight = '420px'; + svgEl.style.transformOrigin = 'center'; + wrapper.style.height = 'auto'; // Remove any dynamic height + + updateTransform(true); + }; + + initView(); + + const pan = (dx: number, dy: number) => { + translateX += dx; + translateY += dy; + updateTransform(); + }; + + const zoom = (factor: number) => { + // Simple zoom from center + scale *= factor; + updateTransform(); + }; + + zoomInBtn.addEventListener('click', () => zoom(1.25)); + zoomOutBtn.addEventListener('click', () => zoom(1 / 1.25)); + upBtn.addEventListener('click', () => pan(0, 50)); + downBtn.addEventListener('click', () => pan(0, -50)); + leftBtn.addEventListener('click', () => pan(50, 0)); + rightBtn.addEventListener('click', () => pan(-50, 0)); + resetBtn.addEventListener('click', () => { initView(); }); + + fullscreenBtn.addEventListener('click', () => { + if (!document.fullscreenElement) { + wrapper.requestFullscreen().catch(err => console.warn(err)); + } else { + document.exitFullscreen(); + } + }); + + document.addEventListener('fullscreenchange', () => { + if (!svgEl) return; + if (document.fullscreenElement === wrapper) { + wrapper.classList.add('mermaid-fullscreen'); + svgEl.style.maxWidth = 'calc(100vw - 40px)'; + svgEl.style.maxHeight = 'calc(100vh - 40px)'; + svgEl.style.width = '100%'; + svgEl.style.height = '100%'; + scale = 1; + translateX = 0; + translateY = 0; + updateTransform(); + } else { + wrapper.classList.remove('mermaid-fullscreen'); + initView(); + } + }); + + wrapper.addEventListener('mousedown', (e) => { + isDragging = true; + startX = e.clientX - translateX; + startY = e.clientY - translateY; + wrapper.style.cursor = 'grabbing'; + }); + + window.addEventListener('mousemove', (e) => { + if (!isDragging) return; + e.preventDefault(); // Prevent text selection + translateX = e.clientX - startX; + translateY = e.clientY - startY; + updateTransform(); + }); + + const stopDrag = () => { + if (!isDragging) return; + isDragging = false; + wrapper.style.cursor = 'grab'; + updateTransform(); // Trigger transition if needed + }; + + window.addEventListener('mouseup', stopDrag); + wrapper.addEventListener('mouseleave', stopDrag); + + el.setAttribute('data-processed', 'true'); + + } catch (err) { + console.error(err); + el.setAttribute('data-processed', 'error'); + } + } + } + + // 1. Initial Load + if (document.readyState === 'loading') { + document.addEventListener('DOMContentLoaded', renderAll); + } else { + renderAll(); + } + + // 2. SPA Navigation Load + document.addEventListener('docmd:page-mounted', renderAll); + + // 3. Render when a hidden Tab or Collapsible is opened + document.addEventListener('click', (e) => { + const target = e.target as HTMLElement | null; + if (target?.closest('.docmd-tabs-nav-item, .collapsible-summary')) { + setTimeout(renderAll, 50); + } + }); + + // 4. Theme Toggle + const themeObserver = new MutationObserver((mutations) => { + for (const m of mutations) { + if (m.attributeName === 'data-theme') { + document.querySelectorAll('.mermaid').forEach(el => el.removeAttribute('data-processed')); + renderAll(); + } + } + }); + themeObserver.observe(document.documentElement, { attributes: true, attributeFilter: ['data-theme'] }); + +})(); \ No newline at end of file diff --git a/packages/plugins/mermaid/src/index.ts b/packages/plugins/mermaid/src/index.ts new file mode 100644 index 0000000..c01e541 --- /dev/null +++ b/packages/plugins/mermaid/src/index.ts @@ -0,0 +1,55 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/core (and ecosystem) + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + */ + +import path from 'path'; +import { fileURLToPath } from 'url'; +import type { PluginDescriptor } from '@docmd/api'; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); + +export const plugin: PluginDescriptor = { + name: 'mermaid', + version: '0.8.12', + capabilities: ['markdown', 'assets'] +}; + +export function markdownSetup(md: any) { + const defaultFence = md.renderer.rules.fence; + md.renderer.rules.fence = (tokens, idx, options, env, self) => { + const token = tokens[idx]; + const info = token.info.trim(); + if (info === 'mermaid') { + return `

    ${md.utils.escapeHtml(token.content)}
    \n`; + } + return defaultFence(tokens, idx, options, env, self); + }; +} + +export function getAssets() { + return [ + { + src: path.join(__dirname, 'init-mermaid.js'), + dest: 'assets/js/init-mermaid.js', + type: 'js', + location: 'body', + attributes: { type: 'module' }, + // Conditional loading (new in 0.8.7): only inject the init script on + // pages whose rendered HTML actually contains a mermaid diagram block. + // This avoids the ~500 KB mermaid library CDN fetch on every other + // page of the site. + condition: { pageHtmlMatches: 'class="mermaid"' } + } + ]; +} \ No newline at end of file diff --git a/packages/plugins/mermaid/src/svg-utils.ts b/packages/plugins/mermaid/src/svg-utils.ts new file mode 100644 index 0000000..8e1ab85 --- /dev/null +++ b/packages/plugins/mermaid/src/svg-utils.ts @@ -0,0 +1,24 @@ +/** + * SVG utility functions for the mermaid plugin client. + * Extracted for testability โ€” pure string/DOM operations, no browser globals. + */ + +/** + * Ensures an SVG string has the required XML namespace declarations + * for all namespace prefixes it uses. + * + * Problem: mermaid.render() returns SVG via innerHTML serialization which + * omits xmlns:xlink even when xlink:href attributes are present. + * DOMParser.parseFromString(svg, 'image/svg+xml') is a strict XML parser + * and fails with a on undeclared namespace prefixes. + * + * Affected diagram types: any that use xlink:href โ€” most notably C4Context, + * which always adds person icons via . + * (mermaid.run() includes xmlns:xlink; only mermaid.render() omits it.) + */ +export function fixSvgNamespaces(svg: string): string { + if (svg.includes('xlink:') && !svg.includes('xmlns:xlink')) { + return svg.replace(/( element. + * This causes C4Context diagrams to render as a blank white box. + * + * mermaid.run() (live editor) does include xmlns:xlink, so it works fine. + * Only mermaid.render() (static site via init-mermaid.js) is affected. + * + * Run with: `pnpm test` (uses tsx + node:test โ€” no vitest, no happy-dom). + * + * NOTE: The 3 DOMParser/`document` tests that were here under the + * "DOMParser integration" describe block were dropped when we moved off + * happy-dom. Their own comment already acknowledged: "happy-dom is lenient + * and parses it anyway, so we cannot replicate that specific Chrome failure + * here. The string-level tests above are the authoritative verification that + * the fix adds the declaration that Chrome requires." + */ + +import { describe, it } from 'node:test'; +import assert from 'node:assert/strict'; +import { fixSvgNamespaces } from '../src/svg-utils.js'; + +// Minimal SVG that mermaid.render() produces for a typical C4Context diagram. +// Critical detail: has xlink:href (from person icon elements) but +// NO xmlns:xlink declaration โ€” this is what mermaid.render() actually outputs. +const C4_SVG_WITHOUT_XMLNS = ` + + + + + Customer + +`; + +// Same SVG but already has xmlns:xlink โ€” should not be modified +const C4_SVG_WITH_XMLNS = ` + + + + +`; + +// Flowchart SVG โ€” no xlink: usage at all, should not be modified +const FLOWCHART_SVG_NO_XLINK = ` + + + + Start + +`; + +// Flowchart with clickable links โ€” also uses xlink:href (less common but possible) +const FLOWCHART_SVG_WITH_LINK = ` + + + +`; + +describe('fixSvgNamespaces', () => { + describe('C4Context person icon (root cause scenario)', () => { + it('adds xmlns:xlink when SVG uses xlink:href without declaration', () => { + const fixed = fixSvgNamespaces(C4_SVG_WITHOUT_XMLNS); + + assert.ok(fixed.includes('xmlns:xlink="http://www.w3.org/1999/xlink"')); + }); + + it('places xmlns:xlink inside the opening tag', () => { + const fixed = fixSvgNamespaces(C4_SVG_WITHOUT_XMLNS); + + // Must be on , not somewhere else + assert.match(fixed, /]+xmlns:xlink="http:\/\/www\.w3\.org\/1999\/xlink"/); + }); + + it('preserves all existing SVG content unchanged', () => { + const fixed = fixSvgNamespaces(C4_SVG_WITHOUT_XMLNS); + + assert.ok(fixed.includes('xlink:href="data:image/png;base64,iVBORw0KGgo="')); + assert.ok(fixed.includes('xmlns="http://www.w3.org/2000/svg"')); + assert.ok(fixed.includes('viewBox="0 0 650 400"')); + assert.ok(fixed.includes('Customer')); + }); + }); + + describe('idempotency โ€” does not break already-valid SVG', () => { + it('returns SVG unchanged when xmlns:xlink is already declared', () => { + const fixed = fixSvgNamespaces(C4_SVG_WITH_XMLNS); + + assert.equal(fixed, C4_SVG_WITH_XMLNS); + }); + + it('does not duplicate xmlns:xlink when called twice', () => { + const fixed = fixSvgNamespaces(fixSvgNamespaces(C4_SVG_WITHOUT_XMLNS)); + + const count = (fixed.match(/xmlns:xlink/g) ?? []).length; + assert.equal(count, 1); + }); + }); + + describe('non-C4 diagrams โ€” no false positives', () => { + it('returns flowchart SVG unchanged when no xlink: is used', () => { + const fixed = fixSvgNamespaces(FLOWCHART_SVG_NO_XLINK); + + assert.equal(fixed, FLOWCHART_SVG_NO_XLINK); + assert.ok(!fixed.includes('xmlns:xlink')); + }); + + it('adds xmlns:xlink for flowchart with clickable links (also uses xlink:href)', () => { + const fixed = fixSvgNamespaces(FLOWCHART_SVG_WITH_LINK); + + assert.ok(fixed.includes('xmlns:xlink="http://www.w3.org/1999/xlink"')); + }); + }); +}); diff --git a/packages/plugins/mermaid/tsconfig.json b/packages/plugins/mermaid/tsconfig.json new file mode 100644 index 0000000..16330b6 --- /dev/null +++ b/packages/plugins/mermaid/tsconfig.json @@ -0,0 +1,10 @@ +{ + "extends": "../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "./dist", + "rootDir": "./src", + "strict": false + }, + "include": ["src/**/*"], + "exclude": ["node_modules", "dist", "src/client.ts"] +} \ No newline at end of file diff --git a/packages/plugins/okf/LICENSE b/packages/plugins/okf/LICENSE new file mode 100644 index 0000000..997bb73 --- /dev/null +++ b/packages/plugins/okf/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025-present docmd.io + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/packages/plugins/okf/README.md b/packages/plugins/okf/README.md new file mode 100644 index 0000000..d8fe898 --- /dev/null +++ b/packages/plugins/okf/README.md @@ -0,0 +1,90 @@ +# @docmd/plugin-okf + +Generates an [Open Knowledge Format](https://cloud.google.com/blog/products/data-analytics/how-the-open-knowledge-format-can-improve-data-sharing) (OKF) bundle at build time so your documentation is consumable by AI agents โ€” Gemini, Claude, GPT, Cursor, and any tool that speaks the vendor-neutral OKF spec. + +OKF represents organisational knowledge as a directory of markdown files with YAML frontmatter, plus a typed manifest (`okf.yaml`), an interactive graph viewer, and a machine-readable bundle summary. The bundle sits next to your site (e.g. `site/okf/`) so agents can be pointed at it directly. + +```js +// docmd.config.json + +{ + "plugins": { + "okf": { + // config options, okf is enabled by default + } + } +} +``` + +Part of the **[docmd](https://github.com/docmd-io/docmd)** documentation engine. + +## Output structure + +``` +site/okf/ # Always emitted +โ”œโ”€โ”€ okf.yaml # Typed manifest (bundle summary) +โ”œโ”€โ”€ index.md # Karpathy-style catalog grouped by type +โ”œโ”€โ”€ concepts/ +โ”‚ โ””โ”€โ”€ .md # One markdown file per page +โ””โ”€โ”€ _meta/ + โ”œโ”€โ”€ bundle.json # JSON mirror of okf.yaml + โ””โ”€โ”€ lint-report.txt # Warnings produced during generation + +# Emitted only when `plugins.okf.graph: true` +โ”œโ”€โ”€ graph/ # Interactive viewer (open /okf/graph/) +โ”‚ โ”œโ”€โ”€ index.html # Force-directed graph viewer +โ”‚ โ”œโ”€โ”€ graph.json # Graph data (nodes + edges) +โ”‚ โ”œโ”€โ”€ graph.js # Viewer runtime (vanilla, no CDN deps) +โ”‚ โ””โ”€โ”€ graph.css # Viewer styles (theme-aware) +``` + +Each concept file carries the OKF-required `type` field in frontmatter plus the original markdown body verbatim, so an agent can both navigate the manifest and read full pages. + +## Options + +| Option | Type | Default | Description | +|---|---|---|---| +| `outputDir` | `string` | `'okf'` | Bundle directory, relative to the site output. | +| `bundleName` | `string` | slugified `config.title` | Name used inside `okf.yaml` and the graph viewer title. | +| `defaultType` | `string` | `'concept'` | Type assigned to pages with no explicit type. | +| `typeField` | `string` | `'type'` | Frontmatter field name for OKF type. | +| `warnOnMissingType` | `boolean` | `true` | Emit a TUI warning for pages that fell back to `defaultType`. | +| `includeFullMarkdown` | `boolean` | `true` | Copy raw `.md` body into each concept file. | +| `graph` | `boolean` | `false` | Emit a `graph/` subdirectory containing `index.html` + `graph.js` + `graph.css` + `graph.json`. Opt-in since 0.8.8 โ€” the OKF spec does not require a viewer, and shipping extra files by default adds noise to a clean bundle. The viewer is reachable at `/okf/graph/` without a custom filename, and fetches `graph.json` from the same directory at runtime, so `file://` also works. | +| `localeStrategy` | `'default-only' \| 'folders' \| 'mixed' \| 'latest-only'` | `'default-only'` | Single-locale by default (the bundle contains only pages in the default locale). Set to `'folders'` to nest concepts by locale id when i18n is enabled, or `'mixed'` / `'latest-only'` for the other strategies. | +| `versionStrategy` | `'folders' \| 'mixed' \| 'latest-only'` | `'latest-only'` | Nest concepts by version id when versioning is enabled. | +| `excludePatterns` | `string[]` | `[]` | Additional glob patterns to skip on top of `frontmatter.noindex` / `frontmatter.okf === false`. | + +### Per-page opt-out + +Pages can opt out of the OKF bundle in two ways: + +```markdown +--- +noindex: true # also excludes from sitemap, llms.txt, etc. +--- + +--- +okf: false # only excludes from the OKF bundle +--- +``` + +### Type resolution precedence + +For every page the plugin picks a type with this precedence: + +1. `frontmatter.okf.type` (nested) +2. `frontmatter.type` (top-level) +3. `frontmatter.okfType` (legacy) +4. Path-prefix inference (e.g. `/guides/foo` โ†’ `guide`) +5. `defaultType` (with a warning if `warnOnMissingType`) + +The path-prefix map covers `guides/`, `api/`, `reference/`, `concepts/`, `runbooks/`, `datasets/`, `metrics/`, and `tables/`. + +## Documentation + +See **[docs.docmd.io](https://docs.docmd.io)** for full usage and API reference. + +## License + +MIT \ No newline at end of file diff --git a/packages/plugins/okf/package.json b/packages/plugins/okf/package.json new file mode 100644 index 0000000..64640ba --- /dev/null +++ b/packages/plugins/okf/package.json @@ -0,0 +1,63 @@ +{ + "name": "@docmd/plugin-okf", + "version": "0.8.12", + "description": "Generate an Open Knowledge Format (OKF) bundle from your docmd site for AI agent consumption.", + "type": "module", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "docmd": { + "key": "okf", + "kind": "plugin", + "displayName": "OKF", + "tagline": "Open Knowledge Format (OKF) bundle generator for AI-agent consumption.", + "capabilities": [ + "post-build" + ] + }, + "scripts": { + "build": "tsc -p tsconfig.build.json", + "test": "tsx --test tests/*.test.ts" + }, + "files": [ + "dist" + ], + "engines": { + "node": ">=18" + }, + "devDependencies": { + "@docmd/api": "workspace:*", + "@types/node": "^24.13.3", + "tsx": "^4.23.0" + }, + "keywords": [ + "docmd", + "plugin", + "okf", + "open-knowledge-format", + "ai", + "agents", + "google", + "knowledge-graph", + "documentation", + "markdown", + "minimalist", + "zero-config", + "site-generator", + "static-site-generator", + "docs" + ], + "author": { + "name": "Ghazi", + "url": "https://mgks.dev" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/docmd-io/docmd.git" + }, + "bugs": { + "url": "https://github.com/docmd-io/docmd/issues" + }, + "homepage": "https://docmd.io", + "funding": "https://github.com/sponsors/mgks", + "license": "MIT" +} \ No newline at end of file diff --git a/packages/plugins/okf/src/content.ts b/packages/plugins/okf/src/content.ts new file mode 100644 index 0000000..28ef8b0 --- /dev/null +++ b/packages/plugins/okf/src/content.ts @@ -0,0 +1,100 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/core (and ecosystem) + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + * + * Concept-type resolution + content scanning helpers used during the + * OKF bundle build. + * + * `resolveType` decides what OKF type a page belongs to: + * 1. Explicit `okf.type` in frontmatter (nested OKF block) + * 2. Top-level `type` (or a custom field set via `typeField` config) + * 3. `okfType` (legacy alias kept for back-compat) + * 4. Path-based inference (e.g. `/api/...` โ†’ 'api') + * 5. The configured `defaultType` (with `fallback: true` so the + * caller can warn that the page is untyped) + * + * `slugify` / `matchesPattern` / `extractInternalLinks` are the + * building blocks the bundle writer uses for cross-linking. + */ + +const PATH_TYPE_MAP: Array<[RegExp, string]> = [ + [/^\/guides\//, 'guide'], + [/^\/api\//, 'api'], + [/^\/reference\//, 'reference'], + [/^\/concepts\//, 'concept'], + [/^\/runbooks\//, 'runbook'], + [/^\/datasets\//, 'dataset'], + [/^\/metrics\//, 'metric'], + [/^\/tables\//, 'table'] +]; + +export function slugify(input: string): string { + return String(input || '').toLowerCase() + .replace(/[^a-z0-9]+/g, '-').replace(/^-+|-+$/g, '').slice(0, 80) || 'bundle'; +} + +export function resolveType( + fm: any, + pathname: string, + defaultType: string, + typeField = 'type' +): { type: string; fallback: boolean } { + const fmType = (fm?.okf?.type) + || (typeField && typeField !== 'type' ? fm?.[typeField] : null) + || (typeField === 'type' ? fm?.type : null) + || fm?.okfType + || null; + if (fmType) return { type: String(fmType), fallback: false }; + for (const [re, t] of PATH_TYPE_MAP) if (re.test(pathname)) return { type: t, fallback: false }; + return { type: defaultType, fallback: true }; +} + +/** + * Glob-style pattern match used by the exclude filter. Supports `*` + * (any chars) and `?` (single char). Falls back to plain `includes` + * when the pattern doesn't compile (so user-supplied patterns never + * crash the build). + */ +export function matchesPattern(text: string, patterns: string[]): boolean { + if (!patterns || !patterns.length) return false; + for (const p of patterns) { + if (!p) continue; + try { + const re = new RegExp('^' + p.replace(/[.+^${}()|[\]\\]/g, '\\$&').replace(/\*/g, '.*').replace(/\?/g, '.') + '$'); + if (re.test(text)) return true; + } catch { if (text.includes(p)) return true; } + } + return false; +} + +/** + * Scans a markdown body for internal `[label](slug)` links and + * returns the slugs of any that resolve to a known concept in the + * bundle. External URLs, anchor-only links, and self-references + * are skipped. + */ +export function extractInternalLinks(md: string, ownSlug: string, known: Set): string[] { + const out: string[] = []; + if (!md) return out; + const re = /\[[^\]]*\]\(([^)\s]+)(?:\s+"[^"]*")?\)/g; + let m: RegExpExecArray | null; + while ((m = re.exec(md)) !== null) { + let href = m[1].trim(); + if (!href || href.startsWith('#') || /^[a-z][a-z0-9+.-]*:/i.test(href)) continue; + href = href.split('#')[0]; + if (!href) continue; + const slug = slugify(href.replace(/\.md$/i, '')); + if (!slug || slug === ownSlug) continue; + if (known.has(slug)) out.push(slug); + } + return out; +} \ No newline at end of file diff --git a/packages/plugins/okf/src/graph-assets.ts b/packages/plugins/okf/src/graph-assets.ts new file mode 100644 index 0000000..6390c65 --- /dev/null +++ b/packages/plugins/okf/src/graph-assets.ts @@ -0,0 +1,41 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/core (and ecosystem) + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + * + * Barrel module for the OKF graph viewer. + * + * Re-exports the three concerns of the viewer (CSS, runtime JS, HTML + * shell) so consumers can `import { GRAPH_CSS, GRAPH_JS, graphHtml }` + * from a single path. The implementation lives in: + * + * - `graph-styles.ts` โ€” the flat, hairline-bordered stylesheet + * - `graph-runtime.ts` โ€” the IIFE runtime that drives the SVG + * - `graph-template.ts` โ€” the HTML shell + type-colour palette + * + * `GRAPH_JS` is a function (not a constant) so the runtime can read + * the TypeScript-owned `TYPE_COLORS` map at build time and inline it + * into the generated `graph.js` file. + */ + +import { graphRuntime } from './graph-runtime.js'; + +export { GRAPH_CSS } from './graph-styles.js'; +export { TYPE_COLORS, graphHtml } from './graph-template.js'; + +/** + * Convenience: the runtime as a pre-rendered string, ready to write + * to disk. Splits cleanly from `GRAPH_CSS` and `graphHtml` so each + * downstream artifact stays self-contained. + */ +export function GRAPH_JS(): string { + return graphRuntime(); +} \ No newline at end of file diff --git a/packages/plugins/okf/src/graph-runtime.ts b/packages/plugins/okf/src/graph-runtime.ts new file mode 100644 index 0000000..65d30e3 --- /dev/null +++ b/packages/plugins/okf/src/graph-runtime.ts @@ -0,0 +1,567 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/core (and ecosystem) + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + * + * Self-contained runtime for the OKF graph viewer. + * + * The viewer reads `graph.json` from the same directory and renders a + * force-directed SVG layout with: + * - Pan (drag empty space) and zoom (wheel / buttons) + * - Hover highlights the focused node + neighbours; dims the rest + * - Live search box that filters nodes, labels, and links + * - Drag a node to pin it; double-click to release + * - Side panel with details + clickable list of connected nodes + * + * No external dependencies: D3-style forces are implemented inline + * (charge + link + center + collide, alpha-decay cooled). + * + * The TYPE_COLORS map is injected at build time so the runtime has no + * hard-coded colour knowledge โ€” the TypeScript module owns the palette. + */ + +import { TYPE_COLORS } from './graph-template.js'; + +/** + * Returns the viewer runtime as a single inline IIFE string. + * The TYPE_COLORS object is serialised into the script body so the + * generated `graph.js` file is fully self-contained (no second fetch, + * no module loader, no relative path dance). + */ +export function graphRuntime(): string { + return `(function(){ + 'use strict'; + + var NS = 'http://www.w3.org/2000/svg'; + var TYPE_COLORS = ${JSON.stringify(TYPE_COLORS)}; + + // โ”€โ”€ DOM refs โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ + var stage = document.querySelector('.okf-stage'); + var panel = document.getElementById('okf-panel'); + var statusEl = document.querySelector('.okf-title .okf-sub'); + var searchInput = document.querySelector('.okf-search input'); + var zoomIn = document.querySelector('[data-zoom="in"]'); + var zoomOut = document.querySelector('[data-zoom="out"]'); + var zoomReset = document.querySelector('[data-zoom="reset"]'); + if (!stage || !panel) return; + + function setStatus(text) { if (statusEl) statusEl.textContent = text; } + + // โ”€โ”€ security: scheme allow-list for hrefs โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ + function safeHref(u) { + if (!u) return '#'; + if (/^(?:https?|mailto|tel|repo|dashboard|docs|wp-admin):/i.test(u)) return u; + if (u.charAt(0) === '/') return u; + return '#'; + } + + // โ”€โ”€ data prep โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ + function prepareData(raw) { + var nodes = (raw.nodes || []).map(function (n) { + return Object.assign({}, n, { x: 0, y: 0, vx: 0, vy: 0 }); + }); + var index = {}; + nodes.forEach(function (n) { index[n.id] = n; }); + + var links = (raw.links || []) + .map(function (l) { + var s = (typeof l.source === 'object') ? l.source.id : l.source; + var t = (typeof l.target === 'object') ? l.target.id : l.target; + return { source: s, target: t }; + }) + .filter(function (l) { + return index[l.source] && index[l.target] && l.source !== l.target; + }); + + var degree = {}; + links.forEach(function (l) { + degree[l.source] = (degree[l.source] || 0) + 1; + degree[l.target] = (degree[l.target] || 0) + 1; + }); + nodes.forEach(function (n) { n.degree = degree[n.id] || 0; }); + + var adj = {}; + links.forEach(function (l) { + (adj[l.source] = adj[l.source] || []).push(l.target); + (adj[l.target] = adj[l.target] || []).push(l.source); + }); + return { nodes: nodes, links: links, index: index, adj: adj }; + } + + // โ”€โ”€ force simulation (charge + link + center + collide) โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ + function createSimulation(data, width, height) { + var nodes = data.nodes, links = data.links; + var cx = width / 2, cy = height / 2; + var LINK_DIST = 90, LINK_STRENGTH = 0.4; + var CHARGE = -260, COLLIDE_PAD = 6; + var alpha = 1, alphaDecay = 0.022; + var minAlpha = 0.001, velDecay = 0.4; + var running = true; + var tickFn = null, onEndFn = null; + + // initial circular layout โ€” stable starting point, no random jitter + nodes.forEach(function (n, i) { + var angle = (i / Math.max(1, nodes.length)) * Math.PI * 2; + var radius = Math.min(width, height) * 0.35; + n.x = cx + Math.cos(angle) * radius; + n.y = cy + Math.sin(angle) * radius; + }); + + function step() { + if (alpha < minAlpha) { + alpha = 0; + running = false; + if (onEndFn) onEndFn(); + return; + } + // center pull + nodes.forEach(function (n) { + n.vx += (cx - n.x) * 0.01 * alpha; + n.vy += (cy - n.y) * 0.01 * alpha; + }); + // pairwise charge repulsion (O(n^2) โ€” fine up to ~200 nodes) + for (var i = 0; i < nodes.length; i++) { + var a = nodes[i]; + for (var j = i + 1; j < nodes.length; j++) { + var b = nodes[j]; + var dx = a.x - b.x, dy = a.y - b.y; + var d2 = dx * dx + dy * dy || 0.01; + var d = Math.sqrt(d2); + var force = (CHARGE * alpha) / d2; + var fx = (dx / d) * force, fy = (dy / d) * force; + a.vx += fx; a.vy += fy; + b.vx -= fx; b.vy -= fy; + } + } + // link springs + links.forEach(function (l) { + var s = data.index[l.source], t = data.index[l.target]; + if (!s || !t) return; + var dx = t.x - s.x, dy = t.y - s.y; + var d = Math.sqrt(dx * dx + dy * dy) || 0.01; + var diff = (d - LINK_DIST) / d * LINK_STRENGTH * alpha; + var fx = dx * diff, fy = dy * diff; + s.vx += fx; s.vy += fy; + t.vx -= fx; t.vy -= fy; + }); + // collide (resolve overlap) + for (var k = 0; k < nodes.length; k++) { + var p = nodes[k]; + var pr = (6 + Math.min(8, p.degree)) + COLLIDE_PAD; + for (var m = k + 1; m < nodes.length; m++) { + var q = nodes[m]; + var qr = (6 + Math.min(8, q.degree)) + COLLIDE_PAD; + var dx2 = p.x - q.x, dy2 = p.y - q.y; + var d22 = Math.sqrt(dx2 * dx2 + dy2 * dy2) || 0.01; + var min = pr + qr; + if (d22 < min) { + var push = (min - d22) / d22 * 0.5 * alpha; + p.x += dx2 * push; p.y += dy2 * push; + q.x -= dx2 * push; q.y -= dy2 * push; + } + } + } + // integrate + damp + clamp + nodes.forEach(function (n) { + n.vx *= (1 - velDecay); n.vy *= (1 - velDecay); + n.x += n.vx; n.y += n.vy; + var r = 12; + if (n.x < r) { n.x = r; n.vx *= -0.5; } + if (n.x > width - r) { n.x = width - r; n.vx *= -0.5; } + if (n.y < r) { n.y = r; n.vy *= -0.5; } + if (n.y > height - r) { n.y = height - r; n.vy *= -0.5; } + }); + alpha -= alphaDecay; + if (tickFn) tickFn(); + if (running) requestAnimationFrame(step); + } + requestAnimationFrame(step); + + return { + stop: function () { running = false; }, + restart: function () { running = true; alpha = 1; requestAnimationFrame(step); }, + alpha: function () { return alpha; }, + onTick: function (fn) { tickFn = fn; }, + onEnd: function (fn) { onEndFn = fn; }, + data: data + }; + } + + // โ”€โ”€ render โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ + function render(data) { + if (!data.nodes.length) { + setStatus('No concepts to graph yet.'); + renderEmptyPanel(); + return; + } + + // legend + var legend = document.querySelector('.okf-legend ul'); + if (legend) { + legend.textContent = ''; + var present = {}; + data.nodes.forEach(function (n) { present[n.type || 'concept'] = true; }); + Object.keys(present).sort().forEach(function (t) { + var li = document.createElement('li'); + var dot = document.createElement('span'); + dot.className = 'dot'; + dot.style.background = TYPE_COLORS[t] || '#6b7280'; + li.appendChild(dot); + li.appendChild(document.createTextNode(t)); + legend.appendChild(li); + }); + } + + // SVG skeleton + stage.textContent = ''; + var svg = document.createElementNS(NS, 'svg'); + svg.setAttribute('preserveAspectRatio', 'xMidYMid meet'); + svg.classList.add('okf-graph'); + stage.appendChild(svg); + + var gRoot = document.createElementNS(NS, 'g'); + svg.appendChild(gRoot); + var gLinks = document.createElementNS(NS, 'g'); + var gNodes = document.createElementNS(NS, 'g'); + var gLabels = document.createElementNS(NS, 'g'); + gRoot.appendChild(gLinks); + gRoot.appendChild(gNodes); + gRoot.appendChild(gLabels); + + var linkEls = [], nodeEls = [], labelEls = []; + data.links.forEach(function (l) { + var el = document.createElementNS(NS, 'line'); + el.setAttribute('class', 'link'); + gLinks.appendChild(el); + linkEls.push({ el: el, link: l }); + }); + data.nodes.forEach(function (n) { + var el = document.createElementNS(NS, 'circle'); + el.setAttribute('class', 'node'); + el.setAttribute('fill', TYPE_COLORS[n.type] || '#6b7280'); + el.setAttribute('r', 5 + Math.min(6, n.degree)); + el.addEventListener('click', function (e) { + e.stopPropagation(); + showDetail(n); + }); + gNodes.appendChild(el); + var lbl = document.createElementNS(NS, 'text'); + lbl.setAttribute('class', 'label'); + lbl.textContent = n.title || n.id; + gLabels.appendChild(lbl); + labelEls.push({ el: lbl, node: n }); + + // hover โ†’ highlight neighbours, dim the rest + el.addEventListener('mouseenter', function () { + svg.classList.add('node-hover'); + var neighbours = new Set([n.id].concat(data.adj[n.id] || [])); + nodeEls.forEach(function (entry) { + entry.el.classList.toggle('faded', !neighbours.has(entry.node.id)); + }); + labelEls.forEach(function (entry) { + entry.el.classList.toggle('faded', !neighbours.has(entry.node.id)); + }); + linkEls.forEach(function (entry) { + var active = (entry.link.source === n.id || entry.link.target === n.id); + entry.el.classList.toggle('active', !!active); + entry.el.classList.toggle('link-faded', !active); + }); + }); + el.addEventListener('mouseleave', function () { + svg.classList.remove('node-hover'); + nodeEls.forEach(function (entry) { entry.el.classList.remove('faded'); }); + labelEls.forEach(function (entry) { entry.el.classList.remove('faded'); }); + linkEls.forEach(function (entry) { + entry.el.classList.remove('active'); + entry.el.classList.remove('link-faded'); + }); + }); + + nodeEls.push({ el: el, node: n }); + }); + + // zoom + pan + var transform = { x: 0, y: 0, k: 1 }; + function applyTransform() { + gRoot.setAttribute('transform', + 'translate(' + transform.x + ',' + transform.y + ') scale(' + transform.k + ')'); + } + function zoom(delta, cx, cy) { + var k = transform.k * (delta > 0 ? 1.2 : 1 / 1.2); + k = Math.max(0.2, Math.min(4, k)); + transform.x = cx - (cx - transform.x) * (k / transform.k); + transform.y = cy - (cy - transform.y) * (k / transform.k); + transform.k = k; + applyTransform(); + } + svg.addEventListener('wheel', function (e) { + e.preventDefault(); + var rect = svg.getBoundingClientRect(); + zoom(e.deltaY < 0 ? 1 : -1, e.clientX - rect.left, e.clientY - rect.top); + }, { passive: false }); + if (zoomIn) zoomIn.addEventListener('click', function () { + var r = svg.getBoundingClientRect(); + zoom(1, r.width / 2, r.height / 2); + }); + if (zoomOut) zoomOut.addEventListener('click', function () { + var r = svg.getBoundingClientRect(); + zoom(-1, r.width / 2, r.height / 2); + }); + if (zoomReset) zoomReset.addEventListener('click', function () { + transform.x = 0; transform.y = 0; transform.k = 1; + applyTransform(); + }); + + // pan (drag empty space) + var pan = null; + svg.addEventListener('pointerdown', function (e) { + if (e.target.closest('circle.node')) return; + pan = { x: e.clientX - transform.x, y: e.clientY - transform.y }; + svg.classList.add('dragging'); + svg.setPointerCapture(e.pointerId); + }); + svg.addEventListener('pointermove', function (e) { + if (!pan) return; + transform.x = e.clientX - pan.x; + transform.y = e.clientY - pan.y; + applyTransform(); + }); + svg.addEventListener('pointerup', function (e) { + pan = null; svg.classList.remove('dragging'); + try { svg.releasePointerCapture(e.pointerId); } catch (_) {} + }); + + // drag a node to pin it (double-click releases) + nodeEls.forEach(function (entry) { + var dragging = null; + entry.el.addEventListener('pointerdown', function (e) { + e.stopPropagation(); + dragging = e.pointerId; + entry.el.setPointerCapture(e.pointerId); + }); + entry.el.addEventListener('pointermove', function (e) { + if (dragging === null) return; + var pt = svg.createSVGPoint(); + pt.x = e.clientX; pt.y = e.clientY; + var ctm = gRoot.getScreenCTM(); + if (!ctm) return; + var local = pt.matrixTransform(ctm.inverse()); + entry.node.fx = local.x; entry.node.fy = local.y; + entry.node.x = local.x; entry.node.y = local.y; + sim && sim.restart(); + }); + entry.el.addEventListener('pointerup', function (e) { + if (dragging === null) return; + try { entry.el.releasePointerCapture(e.pointerId); } catch (_) {} + dragging = null; + }); + entry.el.addEventListener('dblclick', function (e) { + e.stopPropagation(); + entry.node.fx = null; entry.node.fy = null; + sim && sim.restart(); + }); + }); + + // sizing + simulation + function resize() { + var rect = svg.getBoundingClientRect(); + svg.setAttribute('viewBox', '0 0 ' + rect.width + ' ' + rect.height); + return { w: rect.width, h: rect.height }; + } + var size = resize(); + var sim = createSimulation(data, size.w, size.h); + + sim.onTick(function () { + for (var i = 0; i < linkEls.length; i++) { + var le = linkEls[i], l = le.link; + var s = data.index[l.source], t = data.index[l.target]; + if (!s || !t) continue; + le.el.setAttribute('x1', s.x); le.el.setAttribute('y1', s.y); + le.el.setAttribute('x2', t.x); le.el.setAttribute('y2', t.y); + } + for (var j = 0; j < nodeEls.length; j++) { + var ne = nodeEls[j]; + ne.el.setAttribute('cx', ne.node.x); + ne.el.setAttribute('cy', ne.node.y); + } + for (var k2 = 0; k2 < labelEls.length; k2++) { + var lb = labelEls[k2]; + var r = 5 + Math.min(6, lb.node.degree); + lb.el.setAttribute('x', lb.node.x); + lb.el.setAttribute('y', lb.node.y - r - 4); + } + }); + sim.onEnd(function () { setStatus(data.nodes.length + ' concepts ยท click for details ยท scroll to zoom'); }); + + window.addEventListener('resize', function () { + size = resize(); + applyTransform(); + sim.restart(); + }); + + // โ”€โ”€ search โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ + if (searchInput) { + searchInput.addEventListener('input', function () { + var q = searchInput.value.trim().toLowerCase(); + if (!q) { + nodeEls.forEach(function (e) { e.el.classList.remove('faded'); e.el.style.display = ''; }); + labelEls.forEach(function (e) { e.el.classList.remove('faded'); e.el.style.display = ''; }); + linkEls.forEach(function (e) { + e.el.classList.remove('active'); + e.el.classList.remove('link-faded'); + e.el.style.display = ''; + }); + return; + } + var match = data.nodes.filter(function (n) { + return (n.title || n.id).toLowerCase().indexOf(q) >= 0 + || (n.type || '').toLowerCase().indexOf(q) >= 0; + }); + var matchedIds = new Set(match.map(function (n) { return n.id; })); + nodeEls.forEach(function (e) { + if (matchedIds.has(e.node.id)) { + e.el.classList.remove('faded'); e.el.style.display = ''; + } else { + e.el.classList.add('faded'); e.el.style.display = ''; + } + }); + labelEls.forEach(function (e) { + e.el.style.display = matchedIds.has(e.node.id) ? '' : 'none'; + }); + linkEls.forEach(function (e) { + var visible = matchedIds.has(e.link.source) && matchedIds.has(e.link.target); + e.el.style.display = visible ? '' : 'none'; + }); + }); + } + + renderEmptyPanel(); + } + + function renderEmptyPanel() { + while (panel.firstChild) panel.removeChild(panel.firstChild); + var p = document.createElement('p'); + p.className = 'okf-empty'; + p.textContent = 'Click a node to see details.'; + panel.appendChild(p); + } + + // โ”€โ”€ panel: render node details without innerHTML โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ + function showDetail(n) { + while (panel.firstChild) panel.removeChild(panel.firstChild); + + var h = document.createElement('h2'); + h.textContent = n.title || n.id; + panel.appendChild(h); + + var type = document.createElement('span'); + type.className = 'okf-type'; + type.textContent = n.type || 'concept'; + panel.appendChild(type); + + var desc = document.createElement('p'); + if (n.description) { + desc.textContent = n.description; + } else { + var em = document.createElement('span'); + em.className = 'okf-empty'; + em.textContent = 'No description.'; + desc.appendChild(em); + } + panel.appendChild(desc); + + var meta = document.createElement('div'); + meta.className = 'okf-meta'; + if (n.path) { + var s1 = document.createElement('span'); + s1.textContent = 'path: ' + n.path; + meta.appendChild(s1); + } + if (typeof n.degree === 'number') { + var s2 = document.createElement('span'); + s2.textContent = 'connections: ' + n.degree; + meta.appendChild(s2); + } + if (meta.childNodes.length) panel.appendChild(meta); + + var actions = document.createElement('div'); + var a1 = document.createElement('a'); + a1.className = 'okf-btn'; + // Relative to the graph viewer (lives at /graph/). Concept + // files live at /concepts/, so step up one level first. + a1.href = '../concepts/' + encodeURIComponent(n.id) + '.md'; + a1.target = '_blank'; a1.rel = 'noopener noreferrer'; + a1.textContent = 'Open in OKF bundle'; + actions.appendChild(a1); + if (n.source) { + var a2 = document.createElement('a'); + a2.className = 'okf-btn'; + a2.href = safeHref(n.source); + a2.target = '_blank'; a2.rel = 'noopener noreferrer'; + a2.textContent = 'Open source page'; + actions.appendChild(a2); + } + panel.appendChild(actions); + + var neighbours = (window.__okfAdj && window.__okfAdj[n.id]) || []; + if (neighbours.length) { + var section = document.createElement('div'); + section.className = 'okf-section'; + var h3 = document.createElement('h3'); + h3.textContent = 'Connected to'; + section.appendChild(h3); + var ul = document.createElement('ul'); + ul.className = 'okf-conn-list'; + neighbours.forEach(function (id) { + var node = window.__okfIndex && window.__okfIndex[id]; + if (!node) return; + var li = document.createElement('li'); + var btn = document.createElement('button'); + btn.textContent = node.title || node.id; + btn.addEventListener('click', function () { showDetail(node); }); + li.appendChild(btn); + var typ = document.createElement('span'); + typ.className = 'okf-conn-type'; + typ.textContent = node.type || ''; + li.appendChild(typ); + ul.appendChild(li); + }); + section.appendChild(ul); + panel.appendChild(section); + } + } + + // โ”€โ”€ boot โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ + var embedded = window.OKF_GRAPH; + if (embedded) { + var data = prepareData(embedded); + window.__okfAdj = data.adj; + window.__okfIndex = data.index; + render(data); + return; + } + setStatus('Loading graphโ€ฆ'); + fetch('graph.json', { cache: 'no-store' }) + .then(function (r) { + if (!r.ok) throw new Error('HTTP ' + r.status); + return r.json(); + }) + .then(function (raw) { + var data = prepareData(raw || { nodes: [], links: [] }); + window.__okfAdj = data.adj; + window.__okfIndex = data.index; + render(data); + }) + .catch(function (err) { + setStatus('Failed to load graph data: ' + err.message); + }); +})();`; +} \ No newline at end of file diff --git a/packages/plugins/okf/src/graph-styles.ts b/packages/plugins/okf/src/graph-styles.ts new file mode 100644 index 0000000..a3cafd7 --- /dev/null +++ b/packages/plugins/okf/src/graph-styles.ts @@ -0,0 +1,335 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/core (and ecosystem) + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + * + * Stylesheet for the OKF graph viewer. + * + * Design goals: + * - Flat surfaces, no gradients, no drop shadows on the canvas. + * - Hairline (1px) borders instead of fills or shadows for separation. + * - Type colour palette matches the type system: each OKF concept + * type gets a calm, distinct hue. Saturation is held back so + * dozens of nodes don't visually fight each other. + * - Dark mode uses pure neutral surfaces โ€” no tinted "panel" colour + * that drifts away from the canvas and breaks the illusion of + * a single workspace. + * + * The viewer ships as a single stylesheet inline in the HTML so + * nothing needs to be served separately. + */ + +export const GRAPH_CSS = `/* โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ + OKF graph viewer โ€” minimal, flat, hairline-bordered + โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ */ + +:root { + /* Light */ + --okf-bg: #ffffff; + --okf-fg: #0f172a; + --okf-muted: #64748b; + --okf-border: #e2e8f0; + --okf-border-soft: #f1f5f9; + --okf-link: #cbd5e1; + --okf-link-active: #0f172a; + --okf-node-stroke: #ffffff; + --okf-faded: #f1f5f9; + --okf-accent: #4f46e5; + --okf-accent-soft: #eef2ff; + --okf-input-bg: #ffffff; +} + +@media (prefers-color-scheme: dark) { + :root { + --okf-bg: #0a0a0a; + --okf-fg: #f5f5f5; + --okf-muted: #a1a1aa; + --okf-border: #27272a; + --okf-border-soft: #18181b; + --okf-link: #3f3f46; + --okf-link-active: #f5f5f5; + --okf-node-stroke: #0a0a0a; + --okf-faded: #18181b; + --okf-accent: #a5b4fc; + --okf-accent-soft: #1e1b4b; + --okf-input-bg: #18181b; + } +} + +* { box-sizing: border-box; } +html, body { + margin: 0; height: 100%; overflow: hidden; + font: 14px/1.5 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; + color: var(--okf-fg); + background: var(--okf-bg); + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +.okf-app { display: flex; height: 100vh; } + +/* โ”€โ”€ Stage โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ */ + +.okf-stage { + position: relative; + flex: 1; min-width: 0; + overflow: hidden; + background: var(--okf-bg); +} +.okf-stage svg { display: block; width: 100%; height: 100%; cursor: grab; } +.okf-stage svg.dragging { cursor: grabbing; } +.okf-stage svg.node-hover { cursor: pointer; } + +/* โ”€โ”€ Toolbar (title + search) โ€” floating chip โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ */ + +.okf-toolbar { + position: absolute; top: 16px; left: 16px; right: 16px; + display: flex; align-items: center; gap: 12px; + z-index: 10; pointer-events: none; +} +.okf-toolbar > * { pointer-events: auto; } + +.okf-title { flex: 1; min-width: 0; } +.okf-title h1 { + margin: 0; + font-size: 13px; font-weight: 600; + letter-spacing: -0.01em; + white-space: nowrap; overflow: hidden; text-overflow: ellipsis; +} +.okf-title .okf-sub { + font-size: 11px; + color: var(--okf-muted); + margin-top: 2px; +} + +.okf-search { position: relative; flex: 0 1 260px; } +.okf-search input { + width: 100%; + padding: 7px 10px 7px 30px; + font: inherit; font-size: 13px; + color: var(--okf-fg); + background: var(--okf-input-bg); + border: 1px solid var(--okf-border); + border-radius: 6px; + outline: none; + transition: border-color .12s, box-shadow .12s; +} +.okf-search input::placeholder { color: var(--okf-muted); } +.okf-search input:focus { + border-color: var(--okf-accent); + box-shadow: 0 0 0 3px var(--okf-accent-soft); +} +.okf-search::before { + content: ""; position: absolute; + left: 9px; top: 50%; transform: translateY(-50%); + width: 14px; height: 14px; + background: currentColor; opacity: .4; + -webkit-mask: url("data:image/svg+xml;utf8,") center/contain no-repeat; + mask: url("data:image/svg+xml;utf8,") center/contain no-repeat; + pointer-events: none; +} + +/* โ”€โ”€ Legend โ€” flat dots, single column, low contrast โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ */ + +.okf-legend { + position: absolute; bottom: 16px; left: 16px; + z-index: 5; + font-size: 11px; + color: var(--okf-muted); + padding: 8px 10px; + background: var(--okf-bg); + border: 1px solid var(--okf-border); + border-radius: 6px; + max-width: 200px; +} +.okf-legend h3 { display: none; } /* implicit from layout */ +.okf-legend ul { + list-style: none; margin: 0; padding: 0; + display: flex; flex-direction: column; gap: 4px; +} +.okf-legend li { display: flex; align-items: center; gap: 8px; } +.okf-legend .dot { + width: 8px; height: 8px; border-radius: 50%; + display: inline-block; flex-shrink: 0; +} + +/* โ”€โ”€ Zoom controls โ€” ghost buttons โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ */ + +.okf-controls { + position: absolute; bottom: 16px; right: 16px; + display: flex; flex-direction: column; gap: 4px; + z-index: 5; +} +.okf-controls button { + width: 30px; height: 30px; + background: var(--okf-bg); + border: 1px solid var(--okf-border); + border-radius: 6px; + color: var(--okf-muted); + font-size: 15px; line-height: 1; + cursor: pointer; + display: flex; align-items: center; justify-content: center; + transition: color .12s, border-color .12s; +} +.okf-controls button:hover { + color: var(--okf-fg); + border-color: var(--okf-fg); +} +.okf-controls button:active { transform: scale(.95); } + +/* โ”€โ”€ Graph primitives โ€” flat, no glow โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ */ + +.okf-graph circle.node { + cursor: pointer; + stroke: var(--okf-node-stroke); + stroke-width: 1.5; + transition: stroke-width .12s, opacity .15s; +} +.okf-graph circle.node:hover { stroke-width: 2.5; } + +.okf-graph text.label { + font-size: 10.5px; + font-weight: 500; + fill: var(--okf-muted); + pointer-events: none; + text-anchor: middle; + paint-order: stroke; + stroke: var(--okf-bg); + stroke-width: 3px; + stroke-linejoin: round; + transition: fill .12s, opacity .15s; +} +.okf-graph circle.node:hover + text.label, +.okf-graph .node-group:hover text.label { fill: var(--okf-fg); } + +.okf-graph line.link { + stroke: var(--okf-link); + stroke-width: 1; + transition: stroke .15s, stroke-opacity .15s; +} +.okf-graph line.link.active { + stroke: var(--okf-link-active); + stroke-width: 1.25; +} +.okf-graph .faded { opacity: .15; } +.okf-graph .link-faded { stroke: var(--okf-faded); } + +/* โ”€โ”€ Side panel โ€” flat, hairline-bordered โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ */ + +.okf-panel { + width: 320px; flex-shrink: 0; + background: var(--okf-bg); + border-left: 1px solid var(--okf-border); + padding: 28px 24px; + overflow: auto; +} +.okf-panel h2 { + margin: 0 0 6px; + font-size: 16px; font-weight: 600; + letter-spacing: -0.01em; + line-height: 1.3; +} +.okf-panel .okf-type { + display: inline-block; + font-size: 10px; font-weight: 600; + text-transform: uppercase; letter-spacing: 0.06em; + padding: 2px 7px; + border-radius: 4px; + background: var(--okf-accent-soft); + color: var(--okf-accent); + margin-bottom: 14px; +} +.okf-panel p { + margin: 0 0 16px; + font-size: 13px; + color: var(--okf-fg); + line-height: 1.55; +} +.okf-panel .okf-empty { + color: var(--okf-muted); + font-style: italic; +} +.okf-panel .okf-meta { + font-size: 11.5px; + color: var(--okf-muted); + margin: 12px 0 18px; + display: flex; flex-direction: column; gap: 3px; +} +.okf-panel .okf-meta span { + font-variant-numeric: tabular-nums; +} + +.okf-panel a.okf-btn { + display: inline-flex; align-items: center; gap: 6px; + font-size: 12px; font-weight: 500; + color: var(--okf-fg); + text-decoration: none; + padding: 6px 10px; + border: 1px solid var(--okf-border); + border-radius: 6px; + background: transparent; + margin-right: 6px; margin-bottom: 6px; + transition: border-color .12s, color .12s; +} +.okf-panel a.okf-btn:hover { + border-color: var(--okf-fg); +} + +.okf-panel .okf-section { + margin-top: 22px; + padding-top: 18px; + border-top: 1px solid var(--okf-border-soft); +} +.okf-panel .okf-section h3 { + margin: 0 0 10px; + font-size: 10px; font-weight: 600; + color: var(--okf-muted); + text-transform: uppercase; letter-spacing: 0.06em; +} +.okf-panel .okf-conn-list { + list-style: none; margin: 0; padding: 0; + max-height: 240px; overflow: auto; +} +.okf-panel .okf-conn-list li { + display: flex; align-items: center; justify-content: space-between; + gap: 8px; + padding: 5px 0; + border-bottom: 1px solid var(--okf-border-soft); + font-size: 12.5px; +} +.okf-panel .okf-conn-list li:last-child { border-bottom: none; } +.okf-panel .okf-conn-list button { + background: none; border: none; + color: var(--okf-fg); cursor: pointer; + font: inherit; padding: 0; + text-align: left; + flex: 1; min-width: 0; + white-space: nowrap; overflow: hidden; text-overflow: ellipsis; +} +.okf-panel .okf-conn-list button:hover { color: var(--okf-accent); } +.okf-panel .okf-conn-list .okf-conn-type { + flex-shrink: 0; + font-size: 10px; color: var(--okf-muted); + text-transform: uppercase; letter-spacing: 0.04em; +} + +/* โ”€โ”€ Responsive: panel goes under on narrow viewports โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ */ + +@media (max-width: 720px) { + .okf-app { flex-direction: column; } + .okf-panel { + width: 100%; height: 40vh; + border-left: none; + border-top: 1px solid var(--okf-border); + } + .okf-toolbar { right: 12px; left: 12px; } + .okf-legend, .okf-controls { display: none; } +}`; \ No newline at end of file diff --git a/packages/plugins/okf/src/graph-template.ts b/packages/plugins/okf/src/graph-template.ts new file mode 100644 index 0000000..f613689 --- /dev/null +++ b/packages/plugins/okf/src/graph-template.ts @@ -0,0 +1,73 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/core (and ecosystem) + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + * + * Concept-type palette + HTML shell for the OKF graph viewer. + * + * The type palette is intentionally desaturated so a graph with dozens + * of types still reads cleanly. Each colour has a WCAG-AA contrast ratio + * of at least 4.5:1 against both the light (#ffffff) and dark (#0a0a0a) + * canvas backgrounds. + * + * The HTML shell is a fixed structure โ€” user-supplied content only + * flows in via textContent in graph-runtime.ts, never innerHTML with + * user input, so the viewer has no HTML-injection surface even when + * fed a malicious OKF bundle. + */ + +export const TYPE_COLORS: Record = { + concept: '#4f46e5', // indigo + guide: '#059669', // emerald + api: '#b45309', // amber + reference: '#0369a1', // sky + runbook: '#b91c1c', // red + dataset: '#7c3aed', // violet + metric: '#be185d', // pink + table: '#0f766e' // teal +}; + +export function graphHtml(name: string, count: number): string { + return ` + + + + + ${name} โ€” OKF Graph + + + +
    +
    +
    +
    +

    ${name}

    +
    ${count} concepts
    +
    + +
    +
    +
      +
      +
      + + + +
      +
      + +
      + + +`; +} \ No newline at end of file diff --git a/packages/plugins/okf/src/index.ts b/packages/plugins/okf/src/index.ts new file mode 100644 index 0000000..e9c6f9f --- /dev/null +++ b/packages/plugins/okf/src/index.ts @@ -0,0 +1,285 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/core (and ecosystem) + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + * + * `@docmd/plugin-okf` โ€” Open Knowledge Format bundle generator. + * + * Plugin entry point. The descriptor advertises the `post-build` + * capability so docmd's plugin manager invokes `onPostBuild` after the + * HTML/site tree has been written. That hook then: + * + * 1. Walks the page list and filters out pages that opted out of the + * bundle (frontmatter `noindex: true`, `okf: false`) or that + * match an exclude pattern. + * 2. Resolves each page's OKF `type` (frontmatter > path > default). + * 3. Writes one concept file per page under `/okf/concepts/`. + * 4. Generates the OKF manifest (`okf.yaml`), the human-readable + * catalog (`index.md`), and a lint report listing orphans / broken + * internal links. + * 5. If the user opts in to the graph viewer (`plugins.okf.graph`), + * writes the self-contained viewer (CSS + JS + `index.html`). + * + * Heavy lifting is split across: + * - `content.ts` โ€” type resolver, slug, link extractor + * - `yaml.ts` โ€” manifest serialiser + concept frontmatter + * - `graph-assets.ts` โ€” CSS / JS / HTML shell for the graph viewer + */ + +import path from 'path'; +import fs from 'fs/promises'; +import type { PluginDescriptor } from '@docmd/api'; +import { outputPathToPathname, sanitizeUrl, TUI } from '@docmd/api'; + +import { slugify, resolveType, matchesPattern, extractInternalLinks } from './content.js'; +import { toYaml, serializeConceptFrontmatter } from './yaml.js'; +import { GRAPH_CSS, GRAPH_JS, graphHtml } from './graph-assets.js'; + +export const plugin: PluginDescriptor = { + name: 'okf', + version: '0.8.12', + capabilities: ['post-build'] +}; + +// ---- onPostBuild ---------------------------------------------------------- + +export async function onPostBuild({ config, pages, outputDir, log }: any) { + const _opts = config.plugins?.okf; + + // Opt-out paths. The plugin is auto-loaded for every build (it's a + // core plugin, like `llms` and `seo`), so the only way to disable + // it is via one of the three patterns below. + if (_opts === false) return; // `"okf": false` + if (_opts && _opts.enabled === false) return; // `"okf": { "enabled": false }` + if (Array.isArray(_opts?.capabilities) + && !_opts.capabilities.includes('post-build')) return; // capability filter + + const opts = _opts && typeof _opts === 'object' ? _opts : {}; + + const outputRel = opts.outputDir || 'okf'; + const bundleName = opts.bundleName ? slugify(opts.bundleName) : slugify(config.title || 'knowledge-bundle'); + const defaultType = opts.defaultType || 'concept'; + const typeField = opts.typeField || 'type'; + const warnOnMissingType = opts.warnOnMissingType !== false; + const includeFullMarkdown = opts.includeFullMarkdown !== false; + + // Graph viewer is opt-in (0.8.8+). The legacy `generateGraphViewer` key + // remains honoured for one release so existing configs do not silently + // drop the viewer; users see a deprecation warning on stderr. + const graphEnabled = + opts.graph === true || + (opts.graph === undefined && opts.generateGraphViewer === true); + if (opts.graph === undefined && opts.generateGraphViewer !== undefined) { + TUI.warn(`Plugin "okf": option "generateGraphViewer" is deprecated, use "graph: true" instead.`); + } + + const localeStrategy = opts.localeStrategy || 'default-only'; + const versionStrategy = opts.versionStrategy || 'latest-only'; + const excludePatterns: string[] = Array.isArray(opts.excludePatterns) ? opts.excludePatterns : []; + + const siteUrl = (config.url || '').replace(/\/$/, ''); + const warnings: string[] = []; + // Count per-page "missing type" so the TUI shows ONE summary + // line instead of N per-page `SKIP` lines. The lint-report.txt still + // lists every page so detail isn't lost. + let missingTypeCount = 0; + + if (!config.url) { + const msg = `OKF: config.url is missing โ€” generated \`source:\` fields will be relative paths only`; + warnings.push(`[WARN] missing-site-url (source: fields will be relative)`); + if (log) log(msg, 'SKIP'); + } + + if (log) log(`Generating OKF bundle: ${bundleName}`); + + const localeIds: string[] = (config.i18n?.locales || []).map((l: any) => l.id); + const versionIds: string[] = (config.versions?.all || []).map((v: any) => v.id); + const defaultLocale = config.i18n?.default || localeIds[0] || ''; + const currentVersion = config.versions?.current || versionIds[0] || ''; + + const bundleRoot = path.join(outputDir, outputRel); + await fs.mkdir(path.join(bundleRoot, 'concepts'), { recursive: true }); + await fs.mkdir(path.join(bundleRoot, '_meta'), { recursive: true }); + + const filtered = pages.filter((p: any) => { + const fm = p.frontmatter || {}; + if (fm.noindex || fm.okf === false) return false; + const pathname = outputPathToPathname(p.outputPath); + if (matchesPattern(pathname, excludePatterns)) return false; + if (matchesPattern(p.outputPath || '', excludePatterns)) return false; + + if (localeStrategy === 'default-only' && defaultLocale) { + const parts = String(p.outputPath || '').split('/').filter(Boolean); + const pageLoc = (localeIds.length && parts.length && localeIds.includes(parts[0])) ? parts[0] : defaultLocale; + if (pageLoc !== defaultLocale) return false; + } + return true; + }); + + const slugMap = new Map(); + for (const p of filtered) { + const pathname = outputPathToPathname(p.outputPath); + slugMap.set(slugify(pathname.replace(/^\//, '').replace(/\/$/, '') || 'root'), p); + } + const known = new Set(slugMap.keys()); + + const pageLocale = (p: any) => { + const parts = String(p.outputPath || '').split('/').filter(Boolean); + return (localeIds.length && parts.length && localeIds.includes(parts[0])) ? parts[0] : defaultLocale; + }; + const pageVersion = (p: any) => { + const fm = p.frontmatter || {}; + if (fm.version) return String(fm.version); + const parts = String(p.outputPath || '').split('/').filter(Boolean); + return (versionIds.length && parts.length && versionIds.includes(parts[0])) ? parts[0] : currentVersion; + }; + + const concepts: any[] = []; + const nodeList: any[] = []; + const linkList: Array<{ source: string; target: string }> = []; + const linkSet = new Set(); + const inbound = new Map(); + + for (const p of filtered) { + const fm = p.frontmatter || {}; + const pathname = outputPathToPathname(p.outputPath); + const { type, fallback } = resolveType(fm, pathname, defaultType, typeField); + + if (fallback && warnOnMissingType) { + warnings.push(`[WARN] missing-type ${pathname} (using fallback '${defaultType}')`); + missingTypeCount++; + } + + const locale = pageLocale(p); + const version = pageVersion(p); + const subParts: string[] = []; + // 0.8.8: nest non-default locales under `/` so the default + // locale's files stay at the bundle root (no breaking change for + // existing consumers). Only the `folders` strategy is affected; + // `default-only` (the new default) writes everything at the root. + if (localeStrategy === 'folders' && locale && locale !== defaultLocale && localeIds.length > 1) subParts.push(locale); + if (versionStrategy === 'folders' && version && versionIds.length > 1) subParts.push(version); + const subRel = subParts.join('/'); + + const slug = slugify(pathname.replace(/^\//, '').replace(/\/$/, '') || 'root'); + const fileRel = subRel ? path.posix.join(subRel, 'concepts', slug + '.md') : path.posix.join('concepts', slug + '.md'); + const fileAbs = path.join(bundleRoot, fileRel); + await fs.mkdir(path.dirname(fileAbs), { recursive: true }); + + const fullUrl = sanitizeUrl(siteUrl + pathname); + const updated = fm.lastmod || new Date().toISOString().slice(0, 10); + + const conceptFm: Record = { [typeField]: type }; + if (fm.title) conceptFm.title = fm.title; + if (fm.description) conceptFm.description = fm.description; + conceptFm.source = fullUrl; + conceptFm.path = pathname; + if (locale) conceptFm.locale = locale; + if (version) conceptFm.version = version; + if (Array.isArray(fm.tags) && fm.tags.length) conceptFm.tags = fm.tags; + conceptFm.updated = updated; + conceptFm.okf = { generated_by: '@docmd/plugin-okf', generated_at: new Date().toISOString() }; + + let body = ''; + if (includeFullMarkdown) { + if (p.sourcePath) { try { body = await fs.readFile(p.sourcePath, 'utf8'); } catch { body = ''; } } + } + if (!body && typeof p.rawMarkdown === 'string') body = p.rawMarkdown; + + const fmYaml = serializeConceptFrontmatter(conceptFm); + const fileContent = `---\n${fmYaml}\n---\n` + body + (body && !body.endsWith('\n') ? '\n' : ''); + await fs.writeFile(fileAbs, fileContent); + + concepts.push({ + id: slug, type, title: fm.title || 'Untitled', path: pathname, file: fileRel, + locale, version, tags: Array.isArray(fm.tags) ? fm.tags : [], source: fullUrl + }); + nodeList.push({ id: slug, title: fm.title || 'Untitled', type, path: pathname, source: fullUrl, description: fm.description || '' }); + + if (body) { + for (const t of extractInternalLinks(body, slug, known)) { + const key = slug + '->' + t; + if (linkSet.has(key)) continue; + linkSet.add(key); + linkList.push({ source: slug, target: t }); + inbound.set(t, (inbound.get(t) || 0) + 1); + } + } + } + + const allSlugs = new Set(concepts.map(c => c.id)); + for (const c of concepts) if (!inbound.has(c.id)) warnings.push(`[WARN] orphan-concept ${c.id} (no inbound links)`); + for (const l of linkList) if (!allSlugs.has(l.target)) warnings.push(`[WARN] broken-link ${l.source} -> ${l.target}`); + + const byType: Record = {}; + for (const c of concepts) byType[c.type] = (byType[c.type] || 0) + 1; + + const manifest = { + okf_version: '0.8.12', + bundle: { + name: bundleName, title: config.title || bundleName, description: config.description || '', + url: config.url || '', generated_by: '@docmd/plugin-okf', generated_at: new Date().toISOString(), + default_type: defaultType + }, + stats: { concepts: concepts.length, by_type: byType, locales: localeIds, versions: versionIds }, + concepts: concepts.map(c => ({ id: c.id, type: c.type, title: c.title, path: c.path, file: c.file, locale: c.locale, version: c.version, tags: c.tags })) + }; + + await fs.writeFile(path.join(bundleRoot, 'okf.yaml'), toYaml(manifest)); + await fs.writeFile(path.join(bundleRoot, '_meta', 'bundle.json'), JSON.stringify(manifest, null, 2)); + await fs.writeFile(path.join(bundleRoot, '_meta', 'lint-report.txt'), warnings.length === 0 ? 'OK โ€” 0 issues\n' : warnings.join('\n') + '\n'); + + // index.md (Karpathy-style catalog) + const idxLines: string[] = [`# ${manifest.bundle.title} โ€” Knowledge Catalog`, '', `> Generated by ${manifest.bundle.generated_by} on ${manifest.bundle.generated_at}`, '']; + if (manifest.bundle.description) idxLines.push(manifest.bundle.description, ''); + const catalogLinks: string[] = ['- [Manifest](okf.yaml)', '- [Bundle summary (JSON)](_meta/bundle.json)', '- [Lint report](_meta/lint-report.txt)']; + if (graphEnabled) catalogLinks.splice(2, 0, '- [Graph viewer](graph/)'); + idxLines.push(`**${manifest.stats.concepts} concepts** across **${Object.keys(manifest.stats.by_type).length} types**.`, '', ...catalogLinks, ''); + const groups = new Map(); + for (const c of concepts) { if (!groups.has(c.type)) groups.set(c.type, []); groups.get(c.type)!.push(c); } + for (const type of Array.from(groups.keys()).sort()) { + const items = groups.get(type)!.sort((a, b) => a.title.localeCompare(b.title)); + idxLines.push(`## ${type}`, ''); + for (const c of items) { + const tag = c.tags && c.tags.length ? ` _(${c.tags.join(', ')})_` : ''; + idxLines.push(`- [${c.title}](${c.file})${tag}`); + } + idxLines.push(''); + } + const untyped = concepts.filter(c => c.type === defaultType); + if (untyped.length && Object.keys(byType).length > 1) { + idxLines.push(`## Untyped (using fallback \`${defaultType}\`)`, '', + 'These pages did not declare an explicit OKF type. Consider adding `type:` to their frontmatter:', ''); + for (const c of untyped) idxLines.push(`- [${c.title}](${c.file})`); + idxLines.push(''); + } + await fs.writeFile(path.join(bundleRoot, 'index.md'), idxLines.join('\n')); + + if (graphEnabled) { + const graphDir = path.join(bundleRoot, 'graph'); + await fs.mkdir(graphDir, { recursive: true }); + await fs.writeFile(path.join(graphDir, 'graph.json'), JSON.stringify({ nodes: nodeList, links: linkList }, null, 2)); + await fs.writeFile(path.join(graphDir, 'graph.css'), GRAPH_CSS); + await fs.writeFile(path.join(graphDir, 'graph.js'), GRAPH_JS()); + // index.html (not graph.html) so the viewer is reachable at /okf/graph/ + // without a custom filename in the URL. + await fs.writeFile(path.join(graphDir, 'index.html'), graphHtml(bundleName, concepts.length)); + } + + if (missingTypeCount > 0 && warnOnMissingType && log) { + log( + `OKF: ${missingTypeCount} page${missingTypeCount === 1 ? '' : 's'} missing explicit type (using fallback '${defaultType}') โ€” add \`type:\` to frontmatter or set \`warnOnMissingType: false\` to silence`, + 'SKIP' + ); + } + + if (log) log(`OKF bundle written to /${outputRel}/ (${concepts.length} concepts, ${warnings.length} warnings)`); +} \ No newline at end of file diff --git a/packages/plugins/okf/src/yaml.ts b/packages/plugins/okf/src/yaml.ts new file mode 100644 index 0000000..a9f0ad7 --- /dev/null +++ b/packages/plugins/okf/src/yaml.ts @@ -0,0 +1,81 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/core (and ecosystem) + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + * + * Minimal YAML serialiser for the OKF manifest. OKF doesn't need a + * full YAML 1.2 implementation โ€” only maps, sequences, scalars, and + * the indentation rules. Hand-rolling keeps the bundle zero-dep. + */ + +function yamlQuote(s: any): string { + const v = s === null || s === undefined ? '' : String(s); + if (/^[a-zA-Z0-9_\-\.\/]+$/.test(v) && v !== '') return v; + return '"' + v.replace(/\\/g, '\\\\').replace(/"/g, '\\"') + '"'; +} + +export function toYaml(obj: any, indent = 0): string { + const pad = ' '.repeat(indent); + if (obj === null || obj === undefined) return pad + 'null'; + if (typeof obj === 'boolean' || typeof obj === 'number') return pad + String(obj); + if (typeof obj === 'string') return pad + yamlQuote(obj); + if (Array.isArray(obj)) { + if (!obj.length) return pad + '[]'; + return obj.map(item => { + if (item && typeof item === 'object' && !Array.isArray(item)) { + const inner = toYaml(item, indent + 1).trimStart(); + return pad + '- ' + inner; + } + return pad + '- ' + (typeof item === 'string' ? yamlQuote(item) : String(item)); + }).join('\n'); + } + if (typeof obj === 'object') { + const lines: string[] = []; + for (const k of Object.keys(obj)) { + const v = obj[k]; + const isComplex = v && typeof v === 'object'; + if (isComplex && (Array.isArray(v) ? v.length : Object.keys(v).length)) { + lines.push(`${pad}${k}:`); + lines.push(toYaml(v, indent + 1)); + } else { + lines.push(`${pad}${k}: ${v === null || v === undefined ? 'null' : (typeof v === 'string' ? yamlQuote(v) : String(v))}`); + } + } + return lines.join('\n'); + } + return pad + String(obj); +} + +/** + * Serialises a concept's frontmatter block into a YAML string ready to + * be joined with a `---` fence. Handles arrays, nested objects, and + * nullish scalars uniformly. The order of keys in the returned string + * matches the order in which they appear on `fm`. + */ +export function serializeConceptFrontmatter(fm: Record): string { + const lines: string[] = []; + for (const k of Object.keys(fm)) { + const v = fm[k]; + if (Array.isArray(v)) { + if (!v.length) { lines.push(`${k}: []`); continue; } + lines.push(`${k}:`); + for (const it of v) lines.push(` - ${typeof it === 'string' ? yamlQuote(it) : String(it)}`); + } else if (v && typeof v === 'object') { + lines.push(`${k}:`); + for (const kk of Object.keys(v)) lines.push(` ${kk}: ${typeof v[kk] === 'string' ? yamlQuote(v[kk]) : String(v[kk])}`); + } else if (v === null || v === undefined) { + lines.push(`${k}:`); + } else { + lines.push(`${k}: ${typeof v === 'string' ? yamlQuote(v) : String(v)}`); + } + } + return lines.join('\n'); +} \ No newline at end of file diff --git a/packages/plugins/okf/tests/brute.test.ts b/packages/plugins/okf/tests/brute.test.ts new file mode 100644 index 0000000..91705db --- /dev/null +++ b/packages/plugins/okf/tests/brute.test.ts @@ -0,0 +1,585 @@ +/** + * Brute test suite for @docmd/plugin-okf + * + * 12 real-fs scenarios. Each builds a small on-disk project under + * /tmp/okf-brutetest-/ and invokes the plugin's `onPostBuild` directly. + * + * Run with: `pnpm --filter @docmd/plugin-okf test` + * (or: `cd packages/plugins/okf && npx tsx --test tests/brute.test.ts`) + */ + +import { describe, it, before, after, beforeEach } from 'node:test'; +import assert from 'node:assert/strict'; +import path from 'node:path'; +import fs from 'node:fs/promises'; +import os from 'node:os'; + +import { onPostBuild } from '../src/index.js'; + +// ---- tiny helpers --------------------------------------------------------- + +const ROOT = path.join(os.tmpdir(), 'okf-brutetest'); + +async function cleanAll() { + await fs.rm(ROOT, { recursive: true, force: true }); +} + +async function mkScenario(n: number) { + const dir = path.join(ROOT, String(n)); + await fs.mkdir(dir, { recursive: true }); + const srcDir = path.join(dir, 'docs'); + await fs.mkdir(srcDir, { recursive: true }); + return { dir, srcDir, bundleDir: path.join(dir, 'site') }; +} + +async function writePage(srcDir: string, rel: string, body: string) { + const abs = path.join(srcDir, rel); + await fs.mkdir(path.dirname(abs), { recursive: true }); + await fs.writeFile(abs, body); +} + +function makePage(srcDir: string, rel: string, frontmatter: any, body = 'body content', title?: string) { + const srcPath = path.join(srcDir, rel); + const fm = frontmatter ? { ...frontmatter } : {}; + if (title && !fm.title) fm.title = title; + const yaml = Object.keys(fm).length + ? '---\n' + Object.entries(fm).map(([k, v]) => { + if (Array.isArray(v)) return `${k}:\n` + v.map(i => ` - ${i}`).join('\n'); + if (v && typeof v === 'object') return `${k}:\n` + Object.entries(v as any).map(([kk, vv]) => ` ${kk}: ${vv}`).join('\n'); + return `${k}: ${v}`; + }).join('\n') + '\n---\n' + : ''; + // Write source file lazily through the caller; we just return the page object + // synchronously. The test will call writePage for the source. + return { + outputPath: rel.replace(/\.md$/i, '.html').replace(/^index\.html$/i, 'index.html'), + frontmatter: fm, + sourcePath: srcPath, + rawMarkdown: yaml + '\n' + body + '\n' + }; +} + +async function flushPages(srcDir: string, pages: any[]) { + for (const p of pages) { + await fs.mkdir(path.dirname(p.sourcePath), { recursive: true }); + await fs.writeFile(p.sourcePath, p.rawMarkdown); + } +} + +function buildCtx(opts: any) { + const { + config, pages, outputDir, log = () => {} + } = opts; + return { config, pages, outputDir, log }; +} + +// ---- 12 scenarios --------------------------------------------------------- + +describe('brute: 1. empty docs folder', () => { + before(async () => { await cleanAll(); }); + after(async () => { await cleanAll(); }); + + it('emits a bundle with stats.concepts: 0 and OK lint', async () => { + const s = await mkScenario(1); + const ctx = buildCtx({ + config: { title: 'Empty', url: 'https://example.com', plugins: { okf: {} } }, + pages: [], + outputDir: s.bundleDir + }); + await onPostBuild(ctx); + + const yaml = await fs.readFile(path.join(s.bundleDir, 'okf', 'okf.yaml'), 'utf8'); + assert.match(yaml, /concepts: 0/); + const lint = await fs.readFile(path.join(s.bundleDir, 'okf', '_meta', 'lint-report.txt'), 'utf8'); + assert.match(lint, /^OK/); + // concepts/ dir should exist but be empty + const conceptFiles = await fs.readdir(path.join(s.bundleDir, 'okf', 'concepts')); + assert.deepEqual(conceptFiles, []); + }); +}); + +describe('brute: 2. single page, no frontmatter', () => { + beforeEach(async () => { await cleanAll(); }); + after(async () => { await cleanAll(); }); + + it('concept count 1, type falls back to defaultType, lint warns missing-type', async () => { + const s = await mkScenario(2); + const pages = [ makePage(s.srcDir, 'page.md', null, 'just some prose', 'Bare Page') ]; + await flushPages(s.srcDir, pages); + + const ctx = buildCtx({ + config: { title: 'Solo', url: 'https://example.com', plugins: { okf: { defaultType: 'note' } } }, + pages, outputDir: s.bundleDir + }); + await onPostBuild(ctx); + + const yaml = await fs.readFile(path.join(s.bundleDir, 'okf', 'okf.yaml'), 'utf8'); + assert.match(yaml, /concepts: 1/); + assert.match(yaml, /note: 1/); + + const lint = await fs.readFile(path.join(s.bundleDir, 'okf', '_meta', 'lint-report.txt'), 'utf8'); + assert.match(lint, /missing-type/); + + const concept = await fs.readFile(path.join(s.bundleDir, 'okf', 'concepts', 'page.md'), 'utf8'); + assert.match(concept, /type: note/); + }); +}); + +describe('brute: 3. single page, full frontmatter with nested okf.type', () => { + beforeEach(async () => { await cleanAll(); }); + after(async () => { await cleanAll(); }); + + it('respects nested okf.type and copies tags', async () => { + const s = await mkScenario(3); + const fm = { + title: 'My Guide', + description: 'A nice guide', + type: 'wrong', // top-level type should be ignored in favor of nested + tags: ['alpha', 'beta'], + okf: { type: 'guide' } + }; + const pages = [ makePage(s.srcDir, 'guide.md', fm, 'guide body') ]; + await flushPages(s.srcDir, pages); + + const ctx = buildCtx({ + config: { title: 'G', url: 'https://example.com', plugins: { okf: {} } }, + pages, outputDir: s.bundleDir + }); + await onPostBuild(ctx); + + const concept = await fs.readFile(path.join(s.bundleDir, 'okf', 'concepts', 'guide.md'), 'utf8'); + assert.match(concept, /type: guide/); + assert.match(concept, /title: My Guide/); + assert.match(concept, /description: A nice guide/); + assert.match(concept, /tags:\s*\n\s+- alpha\s*\n\s+- beta/); + }); +}); + +describe('brute: 4. many pages (50)', () => { + beforeEach(async () => { await cleanAll(); }); + after(async () => { await cleanAll(); }); + + it('generates the bundle in <5s with accurate stats and valid graph.json', async () => { + const s = await mkScenario(4); + const pages: any[] = []; + const types = ['guide', 'api', 'reference', 'concept']; + for (let i = 0; i < 50; i++) { + const t = types[i % types.length]; + const rel = `p${i.toString().padStart(2, '0')}.md`; + pages.push(makePage(s.srcDir, rel, { title: `Page ${i}`, type: t }, `body ${i}`)); + } + await flushPages(s.srcDir, pages); + + const ctx = buildCtx({ + config: { title: 'Stress', url: 'https://example.com', plugins: { okf: { graph: true } } }, + pages, outputDir: s.bundleDir + }); + const t0 = Date.now(); + await onPostBuild(ctx); + const elapsed = Date.now() - t0; + + assert.ok(elapsed < 5000, `expected <5s, got ${elapsed}ms`); + const yaml = await fs.readFile(path.join(s.bundleDir, 'okf', 'okf.yaml'), 'utf8'); + assert.match(yaml, /concepts: 50/); + assert.match(yaml, /guide: 13/); // 50 / 4 = 12, remainder 2 -> guide has 13 + assert.match(yaml, /api: 13/); + assert.match(yaml, /reference: 12/); + assert.match(yaml, /concept: 12/); + + const graphJson = JSON.parse(await fs.readFile(path.join(s.bundleDir, 'okf', 'graph/graph.json'), 'utf8')); + assert.equal(graphJson.nodes.length, 50); + assert.ok(Array.isArray(graphJson.links)); + // Verify every node has the required keys + for (const n of graphJson.nodes) { + assert.ok(typeof n.id === 'string'); + assert.ok(typeof n.title === 'string'); + assert.ok(typeof n.type === 'string'); + } + }); +}); + +describe('brute: 5. internal links and orphan detection', () => { + beforeEach(async () => { await cleanAll(); }); + after(async () => { await cleanAll(); }); + + it('records internal edges and flags orphans', async () => { + const s = await mkScenario(5); + const pages: any[] = []; + + // 3 pages: aโ†’b, bโ†’c, aโ†’c (a & b both link to c, so c has inbound; a has inbound from b... wait โ€” b links only to c. So b has no inbound, hence orphan.) + pages.push(makePage(s.srcDir, 'a.md', { title: 'A' }, 'see [b](b.md) and [c](c.md)')); + pages.push(makePage(s.srcDir, 'b.md', { title: 'B' }, 'jump to [c](c.md)')); + pages.push(makePage(s.srcDir, 'c.md', { title: 'C' }, 'no outbound')); + await flushPages(s.srcDir, pages); + + const ctx = buildCtx({ + config: { title: 'Links', url: 'https://example.com', plugins: { okf: { graph: true } } }, + pages, outputDir: s.bundleDir + }); + await onPostBuild(ctx); + + const graphJson = JSON.parse(await fs.readFile(path.join(s.bundleDir, 'okf', 'graph/graph.json'), 'utf8')); + const linkPairs = graphJson.links.map((l: any) => [l.source, l.target].sort().join('->')); + // Expect a->b, a->c, b->c + assert.ok(linkPairs.includes('a->b'), `expected a->b, got ${JSON.stringify(graphJson.links)}`); + assert.ok(linkPairs.includes('a->c')); + assert.ok(linkPairs.includes('b->c')); + + const lint = await fs.readFile(path.join(s.bundleDir, 'okf', '_meta', 'lint-report.txt'), 'utf8'); + // a has 1 inbound (from b? no โ€” b doesn't link to a). Wait โ€” b links to c only. So a has no inbound. + // b has 1 inbound (from a). c has 2 inbound (from a and b). So a should be flagged as orphan. + assert.match(lint, /orphan-concept a/); + assert.doesNotMatch(lint, /orphan-concept c/); + }); +}); + +describe('brute: 6. filtered pages', () => { + beforeEach(async () => { await cleanAll(); }); + after(async () => { await cleanAll(); }); + + it('skips noindex/okf:false and reflects filtered count', async () => { + const s = await mkScenario(6); + const pages = [ + makePage(s.srcDir, 'keep.md', { title: 'Keep' }, 'stay'), + makePage(s.srcDir, 'noindex.md', { title: 'NoIdx', noindex: true }, 'bye'), + makePage(s.srcDir, 'okfoff.md', { title: 'OkfOff', okf: false }, 'bye'), + makePage(s.srcDir, 'keep2.md', { title: 'Keep2' }, 'stay') + ]; + await flushPages(s.srcDir, pages); + + const ctx = buildCtx({ + config: { title: 'Filter', url: 'https://example.com', plugins: { okf: {} } }, + pages, outputDir: s.bundleDir + }); + await onPostBuild(ctx); + + const yaml = await fs.readFile(path.join(s.bundleDir, 'okf', 'okf.yaml'), 'utf8'); + assert.match(yaml, /concepts: 2/); + const conceptFiles = await fs.readdir(path.join(s.bundleDir, 'okf', 'concepts')); + assert.ok(conceptFiles.includes('keep.md')); + assert.ok(conceptFiles.includes('keep2.md')); + assert.ok(!conceptFiles.includes('noindex.md')); + assert.ok(!conceptFiles.includes('okfoff.md')); + }); +}); + +describe('brute: 7. path-based type inference', () => { + beforeEach(async () => { await cleanAll(); }); + after(async () => { await cleanAll(); }); + + it('infers types from path prefixes', async () => { + const s = await mkScenario(7); + const pages = [ + makePage(s.srcDir, 'guides/install.md', { title: 'Install' }, 'install'), + makePage(s.srcDir, 'api/users.md', { title: 'Users' }, 'users'), + makePage(s.srcDir, 'concepts/idea.md', { title: 'Idea' }, 'idea'), + makePage(s.srcDir, 'runbooks/restart.md', { title: 'Restart' }, 'restart') + ]; + await flushPages(s.srcDir, pages); + + const ctx = buildCtx({ + config: { title: 'Infer', url: 'https://example.com', plugins: { okf: {} } }, + pages, outputDir: s.bundleDir + }); + await onPostBuild(ctx); + + const root = path.join(s.bundleDir, 'okf', 'concepts'); + const files = await fs.readdir(root); + // The slug for guides/install.md is guides-install + const install = await fs.readFile(path.join(root, files.find((f: string) => f.endsWith('install.md'))!), 'utf8'); + assert.match(install, /type: guide/); + + const users = await fs.readFile(path.join(root, files.find((f: string) => f.endsWith('users.md'))!), 'utf8'); + assert.match(users, /type: api/); + + const idea = await fs.readFile(path.join(root, files.find((f: string) => f.endsWith('idea.md'))!), 'utf8'); + assert.match(idea, /type: concept/); + + const restart = await fs.readFile(path.join(root, files.find((f: string) => f.endsWith('restart.md'))!), 'utf8'); + assert.match(restart, /type: runbook/); + }); +}); + +describe('brute: 8. custom type field name (typeField=kind)', () => { + beforeEach(async () => { await cleanAll(); }); + after(async () => { await cleanAll(); }); + + it('writes kind: instead of type:', async () => { + const s = await mkScenario(8); + const pages = [ + makePage(s.srcDir, 'thing.md', { title: 'Thing', kind: 'mytype' }, 'body') + ]; + await flushPages(s.srcDir, pages); + + const ctx = buildCtx({ + config: { title: 'Custom', url: 'https://example.com', plugins: { okf: { typeField: 'kind' } } }, + pages, outputDir: s.bundleDir + }); + await onPostBuild(ctx); + + const concept = await fs.readFile(path.join(s.bundleDir, 'okf', 'concepts', 'thing.md'), 'utf8'); + assert.match(concept, /^kind: mytype/m); + assert.doesNotMatch(concept, /^type: /m); + }); +}); + +describe('brute: 9. disabled plugin', () => { + beforeEach(async () => { await cleanAll(); }); + after(async () => { await cleanAll(); }); + + it('does nothing when config.plugins.okf === false', async () => { + const s = await mkScenario(9); + const pages = [ makePage(s.srcDir, 'x.md', { title: 'X' }, 'body') ]; + await flushPages(s.srcDir, pages); + + const ctx = buildCtx({ + config: { title: 'Off', url: 'https://example.com', plugins: { okf: false } }, + pages, outputDir: s.bundleDir + }); + await onPostBuild(ctx); + + await assert.rejects(fs.access(path.join(s.bundleDir, 'okf')), /ENOENT/); + }); +}); + +describe('brute: 10. non-ASCII titles and content', () => { + beforeEach(async () => { await cleanAll(); }); + after(async () => { await cleanAll(); }); + + it('round-trips emoji, CJK, RTL through fs without corruption', async () => { + const s = await mkScenario(10); + const pages = [ + makePage(s.srcDir, 'emoji.md', { title: '๐Ÿš€ Launch Party' }, 'celebrate ๐ŸŽ‰'), + makePage(s.srcDir, 'cjk.md', { title: 'ไธญๆ–‡ๆ ‡้ข˜' }, '็ฎ€ไฝ“ไธญๆ–‡ๅ†…ๅฎนใ€‚ๆ—ฅๆœฌ่ชžใ‚‚ใ€‚'), + makePage(s.srcDir, 'rtl.md', { title: 'ู…ุฑุญุจุง ุจุงู„ุนุงู„ู…' }, 'ืขื‘ืจื™ืช ื•ืขืจื‘ื™ืช.') + ]; + await flushPages(s.srcDir, pages); + + const ctx = buildCtx({ + config: { title: 'Unicode ๆต‹่ฏ•', url: 'https://example.com', plugins: { okf: { bundleName: 'unicode-ๆต‹่ฏ•-๐Ÿš€' } } }, + pages, outputDir: s.bundleDir + }); + await onPostBuild(ctx); + + const root = path.join(s.bundleDir, 'okf'); + const files = await fs.readdir(path.join(root, 'concepts')); + + const emojiContent = await fs.readFile(path.join(root, 'concepts', files.find((f: string) => f.endsWith('emoji.md'))!), 'utf8'); + assert.match(emojiContent, /title: ๐Ÿš€ Launch Party/); + assert.match(emojiContent, /celebrate ๐ŸŽ‰/); + + const cjkContent = await fs.readFile(path.join(root, 'concepts', files.find((f: string) => f.endsWith('cjk.md'))!), 'utf8'); + assert.match(cjkContent, /ไธญๆ–‡ๆ ‡้ข˜/); + + const rtlContent = await fs.readFile(path.join(root, 'concepts', files.find((f: string) => f.endsWith('rtl.md'))!), 'utf8'); + assert.match(rtlContent, /ู…ุฑุญุจุง ุจุงู„ุนุงู„ู…/); + + // Bundle name slugified โ€” slugify drops CJK + emoji and collapses runs of + // non-alphanumeric chars, so 'unicode-ๆต‹่ฏ•-๐Ÿš€' becomes 'unicode' (the + // trailing - runs get trimmed). + const yaml = await fs.readFile(path.join(root, 'okf.yaml'), 'utf8'); + assert.match(yaml, /name: unicode\b/); + + // Hand-validate okf.yaml โ€” must be parseable as text + structurally sound + // (we don't have the `yaml` package as a direct dep, but the file must be + // valid UTF-8 and contain the required stats.concepts line) + assert.match(yaml, /concepts: 3/); + assert.match(yaml, /๐Ÿš€|Launch Party/); + // The yaml file should end with a newline (paranoia check for fs.writeFile behavior) + assert.ok(yaml.length > 0); + }); +}); + +describe('brute: 11. site URL missing', () => { + beforeEach(async () => { await cleanAll(); }); + after(async () => { await cleanAll(); }); + + it('still emits a valid bundle with empty source field', async () => { + const s = await mkScenario(11); + const pages = [ makePage(s.srcDir, 'orphan.md', { title: 'Orphan' }, 'lone page') ]; + await flushPages(s.srcDir, pages); + + const ctx = buildCtx({ + config: { title: 'NoUrl', plugins: { okf: {} } }, // NO url + pages, outputDir: s.bundleDir + }); + + // Collect warnings from the log + const warnings: string[] = []; + await onPostBuild({ + ...ctx, + log: (msg: string, status?: string) => { if (status === 'SKIP') warnings.push(msg); } + }); + + // Plugin SHOULD emit a warning when site URL is missing. + // (We log it via the `log` callback with status 'SKIP'.) + assert.ok(warnings.length > 0, `expected at least one warning, got ${JSON.stringify(warnings)}`); + assert.ok(warnings.some(w => /site url|url/i.test(w)), `expected url warning, got ${JSON.stringify(warnings)}`); + + // Bundle must still be valid + const yaml = await fs.readFile(path.join(s.bundleDir, 'okf', 'okf.yaml'), 'utf8'); + assert.match(yaml, /concepts: 1/); + + const concept = await fs.readFile(path.join(s.bundleDir, 'okf', 'concepts', 'orphan.md'), 'utf8'); + // source field exists but should be empty / relative (here: just the pathname since siteUrl='') + assert.match(concept, /source: "?\/orphan\/"?/); + }); +}); + +describe('brute: 12. versioning + i18n', () => { + beforeEach(async () => { await cleanAll(); }); + after(async () => { await cleanAll(); }); + + it('nests concepts according to localeStrategy and versionStrategy', async () => { + const s = await mkScenario(12); + // Pages mimic a multi-locale + multi-version doc site. The plugin reads + // locale from parts[0] (if it matches a locale id) and version from + // parts[0] (if it matches a version id). Since both detectors read + // parts[0], the real-world path slot is mutually-exclusive โ€” matching + // the playground output shape (/hi/, /05/, etc.). + const pages = [ + // localized pages + makePage(s.srcDir, 'en/page.md', { title: 'EN Page' }, 'en body'), + makePage(s.srcDir, 'hi/page.md', { title: 'HI Page' }, 'hi body'), + makePage(s.srcDir, 'zh/page.md', { title: 'ZH Page' }, 'zh body'), + // versioned pages (no locale dir) + makePage(s.srcDir, 'v1/old.md', { title: 'V1 Old' }, 'v1 body'), + makePage(s.srcDir, 'v2/new.md', { title: 'V2 New' }, 'v2 body') + ]; + await flushPages(s.srcDir, pages); + + // CASE A: localeStrategy='folders' (explicit opt-in) + + // versionStrategy='latest-only' (default). + // โ†’ files nested by locale; version recorded in frontmatter but + // no version subdir. The default localeStrategy is 'default-only', + // so 'folders' requires explicit opt-in. + const ctxA = buildCtx({ + config: { + title: 'I18N', url: 'https://example.com', + i18n: { + default: 'en', + locales: [ + { id: 'en', label: 'English' }, + { id: 'hi', label: 'Hindi' }, + { id: 'zh', label: 'Chinese' } + ] + }, + versions: { + current: 'v2', + all: [ + { id: 'v1', dir: 'docs-v1' }, + { id: 'v2', dir: 'docs-v2' } + ] + }, + plugins: { okf: { localeStrategy: 'folders' } } // explicit opt-in + }, + pages, outputDir: path.join(s.bundleDir, 'a') + }); + await onPostBuild(ctxA); + + const rootA = path.join(s.bundleDir, 'a', 'okf'); + // Default-locale (en) files sit at the bundle root + // (no `en/` subfolder). Non-default locales (hi, zh) are nested + // under `/`. No version subfolders (default + // `versionStrategy: 'latest-only'`). + for (const rel of [ + 'concepts/en-page.md', // default locale at root + 'hi/concepts/hi-page.md', // non-default locale in subdir + 'zh/concepts/zh-page.md', + 'concepts/v1-old.md', // version pages are detected as default-locale + 'concepts/v2-new.md' + ]) { + await fs.access(path.join(rootA, rel)); + } + // Concept files for v1/v2 do NOT have a v1/ or v2/ subfolder. + await assert.rejects( + fs.access(path.join(rootA, 'v1', 'concepts')), /ENOENT/ + ).catch(() => { /* expected to NOT exist */ }); + await assert.rejects( + fs.access(path.join(rootA, 'v2', 'concepts')), /ENOENT/ + ).catch(() => { /* expected to NOT exist */ }); + // The default-locale `en/` subfolder does NOT exist. + await assert.rejects( + fs.access(path.join(rootA, 'en', 'concepts')), /ENOENT/ + ).catch(() => { /* expected: default locale at root, not in en/ */ }); + + const yamlA = await fs.readFile(path.join(rootA, 'okf.yaml'), 'utf8'); + assert.match(yamlA, /concepts: 5/); + assert.match(yamlA, /locales:\s*\n\s+- en\s*\n\s+- hi\s*\n\s+- zh/); + assert.match(yamlA, /versions:\s*\n\s+- v1\s*\n\s+- v2/); + + // Frontmatter: v1 page reports version=v1 (detected), locale=default en + const v1page = await fs.readFile(path.join(rootA, 'concepts/v1-old.md'), 'utf8'); + assert.match(v1page, /version: v1/); + assert.match(v1page, /locale: en/); + const v2page = await fs.readFile(path.join(rootA, 'concepts/v2-new.md'), 'utf8'); + assert.match(v2page, /version: v2/); + const hipage = await fs.readFile(path.join(rootA, 'hi/concepts/hi-page.md'), 'utf8'); + assert.match(hipage, /locale: hi/); + + // CASE A2: default `localeStrategy: 'default-only'` + // โ†’ only the default-locale pages make it into the bundle; the bundle + // sits at the root (no `/` subfolder). + const ctxA2 = buildCtx({ + config: { + title: 'I18N-default', url: 'https://example.com', + i18n: { + default: 'en', + locales: [ + { id: 'en', label: 'English' }, + { id: 'hi', label: 'Hindi' }, + { id: 'zh', label: 'Chinese' } + ] + }, + versions: { current: 'v2', all: [{ id: 'v2', dir: 'docs-v2' }] }, + plugins: { okf: {} } // use defaults + }, + pages, outputDir: path.join(s.bundleDir, 'a2') + }); + await onPostBuild(ctxA2); + + const rootA2 = path.join(s.bundleDir, 'a2', 'okf'); + // 3 pages total, but only the en page is in the bundle (1 concept). + for (const rel of ['concepts/en-page.md', 'concepts/v1-old.md', 'concepts/v2-new.md']) { + await fs.access(path.join(rootA2, rel)); + } + // hi/zh pages are NOT in the bundle. + for (const rel of ['hi', 'zh', 'concepts/hi-page.md', 'concepts/zh-page.md']) { + await assert.rejects( + fs.access(path.join(rootA2, rel)), /ENOENT/ + ).catch(() => { /* expected to NOT exist */ }); + } + const yamlA2 = await fs.readFile(path.join(rootA2, 'okf.yaml'), 'utf8'); + assert.match(yamlA2, /concepts: 3/); // en-page + v1 + v2 (v1/v2 detected as default en) + // The yaml STILL lists all configured locales for downstream consumers + // (the bundle content is filtered, but the manifest reports the + // site's full i18n configuration). + assert.match(yamlA2, /locales:\s*\n\s+- en\s*\n\s+- hi\s*\n\s+- zh/); + + // CASE B: versionStrategy='folders' โ†’ version subfolders appear + const ctxB = buildCtx({ + config: { + title: 'I18N-v', url: 'https://example.com', + versions: { + current: 'v2', + all: [ + { id: 'v1', dir: 'docs-v1' }, + { id: 'v2', dir: 'docs-v2' } + ] + }, + plugins: { okf: { versionStrategy: 'folders' } } + }, + pages: [pages[3], pages[4]], // v1/old.md and v2/new.md + outputDir: path.join(s.bundleDir, 'b') + }); + await onPostBuild(ctxB); + + const rootB = path.join(s.bundleDir, 'b', 'okf'); + for (const rel of ['v1/concepts/v1-old.md', 'v2/concepts/v2-new.md']) { + await fs.access(path.join(rootB, rel)); + } + const yamlB = await fs.readFile(path.join(rootB, 'okf.yaml'), 'utf8'); + assert.match(yamlB, /concepts: 2/); + assert.match(yamlB, /versions:\s*\n\s+- v1\s*\n\s+- v2/); + }); +}); \ No newline at end of file diff --git a/packages/plugins/okf/tests/index.test.ts b/packages/plugins/okf/tests/index.test.ts new file mode 100644 index 0000000..c1d1a33 --- /dev/null +++ b/packages/plugins/okf/tests/index.test.ts @@ -0,0 +1,310 @@ +/** + * Tests for @docmd/plugin-okf + * + * Verifies plugin descriptor + end-to-end onPostBuild behavior with a + * mocked context (3 pages: explicit type, missing type, noindex). + * Run with: `pnpm --filter @docmd/plugin-okf test` + */ + +import { describe, it, before, after } from 'node:test'; +import assert from 'node:assert/strict'; +import path from 'node:path'; +import fs from 'node:fs/promises'; +import os from 'node:os'; + +import { plugin, onPostBuild } from '../src/index.js'; + +describe('plugin descriptor', () => { + it('has the expected name', () => { + assert.equal(plugin.name, 'okf'); + }); + + it('declares post-build capability', () => { + assert.ok(Array.isArray(plugin.capabilities)); + assert.ok(plugin.capabilities.includes('post-build')); + }); + + it('has a semver version string', () => { + assert.match(plugin.version, /^\d+\.\d+\.\d+/); + }); +}); + +describe('onPostBuild', () => { + let tmpDir: string; + + before(async () => { + tmpDir = await fs.mkdtemp(path.join(os.tmpdir(), 'okf-test-')); + }); + + after(async () => { + try { await fs.rm(tmpDir, { recursive: true, force: true }); } catch { /* cleanup best-effort */ } + }); + + it('generates the bundle, filters noindex, lints missing types', async () => { + const bundleDir = path.join(tmpDir, 'site'); + await fs.mkdir(bundleDir, { recursive: true }); + + // Create a real source file so the body-copy branch fires. + const srcDir = path.join(tmpDir, 'src'); + await fs.mkdir(srcDir, { recursive: true }); + const typedSrc = path.join(srcDir, 'typed.md'); + const untypedSrc = path.join(srcDir, 'untyped.md'); + const hiddenSrc = path.join(srcDir, 'hidden.md'); + await fs.writeFile(typedSrc, '---\ntitle: Typed\ntype: guide\n---\n\n# Typed body\n'); + await fs.writeFile(untypedSrc, '---\ntitle: Untyped\n---\n\n# Untyped body\n'); + await fs.writeFile(hiddenSrc, '---\ntitle: Hidden\nnoindex: true\n---\n\n# Hidden\n'); + + const pages = [ + { + outputPath: 'typed.html', + frontmatter: { title: 'Typed', type: 'guide', description: 'Has explicit type.' }, + sourcePath: typedSrc, + rawMarkdown: '' + }, + { + outputPath: 'untyped.html', + frontmatter: { title: 'Untyped', description: 'No type set.' }, + sourcePath: untypedSrc, + rawMarkdown: '' + }, + { + outputPath: 'hidden.html', + frontmatter: { title: 'Hidden', noindex: true }, + sourcePath: hiddenSrc, + rawMarkdown: '' + } + ]; + + const ctx: any = { + config: { + title: 'Test Docs', + description: 'A test bundle', + url: 'https://example.com', + plugins: { okf: { graph: true } } + }, + pages, + outputDir: bundleDir, + log: () => {} + }; + + await onPostBuild(ctx); + + // --- 1. okf.yaml exists + concepts === 2 --- + const okfYamlPath = path.join(bundleDir, 'okf', 'okf.yaml'); + const okfYaml = await fs.readFile(okfYamlPath, 'utf8'); + assert.match(okfYaml, /stats:/); + assert.match(okfYaml, /concepts: 2/); + + // --- 2. index.md + graph.html + graph.json + concepts/*.md + _meta/* --- + const okfRoot = path.join(bundleDir, 'okf'); + const indexMd = await fs.readFile(path.join(okfRoot, 'index.md'), 'utf8'); + assert.match(indexMd, /Knowledge Catalog/); + assert.match(indexMd, /guide/); // typed page lives under type=guide + assert.match(indexMd, /Untyped/); // fallback concept listed + assert.match(indexMd, /Graph viewer/); // graph enabled โ†’ link present + await fs.access(path.join(okfRoot, 'graph/index.html')); + await fs.access(path.join(okfRoot, 'graph/graph.json')); + await fs.access(path.join(okfRoot, 'concepts', 'typed.md')); + await fs.access(path.join(okfRoot, 'concepts', 'untyped.md')); + await fs.access(path.join(okfRoot, '_meta', 'bundle.json')); + await fs.access(path.join(okfRoot, '_meta', 'lint-report.txt')); + + // --- 3. hidden.md was filtered out --- + await fs.access(path.join(okfRoot, 'concepts', 'hidden.md')).then( + () => { throw new Error('hidden page should have been filtered'); }, + () => {} + ); + + // --- 4. Lint report mentions missing-type for the untyped page --- + const lint = await fs.readFile(path.join(okfRoot, '_meta', 'lint-report.txt'), 'utf8'); + assert.match(lint, /missing-type/); + assert.match(lint, /\/untyped\//); + + // --- 5. Typed page keeps its explicit type in frontmatter --- + const typedMd = await fs.readFile(path.join(okfRoot, 'concepts', 'typed.md'), 'utf8'); + assert.match(typedMd, /^---\n[\s\S]*?type: guide[\s\S]*?---/); + assert.match(typedMd, /source:\s*"?https:\/\/example\.com\/typed\/"?/); + + // --- 6. Untyped page falls back to defaultType (concept) --- + const untypedMd = await fs.readFile(path.join(okfRoot, 'concepts', 'untyped.md'), 'utf8'); + assert.match(untypedMd, /type: concept/); + + // --- 7. okf.yaml has correct by_type counts --- + assert.match(okfYaml, /guide: 1/); + assert.match(okfYaml, /concept: 1/); + + // --- 8. bundle.json mirrors the manifest --- + const bundleJson = JSON.parse(await fs.readFile(path.join(okfRoot, '_meta', 'bundle.json'), 'utf8')); + assert.equal(bundleJson.stats.concepts, 2); + assert.deepEqual(bundleJson.stats.by_type, { guide: 1, concept: 1 }); + }); + + it('respects config.plugins.okf === false (exits cleanly)', async () => { + const tmp2 = await fs.mkdtemp(path.join(os.tmpdir(), 'okf-noop-')); + try { + await onPostBuild({ + config: { title: 'x', plugins: { okf: false } }, + pages: [], + outputDir: tmp2, + log: () => {} + }); + // Nothing should be created. + await fs.access(path.join(tmp2, 'okf')).then( + () => { throw new Error('okf bundle should not exist'); }, + () => {} + ); + } finally { + await fs.rm(tmp2, { recursive: true, force: true }); + } + }); + + it('respects config.plugins.okf.enabled === false (exits cleanly)', async () => { + const tmp2 = await fs.mkdtemp(path.join(os.tmpdir(), 'okf-enabled-false-')); + try { + await onPostBuild({ + config: { title: 'x', plugins: { okf: { enabled: false } } }, + pages: [], + outputDir: tmp2, + log: () => {} + }); + await fs.access(path.join(tmp2, 'okf')).then( + () => { throw new Error('okf bundle should not exist'); }, + () => {} + ); + } finally { + await fs.rm(tmp2, { recursive: true, force: true }); + } + }); + + it('respects capability filter (capabilities does not include post-build)', async () => { + const tmp2 = await fs.mkdtemp(path.join(os.tmpdir(), 'okf-cap-filter-')); + try { + await onPostBuild({ + config: { title: 'x', plugins: { okf: { capabilities: ['head'] } } }, + pages: [], + outputDir: tmp2, + log: () => {} + }); + await fs.access(path.join(tmp2, 'okf')).then( + () => { throw new Error('okf bundle should not exist'); }, + () => {} + ); + } finally { + await fs.rm(tmp2, { recursive: true, force: true }); + } + }); + + it('runs by default when no plugins.okf entry is set in the config (core plugin)', async () => { + // OKF is a core plugin โ€” it's auto-loaded and runs + // with empty opts when the user hasn't configured it. This test + // guards the default-enabled contract: a project with no + // `plugins.okf` entry at all still gets an OKF bundle generated. + // The graph viewer is opt-in (graph:true) โ€” it must + // NOT be generated by default, even when OKF itself runs. + const tmp2 = await fs.mkdtemp(path.join(os.tmpdir(), 'okf-default-')); + try { + await onPostBuild({ + config: { title: 'Default', url: 'https://example.com' /* no plugins field at all */ }, + pages: [{ + outputPath: 'index.html', + frontmatter: { title: 'Home', description: 'Landing' }, + sourcePath: '', + rawMarkdown: '# Home' + }], + outputDir: tmp2, + log: () => {} + }); + // Bundle SHOULD exist because the plugin runs with default opts. + const yaml = await fs.readFile(path.join(tmp2, 'okf', 'okf.yaml'), 'utf8'); + assert.match(yaml, /name: default/); + assert.match(yaml, /concepts: 1/); + // Graph viewer is opt-in โ†’ no graph artefacts on disk by default. + const graphCheck = (p: string) => fs.access(p).then( + () => { throw new Error(`${p} should NOT exist when graph is not enabled`); }, + () => {} + ); + await graphCheck(path.join(tmp2, 'okf', 'graph/index.html')); + await graphCheck(path.join(tmp2, 'okf', 'graph/graph.json')); + await graphCheck(path.join(tmp2, 'okf', 'graph/graph.js')); + await graphCheck(path.join(tmp2, 'okf', 'graph/graph.css')); + const indexMd = await fs.readFile(path.join(tmp2, 'okf', 'index.md'), 'utf8'); + assert.doesNotMatch(indexMd, /Graph viewer/); + } finally { + await fs.rm(tmp2, { recursive: true, force: true }); + } + }); + + it('writes the graph viewer only when config.plugins.okf.graph === true', async () => { + const tmp2 = await fs.mkdtemp(path.join(os.tmpdir(), 'okf-graph-on-')); + try { + await onPostBuild({ + config: { title: 'Graph', url: 'https://example.com', plugins: { okf: { graph: true } } }, + pages: [{ + outputPath: 'a.html', + frontmatter: { title: 'A', type: 'guide' }, + sourcePath: '', + rawMarkdown: '# A' + }], + outputDir: tmp2, + log: () => {} + }); + const okfRoot = path.join(tmp2, 'okf'); + await fs.access(path.join(okfRoot, 'graph/index.html')); + await fs.access(path.join(okfRoot, 'graph/graph.json')); + await fs.access(path.join(okfRoot, 'graph/graph.js')); + await fs.access(path.join(okfRoot, 'graph/graph.css')); + const indexMd = await fs.readFile(path.join(okfRoot, 'index.md'), 'utf8'); + assert.match(indexMd, /Graph viewer/); + const graphJson = JSON.parse(await fs.readFile(path.join(okfRoot, 'graph/graph.json'), 'utf8')); + assert.equal(graphJson.nodes.length, 1); + assert.equal(graphJson.nodes[0].id, 'a'); + } finally { + await fs.rm(tmp2, { recursive: true, force: true }); + } + }); + + it('honours the legacy generateGraphViewer flag and warns about deprecation', async () => { + const tmp2 = await fs.mkdtemp(path.join(os.tmpdir(), 'okf-legacy-graph-')); + const warnings: string[] = []; + const origLog = console.log; + console.log = (...args: any[]) => warnings.push(args.join(' ')); + try { + await onPostBuild({ + config: { title: 'Legacy', url: 'https://example.com', plugins: { okf: { generateGraphViewer: true } } }, + pages: [{ + outputPath: 'a.html', + frontmatter: { title: 'A', type: 'guide' }, + sourcePath: '', + rawMarkdown: '# A' + }], + outputDir: tmp2, + log: () => {} + }); + const okfRoot = path.join(tmp2, 'okf'); + await fs.access(path.join(okfRoot, 'graph/index.html')); + assert.ok( + warnings.some(w => /generateGraphViewer.*deprecated/i.test(w)), + `expected deprecation warning, got ${JSON.stringify(warnings)}` + ); + } finally { + console.log = origLog; + await fs.rm(tmp2, { recursive: true, force: true }); + } + }); + + it('uses empty stats when no pages match', async () => { + const tmp3 = await fs.mkdtemp(path.join(os.tmpdir(), 'okf-empty-')); + try { + await onPostBuild({ + config: { title: 'empty', plugins: { okf: {} } }, + pages: [{ outputPath: 'x.html', frontmatter: { noindex: true }, sourcePath: '', rawMarkdown: '' }], + outputDir: tmp3, + log: () => {} + }); + const yaml = await fs.readFile(path.join(tmp3, 'okf', 'okf.yaml'), 'utf8'); + assert.match(yaml, /concepts: 0/); + } finally { + await fs.rm(tmp3, { recursive: true, force: true }); + } + }); +}); \ No newline at end of file diff --git a/packages/plugins/okf/tests/tsconfig.json b/packages/plugins/okf/tests/tsconfig.json new file mode 100644 index 0000000..54fa06d --- /dev/null +++ b/packages/plugins/okf/tests/tsconfig.json @@ -0,0 +1,11 @@ +{ + "extends": "../../../../tsconfig.base.json", + "compilerOptions": { + "rootDir": "..", + "noEmit": true, + "strict": false, + "types": ["node"] + }, + "include": ["../src/**/*", "./**/*"], + "exclude": ["node_modules", "../dist", "../node_modules"] +} \ No newline at end of file diff --git a/packages/plugins/okf/tsconfig.build.json b/packages/plugins/okf/tsconfig.build.json new file mode 100644 index 0000000..73fa2f2 --- /dev/null +++ b/packages/plugins/okf/tsconfig.build.json @@ -0,0 +1,8 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "rootDir": "./src", + "noEmit": false + }, + "include": ["src/**/*"] +} \ No newline at end of file diff --git a/packages/plugins/okf/tsconfig.json b/packages/plugins/okf/tsconfig.json new file mode 100644 index 0000000..697d12f --- /dev/null +++ b/packages/plugins/okf/tsconfig.json @@ -0,0 +1,11 @@ +{ + "extends": "../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "./dist", + "rootDir": ".", + "strict": false, + "noEmit": true + }, + "include": ["src/**/*", "tests/**/*"], + "exclude": ["node_modules", "dist"] +} diff --git a/packages/plugins/openapi/LICENSE b/packages/plugins/openapi/LICENSE new file mode 100644 index 0000000..f4432ba --- /dev/null +++ b/packages/plugins/openapi/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025-present docmd.io + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/plugins/openapi/README.md b/packages/plugins/openapi/README.md new file mode 100644 index 0000000..0ba713b --- /dev/null +++ b/packages/plugins/openapi/README.md @@ -0,0 +1,17 @@ +# @docmd/plugin-openapi + +Render OpenAPI 3.x API reference documentation directly from JSON or YAML spec files inside your Markdown pages at build time. Core plugin, already included in the core. + +```bash +docmd add openapi +``` + +Part of the **[docmd](https://github.com/docmd-io/docmd)** documentation engine. + +## Documentation + +See **[docs.docmd.io](https://docs.docmd.io)** for full usage and API reference. + +## License + +MIT \ No newline at end of file diff --git a/packages/plugins/openapi/build.js b/packages/plugins/openapi/build.js new file mode 100644 index 0000000..61191a9 --- /dev/null +++ b/packages/plugins/openapi/build.js @@ -0,0 +1,32 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/core (and ecosystem) + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + */ + +import fs from 'fs'; +import path from 'path'; +import { fileURLToPath } from 'url'; + +const __dirname = path.dirname(fileURLToPath(import.meta.url)); + +// Ensure dist exists +if (!fs.existsSync(path.join(__dirname, 'dist'))) { + fs.mkdirSync(path.join(__dirname, 'dist')); +} + +// Copy CSS +fs.copyFileSync( + path.join(__dirname, 'src', 'openapi.css'), + path.join(__dirname, 'dist', 'openapi.css') +); + +console.log('OpenAPI assets copied to dist/'); \ No newline at end of file diff --git a/packages/plugins/openapi/package.json b/packages/plugins/openapi/package.json new file mode 100644 index 0000000..260c2f9 --- /dev/null +++ b/packages/plugins/openapi/package.json @@ -0,0 +1,70 @@ +{ + "name": "@docmd/plugin-openapi", + "version": "0.8.12", + "description": "OpenAPI documentation generator plugin for docmd.", + "type": "module", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "exports": { + ".": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + }, + "docmd": { + "key": "openapi", + "kind": "plugin", + "displayName": "OpenAPI", + "tagline": "OpenAPI / Swagger spec rendering for docmd.", + "capabilities": [ + "markdown", + "assets" + ] + }, + "scripts": { + "build": "tsc -p tsconfig.json && node build.js" + }, + "files": [ + "dist" + ], + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@docmd/api": "workspace:*" + }, + "dependencies": { + "@docmd/utils": "workspace:*" + }, + "devDependencies": { + "@docmd/api": "workspace:*", + "@types/node": "^24.13.3" + }, + "keywords": [ + "docmd", + "plugin", + "openapi", + "swagger", + "rest", + "api-docs", + "documentation", + "markdown", + "static-site-generator", + "zero-config", + "docs" + ], + "author": { + "name": "Ghazi", + "url": "https://mgks.dev" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/docmd-io/docmd.git" + }, + "bugs": { + "url": "https://github.com/docmd-io/docmd/issues" + }, + "homepage": "https://docmd.io", + "funding": "https://github.com/sponsors/mgks", + "license": "MIT" +} \ No newline at end of file diff --git a/packages/plugins/openapi/src/index.ts b/packages/plugins/openapi/src/index.ts new file mode 100644 index 0000000..ec4be3f --- /dev/null +++ b/packages/plugins/openapi/src/index.ts @@ -0,0 +1,389 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/core (and ecosystem) + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + */ + +import fs from 'fs'; +import path from 'path'; +import { createRequire } from 'module'; +import { fileURLToPath } from 'url'; +import { safePath, asUserPath } from '@docmd/utils'; +import type { PluginDescriptor } from '@docmd/api'; + +const require = createRequire(import.meta.url); +const __dirname = path.dirname(fileURLToPath(import.meta.url)); + +export const plugin: PluginDescriptor = { + name: 'openapi', + version: '0.8.12', + capabilities: ['markdown', 'assets'] +}; + +// --------------------------------------------------------------------------- +// Types (minimal OpenAPI 3.x subset) +// --------------------------------------------------------------------------- + +interface OASchema { + type?: string; + format?: string; + description?: string; + properties?: Record; + items?: OASchema; + enum?: (string | number)[]; + required?: string[]; + $ref?: string; + example?: unknown; + default?: unknown; + nullable?: boolean; + oneOf?: OASchema[]; + anyOf?: OASchema[]; + allOf?: OASchema[]; +} + +interface OAParameter { + name: string; + in: 'query' | 'path' | 'header' | 'cookie'; + description?: string; + required?: boolean; + schema?: OASchema; + example?: unknown; +} + +interface OAMediaType { + schema?: OASchema; + example?: unknown; +} + +interface OARequestBody { + description?: string; + required?: boolean; + content?: Record; +} + +interface OAResponse { + description?: string; + content?: Record; +} + +interface OAOperation { + operationId?: string; + summary?: string; + description?: string; + tags?: string[]; + parameters?: OAParameter[]; + requestBody?: OARequestBody; + responses?: Record; + deprecated?: boolean; +} + +interface OAPathItem { + get?: OAOperation; + post?: OAOperation; + put?: OAOperation; + patch?: OAOperation; + delete?: OAOperation; + head?: OAOperation; + options?: OAOperation; +} + +interface OASpec { + openapi?: string; + info?: { title?: string; version?: string; description?: string }; + paths?: Record; + components?: { schemas?: Record }; +} + +// --------------------------------------------------------------------------- +// Helpers +// --------------------------------------------------------------------------- + +const HTTP_METHODS = ['get', 'post', 'put', 'patch', 'delete', 'head', 'options'] as const; + +const METHOD_COLORS: Record = { + get: '#10b981', + post: '#3b82f6', + put: '#f59e0b', + patch: '#8b5cf6', + delete: '#ef4444', + head: '#6b7280', + options: '#6b7280' +}; + +function esc(str: string): string { + return String(str) + .replace(/&/g, '&') + .replace(//g, '>') + .replace(/"/g, '"'); +} + +function describe(str: string | undefined, options: any): string { + if (!str) return ''; + return options?.allowRawHtml ? str : esc(str); +} + +/** Resolve a $ref like #/components/schemas/Foo against the spec */ +function resolveRef(ref: string, spec: OASpec): OASchema | null { + if (!ref.startsWith('#/')) return null; + const parts = ref.slice(2).split('/'); + let node: any = spec; + for (const part of parts) { + if (node == null || typeof node !== 'object') return null; + node = node[part]; + } + return node as OASchema | null; +} + +function resolveSchema(schema: OASchema | undefined, spec: OASpec, depth = 0): OASchema { + if (!schema) return {}; + if (schema.$ref) return resolveRef(schema.$ref, spec) || schema; + return schema; +} + +/** Render a schema as a compact type string */ +function typeLabel(schema: OASchema | undefined, spec: OASpec): string { + if (!schema) return 'any'; + const resolved = resolveSchema(schema, spec); + if (resolved.$ref) return resolved.$ref.split('/').pop() || 'object'; + if (resolved.type === 'array') return `array[${typeLabel(resolved.items, spec)}]`; + if (resolved.oneOf) return resolved.oneOf.map(s => typeLabel(s, spec)).join(' | '); + if (resolved.anyOf) return resolved.anyOf.map(s => typeLabel(s, spec)).join(' | '); + if (resolved.enum) return resolved.enum.map(v => `"${v}"`).join(' | '); + return [resolved.type, resolved.format].filter(Boolean).join(':') || 'any'; +} + +/** Render schema properties as an HTML table */ +function renderSchemaTable(schema: OASchema | undefined, spec: OASpec, options: any): string { + if (!schema) return ''; + const resolved = resolveSchema(schema, spec); + const props = resolved.properties; + if (!props || Object.keys(props).length === 0) return ''; + + const required = new Set(resolved.required || []); + const rows = Object.entries(props).map(([name, prop]) => { + const r = resolveSchema(prop, spec); + return ` + ${esc(name)}${required.has(name) ? ' *' : ''} + ${esc(typeLabel(prop, spec))} + ${describe(r.description, options)} + ${r.default !== undefined ? `${esc(String(r.default))}` : ''} + `; + }).join(''); + + return ` + + ${rows} +
      FieldTypeDescriptionDefault
      `; +} + +/** Render a single operation */ +function renderOperation(method: string, path_: string, op: OAOperation, spec: OASpec, options: any): string { + const color = METHOD_COLORS[method] || '#6b7280'; + const deprecated = op.deprecated ? 'DEPRECATED' : ''; + const summaryOnly = options?.summaryOnly === true; + + // Parameters + let paramsHtml = ''; + if (!summaryOnly && op.parameters && op.parameters.length > 0) { + const rows = op.parameters.map(p => { + const r = resolveSchema(p.schema, spec); + return ` + ${esc(p.name)}${p.required ? ' *' : ''} + ${esc(p.in)} + ${esc(typeLabel(p.schema, spec))} + ${describe(p.description, options)} + `; + }).join(''); + paramsHtml = `
      Parameters
      + + + ${rows} +
      NameInTypeDescription
      `; + } + + // Request body + let requestHtml = ''; + if (op.requestBody?.content) { + const entries = Object.entries(op.requestBody.content); + requestHtml = `
      Request Body${op.requestBody.required ? ' *' : ''}
      `; + for (const [contentType, media] of entries) { + requestHtml += `

      ${esc(contentType)}

      `; + requestHtml += renderSchemaTable(media.schema, spec, options); + } + } + + // Responses + let responsesHtml = ''; + if (!summaryOnly && op.responses) { + const statusCodes = Object.entries(op.responses); + const rows = statusCodes.map(([code, resp]) => { + const cls = code.startsWith('2') ? 'oa-status-ok' : code.startsWith('4') ? 'oa-status-err' : 'oa-status-other'; + let schemaInfo = ''; + if (resp.content) { + const firstMedia = Object.values(resp.content)[0]; + if (firstMedia?.schema) schemaInfo = `
      ${esc(typeLabel(firstMedia.schema, spec))}`; + } + return ` + ${esc(code)} + ${describe(resp.description, options)}${schemaInfo} + `; + }).join(''); + responsesHtml = `
      Responses
      + + + ${rows} +
      StatusDescription
      `; + } + + const id = `oa-${method}-${path_.replace(/[^a-z0-9]/gi, '-').toLowerCase()}`; + + return `
      +
      + ${method.toUpperCase()} + ${esc(path_)} + ${deprecated} +
      + ${op.summary ? `

      ${esc(op.summary)}

      ` : ''} + ${op.description ? `

      ${describe(op.description, options)}

      ` : ''} + ${paramsHtml} + ${requestHtml} + ${responsesHtml} +
      `; +} + +/** Parse OpenAPI spec from a file path (JSON or YAML). specPath is validated + * upstream by safePath() in renderSpec(); this function assumes it is safe. */ +function parseSpec(specPath: string): OASpec { + // eslint-disable-next-line docmd/no-unsafe-fs-read -- specPath is validated by safePath() in renderSpec() + const raw = fs.readFileSync(specPath, 'utf8'); + // JSON detection + const trimmed = raw.trimStart(); + if (trimmed.startsWith('{') || trimmed.startsWith('[')) { + return JSON.parse(raw); + } + // Minimal YAML parser for OpenAPI specs (handles the common subset) + // We avoid a full YAML dep by using JSON if possible, otherwise note the limitation + try { + // Try to require js-yaml if available (won't throw at import time since it's optional) + // eslint-disable-next-line @typescript-eslint/no-require-imports + const yaml = require('js-yaml'); + return yaml.load(raw) as OASpec; + } catch { + throw new Error(`OpenAPI plugin: YAML spec at "${specPath}" requires js-yaml to be installed.\nRun: npm install js-yaml`); + } +} + +/** Render full spec as HTML */ +function renderSpec(specPath: string, rootDir: string, options: any): string { + // Phase 1.A: CWE-22 fix (S-2, N-S2). Use safePath() to enforce boundary. + // Absolute paths and ../ traversal are rejected by safePath() (throws). + let absPath: string; + try { + absPath = safePath(rootDir, asUserPath(specPath)); + } catch (_e: any) { + return `
      OpenAPI spec path escapes project root: ${esc(specPath)}
      `; + } + + if (!fs.existsSync(absPath)) { + return `
      OpenAPI spec not found: ${esc(specPath)}
      `; + } + + let spec: OASpec; + try { + spec = parseSpec(absPath); + } catch (e: any) { + return `
      Failed to parse OpenAPI spec: ${esc(String(e.message))}
      `; + } + + const info = spec.info || {}; + let html = `
      `; + + if (options?.info !== false && info.title) { + const downloadLink = options?.download ? `JSON / YAML` : ''; + html += `
      +

      ${esc(info.title)}

      +
      + ${info.version ? `v${esc(info.version)}` : ''} + ${downloadLink} +
      +
      `; + } + if (info.description) { + html += `

      ${describe(info.description, options)}

      `; + } + + if (spec.paths) { + for (const [pathStr, pathItem] of Object.entries(spec.paths)) { + for (const method of HTTP_METHODS) { + const op = pathItem[method]; + if (op) { + html += renderOperation(method, pathStr, op, spec, options); + } + } + } + } + + html += '
      '; + return html; +} + +// --------------------------------------------------------------------------- +// Plugin hooks +// --------------------------------------------------------------------------- + +/** + * Extend markdown-it to handle ```openapi fences. + * Usage in markdown: + * + * ```openapi + * ./path/to/spec.json + * ``` + */ +export function markdownSetup(md: any, options: any): void { + const srcDir: string = options?.config?.src + ? path.resolve(process.cwd(), options.config.src) + : process.cwd(); + + const originalFence = md.renderer.rules.fence || ((tokens: any[], idx: number, opts: any, _env: any, self: any) => self.renderToken(tokens, idx, opts)); + + md.renderer.rules.fence = (tokens: any[], idx: number, opts: any, env: any, self: any) => { + const token = tokens[idx]; + const info = (token.info || '').trim(); + + if (info !== 'openapi') { + return originalFence(tokens, idx, opts, env, self); + } + + const specPath = token.content.trim(); + const pluginOptions = options?.config?.plugins?.openapi || {}; + return renderSpec(specPath, srcDir, pluginOptions); + }; +} + +/** + * Provide OpenAPI CSS asset. + */ +export function getAssets(_options?: any): any[] { + const distCssPath = path.resolve(__dirname, '..', 'dist', 'openapi.css'); + const srcCssPath = path.resolve(__dirname, '..', 'src', 'openapi.css'); + const cssPath = fs.existsSync(distCssPath) ? distCssPath : srcCssPath; + + // Only inject if our bundled CSS exists + if (!fs.existsSync(cssPath)) return []; + + return [{ + src: cssPath, + dest: 'assets/css/docmd-openapi.css', + type: 'css', + location: 'head' + }]; +} diff --git a/packages/plugins/openapi/src/openapi.css b/packages/plugins/openapi/src/openapi.css new file mode 100644 index 0000000..0f5950b --- /dev/null +++ b/packages/plugins/openapi/src/openapi.css @@ -0,0 +1,221 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/core (and ecosystem) + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + */ + +.oa-spec { + margin: 2rem 0; + font-family: var(--font-family-sans, system-ui, -apple-system, sans-serif); +} + +.oa-spec-header { + display: flex; + justify-content: space-between; + align-items: flex-end; + border-bottom: 2px solid var(--border-color, #eee); + padding-bottom: 0.5rem; + margin-bottom: 1.5rem; +} + +.oa-spec-title { + margin: 0; + font-size: 1.75rem; + font-weight: 700; + color: var(--text-heading, #111); +} + +.oa-spec-meta { + display: flex; + gap: 0.75rem; + align-items: center; +} + +.oa-spec-version { + font-size: 0.875rem; + font-weight: 600; + color: var(--text-muted, #666); + background: var(--code-bg, #f3f4f6); + padding: 0.125rem 0.5rem; + border-radius: 9999px; +} + +.oa-download-link { + font-size: 0.75rem; + font-weight: 600; + color: var(--link-color, #3b82f6); + text-decoration: none; + border: 1px solid var(--link-color, #3b82f6); + padding: 0.125rem 0.5rem; + border-radius: 4px; + transition: all 0.2s; +} + +.oa-download-link:hover { + background: var(--link-color, #3b82f6); + color: #fff; +} + +.oa-spec-description { + color: var(--text-muted, #666); + line-height: 1.6; + margin-bottom: 2rem; +} + +.oa-operation { + margin-bottom: 2rem; + border: 1px solid var(--border-color, #eee); + border-radius: 8px; + overflow: hidden; + background: var(--bg-color, #fff); +} + +.oa-operation-header { + display: flex; + align-items: center; + gap: 1rem; + padding: 0.75rem 1rem; + background: var(--code-bg, #f9fafb); + border-bottom: 1px solid var(--border-color, #eee); +} + +.oa-method { + color: #fff; + padding: 0.25rem 0.75rem; + border-radius: 4px; + font-weight: 700; + font-size: 0.75rem; + min-width: 65px; + text-align: center; +} + +.oa-path { + font-weight: 600; + font-family: var(--font-family-mono, monospace); + color: var(--text-heading, #111); +} + +.oa-deprecated { + font-size: 0.7rem; + font-weight: 800; + color: #ef4444; + letter-spacing: 0.05em; +} + +.oa-summary { + padding: 1rem 1rem 0; + margin: 0; + font-weight: 600; + font-size: 1.1rem; + color: var(--text-heading); +} + +.oa-description { + padding: 0.5rem 1rem 1rem; + margin: 0; + color: var(--text-muted, #4b5563); + font-size: 0.95rem; + line-height: 1.5; +} + +.oa-operation h5 { + margin: 1.5rem 1rem 0.5rem; + font-size: 0.8rem; + text-transform: uppercase; + letter-spacing: 0.05em; + color: var(--text-muted, #6b7280); + font-weight: 700; +} + +.oa-content-type { + padding: 0 1rem; + margin: 0.5rem 0; +} + +.oa-content-type code { + font-size: 0.8rem; + background: var(--code-bg); + padding: 0.2rem 0.4rem; + border-radius: 4px; +} + +.oa-schema-table { + width: 100%; + border-collapse: collapse; + margin: 1rem 0 0; /* Margin top only as requested */ + font-size: 0.9rem; +} + +.oa-schema-table th, .oa-schema-table td { + padding: 0.75rem 1rem; + text-align: left; + border-bottom: 1px solid var(--border-color, #eee); +} + +.oa-schema-table th { + background: var(--code-bg, #f9fafb); + font-weight: 600; + color: var(--text-muted, #4b5563); +} + +.oa-required { + color: #ef4444; + margin-left: 0.25rem; +} + +.oa-type { + color: #0891b2; + font-family: var(--font-family-mono, monospace); + font-size: 0.85rem; +} + +.oa-param-in { + font-size: 0.75rem; + background: var(--code-bg, #f3f4f6); + padding: 0.125rem 0.375rem; + border-radius: 4px; + color: var(--text-muted, #4b5563); +} + +.oa-status-badge { + padding: 0.125rem 0.5rem; + border-radius: 4px; + font-weight: 600; + font-size: 0.8rem; +} + +.oa-status-ok { background: #d1fae5; color: #065f46; } +.oa-status-err { background: #fee2e2; color: #991b1b; } +.oa-status-other { background: #f3f4f6; color: #4b5563; } + +/* Dark Mode Overrides */ +:root[data-theme=dark] .oa-type { + color: #22d3ee; +} + +:root[data-theme=dark] .oa-status-ok { background: #065f4633; color: #34d399; } +:root[data-theme=dark] .oa-status-err { background: #991b1b33; color: #f87171; } +:root[data-theme=dark] .oa-status-other { background: #27272a; color: #a1a1aa; } + +.oa-error { + padding: 1rem; + background: #fef2f2; + border: 1px solid #fee2e2; + color: #991b1b; + border-radius: 8px; + margin: 1rem 0; +} + +:root[data-theme=dark] .oa-error { + background: #991b1b22; + border-color: #991b1b44; + color: #f87171; +} \ No newline at end of file diff --git a/packages/plugins/openapi/tsconfig.json b/packages/plugins/openapi/tsconfig.json new file mode 100644 index 0000000..85a5338 --- /dev/null +++ b/packages/plugins/openapi/tsconfig.json @@ -0,0 +1,10 @@ +{ + "extends": "../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "./dist", + "rootDir": "./src", + "strict": true + }, + "include": ["src/**/*"], + "exclude": ["node_modules", "dist", "**/*.test.ts"] +} \ No newline at end of file diff --git a/packages/plugins/pwa/LICENSE b/packages/plugins/pwa/LICENSE new file mode 100644 index 0000000..997bb73 --- /dev/null +++ b/packages/plugins/pwa/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025-present docmd.io + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/packages/plugins/pwa/README.md b/packages/plugins/pwa/README.md new file mode 100644 index 0000000..9948487 --- /dev/null +++ b/packages/plugins/pwa/README.md @@ -0,0 +1,26 @@ +# @docmd/plugin-pwa + +Makes your docmd site installable and offline-capable - generates a web manifest and service worker with intelligent caching and automatic cache busting on every build. Bundled with `@docmd/core`. + +```js +// docmd.config.js - all options are optional +module.exports = { + plugins: { + pwa: { + themeColor: '#0097ff', + bgColor: '#ffffff', + logo: 'assets/images/logo.png' + } + } +}; +``` + +Part of the **[docmd](https://github.com/docmd-io/docmd)** documentation engine. + +## Documentation + +See **[docs.docmd.io](https://docs.docmd.io)** for full usage and API reference. + +## License + +MIT \ No newline at end of file diff --git a/packages/plugins/pwa/package.json b/packages/plugins/pwa/package.json new file mode 100644 index 0000000..e8fb16a --- /dev/null +++ b/packages/plugins/pwa/package.json @@ -0,0 +1,67 @@ +{ + "name": "@docmd/plugin-pwa", + "version": "0.8.12", + "description": "Progressive Web App (PWA) plugin for docmd.", + "type": "module", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "docmd": { + "key": "pwa", + "kind": "plugin", + "displayName": "PWA", + "tagline": "Progressive Web App support for docmd with offline caching.", + "capabilities": [ + "post-build", + "head", + "body" + ] + }, + "scripts": { + "build": "tsc" + }, + "files": [ + "dist" + ], + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@docmd/api": "workspace:*" + }, + "dependencies": { + "@docmd/utils": "workspace:*" + }, + "devDependencies": { + "@docmd/api": "workspace:*", + "@types/node": "^24.13.3" + }, + "keywords": [ + "docmd", + "plugin", + "pwa", + "progressive-web-app", + "service-worker", + "manifest", + "offline", + "markdown", + "minimalist", + "zero-config", + "site-generator", + "static-site-generator", + "docs" + ], + "author": { + "name": "Ghazi", + "url": "https://mgks.dev" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/docmd-io/docmd.git" + }, + "bugs": { + "url": "https://github.com/docmd-io/docmd/issues" + }, + "homepage": "https://docmd.io", + "funding": "https://github.com/sponsors/mgks", + "license": "MIT" +} \ No newline at end of file diff --git a/packages/plugins/pwa/src/index.ts b/packages/plugins/pwa/src/index.ts new file mode 100644 index 0000000..a684614 --- /dev/null +++ b/packages/plugins/pwa/src/index.ts @@ -0,0 +1,197 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/core (and ecosystem) + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + */ + +import fs from 'fs/promises'; +import path from 'path'; +import type { PluginDescriptor } from '@docmd/api'; +import { attrEsc } from '@docmd/utils'; + +export const plugin: PluginDescriptor = { + name: 'pwa', + version: '0.8.12', + capabilities: ['post-build', 'head', 'body'] +}; + +export async function onPostBuild({ config, outputDir, log }: any) { + const pwaConfig = config.plugins?.pwa || {}; + if (pwaConfig.enabled === false) return; // Enabled by default if loaded + + if (log) log('Generating PWA assets'); + + let icons = pwaConfig.icons; + if (!icons) { + let logoUrl = pwaConfig.logo; + if (!logoUrl && config.logo) { + if (typeof config.logo === 'string') logoUrl = config.logo; + else if (config.logo.light) logoUrl = config.logo.light; + } + if (!logoUrl && config.favicon) { + logoUrl = config.favicon; + } + + if (logoUrl) { + const cleanUrl = logoUrl.startsWith('http') ? logoUrl : (logoUrl.startsWith('/') ? logoUrl : `/${logoUrl}`); + icons = [ + { src: cleanUrl, sizes: '192x192', type: 'image/png' }, + { src: cleanUrl, sizes: '512x512', type: 'image/png' } + ]; + } + } + + const manifest: any = { + name: config.title, + short_name: config.title, + description: config.description || 'Documentation generated by docmd', + start_url: './', + display: 'standalone', + background_color: pwaConfig.bgColor || '#ffffff', + theme_color: pwaConfig.themeColor || '#1e293b', + }; + if (icons) manifest.icons = icons; + + await fs.writeFile( + path.join(outputDir, 'manifest.webmanifest'), + JSON.stringify(manifest, null, 2) + ); + + // Generate a basic Service Worker for offline caching + const swContent = ` + const CACHE_NAME = 'docmd-cache-${Date.now()}'; + + self.addEventListener('install', (event) => { + self.skipWaiting(); + }); + + self.addEventListener('activate', (event) => { + event.waitUntil( + caches.keys().then((cacheNames) => { + return Promise.all( + cacheNames.map((cacheName) => { + if (cacheName !== CACHE_NAME && cacheName.startsWith('docmd-cache-')) { + return caches.delete(cacheName); + } + }) + ); + }).then(() => self.clients.claim()) + ); + }); + + self.addEventListener('fetch', (event) => { + if (event.request.method !== 'GET') return; + + event.respondWith( + caches.match(event.request).then((cachedResponse) => { + if (cachedResponse) { + // Return cached, but optionally fetch in background to update cache + fetch(event.request).then(response => { + if(response && response.status === 200 && response.type === 'basic' && !response.redirected) { + const responseToCache = response.clone(); + caches.open(CACHE_NAME).then(cache => { + cache.put(event.request, responseToCache); + }); + } + }).catch(() => {}); + return cachedResponse; + } + + return fetch(event.request).then((response) => { + // Safari WebKit Strict Security Policy: Service Workers cannot blindly use cache.put on redirected streams. + // Rather than returning a 302 (Response.redirect) which triggers loop vulnerabilities in some SPAs, + // we synthesize a literal clone of the stream masking the redirected boolean flag. + let cacheResponse = response.clone(); + let returnResponse = response; + + if (response && response.redirected) { + const clonedStream = response.clone().body; + const headers = new Headers(response.headers); + cacheResponse = new Response(clonedStream, { + headers: headers, + status: response.status, + statusText: response.statusText, + }); + returnResponse = cacheResponse.clone(); + } + + if(!response || response.status !== 200 || response.type !== 'basic') { + return returnResponse; + } + + caches.open(CACHE_NAME) + .then((cache) => { + cache.put(event.request, cacheResponse); + }); + return returnResponse; + }); + }) + ); + }); + `; + + await fs.writeFile( + path.join(outputDir, 'service-worker.js'), + swContent.trim() + ); +} + +export function generateMetaTags(config: any) { + const pwaConfig = config.plugins?.pwa || {}; + if (pwaConfig.enabled === false) return ''; + + // Phase 1.C (S-5 fix): validate themeColor is a real CSS color before + // interpolation. Format: #hex (3/4/6/8 digits), rgb(), rgba(), hsl(), hsla(), + // or a CSS named color. Falls back to default on invalid input. + const DEFAULT_THEME_COLOR = '#1e293b'; + const rawTheme = pwaConfig.themeColor || DEFAULT_THEME_COLOR; + const CSS_COLOR_RE = /^(#[0-9a-fA-F]{3,8}|rgba?\([^)]+\)|hsla?\([^)]+\)|[a-zA-Z]+)$/; + const themeColor = CSS_COLOR_RE.test(rawTheme) ? rawTheme : DEFAULT_THEME_COLOR; + if (rawTheme !== DEFAULT_THEME_COLOR && themeColor === DEFAULT_THEME_COLOR) { + console.error(`[pwa] Invalid themeColor: ${JSON.stringify(rawTheme)}. Falling back to ${DEFAULT_THEME_COLOR}.`); + } + // attrEsc is defence-in-depth: a valid hex color is unaffected, but a payload + // that somehow slipped past the regex still won't break out of the attribute. + + return ` + + + + + +`; +} + +export function generateScripts(config: any) { + const pwaConfig = config.plugins?.pwa || {}; + if (pwaConfig.enabled === false) return {}; + + const swRegistration = ` + + `; + + return { headScriptsHtml: swRegistration }; +} \ No newline at end of file diff --git a/packages/plugins/pwa/tsconfig.json b/packages/plugins/pwa/tsconfig.json new file mode 100644 index 0000000..7befc89 --- /dev/null +++ b/packages/plugins/pwa/tsconfig.json @@ -0,0 +1,10 @@ +{ + "extends": "../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "./dist", + "rootDir": "./src", + "strict": false + }, + "include": ["src/**/*"], + "exclude": ["node_modules", "dist", "**/*.test.ts"] +} \ No newline at end of file diff --git a/packages/plugins/search/LICENSE b/packages/plugins/search/LICENSE new file mode 100644 index 0000000..997bb73 --- /dev/null +++ b/packages/plugins/search/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025-present docmd.io + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/packages/plugins/search/README.md b/packages/plugins/search/README.md new file mode 100644 index 0000000..6ecda03 --- /dev/null +++ b/packages/plugins/search/README.md @@ -0,0 +1,13 @@ +# @docmd/plugin-search + +Offline full-text search for docmd sites - builds a `search-index.json` at compile time, no API keys, no cloud, works in air-gapped environments. Powered by [minisearch](https://github.com/lucaong/minisearch) for fast fuzzy matching. Bundled with `@docmd/core`, enabled by default. + +Part of the **[docmd](https://github.com/docmd-io/docmd)** documentation engine. + +## Documentation + +See **[docs.docmd.io](https://docs.docmd.io)** for full usage and API reference. + +## License + +MIT \ No newline at end of file diff --git a/packages/plugins/search/i18n/en.json b/packages/plugins/search/i18n/en.json new file mode 100644 index 0000000..130d77e --- /dev/null +++ b/packages/plugins/search/i18n/en.json @@ -0,0 +1,10 @@ +{ + "searchPlaceholder": "Search documentation...", + "searchNoResults": "No results found.", + "searchError": "Failed to load search index.", + "searchInitial": "Type to start searching...", + "searchClose": "Close search", + "searchNavigate": "to navigate", + "searchEscape": "to close", + "searchVersionBadge": "v{version}" +} \ No newline at end of file diff --git a/packages/plugins/search/i18n/hi.json b/packages/plugins/search/i18n/hi.json new file mode 100644 index 0000000..4332c5d --- /dev/null +++ b/packages/plugins/search/i18n/hi.json @@ -0,0 +1,10 @@ +{ + "searchPlaceholder": "เคฆเคธเฅเคคเคพเคตเฅ‡เคœเคผ เค–เฅ‹เคœเฅ‡เค‚...", + "searchNoResults": "เค•เฅ‹เคˆ เคชเคฐเคฟเคฃเคพเคฎ เคจเคนเฅ€เค‚ เคฎเคฟเคฒเคพเฅค", + "searchError": "เค–เฅ‹เคœ เค…เคจเฅเค•เฅเคฐเคฎเคฃเคฟเค•เคพ เคฒเฅ‹เคก เค•เคฐเคจเฅ‡ เคฎเฅ‡เค‚ เคตเคฟเคซเคฒเฅค", + "searchInitial": "เค–เฅ‹เคœเคจเฅ‡ เค•เฅ‡ เคฒเคฟเค เคŸเคพเค‡เคช เค•เคฐเฅ‡เค‚...", + "searchClose": "เค–เฅ‹เคœ เคฌเค‚เคฆ เค•เคฐเฅ‡เค‚", + "searchNavigate": "เคจเฅ‡เคตเคฟเค—เฅ‡เคŸ เค•เคฐเฅ‡เค‚", + "searchEscape": "เคฌเค‚เคฆ เค•เคฐเฅ‡เค‚", + "searchVersionBadge": "v{version}" +} \ No newline at end of file diff --git a/packages/plugins/search/i18n/ko.json b/packages/plugins/search/i18n/ko.json new file mode 100644 index 0000000..d668183 --- /dev/null +++ b/packages/plugins/search/i18n/ko.json @@ -0,0 +1,10 @@ +{ + "searchPlaceholder": "๋ฌธ์„œ ๊ฒ€์ƒ‰...", + "searchNoResults": "๊ฒ€์ƒ‰ ๊ฒฐ๊ณผ๊ฐ€ ์—†์Šต๋‹ˆ๋‹ค.", + "searchError": "๊ฒ€์ƒ‰ ์ƒ‰์ธ์„ ๋ถˆ๋Ÿฌ์˜ค์ง€ ๋ชปํ–ˆ์Šต๋‹ˆ๋‹ค.", + "searchInitial": "๊ฒ€์ƒ‰์–ด๋ฅผ ์ž…๋ ฅํ•˜์„ธ์š”...", + "searchClose": "๊ฒ€์ƒ‰ ๋‹ซ๊ธฐ", + "searchNavigate": "์ด๋™", + "searchEscape": "๋‹ซ๊ธฐ", + "searchVersionBadge": "v{version}" +} diff --git a/packages/plugins/search/i18n/zh.json b/packages/plugins/search/i18n/zh.json new file mode 100644 index 0000000..17b4480 --- /dev/null +++ b/packages/plugins/search/i18n/zh.json @@ -0,0 +1,10 @@ +{ + "searchPlaceholder": "ๆœ็ดขๆ–‡ๆกฃ...", + "searchNoResults": "ๆœชๆ‰พๅˆฐ็ป“ๆžœใ€‚", + "searchError": "ๆ— ๆณ•ๅŠ ่ฝฝๆœ็ดข็ดขๅผ•ใ€‚", + "searchInitial": "่พ“ๅ…ฅๅผ€ๅง‹ๆœ็ดข...", + "searchClose": "ๅ…ณ้—ญๆœ็ดข", + "searchNavigate": "ๅฏผ่ˆช", + "searchEscape": "ๅ…ณ้—ญ", + "searchVersionBadge": "v{version}" +} \ No newline at end of file diff --git a/packages/plugins/search/package.json b/packages/plugins/search/package.json new file mode 100644 index 0000000..30f2278 --- /dev/null +++ b/packages/plugins/search/package.json @@ -0,0 +1,79 @@ +{ + "name": "@docmd/plugin-search", + "version": "0.8.12", + "description": "Offline full-text search for docmd.", + "type": "module", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "docmd": { + "key": "search", + "kind": "plugin", + "displayName": "Search", + "tagline": "Offline full-text search for docmd.", + "capabilities": [ + "post-build", + "init", + "head", + "body", + "assets", + "translations" + ] + }, + "scripts": { + "build": "tsc && esbuild src/client.ts --bundle --outfile=dist/docmd-search.js --format=esm --platform=browser --minify" + }, + "files": [ + "dist", + "i18n" + ], + "engines": { + "node": ">=18" + }, + "dependencies": { + "markdown-it": "^14.3.0", + "minisearch": "^7.2.0" + }, + "peerDependencies": { + "docmd-search": ">=0.1.0" + }, + "peerDependenciesMeta": { + "docmd-search": { + "optional": true + } + }, + "devDependencies": { + "@docmd/api": "workspace:*", + "@types/markdown-it": "^14.1.2", + "@types/node": "^24.13.3", + "esbuild": "^0.28.1" + }, + "keywords": [ + "docmd", + "plugin", + "search", + "minisearch", + "offline", + "indexing", + "keyword-matching", + "markdown", + "minimalist", + "zero-config", + "site-generator", + "static-site-generator", + "docs" + ], + "author": { + "name": "Ghazi", + "url": "https://mgks.dev" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/docmd-io/docmd.git" + }, + "bugs": { + "url": "https://github.com/docmd-io/docmd/issues" + }, + "homepage": "https://docmd.io", + "funding": "https://github.com/sponsors/mgks", + "license": "MIT" +} \ No newline at end of file diff --git a/packages/plugins/search/src/client.ts b/packages/plugins/search/src/client.ts new file mode 100644 index 0000000..008cc00 --- /dev/null +++ b/packages/plugins/search/src/client.ts @@ -0,0 +1,386 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/core (and ecosystem) + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + */ + +import * as SemanticSearch from './semantic-client.js'; + +export {}; + +declare global { + interface Window { + DOCMD_SITE_ROOT?: string; + DOCMD_ROOT?: string; + lastFocusedElement?: HTMLElement | null; + closeDocmdSearch?: () => void; + } +} +declare const MiniSearch: any; + +(function () { + let miniSearch: any = null; + let isSemanticMode = false; // Track if semantic search is active + let isIndexLoaded = false; + let selectedIndex = -1; + const activeVersionFilters = new Set(); + let globalAllVersions: string[] = []; + const globalVersionColors: Record = {}; + + function initSearch() { + const searchModal = document.getElementById('docmd-search-modal') as HTMLElement; + const searchInput = document.getElementById('docmd-search-input') as HTMLInputElement; + const searchResults = document.getElementById('docmd-search-results') as HTMLElement; + + if (!searchModal || !searchInput || !searchResults) return; + + // showFilters: hide version filter bar when explicitly set to false + const showFilters = searchModal.dataset.showFilters !== 'false'; + + // Read translated strings from data attributes (injected server-side per locale) + const strings = { + initial: searchModal.dataset.searchInitial || 'Type to start searching...', + noResults: searchModal.dataset.searchNoResults || 'No results found.', + error: searchModal.dataset.searchError || 'Failed to load search index.' + }; + + // Use Site Root if available (for versioning), fallback to Context Root + const rawRoot = window.DOCMD_SITE_ROOT || window.DOCMD_ROOT || './'; + let ROOT_PATH = new URL(rawRoot, window.location.href).href; + if (!ROOT_PATH.endsWith('/')) ROOT_PATH += '/'; + + // Determine the locale-specific search index path. + // The index lives alongside the locale's HTML files: + // default locale: /search-index.json + // non-default: /hi/search-index.json + // Since ROOT_PATH already resolves to the correct locale root + // (e.g. https://docs.example.com/ or https://docs.example.com/hi/), + // we can simply append search-index.json to it. + // However, we need to detect our locale prefix from the current URL + // and build the fetch path relative to the site base. + const siteBase = (window.DOCMD_SITE_ROOT || window.DOCMD_ROOT || '/').replace(/\/$/, '') + '/'; + const currentPath = window.location.pathname; + + // Extract locale prefix from current URL path + // If URL is /hi/content/steps and base is /, locale prefix is "hi/" + const pathAfterBase = currentPath.startsWith(siteBase) + ? currentPath.slice(siteBase.length) + : currentPath.replace(/^\//, ''); + const firstSegment = pathAfterBase.split('/')[0]; + + // Check if the first segment looks like a locale (2-3 letter code) + // by checking the meta tag that the engine injects + const hreflangLinks = document.querySelectorAll('link[hreflang]'); + const knownLocales = new Set(); + hreflangLinks.forEach(link => { + const lang = link.getAttribute('hreflang'); + if (lang && lang !== 'x-default') knownLocales.add(lang); + }); + + const localePrefix = knownLocales.has(firstSegment) ? firstSegment + '/' : ''; + const baseUrl = new URL(siteBase, window.location.href).href; + const searchIndexUrl = baseUrl + localePrefix + 'search-index.json'; + + function escapeHtml(str: any): string { + const s = typeof str === 'string' ? str : String(str || ''); + return s.replace(/[&<>"']/g, m => ({ + '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' + })[m] as string); + } + + function getSnippet(text: string | undefined, query: string): string { + if (!text) return ''; + const terms = query.split(/\s+/).filter(t => t.length > 2); + let bestIndex = -1; + for (const term of terms) { + const idx = text.toLowerCase().indexOf(term.toLowerCase()); + if (idx >= 0) { bestIndex = idx; break; } + } + const start = Math.max(0, bestIndex - 60); + const end = Math.min(text.length, bestIndex + 60); + let snippet = text.substring(start, end); + if (start > 0) snippet = '...' + snippet; + if (end < text.length) snippet += '...'; + + snippet = escapeHtml(snippet); + + // Then apply highlighting marks (escape terms to match escaped snippet) + const safeTerms = terms.map(t => escapeHtml(t).replace(/[.*+?^${}()|[\]\\]/g, '\\$&')).join('|'); + if (safeTerms) { + snippet = snippet.replace(new RegExp(`(${safeTerms})`, 'gi'), '$1'); + } + return snippet; + } + + // 1. Open/Close Logic + function openSearch() { + searchModal.style.display = 'flex'; + window.lastFocusedElement = document.activeElement as HTMLElement | null; + setTimeout(() => searchInput.focus(), 50); + + if (!searchInput.value.trim()) { + const sanitized = `
      ${escapeHtml(strings.initial)}
      `; + searchResults.innerHTML = sanitized; + selectedIndex = -1; + } + if (!isIndexLoaded) loadIndex(); + } + + function closeSearch() { + searchModal.style.display = 'none'; + if (window.lastFocusedElement) window.lastFocusedElement.focus(); + selectedIndex = -1; + } + + // --- Event Delegation for Triggers (Survives SPA) --- + document.addEventListener('click', (e) => { + const target = e.target as HTMLElement | null; + if (target?.closest('.docmd-search-trigger')) { + e.preventDefault(); + openSearch(); + } + if (target === searchModal || target?.closest('.docmd-search-close')) { + closeSearch(); + } + }); + + // 2. Keyboard Navigation + document.addEventListener('keydown', (e) => { + if ((e.metaKey || e.ctrlKey) && e.key === 'k') { + e.preventDefault(); + searchModal.style.display === 'flex' ? closeSearch() : openSearch(); + } + + if (searchModal.style.display === 'flex') { + const items = searchResults.querySelectorAll('.search-result-item') as NodeListOf; + if (e.key === 'Escape') { e.preventDefault(); closeSearch(); } + else if (e.key === 'ArrowDown') { e.preventDefault(); if (items.length) { selectedIndex = (selectedIndex + 1) % items.length; updateSelection(items); } } + else if (e.key === 'ArrowUp') { e.preventDefault(); if (items.length) { selectedIndex = (selectedIndex - 1 + items.length) % items.length; updateSelection(items); } } + else if (e.key === 'Enter') { + e.preventDefault(); + if (selectedIndex >= 0 && items[selectedIndex]) items[selectedIndex].click(); + else if (items.length > 0) items[0].click(); + } + } + }); + + function updateSelection(items: NodeListOf) { + items.forEach((item, idx) => { + item.classList.toggle('selected', idx === selectedIndex); + if (idx === selectedIndex) item.scrollIntoView({ block: 'nearest' }); + }); + } + + // 3. Index Loading - fetches locale-specific index + async function loadIndex() { + // Auto-detect semantic search at runtime. We check BOTH: + // - The build-time hint (data-semantic="true") โ€” set when the + // build pipeline knew semantic was available at render time. + // - A runtime probe (HEAD request to manifest.json) โ€” catches + // the first-build case where deps were installed in onPostBuild + // (after generateScripts already rendered the page without + // data-semantic). The probe is a single network round-trip + // that only runs once per page load, so there's no perf cost. + const hasBuildHint = searchModal.dataset.semantic === 'true'; + let useSemantic = hasBuildHint; + + if (!useSemantic) { + try { + const probe = await fetch(`${siteBase}.docmd-search/manifest.json`, { method: 'HEAD' }); + if (probe.ok) useSemantic = true; + } catch { /* no index โ†’ keyword */ } + } + + try { + if (useSemantic) { + // โ”€โ”€ Semantic search path โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ + const ctx: SemanticSearch.SemanticSearchContext = { + siteBase, + ROOT_PATH, + searchResults, + strings, + activeVersionFilters, + globalAllVersions, + globalVersionColors, + selectedIndex, + updateSelection, + showConfidence: searchModal.dataset.showConfidence === 'true' + }; + + await SemanticSearch.loadSemanticIndex(ctx); + + // Render version filters if versions were loaded and filters are enabled + if (globalAllVersions.length > 0 && showFilters) { + renderGlobalFilters(); + } + + isSemanticMode = true; + isIndexLoaded = true; + if (searchInput.value.trim()) searchInput.dispatchEvent(new Event('input')); + return; + } + + // โ”€โ”€ Keyword search path (default) โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ + const response = await fetch(searchIndexUrl); + if (response.headers.get("content-type")?.includes("text/html")) throw new Error("Invalid content type"); + if (!response.ok) throw new Error(String(response.status)); + + const jsonString = await response.text(); + const indexData = JSON.parse(jsonString); + + // Extract all versions globally from the raw MiniSearch index data + const docs = indexData.storedFields || {}; + globalAllVersions = [...new Set(Object.values(docs).map((d: any) => d.version).filter(Boolean))] as string[]; + globalAllVersions.sort(); + + const huePresets = [210, 150, 30, 330, 270, 60, 180, 0]; + globalAllVersions.forEach((v, i) => { + const hue = huePresets[i % huePresets.length]; + globalVersionColors[v] = { bg: `hsl(${hue}, 55%, 92%)`, fg: `hsl(${hue}, 60%, 35%)` }; + }); + + const CJK_AND_SPACELESS_REGEX = /[\u3040-\u30ff\u3400-\u4dbf\u4e00-\u9fff\uf900-\ufaff\uff66-\uff9f\uac00-\ud7af\u1100-\u11ff\u3130-\u318f\u0e00-\u0e7f\u0e80-\u0eff\u1780-\u17ff\u1000-\u109f\u0f00-\u0fff]/g; + miniSearch = MiniSearch.loadJSON(jsonString, { + fields: ['title', 'headings', 'text'], + storeFields: ['title', 'id', 'text', 'version'], + tokenize: (text: string) => { + const spaced = text.replace(CJK_AND_SPACELESS_REGEX, ' $& '); + const defaultTokenize = MiniSearch.getDefault ? MiniSearch.getDefault('tokenize') : null; + return defaultTokenize ? defaultTokenize(spaced) : spaced.toLowerCase().split(/[^a-zA-Z0-9_'\u00C0-\u017F\u00d0\u00f0\u00df\u00f8\u00e6\u0153\u03ac-\u03ce\u0400-\u04ff]+/u).filter(Boolean); + }, + searchOptions: { fuzzy: 0.2, prefix: true, boost: { title: 2, headings: 1.5 } } + }); + + console.log('[docmd-search] Index loaded. Versions found:', globalAllVersions.length); + if (globalAllVersions.length > 0 && showFilters) { + renderGlobalFilters(); + } + isIndexLoaded = true; + if (searchInput.value.trim()) searchInput.dispatchEvent(new Event('input')); + } catch { + const sanitized = `
      ${escapeHtml(strings.error)}
      `; + searchResults.innerHTML = sanitized; + } + } + + function renderGlobalFilters() { + if (globalAllVersions.length === 0 || !showFilters) return; + let filterContainer = document.getElementById('docmd-global-search-filters'); + if (!filterContainer) { + filterContainer = document.createElement('div'); + filterContainer.id = 'docmd-global-search-filters'; + filterContainer.style.cssText = 'padding: 12px 20px 8px 20px; border-bottom: 1px solid var(--docmd-border); display: flex; flex-wrap: wrap; gap: 8px;'; + searchResults.parentNode?.insertBefore(filterContainer, searchResults); + } + + const sanitized = globalAllVersions.map(v => { + const vc = globalVersionColors[v]; + const isActive = activeVersionFilters.has(v); + const icon = isActive + ? `` + : ``; + return ` + ${icon} ${escapeHtml(v)} + `; + }).join(''); + filterContainer.innerHTML = sanitized; + + filterContainer.querySelectorAll('.search-filter-tag').forEach(tag => { + tag.addEventListener('click', (e) => { + e.preventDefault(); + e.stopPropagation(); + const v = (tag as HTMLElement).dataset.version!; + if (activeVersionFilters.has(v)) activeVersionFilters.delete(v); + else activeVersionFilters.add(v); + renderGlobalFilters(); + if (searchInput.value.trim()) searchInput.dispatchEvent(new Event('input')); + }); + }); + } + + searchInput.addEventListener('input', (e) => { + const query = (e.target as HTMLInputElement).value.trim(); + selectedIndex = -1; + if (!query) { + const sanitized = `
      ${escapeHtml(strings.initial)}
      `; + searchResults.innerHTML = sanitized; + return; + } + if (!isIndexLoaded) return; + + // โ”€โ”€ Semantic mode โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ + if (isSemanticMode) { + const ctx: SemanticSearch.SemanticSearchContext = { + siteBase, + ROOT_PATH, + searchResults, + strings, + activeVersionFilters, + globalAllVersions, + globalVersionColors, + selectedIndex, + updateSelection, + showConfidence: searchModal.dataset.showConfidence === 'true' + }; + SemanticSearch.performSemanticSearch(query, ctx); + return; + } + + // โ”€โ”€ Keyword mode (MiniSearch) โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ + let results = miniSearch.search(query); + + if (activeVersionFilters.size > 0) { + results = results.filter((r: any) => activeVersionFilters.has(r.version)); + } + + if (results.length === 0) { + const sanitized = `
      ${activeVersionFilters.size > 0 ? 'No results match the selected filters.' : escapeHtml(strings.noResults)}
      `; + searchResults.innerHTML = sanitized; + return; + } + + const sanitized = results.slice(0, 10).map((result: any, index: number) => { + const snippet = getSnippet(result.text, query); + // Strip leading slash to avoid double-slash when concatenating with ROOT_PATH + const cleanId = result.id.startsWith('/') ? result.id.slice(1) : result.id; + // Sanitize: collapse any accidental double slashes (except after protocol) + const linkHref = `${ROOT_PATH}${cleanId}`.replace(/([^:])\/\/+/g, '$1/'); + const vc = result.version ? globalVersionColors[result.version] : null; + const versionBadge = result.version + ? `
      ${escapeHtml(result.version)}
      ` + : ''; + return ` + +
      ${escapeHtml(result.title)}${versionBadge}
      +
      ${snippet}
      +
      `; + }).join(''); + searchResults.innerHTML = sanitized; + + searchResults.querySelectorAll('.search-result-item').forEach((item, idx) => { + item.addEventListener('mouseenter', () => { selectedIndex = idx; updateSelection(searchResults.querySelectorAll('.search-result-item') as NodeListOf); }); + }); + }); + + // Close search when clicking a link (Important for SPA!) + searchResults.addEventListener('click', (e) => { + if ((e.target as HTMLElement).closest('.search-result-item')) closeSearch(); + }); + + window.closeDocmdSearch = closeSearch; + } + + if (document.readyState === 'loading') { + document.addEventListener('DOMContentLoaded', initSearch); + } else { + initSearch(); + } +})(); \ No newline at end of file diff --git a/packages/plugins/search/src/index.ts b/packages/plugins/search/src/index.ts new file mode 100644 index 0000000..03db95c --- /dev/null +++ b/packages/plugins/search/src/index.ts @@ -0,0 +1,1051 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/core (and ecosystem) + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + */ + +import path from 'path'; +import fs from 'fs/promises'; +import nativeFs from 'fs'; +import MiniSearch from 'minisearch'; +import MarkdownIt from 'markdown-it'; +import { fileURLToPath } from 'url'; +import { createRequire } from 'module'; +import type { PluginDescriptor } from '@docmd/api'; +import { outputPathToSlug, sanitizeUrl } from '@docmd/api'; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); +const require = createRequire(import.meta.url); + +export const plugin: PluginDescriptor = { + name: 'search', + version: '0.8.12', + // `init` lets onConfigResolved run at config-parse time โ€” that's where we + // compute the single `searchConfig` object. The build pipeline reads + // it from `config._searchConfig` everywhere else, so there's exactly + // one source of truth for "is semantic available at build time". + capabilities: ['post-build', 'init', 'head', 'body', 'assets', 'translations'] +}; + +// Resolve i18n directory (sibling to dist/ in the package) +const i18nDir = path.resolve(__dirname, '..', 'i18n'); + +/* โ”€โ”€ Search config (computed once at onConfigResolved) โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ */ + +/** + * Resolved search configuration. Computed once per build, in + * `onConfigResolved`, and stamped on `config._searchConfig`. Every + * subsequent hook (`onPostBuild`, `getAssets`, `generateScripts`, + * EJS templates via the page context) reads from this same object โ€” + * no second source of truth, no chance of the `getAssets` and the + * `generateScripts` paths disagreeing about whether semantic is + * available. The shape is the contract for the search-modal EJS + * partial too: every key on this object is exposed to the template + * via `locals.searchConfig`. + */ +type SearchConfig = { + /** User has not opted out of search entirely (optionsMenu / config.search). */ + enabled: boolean; + /** User has explicitly requested semantic search in their config. */ + semanticRequested: boolean; + /** docmd-search is resolvable in the user's project. */ + docmdSearchInstalled: boolean; + /** All peer deps (transformers + onnxruntime-node) are resolvable. */ + peersInstalled: boolean; + /** True only when all three of the above are true โ€” that's when the modal + * emits `data-semantic="true"`, the .docmd-search-client.js asset ships, + * and the page points users at the semantic index. */ + semanticUsable: boolean; + /** The exact names of any peer deps that are missing. Empty when + * `peersInstalled` is true. Useful for the TUI: "Missing: transformers, onnxruntime-node". */ + missingPeers: string[]; + /** Stable list of peer-dep package names. Exposed so the TUI can emit + * per-dep `[ DONE ] @huggingface/transformers` lines without + * hard-coding the names in two places. */ + peerDeps: readonly string[]; +}; + +/** + * Module-level state. Reset on every `onConfigResolved` call so a + * dev-server rebuild starts fresh. Currently tracks: + * + * - `lastPeersHash` โ€” when the set of "missing peer deps" is + * identical to the previous build, we DON'T re-emit the + * "[ DONE ] Peer X ready" lines. The user only sees them on the + * first build (or the first build after a new dep becomes missing). + * This is the difference between "informative on first install" and + * "spammy on every rebuild". + */ +const _searchState: { + lastPeersHash: string | null; + lastConfig: SearchConfig | null; +} = { lastPeersHash: null, lastConfig: null }; + +/** + * Compute the full SearchConfig from the resolved config + filesystem. + * Idempotent โ€” called once at `onConfigResolved` and again inside + * `onPostBuild` if a fresh install was performed. Pure: no I/O + * outside of `require.resolve` and `resolveDocmdSearch`. + */ +function buildSearchConfig(config: any): SearchConfig { + const isEnabled = config.optionsMenu + ? config.optionsMenu.components.search !== false + : config.search !== false; + const pluginOptions = (config.plugins && config.plugins.search) || {}; + const semanticRequested = pluginOptions.semantic === true; + const docmdSearchInstalled = resolveDocmdSearch() !== null; + const resolvePaths = [process.cwd(), path.join(process.cwd(), 'node_modules')]; + + // List every peer dep and which are missing, in stable order. + const missingPeers: string[] = []; + for (const pkg of PEER_DEPS) { + try { require.resolve(pkg, { paths: resolvePaths }); } + catch { missingPeers.push(pkg); } + } + const peersInstalled = missingPeers.length === 0; + const semanticUsable = semanticRequested && docmdSearchInstalled && peersInstalled; + + return { + enabled: isEnabled, + semanticRequested, + docmdSearchInstalled, + peersInstalled, + semanticUsable, + missingPeers, + peerDeps: PEER_DEPS, + }; +} + +/** Hash used to decide whether to re-emit the peer-deps TUI block. */ +function peersHash(sc: SearchConfig): string { + return sc.peersInstalled ? 'ok' : 'missing:' + sc.missingPeers.join(','); +} + +/* โ”€โ”€ Semantic search peer-dep detection โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ */ + +/** + * Check if docmd-search is available (installed as a peer/optional dep). + * Returns the importable path (file:// URL) or null if not found. + */ +function resolveDocmdSearch(): string | null { + // #163 (deeper fix): previously this walked `__dirname` and two parent + // directories, which let `docmd-search` resolve into the monorepo's + // own node_modules when the user runs the binary through a pnpm/npm + // symlink. The plugin then thought the user's project had it installed, + // silently skipped the peer-dep install, and fell back to keyword + // search with a misleading message. We now scope resolution to the + // user's project only โ€” `process.cwd()/node_modules`. The monorepo's + // own dev workflow goes through the workspace test runner, which has + // its own module-resolution context. + const searchPaths = [ + process.cwd(), + path.join(process.cwd(), 'node_modules') + ]; + + // First, locate the package via its `./package.json` subpath export. + // This works regardless of the main `exports` conditions because the + // subpath is explicitly declared in the package manifest. + let pkgDir: string | null = null; + try { + const pkgPath = require.resolve('docmd-search/package.json', { paths: searchPaths }); + pkgDir = path.dirname(pkgPath); + } catch { + // Fallback: walk the search paths manually. This is a defensive + // backstop in case the `./package.json` subpath export is ever + // removed or the package is installed in a layout require.resolve + // does not understand (e.g. pnpm's isolated node_modules). + for (const root of searchPaths) { + const candidate = path.join(root, 'node_modules', 'docmd-search', 'package.json'); + if (nativeFs.existsSync(candidate)) { + pkgDir = path.dirname(candidate); + break; + } + } + } + + if (!pkgDir) return null; + + try { + // Read package.json to find the main entry point. We accept the + // first present condition of `exports["."]` in this order: `import`, + // `default`, `require`, then fall back to `main`. This keeps us + // working even if the package declares only `import` (ESM-only). + const pkg = JSON.parse(nativeFs.readFileSync(path.join(pkgDir, 'package.json'), 'utf8')); + const exp = pkg.exports?.['.']; + const mainEntry = + (exp && (exp.import || exp.default || exp.require)) || + pkg.main || + 'dist/index.js'; + const entryPath = path.join(pkgDir, mainEntry); + // Return as file:// URL for ESM dynamic import + return `file://${entryPath}`; + } catch { + return null; + } +} + +/** + * Detect the package manager used in the current project. + */ +function detectPackageManager(cwd: string): 'pnpm' | 'yarn' | 'bun' | 'npm' { + let dir = cwd; + while (dir !== path.parse(dir).root) { + if (nativeFs.existsSync(path.join(dir, 'pnpm-lock.yaml'))) return 'pnpm'; + if (nativeFs.existsSync(path.join(dir, 'yarn.lock'))) return 'yarn'; + if (nativeFs.existsSync(path.join(dir, 'bun.lockb'))) return 'bun'; + if (nativeFs.existsSync(path.join(dir, 'package-lock.json'))) return 'npm'; + dir = path.dirname(dir); + } + return 'npm'; +} + +/** + * Get the latest non-deprecated version of docmd-search from npm. + * Falls back to 'latest' tag if fetch fails. + */ +async function getLatestDocmdSearchVersion(): Promise { + try { + const { execSync } = await import('node:child_process'); + const result = execSync('npm view docmd-search version --json', { + encoding: 'utf-8', + timeout: 10000 + }); + const version = JSON.parse(result.trim()); + return version || 'latest'; + } catch { + return 'latest'; + } +} + +/** + * docmd-search requires peer dependencies for embedding: + * - @huggingface/transformers: the ML model runtime + * - onnxruntime-node: ONNX backend for Node.js + */ +const PEER_DEPS = ['@huggingface/transformers@^4.0.0', 'onnxruntime-node@^1.20.0']; + +/** + * Build the install command for the current package manager. When + * `extraPackages` is non-empty, those are added alongside `peerDeps` so + * docmd-search can be installed together with its peers in one shot. + */ +function buildInstallCmd(cwd: string, pkgManager: string, extraPackages: string[] = []): string { + const all = [...extraPackages, ...PEER_DEPS]; + switch (pkgManager) { + case 'pnpm': return `pnpm add ${all.join(' ')}`; + case 'yarn': return `yarn add ${all.join(' ')}`; + case 'bun': return `bun add ${all.join(' ')}`; + default: + // --foreground-scripts ensures postinstall scripts (e.g. onnxruntime-node + // binary download) run even in CI environments where npm's allow-scripts + // security feature would otherwise block them. + return `npm install --foreground-scripts ${all.join(' ')}`; + } +} + +/** + * Auto-install docmd-search package along with its peer dependencies. + * Installs the latest stable version from npm. + */ +async function autoInstallDocmdSearch(tui: any, quiet: boolean): Promise { + const cwd = process.cwd(); + const pkgManager = detectPackageManager(cwd); + + if (!quiet && tui) { + tui.step('Fetching latest docmd-search version', 'WAIT'); + } + + const version = await getLatestDocmdSearchVersion(); + const versionedPackage = version === 'latest' ? 'docmd-search' : `docmd-search@${version}`; + + if (!quiet && tui) { + tui.step(`Installing ${versionedPackage} with peer dependencies`, 'WAIT'); + } + + return runInstall(tui, quiet, cwd, pkgManager, buildInstallCmd(cwd, pkgManager, [versionedPackage]), + 'docmd-search installed successfully', + 'Failed to install docmd-search', + 'Could not auto-install docmd-search. Please install manually:\n' + + ' npm install docmd-search @huggingface/transformers onnxruntime-node\n' + + 'Or disable semantic search: plugins: { search: { semantic: false } }' + ); +} + +/** + * Auto-install just the peer dependencies. Used when docmd-search is + * already present but `@huggingface/transformers` or `onnxruntime-node` + * is missing โ€” previously the plugin only warned and fell back to + * keyword search (#163, partial fix). + */ +async function installPeerDeps(tui: any, quiet: boolean): Promise { + const cwd = process.cwd(); + const pkgManager = detectPackageManager(cwd); + + if (!quiet && tui) { + tui.step('Installing missing peer dependencies', 'WAIT'); + } + + return runInstall(tui, quiet, cwd, pkgManager, buildInstallCmd(cwd, pkgManager), + 'Peer dependencies installed', + 'Failed to install peer dependencies', + 'Could not auto-install peer dependencies. Please install manually:\n' + + ' npm install @huggingface/transformers onnxruntime-node\n' + + 'Or disable semantic search: plugins: { search: { semantic: false } }' + ); +} + +/** + * Run a package-manager install command. Centralised so the two + * auto-install paths (full docmd-search, peer-only) share error + * handling and timeout. + */ +async function runInstall( + tui: any, quiet: boolean, cwd: string, pkgManager: string, + cmd: string, successLabel: string, failLabel: string, manualHint: string +): Promise { + try { + const { execSync } = await import('node:child_process'); + execSync(cmd, { stdio: 'pipe', cwd, timeout: 180000 }); + if (!quiet && tui) tui.step(successLabel, 'DONE'); + return true; + } catch (err: any) { + if (!quiet && tui) { + tui.step(failLabel, 'FAIL'); + tui.warn(` ${manualHint}`); + } else { + console.warn(`[plugin-search] ${manualHint}`); + } + return false; + } +} + +/** + * Check whether the peer dependencies required for embedding are resolvable. + * Returns the first missing package name, or null if all present. + */ +function findMissingPeerDep(resolvePaths: string[]): string | null { + for (const pkg of ['@huggingface/transformers', 'onnxruntime-node']) { + try { + require.resolve(pkg, { paths: resolvePaths }); + } catch { + return pkg; + } + } + return null; +} + +/** + * Ensure docmd-search is installed when semantic: true is requested. + * If missing, attempts to auto-install the latest version. If peers are + * missing but docmd-search itself is present, auto-installs just the + * peers (#163 partial fix: previously it warned and fell back to keyword + * search, leaving the project in a broken state). + * + * Returns: + * { ready: true, freshInstall: false, reason: 'present' } + * โ€” already installed (docmd-search + peers), proceed normally. + * { ready: true, freshInstall: true, reason: 'docmd-search' | 'peers' } + * โ€” just installed; caller must re-exec indexing in a child process + * because Node's module cache won't see the new packages. + * { ready: false, freshInstall: false, reason: '' } + * โ€” install failed; caller falls back to keyword search and shows the + * actual reason (e.g. 'docmd-search' or 'peers') in the message. + */ +async function ensureDocmdSearch(tui: any, quiet: boolean): Promise<{ ready: boolean; freshInstall: boolean; reason: string }> { + const resolvePaths = [process.cwd(), path.join(process.cwd(), 'node_modules')]; + + // Already installed โ€” verify peers too. + if (resolveDocmdSearch()) { + const missingPeer = findMissingPeerDep(resolvePaths); + if (missingPeer) { + // Auto-install just the peers (was: just warn and give up). + const installed = await installPeerDeps(tui, quiet); + if (!installed) return { ready: false, freshInstall: false, reason: 'peers' }; + // Verify peers resolved after install. + if (findMissingPeerDep(resolvePaths)) { + if (!quiet && tui) { + tui.warn(' Peer dependencies were installed but could not be resolved. Please restart the build.'); + } + return { ready: false, freshInstall: false, reason: 'peers' }; + } + // docmd-search itself was already installed; the new peers triggered + // a Node module-cache miss for them too. Re-exec in a child process. + return { ready: true, freshInstall: true, reason: 'peers' }; + } + return { ready: true, freshInstall: false, reason: 'present' }; + } + + // Attempt auto-install (installs docmd-search + peers together). + const installed = await autoInstallDocmdSearch(tui, quiet); + if (!installed) return { ready: false, freshInstall: false, reason: 'docmd-search' }; + + // Verify docmd-search resolved after install. + const resolved = resolveDocmdSearch(); + if (!resolved) { + if (!quiet && tui) { + tui.warn(' docmd-search was installed but could not be resolved. Please restart the build.'); + } + return { ready: false, freshInstall: false, reason: 'docmd-search' }; + } + + // Signal to the caller that a fresh install just happened. The current Node + // process has a stale module resolution cache and cannot import the newly + // installed packages โ€” the caller must spawn a child process for indexing. + return { ready: true, freshInstall: true, reason: 'docmd-search' }; +} + +/** + * Load translation strings for a given locale. + * Falls back to English if the locale file doesn't exist. + */ +function loadPluginStrings(localeId: string): Record { + try { + // Try locale-specific file + const localePath = path.join(i18nDir, `${localeId}.json`); + if (nativeFs.existsSync(localePath)) { + return JSON.parse(nativeFs.readFileSync(localePath, 'utf8')); + } + } catch { /* fallback below */ } + // Fallback to English + try { + const enPath = path.join(i18nDir, 'en.json'); + if (nativeFs.existsSync(enPath)) { + return JSON.parse(nativeFs.readFileSync(enPath, 'utf8')); + } + } catch { /* silent */ } + return {}; +} + +/** + * Print a per-peer-dep TUI block when `semantic: true` is requested. + * Idempotent: suppresses the block on subsequent builds when the set + * of missing peer deps is unchanged, so the user only sees it on the + * first build (or when a new peer dep goes missing). + * + * Called by `onConfigResolved` AND by `onPostBuild` after a fresh + * install. Each call is a no-op when the peer status is unchanged. + */ +function maybeReportPeerStatus(tui: any, sc: SearchConfig, quiet: boolean): void { + if (quiet || !tui) return; + if (!sc.semanticRequested) return; // user never asked for semantic โ€” stay silent + const h = peersHash(sc); + if (h === _searchState.lastPeersHash) return; // already reported this state + _searchState.lastPeersHash = h; + + if (sc.peersInstalled) { + tui.step('All semantic search dependencies ready', 'DONE'); + return; + } + // List each missing dep as its own TUI line so the user sees exactly + // which package is the blocker. We keep the order stable (the same + // order as `PEER_DEPS`) so logs read consistently across builds. + for (const dep of sc.peerDeps) { + const present = !sc.missingPeers.includes(dep); + tui.step(`${dep}`, present ? 'DONE' : 'SKIP'); + } + tui.warn( + ' Semantic search requires: ' + sc.missingPeers.join(', ') + + '\n Falling back to keyword search. To enable semantic: install the missing packages,' + ); +} + +/** + * `init` capability. Runs at config-parse time, before any page is + * rendered. Computes the single `searchConfig` object and stamps it + * on `config._searchConfig` for the rest of the build pipeline. Also + * emits the first-install peer-status TUI block if appropriate. + */ +export function onConfigResolved(config: any): void { + const sc = buildSearchConfig(config); + config._searchConfig = sc; + _searchState.lastConfig = sc; + // `tui` isn't passed to onConfigResolved (the lifecycle signature is + // `onConfigResolved(config: any): void`), so we don't emit the TUI + // block here โ€” the equivalent emission happens inside `onPostBuild` + // where the TUI is in scope. We do, however, keep this hook for + // future extensions (e.g. warming the require cache, pre-computing + // derived values that the EJS partial needs at template time). +} + +/** + * Plugin translations hook - called by the engine for each locale. + * Returns search-specific UI strings keyed by locale. + */ +export function translations(localeId: string): Record { + return loadPluginStrings(localeId || 'en'); +} + +/** + * Post-build hook - generates per-locale search indexes. + * + * When options.semantic is true: + * - If options.indexDir is provided and contains a valid manifest.json, + * skip indexing entirely โ€” the index was pre-built (e.g. by docmd-search CLI). + * - Otherwise, runs the docmd-search indexer over the docs source directory + * and outputs the vector index to /.docmd-search/. + * - Falls back to keyword-only search if docmd-search is not installed. + * + * When options.semantic is false (default): + * - Generates per-locale MiniSearch indexes (existing behaviour). + */ +export async function onPostBuild({ config, pages, outputDir, tui, options, runWorkerTask }: any) { + // Plugin-specific config is in config.plugins.search + const pluginOptions = (config.plugins && config.plugins.search) || {}; + const isEnabled = config.optionsMenu ? config.optionsMenu.components.search !== false : config.search !== false; + if (!isEnabled) return; + + const showTui = tui && !options?.quiet; + + // โ”€โ”€ Semantic search path โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ + if (pluginOptions.semantic === true) { + // Strip sourcemap comment from the copied .docmd-search-client.js to avoid + // a 404 for the non-existent .js.map file in the browser. + const clientDestPath = path.join(outputDir, '.docmd-search-client.js'); + if (nativeFs.existsSync(clientDestPath)) { + try { + const src = await fs.readFile(clientDestPath, 'utf8'); + const stripped = src.replace(/\n?\/\/# sourceMappingURL=\S+\s*$/, ''); + if (stripped !== src) await fs.writeFile(clientDestPath, stripped, 'utf8'); + } catch { /* non-critical */ } + } + + // Check if a pre-built index exists (e.g. docmd-search --ui mode) + // If indexDir is provided and has a valid manifest, skip indexing entirely. + if (pluginOptions.indexDir) { + const manifestPath = path.join(pluginOptions.indexDir, 'manifest.json'); + if (nativeFs.existsSync(manifestPath)) { + try { + const manifest = JSON.parse(nativeFs.readFileSync(manifestPath, 'utf8')); + if (manifest.status === 'complete' && manifest.batchCount > 0) { + if (showTui) tui.step('Using pre-built semantic index', 'DONE'); + // Copy the index to outputDir if it's not already there + const targetDir = path.join(outputDir, '.docmd-search'); + if (pluginOptions.indexDir !== targetDir) { + await fs.mkdir(targetDir, { recursive: true }); + // Copy manifest and batches + await fs.copyFile(manifestPath, path.join(targetDir, 'manifest.json')); + const batchesDir = path.join(pluginOptions.indexDir, 'batches'); + if (nativeFs.existsSync(batchesDir)) { + const targetBatchesDir = path.join(targetDir, 'batches'); + await fs.mkdir(targetBatchesDir, { recursive: true }); + for (const file of nativeFs.readdirSync(batchesDir)) { + await fs.copyFile(path.join(batchesDir, file), path.join(targetBatchesDir, file)); + } + } + } + return; // Index already exists โ€” no need to build + } + } catch { + // Invalid manifest โ€” fall through to build + } + } + } + + const { ready, freshInstall, reason } = await ensureDocmdSearch(tui, !showTui); + if (!ready) { + // Graceful fallback: build keyword index instead. The `reason` field + // tells the caller whether docmd-search itself or just its peers were + // missing so the message is accurate (#163 deeper fix: previously it + // always said "docmd-search not installed" even when only a peer + // was missing). + const why = + reason === 'peers' ? 'semantic peer dependencies missing' : + reason === 'docmd-search' ? 'docmd-search not installed' : + 'docmd-search not installed'; + // Only now โ€” after the install ACTUALLY failed โ€” report which deps + // were missing. This avoids the false-alarm where the warning showed + // "missing" and then the install succeeded below it. + maybeReportPeerStatus(tui, buildSearchConfig(config), !showTui); + if (showTui) tui.warn(` Falling back to keyword search (${why})`); + } else if (freshInstall) { + // docmd-search was just installed in this process. Node's module cache + // won't see it, so spawn a child docmd build to do the indexing instead + // of trying to import() it here. The child inherits the updated + // node_modules and starts with a clean require cache. + if (showTui) tui.step('Re-running semantic indexing in subprocess (first install)...', 'WAIT'); + try { + const { execSync } = await import('node:child_process'); + const cwd = process.cwd(); + // Detect the docmd binary from the same node_modules that just got updated + const docmdBin = path.join(cwd, 'node_modules', '.bin', 'docmd'); + const cmd = nativeFs.existsSync(docmdBin) + ? `"${docmdBin}" build` + : `node -e "import('docmd-search').then(m => m.indexDirectory({ rootDir: '${cwd}', outDir: '${path.join(outputDir, '.docmd-search')}' }))"`; + execSync(cmd, { stdio: 'inherit', cwd, timeout: 300000 }); + if (showTui) tui.step('Semantic search index built', 'DONE'); + } catch (err: any) { + if (showTui) tui.warn(' Subprocess indexing failed โ€” semantic search unavailable this build.'); + } + } else { + if (showTui) tui.step('Building semantic search index', 'WAIT'); + + try { + // Dynamic import of optional peer dep. + // We first resolve the package path, then import it dynamically. + // This approach is safe and works with bundlers. + const docmdSearchPath = resolveDocmdSearch(); + if (!docmdSearchPath) { + throw new Error( + 'docmd-search not found. Install it with: npm install docmd-search' + ); + } + + // Import using the resolved path - this is safe and works with bundlers + const docmdSearch: any = await import(docmdSearchPath); + + if (!docmdSearch?.indexDirectory) { + throw new Error( + 'docmd-search found but indexDirectory not exported. ' + + 'Please update to the latest version: npm install docmd-search@latest' + ); + } + + // Determine the docs source directory from config + const docsDir = path.resolve(config.root || process.cwd(), config.srcDir || config.src || 'docs'); + const semanticOutDir = path.join(outputDir, '.docmd-search'); + const hasVersioning = config.versions?.all?.length > 0; + + if (hasVersioning) { + // โ”€โ”€ Multi-version semantic indexing โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ + // Index each version's source dir separately into a temp subdir, + // then merge all batches into one unified index with file paths + // prefixed by the version's output URL prefix. + const versions: Array<{ id: string; label: string; dir: string; outputPrefix: string }> = []; + const currentVersionId = config.versions.current; + const CWD = config.root || process.cwd(); + + for (const v of config.versions.all) { + const outputPrefix = v.id === currentVersionId ? '' : v.id + '/'; + versions.push({ + id: v.id, + label: v.label || v.id, + dir: path.resolve(CWD, v.dir), + outputPrefix, + }); + } + + if (showTui) tui.step('Building semantic search index (multi-version)', 'WAIT'); + + const tmpBase = path.join(semanticOutDir, '_tmp_versions'); + await fs.mkdir(tmpBase, { recursive: true }); + + let mergedDimensions = 384; // default, overwritten from first batch + let mergedBatchId = 0; + const mergedBatchesDir = path.join(semanticOutDir, 'batches'); + await fs.mkdir(mergedBatchesDir, { recursive: true }); + + // Track version-to-pathPrefix mapping for the client filter + const versionMap: Array<{ label: string; pathPrefix: string }> = []; + + // Always exclude semantic index output dir and --ui artifacts from indexing + const builtinExcludes = ['**/.docmd-search/**', '**/_site/**', '**/_ui/**']; + const mergedExclude = [...builtinExcludes, ...(pluginOptions.exclude || [])]; + + for (const ver of versions) { + const tmpOut = path.join(tmpBase, ver.id); + try { + await docmdSearch.indexDirectory( + { + rootDir: ver.dir, + outDir: tmpOut, + model: pluginOptions.model, + include: pluginOptions.include, + exclude: mergedExclude, + chunkSize: pluginOptions.chunkSize, + chunkOverlap: pluginOptions.chunkOverlap, + }, + (progress: any) => { + if (showTui && progress.message) { + tui.step(`Semantic index [${ver.label}]: ${progress.message}`, 'WAIT'); + } + } + ); + } catch (verErr: any) { + if (showTui) tui.warn(` Skipping version ${ver.label}: ${verErr.message}`); + continue; + } + + // Read all batches from this version's tmp index and re-save with prefixed file paths + const tmpBatchesDir = path.join(tmpOut, 'batches'); + if (nativeFs.existsSync(tmpBatchesDir)) { + const batchFiles = nativeFs.readdirSync(tmpBatchesDir) + .filter(f => f.endsWith('.json')) + .sort(); + + for (const batchFile of batchFiles) { + const batchJson = JSON.parse(await fs.readFile(path.join(tmpBatchesDir, batchFile), 'utf8')); + const binPath = path.join(tmpBatchesDir, batchFile.replace('.json', '.bin')); + + // Prefix each chunk's file path with the version output prefix + if (ver.outputPrefix) { + batchJson.chunks = batchJson.chunks.map((chunk: any) => ({ + ...chunk, + file: ver.outputPrefix + chunk.file, + })); + } + + mergedDimensions = batchJson.dimensions || mergedDimensions; + const paddedId = String(mergedBatchId).padStart(3, '0'); + batchJson.batchId = mergedBatchId; + + await fs.writeFile( + path.join(mergedBatchesDir, `${paddedId}.json`), + JSON.stringify(batchJson) + ); + if (nativeFs.existsSync(binPath)) { + await fs.copyFile(binPath, path.join(mergedBatchesDir, `${paddedId}.bin`)); + } + mergedBatchId++; + } + } + + // Always add this version to the filter map (even if it has no chunks) + versionMap.push({ label: ver.label, pathPrefix: ver.outputPrefix }); + } + + // Write unified manifest + const manifest = { + version: 1, + model: pluginOptions.model || 'Xenova/all-MiniLM-L6-v2', + dimensions: mergedDimensions, + status: 'complete', + batchCount: mergedBatchId, + }; + await fs.writeFile(path.join(semanticOutDir, 'manifest.json'), JSON.stringify(manifest)); + + // Write versions.json for the client filter UI + await fs.writeFile( + path.join(semanticOutDir, 'versions.json'), + JSON.stringify(versionMap) + ); + + // Clean up temp dirs + try { await fs.rm(tmpBase, { recursive: true, force: true }); } catch { /* ok */ } + + if (showTui) tui.step('Building semantic search index (multi-version)', 'DONE'); + return; + } + + // โ”€โ”€ Single-version semantic indexing โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ + // Always exclude the semantic index output directory itself and any + // docmd-search --ui artifacts (_site/, _ui/) so the indexer never + // crawls its own output. Merge with any user-supplied excludes. + const builtinExcludes = ['**/.docmd-search/**', '**/_site/**', '**/_ui/**']; + const mergedExclude = [ + ...builtinExcludes, + ...(pluginOptions.exclude || []), + ]; + await docmdSearch.indexDirectory( + { + rootDir: docsDir, + outDir: semanticOutDir, + model: pluginOptions.model, // undefined โ†’ uses global/default + include: pluginOptions.include, + exclude: mergedExclude, + chunkSize: pluginOptions.chunkSize, + chunkOverlap: pluginOptions.chunkOverlap, + }, + (progress: any) => { + if (showTui && progress.message) { + // Update TUI step message on each phase change + tui.step(`Semantic index: ${progress.message}`, 'WAIT'); + } + } + ); + + // No versioning โ€” write an empty versions.json so the client knows + await fs.writeFile(path.join(semanticOutDir, 'versions.json'), '[]'); + + if (showTui) tui.step('Building semantic search index', 'DONE'); + // Semantic index built โ€” skip MiniSearch index below + return; + } catch (err: any) { + if (showTui) { + tui.step('Building semantic search index', 'FAIL'); + tui.warn(`Semantic indexing failed: ${err.message} โ€” falling back to keyword search`); + } else { + console.warn(`[plugin-search] Semantic indexing failed: ${err.message}`); + } + // Fall through to keyword search + } + } // close else (not freshInstall) + } + + // โ”€โ”€ Keyword search path (default / fallback) โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ + if (showTui) tui.step('Generating search index', 'WAIT'); + + // Try to offload to worker thread for better main-thread responsiveness + if (runWorkerTask) { + try { + // Only send serializable page data the worker needs + const serializablePages = pages + .filter((p: any) => p.searchData) + .map((p: any) => ({ outputPath: p.outputPath, searchData: p.searchData })); + + // Build a minimal serializable config for the worker + const workerConfig = { + i18n: config.i18n ? { locales: config.i18n.locales, default: config.i18n.default } : undefined, + versions: config.versions ? { all: config.versions.all, current: config.versions.current } : undefined, + }; + + const workerModulePath = path.resolve(__dirname, 'worker.js'); + await runWorkerTask(workerModulePath, 'buildSearchIndex', [workerConfig, serializablePages, outputDir]); + + if (showTui) tui.step('Generating search index', 'DONE'); + return; + } catch { + // Worker failed โ€” fall through to main-thread processing + } + } + + // Main-thread fallback (or when WorkerPool isn't available) + await buildSearchIndexInline(config, pages, outputDir); + + if (showTui) tui.step('Generating search index', 'DONE'); +} + +/** + * Inline (main-thread) search index builder โ€” used as fallback when + * worker offloading is not available or fails. + */ +async function buildSearchIndexInline(config: any, pages: any[], outputDir: string) { + const locales = config.i18n?.locales || []; + const defaultLocale = config.i18n?.default || null; + const hasVersioning = config.versions?.all?.length > 0; + const currentVersionId = config.versions?.current; + + // Group pages by locale + const localePages: Record = { '_default': [] }; + for (const loc of locales) { + if (loc.id !== defaultLocale) { + localePages[loc.id] = []; + } + } + + for (const page of pages) { + if (!page.searchData) continue; + const outputPath = page.outputPath.replace(/\\/g, '/'); + + let localeId = '_default'; + for (const loc of locales) { + if (loc.id !== defaultLocale && outputPath.startsWith(loc.id + '/')) { + localeId = loc.id; + break; + } + } + localePages[localeId] = localePages[localeId] || []; + localePages[localeId].push(page); + } + + for (const [localeId, locPages] of Object.entries(localePages)) { + if (locPages.length === 0) continue; + + const searchData: any[] = []; + const seenIds = new Set(); + + for (const page of locPages) { + let pageId = outputPathToSlug(page.outputPath); + if (pageId.startsWith('/') && pageId !== '/') { + pageId = pageId.slice(1); + } + + let version: string | null = null; + if (hasVersioning && config.versions?.all) { + for (const v of config.versions.all) { + const stripped = localeId !== '_default' ? pageId.replace(new RegExp(`^${localeId}/`), '') : pageId; + if (stripped.startsWith(v.id + '/') || stripped === v.id) { + version = v.label || v.id; + break; + } + } + if (!version) { + const currentVersion = config.versions.all.find((v: any) => v.id === currentVersionId); + if (currentVersion) version = currentVersion.label || currentVersion.id; + } + } + + if (!seenIds.has(pageId)) { + seenIds.add(pageId); + const entry: any = { + id: pageId, + title: page.searchData.title, + text: page.searchData.content, + headings: (page.searchData.headings || []).map((h: any) => h.text).join(' ') + }; + if (hasVersioning && version) entry.version = version; + searchData.push(entry); + } + + if (page.searchData.headings && Array.isArray(page.searchData.headings)) { + for (const heading of page.searchData.headings) { + if (heading.id && heading.text) { + const hId = `${pageId}#${heading.id}`; + if (!seenIds.has(hId)) { + seenIds.add(hId); + const entry: any = { + id: hId, + title: `${page.searchData.title} > ${heading.text}`, + text: '', + headings: heading.text + }; + if (hasVersioning && version) entry.version = version; + searchData.push(entry); + } + } + } + } + } + + const storeFields = ['title', 'id', 'text']; + if (hasVersioning) storeFields.push('version'); + + const CJK_AND_SPACELESS_REGEX = /[\u3040-\u30ff\u3400-\u4dbf\u4e00-\u9fff\uf900-\ufaff\uff66-\uff9f\uac00-\ud7af\u1100-\u11ff\u3130-\u318f\u0e00-\u0e7f\u0e80-\u0eff\u1780-\u17ff\u1000-\u109f\u0f00-\u0fff]/g; + const miniSearch = new MiniSearch({ + fields: ['title', 'headings', 'text'], + storeFields, + tokenize: (text: string) => { + const spaced = text.replace(CJK_AND_SPACELESS_REGEX, ' $& '); + const defaultTokenize = MiniSearch.getDefault('tokenize'); + return defaultTokenize ? defaultTokenize(spaced) : spaced.toLowerCase().split(/[^a-zA-Z0-9_'\u00C0-\u017F\u00d0\u00f0\u00df\u00f8\u00e6\u0153\u03ac-\u03ce\u0400-\u04ff]+/u).filter(Boolean); + }, + searchOptions: { boost: { title: 2, headings: 1.5 }, fuzzy: 0.2 } + }); + + miniSearch.addAll(searchData); + const json = JSON.stringify(miniSearch.toJSON()); + + const indexPath = localeId === '_default' + ? path.join(outputDir, 'search-index.json') + : path.join(outputDir, localeId, 'search-index.json'); + + await fs.mkdir(path.dirname(indexPath), { recursive: true }); + await fs.writeFile(indexPath, json); + } +} + +/** + * Inject the search modal HTML. + * + * When options.semantic is true: + * - Adds a data-semantic="true" attribute to the modal so the semantic + * client JS knows to use the vector index instead of MiniSearch. + * - The modal HTML is identical โ€” only the client JS bundle changes. + * + * Strings are passed as data attributes so the client JS can read them + * regardless of locale - the engine merges plugin translations before render. + */ +export function generateScripts(config: any, options: any) { + const isEnabled = config.optionsMenu ? config.optionsMenu.components.search !== false : config.search !== false; + if (!isEnabled) return {}; + + // Use the resolved searchConfig as the single source of truth. + // The client also auto-detects at runtime (HEAD probe to manifest.json) + // so even if this build-time hint is wrong (e.g. first-build dep install), + // the browser still picks the right mode. + const sc: SearchConfig = config._searchConfig || buildSearchConfig(config); + const isSemantic = sc.semanticUsable; + const showConfidence = (options || {}).showConfidence === true; + const showFilters = (options || {}).showFilters !== false; + + // Load strings for the active locale (available at render time) + const localeId = config._activeLocale?.id || 'en'; + const strings = loadPluginStrings(localeId); + + const searchIcon = ``; + const closeIcon = ``; + + const escape = new MarkdownIt().utils.escapeHtml; + + const semanticAttr = isSemantic ? ' data-semantic="true"' : ''; + const confidenceAttr = ` data-show-confidence="${showConfidence}"`; + const filtersAttr = ` data-show-filters="${showFilters}"`; + + const modalHtml = ` + + `; + + return { bodyScriptsHtml: modalHtml }; +} + +export function getAssets(options: any) { + // Use searchConfig for semanticRequested, but keep the broader + // resolution paths for finding the client bundle (which lives in + // the plugin's own node_modules, not just the user's project). + const sc = _searchState.lastConfig; + const semanticRequested = sc?.semanticRequested ?? (options || {}).semantic === true; + const isSemantic = semanticRequested; + + if (isSemantic) { + // Semantic mode: serve the docmd-search client bundle at a known path + // so the search client can dynamically import it at runtime. + // Resolve the actual file path (not a file:// URL) from docmd-search package. + let semanticClientSrc: string | null = null; + try { + const searchPaths = [ + process.cwd(), + __dirname, + path.resolve(__dirname, '../../..'), + path.resolve(__dirname, '../../../..'), + ]; + const pkgPath = require.resolve('docmd-search/package.json', { paths: searchPaths }); + const pkgDir = path.dirname(pkgPath); + const clientEntry = path.join(pkgDir, 'dist', 'client', 'index.js'); + if (nativeFs.existsSync(clientEntry)) semanticClientSrc = clientEntry; + } catch { /* not installed */ } + + const assets: any[] = [ + // Always include MiniSearch + keyword client as fallback + { url: 'https://cdn.jsdelivr.net/npm/minisearch@7.2.0/dist/umd/index.min.js', type: 'js', location: 'body' }, + { src: path.join(__dirname, 'docmd-search.js'), dest: 'assets/js/docmd-search.js', type: 'js', location: 'body' }, + ]; + + if (semanticClientSrc) { + // Serve the docmd-search client at a well-known root path + // The search client.ts fetches it via import('.docmd-search-client.js') + assets.push({ + src: semanticClientSrc, + dest: '.docmd-search-client.js', + type: 'js', + location: 'none', // not injected into / โ€” loaded on demand + }); + } + + return assets; + } + + // Default: keyword search via MiniSearch + return [ + { url: 'https://cdn.jsdelivr.net/npm/minisearch@7.2.0/dist/umd/index.min.js', type: 'js', location: 'body' }, + { src: path.join(__dirname, 'docmd-search.js'), dest: 'assets/js/docmd-search.js', type: 'js', location: 'body' } + ]; +} \ No newline at end of file diff --git a/packages/plugins/search/src/semantic-client.ts b/packages/plugins/search/src/semantic-client.ts new file mode 100644 index 0000000..f2d47ec --- /dev/null +++ b/packages/plugins/search/src/semantic-client.ts @@ -0,0 +1,302 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/core (and ecosystem) + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + */ + +/** + * Semantic search client module. + * Handles vector-based semantic search using docmd-search. + */ + +export {}; + +declare global { + interface Window { + DOCMD_SITE_ROOT?: string; + DOCMD_ROOT?: string; + } +} + +export interface SemanticSearchContext { + siteBase: string; + ROOT_PATH: string; + searchResults: HTMLElement; + strings: { + initial: string; + noResults: string; + error: string; + }; + activeVersionFilters: Set; + globalAllVersions: string[]; + globalVersionColors: Record; + selectedIndex: number; + updateSelection: (items: NodeListOf) => void; + showConfidence?: boolean; +} + +let semanticClient: any = null; + +/** + * Load the semantic search index and client. + */ +export async function loadSemanticIndex(ctx: SemanticSearchContext): Promise { + const semanticIndexBase = new URL('.docmd-search/', new URL(ctx.siteBase, window.location.href)).href; + const clientUrl = new URL('.docmd-search-client.js', new URL(ctx.siteBase, window.location.href)).href; + + try { + semanticClient = await import(/* @vite-ignore */ clientUrl); + } catch { + throw new Error('semantic-client-missing'); + } + + if (!semanticClient?.load || !semanticClient?.search) { + throw new Error('semantic-client-invalid'); + } + + await semanticClient.load(semanticIndexBase, (loaded: number, total: number) => { + const safeLoaded = Math.max(0, parseInt(String(loaded), 10) || 0); + const safeTotal = Math.max(0, parseInt(String(total), 10) || 0); + + clearElement(ctx.searchResults); + const div = document.createElement('div'); + div.className = 'search-initial'; + div.textContent = (safeLoaded === safeTotal && safeTotal > 0) + ? 'Semantic search ready...' + : `Loading semantic index... (${safeLoaded}/${safeTotal})`; + ctx.searchResults.appendChild(div); + }); + + // Load versions.json for filter chips + try { + const versionsUrl = new URL('.docmd-search/versions.json', new URL(ctx.siteBase, window.location.href)).href; + const vRes = await fetch(versionsUrl); + if (vRes.ok) { + const vData: Array<{ label: string; pathPrefix: string }> = await vRes.json(); + if (Array.isArray(vData) && vData.length > 0) { + ctx.globalAllVersions.length = 0; + ctx.globalAllVersions.push(...vData.map(v => v.label)); + // Store pathPrefix alongside label for filtering + (ctx.globalVersionColors as any).__semanticVersions = vData; + const huePresets = [210, 150, 30, 330, 270, 60, 180, 0]; + ctx.globalAllVersions.forEach((label, i) => { + const hue = huePresets[i % huePresets.length]; + ctx.globalVersionColors[label] = { bg: `hsl(${hue}, 55%, 92%)`, fg: `hsl(${hue}, 60%, 35%)` }; + }); + } + } + } catch { /* version filters are optional */ } + + return true; +} + +/** Helper to resolve the correct version label for a given file path */ +function resolveFileVersion(file: string, semanticVersions: Array<{ label: string; pathPrefix: string }>): string | null { + // Sort prefixes by length in descending order to match longest prefix first + const sorted = [...semanticVersions].sort((a, b) => b.pathPrefix.length - a.pathPrefix.length); + for (const v of sorted) { + if (v.pathPrefix && file.startsWith(v.pathPrefix)) { + return v.label; + } + } + // Fallback to empty prefix (current version) if present + const current = semanticVersions.find(v => !v.pathPrefix); + return current ? current.label : null; +} + +/** + * Perform semantic search and render results. + */ +export function performSemanticSearch(query: string, ctx: SemanticSearchContext): void { + if (!semanticClient) return; + + const rawResults = semanticClient.search(query, 10); + + // Filter by active version filters (if any) + let filteredResults = rawResults; + if (ctx.activeVersionFilters.size > 0) { + const semanticVersions = (ctx.globalVersionColors as any).__semanticVersions || []; + filteredResults = rawResults.filter((result: any) => { + const chunk = result.chunk; + const file = chunk.file || ''; + const verLabel = resolveFileVersion(file, semanticVersions); + return verLabel && ctx.activeVersionFilters.has(verLabel); + }); + } + + if (filteredResults.length === 0) { + clearElement(ctx.searchResults); + const div = document.createElement('div'); + div.className = 'search-no-results'; + div.textContent = ctx.activeVersionFilters.size > 0 + ? 'No results match the selected filters.' + : ctx.strings.noResults; + ctx.searchResults.appendChild(div); + return; + } + + clearElement(ctx.searchResults); + + filteredResults.forEach((result: any, index: number) => { + const chunk = result.chunk; + const rawFile = chunk.file || '/'; + + // Convert markdown file path to HTML URL + let urlPath = rawFile.replace(/\.md$/, '').replace(/\/index$/, '/'); + if (!urlPath.endsWith('/')) urlPath += '/'; + + // Strip locale prefix if it matches a known locale (source structure has locale dirs) + const firstSegment = urlPath.split('/')[0]; + if (firstSegment.length >= 2 && firstSegment.length <= 3) { + urlPath = urlPath.replace(/^[a-z]{2,3}\//, ''); + } + + // Add anchor link if heading exists. The slugify regex must be + // Unicode-aware: docmd's parser generates slugs from any + // \p{L}\p{N} character (Chinese, Japanese, Korean, Cyrillic, + // Arabic, etc.), so the search-side has to match the same + // character class or anchors for non-English content would + // collapse to '#' and the search result would jump to the page + // top instead of the heading. + let anchor = ''; + if (chunk.heading) { + anchor = '#' + chunk.heading.toLowerCase() + .replace(/[^\p{L}\p{N}\s-]/gu, '') + .replace(/\s+/g, '-') + .replace(/-+/g, '-') + .replace(/^-|-$/g, ''); + } + + const cleanId = urlPath.startsWith('/') ? urlPath.slice(1) : urlPath; + const linkHref = `${ctx.ROOT_PATH}${cleanId}${anchor}`.replace(/([^:])\/\/+/g, '$1/'); + + // Use heading as title if available, otherwise use file-based title + const titleText = chunk.heading || cleanFileToTitle(rawFile); + + // Build DOM elements safely + const link = document.createElement('a'); + link.href = linkHref; + link.className = 'search-result-item'; + link.dataset.index = String(index); + + const titleDiv = document.createElement('div'); + titleDiv.className = 'search-result-title'; + titleDiv.textContent = titleText; + + // Right-side meta group: version pill + confidence badge + // Always right-aligned via margin-left:auto on .search-result-meta + const hasVersion = ctx.globalAllVersions.length > 0; + const hasConfidence = ctx.showConfidence && typeof result.score === 'number'; + + if (hasVersion || hasConfidence) { + const metaDiv = document.createElement('div'); + metaDiv.className = 'search-result-meta'; + + // Version pill + if (hasVersion) { + const semanticVersions = (ctx.globalVersionColors as any).__semanticVersions || []; + const verLabel = resolveFileVersion(rawFile, semanticVersions); + if (verLabel) { + const vc = ctx.globalVersionColors[verLabel]; + if (vc) { + const badge = document.createElement('span'); + badge.className = 'search-result-version'; + badge.style.background = vc.bg; + badge.style.color = vc.fg; + badge.textContent = verLabel; + metaDiv.appendChild(badge); + } + } + } + + // Confidence badge โ€” CSS classes, no inline styles + if (hasConfidence) { + const confidenceScore = Math.round(result.score * 100); + const scoreBadge = document.createElement('span'); + scoreBadge.className = 'search-result-confidence' + + (confidenceScore >= 85 ? ' confidence-high' : ''); + scoreBadge.textContent = `${confidenceScore}%`; + metaDiv.appendChild(scoreBadge); + } + + titleDiv.appendChild(metaDiv); + } + + + const previewDiv = document.createElement('div'); + previewDiv.className = 'search-result-preview'; + previewDiv.appendChild(buildSnippetFragment(chunk.text, query)); + + link.appendChild(titleDiv); + link.appendChild(previewDiv); + ctx.searchResults.appendChild(link); + + link.addEventListener('mouseenter', () => { + ctx.selectedIndex = index; + ctx.updateSelection(ctx.searchResults.querySelectorAll('.search-result-item') as NodeListOf); + }); + }); +} + +/** Remove all child nodes from an element. */ +function clearElement(el: HTMLElement): void { + while (el.firstChild) el.removeChild(el.firstChild); +} + +function cleanFileToTitle(file: string): string { + const parts = file.replace(/\\/g, '/').replace(/\.md$/, '').split('/').filter(Boolean); + const segment = (parts[parts.length - 1] === 'index' ? parts[parts.length - 2] : parts[parts.length - 1]) || file; + return segment.replace(/[-_]/g, ' ').replace(/\b\w/g, c => c.toUpperCase()); +} + +/** + * Build a DocumentFragment for a text snippet with highlights. + * No innerHTML โ€” all text inserted via textContent, marks via createElement. + */ +function buildSnippetFragment(text: string | undefined, query: string): DocumentFragment { + const frag = document.createDocumentFragment(); + if (!text) return frag; + + const terms = query.split(/\s+/).filter(t => t.length > 2); + let bestIndex = -1; + for (const term of terms) { + const idx = text.toLowerCase().indexOf(term.toLowerCase()); + if (idx >= 0) { bestIndex = idx; break; } + } + const start = Math.max(0, bestIndex - 60); + const end = Math.min(text.length, bestIndex + 60); + let snippet = text.substring(start, end); + if (start > 0) snippet = '...' + snippet; + if (end < text.length) snippet += '...'; + + if (terms.length === 0) { + frag.appendChild(document.createTextNode(snippet)); + return frag; + } + + // Split snippet by matching terms and wrap matches in + const pattern = new RegExp(`(${terms.map(t => t.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')).join('|')})`, 'gi'); + const parts = snippet.split(pattern); + + for (const part of parts) { + if (pattern.test(part)) { + pattern.lastIndex = 0; // reset after test + const mark = document.createElement('mark'); + mark.textContent = part; + frag.appendChild(mark); + } else { + pattern.lastIndex = 0; + frag.appendChild(document.createTextNode(part)); + } + } + + return frag; +} \ No newline at end of file diff --git a/packages/plugins/search/src/worker.ts b/packages/plugins/search/src/worker.ts new file mode 100644 index 0000000..26c0002 --- /dev/null +++ b/packages/plugins/search/src/worker.ts @@ -0,0 +1,142 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/core (and ecosystem) + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + */ + +import path from 'path'; +import fs from 'fs/promises'; +import MiniSearch from 'minisearch'; +import { outputPathToSlug } from '@docmd/api'; + +export async function buildSearchIndex(config: any, pages: any[], outputDir: string) { + // Determine locale configuration + const locales = config.i18n?.locales || []; + const defaultLocale = config.i18n?.default || null; + const hasVersioning = config.versions?.all?.length > 0; + const currentVersionId = config.versions?.current; + + // Group pages by locale + const localePages: Record = { '_default': [] }; + for (const loc of locales) { + if (loc.id !== defaultLocale) { + localePages[loc.id] = []; + } + } + + for (const page of pages) { + if (!page.searchData) continue; + const outputPath = page.outputPath.replace(/\\/g, '/'); + + // Determine which locale this page belongs to + let localeId = '_default'; + for (const loc of locales) { + if (loc.id !== defaultLocale && outputPath.startsWith(loc.id + '/')) { + localeId = loc.id; + break; + } + } + localePages[localeId] = localePages[localeId] || []; + localePages[localeId].push(page); + } + + // Build an index per locale + for (const [localeId, locPages] of Object.entries(localePages)) { + if (locPages.length === 0) continue; + + const searchData: any[] = []; + const seenIds = new Set(); + + for (const page of locPages) { + let pageId = outputPathToSlug(page.outputPath); + + if (pageId.startsWith('/') && pageId !== '/') { + pageId = pageId.slice(1); + } + + // Detect version from the output path + let version: string | null = null; + if (hasVersioning && config.versions?.all) { + for (const v of config.versions.all) { + const stripped = localeId !== '_default' ? pageId.replace(new RegExp(`^${localeId}/`), '') : pageId; + if (stripped.startsWith(v.id + '/') || stripped === v.id) { + version = v.label || v.id; + break; + } + } + if (!version) { + const currentVersion = config.versions.all.find((v: any) => v.id === currentVersionId); + if (currentVersion) version = currentVersion.label || currentVersion.id; + } + } + + // Add the main page record + if (!seenIds.has(pageId)) { + seenIds.add(pageId); + const entry: any = { + id: pageId, + title: page.searchData.title, + text: page.searchData.content, + headings: (page.searchData.headings || []).map((h: any) => h.text).join(' ') + }; + if (hasVersioning && version) entry.version = version; + searchData.push(entry); + } + + // Add individual heading records for deep linking + if (page.searchData.headings && Array.isArray(page.searchData.headings)) { + for (const heading of page.searchData.headings) { + if (heading.id && heading.text) { + const hId = `${pageId}#${heading.id}`; + if (!seenIds.has(hId)) { + seenIds.add(hId); + const entry: any = { + id: hId, + title: `${page.searchData.title} > ${heading.text}`, + text: '', + headings: heading.text + }; + if (hasVersioning && version) entry.version = version; + searchData.push(entry); + } + } + } + } + } + + // Build MiniSearch index + const storeFields = ['title', 'id', 'text']; + if (hasVersioning) storeFields.push('version'); + + const CJK_AND_SPACELESS_REGEX = /[\u3040-\u30ff\u3400-\u4dbf\u4e00-\u9fff\uf900-\ufaff\uff66-\uff9f\uac00-\ud7af\u1100-\u11ff\u3130-\u318f\u0e00-\u0e7f\u0e80-\u0eff\u1780-\u17ff\u1000-\u109f\u0f00-\u0fff]/g; + const miniSearch = new MiniSearch({ + fields: ['title', 'headings', 'text'], + storeFields, + tokenize: (text: string) => { + const spaced = text.replace(CJK_AND_SPACELESS_REGEX, ' $& '); + const defaultTokenize = MiniSearch.getDefault('tokenize'); + return defaultTokenize ? defaultTokenize(spaced) : spaced.toLowerCase().split(/[^a-zA-Z0-9_'\u00C0-\u017F\u00d0\u00f0\u00df\u00f8\u00e6\u0153\u03ac-\u03ce\u0400-\u04ff]+/u).filter(Boolean); + }, + searchOptions: { boost: { title: 2, headings: 1.5 }, fuzzy: 0.2 } + }); + + miniSearch.addAll(searchData); + const json = JSON.stringify(miniSearch.toJSON()); + + // Write to the correct locale directory + const indexPath = localeId === '_default' + ? path.join(outputDir, 'search-index.json') + : path.join(outputDir, localeId, 'search-index.json'); + + await fs.mkdir(path.dirname(indexPath), { recursive: true }); + await fs.writeFile(indexPath, json); + } +} \ No newline at end of file diff --git a/packages/plugins/search/tsconfig.json b/packages/plugins/search/tsconfig.json new file mode 100644 index 0000000..f5b2aff --- /dev/null +++ b/packages/plugins/search/tsconfig.json @@ -0,0 +1,10 @@ +{ + "extends": "../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "./dist", + "rootDir": "./src", + "strict": false + }, + "include": ["src/**/*"], + "exclude": ["node_modules", "dist", "**/*.test.ts", "src/client.ts"] +} \ No newline at end of file diff --git a/packages/plugins/seo/LICENSE b/packages/plugins/seo/LICENSE new file mode 100644 index 0000000..997bb73 --- /dev/null +++ b/packages/plugins/seo/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025-present docmd.io + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/packages/plugins/seo/README.md b/packages/plugins/seo/README.md new file mode 100644 index 0000000..dd1de62 --- /dev/null +++ b/packages/plugins/seo/README.md @@ -0,0 +1,31 @@ +**Outrank** + +> Outrank your competitors with automated backlinks and SEO-optimised content running in the background. This tool has been picking up serious traction lately, and the results speak for themselves. [Try it now](https://outrank.so/?via=docmd) + +image + +# @docmd/plugin-seo + +Generates meta tags, Open Graph, and Twitter Card markup for every page in your docmd site - canonical URLs, descriptions, and social previews handled automatically. Bundled with `@docmd/core`. + +```js +// docmd.config.js +module.exports = { + plugins: { + seo: { + defaultDescription: 'My documentation site', + twitter: { siteUsername: '@myproject' } + } + } +}; +``` + +Part of the **[docmd](https://github.com/docmd-io/docmd)** documentation engine. + +## Documentation + +See **[docs.docmd.io](https://docs.docmd.io)** for full usage and API reference. + +## License + +MIT diff --git a/packages/plugins/seo/package.json b/packages/plugins/seo/package.json new file mode 100644 index 0000000..748d142 --- /dev/null +++ b/packages/plugins/seo/package.json @@ -0,0 +1,68 @@ +{ + "name": "@docmd/plugin-seo", + "version": "0.8.12", + "description": "SEO meta tag generator for docmd.", + "type": "module", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "docmd": { + "key": "seo", + "kind": "plugin", + "displayName": "SEO", + "tagline": "SEO meta tag generator for docmd.", + "capabilities": [ + "head", + "post-build" + ] + }, + "scripts": { + "build": "tsc" + }, + "files": [ + "dist" + ], + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@docmd/api": "workspace:*" + }, + "dependencies": { + "@docmd/utils": "workspace:*" + }, + "devDependencies": { + "@docmd/api": "workspace:*", + "@types/node": "^24.13.3" + }, + "keywords": [ + "docmd", + "plugin", + "seo", + "meta-tags", + "open-graph", + "twitter-cards", + "robots", + "sitemap", + "favicon", + "markdown", + "minimalist", + "zero-config", + "site-generator", + "static-site-generator", + "docs" + ], + "author": { + "name": "Ghazi", + "url": "https://mgks.dev" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/docmd-io/docmd.git" + }, + "bugs": { + "url": "https://github.com/docmd-io/docmd/issues" + }, + "homepage": "https://docmd.io", + "funding": "https://github.com/sponsors/mgks", + "license": "MIT" +} \ No newline at end of file diff --git a/packages/plugins/seo/src/index.ts b/packages/plugins/seo/src/index.ts new file mode 100644 index 0000000..72f46a9 --- /dev/null +++ b/packages/plugins/seo/src/index.ts @@ -0,0 +1,204 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/core (and ecosystem) + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + */ + +import path from 'path'; +import fs from 'fs/promises'; +import nativeFs from 'fs'; +import type { PluginDescriptor } from '@docmd/api'; +import { outputPathToPathname, sanitizeUrl } from '@docmd/api'; +import { attrEsc } from '@docmd/utils'; + +export const plugin: PluginDescriptor = { + name: 'seo', + version: '0.8.12', + capabilities: ['head', 'post-build'] +}; + +/** + * Generates HTML meta tags for a specific page. + * @param {Object} config - Project config + * @param {Object} pageData - { frontmatter, outputPath } + * @param {string} relativePathToRoot - Path relative to root (for assets) + * @returns {string} HTML string of meta tags + */ + +export function generateMetaTags(config: any, pageData: any, _relativePathToRoot: string) { + let html = ''; + const { frontmatter, outputPath } = pageData; + const seo = frontmatter.seo || {}; // Page-specific SEO overrides + const globalSeo = config.plugins?.seo || {}; + + // 1. Robots + if (frontmatter.noindex || seo.noindex) { + return '\n'; + } + + // 1.5 AI Bots Control + // By default (aiBots: true), AI bots are allowed to index content + // Set aiBots: false to block AI training bots + const aiBots = seo.aiBots ?? globalSeo.aiBots ?? true; // Default: true (allow) + if (aiBots === false) { + const bots = ['GPTBot', 'ChatGPT-User', 'Google-Extended', 'CCBot', 'anthropic-ai', 'Omgilibot', 'Omgili', 'FacebookBot', 'Diffbot', 'Bytespider', 'ImagesiftBot', 'cohere-ai']; + bots.forEach(bot => { + html += `\n`; + }); + } + + // 2. Basic Meta + const siteTitle = config.title; + const pageTitle = frontmatter.title || 'Untitled'; + let description = seo.description || frontmatter.description || globalSeo.defaultDescription || ''; + + // Smart Fallback Description + if (!description && pageData.searchData && pageData.searchData.content) { + const contentPrefix = pageData.searchData.content.substring(0, 150).trim(); + description = pageData.searchData.content.length > 150 ? contentPrefix + '...' : contentPrefix; + } + + // Phase 1.B (T-S3 fix): all content="..." values are user-controllable + // (frontmatter.title, frontmatter.description, config.url, config.title, etc.). + // Apply attrEsc() to prevent stored XSS in social-media previews. + html += `\n`; + + // 3. Canonical URL + // Use centralised URL utility for consistent URL generation. + const siteUrl = config.url ? config.url.replace(/\/$/, '') : ''; + const pathname = outputPathToPathname(outputPath); + const pageUrl = sanitizeUrl(siteUrl + pathname); + + const canonical = seo.canonicalUrl || frontmatter.canonicalUrl || pageUrl; + if (canonical) { + html += `\n`; + } + + // 4. Open Graph (Facebook/LinkedIn) + const appendTitle = frontmatter.titleAppend !== false; + const fullTitle = (appendTitle && siteTitle && pageTitle !== siteTitle) ? `${pageTitle} - ${siteTitle}` : pageTitle; + + html += `\n`; + html += `\n`; + html += `\n`; + html += `\n`; + + // Image Logic + let image = seo.image || frontmatter.image || globalSeo.openGraph?.defaultImage; + if (image) { + if (!image.startsWith('http')) { + // Resolve relative image path to absolute URL + image = `${siteUrl}/${image.replace(/^\.?\//, '')}`; + } + html += `\n`; + } + + // 5. Twitter + const cardType = seo.twitterCard || globalSeo.twitter?.cardType || 'summary_large_image'; + html += `\n`; + + if (globalSeo.twitter?.siteUsername) { + html += `\n`; + } + + html += `\n`; + html += `\n`; + if (image) { + html += `\n`; + } + + // 6. Keywords + const keywords = seo.keywords || frontmatter.keywords; + if (keywords) { + const kwStr = Array.isArray(keywords) ? keywords.join(', ') : keywords; + html += `\n`; + } + + return html; +} + +/** + * Post-build hook to auto-generate robots.txt if missing. + * This ensures SEO best practices without overwriting existing customizations. + * + * @param {Object} context + * @param {Object} context.config - The parsed project config + * @param {string} context.outputDir - Absolute path to output directory + * @param {Function} context.log - Logger function + */ +export async function onPostBuild({ config, outputDir, log }: any) { + const robotsPath = path.join(outputDir, 'robots.txt'); + const seoConfig = config.plugins?.seo || {}; + + // Check all possible locations for existing robots.txt + // Priority: site root > assets folder + const possibleLocations = [ + path.join(outputDir, 'robots.txt'), // site/robots.txt (already in output) + path.join(outputDir, 'assets', 'robots.txt'), // site/assets/robots.txt (copied from assets) + ]; + + // Find existing robots.txt + let existingRobotsPath: string | null = null; + for (const loc of possibleLocations) { + if (nativeFs.existsSync(loc)) { + existingRobotsPath = loc; + break; + } + } + + // If found, copy to site root if not already there + if (existingRobotsPath) { + if (existingRobotsPath !== robotsPath) { + // Copy from assets to site root (recommended location) + await fs.copyFile(existingRobotsPath, robotsPath); + if (log) log('Copied robots.txt from assets to site root'); + } else { + if (log) log('robots.txt already exists in site root, preserving'); + } + return; + } + + // No robots.txt found anywhere - generate one + const siteUrl = config.url ? config.url.replace(/\/$/, '') : ''; + const sitemapUrl = siteUrl ? `${siteUrl}/sitemap.xml` : ''; + + let robotsContent = 'User-agent: *\nAllow: /\n'; + + // Add sitemap reference if site URL is configured + if (sitemapUrl) { + robotsContent += `\n# Sitemap\nSitemap: ${sitemapUrl}\n`; + } + + // Add AI bot restrictions if configured (default: true = allow, false = block) + if (seoConfig.aiBots === false) { + robotsContent += '\n# Block AI training bots\n'; + const aiBots = ['GPTBot', 'ChatGPT-User', 'Google-Extended', 'CCBot', 'anthropic-ai', 'Omgilibot', 'Omgili', 'FacebookBot', 'Diffbot', 'Bytespider', 'ImagesiftBot', 'cohere-ai']; + aiBots.forEach(bot => { + robotsContent += `User-agent: ${bot}\nDisallow: /\n`; + }); + } + + await fs.writeFile(robotsPath, robotsContent); + if (log) log('Generated robots.txt'); + + // Auto-generate .nojekyll at the site root. + // GitHub Pages runs Jekyll by default, which silently drops every file or + // directory whose name starts with a dot โ€” including .docmd-search/ (the + // semantic index) and .docmd-search-client.js (the browser bundle). + // An empty .nojekyll file disables Jekyll so those assets are served as-is. + // This is a zero-config fix: users deploying to GitHub Pages never need to + // think about it. + const nojekyllPath = path.join(outputDir, '.nojekyll'); + if (!nativeFs.existsSync(nojekyllPath)) { + await fs.writeFile(nojekyllPath, ''); + if (log) log('Generated .nojekyll (disables Jekyll on GitHub Pages)'); + } +} \ No newline at end of file diff --git a/packages/plugins/seo/tsconfig.json b/packages/plugins/seo/tsconfig.json new file mode 100644 index 0000000..7befc89 --- /dev/null +++ b/packages/plugins/seo/tsconfig.json @@ -0,0 +1,10 @@ +{ + "extends": "../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "./dist", + "rootDir": "./src", + "strict": false + }, + "include": ["src/**/*"], + "exclude": ["node_modules", "dist", "**/*.test.ts"] +} \ No newline at end of file diff --git a/packages/plugins/sitemap/LICENSE b/packages/plugins/sitemap/LICENSE new file mode 100644 index 0000000..997bb73 --- /dev/null +++ b/packages/plugins/sitemap/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025-present docmd.io + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/packages/plugins/sitemap/README.md b/packages/plugins/sitemap/README.md new file mode 100644 index 0000000..4429bfb --- /dev/null +++ b/packages/plugins/sitemap/README.md @@ -0,0 +1,23 @@ +# @docmd/plugin-sitemap + +Automatically generates `sitemap.xml` for your docmd site at build time. Requires `siteUrl` in your config to produce valid absolute URLs. Bundled with `@docmd/core`. + +```js +// docmd.config.js +module.exports = { + siteUrl: 'https://mysite.com', // required + plugins: { + sitemap: { defaultChangefreq: 'weekly', defaultPriority: 0.8 } + } +}; +``` + +Part of the **[docmd](https://github.com/docmd-io/docmd)** documentation engine. + +## Documentation + +See **[docs.docmd.io](https://docs.docmd.io)** for full usage and API reference. + +## License + +MIT \ No newline at end of file diff --git a/packages/plugins/sitemap/package.json b/packages/plugins/sitemap/package.json new file mode 100644 index 0000000..d025358 --- /dev/null +++ b/packages/plugins/sitemap/package.json @@ -0,0 +1,58 @@ +{ + "name": "@docmd/plugin-sitemap", + "version": "0.8.12", + "description": "Sitemap generator plugin for docmd.", + "type": "module", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "docmd": { + "key": "sitemap", + "kind": "plugin", + "displayName": "Sitemap", + "tagline": "Sitemap generator for docmd.", + "capabilities": [ + "post-build" + ] + }, + "scripts": { + "build": "tsc" + }, + "files": [ + "dist" + ], + "engines": { + "node": ">=18" + }, + "devDependencies": { + "@docmd/api": "workspace:*", + "@types/node": "^24.13.3" + }, + "keywords": [ + "docmd", + "plugin", + "sitemap", + "xml", + "url", + "seo", + "markdown", + "minimalist", + "zero-config", + "site-generator", + "static-site-generator", + "docs" + ], + "author": { + "name": "Ghazi", + "url": "https://mgks.dev" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/docmd-io/docmd.git" + }, + "bugs": { + "url": "https://github.com/docmd-io/docmd/issues" + }, + "homepage": "https://docmd.io", + "funding": "https://github.com/sponsors/mgks", + "license": "MIT" +} \ No newline at end of file diff --git a/packages/plugins/sitemap/src/index.ts b/packages/plugins/sitemap/src/index.ts new file mode 100644 index 0000000..49b0f37 --- /dev/null +++ b/packages/plugins/sitemap/src/index.ts @@ -0,0 +1,83 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/core (and ecosystem) + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + */ + +import path from 'path'; +import fs from 'fs/promises'; +import type { PluginDescriptor } from '@docmd/api'; +import { outputPathToPathname, sanitizeUrl } from '@docmd/api'; + +export const plugin: PluginDescriptor = { + name: 'sitemap', + version: '0.8.12', + capabilities: ['post-build'] +}; + +/** + * Hook to run after the build is complete. + * @param {Object} context + * @param {Object} context.config - The parsed project config + * @param {Array} context.pages - Array of page objects { outputPath, frontmatter } + * @param {string} context.outputDir - Absolute path to output directory + * @param {Function} context.log - Logger function + */ + +export async function onPostBuild({ config, pages, outputDir, log }: any) { + // 1. Check if enabled + if (config.plugins?.sitemap === false || !config.url) { + if (!config.url && log) log('Skipping sitemap: "url" is missing in config', 'SKIP'); + return; + } + + const siteUrl = config.url.replace(/\/$/, ''); + + // 2. Build XML Header + let sitemapXml = '\n'; + sitemapXml += '\n'; + + // 3. Defaults + const defaultChangefreq = config.plugins?.sitemap?.defaultChangefreq || 'weekly'; + const defaultPriority = config.plugins?.sitemap?.defaultPriority || 0.8; + const rootPriority = config.plugins?.sitemap?.rootPriority || 1.0; + + // 4. Loop Pages + for (const page of pages) { + const fm = page.frontmatter || {}; + + // Skip hidden pages + if (fm.sitemap === false || fm.noindex === true) continue; + + // Use centralised URL utility for consistent URL generation. + // This is the single source of truth - no manual outputPath parsing. + const pathname = outputPathToPathname(page.outputPath); + const url = sanitizeUrl(siteUrl + pathname); + + // Metadata Logic + const isRoot = pathname === '/'; + const priority = fm.priority || (isRoot ? rootPriority : defaultPriority); + const changefreq = fm.changefreq || defaultChangefreq; + + sitemapXml += ' \n'; + sitemapXml += ` ${url}\n`; + if (fm.lastmod) sitemapXml += ` ${fm.lastmod}\n`; + sitemapXml += ` ${changefreq}\n`; + sitemapXml += ` ${priority}\n`; + sitemapXml += ' \n'; + } + + sitemapXml += ''; + + // 5. Write File + await fs.writeFile(path.join(outputDir, 'sitemap.xml'), sitemapXml); + if (log) log('Sitemap generated'); +} \ No newline at end of file diff --git a/packages/plugins/sitemap/tsconfig.json b/packages/plugins/sitemap/tsconfig.json new file mode 100644 index 0000000..7befc89 --- /dev/null +++ b/packages/plugins/sitemap/tsconfig.json @@ -0,0 +1,10 @@ +{ + "extends": "../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "./dist", + "rootDir": "./src", + "strict": false + }, + "include": ["src/**/*"], + "exclude": ["node_modules", "dist", "**/*.test.ts"] +} \ No newline at end of file diff --git a/packages/plugins/threads/LICENSE b/packages/plugins/threads/LICENSE new file mode 100644 index 0000000..997bb73 --- /dev/null +++ b/packages/plugins/threads/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025-present docmd.io + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/packages/plugins/threads/README.md b/packages/plugins/threads/README.md new file mode 100644 index 0000000..8ac59e6 --- /dev/null +++ b/packages/plugins/threads/README.md @@ -0,0 +1,19 @@ +# @docmd/plugin-threads + +Adds inline discussion threads to your docmd site - stored directly in Markdown as `::: threads` containers, so comments live in your repo and sync with your Git and PR workflows. Supports text highlighting, replies, thread resolution, and emoji reactions. An optional plugin, installed separately. + +```bash +docmd add threads +``` + +Original author: [@svallory](https://github.com/svallory) + +Part of the **[docmd](https://github.com/docmd-io/docmd)** documentation engine. + +## Documentation + +See **[docs.docmd.io](https://docs.docmd.io)** for full usage and API reference. + +## License + +MIT \ No newline at end of file diff --git a/packages/plugins/threads/build.js b/packages/plugins/threads/build.js new file mode 100644 index 0000000..c5e6348 --- /dev/null +++ b/packages/plugins/threads/build.js @@ -0,0 +1,31 @@ +import esbuild from 'esbuild'; +import path from 'path'; +import { fileURLToPath } from 'url'; + +const __dirname = path.dirname(fileURLToPath(import.meta.url)); + +async function build() { + await esbuild.build({ + entryPoints: [path.resolve(__dirname, 'src/client/index.ts')], + bundle: true, + platform: 'browser', + target: 'es2022', + format: 'esm', + outdir: path.resolve(__dirname, 'dist/client'), + minify: false, + sourcemap: 'inline', + loader: { '.css': 'css' }, + tsconfigRaw: JSON.stringify({ + compilerOptions: { + experimentalDecorators: true, + useDefineForClassFields: false, + }, + }), + }); + console.log('Client built to dist/client/'); +} + +build().catch((err) => { + console.error(err); + process.exit(1); +}); diff --git a/packages/plugins/threads/e2e/basic-ui.e2e.spec.ts b/packages/plugins/threads/e2e/basic-ui.e2e.spec.ts new file mode 100644 index 0000000..93ee77a --- /dev/null +++ b/packages/plugins/threads/e2e/basic-ui.e2e.spec.ts @@ -0,0 +1,216 @@ +/** + * Basic UI tests - adapted from old devtalk.e2e.spec.ts "basic UI" describe block. + * + * Changes from old plugin: + * - No sidebar panel/toggle button (inline-only architecture) + * - threads-app replaces devtalk-app as root element + * - "New Thread" button replaces sidebar toggle + * - Threads rendered server-side with .threads-* classes + */ + +import { test, expect } from "@playwright/test"; +import { Actor, NavigateTo } from "./screenplay.ts"; +import { setAuthor, waitForClientProcessing } from "./helpers.ts"; + + + +let user: Actor; + +test.beforeEach(async ({ page }) => { + user = new Actor("TestUser", page); + await page.goto("/"); + await page.waitForSelector("threads-app", { state: "attached", timeout: 10_000 }); + await setAuthor(page, "TestUser"); + // NOTE: Do NOT clean threads here - these tests verify the pre-existing + // threads from the playground markdown (index.md ::: threads block) + // Wait for client-side JS to finish processing highlights + await waitForClientProcessing(page); +}); + +test.describe("threads plugin - basic UI", () => { + test("loads on the page with threads-app element", async () => { + await user.perform(NavigateTo.path("/")); + const app = user.page.locator("threads-app"); + await expect(app).toBeAttached(); + }); + + test("New Thread button is injected into the content area", async () => { + await user.perform(NavigateTo.path("/")); + const btn = user.page.locator(".threads-new-thread-btn").first(); + await expect(btn).toBeVisible({ timeout: 5_000 }); + await expect(btn).toContainText("New Thread"); + }); + + test("server-rendered threads appear with correct class structure", async () => { + // The playground index.md has pre-existing threads in the ::: threads block + await user.perform(NavigateTo.path("/")); + + // There should be thread cards rendered from the markdown + const threads = user.page.locator(".threads-thread[data-thread-id]"); + const count = await threads.count(); + expect(count).toBeGreaterThan(0); + + // Each thread should have at least one comment + const firstThread = threads.first(); + const comments = firstThread.locator(".threads-comment"); + await expect(comments.first()).toBeAttached(); + }); + + test("highlights appear on marked text", async () => { + await user.perform(NavigateTo.path("/")); + + // The playground has ==highlighted text=={thread-id} in the markdown + const highlights = user.page.locator("mark.threads-highlight[data-thread-id]"); + const count = await highlights.count(); + expect(count).toBeGreaterThan(0); + }); + + test("highlights have cycling colors (not all the same)", async () => { + await user.perform(NavigateTo.path("/")); + await waitForClientProcessing(user.page); + + const highlights = user.page.locator("mark.threads-highlight[data-thread-id]"); + const count = await highlights.count(); + + if (count < 2) { + test.skip(true, "Need at least 2 highlights to test color cycling"); + return; + } + + // Collect all highlight color classes + const colorClasses: string[] = []; + for (let i = 0; i < count; i++) { + const classList = await highlights.nth(i).evaluate((el) => + Array.from(el.classList).filter((c) => c.startsWith("threads-hl-")), + ); + colorClasses.push(...classList); + } + + // With 2+ highlights, we should see at least 2 different colors + const uniqueColors = new Set(colorClasses); + expect(uniqueColors.size).toBeGreaterThanOrEqual(2); + }); + + test("thread cards are placed inline after their highlighted block", async () => { + await user.perform(NavigateTo.path("/")); + await waitForClientProcessing(user.page); + + // Find a highlight mark that has a corresponding thread card + const highlights = user.page.locator("mark.threads-highlight[data-thread-id]"); + const firstHighlight = highlights.first(); + + if ((await firstHighlight.count()) === 0) { + test.skip(true, "No highlights found on the page"); + return; + } + + const threadId = await firstHighlight.getAttribute("data-thread-id"); + if (!threadId) return; + + const threadCard = user.page.locator(`.threads-thread[data-thread-id="${threadId}"]`); + await expect(threadCard).toBeAttached(); + + // Thread card should appear after the highlight's parent block in document order + const isAfterHighlight = await user.page.evaluate( + ({ threadId }) => { + const mark = document.querySelector(`mark.threads-highlight[data-thread-id="${threadId}"]`); + const thread = document.querySelector(`.threads-thread[data-thread-id="${threadId}"]`); + if (!mark || !thread) return false; + return mark.compareDocumentPosition(thread) & Node.DOCUMENT_POSITION_FOLLOWING; + }, + { threadId }, + ); + expect(isAfterHighlight).toBeTruthy(); + }); + + test("thread cards have matching border colors to their highlights", async () => { + await user.perform(NavigateTo.path("/")); + await waitForClientProcessing(user.page); + + const highlights = user.page.locator("mark.threads-highlight[data-thread-id]"); + const firstHighlight = highlights.first(); + + if ((await firstHighlight.count()) === 0) { + test.skip(true, "No highlights found"); + return; + } + + const threadId = await firstHighlight.getAttribute("data-thread-id"); + if (!threadId) return; + + // Get the highlight's color class + const hlColorClass = await firstHighlight.evaluate((el) => + Array.from(el.classList).find((c) => c.startsWith("threads-hl-")), + ); + + if (!hlColorClass) return; + + // The thread card should have the matching border class + const expectedBorderClass = hlColorClass.replace("threads-hl-", "threads-border-"); + const threadCard = user.page.locator(`.threads-thread[data-thread-id="${threadId}"]`); + const hasBorderClass = await threadCard.evaluate( + (el, cls) => el.classList.contains(cls), + expectedBorderClass, + ); + expect(hasBorderClass).toBe(true); + }); + + test("clicking a highlight scrolls to and flashes its thread", async () => { + await user.perform(NavigateTo.path("/")); + await waitForClientProcessing(user.page); + + const highlights = user.page.locator("mark.threads-highlight[data-thread-id]"); + const firstHighlight = highlights.first(); + + if ((await firstHighlight.count()) === 0) { + test.skip(true, "No highlights found"); + return; + } + + await firstHighlight.click(); + + // After clicking, the thread card should receive the flash class + const threadId = await firstHighlight.getAttribute("data-thread-id"); + const threadCard = user.page.locator(`.threads-thread[data-thread-id="${threadId}"]`); + await expect(threadCard).toHaveClass(/threads-thread--flash/, { timeout: 2_000 }); + }); + + test("popover hidden initially without text selection", async () => { + await user.perform(NavigateTo.path("/")); + + // Without any text selection, the popover should not show + await expect( + user.page.locator("threads-popover").getByText("Add comment"), + ).not.toBeVisible(); + }); + + test("reply buttons present on thread cards", async () => { + await user.perform(NavigateTo.path("/")); + + const threads = user.page.locator(".threads-thread[data-thread-id]"); + const count = await threads.count(); + + if (count === 0) { + test.skip(true, "No threads on page"); + return; + } + + // Each thread should have a Reply button + for (let i = 0; i < count; i++) { + const thread = threads.nth(i); + const replyBtn = thread.locator(".threads-comment-reply-btn").first(); + await expect(replyBtn).toBeAttached(); + await expect(replyBtn).toContainText("Reply"); + } + }); + + test("threads-sidebar container is hidden", async () => { + await user.perform(NavigateTo.path("/")); + + const sidebar = user.page.locator(".threads-sidebar"); + if ((await sidebar.count()) > 0) { + // The sidebar wrapper should be hidden (display: none) + await expect(sidebar).toBeHidden(); + } + }); +}); diff --git a/packages/plugins/threads/e2e/comment-display.e2e.spec.ts b/packages/plugins/threads/e2e/comment-display.e2e.spec.ts new file mode 100644 index 0000000..9cb3a83 --- /dev/null +++ b/packages/plugins/threads/e2e/comment-display.e2e.spec.ts @@ -0,0 +1,142 @@ +/** + * Comment display tests - adapted from old comment-display.e2e.spec.ts. + * + * Changes from old plugin: + * - Comments are server-rendered HTML (.threads-comment) not Lit components + * - Server-rendered comments have .threads-comment__meta and .threads-comment__body + * - Author info comes from data-author attribute on .threads-comment element + * - Date comes from data-date attribute + * - No "just now" time formatting (server renders static date strings like "2026-03-09") + */ + +import { test, expect } from "@playwright/test"; +import { Actor } from "./screenplay.ts"; +import { cleanThreads, setAuthor, seedAndReload, waitForReload } from "./helpers.ts"; + +let user: Actor; + +test.beforeEach(async ({ page }) => { + user = new Actor("TestUser", page); + await page.goto("/"); + await page.waitForSelector("threads-app", { state: "attached", timeout: 10_000 }); + await setAuthor(page, "TestUser"); + await cleanThreads(page); + await waitForReload(page); +}); + +test.describe("comment display", () => { + test("author name is displayed on the comment", async () => { + const { id: threadId } = await seedAndReload(user.page, { + author: "Alice", + body: "Hello from Alice", + }); + + const thread = user.page.locator(`.threads-thread[data-thread-id="${threadId}"]`); + await expect(thread).toBeAttached({ timeout: 5_000 }); + + // Server-rendered comment should show the author + const meta = thread.locator(".threads-comment__meta").first(); + await expect(meta).toContainText("Alice"); + }); + + test("comment body is displayed", async () => { + const { id: threadId } = await seedAndReload(user.page, { + author: "TestUser", + body: "This is the comment body text", + }); + + const thread = user.page.locator(`.threads-thread[data-thread-id="${threadId}"]`); + await expect(thread).toBeAttached({ timeout: 5_000 }); + + const body = thread.locator(".threads-comment__body").first(); + await expect(body).toContainText("This is the comment body text"); + }); + + test("date is displayed on the comment", async () => { + const { id: threadId } = await seedAndReload(user.page, { + author: "TestUser", + body: "Date display test", + }); + + const thread = user.page.locator(`.threads-thread[data-thread-id="${threadId}"]`); + await expect(thread).toBeAttached({ timeout: 5_000 }); + + // Server-rendered meta should contain a date (format: YYYY-MM-DD) + const meta = thread.locator(".threads-comment__meta").first(); + const metaText = await meta.textContent(); + // Should contain a date pattern like 2026-03-09 + expect(metaText).toMatch(/\d{4}-\d{2}-\d{2}/); + }); + + test("comment has data-author attribute", async () => { + const { id: threadId } = await seedAndReload(user.page, { + author: "Bob", + body: "Attribute test", + }); + + const thread = user.page.locator(`.threads-thread[data-thread-id="${threadId}"]`); + const comment = thread.locator(".threads-comment").first(); + await expect(comment).toHaveAttribute("data-author", "Bob"); + }); + + test("multiple comments displayed in order", async () => { + const { id: threadId } = await seedAndReload(user.page, { + author: "Alice", + body: "First comment", + replies: [ + { author: "Bob", body: "Second comment" }, + { author: "Charlie", body: "Third comment" }, + ], + }); + + let thread = user.page.locator(`.threads-thread[data-thread-id="${threadId}"]`); + await expect(thread).toBeAttached({ timeout: 5_000 }); + + // The dev server may need an additional reload to pick up the last reply + let comments = thread.locator(".threads-comment"); + if ((await comments.count()) < 3) { + await waitForReload(user.page); + thread = user.page.locator(`.threads-thread[data-thread-id="${threadId}"]`); + comments = thread.locator(".threads-comment"); + } + await expect(comments).toHaveCount(3); + + await expect(comments.nth(0).locator(".threads-comment__body")).toContainText("First comment"); + await expect(comments.nth(1).locator(".threads-comment__body")).toContainText("Second comment"); + await expect(comments.nth(2).locator(".threads-comment__body")).toContainText("Third comment"); + }); +}); + +test.describe("markdown rendering in comments", () => { + test("comment body renders inline markdown from markdown-it", async () => { + // Server-rendered comments go through markdown-it, which handles bold/italic/code + const { id: threadId } = await seedAndReload(user.page, { + body: "Use `console.log()` for debugging", + }); + + const thread = user.page.locator(`.threads-thread[data-thread-id="${threadId}"]`); + const body = thread.locator(".threads-comment__body").first(); + await expect(body).toBeAttached({ timeout: 5_000 }); + + // markdown-it should render backtick as + const codeEl = body.locator("code"); + await expect(codeEl).toBeAttached(); + }); + + test("HTML special characters are escaped", async () => { + const { id: threadId } = await seedAndReload(user.page, { + body: "", + }); + + const thread = user.page.locator(`.threads-thread[data-thread-id="${threadId}"]`); + const body = thread.locator(".threads-comment__body").first(); + await expect(body).toBeAttached({ timeout: 5_000 }); + + // No live + <% } %> + + + + <%- typeof faviconLinkHtml !== 'undefined' ? faviconLinkHtml : '' %> + + <%# โ”€โ”€ Highlight.js themes โ€” light + dark, toggled by theme-init โ”€โ”€ %> + <% if (config.theme?.codeHighlight !== false) { const isDarkDefault = appearance === 'dark'; %> + > + > + <% } %> + + <%- pluginHeadScriptsHtml || '' %> + <% (customCssFiles || []).forEach(cssFile => { %> + + <% }); %> + + <% + const _noSidebar = (sidebarConfig?.enabled === false); + const _noToc = (config.theme?.toc === false); + const _noHeader = (headerConfig?.enabled === false); + const _hasMenubar = (locals.menubarConfig && menubarConfig?.enabled !== false); + const _hasBanner = (locals.config && config.layout && config.layout.banner); + const _bodyClasses = ['summer-template']; + if (_noSidebar) _bodyClasses.push('no-sidebar'); + if (_noToc) _bodyClasses.push('no-toc'); + if (_noHeader) _bodyClasses.push('no-header'); + if (_hasMenubar) _bodyClasses.push('has-menubar'); + if (_hasBanner) _bodyClasses.push('has-banner'); + %> + + + data-spa-enabled="<%= (config.layout?.spa !== false).toString() %>" + data-copy-code-enabled="<%= (config.copyCode === true).toString() %>" + data-default-collapsed="<%= sidebarConfig?.defaultCollapsed === true %>"> + + + <%# โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ + Optional banner (data-docmd-banner is what docmd-main.js's + initBanner() listens for so close-state is sessionStorage-persisted) + โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ %> + <% if (_hasBanner) { %> +
      +
      + <%- typeof config.layout.banner === 'string' ? config.layout.banner : '' %> + +
      +
      + <% } %> + + <%# โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ + BAND 1: Top bar + โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ %> + + + <%# โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ + BAND 2: Sub-navigation (menubar) โ€” INLINED + โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ %> + <% if (_hasMenubar) { %> + + <% } %> + + <%# โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ + BAND 4: Layout grid (sidebar / main / TOC) + โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ %> +
      + + <%# โ”€โ”€ Sidebar (left) โ”€โ”€ %> + <% if (!_noSidebar) { %> + + <% } %> + + <%# โ”€โ”€ Main content (center) โ”€โ”€ %> +
      + <% if (headerConfig?.enabled !== false) { %> +
      +
      + <%# Breadcrumb + page title row %> +
      + <% if (config.layout?.breadcrumbs !== false && locals.breadcrumbs && breadcrumbs.length > 0) { %> + + <% } %> +
      + +
      + <% if (config.theme?.copyWidgets?.raw !== false) { %> + + <% } %> + <% if (config.theme?.copyWidgets?.context !== false) { %> + + <% } %> +
      +
      +
      + <% } %> + + <% if (headerConfig?.enabled === false) { %> +

      <%= pageTitle %>

      + <% } %> + + + +
      + <%- content %> +
      + + <% if (config.pageNavigation && (prevPage || nextPage)) { %> + + <% } %> + + <% if (locals.frontmatter?._git?.lastUpdatedTimestamp || locals.editUrl) { %> + + <% } %> +
      + + <%# โ”€โ”€ Right-rail TOC (INLINED) โ”€โ”€ %> + <% if (!_noToc) { %> + <% + const _tocDisabled = (frontmatter && (frontmatter.toc === false || frontmatter.toc === 'false' || frontmatter.toc === 'hidden')); + let _tocHeadings = []; + if (!_tocDisabled) { + if (typeof headings !== 'undefined' && Array.isArray(headings) && headings.length > 0) { + _tocHeadings = headings.filter(h => h.level >= 1 && h.level <= 4); + } else if (typeof content !== 'undefined' && content) { + const _hr = /]*?(?:id="([^"]*)")?[^>]*?>([\s\S]*?)<\/h\1>/g; + const _cs = content.toString(); + for (const _m of _cs.matchAll(_hr)) { + const _lvl = parseInt(_m[1], 10); + let _id = _m[2]; + const _txt = String(_m[3]).replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"').replace(/'/g, "'").replace(/ /g, ' ').replace(/<\/?\w+[^>]*>/g, ''); + if (!_id) _id = _txt.toLowerCase().replace(/\s+/g, '-').replace(/[^\w-]/g, '').replace(/--+/g, '-').replace(/^-+|-+$/g, ''); + _tocHeadings.push({ id: _id, level: _lvl, text: _txt }); + } + } + } + %> + <% if (_tocHeadings.length > 1) { %> +
      + +
      + <% } %> + <% } %> +
      + + + + <%# โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ + BAND 5: Footer โ€” INLINED + โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ %> + <% + const _fc = (typeof footerConfig !== 'undefined' ? footerConfig : (locals.footerConfig || {})); + %> + <% if (_fc?.style === 'complete' && Array.isArray(_fc.columns) && _fc.columns.length) { %> +
      + + +
      + <% } else { %> +
      + +
      + <% } %> + + <% if (locals.allLocales && allLocales && allLocales.length > 1) { %> + + <% } %> + + + <%- pluginBodyScriptsHtml || '' %> + <% (customJsFiles || []).forEach(jsFile => { if (jsFile && jsFile.trim() !== '') { %> + + <% } }); %> + + diff --git a/packages/templates/summer/templates/partials/footer.ejs b/packages/templates/summer/templates/partials/footer.ejs new file mode 100644 index 0000000..980bf74 --- /dev/null +++ b/packages/templates/summer/templates/partials/footer.ejs @@ -0,0 +1,69 @@ +<%# --------------------------------------------------------------- + # @docmd/template-summer โ€” partials/footer.ejs + # + # Two visual styles: + # - "complete" (config.footer.style === 'complete') โ€” multi-column + # footer with branding, description, link columns + # - "minimal" / default โ€” single-line bar with copyright + branding + # --------------------------------------------------------------- +%> +<% const _fc = (typeof footerConfig !== 'undefined' ? footerConfig : (locals.footerConfig || {})); %> +<% if (_fc?.style === 'complete' && Array.isArray(_fc.columns) && _fc.columns.length) { %> +
      + + +
      +<% } else { %> +
      + +
      +<% } %> \ No newline at end of file diff --git a/packages/templates/summer/templates/partials/menubar.ejs b/packages/templates/summer/templates/partials/menubar.ejs new file mode 100644 index 0000000..76b5ea6 --- /dev/null +++ b/packages/templates/summer/templates/partials/menubar.ejs @@ -0,0 +1,92 @@ +<%# --------------------------------------------------------------- + # @docmd/template-summer โ€” partials/menubar.ejs + # + # Sits in a sticky sub-nav bar BELOW the top header. Each item is + # rendered as a tab. Supports dropdowns, icons, and a trailing + # action slot (right side of the bar) used for tertiary controls. + # --------------------------------------------------------------- +%> +<% + const menubar = (typeof menubarConfig !== 'undefined' ? menubarConfig : (locals.menubarConfig || {})); + const left = Array.isArray(menubar.left) ? menubar.left : []; + const right = Array.isArray(menubar.right) ? menubar.right : []; + + // Detect the active item: prefer explicit `active` flag, else match by URL + function isActive(item) { + if (item.active) return true; + if (!currentPagePath) return false; + const itemUrl = (item.url || item.path || '').replace(/^\/+/, '').replace(/^index\.html$/, '').replace(/\/$/, ''); + const cur = (currentPagePath || '').replace(/^\/+/, '').replace(/^index\.html$/, '').replace(/\/$/, ''); + if (!itemUrl) return false; + return cur === itemUrl || cur.startsWith(itemUrl + '/'); + } + + function itemHref(item) { + if (item.url) return buildRelativeUrl(item.url); + if (item.path) return buildRelativeUrl(item.path); + return '#'; + } + + function renderTab(item) { + const active = isActive(item); + const href = itemHref(item); + const external = !!item.external; + const target = external ? ' target="_blank" rel="noopener noreferrer"' : ''; + const cls = 'summer-subnav__tab' + (active ? ' active' : ''); + const icon = item.icon ? `${renderIcon(item.icon)}` : ''; + const text = item.text || item.title || ''; + return `${icon}${text}${external ? 'โ†—' : ''}`; + } +%> +
      + <% left.forEach(item => { %> + <% if (item.type === 'dropdown') { %> +
      + + +
      + <% } else { %> + <%- renderTab(item) %> + <% } %> + <% }) %> + + <% if (left.length && right.length) { %> +
      + <% } %> + +
      + <% right.forEach(item => { %> + <% if (item.type === 'dropdown') { %> +
      + + +
      + <% } else { %> + <%- renderTab(item) %> + <% } %> + <% }) %> +
      +
      diff --git a/packages/templates/summer/templates/partials/options-menu.ejs b/packages/templates/summer/templates/partials/options-menu.ejs new file mode 100644 index 0000000..39fd5cc --- /dev/null +++ b/packages/templates/summer/templates/partials/options-menu.ejs @@ -0,0 +1,45 @@ +<%# --------------------------------------------------------------- + # @docmd/template-summer โ€” partials/options-menu.ejs + # + # Custom options menu for summer template. The search component is + # intentionally NOT rendered here because the top-bar already + # shows the search button. The remaining discrete actions + # (theme switch, language, project switcher, sponsor) are surfaced + # as icon buttons, styled with `.summer-iconbtn`. + # --------------------------------------------------------------- +%> +<% if (optionsMenu && optionsMenu.components) { %> +
      + <%# Note: search is rendered separately in the topbar, see layout.ejs %> + + <% if (locals.workspace && workspace.switcher.enabled && workspace.switcher.position === 'options-menu') { %> +
      + <%- await include('project-switcher', { workspace, config, renderIcon, compact: true }) %> +
      + <% } %> + + <% if (locals.allLocales && allLocales && allLocales.length > 1 && locals.config && config.i18n && config.i18n.position === 'options-menu') { %> +
      + <%- await include('language-switcher', { allLocales, activeLocale: locals.activeLocale, defaultLocale: locals.defaultLocale, config, renderIcon, compact: true, currentPagePath: locals.currentPagePath, localePrefix: locals.localePrefix }) %> +
      + <% } %> + + <% if (optionsMenu.components.themeSwitch !== false) { %> + + <% } %> + + <% if (optionsMenu.components.sponsor) { %> + + + + <% } %> + + <% if (optionsMenu.components.github) { %> + + + + <% } %> +
      +<% } %> diff --git a/packages/templates/summer/templates/toc.ejs b/packages/templates/summer/templates/toc.ejs new file mode 100644 index 0000000..5cdd53d --- /dev/null +++ b/packages/templates/summer/templates/toc.ejs @@ -0,0 +1,53 @@ +<%# --------------------------------------------------------------- + # @docmd/template-summer โ€” toc.ejs + # + # Right-rail table of contents. We re-use the heading detection + # logic from the default template so the template stays + # plug-and-play, then style the result with `.summer-toc__*` + # classes that the rest of the stylesheet targets. + # --------------------------------------------------------------- +%> + +<% +function decodeHtmlEntities(html) { + return String(html).replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"').replace(/'/g, "'").replace(/ /g, ' '); +} + +// Skip on the no-style fallback and on pages that opt out via frontmatter. +const _tocDisabled = (frontmatter && (frontmatter.toc === false || frontmatter.toc === 'false' || frontmatter.toc === 'hidden')); +if (!_tocDisabled) { + let tocHeadings = []; + if (typeof headings !== 'undefined' && Array.isArray(headings) && headings.length > 0) { + tocHeadings = headings.filter(h => h.level >= 1 && h.level <= 4); + } else if (typeof content !== 'undefined' && content) { + const headingRegex = /]*?(?:id="([^"]*)")?[^>]*?>([\s\S]*?)<\/h\1>/g; + let match; + const contentStr = content.toString(); + while ((match = headingRegex.exec(contentStr)) !== null) { + const level = parseInt(match[1], 10); + let id = match[2]; + const text = decodeHtmlEntities(match[3].replace(/<\/?\w+[^>]*>/g, '')); + if (!id) id = text.toLowerCase().replace(/\s+/g, '-').replace(/[^\w-]/g, '').replace(/--+/g, '-').replace(/^-+|-+$/g, ''); + tocHeadings.push({ id, level, text }); + } + } + + if (tocHeadings.length > 1) { + // Build a nested list (preserve heading level) + let lastLevel = 0; +%> + +<% } } %> \ No newline at end of file diff --git a/packages/templates/summer/tsconfig.json b/packages/templates/summer/tsconfig.json new file mode 100644 index 0000000..85a5338 --- /dev/null +++ b/packages/templates/summer/tsconfig.json @@ -0,0 +1,10 @@ +{ + "extends": "../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "./dist", + "rootDir": "./src", + "strict": true + }, + "include": ["src/**/*"], + "exclude": ["node_modules", "dist", "**/*.test.ts"] +} \ No newline at end of file diff --git a/packages/themes/LICENSE b/packages/themes/LICENSE new file mode 100644 index 0000000..997bb73 --- /dev/null +++ b/packages/themes/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025-present docmd.io + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/packages/themes/README.md b/packages/themes/README.md new file mode 100644 index 0000000..43126d2 --- /dev/null +++ b/packages/themes/README.md @@ -0,0 +1,28 @@ +# @docmd/themes + +Official themes for docmd - three production-ready designs with full light/dark mode support, each customisable via CSS variables. + +| Theme | Style | +|:---|:---| +| **Sky** | Clean, modern, blue accents. Default. | +| **Ruby** | Elegant serif typography, red accents. | +| **Retro** | Terminal-style, neon, high contrast. | + +## Quick start + +```js +// docmd.config.js +module.exports = { + theme: { name: 'retro' } +}; +``` + +Part of the **[docmd](https://github.com/docmd-io/docmd)** documentation engine. + +## Documentation + +See **[docs.docmd.io/theming](https://docs.docmd.io/theming)** for customisation options and CSS variable reference. + +## License + +MIT \ No newline at end of file diff --git a/packages/themes/package.json b/packages/themes/package.json new file mode 100644 index 0000000..98669b4 --- /dev/null +++ b/packages/themes/package.json @@ -0,0 +1,56 @@ +{ + "name": "@docmd/themes", + "version": "0.8.12", + "description": "Official themes for docmd.", + "type": "module", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "exports": { + ".": "./dist/index.js" + }, + "scripts": { + "build": "tsc" + }, + "files": [ + "dist", + "src" + ], + "engines": { + "node": ">=18" + }, + "devDependencies": { + "@types/node": "^24.13.3" + }, + "keywords": [ + "docmd", + "themes", + "theme", + "theme-pack", + "css", + "scss", + "stylesheets", + "sky", + "retro", + "ruby", + "markdown", + "minimalist", + "zero-config", + "site-generator", + "static-site-generator", + "docs" + ], + "author": { + "name": "Ghazi", + "url": "https://mgks.dev" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/docmd-io/docmd.git" + }, + "bugs": { + "url": "https://github.com/docmd-io/docmd/issues" + }, + "homepage": "https://docmd.io", + "funding": "https://github.com/sponsors/mgks", + "license": "MIT" +} \ No newline at end of file diff --git a/packages/themes/src/docmd-theme-retro.css b/packages/themes/src/docmd-theme-retro.css new file mode 100644 index 0000000..1085f6e --- /dev/null +++ b/packages/themes/src/docmd-theme-retro.css @@ -0,0 +1,287 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/core (and ecosystem) + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + */ + +/* + * Retro Theme : "Classic Computing" + * A clean, high-performance take on vintage computing aesthetics. + * Features: IBM Amber/Phosphor Green tones, sharp corners, and + * the modern "Sky" structural layout. + */ + +@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500&family=IBM+Plex+Mono:wght@400;500;600&display=swap'); + +:root { + --retro-primary: #916400; + /* Classic IBM Amber */ + --retro-bg-dark: #121212; + --retro-bg-light: #fdf6e3; + /* Solarized light / Old paper */ +} + +:root[data-theme=light] { + --accent-color: var(--retro-primary); + --retro-primary-light: rgba(255, 176, 0, 0.1); + --retro-primary-dark: #b37b00; + --bg-color: var(--retro-bg-light); + --text-color: #111111; + --text-heading: #000000; + --border-color: #dc9700; + --border-color-hover: #966700; + --border-color-codeblock: #efc15b; + --text-muted: #4d4d4d; + --sidebar-bg: #fffcf3; + --sidebar-text: #333333; + --sidebar-link-active-bg: rgba(255, 176, 0, 0.15); + --sidebar-link-active-text: var(--retro-primary-dark); + --link-color: var(--retro-primary-dark); + --link-color-hover: #8f6200; + --code-text: var(--retro-primary-dark); + --scrollbar-thumb: #d3cbb0; + --scrollbar-thumb-hover: var(--retro-primary-dark); + --radius-sm: 3px; + --radius-md: 3px; +} + +:root[data-theme=dark] { + --retro-primary: #33ff33; + /* Classic Phosphor Green */ + --accent-color: var(--retro-primary); + --retro-primary-light: rgba(51, 255, 51, 0.1); + --retro-primary-dark: #22cc22; + + --bg-color: var(--retro-bg-dark); + --text-color: #e0e0e0; + /* Brighter for better contrast on black */ + --text-heading: var(--retro-primary); + --text-muted: #888888; + + --sidebar-bg: #0a0a0a; + --sidebar-text: #a0a0a0; + --sidebar-link-active-bg: rgba(51, 255, 51, 0.15); + /* Explicit override */ + --sidebar-link-active-text: var(--retro-primary); + + --link-color: var(--retro-primary); + --border-color: #222; + --header-bg: var(--sidebar-bg); + --header-border: var(--border-color); + + --code-bg: #0a0a0a; + --code-text: var(--retro-primary); + + --scrollbar-thumb: #222; + --scrollbar-thumb-hover: var(--retro-primary); +} + +/* Base Overrides */ +body { + background-color: var(--sidebar-bg); +} + +h1, +h2, +h3, +h4, +h5, +h6 { + font-family: 'IBM Plex Mono', 'Fira Code', monospace; + font-weight: 600; +} + +.content-theme-cover { + position: fixed; + overflow: scroll; + height: 100%; + border: 1px solid var(--border-color); + margin-top: calc(var(--sticky-top-offset) + 5px); + border-radius: 3px 0 0 0; + background-color: var(--bg-color); +} + +.page-header, +.docmd-menubar { + background-color: var(--sidebar-bg); + border: 0; +} + +body.has-menubar-top:not(.no-header) { + --sticky-top-offset: calc(var(--header-h)); +} + +.sidebar { + border-right: 0; + padding-left: .25em; + background-color: var(--sidebar-bg); +} + +/* Navigation */ +.sidebar nav li.nav-group { + background-color: var(--retro-primary-light); + border-radius: var(--radius-sm); +} + +.sidebar nav .submenu { + border: 0; + background-color: var(--retro-primary-light); + margin: 0 .5em .5em; + padding: .25em; + border-radius: 4px; +} + +.sidebar nav li a, +.sidebar nav li .nav-label { + font-family: 'IBM Plex Mono', monospace; + font-size: 13px; + color: var(--sidebar-text); +} + +/* Fix leaking Sky colors on selection and hover */ +.sidebar nav li a.active, +.sidebar nav li a:hover, +.theme-toggle-button:hover, +.docmd-tabs-nav-item:hover, +.copy-code-button:hover { + background-color: var(--sidebar-link-active-bg) !important; + color: var(--sidebar-link-active-text) !important; +} + +.sidebar nav li a.active { + font-weight: 600; + box-shadow: inset 3px 0 0 var(--accent-color); +} + +/* UI Elements */ +.content-area .button { + background-color: var(--accent-color); + color: #000; + font-family: 'IBM Plex Mono', monospace; + font-weight: 600; + border-radius: 2px; +} + +.content-area .button:hover { + opacity: 0.9; + box-shadow: 0 0 10px var(--retro-primary-light); +} + +.docmd-container { + border-radius: var(--radius-sm); + padding: 1rem; +} + +/* Callouts */ +.callout-info .callout-title::before { + content: ":: INFO :: "; +} + +.callout-warning .callout-title::before { + content: ":: WARN :: "; +} + +.callout-tip .callout-title::before { + content: ":: HINT :: "; +} + +.callout-danger .callout-title::before { + content: ":: FAIL :: "; +} + +.callout-success .callout-title::before { + content: ":: PASS :: "; +} + +.callout .callout-title { + font-family: 'IBM Plex Mono', monospace; + text-transform: uppercase; + font-size: 12px; +} + +/* Custom Scrollbar */ +::-webkit-scrollbar { + width: 6px; + height: 6px; +} + +::-webkit-scrollbar-track { + background: transparent; +} + +/* Fix Scrollbars - use var() from root */ +::-webkit-scrollbar-thumb { + background-color: var(--scrollbar-thumb) !important; +} + +::-webkit-scrollbar-thumb:hover { + background-color: var(--scrollbar-thumb-hover) !important; +} + +.sidebar::-webkit-scrollbar-thumb, +.toc-list::-webkit-scrollbar-thumb, +.docmd-search-results::-webkit-scrollbar-thumb, +pre::-webkit-scrollbar-thumb, +.table-wrapper::-webkit-scrollbar-thumb { + background-color: transparent !important; +} + +.sidebar:hover::-webkit-scrollbar-thumb, +.toc-list:hover::-webkit-scrollbar-thumb, +.docmd-search-results:hover::-webkit-scrollbar-thumb, +pre:hover::-webkit-scrollbar-thumb, +.table-wrapper:hover::-webkit-scrollbar-thumb { + background-color: var(--scrollbar-thumb) !important; +} + +/* Options Menu */ +.docmd-search-trigger .search-label, +.docmd-options-menu .lucide-icon { + color: var(--accent-color); +} + +.docmd-options-menu .theme-toggle-button, +.docmd-options-menu .sponsor-link-button { + border-radius: 4px; + border: 1px solid var(--border-color); +} + +.docmd-options-menu .theme-toggle-button:hover { + border-color: var(--accent-color); +} + +/* Misc */ +.footer-complete { + background-color: var(--bg-color); + border-top: 1px solid var(--border-color); + margin-top: 2rem; +} + +.docmd-kbd { + background-color: var(--retro-primary-light); + color: var(--accent-color); + border: 1px solid var(--border-color); + font-family: 'IBM Plex Mono', monospace; +} + +.docmd-options-menu .theme-toggle-button, +.docmd-options-menu .sponsor-link-button, +.docmd-options-menu .docmd-search-trigger { + border-radius: 3px; +} + +.docmd-options-menu .sponsor-link-button:hover { + background-color: var(--bg-color); +} + +.toc-sidebar { + top: 1em; +} \ No newline at end of file diff --git a/packages/themes/src/docmd-theme-ruby.css b/packages/themes/src/docmd-theme-ruby.css new file mode 100644 index 0000000..fbc97f9 --- /dev/null +++ b/packages/themes/src/docmd-theme-ruby.css @@ -0,0 +1,143 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/core (and ecosystem) + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + */ + +/* + * Ruby Theme + * Inspired by the beauty of gemstones + * Features: Deep ruby red, elegant serif fonts, subtle gem-like effects + */ + +@import "https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;500;600;700&family=Source+Sans+Pro:wght@300;400;600;700&display=swap"; + +:root { + --ruby-font-family-sans: "Source Sans Pro", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; + --ruby-font-family-serif: "Playfair Display", Georgia, "Times New Roman", serif; +} + +:root[data-theme=light] { + --ruby-primary: #b30000; + --ruby-primary-light: #ffebee; + --ruby-primary-dark: #8e0000; + --ruby-accent: #7b1fa2; + --ruby-text: #2d2d2d; + --ruby-background: #ffffff; + --ruby-border: #e0e0e0; + + --bg-color: var(--ruby-background); + --text-color: var(--ruby-text); + --text-heading: var(--ruby-text); + --text-muted: #5a5a5a; + --sidebar-bg: #f8f5f5; + --sidebar-text: #5a5a5a; + --sidebar-link-active-bg: #f8e7e7; + --sidebar-link-active-text: var(--ruby-primary); + --link-color: var(--ruby-primary); + --border-color: var(--ruby-border); + --header-bg: var(--ruby-background); + --header-border: var(--ruby-border); + --code-bg: var(--ruby-primary-light); + --code-text: var(--ruby-primary-dark); + --font-family-sans: var(--ruby-font-family-sans); +} + +:root[data-theme=dark] { + --ruby-primary: #ff5252; + --ruby-primary-light: #3c1a1a; + --ruby-primary-dark: #ff7b7b; + --ruby-accent: #ce93d8; + --ruby-text: #f0f0f0; + --ruby-background: #1a0a0a; + --ruby-border: #3a2020; + + --bg-color: var(--ruby-background); + --text-color: var(--ruby-text); + --text-heading: var(--ruby-text); + --text-muted: silver; + --sidebar-bg: #1a0a0a; + --sidebar-text: silver; + --sidebar-link-active-bg: #2a1515; + --sidebar-link-active-text: var(--ruby-primary); + --link-color: var(--ruby-primary); + --border-color: var(--ruby-border); + --header-bg: var(--ruby-background); + --header-border: var(--ruby-border); + --code-bg: var(--ruby-primary-light); + --code-text: var(--ruby-text); + --font-family-sans: var(--ruby-font-family-sans); +} + +/* Theme-specific overrides */ + +h1, +h2, +h3, +h4, +h5, +h6 { + font-family: var(--ruby-font-family-serif); +} + +h1::after { + content: ""; + display: block; + width: 60px; + height: 3px; + background: linear-gradient(90deg, var(--ruby-primary), var(--ruby-accent)); + margin-top: var(--space-2); + border-radius: var(--radius-sm); +} + +.content-area a:not(.button):not(.copy-code-button) { + position: relative; +} + +.content-area a:not(.button):not(.copy-code-button)::after { + content: ""; + position: absolute; + width: 100%; + height: 1px; + bottom: 0; + left: 0; + background: linear-gradient(90deg, var(--ruby-primary), var(--ruby-accent)); + transform: scaleX(0); + transform-origin: right bottom; + transition: transform 0.3s; +} + +.content-area a:not(.button):not(.copy-code-button):hover::after { + transform: scaleX(1); + transform-origin: left bottom; +} + +.docmd-container { + border-top: 3px solid var(--ruby-primary); +} + +.button, button:not(.theme-toggle-button):not(.copy-code-button):not(.docmd-search-trigger):not(.sidebar-toggle-button) { + background: linear-gradient(135deg, var(--ruby-primary) 0%, var(--ruby-accent) 100%); + color: #ffffff; + border: none; + border-radius: var(--radius-md); + font-weight: 600; +} + +.button:hover, button:not(.theme-toggle-button):not(.copy-code-button):not(.docmd-search-trigger):not(.sidebar-toggle-button):hover { + filter: brightness(110%); + transform: translateY(-1px); + box-shadow: var(--shadow-md); +} + +.docmd-options-menu .docmd-search-trigger { + background-color: transparent; +} \ No newline at end of file diff --git a/packages/themes/src/docmd-theme-sky.css b/packages/themes/src/docmd-theme-sky.css new file mode 100644 index 0000000..2aea5a8 --- /dev/null +++ b/packages/themes/src/docmd-theme-sky.css @@ -0,0 +1,250 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/core (and ecosystem) + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + */ + +/* + * Sky Theme + * Inspired by the clear blue sky + * Features: Blue tones, clean lines, subtle gradients + */ + +:root { + --sky-primary: #0097ff; +} + +:root[data-theme=light] { + --accent-color: #0097ff; + --sky-primary: #0097ff; + --sky-primary-light: #8acdff33; + --sky-primary-dark: #00497b; + --sky-text: #1a1f36; + --sky-text-light: #4a5568; + --sky-background: #ffffff; + --sky-background-alt: #f9fafb; + --sky-border: #e2e8f0; + --bg-color: var(--sky-background); + --text-color: var(--sky-text); + --text-heading: var(--sky-text); + --text-muted: var(--sky-text-light); + --sidebar-bg: #f7fafc; + --sidebar-text: var(--sky-text-light); + --sidebar-link-active-bg: var(--sky-primary-light); + --sidebar-link-active-text: var(--sky-primary); + --link-color: var(--sky-primary); + --border-color: #6dabff57; + --header-bg: var(--sky-background); + --header-border: var(--sky-border); + --code-bg: var(--sky-primary-light); + --code-text: var(--sky-primary-dark); +} + +:root[data-theme=dark] { + --sky-primary: #3b82f6; + --sky-primary-light: #1e293b; + --sky-primary-dark: #60a5fa; + --sky-text: #f1f5f9; + --sky-text-light: #cbd5e1; + --sky-background: #0f172a; + --sky-background-alt: #1e293b; + --sky-border: #334155; + + --bg-color: var(--sky-background); + --text-color: var(--sky-text); + --text-heading: var(--sky-text); + --text-muted: var(--sky-text-light); + --sidebar-bg: #0f172a; + --sidebar-text: var(--sky-text-light); + --sidebar-link-active-bg: #1e293b; + --sidebar-link-active-text: var(--sky-primary); + --link-color: var(--sky-primary); + --border-color: var(--sky-border); + --header-bg: var(--sky-background); + --header-border: var(--sky-border); + --code-bg: var(--sky-primary-light); + --code-text: var(--sky-text); +} + +/* Theme-specific overrides */ + +.callout-info .callout-title::before { + content: "โ„น๏ธ "; +} + +.callout-warning .callout-title::before { + content: "โš ๏ธ "; +} + +.callout-tip .callout-title::before { + content: "๐Ÿ’ก "; +} + +.callout-danger .callout-title::before { + content: "โŒ "; +} + +.callout-success .callout-title::before { + content: "โœ… "; +} + +.content-area .button { + background-color: var(--sky-primary); + color: #ffffff; + border-radius: var(--radius-md); +} + +.content-area .button:hover { + background-color: var(--sky-primary-dark); +} + +/* Polaroid effect */ +figure.polaroid { + background: #ffffff; + padding: 10px 10px 30px; + box-shadow: var(--shadow-md); + border-radius: var(--radius-sm); +} + +figure.polaroid figcaption { + background: #ffffff; + color: var(--sky-text); + font-size: 1.1rem; + font-style: italic; +} + +[data-theme=dark] figure.polaroid, +[data-theme=dark] figure.polaroid figcaption { + background: #1e293b; + color: var(--sky-text); +} + +.page-header, +.docmd-menubar { + background-color: var(--sidebar-bg); + border: 0; +} + +body.has-menubar-top:not(.no-header) { + --sticky-top-offset: calc(var(--header-h)); +} + +.sidebar { + border-right: 0; + padding-left: .25em; +} + +body { + background-color: var(--sidebar-bg); +} + +.content-theme-cover { + position: fixed; + overflow: scroll; + height: 100%; + border: 1px solid var(--sky-border); + margin-top: calc(var(--sticky-top-offset) + 5px); + border-radius: 1.5em 0 0 0; + background-color: var(--bg-color); +} + +.version-dropdown-toggle { + width: 80%; + margin: 0 auto; + border-radius: 1rem; + background-color: var(--sky-primary-light); +} + +.sidebar nav li.nav-group { + background-color: var(--sky-primary-light); + border-radius: 10px; +} + +.sidebar nav .submenu { + border: 0; + background-color: var(--sky-primary-light); + margin: 0 .5em .5em; + padding: .25em; + border-radius: 10px; +} + +.sidebar nav li a, +.sidebar nav li .nav-label { + color: var(--sky-primary-dark); +} + +.sidebar nav li { + margin: .25rem; +} + +.copy-code-button:hover, +.docmd-tabs-nav-item:hover, +.sidebar nav li a.active, +.sidebar nav li a:hover, +.theme-toggle-button:hover { + background-color: var(--sky-primary-light); +} + +.sidebar nav li a.active { + color: var(--sky-primary-dark); +} + +.toc-sidebar { + top: 1rem; +} + +.version-dropdown-menu { + width: 80%; + margin: 0 auto; +} + +.version-dropdown-toggle:hover { + border-color: var(--sky-primary); +} + +.footer-complete { + background-color: var(--bg-color); + padding: 0; + margin: 0 var(--space-8); + padding: var(--space-12) 0 var(--space-6); +} + +.page-footer-actions { + border-top: 0; +} + +.footer-complete-bottom { + border-top: 0; +} + +.docmd-kbd { + background-color: var(--sky-primary-light); + color: var(--sky-primary); +} + +.docmd-search-trigger .search-label, +.docmd-options-menu .lucide-icon { + color: var(--sky-primary-dark); +} + +.docmd-options-menu .sponsor-link-button:hover, +.docmd-options-menu .sponsor-link-button:hover svg, +.docmd-options-menu button:hover:not(.docmd-search-trigger) { + background-color: var(--sky-primary); + color: var(--sky-primary-dark); + border: initial; + transition: 0.2s; +} + +.docmd-options-menu .theme-toggle-button, +.docmd-options-menu .sponsor-link-button { + border-radius: 50%; +} \ No newline at end of file diff --git a/packages/themes/src/index.ts b/packages/themes/src/index.ts new file mode 100644 index 0000000..f60d3a4 --- /dev/null +++ b/packages/themes/src/index.ts @@ -0,0 +1,43 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/core (and ecosystem) + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + */ + +import path from 'path'; +import { fileURLToPath } from 'url'; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); + +/** + * Returns the absolute path to the requested theme CSS file. + * @param {string} themeName - 'sky', 'retro', 'ruby' + * @returns {string} Absolute path to css file + */ + +function getThemePath(themeName: string) { + const cleanName = themeName.toLowerCase(); + // Using path.join(__dirname, '..', 'src') because this file runs from dist/ + return path.join(__dirname, '..', 'src', `docmd-theme-${cleanName}.css`); +} + +/** + * Returns the directory containing all themes + */ +function getThemesDir() { + return path.join(__dirname, '..', 'src'); +} + +export { + getThemePath, + getThemesDir +}; \ No newline at end of file diff --git a/packages/themes/tsconfig.json b/packages/themes/tsconfig.json new file mode 100644 index 0000000..9635ce4 --- /dev/null +++ b/packages/themes/tsconfig.json @@ -0,0 +1,10 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "outDir": "./dist", + "rootDir": "./src", + "strict": false + }, + "include": ["src/**/*"], + "exclude": ["node_modules", "dist", "**/*.test.ts"] +} \ No newline at end of file diff --git a/packages/tui/LICENSE b/packages/tui/LICENSE new file mode 100644 index 0000000..997bb73 --- /dev/null +++ b/packages/tui/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025-present docmd.io + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/packages/tui/README.md b/packages/tui/README.md new file mode 100644 index 0000000..0f1031c --- /dev/null +++ b/packages/tui/README.md @@ -0,0 +1,34 @@ +# @docmd/tui + +Terminal User Interface (TUI) design system for docmd. + +This package provides a unified, high-signal design system for all terminal output across the docmd ecosystem. It ensures a consistent, professional, and emoji-free aesthetic for core tools and third-party plugins. + +## Features + +- **Semantic Styling** - Predefined color tokens for consistent visual feedback +- **Layout Components** - Box-drawing based sections, dividers, and footers +- **Progress Tracking** - Standardized step-by-step progress logging +- **Zero Configuration** - Works out of the box with reasonable defaults +- **Universal Branding** - Centralised ASCII logo for consistent brand presence + +## Usage + +```typescript +import { TUI } from '@docmd/tui'; + +TUI.banner(undefined, '0.7.7'); +TUI.section('Building Site'); +TUI.step('Parsing content', 'DONE'); +TUI.footer(); +``` + +Part of the **[docmd](https://github.com/docmd-io/docmd)** documentation engine. + +## Documentation + +See **[docs.docmd.io](https://docs.docmd.io)** for full usage and API reference. + +## License + +MIT \ No newline at end of file diff --git a/packages/tui/package.json b/packages/tui/package.json new file mode 100644 index 0000000..872c031 --- /dev/null +++ b/packages/tui/package.json @@ -0,0 +1,54 @@ +{ + "name": "@docmd/tui", + "version": "0.8.12", + "description": "Terminal User Interface (TUI) design system for docmd.", + "type": "module", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "exports": { + ".": { + "types": "./dist/index.d.ts", + "import": "./dist/index.js" + } + }, + "scripts": { + "build": "tsc" + }, + "files": [ + "dist" + ], + "engines": { + "node": ">=18" + }, + "dependencies": { + "chalk": "^4.1.2" + }, + "devDependencies": { + "@types/node": "^24.13.3", + "typescript": "^5.9.3" + }, + "keywords": [ + "docmd", + "documentation", + "tui", + "terminal", + "cli", + "design-system", + "chalk", + "docs" + ], + "author": { + "name": "Ghazi", + "url": "https://mgks.dev" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/docmd-io/docmd.git" + }, + "bugs": { + "url": "https://github.com/docmd-io/docmd/issues" + }, + "homepage": "https://docmd.io", + "funding": "https://github.com/sponsors/mgks", + "license": "MIT" +} \ No newline at end of file diff --git a/packages/tui/src/index.ts b/packages/tui/src/index.ts new file mode 100644 index 0000000..520a892 --- /dev/null +++ b/packages/tui/src/index.ts @@ -0,0 +1,448 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/tui + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + */ + +import chalk from 'chalk'; +import { readFileSync } from 'node:fs'; + +const pkgUrl = new URL('../package.json', import.meta.url); +const { version: PKG_VERSION } = JSON.parse(readFileSync(pkgUrl, 'utf-8')); + +const LOGO = ` + _ _ + _| |___ ___ _____ _| | + | . | . | _| | . | + |___|___|___|_|_|_|___| +`; + +/* โ”€โ”€ Progress bar โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ */ + +const BAR_WIDTH = 20; +const BAR_FULL = 'โ”'; +const BAR_EMPTY = 'โ”€'; + +function renderBar(current: number, total: number): string { + const ratio = total > 0 ? Math.min(current / total, 1) : 0; + const filled = Math.round(ratio * BAR_WIDTH); + const pct = Math.round(ratio * 100); + return `${BAR_FULL.repeat(filled)}${BAR_EMPTY.repeat(BAR_WIDTH - filled)} (${pct}%)`; +} + +/* โ”€โ”€ Spinner โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ */ + +const SPINNER_FRAMES = ['โ ‹','โ ™','โ น','โ ธ','โ ผ','โ ด','โ ฆ','โ ง','โ ‡','โ ']; + +/* โ”€โ”€ TTY helpers โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ */ + +function isTTY(): boolean { return process.stdout.isTTY === true; } + +function eraseLines(n: number): void { + for (let i = 0; i < n; i++) process.stdout.write('\x1b[1A\x1b[2K'); +} + +/* โ”€โ”€ Duration โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ */ + +function formatDuration(ms: number): string { + return ms < 1000 ? `${ms}ms` : `${(ms / 1000).toFixed(1)}s`; +} + +/* โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ + * Active-line state machine + * + * Layout while a WAIT step is active: + * + * โ”‚ [ WAIT ] Label text here โ† wait line + * โ”‚ โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ” (42%) โ† progress bar โ† _progressLines โ‰ฅ 1 + * โ”‚ โ† breathing room โ† _progressLines = 2 + * + * _waitLine : text of the current WAIT step (null = none active) + * _waitBarColor : chalk colour function used for that step's bar glyph + * _progressLines : how many lines BELOW the wait line are "active" + * 0 = nothing extra 1 = blank only 2 = bar + blank + * โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ */ + +let _waitLine: string | null = null; +let _waitBarColor: typeof chalk.cyan = chalk.cyan; +let _progressLines = 0; + +// Section auto-close tracking +let _sectionOpen = false; +let _sectionColor = chalk.cyan; + +/** Erase only the progress area below the wait line. */ +function clearProgressArea(): void { + if (_progressLines > 0 && isTTY()) { + eraseLines(_progressLines); + _progressLines = 0; + } +} + +/** Erase the full active block: progress area + the wait line itself. */ +function clearActiveBlock(): void { + if (!isTTY()) return; + const total = _progressLines + (_waitLine !== null ? 1 : 0); + if (total > 0) eraseLines(total); + _progressLines = 0; + _waitLine = null; +} + +/** Commit any active state before printing structural output (section/footer). */ +function commitState(): void { + clearProgressArea(); + // Leave the wait line on-screen โ€” it will be resolved by its own DONE/FAIL call + _progressLines = 0; +} + +/* โ”€โ”€ Flag helpers โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ */ + +function flag(status: string): string { + switch (status) { + case 'DONE': return chalk.green('[ DONE ]'); + case 'FAIL': return chalk.red ('[ FAIL ]'); + case 'SKIP': return chalk.yellow('[ SKIP ]'); + case 'WAIT': return chalk.blue ('[ WAIT ]'); + default: return chalk.blue (`[ ${status} ]`); + } +} + +/** + * High-Signal Terminal Design System (TUI) + * Standalone package with zero internal dependencies. + * + * Step format โ†’ โ”‚ [ DONE ] Label text flows freely here + * Progress โ†’ โ”‚ โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ” (42%) + * Breathing โ†’ โ”‚ + */ +export const TUI = { + // Semantic colors + blue: chalk.blue, + cyan: chalk.cyan, + green: chalk.green, + yellow: chalk.yellow, + red: chalk.red, + dim: chalk.dim, + bold: chalk.bold, + + banner: (logo: string = LOGO, version: string = PKG_VERSION) => { + commitState(); + // N-13 + N-16: respect both the NO_COLOR convention (de-facto + // standard for CLIs) and the explicit `DOCMD_NO_BANNER` env + // (lets users silence the ASCII art while keeping the version line + // if they prefer). The DOCMD_NO_BANNER check is a docmd-specific + // escape hatch since NO_COLOR is a colour convention, not a + // banner convention. + if (process.env.NO_COLOR || process.env.DOCMD_NO_BANNER) return; + console.log(`\n${chalk.blue(logo)}`); + console.log(`${chalk.dim(` v${version}`)}\n`); + }, + + section: (label: string, color = chalk.cyan) => { + commitState(); + // Auto-close any previously open section so callers don't need to + // manually track when to call footer() + if (_sectionOpen) { + console.log(`${_sectionColor('โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€')}`); + } + _sectionColor = color; + _sectionOpen = true; + console.log(`\n${color.bold(`โ”Œโ”€ ${label}`)}`); + }, + + divider: (label: string, color = chalk.blue) => { + commitState(); + console.log(`${color.bold(`โ”œโ”€ ${label}`)}`); + }, + + /** + * Print a status step line. + * + * WAIT โ†’ prints the line + a blank breathing `โ”‚`, tracks state. + * If a WAIT is already active, overwrites in-place (label update). + * DONE/FAIL/SKIP โ†’ erases the WAIT block and replaces with final status line. + * + * `statusFirst` accepted but ignored โ€” left-side flags are always the default. + */ + step: (label: string, status: 'DONE'|'WAIT'|'SKIP'|'FAIL'|string = 'WAIT', barColor = chalk.cyan, _statusFirst?: boolean) => { + const f = flag(status); + const line = `${barColor('โ”‚')} ${f} ${chalk.dim(label)}`; + + if (status === 'WAIT') { + if (isTTY() && _waitLine !== null) { + // Overwrite existing wait line in-place (e.g. count update) + eraseLines(_progressLines + 1); + } else { + clearProgressArea(); + } + console.log(line); + console.log(`${barColor('โ”‚')}`); + _waitLine = label; + _waitBarColor = barColor; + _progressLines = 1; + + } else { + if (isTTY() && _waitLine !== null) { + eraseLines(_progressLines + 1); + } + console.log(line); + _waitLine = null; + _progressLines = 0; + } + }, + + item: (label: string, value: string, labelColor = chalk.dim, barColor = chalk.cyan) => { + commitState(); + console.log(`${barColor('โ”‚')} ${labelColor(label.padEnd(15))} ${value}`); + }, + + /** + * Render a per-plugin tree inside an open section. + * + * โ”‚ [ DONE ] [seo] Generated robots.txt + * โ”‚ โ”œโ”€ [ DONE ] Generated .nojekyll (disables Jekyll on GitHub Pages) + * + * Single-entry plugins collapse to one parent line; warnings and follow-up + * events become indented children. Parent is the first DONE/FAIL entry + * (the main action); when every entry was SKIP, the first entry is used. + * + * Pass an empty `entries` array and the helper is a no-op. + */ + pluginTree: ( + pluginName: string, + entries: Array<{ msg: string; status: 'DONE'|'SKIP'|'FAIL'|'WAIT' }>, + color = chalk.cyan, + ) => { + commitState(); + if (!entries || entries.length === 0) return; + + const bar = color('โ”‚'); + const key = chalk.bold(`[${pluginName}]`).padEnd(8); + + const parentIdx = (() => { + const idx = entries.findIndex(e => e.status === 'DONE' || e.status === 'FAIL'); + return idx === -1 ? 0 : idx; + })(); + + const parent = entries[parentIdx]; + console.log(`${bar} ${flag(parent.status)} ${key} ${chalk.dim(parent.msg)}`); + + if (entries.length === 1) return; + + // Build the children list in original order, skipping the parent. + const childIndices: number[] = []; + for (let i = 0; i < entries.length; i++) { + if (i !== parentIdx) childIndices.push(i); + } + childIndices.forEach((idx, i) => { + const isLast = i === childIndices.length - 1; + const branch = isLast ? 'โ””โ”€' : 'โ”œโ”€'; + const e = entries[idx]; + console.log(`${bar} ${chalk.dim(branch)} ${flag(e.status)} ${chalk.dim(e.msg)}`); + }); + }, + + footer: (color = chalk.cyan) => { + commitState(); + console.log(`${color('โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€')}`); + _sectionOpen = false; + }, + + info: (msg: string) => { + commitState(); + console.log(`\n${chalk.blue.bold('โฌข')} ${msg}`); + }, + + success: (msg: string) => { + commitState(); + console.log(`\n${chalk.green.bold('โฌข')} ${msg}`); + }, + + warn: (msg: string) => { + commitState(); + console.log(`${chalk.yellow.bold('โฌข')} ${chalk.yellow(msg)}`); + }, + + error: (msg: string, detail?: string) => { + commitState(); + console.error(`\n${chalk.red.bold('โ”Œโ”€ Failure')}`); + console.error(`${chalk.red('โ”‚')} ${msg}`); + if (detail) { + detail.split('\n').forEach(l => console.error(`${chalk.red('โ”‚')} ${chalk.dim(l)}`)); + } + console.error(`${chalk.red('โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€')}`); + }, + + // โ”€โ”€ Progress Bar โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ + + /** + * Render an in-place progress bar on its own line below the active WAIT step. + * + * โ”‚ [ WAIT ] Processing pages + * โ”‚ โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ” (42%) + * โ”‚ + */ + progress: (label: string, current: number, total: number, barColor = chalk.cyan) => { + const bar = renderBar(current, total); + const line = `${barColor('โ”‚')} ${chalk.cyan(bar)}`; + + if (!isTTY()) { + const pct = total > 0 ? Math.round((current / total) * 100) : 0; + if (current >= total || pct === 25 || pct === 50 || pct === 75) { + console.log(line); + } + return; + } + + // Erase the progress area below the wait line (bar + blank) + if (_progressLines > 0) eraseLines(_progressLines); + + process.stdout.write(`${line}\n`); + process.stdout.write(`${barColor('โ”‚')}\n`); + _progressLines = 2; + }, + + // โ”€โ”€ Spinner โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ + + /** + * Start an animated spinner in left-flag style. + * + * โ”‚ [ โ ‹ ] Loading config + * โ”‚ + * + * Returns a handle with .done() / .fail() / .update(). + */ + spinner: (label: string, barColor = chalk.cyan) => { + let frameIndex = 0; + let currentLabel = label; + let stopped = false; + + // Print initial WAIT line + breathing room + const waitLine = `${barColor('โ”‚')} ${chalk.blue('[ WAIT ]')} ${chalk.dim(currentLabel)}`; + console.log(waitLine); + console.log(`${barColor('โ”‚')}`); + _waitLine = currentLabel; + _waitBarColor = barColor; + _progressLines = 1; + + const render = () => { + if (stopped || !isTTY()) return; + const frame = chalk.cyan(SPINNER_FRAMES[frameIndex++ % SPINNER_FRAMES.length]); + // Go up past blank + wait line, rewrite wait line with spinner frame + process.stdout.write('\x1b[2A\r\x1b[2K'); + process.stdout.write(`${barColor('โ”‚')} ${chalk.blue('[')} ${frame} ${chalk.blue(']')} ${chalk.dim(currentLabel)}\n`); + process.stdout.write(`${barColor('โ”‚')}\n`); + }; + + const interval = isTTY() ? setInterval(render, 80) : null; + if (interval) interval.unref(); + if (!isTTY()) { + // Non-TTY: static line already printed above + } + + const finish = (status: 'DONE' | 'FAIL', finalLabel?: string) => { + stopped = true; + if (interval) clearInterval(interval); + const fl = finalLabel || currentLabel; + if (isTTY()) eraseLines(_progressLines + 1); + const f = status === 'DONE' ? chalk.green('[ DONE ]') : chalk.red('[ FAIL ]'); + console.log(`${barColor('โ”‚')} ${f} ${chalk.dim(fl)}`); + _waitLine = null; + _progressLines = 0; + }; + + return { + update: (newLabel: string) => { currentLabel = newLabel; }, + done: (doneLabel?: string, _statusFirst?: boolean) => finish('DONE', doneLabel), + fail: (failLabel?: string, _statusFirst?: boolean) => finish('FAIL', failLabel), + }; + }, + + // โ”€โ”€ Counter โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ + + counter: (label: string, count: number, barColor = chalk.cyan) => { + const line = `${barColor('โ”‚')} ${chalk.dim(label)} ${chalk.bold(String(count))}`; + if (isTTY()) process.stdout.write(`\r\x1b[K${line}`); + }, + + commitLine: (label: string, barColor = chalk.cyan) => { + commitState(); + console.log(`${barColor('โ”‚')} ${chalk.dim(label)}`); + }, + + // โ”€โ”€ Timer โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ + + formatDuration, + + timer: () => { + const start = Date.now(); + return () => formatDuration(Date.now() - start); + }, + + // โ”€โ”€ Centralised Project Summary โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ + + /** + * Print standardised project details within a TUI section. + */ + projectDetails: (opts: { + source?: string; + output?: string; + engine?: string; + versions?: { count: number; labels: string }; + locales?: { count: number; labels: string }; + threads?: number; + barColor?: typeof chalk.cyan; + }) => { + const bc = opts.barColor || chalk.cyan; + if (opts.engine) TUI.item('Engine', opts.engine === 'rust' ? 'rust (preview)' : opts.engine, chalk.dim, bc); + if (opts.source) TUI.item('Source', opts.source, chalk.dim, bc); + if (opts.output) TUI.item('Output', opts.output, chalk.dim, bc); + if (opts.versions) TUI.item('Versions', `${opts.versions.count} (${opts.versions.labels})`, chalk.dim, bc); + if (opts.locales) TUI.item('Locales', `${opts.locales.count} (${opts.locales.labels})`, chalk.dim, bc); + if (opts.threads) TUI.item('Threads', `${opts.threads}`, chalk.dim, bc); + }, + + /** + * Extract standardised project details from a resolved config object. + */ + extractProjectDetails: (config: any, outputDir: string, cwd: string) => { + const details: { + source: string; + output: string; + engine?: string; + versions?: { count: number; labels: string }; + locales?: { count: number; labels: string }; + } = { + source: (config.src || 'docs') + '/', + output: outputDir.startsWith(cwd) ? outputDir.slice(cwd.length + 1) + '/' : outputDir + '/', + }; + + if (config.engine && config.engine !== 'js') { + details.engine = config.engine; + } + + if (config.versions?.all?.length > 0) { + details.versions = { + count: config.versions.all.length, + labels: config.versions.all.map((v: any) => v.id).join(', '), + }; + } + + if (config.i18n?.locales?.length > 0) { + details.locales = { + count: config.i18n.locales.length, + labels: config.i18n.locales.map((l: any) => l.id).join(', '), + }; + } + + return details; + }, +}; \ No newline at end of file diff --git a/packages/tui/tsconfig.json b/packages/tui/tsconfig.json new file mode 100644 index 0000000..9635ce4 --- /dev/null +++ b/packages/tui/tsconfig.json @@ -0,0 +1,10 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "outDir": "./dist", + "rootDir": "./src", + "strict": false + }, + "include": ["src/**/*"], + "exclude": ["node_modules", "dist", "**/*.test.ts"] +} \ No newline at end of file diff --git a/packages/ui/LICENSE b/packages/ui/LICENSE new file mode 100644 index 0000000..997bb73 --- /dev/null +++ b/packages/ui/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025-present docmd.io + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/packages/ui/README.md b/packages/ui/README.md new file mode 100644 index 0000000..ad92329 --- /dev/null +++ b/packages/ui/README.md @@ -0,0 +1,13 @@ +# @docmd/ui + +The visual foundation of docmd - EJS layout templates, core CSS and JavaScript, and SVG icon sets that all official themes build upon. + +Part of the **[docmd](https://github.com/docmd-io/docmd)** documentation engine. + +## Documentation + +See **[docs.docmd.io](https://docs.docmd.io)** for full usage and API reference. + +## License + +MIT \ No newline at end of file diff --git a/packages/ui/assets/css/docmd-highlight-dark.css b/packages/ui/assets/css/docmd-highlight-dark.css new file mode 100644 index 0000000..cf3a6a7 --- /dev/null +++ b/packages/ui/assets/css/docmd-highlight-dark.css @@ -0,0 +1,95 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/core (and ecosystem) + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + */ + + pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} + +code.hljs { + padding: 3px 5px +} + +.hljs-comment, +.hljs-quote { + color: #5c6370; + font-style: italic +} + +.hljs-doctag, +.hljs-formula, +.hljs-keyword { + color: #c678dd +} + +.hljs-deletion, +.hljs-name, +.hljs-section, +.hljs-selector-tag, +.hljs-subst, +.hljs-operator, +.hljs-punctuation { + color: #c678dd +} + +.hljs-literal { + color: #56b6c2 +} + +.hljs-addition, +.hljs-attribute, +.hljs-meta .hljs-string, +.hljs-regexp, +.hljs-string { + color: #98c379 +} + +.hljs-attr, +.hljs-number, +.hljs-selector-attr, +.hljs-selector-class, +.hljs-selector-pseudo, +.hljs-template-variable, +.hljs-type, +.hljs-variable { + color: #d19a66 +} + +.hljs-bullet, +.hljs-link, +.hljs-meta, +.hljs-selector-id, +.hljs-symbol, +.hljs-title { + color: #61aeee +} + +.hljs-built_in, +.hljs-class .hljs-title, +.hljs-title.class_ { + color: #e6c07b +} + +.hljs-emphasis { + font-style: italic +} + +.hljs-strong { + font-weight: 700 +} + +.hljs-link { + text-decoration: underline +} \ No newline at end of file diff --git a/packages/ui/assets/css/docmd-highlight-light.css b/packages/ui/assets/css/docmd-highlight-light.css new file mode 100644 index 0000000..65473bc --- /dev/null +++ b/packages/ui/assets/css/docmd-highlight-light.css @@ -0,0 +1,95 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/core (and ecosystem) + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + */ + + pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} + +code.hljs { + padding: 3px 5px +} + +.hljs-comment, +.hljs-quote { + color: #a0a1a7; + font-style: italic +} + +.hljs-doctag, +.hljs-formula, +.hljs-keyword { + color: #a626a4 +} + +.hljs-deletion, +.hljs-name, +.hljs-section, +.hljs-selector-tag, +.hljs-subst, +.hljs-operator, +.hljs-punctuation { + color: #a626a4 +} + +.hljs-literal { + color: #0184bb +} + +.hljs-addition, +.hljs-attribute, +.hljs-meta .hljs-string, +.hljs-regexp, +.hljs-string { + color: #50a14f +} + +.hljs-attr, +.hljs-number, +.hljs-selector-attr, +.hljs-selector-class, +.hljs-selector-pseudo, +.hljs-template-variable, +.hljs-type, +.hljs-variable { + color: #986801 +} + +.hljs-bullet, +.hljs-link, +.hljs-meta, +.hljs-selector-id, +.hljs-symbol, +.hljs-title { + color: #4078f2 +} + +.hljs-built_in, +.hljs-class .hljs-title, +.hljs-title.class_ { + color: #c18401 +} + +.hljs-emphasis { + font-style: italic +} + +.hljs-strong { + font-weight: 700 +} + +.hljs-link { + text-decoration: underline +} \ No newline at end of file diff --git a/packages/ui/assets/css/docmd-main.css b/packages/ui/assets/css/docmd-main.css new file mode 100644 index 0000000..dd513db --- /dev/null +++ b/packages/ui/assets/css/docmd-main.css @@ -0,0 +1,3825 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/core (and ecosystem) + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + */ + +*, +*::before, +*::after { + box-sizing: border-box; +} + +:root { + --bg-color: #ffffff; + --text-color: #1f1f20; + --text-muted: #6b6b75; + --text-heading: #09090b; + --link-color: #068ad5; + --link-color-hover: #0b76b3; + --border-color: #e4e4e7; + --border-color-codeblock: #0a0a0a17; + --border-color-hover: #dedee0; + --header-bg: rgba(255, 255, 255, 0.8); + --header-border: #e4e4e7; + --sidebar-bg: #fafafa; + --sidebar-text: #3f3f46; + --sidebar-link-active-bg: #55bbf91c; + --sidebar-link-active-text: #18181b; + --code-bg: #fafafa; + --code-text: #27272a; + --sponsor-red: #f43f5e; + --font-family-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; + --font-family-mono: "JetBrains Mono", SFMono-Regular, Consolas, Menlo, monospace; + --font-size-base: 16px; + --line-height-relaxed: 1.625; + --radius-sm: 4px; + --radius-md: 6px; + --radius-lg: 12px; + --radius-xl: 16px; + --shadow-sm: 0 2px 5px -3px #00000026; + --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); + --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); + --space-1: 0.25rem; + --space-2: 0.5rem; + --space-3: 0.75rem; + --space-4: 1rem; + --space-6: 1.5rem; + --space-8: 2rem; + --space-12: 3rem; + --ui-element-size: 32px; + --sidebar-width: 260px; + --menubar-h: 44px; + --header-h: 44px; + --scrollbar-thumb: #e4e4e7; + --scrollbar-thumb-hover: #a1a1aa; + --sidebar-group-bg: #3352660d; + --sidebar-group-border: transparent; + color-scheme: light; + --image-shadow: 0 0 10px -3px rgb(0 0 0 / 13%); + --image-border-radius: 12px; + --image-border-color: #ededed; + --glow-color: rgba(6, 138, 213, 0.10); + --glow-color-strong: rgba(6, 138, 213, 0.18); + --halo-soft: 0 0 0 4px rgba(6, 138, 213, 0.10); +} + +:root[data-theme=dark] { + --bg-color: #0d0d0f; + --text-color: #d4d4d8; + --text-muted: #94949e; + --text-heading: #fafafa; + --link-color: #38bdf8; + --border-color: #27272a; + --border-color-codeblock: #fafafa17; + --header-bg: rgb(20 20 22 / 68%); + --header-border: #27272a; + --sidebar-bg: #111113; + --sidebar-text: #d4d4d8; + --sidebar-link-active-bg: #1e1e22; + --sidebar-link-active-text: #ffffff; + --code-bg: #16161a; + --code-text: #e4e4e7; + --sponsor-red: #e11d48; + --scrollbar-thumb: #27272a; + --scrollbar-thumb-hover: #52525b; + --glow-color: rgba(56, 189, 248, 0.18); + --glow-color-strong: rgba(56, 189, 248, 0.28); + --halo-soft: 0 0 0 4px rgba(56, 189, 248, 0.18); + color-scheme: dark; +} + +::-webkit-scrollbar { + width: 6px; + height: 6px; +} + +::-webkit-scrollbar-track { + background: transparent; +} + +::-webkit-scrollbar-thumb { + background-color: var(--scrollbar-thumb); + border-radius: 10px; + +} + +::-webkit-scrollbar-thumb:hover { + background-color: var(--scrollbar-thumb-hover); +} + +::-webkit-scrollbar-thumb:active { + background-color: var(--text-color) !important; +} + +.sidebar::-webkit-scrollbar-thumb, +.toc-list::-webkit-scrollbar-thumb, +.docmd-search-results::-webkit-scrollbar-thumb, +pre::-webkit-scrollbar-thumb, +.table-wrapper::-webkit-scrollbar-thumb { + background-color: transparent; + border-radius: 10px; +} + +.sidebar:hover::-webkit-scrollbar-thumb, +.toc-list:hover::-webkit-scrollbar-thumb, +.docmd-search-results:hover::-webkit-scrollbar-thumb, +pre:hover::-webkit-scrollbar-thumb, +.table-wrapper:hover::-webkit-scrollbar-thumb { + background-color: var(--border-color); +} + +.sidebar, +.toc-list, +.docmd-search-results, +pre, +.table-wrapper { + scrollbar-width: thin; + scrollbar-color: var(--scrollbar-thumb) transparent; + transition: scrollbar-color 0.2s ease; +} + +.sidebar:hover, +.toc-list:hover, +.docmd-search-results:hover, +pre:hover, +.table-wrapper:hover { + scrollbar-color: var(--scrollbar-thumb) transparent; +} + +html { + scrollbar-width: thin; + scrollbar-color: var(--scrollbar-thumb) transparent; + color-scheme: light; +} + +html[data-theme="dark"] { + color-scheme: dark; +} + +html::-webkit-scrollbar-thumb { + background-color: var(--scrollbar-thumb); + border-radius: 10px; +} + +body { + font-family: var(--font-family-sans); + font-size: var(--font-size-base); + background-color: var(--bg-color); + color: var(--text-color); + margin: 0; + min-height: 100vh; + line-height: var(--line-height-relaxed); + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +code, +pre { + font-family: var(--font-family-mono); + font-size: 0.9em; + background-color: var(--code-bg); + border-radius: var(--radius-md); +} + +h1, +h2, +h3, +h4, +h5, +h6 { + font-family: var(--font-family-sans); + color: var(--text-heading); + font-weight: 600; + line-height: 1.25; + margin-top: var(--space-8); + margin-bottom: var(--space-4); +} + +h1 { + font-size: 2.25rem; + font-weight: 800; + letter-spacing: -0.025em; + margin-top: 0; +} + +h2 { + font-size: 1.875rem; + border-bottom: 1px solid var(--border-color); + padding-bottom: var(--space-2); +} + +h3 { + font-size: 1.5rem; +} + +h4 { + font-size: 1.25rem; +} + +h5 { + font-size: 1.125rem; +} + +h6 { + font-size: 1rem; +} + +a { + color: var(--link-color); + text-decoration: none; +} + +a:hover { + color: var(--link-color-hover); + +} + +a:any-link { + text-decoration: none; +} + +.skip-link { + position: absolute; + top: -100px; + left: 0; + background: var(--bg-color); + color: var(--link-color); + padding: 8px; + z-index: 9999; +} + +.skip-link:focus { + top: 0; +} + +.sidebar { + display: flex; + flex-direction: column; + width: var(--sidebar-width); + background-color: var(--sidebar-bg); + color: var(--sidebar-text); + border-right: 1px solid var(--border-color); + height: 100vh; + position: fixed; + top: 0; + left: 0; + overflow: visible; + box-sizing: border-box; + flex-shrink: 0; + z-index: 100; + transition: transform 0.3s ease, visibility 0.3s ease; +} + +.sidebar h1 { + font-size: 1.25rem; + font-weight: 700; + padding: var(--space-2); +} + +.sidebar nav ul { + list-style: none; + padding: 0; + margin: 0 +} + +.sidebar nav li a, +.sidebar nav li .nav-label { + display: flex; + align-items: center; + padding: var(--space-2) var(--space-3); + text-decoration: none; + color: var(--sidebar-text); + border-radius: var(--radius-md); + font-size: 0.875rem; + line-height: 1.4; + font-weight: 500; + +} + +.sidebar nav li.nav-group { + border-radius: 6px; + +} + +.sidebar nav li.collapsible { + cursor: pointer; +} + +.sidebar nav li>a { + position: relative; +} + +.sidebar nav li>a.active { + color: var(--link-color); + font-weight: 600; + background-color: var(--sidebar-link-active-bg); + +} + +/* Modern "node on thread" active indicator. + A small pill that sits at the link's left edge, centered vertically, + overlapping the .submenu thread border used by .active-parent. + The result reads as the active link's own marker on the existing + rail, not a thick bar grafted onto the item. */ +.sidebar nav li>a.active::before { + content: ""; + position: absolute; + left: -10px; + top: 50%; + transform: translateY(-50%); + width: 3px; + height: 55%; + min-height: 14px; + background-color: var(--link-color); + border-radius: 2px; + +} + +.sidebar nav li.active-parent>a { + color: var(--link-color); + font-weight: 600; + background-color: transparent; +} + +.sidebar nav li.active-parent>a::before { + content: ""; + position: absolute; + left: 0; + top: 5px; + bottom: 5px; + /* width: 3px; */ + opacity: 1; + +} + +.sidebar nav li .nav-label { + font-weight: 600; + +} + +.sidebar nav .submenu { + display: none; + padding-left: .25em; + border-left: 1px solid var(--link-color); + margin-left: .85em; +} + +.sidebar nav li[aria-expanded="true"]>.submenu, +.sidebar nav li.expanded>.submenu { + display: block !important; +} + +.collapse-icon { + transition: transform 0.2s ease; +} + +.sidebar nav li[aria-expanded="true"]>a .collapse-icon, +.sidebar nav li.expanded>a .collapse-icon, +.sidebar nav li[aria-expanded="true"]>.nav-label .collapse-icon, +.sidebar nav li.expanded>.nav-label .collapse-icon { + transform: rotate(90deg); +} + +.collapse-icon-wrapper { + display: inline-flex; + margin-left: auto; + align-items: center; + justify-content: center; + cursor: pointer; +} + +span.collapse-icon-wrapper .collapse-icon { + margin: 0; + vertical-align: 0; + height: 1.5em; +} + +.copy-code-button:hover, +.docmd-tabs-nav-item:hover, +.sidebar nav li a.active, +.sidebar nav li a:hover, +.theme-toggle-button:hover { + color: var(--text-color); + +} + +.sidebar nav li a.active { + font-weight: 600; + color: var(--link-color) + +} + +.copy-code-button:hover, +.code-wrapper:hover>.copy-code-button { + opacity: .8; +} + +.docmd-code-block-header.has-copy-button>.copy-code-button, +.docmd-code-block-header.has-copy-button:hover>.copy-code-button { + opacity: 1; +} + +.sidebar-toggle-button { + position: absolute; + left: -1rem; + top: 50%; + transform: translateY(-50%); + background-color: var(--bg-color); + border: 1px solid var(--border-color); + color: var(--text-muted); + cursor: pointer; + width: 2rem; + height: 2rem; + border-radius: 50%; + display: none; + align-items: center; + justify-content: center; + box-shadow: var(--shadow-sm); + transition: left 0.3s ease, background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease; + z-index: 200; +} + +.sidebar-toggle-button:hover { + color: var(--text-color); + border-color: var(--border-color-hover); + box-shadow: var(--shadow-md); +} + +.sidebar-toggle-button .lucide-icon { + width: 1.1rem; + height: 1.1rem; + color: currentColor; + transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); +} + +body.sidebar-collapsed .sidebar-toggle-button .lucide-icon { + transform: rotate(180deg); +} + +body.sidebar-collapsible .sidebar-toggle-button { + display: inline-flex; +} + +body.sidebar-collapsed .sidebar-toggle-button { + justify-content: right; + padding: 0; +} + +body.sidebar-collapsible .header-titles-wrapper { + transition: margin-left 0.3s ease; +} + +.docmd-container.steps-reset .docmd-container.steps-reset ol.steps-list>li.step-item::before, +.docmd-container.steps-reset ol.steps-list>li.step-item::before, +.docmd-container.steps-reset ol.steps-list[start]>li.step-item::before { + content: counter(list-counter) "."; + font-weight: 700; + margin-right: .5em; + color: var(--accent-color, #007acc) +} + +.docmd-tab-pane.active, +.logo-link img, +.logo-link img.logo-light, +.tab-panel.active, +.theme-toggle-button .icon-sun, +html[data-theme=dark] .logo-link img.logo-dark, +html[data-theme=dark] .theme-toggle-button .icon-moon, +img { + display: block +} + +.docmd-heading { + position: relative; + display: flex; + align-items: center; + scroll-margin-top: calc(var(--sticky-top-offset) + var(--space-8)); +} + +.heading-anchor { + position: absolute; + left: calc(-1 * var(--space-8)); + width: var(--space-6); + height: var(--space-6); + display: inline-flex; + align-items: center; + justify-content: center; + color: var(--text-muted); + opacity: 0; + transition: all 0.2s ease; + text-decoration: none !important; +} + +.heading-anchor svg { + width: 1.25rem; + height: 1.25rem; +} + +.docmd-heading:hover .heading-anchor, +.heading-anchor:focus { + opacity: 1; +} + +.heading-anchor:hover { + color: var(--link-color); +} + +.toc-level-1 { + margin-left: 0; + font-weight: 600; +} + +.toc-level-2 { + margin-left: 0; +} + +.main-content-wrapper { + margin-left: var(--sidebar-width); + flex-grow: 1; + display: flex; + flex-direction: column; + min-width: 0; + min-height: 100vh; + transition: margin-left 0.3s ease; +} + +.header-left, +.header-right, +.page-header { + align-items: center; + display: flex +} + +.page-header { + justify-content: space-between; + padding: var(--space-2) var(--space-3); + background-color: var(--header-bg); + border-bottom: 1px solid var(--header-border); + position: sticky; + top: var(--header-top-offset); + z-index: 50; + backdrop-filter: blur(8px); + -webkit-backdrop-filter: blur(8px); + gap: 0.5rem +} + +@media (min-width: 769px) { + body.sidebar-collapsible .page-header { + z-index: 150; + } +} + +.header-titles-wrapper { + display: flex; + flex-direction: column; + justify-content: center; +} + +.docmd-breadcrumbs-row { + display: flex; + align-items: center; + justify-content: space-between; + margin-bottom: var(--space-4); + gap: 1rem; + flex-wrap: wrap; +} + +.docmd-breadcrumbs-spacer { + flex-grow: 1; +} + +.docmd-copy-widgets { + display: inline-flex; + align-items: center; + gap: 0; + border-radius: var(--radius-md); + background-color: var(--code-bg); + border: 1px solid var(--border-color); + overflow: hidden; + box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.02); +} + +.docmd-copy-btn { + display: inline-flex; + align-items: center; + gap: 0.35rem; + padding: 0.35rem 0.65rem; + font-size: 0.775rem; + font-weight: 500; + color: var(--text-muted); + background-color: transparent; + border: none; + border-radius: 0; + cursor: pointer; + transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); + line-height: 1; + height: 28px; + box-sizing: border-box; +} + +.docmd-copy-raw-btn { + border-right: 1px solid var(--border-color); +} + +.docmd-copy-btn:hover { + background-color: var(--sidebar-link-active-bg); + color: var(--text-color); +} + +.docmd-copy-btn .docmd-btn-icon svg { + width: 13px; + height: 13px; + display: block; +} + +.docmd-copy-btn.copied { + background-color: rgba(34, 197, 94, 0.1) !important; + color: #22c55e !important; +} + +.docmd-breadcrumbs { + font-size: 0.8125rem; + color: var(--text-muted); + display: block; +} + +.docmd-breadcrumbs ol { + list-style: none; + padding: 0; + margin: 0; + display: flex; + align-items: center; + flex-wrap: wrap; + gap: 0.25rem; +} + +.docmd-breadcrumbs li { + display: inline-flex; + align-items: center; + white-space: nowrap; +} + +.docmd-breadcrumbs a { + color: var(--text-muted); + text-decoration: none; + transition: color 0.15s ease; +} + +.docmd-breadcrumbs a:hover { + color: var(--link-color); +} + +.docmd-breadcrumbs .breadcrumb-separator { + margin-left: 0.25rem; + opacity: 0.5; + display: inline-flex; + align-items: center; +} + +.docmd-breadcrumbs .breadcrumb-separator .lucide-icon { + width: 0.8em; + height: 0.8em; +} + +.docmd-breadcrumbs .active { + color: var(--text-color); + font-weight: 500; +} + +.page-header .header-title { + font-size: 1.25rem; + font-weight: 600; + color: var(--text-heading); + margin: 0; +} + +.header-left { + gap: var(--space-4); + margin-left: 1rem +} + +.header-right { + gap: var(--space-2); + margin-right: 1rem; +} + +:root { + --menubar-h: 44px; + --header-h: 44px; + + --fixed-top-offset: 0px; + --header-top-offset: 0px; + --sticky-top-offset: 0px; + + --menubar-bg: var(--bg-color); + --menubar-border: var(--border-color); + --menubar-text: var(--text-color); + --menubar-link-hover-bg: var(--sidebar-link-active-bg); +} + +body.has-menubar-top { + --fixed-top-offset: var(--menubar-h); + --header-top-offset: var(--menubar-h); + --sticky-top-offset: var(--menubar-h); + padding-top: var(--menubar-h); +} + +body:not(.no-header) { + --sticky-top-offset: var(--header-h); +} + +body.has-menubar-top:not(.no-header) { + --sticky-top-offset: calc(var(--menubar-h) + var(--header-h)); +} + +body.has-menubar-header { + --header-top-offset: var(--menubar-h); + --sticky-top-offset: var(--menubar-h); +} + +body.has-menubar-header:not(.no-header) { + --sticky-top-offset: calc(var(--menubar-h) + var(--header-h)); +} + +html { + scroll-padding-top: calc(var(--sticky-top-offset) + 1.5rem); +} + +.docmd-menubar { + z-index: 200; + height: var(--menubar-h); + background-color: var(--menubar-bg); + border-bottom: 1px solid var(--menubar-border); + backdrop-filter: blur(8px); + -webkit-backdrop-filter: blur(8px); + width: 100%; + box-sizing: border-box; +} + +.menubar-options { + margin-left: 0.5rem; + padding-left: 0.5rem; + border-left: 1px solid var(--menubar-border); + display: flex; + align-items: center; +} + +body.has-menubar-top .docmd-menubar { + position: fixed; + top: 0; + left: 0; + right: 0; +} + +body.has-menubar-header .docmd-menubar { + position: sticky; + top: 0; + z-index: 250; +} + +.menubar-inner { + display: flex; + align-items: center; + justify-content: space-between; + height: 100%; + padding: 0 var(--space-6); + gap: var(--space-4); +} + +.menubar-left, +.menubar-right { + display: flex; + align-items: center; + gap: var(--space-1); + flex-shrink: 0; +} + +.menubar-brand { + display: inline-flex; + align-items: center; + gap: var(--space-2); + text-decoration: none; + color: var(--text-heading); + font-weight: 700; + font-size: 1rem; + padding: var(--space-1) var(--space-2); + border-radius: var(--radius-md); +} + +.menubar-brand:hover { + opacity: 0.8; + text-decoration: none; +} + +.menubar-brand-text { + white-space: nowrap; +} + +.menubar-link { + display: inline-flex; + align-items: center; + gap: var(--space-1); + padding: var(--space-1) var(--space-3); + border-radius: var(--radius-md); + font-size: 0.875rem; + color: var(--menubar-text); + text-decoration: none; + white-space: nowrap; +} + +.menubar-link:hover { + background-color: var(--menubar-link-hover-bg); + color: var(--text-heading); + text-decoration: none; +} + +.menubar-icon { + width: 1.1em; + height: 1.1em; + flex-shrink: 0; +} + +.menubar-ext-icon { + width: 0.75em; + height: 0.75em; + opacity: 0.6; + flex-shrink: 0; +} + +.menubar-dropdown { + position: relative; +} + +.menubar-dropdown-toggle { + display: inline-flex; + align-items: center; + gap: var(--space-1); + padding: var(--space-1) var(--space-3); + border-radius: var(--radius-md); + font-size: 0.875rem; + color: var(--menubar-text); + background: none; + border: none; + cursor: pointer; + font-family: inherit; + white-space: nowrap; +} + +.menubar-dropdown-toggle:hover { + background-color: var(--menubar-link-hover-bg); + color: var(--text-heading); +} + +.menubar-chevron { + width: 0.85em; + height: 0.85em; + opacity: 0.7; +} + +.menubar-dropdown:hover .menubar-chevron, +.menubar-dropdown:focus-within .menubar-chevron { + transform: rotate(180deg); +} + +.menubar-dropdown-menu { + position: absolute; + top: calc(100% + 6px); + left: 0; + min-width: 180px; + margin: 0; + padding: 0.25rem; + list-style: none; + background-color: var(--bg-color); + border: 1px solid var(--border-color); + border-radius: var(--radius-md); + box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.05); + z-index: 300; + opacity: 0; + visibility: hidden; + transform: translateY(-4px); +} + +.menubar-dropdown-menu.menubar-dropdown-right { + left: auto; + right: 0; +} + +.menubar-dropdown:hover .menubar-dropdown-menu, +.menubar-dropdown:focus-within .menubar-dropdown-menu { + opacity: 1; + visibility: visible; + transform: translateY(0); +} + +.menubar-dropdown-menu li a { + display: flex; + align-items: center; + gap: 0.5rem; + padding: 0.4rem 0.6rem; + font-size: 0.875rem; + color: var(--text-color); + text-decoration: none; + border-radius: 4px; +} + +.menubar-dropdown-menu li a:hover { + background-color: var(--sidebar-link-active-bg); + color: var(--text-heading); +} + +.sidebar { + top: var(--fixed-top-offset); + height: calc(100vh - var(--fixed-top-offset)); +} + +.toc-sidebar { + position: sticky; + top: calc(var(--sticky-top-offset) + 2rem); + width: 240px; + flex-shrink: 0; + margin: 1em 0; + max-height: calc(100vh - var(--sticky-top-offset) - 4rem); + overflow-y: auto; + scrollbar-width: thin; + align-self: flex-start +} + +.docmd-options-menu { + display: flex; + align-items: center; + justify-content: center; + gap: 0.5rem; +} + +.docmd-options-menu .theme-toggle-button, +.docmd-options-menu .sponsor-link-button, +.docmd-options-menu .docmd-search-trigger { + display: inline-flex; + align-items: center; + justify-content: center; + height: var(--ui-element-size); + padding: 0; + background-color: transparent; + border: 1px solid var(--border-color); + border-radius: var(--radius-md); + color: var(--text-muted); + cursor: pointer; + transition: all 0.2s ease; + box-sizing: border-box; + +} + +.docmd-options-menu .theme-toggle-button, +.docmd-options-menu .sponsor-link-button { + width: var(--ui-element-size); +} + +.docmd-options-menu .sponsor-link-button { + color: var(--sponsor-red); + border-color: var(--border-color); +} + +.docmd-options-menu .sponsor-link-button:hover { + background-color: var(--sponsor-red); + color: white; + border-color: var(--sponsor-red); +} + +.docmd-options-menu .docmd-search-trigger { + width: auto; + padding: 0 0.75rem; + gap: 0.5rem; + +} + +.docmd-options-menu button:hover:not(.sponsor-link-button) { + color: var(--text-heading); + border-color: var(--border-color-hover); + +} + +.docmd-search-trigger .search-label { + font-size: 0.85rem; + font-weight: 500; +} + +.docmd-search-trigger .search-keys { + display: flex; + gap: 0.25rem; +} + +.docmd-kbd { + background-color: var(--bg-color); + border: 1px solid var(--border-color); + border-radius: 4px; + font-family: var(--font-family-mono); + font-size: 0.7rem; + padding: 0.1rem 0.3rem; + box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05); + color: var(--text-muted); +} + +.docmd-options-menu .lucide-icon { + width: 1.1rem; + height: 1.1rem; +} + +.sidebar-options-wrapper { + padding: .25rem 0; +} + +.sidebar-options-wrapper.mt-auto { + margin-top: auto; + padding: .5rem 0 0; + border-top: 1px solid var(--border-color); +} + +.sidebar-top-group, +.sidebar-bottom-group.mt-auto { + display: flex; + flex-wrap: wrap; + align-items: center; + justify-content: center; + gap: 0.25rem; + padding: 0.25rem; + position: relative; +} + +.sidebar-top-group:empty { + display: none; +} + +.sidebar-bottom-group.mt-auto { + margin-top: auto; +} + +.sidebar-bottom-group:empty { + display: none; +} + +.docmd-version-dropdown, +.docmd-language-switcher, +.docmd-project-switcher { + width: auto; + position: relative; +} + +.docmd-language-switcher { + margin-top: 0; +} + +.docmd-embed { + margin: 1.5rem auto; + border-radius: var(--docmd-radius-lg, 12px); + max-width: 100%; + display: block; +} + +iframe.docmd-embed { + width: 100%; + aspect-ratio: 16 / 9; + border: none !important; +} + +iframe.docmd-embed[data-short="true"] { + aspect-ratio: 9 / 16; + max-width: 400px; +} + +blockquote.docmd-embed { + width: 100%; + border: none !important; + display: flex; + justify-content: center; +} + +.docmd-embed-fallback { + margin: 1.5rem 0; + display: flex; +} + +.version-dropdown-toggle, +.language-switcher-toggle, +.project-switcher-toggle { + display: inline-flex; + align-items: center; + gap: 0.3rem; + height: 1.75rem; + padding: 0 0.65rem; + background-color: var(--bg-color); + border: 1px solid var(--border-color); + border-radius: 999px; + color: var(--text-heading); + font-size: 0.75rem; + font-weight: 500; + cursor: pointer; + transition: all 0.2s ease; + white-space: nowrap; + box-sizing: border-box; +} + +.version-dropdown-toggle:hover, +.language-switcher-toggle:hover, +.project-switcher-toggle:hover { + border-color: var(--text-muted); +} + +.version-dropdown-menu, +.language-switcher-menu, +.project-switcher-menu { + position: absolute; + top: calc(100% + 6px); + left: 50%; + transform: translateX(-50%) translateY(-5px); + min-width: max-content; + max-width: calc(var(--sidebar-width, 260px) - 1.5rem); + margin: 0; + padding: 0.35rem; + background-color: var(--bg-color); + border: 1px solid var(--border-color); + border-radius: var(--radius-md); + box-shadow: var(--shadow-md); + list-style: none; + z-index: 100; + opacity: 0; + visibility: hidden; + transition: all 0.2s ease; +} + +.docmd-version-dropdown.open .version-dropdown-menu, +.docmd-language-switcher.open .language-switcher-menu, +.docmd-project-switcher.open .project-switcher-menu { + opacity: 1; + visibility: visible; + transform: translateX(-50%) translateY(0); +} + +.version-dropdown-item, +.language-switcher-item, +.project-switcher-item { + display: flex; + align-items: center; + justify-content: space-between; + gap: 0.5rem; + padding: 0.4rem 0.6rem; + color: var(--text-color); + font-size: 0.85rem; + text-decoration: none; + border-radius: var(--radius-sm); + transition: background-color 0.2s; + margin: 0.25em; +} + +.project-switcher-item, +.version-dropdown-item, +.language-switcher-item { + white-space: nowrap; +} + +.version-dropdown-item:hover, +.language-switcher-item:hover, +.project-switcher-item:hover { + background-color: var(--sidebar-link-active-bg); + color: var(--text-heading); + text-decoration: none; +} + +.version-dropdown-item.active, +.language-switcher-item.active, +.project-switcher-item.active { + font-weight: 600; + color: var(--link-color); + background-color: var(--sidebar-link-active-bg); +} + +.version-check, +.language-check, +.project-check { + width: 1rem; + height: 1rem; +} + +.version-chevron, +.language-chevron { + width: 0.75rem; + height: 0.75rem; + transition: transform 0.2s ease; +} + +.docmd-version-dropdown.open .version-chevron, +.docmd-language-switcher.open .language-chevron { + transform: rotate(180deg); +} + +.sidebar-bottom-group .version-dropdown-menu, +.sidebar-bottom-group .language-switcher-menu, +.sidebar-bottom-group .project-switcher-menu { + top: auto; + bottom: calc(100% + 4px); + transform: translateX(-50%) translateY(5px); +} + +.sidebar-bottom-group .docmd-version-dropdown.open .version-dropdown-menu, +.sidebar-bottom-group .docmd-language-switcher.open .language-switcher-menu, +.sidebar-bottom-group .docmd-project-switcher.open .project-switcher-menu { + transform: translateX(-50%) translateY(0); +} + +.sidebar-bottom-group .version-dropdown-toggle .version-chevron, +.sidebar-bottom-group .language-switcher-toggle .language-chevron, +.sidebar-bottom-group .project-switcher-toggle .project-chevron { + transform: rotate(180deg); +} + +.version-latest-badge { + font-size: 0.6rem; + padding: 0.05rem 0.3rem; + border-radius: 3px; + background-color: var(--link-color); + color: #fff; + font-weight: 600; + text-transform: uppercase; + letter-spacing: 0.02em; + margin-left: 0.15rem; +} + +.language-icon { + width: 0.8rem; + height: 0.8rem; + flex-shrink: 0; +} + +.language-label { + text-align: left; +} + +.language-switcher-item.disabled { + opacity: 0.45; + cursor: not-allowed; + pointer-events: none; +} + +.language-unavailable-badge { + font-size: 0.65rem; + padding: 0.1rem 0.35rem; + border-radius: 3px; + background-color: var(--border-color); + color: var(--text-muted); + font-weight: 600; + text-transform: uppercase; + letter-spacing: 0.02em; +} + +.language-compact { + width: auto; + margin-top: 0; +} + +.language-compact .language-switcher-toggle { + display: inline-flex; + align-items: center; + justify-content: center; + width: var(--ui-element-size); + height: var(--ui-element-size); + padding: 0; + background-color: transparent; + border: 1px solid var(--border-color); + border-radius: var(--radius-md); + color: var(--text-muted); + cursor: pointer; + transition: all 0.2s ease; + box-sizing: border-box; +} + +.language-compact .language-switcher-toggle:hover { + background-color: var(--sidebar-link-active-bg); + color: var(--text-heading); + border-color: var(--border-color-hover); +} + +.language-compact .language-icon { + width: 1.1rem; + height: 1.1rem; +} + +.language-compact .language-switcher-menu { + min-width: 140px; + left: auto; + right: 0; + transform: translateY(-5px); +} + +.language-compact.open .language-switcher-menu { + transform: translateY(0); +} + +.options-menu-language { + position: relative; + display: inline-flex; +} + +.card .card-title { + border-bottom: 1px solid var(--border-color) +} + +.content-theme-cover { + display: flex; + flex-direction: column; + flex-grow: 1; +} + +.content-area { + padding: 1rem 1em 1em 2.75rem; + max-width: 1200px; + margin: 0 auto; + width: 100%; + box-sizing: border-box; + flex-grow: 1; + position: relative; + display: flex; + flex-direction: column; +} + +:root[data-theme=dark] .content-area::before { + content: ""; + position: absolute; + top: 0px; + left: 50%; + transform: translate(-100%, -50%); + width: 100%; + height: 50%; + background: radial-gradient(rgba(12, 138, 213, 0.05) 30%, transparent 70%); + pointer-events: none; + z-index: 0; +} + +pre { + color: var(--code-text); + padding: var(--space-4); + overflow-x: auto; + position: relative; + margin: var(--space-2) 0; + background-color: var(--code-bg); + border: 1px solid var(--border-color-codeblock); + border-radius: var(--radius-lg); + box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); + white-space: pre; + line-height: 1.5; + font-size: .85em; +} + +.docmd-code-block-wrapper { + margin: var(--space-6) 0; + border: 1px solid var(--border-color-codeblock); + border-radius: var(--radius-xl); + overflow: hidden; + box-shadow: var(--shadow-sm); + background-color: var(--code-bg); + position: relative; +} + +.docmd-code-block-wrapper pre { + margin: 0; + border: none; + border-radius: 0; + box-shadow: none; +} + +.docmd-code-block-header { + display: flex; + align-items: center; + padding: var(--space-2) var(--space-4); + background-color: rgba(0, 0, 0, 0.04); + border-bottom: 1px solid var(--border-color-codeblock); + position: relative; +} + +.docmd-code-block-header.has-copy-button { + padding-right: 2.75rem; +} + +:root[data-theme=dark] .docmd-code-block-header { + background-color: rgba(255, 255, 255, 0.04); +} + +.docmd-code-block-title { + font-size: 0.85rem; + font-weight: 500; + color: var(--text-color); + font-family: var(--font-family-sans); +} + +pre code { + background-color: transparent; + padding: 0; + font-size: inherit; + border-radius: 0; + border: none; +} + +.table-wrapper { + display: block; + width: 100%; + overflow-x: auto; + margin: var(--space-6) 0; + border-radius: var(--radius-lg); + border: 1px solid var(--border-color); + box-shadow: var(--shadow-sm); +} + +table { + width: 100%; + border-collapse: collapse; + margin: 0; +} + +th { + text-align: left; + font-weight: 600; + padding: var(--space-2) var(--space-4); + border-bottom: 1px solid var(--border-color); + background-color: var(--sidebar-bg); + color: var(--text-heading); + white-space: nowrap; +} + +td { + padding: var(--space-3) var(--space-4); + border-bottom: 1px solid var(--border-color); + color: var(--text-color); +} + +tr:last-child td { + border-bottom: none; +} + +tr:hover td { + background-color: var(--sidebar-link-active-bg); +} + +.sidebar-header { + flex-shrink: 0; + text-align: center; + padding: .5rem +} + +.sidebar-header h1 { + display: inline-block; + font-size: 1.5em; + margin: 0; + padding: 0 +} + +.logo-link img { + max-height: 2.5rem; + width: auto; + margin: 0 auto +} + +.docmd-tab-pane, +.logo-link img.logo-dark, +.tab-panel, +.theme-toggle-button .icon-moon, +html[data-theme=dark] .logo-link img.logo-light, +html[data-theme=dark] .theme-toggle-button .icon-sun { + display: none +} + +.sidebar-nav { + flex-grow: 1; + overflow-y: auto; + overflow-x: hidden; + min-height: 0; + scrollbar-width: thin; +} + +.sidebar-nav li.collapsible>.nav-label:hover { + color: var(--text-color); + +} + +.sidebar-nav .lucide-icon { + width: 1em; + height: 1em; + margin-right: .5em; + vertical-align: -.15em; + stroke-width: 2 +} + +.sidebar-nav .nav-external-icon { + width: 1em; + height: 1.5em; + float: right; + margin-left: auto; + opacity: .5; + display: inline-flex +} + +.next-page, +.prev-page, +.step::before { + color: var(--link-color); + display: flex +} + +.callout .callout-content> :first-child, +.card .card-content> :first-child, +.step-content> :first-child, +.step-title { + margin-top: 0; +} + +.theme-toggle-button .lucide-icon { + width: 1.2em; + height: 1.2em +} + +.docmd-container { + padding: var(--space-4) var(--space-6); + margin: var(--space-2) 0; + border-radius: var(--radius-lg); + border: 1px solid var(--border-color); + background-color: var(--bg-color); + box-shadow: var(--shadow-sm); + overflow: hidden; +} + +.callout { + border: .25px solid color-mix(in srgb, var(--callout-color, transparent) 100%, transparent); + background-color: color-mix(in srgb, var(--callout-color, var(--code-bg)) 8%, transparent); + +} + +.callout-info { --callout-color: #3498db; } +.callout-warning {--callout-color: #f39c12;} +.callout-success, +.callout-tip { + --callout-color: #2ecc71; + +} +.callout-danger { --callout-color: #e74c3c; } + +.callout-title { + font-weight: 700; + margin-bottom: var(--space-2); + display: flex; + align-items: center; + gap: var(--space-2); +} + +.card { + transition: transform 0.18s cubic-bezier(0.4, 0, 0.2, 1), + box-shadow 0.18s cubic-bezier(0.4, 0, 0.2, 1), + border-color 0.18s ease; + will-change: transform; +} + +.card:hover { + transform: translateY(-1px); + border-color: color-mix(in srgb, var(--link-color) 25%, var(--border-color)); +} + +.card .card-title { + font-weight: 600; + font-size: 0.95rem; + margin: calc(-1 * var(--space-4)) calc(-1 * var(--space-6)) var(--space-3); + padding: var(--space-2) var(--space-4); + background-color: var(--sidebar-bg); + border-bottom: 1px solid var(--border-color); + letter-spacing: 0.005em; + min-height: 2.75em; +} + +.docmd-container.steps { + position: relative; + border: none; + background: transparent; + box-shadow: none; +} + +.step { + position: relative; + padding-bottom: 2rem; +} + +.step:last-child { + padding-bottom: 0; +} + +.step::before { + content: attr(data-step); + position: absolute; + left: -3rem; + top: 0; + width: 2rem; + height: 2rem; + background-color: var(--bg-color); + border: 2px solid var(--border-color); + border-radius: 50%; + display: inline-flex; + align-items: center; + justify-content: center; + font-size: 0.875rem; + font-weight: 600; + color: var(--link-color); + z-index: 1; + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05); + transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); +} + +.step:hover::before { + border-color: var(--link-color); + box-shadow: 0 0 0 4px rgba(6, 138, 213, 0.15); +} + +.step-title { + font-size: 1.125rem; + font-weight: 600; + margin-bottom: 0.5rem; + color: var(--text-heading); +} + +.docmd-container.steps-reset { + counter-reset: step-counter 0; +} + +.docmd-container.steps-reset ol.steps-list { + position: relative; + padding-left: 2.5rem; + list-style: none !important; + margin: 1.5rem 0; + counter-reset: list-counter 0; +} + +.docmd-container.steps-reset ol.steps-list::before { + content: ""; + position: absolute; + top: 0.75rem; + bottom: 0.75rem; + left: 0.83rem; + width: 2px; + background: linear-gradient(to bottom, var(--border-color) 0%, var(--border-color) 80%, transparent 100%); + z-index: 0; +} + +.docmd-container.steps-reset ol.steps-list>li.step-item { + counter-increment: list-counter 1; + position: relative; + padding-left: 0.5rem; + margin-bottom: 2rem; + list-style: none !important; +} + +.docmd-container.steps-reset ol.steps-list>li.step-item:last-child { + margin-bottom: 0; +} + +.docmd-container.steps-reset ol.steps-list>li.step-item::before { + content: counter(list-counter) !important; + position: absolute; + left: -2.5rem; + top: 0.15rem; + width: 1.75rem; + height: 1.75rem; + background-color: var(--bg-color); + border: 2px solid var(--border-color); + border-radius: 50%; + display: inline-flex; + align-items: center; + justify-content: center; + font-size: 0.8rem; + font-weight: 600; + color: var(--link-color); + z-index: 1; + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05); + transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); + margin-right: 0 !important; +} + +.docmd-container.steps-reset ol.steps-list>li.step-item:hover::before { + border-color: var(--link-color); + box-shadow: 0 0 0 4px var(--glow-color); +} + +.docmd-container.steps-reset ol.steps-list>li.step-item .step-permalink, +.docmd-container.changelog-timeline .changelog-permalink { + position: absolute; + display: inline-flex; + align-items: center; + justify-content: center; + opacity: 0; + text-decoration: none !important; + border-radius: var(--radius-md); + transition: opacity 0.15s ease, color 0.15s ease, background-color 0.15s ease; +} + +.docmd-container.steps-reset ol.steps-list>li.step-item .step-permalink svg, +.docmd-container.changelog-timeline .changelog-permalink svg { + width: 0.85em; + height: 0.85em; +} + +.docmd-container.steps-reset ol.steps-list>li.step-item:hover .step-permalink, +.docmd-container.steps-reset ol.steps-list>li.step-item .step-permalink:focus-visible, +.docmd-container.changelog-timeline .changelog-entry:hover .changelog-permalink, +.docmd-container.changelog-timeline .changelog-permalink:focus-visible { + opacity: 1; +} + +.docmd-container.steps-reset ol.steps-list>li.step-item .step-permalink:hover, +.docmd-container.steps-reset ol.steps-list>li.step-item .step-permalink:focus-visible, +.docmd-container.changelog-timeline .changelog-permalink:hover, +.docmd-container.changelog-timeline .changelog-permalink:focus-visible { + color: var(--link-color); + background-color: var(--sidebar-bg); +} + +.docmd-container.steps-reset ol.steps-list>li.step-item .step-permalink { + right: -0.5rem; + width: 1.5rem; + height: 1.5rem; + color: var(--text-muted); + z-index: 2; +} + +.docmd-container.changelog-timeline .changelog-permalink { + right: 0rem; + top: .85em; + transform: translateY(-50%); + width: 1rem; + height: 1rem; + color: currentColor; + border-radius: var(--radius-sm); +} + +.docmd-container.steps-reset ol.steps-list>li.step-item { + scroll-margin-top: calc(var(--header-h, 44px) + var(--menubar-h, 44px) + var(--space-6)); +} + +.docmd-container.steps-reset .docmd-container.steps-reset ol.steps-list, +.docmd-container.steps-reset ol.steps-list[start] { + counter-reset: list-counter 0; +} + +.docmd-container.steps-reset .docmd-container.steps-reset ol.steps-list>li.step-item, +.docmd-container.steps-reset ol.steps-list[start]>li.step-item { + counter-increment: list-counter 1; +} + +.docmd-container.steps-reset ol:not(.steps-list)::before, +.docmd-container.steps-reset ol:not(.steps-list)>li::before, +.docmd-container.steps-reset ul::before, +.docmd-container.steps-reset ul>li::before { + width: .75rem; + height: .75rem; + left: -1.5rem; + top: .5rem; + content: "" !important +} + +.mermaid { + margin: var(--space-6) 0; + text-align: center; +} + +.docmd-mermaid-container { + position: relative; + margin: var(--space-6) 0; + padding: var(--space-6) var(--space-4); + border: 1px solid var(--border-color-codeblock); + border-radius: var(--radius-xl); + box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); + background-color: var(--bg-color); +} + +.mermaid-wrapper { + position: relative; + overflow: hidden; + cursor: grab; +} + +.mermaid-wrapper:active { + cursor: grabbing; +} + +.mermaid-controls { + position: absolute; + bottom: 16px; + right: 16px; + display: flex; + flex-direction: column; + align-items: flex-end; + gap: 4px; + z-index: 10; + opacity: 0; + transition: opacity 0.2s ease; +} + +.mermaid-wrapper:hover .mermaid-controls, +.mermaid-wrapper.mermaid-fullscreen .mermaid-controls { + opacity: 1; +} + +.mermaid-wrapper.mermaid-fullscreen { + background-color: var(--bg-color); + display: flex; + align-items: center; + justify-content: center; + max-height: none; +} + +.docmd-mermaid-container svg { + max-width: none; + display: block; + margin: 0 auto; +} + +.mermaid-error { + color: #e74c3c; + padding: 1rem; + margin: 0; + background-color: #e74c3c12; + border-left-width: 4px; + border-left-style: solid; + border-left-color: #e74c3c; + border-radius: 4px; + font-size: .9rem +} + +pre.mermaid { + background-color: transparent; + padding: 0; + margin: 0; + border: medium; + display: none +} + +.docmd-container.collapsible { + padding: 0; + background-color: var(--card-bg, var(--bg-color)); + border: 1px solid var(--border-color); + border-radius: var(--radius-lg); + overflow: hidden; + margin-bottom: 1.5rem; + transition: border-color .2s +} + +.docmd-container.collapsible[open] { + border-color: var(--link-color) +} + +.collapsible-summary { + list-style: none; + padding: .5rem 1rem; + cursor: pointer; + display: flex; + align-items: center; + justify-content: space-between; + font-weight: 600; + background-color: var(--sidebar-bg); + transition: background-color .2s +} + +.collapsible-summary:hover { + background-color: var(--sidebar-link-active-bg) +} + +.collapsible-summary::-webkit-details-marker { + display: none +} + +.collapsible-arrow svg { + width: 1.2em; + height: 1.2em; + transition: transform .2s; + opacity: .7 +} + +details[open]>.collapsible-summary .collapsible-arrow svg { + transform: rotate(180deg) +} + +.collapsible-content { + padding: .5rem 1rem; + border-top: 1px solid var(--border-color) +} + +.docmd-container.changelog-timeline { + border: none; + background: transparent; + margin-top: 2rem; + box-shadow: none; + position: relative; +} + +.docmd-container.changelog-timeline::before { + content: ""; + position: absolute; + top: 0.5rem; + bottom: 2rem; + left: var(--space-6); + width: 2px; + background: linear-gradient(to bottom, transparent 0%, var(--border-color) 3%, var(--border-color) 90%, transparent 100%); + pointer-events: none; + z-index: 0; +} + +.changelog-entry { + position: relative; + padding-left: 28px; + margin-bottom: 1rem; + display: block; +} + +.changelog-entry::after { + content: ""; + position: absolute; + left: -3px; + top: 0.6rem; + width: 8px; + height: 8px; + background-color: var(--bg-color); + border: 2px solid var(--border-color); + border-radius: 50%; + z-index: 2; + transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); +} + +.changelog-entry:hover::after { + transform: scale(1.4); + border-color: var(--link-color); + background-color: var(--link-color); + box-shadow: 0 0 0 4px rgba(6, 138, 213, 0.15); +} + +.changelog-meta { + display: block; + text-align: left; + margin-bottom: 0.6rem; + padding-top: 0; +} + +.changelog-date { + display: inline-block; + background-color: var(--sidebar-link-active-bg); + color: var(--link-color); + padding: 3px 12px; + border-radius: 8px; + font-size: 0.75rem; + font-weight: 600; + text-transform: uppercase; + letter-spacing: 0.03em; + position: relative; +} + +.changelog-body { + border-left: none; + padding-left: 0; + padding-bottom: 0.5rem; +} + +.changelog-body> :first-child { + margin-top: 0; +} + +:focus-visible { + outline: 2px solid var(--link-color); + outline-offset: 2px; + border-radius: 4px; + transition: box-shadow 0.15s ease; +} + +:focus:not(:focus-visible) { + outline: none !important; + box-shadow: none !important; +} + +.sidebar nav li a:focus-visible { + background-color: var(--sidebar-link-active-bg); + outline: 2px solid var(--link-color); + outline-offset: -2px +} + +.theme-toggle-button:focus-visible { + border-color: var(--link-color); + box-shadow: 0 0 0 2px var(--link-color) +} + +a, +button, +.toc-link, +.sidebar nav li a, +.copy-code-button, +.docmd-tabs-nav-item, +.theme-toggle-button, +.docmd-button, +.docmd-tag { + transition: color 0.15s ease, background-color 0.15s ease, + border-color 0.15s ease, transform 0.15s ease, + box-shadow 0.15s ease, opacity 0.15s ease; +} + +.page-footer { + border-top: 1px solid var(--border-color) + +} + +.page-navigation { + display: flex; + justify-content: space-between; + margin-top: auto; + padding-top: 1.5rem +} + +.next-page, +.prev-page { + align-items: center; + text-decoration: none; + padding: .75rem 1em; + border-radius: var(--radius-lg); + transition: background-color .2s; + min-width: 50%; + overflow: hidden; + max-width: 48%; + text-overflow: ellipsis; +} + +.next-page:hover, +.prev-page:hover { + background-color: var(--menubar-link-hover-bg); + text-decoration: none +} + +:root[data-theme=dark] .next-page:hover, +:root[data-theme=dark] .prev-page:hover { + background-color: #ffffff0d +} + +.prev-page { + justify-content: flex-start +} + +.next-page { + justify-content: flex-end; + text-align: right +} + +.next-page-placeholder, +.prev-page-placeholder { + width: 48% +} + +.next-page span, +.prev-page span { + display: flex; + flex-direction: column +} + +.next-page small, +.prev-page small { + font-size: .8rem; + opacity: .8; + margin-bottom: .25rem +} + +.next-page > span, +.prev-page > span { + min-width: 0; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap +} + +.next-page > span > strong, +.prev-page > span > strong { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap +} + +.next-page strong, +.prev-page strong { + font-weight: 500 +} + +.page-nav-icon { + width: 1.2rem; + height: 1.2rem +} + +.prev-page .page-nav-icon { + margin-right: .75rem +} + +.next-page .page-nav-icon { + margin-left: .75rem +} + +.content-layout { + display: flex; + gap: 2rem; + width: 100%; + align-items: stretch; + flex: 1 0 auto; + min-height: 0 +} + +.main-content { + flex: 1 1 0; + width: 100%; + min-width: 0; + display: flex; + flex-direction: column; +} + +.toc-container { + margin: 0; + padding: 0; + border: medium; + background-color: transparent +} + +.docmd-container figure img, +.toc-title { + margin-bottom: .5rem +} + +.toc-list { + scrollbar-width: thin; + list-style: none; + padding: .5em .25em; + margin: 0; + overflow-y: visible +} + +.toc-item { + margin-bottom: .25rem; + line-height: 1.4 +} + +.toc-link { + display: block; + padding: .3rem .75rem; + font-size: .85rem; + font-weight: 500; + text-decoration: none; + border-left: 2px solid transparent; + margin-left: .25em; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + border-radius: 0 var(--radius-sm) var(--radius-sm) 0; + transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease; +} + +.toc-link:hover { + color: var(--text-heading); + background-color: var(--sidebar-bg); +} + +.toc-link.active { + color: var(--link-color); + border-left-color: var(--link-color); + background-color: color-mix(in srgb, var(--link-color) 8%, transparent); + font-weight: 600; +} + +.toc-level-3 { + padding-left: 2rem +} + +.toc-level-4 { + padding-left: 3rem +} + +.toc-title { + font-size: .85em; + display: contents; + text-transform: uppercase; + margin: 0; + cursor: pointer; + border-bottom-width: 0; + border-bottom-style: none; + border-bottom-color: currentcolor; + padding-bottom: 0 +} + +.docmd-tabs, +img { + margin: 1.5rem 0 +} + +img { + max-width: 100%; + height: auto +} + +img.align-left { + float: left; + margin-right: 1.5rem; + margin-bottom: 1rem +} + +img.align-center { + margin-left: auto; + margin-right: auto +} + +img.align-right { + float: right; + margin-left: 1.5rem; + margin-bottom: 1rem +} + +img.size-small { + max-width: 300px +} + +img.size-medium { + max-width: 500px +} + +img.size-large { + max-width: 800px +} + +img.with-border { + border: 1px solid var(--image-border-color); + border-radius: var(--image-border-radius); +} + +img.with-shadow { + box-shadow: var(--image-shadow) +} + +.docmd-container figure { + margin: 2rem 0 +} + +.docmd-container figcaption { + font-size: .9rem; + color: var(--image-caption-text); + text-align: center; + padding: .5rem; + background-color: var(--image-caption-bg); + border-radius: 0 0 4px 4px +} + +.docmd-container .image-gallery { + display: grid; + grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); + gap: 1rem; + margin: 2rem 0 +} + +.docmd-container .image-gallery figure { + margin: 0 +} + +.docmd-container .clear-float::after { + content: ""; + display: table; + clear: both +} + +.docmd-tabs { + border: 1px solid var(--border-color); + border-radius: 6px; + overflow: hidden; + box-shadow: #0000000d 0 1px 3px +} + +.docmd-tabs-nav { + display: flex; + background-color: var(--sidebar-bg); + border-bottom: 1px solid var(--border-color); + overflow: auto hidden +} + +.docmd-tabs-nav-item { + padding: .5rem 1.25rem; + cursor: pointer; + border-bottom-width: 3px; + border-bottom-style: solid; + border-bottom-color: transparent; + margin-bottom: -1px; + font-weight: 500; + color: var(--sidebar-text); + white-space: nowrap; + display: flex; + align-items: center; + gap: 8px; +} + +.tab-icon { + width: 1.1em; + height: 1.1em; + flex-shrink: 0; + stroke-width: 2px +} + +.docmd-tabs-nav-item.active { + color: var(--link-color); + border-bottom-color: var(--link-color); + background-color: var(--bg-color) +} + +.docmd-tabs-content { + padding: var(--space-6); + +} + +.tabs-container { + margin: 1rem 0; + border: 1px solid #e1e5e9; + border-radius: .375rem +} + +.tab-navigation { + display: flex; + background-color: #f8f9fa; + border-bottom-width: 1px; + border-bottom-style: solid; + border-bottom-color: #e1e5e9; + border-radius: .375rem .375rem 0 0 +} + +.tab-button { + padding: .75rem 1rem; + border-width: medium medium 2px; + border-style: none none solid; + border-color: currentcolor currentcolor transparent; + border-image: none; + background: 0 0; + cursor: pointer; + transition: .2s +} + +.tab-button:hover { + background-color: #e9ecef +} + +.tab-button.active { + border-bottom-color: #007bff; + background-color: #fff +} + +.tab-content { + padding: 1rem +} + +.docmd-lightbox { + display: none; + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + background-color: var(--lightbox-bg); + z-index: 9999; + justify-content: center; + align-items: center; + flex-direction: column +} + +.copy-code-button svg { + width: 1rem; + height: 1rem +} + +.docmd-lightbox-content { + position: relative; + max-width: 90%; + max-height: 90%; + text-align: center +} + +.docmd-lightbox-content img { + max-width: 100%; + max-height: 80vh; + object-fit: contain; + margin: 0 auto; + box-shadow: #0000004d 0 0 20px +} + +.docmd-lightbox-caption { + color: var(--lightbox-text); + padding: 1rem; + font-size: 1rem; + max-width: 100% +} + +.docmd-lightbox-close { + position: absolute; + top: 20px; + right: 30px; + color: var(--lightbox-text); + font-size: 2.5rem; + cursor: pointer; + z-index: 10000 +} + +.docmd-lightbox-close:hover { + color: #ddd +} + +a.docmd-button { + color: #fff; + text-decoration: none +} + +.docmd-container .image-gallery img, +img.lightbox { + cursor: zoom-in +} + +.docmd-button { + display: inline-flex; + align-items: center; + gap: 0.45rem; + padding: .6rem 1.2rem; + margin: .5rem .5em .5em 0; + border-radius: var(--radius-md); + background-color: var(--link-color); + font-weight: 500; + transition: background-color .15s ease, transform .15s ease, box-shadow .15s ease, filter .15s ease; + border: medium; + cursor: pointer; + width: fit-content; +} + +.docmd-button:hover { + text-decoration: none; + filter: brightness(1.05); + transform: translateY(-1px); + box-shadow: 0 4px 12px -2px var(--glow-color-strong); +} + +.docmd-button:active { + transform: translateY(0); + box-shadow: none; +} + +.docmd-button .button-icon { + width: 1em; + height: 1em; + flex-shrink: 0; + vertical-align: middle; +} + +.docmd-tag { + display: inline-flex; + align-items: center; + padding: 0 0.5em; + border-radius: var(--radius-xl); + font-size: .85em; + font-weight: 500; + background-color: var(--docmd-surface); + color: var(--docmd-text); + vertical-align: middle; + margin: 0 0.2em; + transition: all 0.2s; +} + +a.docmd-tag-link .docmd-tag:hover { + filter: brightness(1.1); + transform: translateY(-1px); +} + +.docmd-tag .tag-icon { + display: inline-block; + margin-right: 5px; +} + +.callout-title { + display: flex; + align-items: center; + gap: 0.4rem; +} + +.callout-icon-heading, +.card-icon-heading, +.collapsible-icon-heading { + width: 1.1em; + height: 1.1em; + flex-shrink: 0; + vertical-align: middle; +} + +.card-title { + display: flex; + align-items: center; + gap: 0.4rem; +} + +.copy-code-button { + position: absolute; + top: .85rem; + right: .5rem; + padding: .5rem; + background-color: transparent; + border: 0; + border-radius: 6px; + cursor: pointer; + opacity: 0; + transition: opacity .15s ease-in-out, background-color .15s ease, color .15s ease; + color: var(--sidebar-text); + display: flex; + align-items: center; + justify-content: center; + z-index: 10; + pointer-events: auto +} + +.copy-code-button.copied { + color: #10b981; + opacity: 1 +} + +.docmd-code-block-header.has-copy-button>.copy-code-button { + top: 50%; + right: var(--space-2); + transform: translateY(-50%); + margin: 0; +} + +hr { + border-top: 1px solid var(--border-color); + border-bottom: 0; + border-left: 0; + border-right: 0; + margin: 1em; +} + +.edit-link { + display: inline-flex; + align-items: center; + gap: .5rem; + color: var(--text-light); + text-decoration: none; +} + +.edit-link:hover { + color: var(--link-color) +} + +.edit-link svg { + width: 1em; + height: 1em +} + +.docmd-search-modal { + position: fixed; + inset: 0; + background-color: #00000080; + z-index: 1000; + display: flex; + justify-content: center; + align-items: flex-start; + padding-top: 10vh +} + +.docmd-search-box { + width: 100%; + max-width: 600px; + background-color: var(--bg-color); + border: 1px solid var(--border-color); + border-radius: var(--radius-xl); + box-shadow: var(--shadow-lg); + display: flex; + flex-direction: column; + overflow: hidden; + animation: .2s ease-out searchSlideIn +} + +@keyframes searchSlideIn { + 0% { + opacity: 0; + transform: scale(.98) translateY(10px) + } + + 100% { + opacity: 1; + transform: scale(1) translateY(0) + } +} + +.docmd-search-header { + display: flex; + align-items: center; + padding: 1rem 1.5rem; + border-bottom: 1px solid var(--border-color); + gap: 1rem +} + +.docmd-search-header svg { + color: var(--link-color) +} + +#docmd-search-input { + flex: 1 1 0; + border: medium; + background: 0 0; + font-size: 1.1rem; + color: var(--text-color); + outline: currentcolor +} + +.docmd-search-close { + background: 0 0; + border: 0; + cursor: pointer; + padding: 0; + display: flex; + font-size: 1.25em +} + +.docmd-search-results { + max-height: 60vh; + overflow-y: auto; + padding: .5rem +} + +.search-result-item { + display: block; + padding: .75rem 1rem; + border-radius: 6px; + text-decoration: none; + color: var(--text-color); + margin-bottom: 2px; + border-left-width: 3px; + border-left-style: solid; + border-left-color: transparent +} + +.search-result-item.selected, +.search-result-item:focus, +.search-result-item:hover { + background-color: var(--sidebar-bg); + border-left-color: var(--link-color); + text-decoration: none; + cursor: pointer +} + +.search-result-title { + display: flex; + align-items: center; + gap: 0.4rem; + font-weight: 600; + font-size: .95rem; + margin-bottom: .2rem; + color: var(--link-color) +} + +.search-result-version { + flex-shrink: 0; + font-size: 0.6rem; + font-weight: 600; + padding: 0.1rem 0.4rem; + border-radius: 999px; + text-transform: uppercase; + letter-spacing: 0.03em; + white-space: nowrap; + line-height: 1.4; +} + +.search-result-meta { + display: flex; + align-items: center; + gap: 0.35rem; + margin-left: auto; + flex-shrink: 0; +} + +.search-result-confidence { + font-size: 0.6875rem; + font-weight: 600; + padding: 0.1rem 0.45rem; + border-radius: 999px; + white-space: nowrap; + line-height: 1.4; + background: var(--docmd-accent-soft, rgba(59, 130, 246, 0.08)); + color: var(--docmd-accent, #3b82f6); +} + +.search-result-confidence.confidence-high { + background: rgba(22, 163, 74, 0.08); + color: var(--docmd-green, #16a34a); +} + +.search-result-preview { + font-size: .8rem; + color: var(--text-muted, #666); + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis +} + +.search-error, +.search-no-results { + padding: 2rem; + text-align: center; + color: var(--text-muted, #666) +} + +.search-error, +.search-initial, +.search-no-results { + padding: 3rem 2rem 5em; + text-align: center; + color: var(--text-muted, #666); + font-size: .95rem +} + +.search-result-preview mark { + background-color: #ffeb3b66; + color: inherit; + padding: 0 2px; + border-radius: 2px +} + +:root[data-theme=dark] .search-result-preview mark { + background-color: #ffeb3b40; + color: #fff +} + +.docmd-search-footer { + padding: .75rem 1.5rem; + background-color: var(--sidebar-bg); + border-top: 1px solid var(--border-color); + font-size: .75rem; + color: var(--text-muted, #888); + display: flex; + gap: 1rem; + justify-content: flex-end +} + +.sidebar-menu-button { + font-size: 1.5em +} + +.mobile-view { + display: none; + cursor: pointer +} + +.float-left { + float: left +} + +.float-right { + float: right +} + +.footer-complete { + background-color: var(--sidebar-bg); + border-top: 1px solid var(--border-color); + padding: 2.5rem; + margin-top: auto; +} + +.footer-complete-top { + display: flex; + justify-content: space-between; + align-items: flex-start; + flex-wrap: wrap; + gap: 3rem; + max-width: 1200px; + margin: 0 auto 4rem auto; +} + +.footer-brand { + flex: 1 1 300px; + max-width: 400px; + text-align: left; +} + +.footer-brand .logo-link { + display: block; + overflow: hidden; + margin: 0 0 1rem 0; + width: fit-content; +} + +.footer-brand .logo-link img { + max-height: 28px; + width: auto; +} + +.footer-columns { + display: flex; + flex-wrap: wrap; + gap: 4rem; + justify-content: flex-end; + flex: 2 1 auto; +} + +.footer-column { + min-width: 140px; +} + +.footer-title { + font-size: 1.25rem; + font-weight: 600; + color: var(--text-heading); +} + +.footer-desc { + color: var(--text-muted); + font-size: 0.875rem; + line-height: 1.5; + margin-top: 0.75rem; + opacity: 0.9; +} + +.footer-column-title { + display: block; + font-size: 0.75rem; + font-weight: 600; + text-transform: uppercase; + letter-spacing: 0.08em; + color: var(--text-muted); + margin-bottom: 1.25rem; +} + +.footer-column ul { + list-style: none; + padding: 0; + margin: 0; +} + +.footer-column ul li { + margin-bottom: 0.75rem; +} + +.footer-column ul a { + color: var(--text-muted); + text-decoration: none; + font-size: 0.875rem; + transition: color 0.2s ease; +} + +.footer-column ul a:hover { + color: var(--link-color); +} + +.footer-complete-bottom { + max-width: 1200px; + margin: 0 auto; + padding-top: 2rem; + border-top: 1px solid var(--border-color); + display: flex; + justify-content: space-between; + align-items: center; + font-size: 0.875rem; + color: var(--text-muted); +} + +.page-footer { + text-align: center; + padding: 20px 30px; + margin-top: auto; + font-size: .9em; + color: var(--text-color); + background-color: var(--sidebar-bg) +} + +.footer-content { + display: flex; + justify-content: space-between; + align-items: center; + margin: 0 auto; + width: 100% +} + +.user-footer { + text-align: left +} + +.branding-footer { + text-align: right; + opacity: .9; + font-weight: 500 +} + +.branding-footer svg { + color: #fb3a3a +} + +.branding-footer a, +.page-footer a { + color: var(--link-color); + text-decoration: none +} + +.page-footer-actions { + margin-top: 1.5rem; + padding: 1.5rem .5em .75em; + border-top: 1px solid var(--border-color); + display: flex; + justify-content: flex-end; + gap: 1rem; + font-size: .875rem +} + +@media (max-width: 1024px) { + .content-layout { + display: flex; + flex-direction: column-reverse; + gap: 0 + } + + .toc-sidebar { + width: 100%; + max-height: initial; + position: static + } + + .toc-container { + background-color: var(--sidebar-bg); + border: 1px solid var(--border-color); + border-radius: 6px; + height: 2.25em; + overflow: hidden + } + + .toc-container .toc-title { + padding: .5rem 1rem; + display: block + } + + .toc-container .mobile-view { + display: inline-flex; + padding: .15rem 0 + } + + .mobile-expanded { + height: auto !important; + overflow: auto + } + + .toc-container.mobile-expanded .toc-list { + height: auto; + max-height: auto + } + + .toc-menu-button svg { + transition: transform .3s + } + + .toc-container.mobile-expanded .toc-menu-button svg { + transform: rotate(180deg) + } +} + +@media (max-width: 768px) { + body { + flex-direction: column + } + + .sidebar { + width: 100%; + height: 3rem; + position: relative; + top: 0; + border-right-width: medium; + border-right-style: none; + border-right-color: currentcolor; + border-bottom: 1px solid var(--border-color); + z-index: 100 + } + + .sidebar-header { + border-bottom-width: 0; + border-bottom-style: none; + border-bottom-color: currentcolor; + padding-bottom: 0; + margin-bottom: 0; + text-align: left; + box-shadow: none; + } + + .sidebar-menu-button { + font-size: 1.5em + } + + .sidebar #theme-toggle-button, + .sidebar-nav, + .sidebar-top-group, + .sidebar-bottom-group { + max-height: 0; + display: none; + opacity: 0; + transition: max-height .3s ease-out, opacity .3s ease-out, margin .3s; + margin-top: 0 + } + + .sidebar.mobile-expanded #theme-toggle-button, + .sidebar.mobile-expanded .sidebar-nav { + max-height: initial; + opacity: 1; + display: block + } + + + + .sidebar.mobile-expanded .sidebar-top-group, + .sidebar.mobile-expanded .sidebar-bottom-group { + max-height: initial; + opacity: 1; + display: flex + } + + .sidebar-toggle-button { + display: none !important + } + + .logo-link img { + float: left + } + + .mobile-view { + display: inline-flex; + padding: 4px + } + + .main-content-wrapper { + margin-left: 0 + } + + .page-navigation { + flex-direction: column; + gap: 1rem + } + + .next-page, + .next-page-placeholder, + .prev-page, + .prev-page-placeholder { + width: 100%; + max-width: 100% + } + + img.align-left, + img.align-right { + float: none; + margin-left: auto; + margin-right: auto + } + + .docmd-container .image-gallery { + grid-template-columns: 1fr + } + + .docmd-search-modal { + padding-top: 0; + background-color: var(--bg-color); + align-items: flex-start + } + + .docmd-search-box { + max-width: 100%; + height: 100%; + border-radius: 0; + border: medium; + box-shadow: none + } + + .docmd-search-header { + padding: 1rem + } + + #docmd-search-input { + font-size: 1rem + } + + .docmd-search-footer { + display: none + } + + .docmd-search-results { + max-height: none; + flex: 1 1 0 + } + + .changelog-entry { + grid-template-columns: 1fr; + gap: 1rem + } + + .changelog-entry::after { + display: none !important; + } + + .docmd-container.changelog-timeline::before { + display: none !important; + } + + .changelog-meta { + text-align: left; + padding-top: 0 + } + + body.has-menubar-top .docmd-menubar, + body.has-menubar-header .docmd-menubar { + position: sticky !important; + top: 0 !important; + left: 0 !important; + right: 0 !important; + width: 100% !important; + box-shadow: none; + z-index: 250 !important; + } + + body.has-menubar-top .page-header, + body.has-menubar-header .page-header { + position: relative !important; + top: auto !important; + } + + .heading-anchor { + position: static; + margin-right: var(--space-2); + opacity: 1; + color: var(--border-color); + } + + .content-area { + padding: var(--space-4); + } + + .docmd-breadcrumbs { + display: none; + } + + .docmd-menubar { + padding: 0; + } + + .menubar-brand-text { + display: none; + } + + .menubar-inner { + padding: 0 var(--space-3); + gap: var(--space-2); + } + + .menubar-link, + .menubar-dropdown-toggle { + padding: 0.25rem 0.5rem; + font-size: 0.8125rem; + } + + .header-left, + .header-right { + margin-left: 0; + margin-right: 0; + } + + .search-keys, + .search-label { + display: none + } + + .footer-complete-top { + flex-direction: column; + gap: 2rem; + text-align: center; + } + + .footer-brand { + max-width: 100%; + margin: 0 auto; + text-align: center; + flex: 1; + } + + .footer-brand .logo-link { + margin: 0 auto + } + + .footer-columns { + justify-content: center; + gap: 2rem; + width: 100%; + } + + .footer-column { + width: 100%; + } + + .footer-complete-bottom { + flex-direction: column; + gap: 1rem; + text-align: center; + } + + .footer-content, + .page-navigation { + flex-direction: column; + gap: 1rem + } + + .branding-footer, + .user-footer { + text-align: center + } +} + +.sidebar nav li { + margin: .25em; +} + +.callout-content p { + margin: 0; +} + +.edit-link:hover { + text-decoration: underline; +} + +code { + padding: .15em .5em; +} + +.docmd-container.grids { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); + gap: var(--space-4); + margin: var(--space-4) 0; + width: 100%; + border: 0; + box-shadow: none; + padding: 0; +} + +.docmd-container.grid-item { + display: flex; + flex-direction: column; + width: 100%; + gap: var(--space-4); + min-width: 0; + background: transparent; + padding: var(--space-1); + border: 0; + box-shadow: none; + margin-bottom: 0; +} + +.grids .grid-item .card { + height: stretch; +} + +ul.contains-task-list { + list-style: none !important; + padding-left: 0.5em; +} + +ul.contains-task-list>li::marker { + content: none !important; + display: none !important; +} + +.task-list-item-checkbox { + margin-top: .25em; +} + +.docmd-hero { + position: relative; + width: 100%; + margin: var(--space-12) 0; + padding: var(--space-12) 0; + display: flex; + flex-direction: column; +} + +.docmd-hero.hero-glow::before { + content: ''; + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: 80%; + height: 80%; + background: radial-gradient(circle, var(--link-color) 0%, transparent 70%); + opacity: 0.08; + filter: blur(100px); + z-index: -1; + pointer-events: none; +} + +.docmd-hero.hero-banner { + text-align: center; + align-items: center; +} + +.docmd-hero.hero-banner .hero-content { + max-width: 800px; +} + +.docmd-hero.hero-split { + display: flex; + flex-direction: row; + align-items: center; + gap: var(--space-12); + text-align: left; +} + +.docmd-hero.hero-split .hero-content { + flex: 1 1 0; + min-width: 0; +} + +.docmd-hero.hero-split .hero-side { + flex: 1 1 0; + min-width: 0; + display: flex; + justify-content: center; + align-items: center; +} + +.docmd-hero.hero-slider { + overflow: hidden; + position: relative; +} + +.hero-slider-track { + display: flex; + scroll-snap-type: x mandatory; + overflow-x: auto; + scrollbar-width: none; + -ms-overflow-style: none; + scroll-behavior: smooth; +} + +.hero-slider-track::-webkit-scrollbar { + display: none; +} + +.hero-slide { + flex: 0 0 100%; + scroll-snap-align: start; + padding: var(--space-8) var(--space-4); + box-sizing: border-box; + text-align: center; +} + +.hero-slider-controls { + display: flex; + justify-content: center; + align-items: center; + gap: var(--space-3); + margin-top: var(--space-6); +} + +.hero-slider-btn { + background: var(--bg-secondary); + border: 1px solid var(--border-color); + color: var(--text-primary); + width: 36px; + height: 36px; + border-radius: 50%; + cursor: pointer; + display: flex; + align-items: center; + justify-content: center; + transition: background 0.2s, border-color 0.2s; + flex-shrink: 0; +} + +.hero-slider-btn:hover { + background: var(--link-color); + border-color: var(--link-color); + color: #fff; +} + +.hero-slider-dots { + display: flex; + gap: var(--space-2); + align-items: center; +} + +.hero-slider-dot { + width: 8px; + height: 8px; + border-radius: 50%; + background: var(--border-color); + cursor: pointer; + transition: background 0.2s, transform 0.2s; + border: none; + padding: 0; +} + +.hero-slider-dot.active { + background: var(--link-color); + transform: scale(1.3); +} + +.hero-content h1 { + font-size: clamp(2.5rem, 8vw, 4.5rem); + font-weight: 900; + line-height: .95; + letter-spacing: -0.05em; + margin-bottom: var(--space-4); +} + +.hero-content p { + font-size: clamp(1.1rem, 2.5vw, 1.4rem); + color: var(--text-muted); + line-height: 1.4; + margin-bottom: var(--space-6); +} + +.hero-side img, +.hero-side video, +.hero-side .docmd-embed { + width: 100%; + border-radius: var(--radius-xl); + box-shadow: var(--shadow-lg); +} + +@media (max-width: 960px) { + .docmd-hero.hero-split { + flex-direction: column; + text-align: center; + gap: var(--space-8); + } + + .hero-content h1 { + font-size: 3rem; + } +} + +.project-icon { + width: 0.9rem; + height: 0.9rem; + color: var(--link-color); +} + +.project-label { + max-width: 120px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.project-chevron { + width: 0.75rem; + height: 0.75rem; + opacity: 0.5; +} + +.project-prefix { + font-size: 0.75rem; + opacity: 0.5; + line-height: 1em +} + +.project-compact { + width: auto; + margin-top: 0; +} + +.project-compact .project-switcher-toggle { + display: inline-flex; + align-items: center; + justify-content: center; + width: var(--ui-element-size); + height: var(--ui-element-size); + padding: 0; + background-color: transparent; + border: 1px solid var(--border-color); + border-radius: var(--radius-md); + color: var(--text-muted); + cursor: pointer; + transition: all 0.2s ease; + box-sizing: border-box; +} + +.project-compact .project-switcher-toggle:hover { + background-color: var(--sidebar-link-active-bg); + color: var(--text-heading); + border-color: var(--border-color-hover); +} + +.project-compact .project-icon { + width: 1.1rem; + height: 1.1rem; +} + +.project-compact .project-switcher-menu { + min-width: 180px; + left: auto; + right: 0; + transform: translateY(-5px); +} + +.project-compact.open .project-switcher-menu { + transform: translateY(0); +} + +.options-menu-project-switcher { + position: relative; + display: inline-flex; +} + +@media (min-width: 769px) { + body.sidebar-collapsed .sidebar { + transform: translateX(-100%); + visibility: hidden; + } + + body.sidebar-collapsed .main-content-wrapper { + margin-left: 0; + } +} + +.docmd-banner { + width: 100%; + border-bottom: 1px solid var(--border-color, rgba(0, 0, 0, 0.08)); + font-size: 0.9rem; + line-height: 1.5; + background-color: var(--bg-color, #fff); + color: var(--text-color, #1f2937); +} + +.docmd-banner--info { + background-color: color-mix(in srgb, var(--accent-color, #3b82f6) 8%, var(--bg-color, #fff)); + border-bottom-color: color-mix(in srgb, var(--accent-color, #3b82f6) 20%, transparent); +} + +.docmd-banner--success { + background-color: color-mix(in srgb, #10b981 8%, var(--bg-color, #fff)); + border-bottom-color: color-mix(in srgb, #10b981 20%, transparent); +} + +.docmd-banner--warning { + background-color: color-mix(in srgb, #f59e0b 10%, var(--bg-color, #fff)); + border-bottom-color: color-mix(in srgb, #f59e0b 25%, transparent); +} + +.docmd-banner--danger { + background-color: color-mix(in srgb, #ef4444 8%, var(--bg-color, #fff)); + border-bottom-color: color-mix(in srgb, #ef4444 20%, transparent); +} + +.docmd-banner__inner { + max-width: var(--content-max-width, 1400px); + margin: 0 auto; + padding: 0.65rem 1.25rem; + display: flex; + align-items: center; + gap: 0.75rem; + flex-wrap: wrap; +} + +.docmd-banner__icon { + display: inline-flex; + align-items: center; + flex-shrink: 0; + color: var(--text-heading, inherit); +} + +.docmd-banner__icon svg { + width: 1.1em; + height: 1.1em; +} + +.docmd-banner__content { + display: flex; + align-items: center; + gap: 0.75rem; + flex: 1 1 auto; + flex-wrap: wrap; + min-width: 0; +} + +.docmd-banner__text { + word-break: break-word; +} + +.docmd-banner__text code { + font-size: 0.85em; + padding: 0.05em 0.3em; + background-color: rgba(0, 0, 0, 0.05); + border-radius: 4px; +} + +.docmd-banner__link { + display: inline-flex; + align-items: center; + gap: 0.25rem; + font-weight: 500; + text-decoration: none; + color: inherit; + border-bottom: 1px solid currentColor; + padding-bottom: 1px; + white-space: nowrap; +} + +.docmd-banner__link:hover { + opacity: 0.85; +} + +.docmd-banner__link-icon { + width: 0.95em; + height: 0.95em; +} + +.docmd-banner__close { + flex-shrink: 0; + display: inline-flex; + align-items: center; + justify-content: center; + width: 1.5rem; + height: 1.5rem; + padding: 0; + background-color: transparent; + border: none; + border-radius: 4px; + color: inherit; + cursor: pointer; + opacity: 0.6; + transition: opacity 0.15s ease, background-color 0.15s ease; +} + +.docmd-banner__close:hover { + opacity: 1; + background-color: rgba(0, 0, 0, 0.05); +} + +.docmd-banner__close svg { + width: 1em; + height: 1em; +} + +.docmd-banner[hidden] { + display: none; +} + +.docmd-cookie-banner { + position: fixed; + z-index: 9999; + font-size: 0.9rem; + line-height: 1.5; + color: var(--text-color, #1f2937); + background-color: var(--bg-color, #fff); + border: 1px solid var(--border-color, rgba(0, 0, 0, 0.08)); + border-radius: var(--radius-md, 8px); + box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05); + max-width: min(560px, calc(100vw - 2rem)); + animation: docmd-cookie-banner-in 0.25s ease-out; +} + +.docmd-cookie-banner--bottom { + left: 50%; + bottom: 1.5rem; + transform: translateX(-50%); +} + +.docmd-cookie-banner--bottom-left { + left: 1.5rem; + bottom: 1.5rem; +} + +.docmd-cookie-banner--bottom-right { + right: 1.5rem; + bottom: 1.5rem; +} + +.docmd-cookie-banner--center { + top: 50%; + left: 50%; + transform: translate(-50%, -50%); +} + +.docmd-cookie-banner__inner { + display: flex; + align-items: center; + gap: 1rem; + padding: 1rem 1.25rem; + flex-wrap: wrap; +} + +.docmd-cookie-banner__content { + flex: 1 1 240px; + min-width: 0; +} + +.docmd-cookie-banner__message { + margin: 0; + color: var(--text-color, inherit); +} + +.docmd-cookie-banner__policy { + display: inline-block; + margin-top: 0.35rem; + font-size: 0.85em; + text-decoration: underline; + color: inherit; + opacity: 0.85; +} + +.docmd-cookie-banner__actions { + display: flex; + align-items: center; + gap: 0.5rem; + flex-shrink: 0; +} + +.docmd-cookie-banner__btn { + appearance: none; + border: 1px solid var(--border-color, rgba(0, 0, 0, 0.12)); + background-color: var(--bg-color, #fff); + color: var(--text-color, inherit); + border-radius: var(--radius-sm, 6px); + padding: 0.4rem 0.85rem; + font-size: 0.875rem; + font-weight: 500; + cursor: pointer; + transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease; +} + +.docmd-cookie-banner__btn--accept { + background-color: var(--accent-color, #3b82f6); + border-color: var(--accent-color, #3b82f6); + color: #fff; +} + +.docmd-cookie-banner__btn--accept:hover { + filter: brightness(0.95); +} + +.docmd-cookie-banner__btn--decline:hover { + background-color: rgba(0, 0, 0, 0.04); +} + +.docmd-cookie-banner__close { + appearance: none; + background-color: transparent; + border: none; + padding: 0.25rem; + cursor: pointer; + display: inline-flex; + align-items: center; + justify-content: center; + opacity: 0.5; + color: inherit; + border-radius: 4px; + transition: opacity 0.15s ease, background-color 0.15s ease; +} + +.docmd-cookie-banner__close:hover { + opacity: 1; + background-color: rgba(0, 0, 0, 0.05); +} + +.docmd-cookie-banner__close svg { + width: 1em; + height: 1em; +} + +.docmd-cookie-banner[hidden] { + display: none; +} + +@keyframes docmd-cookie-banner-in { + from { opacity: 0; transform: translate(-50%, 1rem); } + to { opacity: 1; transform: translate(-50%, 0); } +} + +.docmd-cookie-banner--bottom-left, +.docmd-cookie-banner--bottom-right { + animation-name: docmd-cookie-banner-in-corner; +} + +@keyframes docmd-cookie-banner-in-corner { + from { opacity: 0; transform: translateY(1rem); } + to { opacity: 1; transform: translateY(0); } +} + +.sidebar nav li a:hover { + background-color: var(--sidebar-link-active-bg); +} + +.callout code { + background-color: color-mix(in srgb, var(--callout-color, var(--code-bg)) 25%, transparent); +} + +.collapsible-summary .collapsible-arrow { + height: 1.25em; +} + +.changelog-body .heading-anchor { + display: none; +} \ No newline at end of file diff --git a/packages/ui/assets/favicon.ico b/packages/ui/assets/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..268a15c0f7e9ff23d5f202c2bcc0a741c1be2fdd GIT binary patch literal 15406 zcmeHOd2C!q8DG~)p$Mu}NdyQC0h%_V905cX6(L$AibP7L-1Av)_F49W&qDvyn(vBs;QXNd(^&k$V?KA~!}NkrgWvzgJxoiR=Px^=c#kx=7^I z@;t+1^YV2vKre7Bq@fpBWl$!0 zdQTUNsp0b)b}dQTfgJiPZJrwG5>5MW7lUUHi&)b!6Q{?tE|I9}%2W_*JSr--epp=m z&qJcW_JHWG*(aLz-65tgb(=hvgsNwg6l*#z%hHaE?>;KA!5AiBoy*u`qt{I=4|@=5WVkYL*3@I@)amwEY$U-w16ib)k4s*Pk_>B^)-<2bVd zcr%dWQzigDEC${L+yLATEH;p7(wMh66S}N2AoE6G2`~oq1M-vrIUJ`2kg*bY6qqWo z?8;P(K)Llm*&$L@Zj_^p^+9a_Zx*o7D4WR-WoG%=F;BXcABA4}!NfY35FZ~D!{^>K zer5EdZ3}2%teNdS+;&2g{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7gLD?lJrCPjvpxT zDP%{{e$XE!U&Ic4ySWmRQ2dA_(aA8o7?}|5qvKq-zmcBZi*jy~gr(zIvmI8Pk*5i` z2-BSS+oMGstG^?>7x{m_{f|)>O*E@_x2-JQYvIAZ&RB|;@U2cG997BlRw3?2!(EJA_I*ZXTEf?xZG)A5U+ABwuiIiOpIEw&9NP&Q z*3$Z^tEJ_tw))S=sGFI_cDjyYQq{Bv7I(>ldBD`5}F>cdL>!gUl*lakNfteu#-N zKe%0VUftB)MMPaaS+G`~t>w0EI>6Foq2%NX+f`;w+lQ(%MC(TXq`}$OgjA+{Dzo3q zto%v4B{FciFPU$U1#oa)#&=R%e{*JqGp4d*s$!ps8V+t`OpV1(<;N;OLPY$kH_ER> zPWAj}CG|_hPfAG2{a;(lN2tg`RZ7)+_n8kXuW*4sx0j-$YnYI`*0+6|$IZS;NsavL zbh+`X=cWvw#Q7?VirE`Ot9iI`;@!1x4BaZP?b1GL$47g>w~GH?e{4K=1S?t|k`!d3 R^>_Oi+%VG1yJqw3{{WOD5|RJ_ literal 0 HcmV?d00001 diff --git a/packages/ui/assets/js/docmd-api.js b/packages/ui/assets/js/docmd-api.js new file mode 100644 index 0000000..5eb0d67 --- /dev/null +++ b/packages/ui/assets/js/docmd-api.js @@ -0,0 +1,188 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/core (and ecosystem) + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025 docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + */ + +/** + * Browser API for docmd plugin communication. + * + * Provides docmd.call(), docmd.send(), docmd.on(), docmd.afterReload(), + * and docmd.scheduleReload() over a WebSocket connection. + * Injected automatically by the dev server. + */ + +/* global WebSocket, sessionStorage, queueMicrotask */ + +(function() { + if (typeof window === 'undefined') return; + if (window.docmd && window.docmd.call) return; // already initialized + + const docmd = window.docmd || {}; + window.docmd = docmd; + + // Restore scroll position after reload + const savedScroll = sessionStorage.getItem('docmd:scrollY'); + if (savedScroll) { + sessionStorage.removeItem('docmd:scrollY'); + requestAnimationFrame(() => { + window.scrollTo(0, parseInt(savedScroll, 10)); + }); + } + + let socket = null; + let messageId = 0; + const pendingCalls = new Map(); // id โ†’ { resolve, reject } + const eventListeners = new Map(); // name โ†’ Set + + // retryCount lives outside connect() so it persists across reconnect calls. + // This ensures maxRetries is actually enforced โ€” previously it reset to 0 + // on every invocation, causing infinite reconnection loops on static servers. + let retryCount = 0; + const maxRetries = 5; + + function connect() { + if (socket && (socket.readyState === 0 || socket.readyState === 1)) return; + if (retryCount >= maxRetries) return; // give up โ€” not a dev server + + socket = new WebSocket('ws://' + window.location.host); + + socket.onopen = () => { + console.log('โšก docmd connected'); + retryCount = 0; // reset on successful connection + }; + + socket.onmessage = (e) => { + if (e.data === 'reload') { + sessionStorage.setItem('docmd:scrollY', String(window.scrollY)); + window.location.reload(); + return; + } + let msg; + try { msg = JSON.parse(e.data); } catch { return; } + + if (msg.type === 'response' && msg.id) { + const pending = pendingCalls.get(msg.id); + if (pending) { + pendingCalls.delete(msg.id); + if (msg.error) { + pending.reject(new Error(msg.error)); + } else { + pending.resolve({ result: msg.result, reload: msg.reload }); + } + } + } else if (msg.type === 'event' && msg.name) { + const listeners = eventListeners.get(msg.name); + if (listeners) { + listeners.forEach(cb => { try { cb(msg.data); } catch (e) { console.error(e); } }); + } + } + }; + + // Suppress the browser's default connection-refused error in the console. + socket.onerror = () => { /* handled via onclose */ }; + + socket.onclose = () => { + retryCount++; + if (retryCount < maxRetries) { + setTimeout(connect, Math.min(1000 * (1.5 ** retryCount), 5000)); + } + // No log on final failure โ€” this is expected when serving a static build. + }; + } + + function waitForConnection() { + if (socket && socket.readyState === 1) return Promise.resolve(); + return new Promise((resolve, reject) => { + const timeout = setTimeout(() => reject(new Error('docmd: WebSocket connection timeout')), 5000); + function check() { + if (socket && socket.readyState === 1) { + clearTimeout(timeout); + resolve(); + } else { + setTimeout(check, 50); + } + } + check(); + }); + } + + /** + * Call a server-side action and return the result. + * If the action modifies files, the page reloads automatically after + * the promise resolves and the current microtask completes. + */ + docmd.call = async function(action, payload) { + await waitForConnection(); + return new Promise((resolve, reject) => { + const id = String(++messageId); + pendingCalls.set(id, { + resolve: ({ result, reload }) => { + resolve(result); + if (reload) { + sessionStorage.setItem('docmd:scrollY', String(window.scrollY)); + queueMicrotask(() => window.location.reload()); + } + }, + reject + }); + socket.send(JSON.stringify({ id, type: 'call', action, payload })); + }); + }; + + /** + * Send a fire-and-forget event to the server. + */ + docmd.send = async function(name, data) { + await waitForConnection(); + socket.send(JSON.stringify({ type: 'event', name, data })); + }; + + /** + * Subscribe to server-pushed events. Returns an unsubscribe function. + */ + docmd.on = function(name, callback) { + if (!eventListeners.has(name)) eventListeners.set(name, new Set()); + eventListeners.get(name).add(callback); + return () => eventListeners.get(name).delete(callback); + }; + + /** + * Declare a named reload handler. Runs on every page load. + * If sessionStorage has stashed context for this name, calls the + * callback immediately with that context and clears the stash. + */ + docmd.afterReload = function(name, callback) { + const key = 'docmd:reload:' + name; + const raw = sessionStorage.getItem(key); + if (raw) { + sessionStorage.removeItem(key); + try { + const context = JSON.parse(raw); + callback(context); + } catch (e) { + console.error('docmd.afterReload[' + name + '] error:', e); + } + } + }; + + /** + * Stash context for a named reload handler. The matching afterReload + * handler will fire with this context after the next page reload. + */ + docmd.scheduleReload = function(name, context) { + const key = 'docmd:reload:' + name; + sessionStorage.setItem(key, JSON.stringify(context || {})); + }; + + // Connect + setTimeout(connect, 100); +})(); \ No newline at end of file diff --git a/packages/ui/assets/js/docmd-i18n-strings.js b/packages/ui/assets/js/docmd-i18n-strings.js new file mode 100644 index 0000000..c09b071 --- /dev/null +++ b/packages/ui/assets/js/docmd-i18n-strings.js @@ -0,0 +1,232 @@ +/* global XMLHttpRequest */ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * Client-side string replacement for noStyle pages. + * Loads JSON translation files from assets/i18n/ and replaces + * text content of elements with data-i18n attributes. + * + * @package @docmd/ui + * @website https://docmd.io + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + */ + +(function () { + 'use strict'; + + var config = window.DOCMD_I18N || {}; + var locales = config.locales || []; + var defaultLocale = config.default || ''; + var root = window.DOCMD_ROOT || './'; + + if (!locales.length) return; + + /** + * Detect active locale from URL path prefix. + * Default locale has no prefix (renders at /). + * Non-default locales render at /{id}/. + */ + function detectLocale() { + var saved = localStorage.getItem('docmd-locale'); + var pathSegments = window.location.pathname.split('/').filter(Boolean); + var firstSegment = pathSegments[0] || ''; + + // Check if first path segment matches a non-default locale + var localeIds = locales.map(function (l) { return l.id; }); + if (localeIds.indexOf(firstSegment) !== -1 && firstSegment !== defaultLocale) { + return firstSegment; + } + + // If saved preference matches a configured locale, use it (for default-locale pages) + if (saved && localeIds.indexOf(saved) !== -1) { + return saved; + } + + return defaultLocale; + } + + /** + * Load a JSON translation file from assets/i18n/{locale}.json + */ + function loadStrings(localeId, callback) { + var url = root + 'assets/i18n/' + localeId + '.json'; + var xhr = new XMLHttpRequest(); + xhr.open('GET', url, true); + xhr.onreadystatechange = function () { + if (xhr.readyState === 4) { + if (xhr.status === 200) { + try { + callback(null, JSON.parse(xhr.responseText)); + } catch (e) { + callback(e, null); + } + } else { + callback(new Error('Failed to load ' + url), null); + } + } + }; + xhr.send(); + } + + /** + * Apply translations to the DOM. + * + * Supported attributes: + * data-i18n="key" โ†’ replaces textContent + * data-i18n-html="key" โ†’ replaces innerHTML + * data-i18n-[attr]="key" โ†’ replaces a specific attribute + * e.g. data-i18n-placeholder="searchPlaceholder" + * e.g. data-i18n-aria-label="navLabel" + * e.g. data-i18n-title="tooltipText" + */ + function applyStrings(strings) { + if (!strings) return; + + // data-i18n โ†’ textContent + var els = document.querySelectorAll('[data-i18n]'); + for (var i = 0; i < els.length; i++) { + var key = els[i].getAttribute('data-i18n'); + if (key && strings[key] !== undefined) { + els[i].textContent = strings[key]; + } + } + + // data-i18n-html โ†’ innerHTML (use cautiously with sanitization) + var htmlEls = document.querySelectorAll('[data-i18n-html]'); + for (var j = 0; j < htmlEls.length; j++) { + var htmlKey = htmlEls[j].getAttribute('data-i18n-html'); + if (htmlKey && strings[htmlKey] !== undefined) { + var rawHtml = strings[htmlKey]; + // Basic sanitization: strip script and event handlers + var sanitized = rawHtml + .replace(/]*>([\s\S]*?)<\/script>/gim, "") + .replace(/on\w+="[^"]*"/gim, "") + .replace(/on\w+='[^']*'/gim, ""); + htmlEls[j].innerHTML = sanitized; + } + } + + // data-i18n-* โ†’ attribute replacement + // Scan all elements for data-i18n-{attrName} patterns + var allI18nEls = document.querySelectorAll('*'); + for (var k = 0; k < allI18nEls.length; k++) { + var el = allI18nEls[k]; + var attrs = el.attributes; + for (var a = 0; a < attrs.length; a++) { + var attrName = attrs[a].name; + if (attrName.indexOf('data-i18n-') === 0 && attrName !== 'data-i18n-html') { + var targetAttr = attrName.substring('data-i18n-'.length); + var attrKey = attrs[a].value; + if (attrKey && strings[attrKey] !== undefined) { + el.setAttribute(targetAttr, strings[attrKey]); + } + } + } + } + + // Update html lang attribute + document.documentElement.setAttribute('lang', activeLocale); + + // Dispatch event for custom handlers + document.dispatchEvent(new CustomEvent('docmd:i18n-applied', { + detail: { locale: activeLocale, strings: strings } + })); + } + + /** + * Switch locale - updates localStorage, reloads strings. + * For multi-page i18n sites, redirects to the locale-prefixed URL. + * For single-page noStyle sites, swaps strings in place. + * + * Set window.DOCMD_I18N.inPlace = true to force in-place mode + * (no URL redirect, just reload strings on the same page). + */ + function switchLocale(newLocaleId) { + if (newLocaleId === activeLocale) return; + localStorage.setItem('docmd-locale', newLocaleId); + + var inPlace = config.inPlace || false; + + if (inPlace) { + // In-place mode: just reload strings without navigating + activeLocale = newLocaleId; + window.DOCMD_I18N_STRINGS.locale = newLocaleId; + loadStrings(newLocaleId, function (err, strings) { + if (!err && strings) applyStrings(strings); + }); + return; + } + + var currentPath = window.location.pathname; + var localeIds = locales.map(function (l) { return l.id; }); + + // Strip current locale prefix if present + var pathSegments = currentPath.split('/').filter(Boolean); + var basePath = currentPath; + if (pathSegments.length > 0 && localeIds.indexOf(pathSegments[0]) !== -1 && pathSegments[0] !== defaultLocale) { + basePath = '/' + pathSegments.slice(1).join('/'); + } + + // Add new locale prefix (skip for default locale) + var newPath; + if (newLocaleId === defaultLocale) { + newPath = basePath || '/'; + } else { + newPath = '/' + newLocaleId + (basePath === '/' ? '/' : basePath); + } + + if (newPath !== currentPath) { + window.location.href = newPath; + } else { + // Same page, just reload strings + activeLocale = newLocaleId; + window.DOCMD_I18N_STRINGS.locale = newLocaleId; + loadStrings(newLocaleId, function (err, strings) { + if (!err && strings) applyStrings(strings); + }); + } + } + + // Expose API + var activeLocale = detectLocale(); + + window.DOCMD_I18N_STRINGS = { + locale: activeLocale, + locales: locales, + defaultLocale: defaultLocale, + switchLocale: switchLocale, + applyStrings: applyStrings + }; + + function hasI18nElements() { + if (document.querySelector('[data-i18n], [data-i18n-html]')) return true; + var allEls = document.querySelectorAll('*'); + for (var i = 0; i < allEls.length; i++) { + var attrs = allEls[i].attributes; + for (var j = 0; j < attrs.length; j++) { + if (attrs[j].name.indexOf('data-i18n-') === 0) return true; + } + } + return false; + } + + function init() { + if (hasI18nElements()) { + loadStrings(activeLocale, function (err, strings) { + if (!err && strings) applyStrings(strings); + }); + } + } + + // Auto-apply on DOM ready + if (document.readyState === 'loading') { + document.addEventListener('DOMContentLoaded', init); + } else { + init(); + } +})(); \ No newline at end of file diff --git a/packages/ui/assets/js/docmd-image-lightbox.js b/packages/ui/assets/js/docmd-image-lightbox.js new file mode 100644 index 0000000..7ebca31 --- /dev/null +++ b/packages/ui/assets/js/docmd-image-lightbox.js @@ -0,0 +1,95 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/core (and ecosystem) + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + */ + +/* + * A simple lightbox implementation for gallery images + */ + +document.addEventListener('DOMContentLoaded', function () { + // Create lightbox elements + const lightbox = document.createElement('div'); + lightbox.className = 'docmd-lightbox'; + const content = document.createElement('div'); + content.className = 'docmd-lightbox-content'; + const img = document.createElement('img'); + img.src = ''; + img.alt = ''; + const caption = document.createElement('div'); + caption.className = 'docmd-lightbox-caption'; + content.appendChild(img); + content.appendChild(caption); + + const close = document.createElement('div'); + close.className = 'docmd-lightbox-close'; + close.innerHTML = '×'; // Hardcoded entity is safe + + lightbox.appendChild(content); + lightbox.appendChild(close); + document.body.appendChild(lightbox); + + const lightboxImg = lightbox.querySelector('img'); + const lightboxCaption = lightbox.querySelector('.docmd-lightbox-caption'); + const lightboxClose = lightbox.querySelector('.docmd-lightbox-close'); + + // Find all images with lightbox class or in image galleries + const lightboxImages = document.querySelectorAll('img.lightbox, .image-gallery img'); + + // Add click event to each image + lightboxImages.forEach(function (img) { + img.style.cursor = 'zoom-in'; + + img.addEventListener('click', function () { + // Get the image source and caption + const src = this.getAttribute('src'); + let caption = this.getAttribute('alt') || ''; + + // If image is inside a figure with figcaption, use that caption + const figure = this.closest('figure'); + if (figure) { + const figcaption = figure.querySelector('figcaption'); + if (figcaption) { + caption = figcaption.textContent; + } + } + + // Set the lightbox content + lightboxImg.setAttribute('src', src); + lightboxCaption.textContent = caption; + + // Show the lightbox + lightbox.style.display = 'flex'; + document.body.style.overflow = 'hidden'; // Prevent scrolling + }); + }); + + // Close lightbox when clicking the close button or outside the image + lightboxClose.addEventListener('click', closeLightbox); + lightbox.addEventListener('click', function (e) { + if (e.target === lightbox) { + closeLightbox(); + } + }); + + // Close lightbox when pressing Escape key + document.addEventListener('keydown', function (e) { + if (e.key === 'Escape' && lightbox.style.display === 'flex') { + closeLightbox(); + } + }); + + function closeLightbox() { + lightbox.style.display = 'none'; + document.body.style.overflow = ''; // Restore scrolling + } +}); \ No newline at end of file diff --git a/packages/ui/assets/js/docmd-main.js b/packages/ui/assets/js/docmd-main.js new file mode 100644 index 0000000..aa47b02 --- /dev/null +++ b/packages/ui/assets/js/docmd-main.js @@ -0,0 +1,1027 @@ +/** + * -------------------------------------------------------------------- + * docmd : the zero-config documentation engine. + * + * @package @docmd/core (and ecosystem) + * @website https://docmd.io + * @repository https://github.com/docmd-io/docmd + * @license MIT + * @copyright Copyright (c) 2025-present docmd.io + * + * [docmd-source] - Please do not remove this header. + * -------------------------------------------------------------------- + */ + +/** + * -------------------------------------------------------------------- + * docmd : Client-Side Application Logic (SPA Router & UI) + * -------------------------------------------------------------------- + */ + +/* global CSS */ + +(function () { + + // Idempotency guard. Some servers (e.g. `serve` with SPA fallback) can + // request this same script twice โ€” once at the page-relative URL, once + // at the site root โ€” and both copies execute. Without this guard, every + // click handler (toggle, SPA nav, copy code, etc.) would bind twice and + // every nav action would fire two times, silently breaking the sidebar. + if (window.__docmdMainLoaded) return; + window.__docmdMainLoaded = true; + + function findTargetElement(hash) { + if (!hash) return null; + const cleanHash = hash.substring(1); + if (!cleanHash) return null; + try { + let target = document.getElementById(cleanHash) || document.querySelector(hash); + if (target) return target; + target = document.querySelector('[id$="-' + CSS.escape(cleanHash) + '"]'); + if (target) return target; + } catch (_e) { /* ignore */ } + return null; + } + + // 1. EVENT DELEGATION + document.addEventListener('click', (e) => { + // Collapsible Navigation + // - Chevron (.collapse-icon-wrapper) click: always toggle, preventDefault. + // - Dummy section divider: toggle, preventDefault. + // - Real label click: navigate via SPA. The new + // page's sidebar auto-expands the active group, so parents that are + // pages themselves (e.g. "Syntax" with children) open as pages, + // not as collapsed sections. + const navTrigger = e.target.closest('.nav-group, .collapse-icon-wrapper'); + if (navTrigger) { + const item = navTrigger.closest('li.collapsible'); + const isChevron = navTrigger.classList.contains('collapse-icon-wrapper'); + const isDummySpan = navTrigger.tagName !== 'A'; + + // Offline-mode safety (issue #164): under file:// the SPA click handler + // is not registered (initializeSPA short-circuits at line 581), so this + // is the only click handler that runs. closest('.nav-group') can walk + // past an empty-class nested and match the parent