CONTRIBUTING.md
January 14, 2024 ยท View on GitHub
Local Development
To develop the plugin locally, follow these steps:
- Clone the project into this directory using:
git clone https://github.com/j0rd1smit/obsidian-copilot(or your fork). - Navigate to the newly created
obsidian-copilotfolder using:cd obsidian-copilot. - Install the dependencies with:
npm install. - Run the build script with:
npm run dev, which will:- Build the plugin and place the files in the
.obsidian/plugins/obsidian-copilotfolder. - Watch for file changes and automatically rebuild the plugin when changes are made. (Use the
reload app without savingaction in Obsidian to see the changes).
- Build the plugin and place the files in the
- Open the
demo_vaultin your local Obsidian application. - Enable
obsidian-copilotin the community plugins section. - Access the
obsidian-copilotsettings and enter the necessary secrets. - You are now ready to test the plugin in the
demo_vault. - For more information on the different test cases, refer to the README.md file in the
demo_vault.
Want to try out in your own vault? You can do so by following these steps:
- Go to your (development) obsidian vault.
- Find the dotfiles folder with all the configs. Typically name
.obsidian - Go to the plugin folder here. This is typically named
plugins. If you have not installed any plugins, this folder might not exist. - Copy the folder
demo_vault/.obsidian/plugins/obsidian-copilotinto your own plugins folder.
You can now make changes to the plugin and test them locally. If your changes could benefit others, feel free to submit a pull request.
Making a Release
To make a release, follow these steps:
- Update the version number in the
package.jsonfile. - Execute the following commands to synchronize the version number across all files:
npm install npm run version - Add an entry for the new version to the
CHANGELOG.mdfile. - Commit these updates to the master branch.
- Ensure you have the latest version of the master branch:
git checkout master git pull - Create a release with the following commands:
git tag -a $(jq -r '.version' package.json) -m "Release $(jq -r '.version' package.json)" git push origin $(jq -r '.version' package.json)
This process will automatically trigger a GitHub action to build the plugin and upload it to the release.