本文介绍了如何构建流星智能包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何构建流星智能程序包出现在meteor list
中?
构建 Atmosphere 软件包相当好已记录,但未构建Meteor软件包.
Building Atmosphere packages is reasonably well documented, but building Meteor packages isn't.
推荐答案
Meteor现在支持 create --package
命令.
Meteor now supports a create --package
command.
请参见流星文档.
示例(用您自己的流星开发者帐户代替"cunneen"):
Example (substitute your own meteor developer account for "cunneen"):
meteor create --package cunneen:foo
输出:
cunneen:foo: created in your app
结果:
packages/cunneen:foo/package.js
Package.describe({
name: 'cunneen:foo',
version: '0.0.1',
// Brief, one-line summary of the package.
summary: '',
// URL to the Git repository containing the source code for this package.
git: '',
// By default, Meteor will default to using README.md for documentation.
// To avoid submitting documentation, set this field to null.
documentation: 'README.md'
});
Package.onUse(function(api) {
api.versionsFrom('1.0.3.1');
api.addFiles('cunneen:foo.js');
});
Package.onTest(function(api) {
api.use('tinytest');
api.use('cunneen:foo');
api.addFiles('cunneen:foo-tests.js');
});
packages/cunneen:foo/foo.js(空文件)
// Write your package code here!
packages/cunneen:foo/foo-tests.js
// Write your tests here!
// Here is an example.
Tinytest.add('example', function (test) {
test.equal(true, true);
});
packages/cunneen:foo/README.md(空文件)
# cunneen:foo package
作为一个很好的例子(非常全面),请查看 iron-router .
For a good (VERY comprehensive) example, take a look at iron-router.
这篇关于如何构建流星智能包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!