Load developing package


#1

Hi, I’d like to add some functionality to markdown-preview package, so I fork it on Github, then, I found I have no idea where to go. Can there be a load developing package button? (like Chrome extension which provides nice developing experience)


#2

If you have your fork installed locally and your cwd is your package, than you can call $ apm link. Than you can reload you Atom window and Atom knows about your package.

Does this solve your question?


#3

The workflow - as far as I understand it - is:

  • apm develop <package_name>
  • cd ~/.atom/dev/packages/<package_name>
  • atom -d

First command clones the github repo into ~/github/<package_name> and links it to ~/.atom/dev/packages/<package_name>, second is obvious, and third runs atom in development mode in which it’s also loading ‘development’ packages from dev/packages/.
If you want to use your modified package in normal mode, too, simply link create a link to it in ~/.atom/packages/

You’ll of course need atom’s shell commands installed for all that.


#4

Will atom -d also automatically reload plugins with changed code?

(I apologise for the dumb question, but I’m away from my Atom machine, otherwise I’d just tried myself.)


#5

atom -d just opens up Atom in development mode. Meaning all packages in ~/.atom/dev/packages/ will be loaded.

If you already have Atom opened in developer mode and want to reload packages so you can test your changes. Just do cmd-alt-shift-L. That will refresh Atom.


#6

atom -d and cmd-shift-o will open a new dev window.

Dev windows load packages from ~/.atom/dev/packages first, then ~/.atom/packages second, and from within /Applications/Atom.app last. Dev windows do have automatic stylesheet reloading via the dev-live-reload package.

So if markdown-preview is in ~/.atom/dev/packages then new dev windows will load that version instead of the version that comes with Atom.

Just for clarity, another thing apm develop does is run apm install initially after cloning in the package’s root directory which installs all dependencies of that package into its local node_modules folder. You can run apm install anytime to install the package’s dependencies again.

There is also apm unlink to remove the symlink, see `apm help unlink for more details.


#7

Thanks for the clarification.


#8

Thanks for all your replies!


My package isn't reloading properly with Window: Reload
#9

When I’ve used apm dev it has put the new package into ~/github not ~/.atom/dev. Has that changed recently?

Does atom -d open all packages in ~/github also (it appears too)?

Are there docs on dev mode somewhere? Thanks.


#10

I just discovered that ~/.atom/dev still exists and the packages inside are symlinks to ~/github. It would be very helpful if everything apm dev did was clear somewhere. Splitting Atoms might be a good place.


#11

How about in the help?

[~/.atom] apm dev --help
Usage: apm develop <package_name>

Clone the given package's Git repository to ~/github/<package_name>,
install its dependencies, and link it for development to
~/.atom/packages/dev/<package_name>.

Once this command completes you can open a dev window from atom using
cmd-shift-o to run the package out of the newly cloned repository.

Options:
  --help, -h  Print this usage message

#12

atom -d worked for my package.

I’m having issues with it for vim-mode. Is there something else I have to do to turn vim mode on?

Also, is there away to quickly turn off all non-core packages so that it’s just the package I’m developing on and optional others (to isolate which package is causing issues etc)

While my package is dependent upon vim-mode, I really need to make sure it works well with it.


#13

Oops. It seemed I had to restart everything and it’s working now.


#14

Obviously this alone doesn’t accomplish the goal. Atom doesn’t load your plugin just because you linked it.


#15

I wonder what’s the up to date doc page for this now…
I just cloned my repo inside ~/.atom/dev/packages, then atom -d loads it.


#16

“Obviously”? The apm link command creates a symbolic link in your .atom/packages/ folder pointing to the package you’re working on. If you use apm link -d, the symbolic link is created in .atom/dev/packages/. It’s not necessarily a problem to have your development code in dev/, since you’ll know that it’s there, but you definitely wouldn’t want to keep it in packages/.

If you keep your code in a dedicated external folder, you can add that folder to Atom as the default project folder. Then any packages you spin up with package-generator will have that directory filled in by default. It’s very convenient.