Skip to content

Instantly share code, notes, and snippets.

@monbro
Last active August 29, 2015 14:15
Show Gist options
  • Save monbro/78d6bad07d09f62c81da to your computer and use it in GitHub Desktop.
Save monbro/78d6bad07d09f62c81da to your computer and use it in GitHub Desktop.
meteor-packages-exposed-objects-issue
// *************************************** NEW FILE
// the main app uses multiple packes, also these two private packages. currently the .meteor/packaes is
meteor-platform
myapp-boilerplate
myapp-user-account
udondan:yml
amplify
// *************************************** NEW FILE
// the first package.js file,
// this package is using another private package "myapp-navigation" which is not used anywhere else and not shown in this gist
Package.describe({
name: 'myapp-boilerplate',
summary: 'Test Summary',
version: '1.0.0'
});
function configurePackage(api) {
if(api.versionsFrom) {
api.versionsFrom('METEOR@1.0');
}
// Core Dependencies
api.use(
[
'myapp-navigation', // that is what I assumed how it should be to use exposed objects from another package
'templating',
'meteor'
], 'client'
);
// expose this package to the main app as well
api.imply('myapp-navigation');
api.use('udondan:yml@3.2.2_1', 'server');
api.addFiles('server_mediator.js', 'server');
api.addFiles('server_config.js', 'server');
api.addFiles('client_header.js', 'client');
api.addFiles('header.html', 'client');
Npm.depends({"mediator-js": "0.9.9"});
api.export('MyappConfig');
api.export('MyappMediator');
}
Package.onUse(function(api) {
configurePackage(api);
});
Package.onTest(function(api) {
});
// *************************************** NEW FILE
// the second package.js which is used in the main app
// this package has access in the file 'server_accounts.js' to the objects MyappConfig and MyappMediator without having the previous package in the specifications
Package.describe({
name: 'myapp-user-account',
summary: 'Test Summary',
version: '1.0.0'
});
function configurePackage(api) {
if(api.versionsFrom) {
api.versionsFrom('METEOR@1.0');
}
// Core Dependencies
api.use(
[
'blaze@2.0.0',
'templating',
'ui',
'reactive-var',
'meteor'
], 'client'
);
api.use('iron:router@1.0.1', 'client');
api.addFiles('accounts.html', 'client');
api.addFiles('server_accounts.js', 'server');
api.export('MyappUserAccounts');
}
Package.onUse(function(api) {
configurePackage(api);
});
Package.onTest(function(api) {
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment