Skip to content

Latest commit

 

History

History
67 lines (42 loc) · 3.02 KB

CONTRIBUTING.md

File metadata and controls

67 lines (42 loc) · 3.02 KB

Contributing

Development

Yarn 1.x is required

First, quit Lens if it's currently running.

Then, clone the repository wherever you prefer to have your code, and then link to it:

$ git clone https://github.com/Mirantis/lens-extension-cc.git /cloned/repo/path
$ mkdir -p ~/.k8slens/extensions
$ ln -s /cloned/repo/path ~/.k8slens/extensions/lens-extension-cc
$ cd /cloned/repo/path
$ npm install # install dependencies
$ npm start   # start dev build in watch mode

This will put the development build into watch mode.

Restart Lens and go to the Extensions View (CMD+SHIFT+E on macOS) to enable it, which will cause it to load for the first time.

Now, as you make source changes, the build will run, and usually all you need to do is reload the Lens window (CMD+R on macOS) to see your changes. If you make changes under /src/main (or any shared code that's used by that code), however, you will need to restart Lens because code on the main thread does not get reloaded with CMD+R.

You can also run a one-off development build with npm run dev.

Note these steps will get much easier once this Lens issue is fixed.

Dev - Env vars

The following environment variables are supported when starting Lens from the command line (typically to debug the main process):

  • LEX_CC_MAIN_CAPTURE: Use this to opt-out of broadcasting some log messages from main to renderer to reduce noise in the renderer process' DevTools Console.
    • No value, or one of "true", "yes", or "1" will enable it.
    • Set it to any other non-empty value to disable it.

Start Lens from the command line, with main process debugging enabled, like this (and here, we're disabling the flag, as an example of using it):

$ DEBUG=true LEX_CC_MAIN_CAPTURE=0 /Applications/Lens.app/Contents/MacOS/Lens --inspect=5858

Dev - Uninstalling

Go to the Lens Extensions View (CMD+SHIFT+E on macOS) and use the UI to uninstall it.

This will simply remove the symlink you created in ~/.k8slens/extensions and leave your linked directory intact.

Publishing

First, update the CHANGELOG:

  • Make sure everything in UNRELEASED is accurate
  • Change UNRELEASED -> vX.Y.Z (version that will be published)

Then use NPM:

$ npm run version <patch|minor|major>
$ npm run publish --access public        # <- NOTE the '--access public' part!
$ git push && git push --tags

By default, packages published to an NPM scope/org are private. Use the --access public option to publish it as a public package instead. You can also configure NPM to always publish that single package publicly by running npm config set access public within the repository root directory (i.e. package root).

The prepublishOnly script will automatically produce a production build in the ./dist directory, which will be published.