mirror of
https://github.com/simontc/obsidian-note-autocreation.git
synced 2026-07-22 06:30:28 +00:00
2.2 KiB
2.2 KiB
Development
Preparing the dev environment
- Clone this repo
- Open the vault
tests/Note Auto Creation Test Vaultand disable safe mode to enable plugins - Restart the server and enable the plugin Hot-Reload (See Manual Testing)
- Install NodeJS, then run
npm iin the command line under your repo folder. - Run
npm run devto compile this plugin fromsrc/main.tstosrc/main.js. - Make changes to
main.ts(or create new.tsfiles). Those changes should be automatically compiled intomain.js.
Testing the plugin
Manual testing
- Open the test vault
tests/Note Auto Creation Test Vault - Enable Note Auto Creator
- Enable the Hot-Reload plugin in the vault. With this enabled our plugin is always reloaded when the Hot-Reload plugin observes changes to
main.jsorstyles.css. - Run
npm run devto compile the plugin and automatically recompile when changes have been made.
Automated testing
No end-to-end tests have been implemented, but a number of unit tests have been implemented to test the core functionality. You can find the tests in the tests folder.
Releasing new releases
- Update the
manifest.jsonwith the version number, such as1.0.1, and the minimum Obsidian version required for the latest release. - Update the
versions.jsonfile with"new-plugin-version": "minimum-obsidian-version"so older versions of Obsidian can download an older version of your plugin that's compatible. - Create a new GitHub release using the new version number as the "Tag version". Use the exact version number, don't include a prefix
v. See here for an example: https://github.com/obsidianmd/obsidian-sample-plugin/releases - Upload the files
manifest.json,main.js,styles.cssas binary attachments. Note: The manifest.json file must be in two places, first the root path of your repository and also in the release. - Publish the release.
You can simplify the version bump process by running
npm version patch,npm version minorornpm version majorafter updatingminAppVersionmanually inmanifest.json. The command will bump version inmanifest.jsonandpackage.json, and add the entry for the new version toversions.json