Last active
August 29, 2015 14:15
-
-
Save monbro/78d6bad07d09f62c81da to your computer and use it in GitHub Desktop.
meteor-packages-exposed-objects-issue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// *************************************** 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('[email protected]'); | |
} | |
// 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:[email protected]_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('[email protected]'); | |
} | |
// Core Dependencies | |
api.use( | |
[ | |
'[email protected]', | |
'templating', | |
'ui', | |
'reactive-var', | |
'meteor' | |
], 'client' | |
); | |
api.use('iron:[email protected]', '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