How to build a Meteor smart package

前端 未结 5 1780
半阙折子戏
半阙折子戏 2020-12-01 00:54

How can one build a Meteor smart package that would show up in meteor list?

Building Atmosphere packages is reasonably well documented, but building Met

5条回答
  •  盖世英雄少女心
    2020-12-01 01:36

    This was dated Jun 12 2013. It was the correct answer at the time, and is still an alternative solution:

    Like n1mmy said. It's undocumented, and you should use meteorite.

    If you insist on creating a package with meteor, I found a good unofficial How-to, but you really shouldn't do this. Meteor will be coming out with a way to create packages in an upcoming release.

    Bulding a Meteor package: https://coderwall.com/p/ork35q

    The way I would do it is with Meteorite

    Obviously you have node, and I assume you have node package manager (npm), so your best way to make a meteor package to date, is to make a meteorite smart package.

    npm install meteorite
    

    Meteorite smart packages contain 2 key files essential for package creation - package.js - smart.json

    Meteorite files are stored under your system logged in user account: ~/.meteorite/
    but are symlinked to your current where you created a meteor app: project/.meteor/meteorite/

    Sample package.js:

    Package.describe({
       summary: "User analytics suite for meteor"
    });
    
    Package.on_use(function (api) {
       api.add_files('user_analytics.js', 'client');
    });
    

    Sample smart.json

    {
       "name": "User analytics",
       "description": "User Analytics",
       "homepage": "http://yourHomepage.com",
       "author": "Eric Leroy",
       "version": "0.1",
       "git": "https://github.com/yipyo",
       "packages" : {}
    }
    

    If you need anymore info, you should install a mrt package from the list:

    mrt list
    

    then analyze the files under your app/.meteor/meteorite/ directory.

    Hope this helps, and keep developing the best language of the future.

    Here are some helpful links:

    • http://www.eventedmind.com/ - Exceptional tutorials explaining Meteor's core concepts
    • publishing Atmosphere packages
    • Unofficial meteor FAQ
    • making a chatroom app with Meteor

提交回复
热议问题