Skip to content

Configuration Reference

Every configuration file in the Communitas repository, what it controls, and notable choices.

FilePurpose
package.jsonProject metadata, scripts, dependencies, engine constraints
astro.config.mtsAstro, Starlight, Vite, and Tailwind configuration
tsconfig.jsonTypeScript compiler options
eslint.config.mjsESLint flat config
.prettierrcPrettier formatting rules
.nvmrcPinned Node.js version
.editorconfigEditor-level formatting defaults
.gitignoreGit exclusions
.github/workflows/deploy.ymlCI/CD pipeline for GitHub Pages
src/content.config.tsAstro content collection definition
src/env.d.tsTypeScript environment type references
src/styles/global.cssBrand color tokens for Starlight pages
ScriptCommandNotes
devastro devStarts dev server at localhost:4321
buildastro buildStatic build to dist/
previewastro previewServes built site locally
linteslint .Runs ESLint on all supported files
formatprettier --write .Formats all files in place
typechecktsc --noEmitType-checks without emitting
testvitestRuns Vitest (no tests exist yet)
"engines": { "node": ">=22.21.0" }

Matches the exact version pinned in .nvmrc. Requires Node 22 LTS.

"overrides": {
"@tailwindcss/vite": { "vite": "$vite" }
}

Forces @tailwindcss/vite to use the project’s top-level vite dependency instead of pulling its own copy. Prevents duplicate-Vite bugs where two Vite instances conflict during the build.

Runtime:

PackagePurpose
astroCore framework (static site generator)
@astrojs/starlightDocumentation site plugin for Astro
@astrojs/starlight-tailwindBridges Starlight design tokens to Tailwind
starlight-theme-blackDark-first theme with shadcn/ui aesthetic
tailwindcssUtility-first CSS framework (v4)
@tailwindcss/viteTailwind v4 Vite plugin
@fontsource/geist-sansSelf-hosted Geist Sans font
@fontsource/geist-monoSelf-hosted Geist Mono font
threeThree.js for landing page network visualization

Development:

PackagePurpose
typescriptTypeScript compiler
@types/nodeNode.js type definitions
@types/threeThree.js type definitions
eslintLinter
@eslint/jsESLint base JS config
typescript-eslintTypeScript ESLint integration (flat config)
prettierCode formatter
viteBuild tool (explicit dep for override)
vitestTest runner
site: 'https://communitas.xyz';

Used for sitemap generation, canonical URLs, and Open Graph metadata. Requires a DNS CNAME record pointing communitas.xyz to GitHub Pages.

vite: {
plugins: [tailwindcss()],
server: {
allowedHosts: ['server.tail14a7e5.ts.net'],
},
}
  • Tailwind plugin: Registers the Tailwind v4 Vite plugin globally. No tailwind.config.js needed — Tailwind v4 uses CSS-native configuration via @theme directives.
  • Allowed hosts: Permits the Tailscale hostname for remote development. Add your own hostname here if accessing the dev server over a non-localhost address.
starlight({
title: 'Communitas',
plugins: [
starlightThemeBlack({
navLinks: [{ label: 'Home', link: '/' }],
}),
],
customCss: ['./src/styles/global.css'],
sidebar: [
/* 8 auto-generated sections */
],
});
  • Theme: starlight-theme-black overrides 16 Starlight components with a shadcn/ui-inspired dark-first design. The navLinks option adds a “Home” link in the Starlight header that returns to the landing page.
  • Custom CSS: src/styles/global.css provides brand color tokens (indigo accent, zinc grays) that map to Tailwind and Starlight variables.
  • Sidebar: Eight sections, all using autogenerate from directory names under src/content/docs/. Pages are sorted by Starlight’s default order (overridable via frontmatter sidebar.order).
LabelDirectoryContent
Overviewoverview/Product introduction
Researchresearch/Research foundations
Getting Startedgetting-started/Pilot guide
Modelsmodels/Graph, metrics, interventions
Experimentsexperiments/Experiment registry
Agentsagents/Agent design principles
Governancegovernance/Safety and governance
Internalsinternals/Architecture, config, ADRs
{
"compilerOptions": {
"target": "ES2022",
"module": "ESNext",
"moduleResolution": "bundler",
"strict": true,
"jsx": "react-jsx",
"noEmit": true,
"types": ["vite/client", "node"]
},
"include": ["src", "astro.config.*"]
}
OptionValueRationale
targetES2022Matches Node 22 capabilities
moduleResolutionbundlerModern resolution for Vite/Astro projects
stricttrueFull strict mode per project style guide
noEmittrueType-checking only; Astro/Vite handle compilation
typesvite/client, nodeLoads Vite client types (import.meta.env) and Node types

The src/env.d.ts file adds Astro’s generated types via a triple-slash reference to .astro/types.d.ts.

Uses ESLint 9 flat config format. Combines @eslint/js recommended rules with typescript-eslint recommended rules.

RuleValueNotes
@typescript-eslint/no-unused-varswarnAllows _-prefixed args
quotessingleMatches Prettier config
semialwaysMatches Prettier config

.astro/, dist/, node_modules/, src/env.d.ts

ESLint does not lint .astro or .mdx files. No eslint-plugin-astro is installed.

{
"semi": true,
"singleQuote": true,
"trailingComma": "all",
"printWidth": 100,
"tabWidth": 2,
"useTabs": false
}

All values align with the project style guide in AGENTS.md. Prettier does not format .astro files (no prettier-plugin-astro installed).

22.21.0

Exact Node.js version. Read by nvm use, nvm install, and the CI workflow (node-version-file: .nvmrc).

  • 2-space indentation, spaces (not tabs)
  • LF line endings
  • UTF-8 charset
  • Trailing whitespace trimmed (except in .md and .mdx where trailing spaces are meaningful for Markdown line breaks)

Excludes: node_modules/, dist/, .astro/, .vercel/, .netlify/, .DS_Store, coverage/, *.log.

Does not exclude .env files. No environment variables are currently used, but .env* patterns should be added if secrets are introduced.

Triggers on push to main and manual dispatch. Two jobs:

  1. Build: Checks out code, installs Node (from .nvmrc), runs npm ci, runs npm run build, uploads dist/ as a Pages artifact.
  2. Deploy: Deploys the artifact to GitHub Pages using OIDC token authentication.

The pipeline does not run lint, typecheck, or test. These checks are developer-responsibility only.

Defines a single docs content collection using Starlight’s loader and schema:

export const collections = {
docs: defineCollection({ loader: docsLoader(), schema: docsSchema() }),
};

The loader reads .mdx files from src/content/docs/. The schema validates Starlight frontmatter fields (title, description, sidebar, template, etc.).

Loaded by Starlight via customCss. Provides:

  • Tailwind v4 imports: @astrojs/starlight-tailwind, tailwindcss/theme.css, tailwindcss/utilities.css
  • Accent palette: Full Tailwind indigo scale (50-950) mapped to --color-accent-*
  • Gray palette: Full Tailwind zinc scale (50-950) mapped to --color-gray-*

These tokens are consumed by both Starlight’s built-in styles and the starlight-theme-black theme. The landing page (src/pages/index.astro) defines its own matching tokens independently.

ChoiceValueWhy
Themestarlight-theme-blackDark-first aesthetic for a technical/research audience
AccentIndigoProfessional blue-purple tone; trust-oriented
GraysZincNeutral cool grays that pair with indigo
FontsGeist Sans + Geist MonoVercel’s open-source family; high readability for technical content
CSS frameworkTailwind v4Utility-first; CSS-native config via @theme directives
.nvmrc (22.21.0)
+---> package.json (engines.node >= 22.21.0)
+---> .github/workflows/deploy.yml (node-version-file)
package.json
+---> astro.config.mts (imports from deps)
| +---> src/styles/global.css (customCss)
| +---> src/content.config.ts (content collections)
| +---> public/favicon.svg (favicon)
+---> tsconfig.json (types from devDeps)
| +---> src/env.d.ts (.astro/types.d.ts)
+---> eslint.config.mjs (imports from devDeps)
+---> .prettierrc (used by prettier)