Bike 2 Extensions Questions

Yesterday, I built 2 simple extensions for Bike.

  1. vim-traverser, which lets me navigate up & down using j & k when in block mode.
  2. vim-context, which lets me type jj to enter block mode. When in block mode, if I type i, I begin editing the current line.

The process I folllowed:

  1. clone the bike-extension-kit repo
  2. navigate to src
  3. create an extension directory
  4. write the extension’s code
  5. run npm run build to build the extensions source
  6. copy the output into the Bike 2 app’s Contents/Resources/Extensions directory.
  7. Quit & reopen Bike 2

I have a couple of questions —

  1. Is it possible to load “unbuilt” or “unpacked” extensions into the Bike’s Extensions directory, and write code directly within that? The process of having to manually build, move them to the destination and restart Bike 2 was not ideal.
  2. Looking forward a bit… how do you recommend we share extensions? In the future, do you expect these to all be on github with the repo, or do you expect folks to be able to host their own?

Thank you! Bike 2 is excellent.

2 Likes

I see the install flag in the manifest may automatically install it for me. But I don’t know what that means! Does it mean I don’t have to restart Bike 2?

I tried handling shift+a in a keySequence, but I’m getting the macOS “boop” noise when pressing that specific key binding. I believe there’s a conflict somehow with the native app (a when in block attempts to Archive a node, I think).

Yes, you can set it up so that as soon as you save a change to your extension it is automatically reloaded into Bike. The two important bits are:

  1. Set that install flag in the manifest.json to true
  2. Build the extension kit in npm run watch mode

Also, if you haven’t found it yet there is some extension documentation here:

1 Like

For Bike 2.0 extensions will be pretty much as they are now. Meaning no build in UI for managing them, and no official location to share them. So for now easiest way to share is just:

  1. Zip and share link
  2. And to install unzip and copy to extensions directory

Of course that’s pretty problematic for versioning, etc, but it’s best I’ve got for 2.0 release.

Longer term I’m not sure, but my thoughts are:

  1. Probably first I will start to bundle some extensions with each release. Currently I’m already doing this with the default Bike extension, but I might add more.

  2. Eventually I will build UI to manage and browse extensions. This isn’t priority at the moment, but when I do that I think the default location for browsing extensions will be the current extension kit, though I will likely allow you to add forks of that kit too, by pasting in the fork URL

Generally biggest goal for post 2.0 is just to use the extension kit to build some real things, and see how it goes. Then figure what’s next.

1 Like