src
├── commands - contains internal / external commands, e.g. open today or random note commands
├── declarations.d.ts - global TS type declarations
├── extension.ts - plugin entrypoint
├── features - contains features, usually feature accepts plugin context and implements certain functionality
├── test - contains test runner and common test utils
├── types.ts - common types
└── utils - common utils
See Conventional Commits for commit guidelines and Why Use Conventional Commits.
Guidelines enforced via commit hooks, so commits MUST be prefixed with a type.
- Fork this repository
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'feat: Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request
For bigger features, please consider discussing your plans and ideas on GitHub first before implementing them.
cd <project-root> && yarn && yarn watch
- Open project in VSCode using
code <project-root>
or viaFile -> Open...
and pressF5
to open a new window with the extension loaded. - After making modifications run
Developer: Restart Extension Host
command from the command palette to restart the extension and quickly pick up your changes. - Set breakpoints in your code inside
src/extension.ts
to debug the extension. - Find output from the extension in the debug console.
yarn test # runs all tests
yarn test:watch # runs only changed tests, consider also using JEST_TEST_REGEX env var for running specific tests
Note: Before running integration tests, please ensure that all VSCode instances are closed.
You can skip this section if your contribution comes via PR from a forked repository.
- Remember to update new version notifications if needed
- Run
yarn release
- Push to origin with
git push --follow-tags origin master
- After push CI will automatically:
- create new release
- attach release artifacts
- publish extension to the marketplace
General:
- Please prefer FP over OOP style where task permits to stay consistent with the existing codebase
- Use random file names in tests to increase isolation
- VSCode does not provide API to dispose text documents manually which can lead to flaky tests if random file names are not used
- Use "_" prefix for internal command names
- Put tests as
<filename>.spec.ts
next to the tested file
Pull requests:
- No linter or type errors
- No failing tests
- Try to make code better than it was before the pull request