We have an outline for a “Publishing Packages” article: https://github.com/meteor/guide/issues/45 but we decided to focus on other articles for the 1.3 release. Considering the 1.4 release is going to be focussed on moving towards npm and away from Atmosphere, I’m kind of doubtful we will end up getting round to writing it.
Got it. That makes sense. Still doesn’t work because now that package doesn’t export Slack - good ol’ fun. I’ll try to coordinate with the package maintainers.
I think you’ll need to wait for the core Meteor packages to
a) be rewritten to not rely on psuedo-globals (/the linker)
b) be imported into npm
There are a lot of little things to get right in doing so (let alone figuring out a system for doing so for non-core packages). We’re working on it but it’s still a little ways away.
I’m looking for a package sharing strategy. Since I posted that package I’ve learned more about npm link and local paths which I think negate the need for a local package repo.
Yeah, I think we are just in that awkward limbo where we are quite on NPM and we are afraid to use the Meteor package system since we know it will die off this year.
I wrote a internal Meteor package and I had issue when I created the first template: "Can’t find the module ./some_template.html'
The solution is quite easy and logic but I spend too much time to find out, so maybe you can add it on the guide:
Add the following line in the Package.onUse block in the package.js file:
api.use(‘templating’, ‘client’);
if you want to be able to import an html template with the lastest syntax:
I used these instructions to try to setup some code in a separate folder. The npm link is clearly working, because if I just import my shared package, and have it do a console.log, it all works.
If, instead, I do:
exports.myPackageLog = function() {
console.log("logged from my-package");
};
… as described in this article, I get an “Unexpected token” pointing to the “exports” line from “meteor run”.
I also tried “export default class …” with a corresponding import. With this version, I get “modules.js?hash=9e60446…:71833 Uncaught SyntaxError: Unexpected token export” and then multiple “es5-shim.js?hash=4187fff…:17 Uncaught TypeError: Cannot read property ‘meteorInstall’ of undefined” messages in my browser console.
I think this article has not been updated to work with the latest module export and import system, and I’m guessing that I need to add something to my package.json. I’ve experimented with dependencies on babel-runtime and meteor-node-stubs but those just generated other errors. So how do I make this work?