🔧 Development Setup - devonthesofa/obsidian-note-status GitHub Wiki
Development Setup
Get the plugin running locally for development.
Prerequisites
- Node.js 16+
- npm or yarn
- Git
- Obsidian installed
Quick Start
# Clone and setup
git clone https://github.com/devonthesofa/obsidian-note-status.git
cd obsidian-note-status
npm install
# Development mode (hot reload)
npm run dev
# Build for production
npm run build
Development Workflow
1. Link to Test Vault
# Symlink to your test vault
ln -s /path/to/obsidian-note-status /path/to/vault/.obsidian/plugins/note-status
# Windows
mklink /D "C:\Vault\.obsidian\plugins\note-status" "C:\Dev\obsidian-note-status"
2. Enable Plugin
- Open Obsidian
- Settings → Community plugins → Disable Safe Mode
- Enable "Note Status"
3. Hot Reload
Development mode watches for changes:
- TypeScript changes → Auto rebuild
- CSS changes → Instant update
- Full reload: Ctrl+R in Obsidian
Common Development Tasks
Add New Status Template
// constants/status-templates.ts
export const PREDEFINED_TEMPLATES: StatusTemplate[] = [
{
id: "new-workflow",
name: "New Workflow",
description: "Description",
statuses: [{ name: "status1", icon: "🔥", color: "#FF0000" }],
},
];
Add New Command
// integrations/commands/command-integration.ts
this.plugin.addCommand({
id: "new-command",
name: "New Command",
callback: () => {
// Implementation
},
});
Add New Setting
// 1. Update interface in models/types.ts
export interface NoteStatusSettings {
newSetting: boolean;
}
// 2. Add default in constants/defaults.ts
export const DEFAULT_SETTINGS: NoteStatusSettings = {
newSetting: false,
};
// 3. Add UI in integrations/settings/settings-ui.ts
new Setting(containerEl)
.setName("New Setting")
.addToggle((toggle) =>
toggle
.setValue(settings.newSetting)
.onChange((value) =>
this.callbacks.onSettingChange("newSetting", value),
),
);
Build & Release
Production Build
npm run build
# Creates: main.js, manifest.json, styles.css
Version Bump
npm version patch # or minor/major
# Updates: package.json, manifest.json, versions.json
Release Process
- Create git tag:
git tag 1.0.13
- Push tag:
git push origin 1.0.13
- GitHub Actions creates draft release
- Edit release notes and publish
Obsidian DevTools
- Ctrl+Shift+I → Console
- Check for plugin errors
- Monitor performance tab
Code Style
- TypeScript strict mode
- Use
const
by default - Explicit return types
- Handle null/undefined
- Clean up in unload()
Contributing
- Fork repository
- Create feature branch
- Follow existing patterns
- Test with large vault
- Submit PR with description