Atom package in multi-package repo


#1

Is it possible to have an Atom package be a child in a multi-package repo as opposed to being in the root directory? It also needs to reference/require other node packages within the repo


#2

It’s possible; see atom-ide-ui, which has independent packages bundled together, some of which provide or consume services for each other.

You cannot have your package listed at atom.io/packages or accessible directly via APM unless it exists as an independent repository, and you should not make a package available via APM if it has references to a package that isn’t listed as a dependency (and if it does you should be consuming a service through Atom, not requiring code in a folder that you assume is adjacent). There’s a lot of trouble you can get into if you do that (not officially or anything, just in terms of messing up Atom’s functionality for yourself or your users if you have bits of code calling other bits of code that might not exist or might be something completely unexpected). If you make sure that your subsidiary packages are only accessible as subsidiaries, you can absolutely have two or more packages in one repo and downloaded as a single package.


#3

Thanks so much! That’s very helpful


#4

No problem. :slight_smile:

For the sake of thoroughness I’ll also add something that seems obvious to me: Atom cannot automatically load packages that aren’t sitting at the top level of either .atom/packages/ or .atom/dev/packages/. You can use an undocumented PackageManager method to load a package not in the normal set of paths, and of course you can always require() or import in your code according to what style of JS/etc. you’re using (Atom packages are just NPM packages at core).