This document provides the necessary instructions for setting up, developing, and publishing the Bearded Theme extension for VS Code and Zed.
The project is structured to share a common codebase between VS Code and Zed theme generation:
bearded-theme/
├── src/
│ ├── shared/ # Shared code between generators
│ │ └── theme-registry.ts # Central registry of all theme variants
│ ├── generators/
│ │ ├── vscode/ # VS Code theme generator
│ │ │ └── index.ts
│ │ └── zed/ # Zed theme generator
│ │ └── index.ts
│ ├── variations/ # Theme color definitions (shared)
│ ├── scopes/ # Syntax highlighting scopes (VS Code)
│ ├── typing.ts # TypeScript type definitions
│ ├── ui.ts # VS Code UI color mappings
│ ├── helper.ts # Color utility functions
│ └── build.ts # Build orchestrator
├── dist/
│ ├── vscode/ # Generated VS Code themes
│ │ └── themes/
│ └── zed/ # Generated Zed themes
│ ├── themes/
│ └── extension.toml
├── releases/ # VSIX packages and release notes
└── assets/ # Icons and images
# Install dependencies
npm installnpm run buildThis builds themes for both VS Code and Zed.
# Build only VS Code themes
npm run build:vscode
# Build only Zed themes
npm run build:zed# Watch VS Code themes only
npm run dev:vscode
# Watch Zed themes only
npm run dev:zed| Platform | Output Directory | Format |
|---|---|---|
| VS Code | dist/vscode/themes/ |
Individual JSON files per theme |
| Zed | dist/zed/themes/ |
Single bearded-theme.json with all themes |
- Create the color palette in
src/variations/:
// src/variations/my-theme.ts
import { makeMainColorsDark } from "../helper";
import { Theme, ThemeColors, ThemeLevels } from "../typing";
const myColors: ThemeColors = {
blue: "#69C3FF",
green: "#3CEC85",
// ... other colors
};
const myLevels: ThemeLevels = {
danger: myColors.red,
info: myColors.blue,
success: myColors.green,
warning: myColors.orange,
};
export const myTheme: Theme = {
colors: myColors,
levels: myLevels,
ui: makeMainColorsDark({ base: "#1c2433", primary: "#8196b5" }),
};- Register the theme in
src/shared/theme-registry.ts:
import { myTheme } from "../variations/my-theme";
export const themeRegistry: ThemeRegistryEntry[] = [
// ... existing themes
{ name: "My Theme", slug: "my-theme", theme: myTheme, options: {} },
];- Rebuild:
npm run buildThe theme will automatically be generated for both VS Code and Zed.
When registering a theme, you can specify options:
interface ThemeOptions {
light?: boolean; // Light theme (default: false = dark)
hc?: boolean; // High contrast theme
desaturateInputs?: boolean; // Desaturate input backgrounds
untindedSelection?: boolean; // Use untinted selection color
}Example:
{ name: "My Light Theme", slug: "my-light", theme: myLightTheme, options: { light: true } },
{ name: "My HC Theme", slug: "my-hc", theme: myHcTheme, options: { hc: true } },# Build themes and create VSIX package
npm run build:extThe VSIX file will be generated in ./releases/{version}.vsix.
# Build Zed themes
npm run build:ext:zedThe Zed extension files are in dist/zed/:
extension.toml- Extension manifestthemes/bearded-theme.json- Theme family file
- Update the version in
package.json - Create release notes:
npm run create:release-notesThis creates ./releases/{version}.md which should be edited with relevant information.
# Publish to VS Code Marketplace
npm run publish:vscode
# Publish to Open VSX
npm run publish:ovsx
# Publish to both + GitHub
npm run publish:allOr use the interactive script:
# On Linux/Mac
./publish.sh
# On Windows
publish.batTo publish to Zed's extension registry:
- Build the Zed themes:
npm run build:zed - Copy the contents of
dist/zed/to your extension repository - Follow Zed's extension publishing guidelines
| Platform | Token Type | Environment Variable |
|---|---|---|
| VS Code Marketplace | Personal Access Token | VSCE_PAT |
| Open VSX | Access Token | OVSX_TOKEN |
If tokens are not set as environment variables, the publish scripts will prompt you to enter them.
- Theme not appearing: Make sure it's registered in
theme-registry.ts - Color errors: Verify all required colors are defined in your theme variant
- Type errors: Run
npx tsc --noEmitto check for TypeScript issues
- Verify tokens are valid and have correct permissions
- Ensure the version in
package.jsonis unique - Check that release notes exist for the current version