30
votes

I have just began working on Atom.io Package development, and based on this tutorial, have learnt from how to create package development skelton file to how to publish your package.

However, I do not know how to check/debug/develop your package. I know I can use Jasmine via alt-cmd-I or Developer Console (for Atom is based on Chromium), still if you want to check the behavior of your package, do I have to re-publish or install your package manually every time?

2

2 Answers

55
votes

When working on packages locally, here's the recommended workflow:

  • Clone your package from GitHub using apm develop <package-name>. This will clone the package's repo to your local ~/.atom/dev/packages/<package-name>
  • cd into this directory
  • Start Atom in this directory using atom -d .

Now you can work on the package, make changes, etc. Once you're ready to reload, you can use View > Developer > Reload Window to restart Atom with the changed package.

If you have your package sources locally on your machine, you can skip the first step (apm develop) and simply create a symbolic link from your sources to ~/.atom/dev/packages/<package-name.

24
votes

Already have a local repo of the package?

To add to nwinkler's answer, if you already have a repo of the package locally, you can use

apm link --dev

to automatically create a symbolic link to the ~/.atom/dev/packages/ directory.

Make sure to completely restart atom in developer mode with

atom -d

or in View > Developer > Open In Dev Mode...

If you just want to use a local package (not in dev mode), you can use apm link directly. And apm unlink to remove the symbolic link to ~/.atom/packages.