I want to be an engine


#1

I have a plugin architecture in my new package. The plugins are regular npm modules. I want to register my package as an “engine” for the plugins to reference in their package.json just like Node and Atom. The only package.json doc I could find on the web just assumed the engine was Node.

How does Atom (apm) register as an engine?


#2

Like a package dependency?

ATM the only way to do that is to have your package loaded after it’s dependency, and since packages are loaded alphabetically…


#3

Not a package dependent on another package. I need an npm module to have an engine dependency on my package. This is like the atom dependency …

"engines": {
  "atom": ">0.100.0",
  "myPackage": "0.1.0"
},

Using this engine dependency is the only way I can think of to have my npm plugins dependent upon my package’s version. This is very important because they call my api (classes) just like Atom packages call Atom stuff and my package might have breaking changes.

P.S. What is ATM?


#4

Take a look a peer-dependencies


#5

That’s perfect. It kind of overlaps with the engine dependency IMHO.

Thanks mucho.