Platform:

Developing Node modules

Pulsar contains a number of packages that are Node modules instead of Pulsar packages. If you want to make changes to the Node modules, for instance atom-keymap, you have to link them into the development environment differently than you would a normal Pulsar package.

Linking a Node module into your Pulsar dev environment

Here are the steps to run a local version of a Node module within Pulsar. We’re using atom-keymap as an example:

$ git clone https://github.com/pulsar-edit/atom-keymap.git
$ cd atom-keymap
$ npm install
$ npm link
$ cd <WHERE YOU CLONED PULSAR>
$ npm link atom-keymap

# This is the special step; it makes the Node module work with Pulsar's version
# of Node. If the Node module in question does not have any native code
# (C/C++), you can skip this step.
$ pulsar -p rebuild

# If you have cloned Pulsar in a different location than ~/github/pulsar
# you need to set the following environment variable
$ export ATOM_DEV_RESOURCE_PATH=<WHERE YOU CLONED PULSAR>

# Should work!
$ pulsar --dev .
$ git clone https://github.com/pulsar-edit/atom-keymap.git
$ cd atom-keymap
$ npm install
$ npm link
$ cd <WHERE YOU CLONED PULSAR>
$ npm link atom-keymap

# This is the special step; it makes the Node module work with Pulsar's version
# of Node. If the Node module in question does not have any native code
# (C/C++), you can skip this step.
$ pulsar -p rebuild

# If you have cloned Pulsar in a different location than ~/github/pulsar
# you need to set the following environment variable
$ export ATOM_DEV_RESOURCE_PATH=<WHERE YOU CLONED PULSAR>

# Should work!
$ pulsar --dev .
$ git clone https://github.com/pulsar-edit/atom-keymap.git
$ cd atom-keymap
$ npm install
$ npm link
$ cd <WHERE YOU CLONED PULSAR>
$ npm link atom-keymap

# This is the special step; it makes the Node module work with Pulsar's version
# of Node. If the Node module in question does not have any native code
# (C/C++), you can skip this step.
$ pulsar -p rebuild

# If you have cloned Pulsar in a different location than %USERPROFILE%\github\pulsar
# you need to set the following environment variable
$ setx ATOM_DEV_RESOURCE_PATH=<WHERE YOU CLONED PULSAR>

# Should work!
$ pulsar --dev .

After you get the Node module linked and working, you should be able to make changes to the module as described below:

If your changes bear fruit, it’s a good idea to contribute them upstream so you can unlink your locally modified version of the package.