- MarkBind is a static site generator optimized for content-heavy instructional websites (e.g., courses, tutorials, documentation). It converts Markdown-like syntax into rich, interactive HTML websites.
- Business Domain: Documentation, Education, Static Site Generation (SSG).
- Languages:
- TypeScript (Backend/Core logic, CLI,
packages/core,packages/cli) - JavaScript (Legacy scripts, Webpack configs)
- Vue.js 3 (Frontend components,
packages/vue-components,packages/core-web)
- TypeScript (Backend/Core logic, CLI,
- Frameworks & Runtimes:
- Node.js (Runtime)
- Vue 3 (Frontend Framework)
- Jest (Testing)
- Key Libraries/Dependencies:
markdown-it(Markdown parsing)nunjucks(Templating)commander(CLI interface)webpack(Asset bundling)
- Package Manager(s):
npm(Workspaces enabled)lerna(Monorepo orchestration)
- Overall Architecture: Monorepo structure managed by Lerna. Separates concerns into:
- CLI (
packages/cli): Command-line interface and orchestration. - Core (
packages/core): Main logic for parsing and generating sites. - Core-Web (
packages/core-web): Client-side assets and build configuration. - Vue Components (
packages/vue-components): UI library for the generated sites.
- CLI (
- Directory Structure Philosophy:
packages/: Contains all monorepo packages.docs/: Documentation site content (dogfooding MarkBind).scripts/: Maintainance and utility scripts.
- Formatting:
- Indentation: 2 spaces.
- Style: Follows
airbnb-baseandairbnb-typescript. - Enforced via ESLint (
.eslintrc.js).
- Naming Conventions:
- Variables/Functions: camelCase (
processMarkdown). - Classes: PascalCase (
SiteDeployManager). - Files: kebab-case preferred for new files, though consistency with existing structure is paramount.
- Variables/Functions: camelCase (
- CLI Entry:
packages/cli/index.ts(TypeScript, ESM) - Core Entry:
packages/core/index.js(JavaScript, CommonJS) - Monorepo Config:
lerna.json - Lint Config:
.eslintrc.js
- Local Development Environment:
- Initial Setup: Run
npm run setupto install dependencies, clean artifacts, and bootstrap the monorepo. - Backend (Core): Run
npm run devin the root to watch/recompile TypeScript. Otherwise, runnpm run build:backendto compile TypeScript. - Frontend: Run
markbind serve -dto enable hot reloading of client assets. - Troubleshooting: Run
npm run cleanto remove compiled artifacts if you encounter "orphaned file" issues (e.g., after renaming.tsfiles). - Warning: Do NOT build full release bundles (
npm run build:web) manually unless releasing.
- Initial Setup: Run
- Testing:
- Run
npm testfor all tests. - Run
npm run updatetestto update test snapshots. - Localized Testing: Run tests in specific package directories (
packages/core, etc.) for efficiency.
- Run
- CI/CD Process: GitHub Actions (
.github/workflows) handle testing and linting on PRs.
- Contribution:
- Follow the "Do" and "Don't" lists in package-specific
AGENTS.mdfiles. - Ensure small diffs and meaningful commit messages.
- Follow the "Do" and "Don't" lists in package-specific
- Security:
- Do not hardcode secrets.
- Validate inputs in CLI and Core logic.
- Dependencies:
- Use
npmworkspaces. - Do not add heavy dependencies without strong justification.
- Use
See each package's AGENTS.md for specific guidelines: