-
-
Notifications
You must be signed in to change notification settings - Fork 219
How to Contribute
Calva is mostly TypeScript, but some things are written in ClojureScript.
The CLJS code is compiled by shadow-cljs
into an npm library, that is then required from TypeScript.
Start by saying hello in #calva-dev at the Clojurians Slack. Then:
- Clone your fork of https://github.com/BetterThanTomorrow/calva
-
npm install
(This will install, amongst other things,shadow-cljs
) - Open the project root directory in VS Code. (You are using VS Code and Calva, right?)
The dev process is like so:
- Jack in Calva to Calva itself. This will build the JS library used which is then used by the TS code.
- Choose to connect to the
:calva-lib
cljs REPL. - Wait for it to build and run the tests. (You'll see this happening in the Terminal spawned to run the Jack-in task.)
- Choose to connect to the
- Run the build task Watch TS.
- Wait for it to compile the TypeScript code and start watching. (Only takes a second).
- Run the build task Watch Webpack.
- Wait for it build its stuff and start watching. (This also only takes a second).
- Start the extension in debug mode (the Extension Host):
F5
. (This is the app with a cljs REPL server your Calva will connect to.) - Hack away. The watch task will rebuild the extension really quickly.
- You'll find the output from both build task in their respective vscode Terminal view.
- NB: There are no automated tests for the TS code, mainly because I don't know how to do it. Please consider setting that up to collect gold stars in heaven (as we say in Sweden).
- Restart the extension host when you have new TS code to test (CLJS code will hot-reload).
Good to know: If you are working with TS code only, then you only need to do the Jack-in once.
- Make sure all tests pass. Please add some basic unit tests for any functionality in the ClojureScript code that you add or change.
- Package a
vsix
file:-
vsce package
(you might need tonpm install -g vsce
first.) - Install the vsix it manually in your VS Code and do some testing that the production build works.
-
Note: On Windows, uninstalling extensions does not seem to remove the extension folder in ~.vscode/extensions
. So if you don't rename/reversion your custom vsix, if you install and uninstall and then try to install the Marketplace version of Calva, you may notice your custom changes are still in effect. To fix this, uninstall the extension, remove the extension folder, and reinstall.
When you have issued your Pull Request it is best to ping me about it to catch my attention. The #calva-dev channel of the Clojurians Slack is a good place for this ping, mention @pez
even.