2 KiB
Development
Quick start
npm cinpm run dev
Symlink to Sandbox
Create a symlink from the dist folder to the Sandbox vault:
cd /Users/philipp/Obsidian/Sandbox/.obsidian/plugins
ln -s /Users/philipp/Coding/Obsidian/journal-reflection/dist ./journal-reflection
NPM Scripts
npm run dev
Starts a development server and watches for changes.
Output of the dev plugin is in dist/ folder.
Testing the changes
- Open the Sandbox vault in Obsidian (make sure the symlink is set up - see above)
- After every change, disable and re-enable the plugin in Obsidian settings to apply changes
npm run version
Important: Before calling this script, update the version attribute in the package.json file.
Bumps the plugin version. Must run before an official plugin release can happen.
Expected updates:
manifest.jsonversions.json
npm run build
Packages the plugin for release.
Output of the full plugin is in dist/ folder.
npm test
Runs the test suite once using Jest.
All tests are located next to their corresponding source files with the .test.ts extension.
npm run test:watch
Runs the test suite in watch mode. Tests automatically re-run when files change.
Useful during development to get instant feedback on code changes.
npm run test:coverage
Runs the test suite and generates a coverage report.
Testing
The plugin uses Jest for unit testing. Tests are colocated with source files.
Running Tests During Development
- One-time run:
npm test- Quick check before commits - Watch mode:
npm run test:watch- Continuous testing during development - Coverage check:
npm run test:coverage- Verify test coverage
Create a New Release
- Commit all changes
- Bump version in
package.json - Run
npm run version - Run
npm run build - Add a version tag in git (
git tag vX.Y.Z) - Push to GitHub (
git push --tags)
The GitHub workflow will automatically create a new release in the git repo.