Apart from the module support, it has native NPM support. That means, you could import NPM packages inside the node_modules directory. So, sooner or later we may need to publish our packages to NPM rather to Atmosphere.
I just started to considering porting some of our Meteor packages to NPM and I found it so harder to find a good way to write ES2015 inside as a NPM package.
It took me a while to setup a good environment with liniting, testing and proper transpilation. I made it as a base repo so everyone can use and we’ll support it.
@arunoda I was trying to move my packages to npm aproach and migrate views from Blaze to React but some templates will stay on Blaze. I’m unable to figure out how export/import Blaze from npm. Do you know it?
Any repo example?
Just want to chip in here regarding the boilerplate and what to do if you prefer - like we do - to create meteor agnostic npm packages now. Since we’re on npm, we can not only provide ES2015.
@benjamn made some crucial points (see below) about how npm packages should look like to transition to true ES2015 import / export statements. Since npm is currently split between ES5 and ES6 he basically advocates the jsnextproperty inside a package.json to provide both the ES2015 and transpiled ES5 js entry points: Checkout the jsnext-skeleton boilerplate
He gave a talk in November (video below) about this issue in which he pleas to publish both source files and (if you care about npm) transpiled js routed via the ‘jsnext’ property (slide 71+)
I personally like the skeleton very very much - untying everything in a npm package from meteor. @arunoda what do you think? Maybe you can include this alternative in your medium post / faq section?
This is good idea in general that I’ve been using in libraries I contribute to or write: If you’d like the most people possible to use your library, include all forms of your source (original, compiled, global UMD) in your package since each form is still just a script, with instructions on how to use each. I usually put original files in a src folder, compile everything into lib or just into the root of the project, and also place a global version at the root.