How to use `apm develop`?


#1

When this evening I used apm develop terminal-status, the package got cloned to my ~/github/terminal-package directory, but atom didn’t want to load the package at all… Why/how is this command useful if it just clones a github repository or am I missing something?

Thanks!


#2

I don’t remember if apm develop runs apm install to install the package’s dependencies or if that is a separate step. You might want to try running apm install from inside the package directory and reload Atom.


#3

I tried that. Running apm develop terminal-status just cloned the repo to ~/github/terminal-status (I remember previously it copied it to the “project home” directory I set in atom, I may of course be wrong though). The package is showing up in the “dev packages” section of the settings view, but I can click install on the package…

Just after I did the apm develop terminal-status. apm develop did indeed run apm install from the package directory.


#4

By the way, just to be clear: the screenshot is after I ran following commands:

apm develop terminal-status
cd ~/github/terminal-status
apm install

#5

I see what you’re describing if Atom is already open when I execute apm develop terminal-status. Atom currently doesn’t have a way of knowing that new packages are installed by apm, so this behavior is, while not desired, somewhat expected.

If Atom is closed when you run apm develop terminal-status, then everything works as it should.

The bug for the above mentioned undesirable behavior is here:


#6

What I’m describing was with atom closed… Using Atom v0.174.0 by the way, on Linux Debian 8 (testing).

> apm --version
apm  0.120.0
npm  1.4.4
node 0.10.35
python 2.7.8
git 2.1.4

#7

I’m running Atom v0.175.0-432b531 on Mac OS X 10.10.1 … so maybe things have been fixed recently?

$ apm --version
apm  0.122.0
npm  2.1.18
node 0.10.35
python 2.7.6
git 2.2.0

#8

Didn’t know about the new version, so thanks for the heads-up :smile:. I’ll try that.


#9

Hmmm. When I download the newest version for Linux it is still on v0.174.0… I’ll try tomorrow, after I’ve got some sleep :sleepy:. Thanks for the input anyways :smile::smile:


#10

You’re welcome. I build from master almost exclusively … so v0.175.0-432b531 was the latest commit as of whenever I last pulled from https://github.com/atom/atom. (That’s what the hex digits after the normal version number mean … that it isn’t an officially released version.)


#11

How often do you get nailed by bugs from the unstable version?


#12

Very, very rarely. I’d have to look at my bug submissions to give a number though. But since I started using Atom this way, probably in early April, I can think of only once that I had a bug that made me compile the released version.


#13

I’ve been confused by apm develop too – since it just clones the package repo instead of cloning from a fork you have push access to, it leaves you with the extra step of forking on GitHub and then adding the new remote locally (probably replacing origin). It seems to me that the command was meant for package maintainers with push access to the repo, and not so much other contributors (who might just be better off git cloneing and apm installing manually).


#14

I think the idea is that you apm develop first to get the local working copy, then you change directory into it, then you do apm link to symlink that working copy into the Atom packages directory. Then you don’t need to run apm install every time you make a change to the package.


#15

Steps I use all the time.

  • $ apm develop (package_name)
  • $ atom (package_path)
  • $ atom -d <whatever_path> # critical step I haven’t seen mentioned on this thread yet, and gets rid of need for manual apm link
    If forking:
  • Fork
  • $ git stuff…
    If removing after done:
  • $ apm delete --dev (package_name) # also can do -d

So the point of this is that atom -d points to the union of all of these dev dirs.


#16

Thanks for the explanation. So I’m correct that the packages in ~/.atom/dev/<package_name> are only loaded in atom --dev mode?


#17

Yes, that is correct.