question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Publish to npm instead of atmosphere

See original GitHub issue

This would probably resolve #35 We could rely on meteor globals with this pattern:

function getMeteorGlobal(packageName, globalName) {
  if (!global.Package || !global.Package[packageName]) return
  return global.Package[packageName][globalName]
}

const Mongo = getMeteorGlobal('mongo', 'Mongo') // from core package
const RedisOplog = getMeteorGlobal('cultofcoders:redis-oplog', 'RedisOplog') // from atmosphere package

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:9 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
gaurav-commented, Nov 26, 2016

Just a note that merely moving to npm doesn’t automatically mean support for 1.2.x. It would also depend on not using any of the Meteor core or packages APIs that are not available in 1.2.x. That would be difficult to control since versions of Meteor packages cannot be controlled through NPM. We might have to rely on unit tests. But I’d worry about it only after the move to npm is complete.

@maxnowack nice initiative with meteor-globals!

For unit testing, there already seems to be supporting packages like https://github.com/Astrocoders/meteor-mocks and https://github.com/meteor-velocity/meteor-stubs. I haven’t used them personally though.

1reaction
maxnowackcommented, Nov 24, 2016

Here it is: https://github.com/maxnowack/meteor-npm-package It uses this small package to get globals from meteor: https://github.com/maxnowack/meteor-globals

I think the easiest way to depend on a meteor package would be, to check if the package is there and otherwise log a message, throw an exception and kill the process. What do you think?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Where to publish? Atmosphere vs NPM - packages - Meteor forums
On my personal opinion, I would start publishing everything to NPM, but is it possible to add dependencies to Meteor Packages on NPM...
Read more >
Deprecate atmosphere packages? · Discussion #11765 - GitHub
Here's the suggestion, in rough form: Deprecate atmoshpere packages entirely. Extend npm package. json (for packages) to add Meteor specific items, like the ......
Read more >
Unpublish package from Atmosphere - meteor - Stack Overflow
There is a temporary, undocumented way to do this: Log into the atmosphere website with the same details you used to publish your...
Read more >
Writing Packages | Meteor Guide - GitHub Pages
You can share your package with others by publishing it to the npm registry. While most packages are public, you can control who...
Read more >
npm-publish - npm Docs
By default npm will publish to the public registry. This can be overridden by specifying a different default registry or using a scope...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found