Before you begin, ensure you have:
git clone https://github.com/YOUR_USERNAME/obsidian-github-projects.git
cd obsidian-github-projects
git remote add upstream https://github.com/alexnodeland/obsidian-github-projects.git
# Install dependencies and set up development environment
make setup VAULT=/path/to/your/vaultStart development with auto-rebuild
make dev VAULT=/path/to/your/vault
npm install
npm run build
./scripts/setup-dev.sh /path/to/your/vault
Or manually copy files:
mkdir -p /path/to/vault/.obsidian/plugins/github-projects
cp main.js manifest.json styles.css /path/to/vault/.obsidian/plugins/github-projects/
Use the watch mode for continuous development:
# Using Make (recommended)
make dev VAULT=/path/to/your/vaultOr using the script directly
./scripts/dev-watch.sh /path/to/your/vault
This will:
After each rebuild:
Ctrl/Cmd+R in Obsidian to reload the plugingit checkout -b feature/your-feature-name
# Run tests
npm testRun tests in watch mode
npm run test:watchRun linter
npm run lintType check
npm run build
git add .
git commit -m "feat: add awesome new feature"
Follow Conventional Commits format:
feat: - New featuresfix: - Bug fixesdocs: - Documentation changesrefactor: - Code refactoringtest: - Test changeschore: - Build/tooling changesgit push origin feature/your-feature-name
Then create a Pull Request on GitHub.
obsidian-github-projects/
├── .github/
│ └── workflows/ # GitHub Actions CI/CD
├── docs/ # Documentation
├── src/
│ ├── api/ # GitHub API client
│ │ ├── client.ts # GraphQL client
│ │ └── queries.ts # GraphQL queries
│ ├── state/ # State management
│ │ ├── ProjectState.ts # Project state
│ │ └── types.ts # Type definitions
│ ├── utils/ # Utility functions
│ │ ├── github.ts # GitHub helpers
│ │ └── storage.ts # Storage helpers
│ ├── views/ # UI components
│ │ ├── components/ # Reusable components
│ │ │ ├── Card.tsx
│ │ │ ├── Column.tsx
│ │ │ └── DetailModal.tsx
│ │ └── ProjectBoardView.tsx
│ ├── __tests__/ # Unit tests
│ ├── __mocks__/ # Test mocks
│ ├── main.tsx # Plugin entry point
│ └── settings.ts # Settings tab
├── styles.css # Plugin styles
├── manifest.json # Plugin manifest
├── package.json # Dependencies
├── tsconfig.json # TypeScript config
├── jest.config.js # Jest config
├── esbuild.config.mjs # Build config
└── Makefile # Development tasks
src/main.tsx: Plugin entry point, registers views and commandssrc/settings.ts: Settings tab implementationsrc/api/client.ts: GitHub GraphQL API clientsrc/state/ProjectState.ts: Centralized state managementsrc/views/ProjectBoardView.tsx: Main board viewany types - use unknown and type guardsWe use ESLint for code quality. Run before committing:
npm run lint
Key rules:
Preact Components:
Example:
interface CardProps {
item: ProjectItem;
onMove: (itemId: string, statusId: string) => void;
}export function Card({ item, onMove }: CardProps) {
// Component implementation
}
Events for event-driven stateProjectState class for centralized state# Run all tests
npm testRun tests in watch mode
npm run test:watchRun tests with coverage
npm test -- --coverageRun specific test file
npm test -- Card.test.tsx
Place tests in src/__tests__/ directory:
import { render, screen } from '@testing-library/preact';
import { Card } from '../views/components/Card';describe('Card', () => {
it('renders card title', () => {
const item = { id: '1', title: 'Test Issue', content: '' };
render( );
expect(screen.getByText('Test Issue')).toBeInTheDocument();
});
});
Current coverage baseline: ~12% (statements, branches, functions, lines)
Target: Gradually increase to >80% coverage
Check coverage:
npm test -- --coverage
Coverage reports are generated in coverage/ directory.
Note: Coverage thresholds are currently set to 10% to match the existing codebase. As you add features, please include tests to incrementally improve coverage.
npm run dev
This creates an unminified build with source maps for debugging.
npm run build
This creates an optimized, minified build without source maps.
The build process generates:
main.js - Bundled plugin codemain.js.map - Source map (dev build only) npm test
npm run lint
npm run build
When reviewing PRs:
We follow Semantic Versioning:
package.json and manifest.json:npm version patch # or minor, or major
git add .
git commit -m "chore: bump version to X.Y.Z"
git tag X.Y.Z
git push origin main --tags
make setup VAULT=/path # Initial setup
make dev VAULT=/path # Development mode
make build # Production build
make test # Run tests
make lint # Run linter
make clean # Clean build artifacts
make coverage # Generate coverage report
Browser DevTools:
Ctrl/Cmd+Shift+ISource Maps: Development builds include source maps for debugging TypeScript in DevTools.
By contributing, you agree that your contributions will be licensed under the MIT License.