<commit_before>Package.describe({
  name: 'gimco:latch',
  summary: 'Protect user accounts with Latch service',
  version: '1.0.0',
  git: 'https://github.com/gimco/meteor-latch'
});

Package.onUse(function(api) {
  api.versionsFrom('1.0');

  // npm package is outdated (uses 0.7 api version)
  // Npm.depends({
  //   'latch-sdk': '0.1.0'
  // });

  api.use('underscore');
  api.use('http', 'server');
  api.use('accounts-base');
  api.use('momentjs:moment', 'server');
  api.use('service-configuration', 'server');

  api.addFiles('latch-common.js', ['client', 'server']);
  api.addFiles('latch-client.js', 'client');
  api.addFiles('latch-server.js', 'server');

  api.export('Latch');
});
<commit_msg>Specify a momentjs version<commit_after>Package.describe({
  name: 'gimco:latch',
  summary: 'Protect user accounts with Latch service',
  version: '1.0.0',
  git: 'https://github.com/gimco/meteor-latch'
});

Package.onUse(function(api) {
  api.versionsFrom('1.0');

  // npm package is outdated (uses 0.7 api version)
  // Npm.depends({
  //   'latch-sdk': '0.1.0'
  // });

  api.use('underscore');
  api.use('http', 'server');
  api.use('accounts-base');
  api.use('momentjs:moment@2.8.4', 'server');
  api.use('service-configuration', 'server');

  api.addFiles('latch-common.js', ['client', 'server']);
  api.addFiles('latch-client.js', 'client');
  api.addFiles('latch-server.js', 'server');

  api.export('Latch');
});
<|endoftext|>


<commit_before>Package.describe({
  name: 'timbrandin:jsx-templating',
  version: '0.1.2',
  // Brief, one-line summary of the package.
  summary: 'React jsx templating',
  // URL to the Git repository containing the source code for this package.
  git: 'https://github.com/timbrandin/meteor-react-jsx-templating',
  // By default, Meteor will default to using README.md for documentation.
  // To avoid submitting documentation, set this field to null.
  documentation: 'README.md'
});

Package.registerBuildPlugin({
  name: 'transpileJSXHTML',
  use: ['babel-compiler@5.4.7'],
  sources: [
    'jsx-templating-plugin.js'
  ],
  npmDependencies: {
    'cheerio': '0.7.0',
    'eval': '0.1.0',
    'cheerio-select': '0.0.3'
  }
});

Package.onUse(function (api) {
  // We need the Babel helpers as a run-time dependency of the generated code.
  api.imply('babel-runtime@0.1.0');
  api.imply('react-meteor-data@0.1.0');
});
<commit_msg>No need for cheerio-select.<commit_after>Package.describe({
  name: 'timbrandin:jsx-templating',
  version: '0.1.2',
  // Brief, one-line summary of the package.
  summary: 'React jsx templating',
  // URL to the Git repository containing the source code for this package.
  git: 'https://github.com/timbrandin/meteor-react-jsx-templating',
  // By default, Meteor will default to using README.md for documentation.
  // To avoid submitting documentation, set this field to null.
  documentation: 'README.md'
});

Package.registerBuildPlugin({
  name: 'transpileJSXHTML',
  use: ['babel-compiler@5.4.7'],
  sources: [
    'jsx-templating-plugin.js'
  ],
  npmDependencies: {
    'cheerio': '0.7.0',
    'eval': '0.1.0'
  }
});

Package.onUse(function (api) {
  // We need the Babel helpers as a run-time dependency of the generated code.
  api.imply('babel-runtime@0.1.0');
  api.imply('react-meteor-data@0.1.0');
});
<|endoftext|>


<commit_before>Package.describe({
  summary: "Basic blog functionality for Meteor.js applications",
  version: "1.0.0",
  git: "https://github.com/bredikhin/meteor-posts"
});

Package.onUse(function(api) {
  api.versionsFrom('METEOR@1.0');
  api.use(['templating'], 'client');
  api.use(['mongo', 'iron:router@1.0.3'], ['client', 'server']);
  api.addFiles(['client/views/posts.html',
    'client/views/posts_item.html',
    'client/views/post.html'
  ], 'client');
  api.addFiles(['posts.js', 'collections/posts.js'], ['client', 'server']);
  api.addFiles(['server/publications.js'], 'server');

  if (api.export) {
    api.export('Posts');
  }
});

Package.onTest(function(api) {
  api.use('tinytest');
  api.use('bredikhin:posts');
  api.addFiles('posts_tests.js');
});
<commit_msg>version bump<commit_after>Package.describe({
  summary: "Basic blog functionality for Meteor.js applications",
  version: "1.0.1",
  git: "https://github.com/bredikhin/meteor-posts"
});

Package.onUse(function(api) {
  api.versionsFrom('METEOR@1.0');
  api.use(['templating'], 'client');
  api.use(['mongo', 'iron:router@1.0.3'], ['client', 'server']);
  api.addFiles(['client/views/posts.html',
    'client/views/posts_item.html',
    'client/views/post.html'
  ], 'client');
  api.addFiles(['posts.js', 'collections/posts.js'], ['client', 'server']);
  api.addFiles(['server/publications.js'], 'server');

  if (api.export) {
    api.export('Posts');
  }
});

Package.onTest(function(api) {
  api.use('tinytest');
  api.use('bredikhin:posts');
  api.addFiles('posts_tests.js');
});
<|endoftext|>


<commit_before>var exec = require('sync-exec');
var EOL = require('os').EOL;

var PackageVersion = require('./package-version-parser');

// Given a package constraint, check if the user has the latest version
//
// Rather than reimplement Meteor's entire package database mechanism in order
// to get the latest versions, we simply call out to Meteor's command line.

var checkPackage = function(packageConstraint) {

  var splitString = packageConstraint.split('@');
  var version = (splitString.length > 1) ? splitString[1] : null;

  if (version) {

    var packageName = splitString[0];

    // Use the command line to get the latest versions of this package

    var result = exec('meteor show ' + packageName);

    if (result.status != 0) {
      console.log('Call to `meteor show` failed.')
      console.log(error);
      exit(1);
    }

    var lines = result.stdout.split(EOL);
    var idx = 0;
    var latest = null;

    // Find the list of recent versions
    while (idx < lines.length && lines[idx++] !== 'Recent versions:') ;

    // Get the last line in this list
    while (idx < lines.length && lines[idx] !== '') {
      latest = lines[idx];
      idx++;
    }

    // If we have a line, get the version and test
    if (latest !== null) {
      latestVersion = latest.split(' ').filter(function(item) { return item != ''; })[0];
      if (PackageVersion.lessThan(version, latestVersion)) {
        console.log(packageName + ' version ' + latestVersion + ' is available (' + version + ' currently specified)');
        return true;
      }
    }
  }

  return false;
}

// api object to be passed to the Package.onUse function

var api = {

  // Define empty functions for parts of the API that don't interest us

  versionsFrom: function() {},
  imply: function() {},
  export: function() {},
  addFiles: function() {},
  add_files: function() {},

  // The `use` function is called with the list of packages that we need to check

  use: function(packageConstraints) {

    // The user can either pass an array or a string, we need to handle both cases

    var updatesAvailable = false
    if (packageConstraints.constructor === Array) {
      packageConstraints.forEach(function(packageConstraint) {
        if (checkPackage(packageConstraint))
          updatesAvailable = true;
      });
    }
    else {
      if (checkPackage(packageConstraints))
        updatesAvailable = true;
    }

    // Insert a blank link between packages if there were updates displayed

    if (updatesAvailable)
      console.log();

  }

}

// We need to export our own Package object that will be called by the user's package.js script

var Package = {

  describe: function(description) {
    console.log("Checking package " + description.name + '...');
  },

  onUse: function(fn) {
    fn(api);
  },

  onTest: function(fn) {
    fn(api);
  },

  registerBuildPlugin: function(description) {
    api.use(description.use);
  }

}

module.exports = Package;
<commit_msg>Don't stop check when package isn't found - just report it.<commit_after>var exec = require('sync-exec');
var EOL = require('os').EOL;

var PackageVersion = require('./package-version-parser');

// Given a package constraint, check if the user has the latest version
//
// Rather than reimplement Meteor's entire package database mechanism in order
// to get the latest versions, we simply call out to Meteor's command line.

var checkPackage = function(packageConstraint) {

  var splitString = packageConstraint.split('@');
  var version = (splitString.length > 1) ? splitString[1] : null;

  if (version) {

    var packageName = splitString[0];

    // Use the command line to get the latest versions of this package

    var result = exec('meteor show ' + packageName);

    if (result.status != 0) {
      console.log(result.stderr);
    }
    else {
      var lines = result.stdout.split(EOL);
      var idx = 0;
      var latest = null;

      // Find the list of recent versions
      while (idx < lines.length && lines[idx++] !== 'Recent versions:') ;

      // Get the last line in this list
      while (idx < lines.length && lines[idx] !== '') {
        latest = lines[idx];
        idx++;
      }

      // If we have a line, get the version and test
      if (latest !== null) {
        latestVersion = latest.split(' ').filter(function(item) { return item != ''; })[0];
        if (PackageVersion.lessThan(version, latestVersion)) {
          console.log(packageName + ' version ' + latestVersion + ' is available (' + version + ' currently specified)');
          return true;
        }
      }
    }
  }

  return false;
}

// api object to be passed to the Package.onUse function

var api = {

  // Define empty functions for parts of the API that don't interest us

  versionsFrom: function() {},
  imply: function() {},
  export: function() {},
  addFiles: function() {},
  add_files: function() {},

  // The `use` function is called with the list of packages that we need to check

  use: function(packageConstraints) {

    // The user can either pass an array or a string, we need to handle both cases

    var updatesAvailable = false
    if (packageConstraints.constructor === Array) {
      packageConstraints.forEach(function(packageConstraint) {
        if (checkPackage(packageConstraint))
          updatesAvailable = true;
      });
    }
    else {
      if (checkPackage(packageConstraints))
        updatesAvailable = true;
    }

    // Insert a blank link between packages if there were updates displayed

    if (updatesAvailable)
      console.log();

  }

}

// We need to export our own Package object that will be called by the user's package.js script

var Package = {

  describe: function(description) {
    console.log("Checking package " + description.name + '...');
  },

  onUse: function(fn) {
    fn(api);
  },

  onTest: function(fn) {
    fn(api);
  },

  registerBuildPlugin: function(description) {
    api.use(description.use);
  }

}

module.exports = Package;
<|endoftext|>


<commit_before>Package.describe({
  name: "cultofcoders:grapher",
  version: "1.3.18",
  // Brief, one-line summary of the package.
  summary: "Grapher is a data fetching layer on top of Meteor",
  // URL to the Git repository containing the source code for this package.
  git: "https://github.com/cult-of-coders/grapher",
  // By default, Meteor will default to using README.md for documentation.
  // To avoid submitting documentation, set this field to null.
  documentation: "README.md"
});

Npm.depends({
  sift: "3.2.6",
  "dot-object": "1.5.4",
  "lodash.clonedeep": "4.5.0",
  "deep-extend": "0.5.0"
});

Package.onUse(function(api) {
  api.versionsFrom("1.3");

  var packages = [
    "ecmascript",
    "underscore",
    "promise",
    "check",
    "reactive-var",
    "mongo",
    "matb33:collection-hooks@0.8.4",
    "reywood:publish-composite@1.5.2",
    "dburles:mongo-collection-instances@0.3.5",
    "peerlibrary:subscription-scope@0.5.0",
    "herteby:denormalize@0.6.5"
  ];

  api.use(packages);

  api.mainModule("main.client.js", "client");
  api.mainModule("main.server.js", "server");
});

Package.onTest(function(api) {
  api.use("cultofcoders:grapher");

  var packages = [
    "random",
    "ecmascript",
    "underscore",
    "matb33:collection-hooks@0.8.4",
    "reywood:publish-composite@1.5.2",
    "dburles:mongo-collection-instances@0.3.5",
    "herteby:denormalize@0.6.5",
    "mongo"
  ];

  api.use(packages);
  api.use("tracker");

  api.use(["meteortesting:mocha"]);

  // LINKS
  api.addFiles("lib/links/tests/main.js", "server");
  api.addFiles("lib/links/tests/client.test.js", "client");

  // EXPOSURE
  api.addFiles("lib/exposure/testing/server.js", "server");
  api.addFiles("lib/exposure/testing/client.js", "client");

  // QUERY
  api.addFiles("lib/query/testing/bootstrap/index.js");

  // When you play with tests you should comment this to make tests go faster.
  api.addFiles("lib/query/testing/bootstrap/fixtures.js", "server");

  api.addFiles("lib/query/testing/server.test.js", "server");
  api.addFiles("lib/query/testing/client.test.js", "client");

  // NAMED QUERY
  api.addFiles("lib/namedQuery/testing/bootstrap/both.js");
  api.addFiles("lib/namedQuery/testing/bootstrap/client.js", "client");
  api.addFiles("lib/namedQuery/testing/bootstrap/server.js", "server");

  // REACTIVE COUNTS
  api.addFiles("lib/query/counts/testing/server.test.js", "server");
  api.addFiles("lib/query/counts/testing/client.test.js", "client");

  // NAMED QUERIES
  api.addFiles("lib/namedQuery/testing/server.test.js", "server");
  api.addFiles("lib/namedQuery/testing/client.test.js", "client");

  // GRAPHQL
  api.addFiles("lib/graphql/testing/index.js", "server");
});
<commit_msg>Bump to 1.3.19<commit_after>Package.describe({
  name: "cultofcoders:grapher",
  version: "1.3.19",
  // Brief, one-line summary of the package.
  summary: "Grapher is a data fetching layer on top of Meteor",
  // URL to the Git repository containing the source code for this package.
  git: "https://github.com/cult-of-coders/grapher",
  // By default, Meteor will default to using README.md for documentation.
  // To avoid submitting documentation, set this field to null.
  documentation: "README.md"
});

Npm.depends({
  sift: "3.2.6",
  "dot-object": "1.5.4",
  "lodash.clonedeep": "4.5.0",
  "deep-extend": "0.5.0"
});

Package.onUse(function(api) {
  api.versionsFrom("1.3");

  var packages = [
    "ecmascript",
    "underscore",
    "promise",
    "check",
    "reactive-var",
    "mongo",
    "matb33:collection-hooks@0.8.4",
    "reywood:publish-composite@1.5.2",
    "dburles:mongo-collection-instances@0.3.5",
    "peerlibrary:subscription-scope@0.5.0",
    "herteby:denormalize@0.6.5"
  ];

  api.use(packages);

  api.mainModule("main.client.js", "client");
  api.mainModule("main.server.js", "server");
});

Package.onTest(function(api) {
  api.use("cultofcoders:grapher");

  var packages = [
    "random",
    "ecmascript",
    "underscore",
    "matb33:collection-hooks@0.8.4",
    "reywood:publish-composite@1.5.2",
    "dburles:mongo-collection-instances@0.3.5",
    "herteby:denormalize@0.6.5",
    "mongo"
  ];

  api.use(packages);
  api.use("tracker");

  api.use(["meteortesting:mocha"]);

  // LINKS
  api.addFiles("lib/links/tests/main.js", "server");
  api.addFiles("lib/links/tests/client.test.js", "client");

  // EXPOSURE
  api.addFiles("lib/exposure/testing/server.js", "server");
  api.addFiles("lib/exposure/testing/client.js", "client");

  // QUERY
  api.addFiles("lib/query/testing/bootstrap/index.js");

  // When you play with tests you should comment this to make tests go faster.
  api.addFiles("lib/query/testing/bootstrap/fixtures.js", "server");

  api.addFiles("lib/query/testing/server.test.js", "server");
  api.addFiles("lib/query/testing/client.test.js", "client");

  // NAMED QUERY
  api.addFiles("lib/namedQuery/testing/bootstrap/both.js");
  api.addFiles("lib/namedQuery/testing/bootstrap/client.js", "client");
  api.addFiles("lib/namedQuery/testing/bootstrap/server.js", "server");

  // REACTIVE COUNTS
  api.addFiles("lib/query/counts/testing/server.test.js", "server");
  api.addFiles("lib/query/counts/testing/client.test.js", "client");

  // NAMED QUERIES
  api.addFiles("lib/namedQuery/testing/server.test.js", "server");
  api.addFiles("lib/namedQuery/testing/client.test.js", "client");

  // GRAPHQL
  api.addFiles("lib/graphql/testing/index.js", "server");
});
<|endoftext|>


<commit_before>Package.describe({
   name: 'nblazer:casperjs',
   summary: 'CasperJS end to end test integration with velocity.',
   version: '0.1.6',
   git: 'https://github.com/blazer82/meteor-casperjs.git',
   debugOnly: true
});

Npm.depends({
   glob: '4.0.6',
   xml2js: '0.4.4'
});

Package.onUse(function(api) {
   api.versionsFrom('METEOR@1.0');
   api.use([
      'velocity:core@0.4.1',
      'velocity:shim@0.0.3',
      'coffeescript'
   ], 'server');
   api.use("velocity:node-soft-mirror@0.2.6", { unordered: true });
   api.addFiles('nblazer:casperjs.coffee', 'server');
   api.addFiles('sample-tests/sampleTest.coffee', 'server', {isAsset: true});
});

Package.onTest(function(api) {
   api.use('tinytest');
   api.use('nblazer:casperjs');
   api.addFiles('nblazer:casperjs-tests.js');
});
<commit_msg>Follows update instructions per https://github.com/meteor-velocity/velocity/issues/96#issuecomment-90531211<commit_after>Package.describe({
   name: 'nblazer:casperjs',
   summary: 'CasperJS end to end test integration with velocity.',
   version: '0.1.6',
   git: 'https://github.com/blazer82/meteor-casperjs.git',
   debugOnly: true
});

Npm.depends({
   glob: '4.0.6',
   xml2js: '0.4.4'
});

Package.onUse(function(api) {
   api.versionsFrom('METEOR@1.0');
   api.use([
      'velocity:core@0.6.1',
      'velocity:shim@0.0.3',
      'coffeescript'
   ], 'server');
   api.addFiles('nblazer:casperjs.coffee', 'server');
   api.addFiles('sample-tests/sampleTest.coffee', 'server', {isAsset: true});
});

Package.onTest(function(api) {
   api.use('tinytest');
   api.use('nblazer:casperjs');
   api.addFiles('nblazer:casperjs-tests.js');
});
<|endoftext|>


<commit_before>Package.describe({
  name: 'jagi:astronomy-validators',
  version: '0.10.10',
  summary: 'Validators for Meteor Astronomy',
  git: 'https://github.com/jagi/meteor-astronomy-validators.git'
});

Package.onUse(function(api) {
  api.versionsFrom('1.1.0.2');

  api.use('jagi:astronomy@0.10.5');
  api.use('jagi:reactive-map@0.2.1');
  api.use('underscore');
  api.use('ui');
  api.use('check');

  api.imply('jagi:astronomy');

  // Module.
  api.addFiles([
    'lib/module/global.js',
    'lib/module/validation_error.js',
    'lib/module/validator.js',
    'lib/module/field_validator.js',
    'lib/module/create_validator.js',
    'lib/module/validate.js',
    'lib/module/get_error.js',
    'lib/module/ejson.js',
    'lib/module/init_definition.js',
    'lib/module/init_schema.js',
    'lib/module/init_class.js'
  ], ['client', 'server']);

  // Type validators.
  api.addFiles([
    'lib/validators/type/string.js',
    'lib/validators/type/number.js',
    'lib/validators/type/boolean.js',
    'lib/validators/type/array.js',
    'lib/validators/type/object.js',
    'lib/validators/type/date.js',
    'lib/validators/type/email.js'
  ], ['client', 'server']);

  // Existence validators.
  api.addFiles([
    'lib/validators/existence/required.js',
    'lib/validators/existence/null.js',
    'lib/validators/existence/not_null.js',
  ], ['client', 'server']);

  // Size validators.
  api.addFiles([
    'lib/validators/size/length.js',
    'lib/validators/size/min_length.js',
    'lib/validators/size/max_length.js',
    'lib/validators/size/gt.js',
    'lib/validators/size/gte.js',
    'lib/validators/size/lt.js',
    'lib/validators/size/lte.js'
  ], ['client', 'server']);

  // Comparison validators.
  api.addFiles([
    'lib/validators/comparison/choice.js',
    'lib/validators/comparison/unique.js',
    'lib/validators/comparison/equal.js',
    'lib/validators/comparison/equal_to.js',
    'lib/validators/comparison/regexp.js'
  ], ['client', 'server']);

  // Logical validators.
  api.addFiles([
    'lib/validators/logical/and.js',
    'lib/validators/logical/or.js',
    'lib/validators/logical/if.js',
    'lib/validators/logical/switch.js'
  ], ['client', 'server']);

  // Embeded validators.
  api.addFiles([
    'lib/validators/nested/every.js',
    'lib/validators/nested/has.js',
    'lib/validators/nested/contains.js'
  ], ['client', 'server']);

  api.export(['Validators'], ['client', 'server']);
});
<commit_msg>Bump version to 1.0.0-rc.1<commit_after>Package.describe({
  name: 'jagi:astronomy-validators',
  version: '1.0.0-rc.1',
  summary: 'Validators for Meteor Astronomy',
  git: 'https://github.com/jagi/meteor-astronomy-validators.git'
});

Package.onUse(function(api) {
  api.versionsFrom('1.1.0.2');

  api.use('jagi:astronomy@1.0.0-rc.1');
  api.use('jagi:reactive-map@0.2.2');
  api.use('underscore');
  api.use('ui');
  api.use('check');

  api.imply('jagi:astronomy');

  // Module.
  api.addFiles([
    'lib/module/global.js',
    'lib/module/validation_error.js',
    'lib/module/validator.js',
    'lib/module/field_validator.js',
    'lib/module/create_validator.js',
    'lib/module/validate.js',
    'lib/module/get_error.js',
    'lib/module/ejson.js',
    'lib/module/init_definition.js',
    'lib/module/init_schema.js',
    'lib/module/init_class.js'
  ], ['client', 'server']);

  // Type validators.
  api.addFiles([
    'lib/validators/type/string.js',
    'lib/validators/type/number.js',
    'lib/validators/type/boolean.js',
    'lib/validators/type/array.js',
    'lib/validators/type/object.js',
    'lib/validators/type/date.js',
    'lib/validators/type/email.js'
  ], ['client', 'server']);

  // Existence validators.
  api.addFiles([
    'lib/validators/existence/required.js',
    'lib/validators/existence/null.js',
    'lib/validators/existence/not_null.js',
  ], ['client', 'server']);

  // Size validators.
  api.addFiles([
    'lib/validators/size/length.js',
    'lib/validators/size/min_length.js',
    'lib/validators/size/max_length.js',
    'lib/validators/size/gt.js',
    'lib/validators/size/gte.js',
    'lib/validators/size/lt.js',
    'lib/validators/size/lte.js'
  ], ['client', 'server']);

  // Comparison validators.
  api.addFiles([
    'lib/validators/comparison/choice.js',
    'lib/validators/comparison/unique.js',
    'lib/validators/comparison/equal.js',
    'lib/validators/comparison/equal_to.js',
    'lib/validators/comparison/regexp.js'
  ], ['client', 'server']);

  // Logical validators.
  api.addFiles([
    'lib/validators/logical/and.js',
    'lib/validators/logical/or.js',
    'lib/validators/logical/if.js',
    'lib/validators/logical/switch.js'
  ], ['client', 'server']);

  // Embeded validators.
  api.addFiles([
    'lib/validators/nested/every.js',
    'lib/validators/nested/has.js',
    'lib/validators/nested/contains.js'
  ], ['client', 'server']);

  api.export(['Validators'], ['client', 'server']);
});
<|endoftext|>


<commit_before>Package.describe({
  summary: 'Routing for Meteor'
});

Package.on_use(function (api) {

  Npm.depends({connect: "2.7.10"});

  api.use([
    'meteor',
    'deps',
    'underscore',
    'reactive-dict'
  ], ['client', 'server']);

  api.use([
    'templating',
    'handlebars',
    'universal-events'
  ], 'client');

  api.add_files([
    'lib/router_utils.js',
    'lib/route_path.js',
    'lib/route_context.js',
    'lib/route.js',
    'lib/router.js'
  ], ['client', 'server']);

  api.add_files([
    'lib/client/location.js',
    'lib/client/yield_partials_dict.js',
    'lib/client/client_router.js',
    'lib/client/default_layout.html',
    'lib/client/route_controller.js',
    'lib/client/helpers.js'
  ], 'client');

  /*
   * All kinds of breaking changes due to linker branch merge
   * so commenting this out for now
  api.add_files([
    'lib/server/route_controller.js',
    'lib/server/server_router.js'
  ], 'server');
  */
});

Package.on_test(function (api) {
  api.use([
    'iron-router',
    'tinytest',
    'test-helpers'
  ], ['client']);

  api.add_files([
    'test/test_helpers.js',
    'test/router_utils_test.js',
    'test/route_path_test.js',
    'test/route_context_test.js',
    'test/route_test.js',
    'test/router_test.js'
  ], ['client']);

  /*
   * XXX removing server tests for now
  api.add_files([
    'test/server/route_controller_test.js',
    'test/server/server_router_test.js',
  ], 'server');
  */
});
<commit_msg>Add EJSON dependency for package.<commit_after>Package.describe({
  summary: 'Routing for Meteor'
});

Package.on_use(function (api) {

  Npm.depends({connect: "2.7.10"});

  api.use([
    'meteor',
    'deps',
    'underscore',
    'ejson'
  ], ['client', 'server']);

  api.use([
    'templating',
    'handlebars',
    'universal-events'
  ], 'client');

  api.add_files([
    'lib/router_utils.js',
    'lib/route_path.js',
    'lib/route_context.js',
    'lib/route.js',
    'lib/router.js'
  ], ['client', 'server']);

  api.add_files([
    'lib/client/location.js',
    'lib/client/yield_partials_dict.js',
    'lib/client/client_router.js',
    'lib/client/default_layout.html',
    'lib/client/route_controller.js',
    'lib/client/helpers.js'
  ], 'client');

  /*
   * All kinds of breaking changes due to linker branch merge
   * so commenting this out for now
  api.add_files([
    'lib/server/route_controller.js',
    'lib/server/server_router.js'
  ], 'server');
  */
});

Package.on_test(function (api) {
  api.use([
    'iron-router',
    'tinytest',
    'test-helpers'
  ], ['client']);

  api.add_files([
    'test/test_helpers.js',
    'test/router_utils_test.js',
    'test/route_path_test.js',
    'test/route_context_test.js',
    'test/route_test.js',
    'test/router_test.js'
  ], ['client']);

  /*
   * XXX removing server tests for now
  api.add_files([
    'test/server/route_controller_test.js',
    'test/server/server_router_test.js',
  ], 'server');
  */
});
<|endoftext|>


<commit_before>Package.describe({
  summary: 'Accounts Templates styled for Semantic UI.',
  version: '1.12.2',
  name: 'useraccounts:semantic-ui',
  git: 'https://github.com/meteor-useraccounts/semantic-ui.git',
});

Package.on_use(function(api, where) {
  api.versionsFrom('METEOR@1.0');

  api.use([
    'templating',
    'underscore',
  ], 'client');

  api.use([
    'useraccounts:core',
  ], ['client', 'server']);

  // Requires all routing packages loads before this asking for weak dependencies.
  api.use('useraccounts:flow-routing@1.12.1', ['client', 'server'], {weak: true});
  api.use('useraccounts:iron-routing@1.12.1', ['client', 'server'], {weak: true});

  api.imply([
    'useraccounts:core@1.12.2',
  ], ['client', 'server']);

  api.add_files([
    'lib/at_error.html',
    'lib/at_error.js',
    'lib/at_form.html',
    'lib/at_form.js',
    'lib/at_input.html',
    'lib/at_input.js',
    'lib/at_message.html',
    'lib/at_message.js',
    'lib/at_nav_button.html',
    'lib/at_nav_button.js',
    'lib/at_oauth.html',
    'lib/at_oauth.js',
    'lib/at_pwd_form.html',
    'lib/at_pwd_form.js',
    'lib/at_pwd_form_btn.html',
    'lib/at_pwd_form_btn.js',
    'lib/at_pwd_link.html',
    'lib/at_pwd_link.js',
    'lib/at_reCaptcha.html',
    'lib/at_reCaptcha.js',
    'lib/at_result.html',
    'lib/at_result.js',
    'lib/at_sep.html',
    'lib/at_sep.js',
    'lib/at_signin_link.html',
    'lib/at_signin_link.js',
    'lib/at_signup_link.html',
    'lib/at_signup_link.js',
    'lib/at_social.html',
    'lib/at_social.js',
    'lib/at_terms_link.html',
    'lib/at_terms_link.js',
    'lib/at_resend_verification_email_link.html',
    'lib/at_resend_verification_email_link.js',
    'lib/at_title.html',
    'lib/at_title.js',
    'lib/full_page_at_form.html',
    'lib/at_semantic-ui.css',
  ], ['client']);
});

Package.on_test(function(api) {
  api.use([
    'useraccounts:semantic-ui',
    'useraccounts:core@1.12.2',
  ]);

  api.use([
    'accounts-password',
    'tinytest',
    'test-helpers'
  ], ['client', 'server']);

  api.add_files([
    'tests/tests.js'
  ], ['client', 'server']);
});
<commit_msg>patch release - Bump to version 1.12.3<commit_after>Package.describe({
  summary: 'Accounts Templates styled for Semantic UI.',
  version: '1.12.3',
  name: 'useraccounts:semantic-ui',
  git: 'https://github.com/meteor-useraccounts/semantic-ui.git',
});

Package.on_use(function(api, where) {
  api.versionsFrom('METEOR@1.0');

  api.use([
    'templating',
    'underscore',
  ], 'client');

  api.use([
    'useraccounts:core',
  ], ['client', 'server']);

  // Requires all routing packages loads before this asking for weak dependencies.
  api.use('useraccounts:flow-routing@1.12.1', ['client', 'server'], {weak: true});
  api.use('useraccounts:iron-routing@1.12.1', ['client', 'server'], {weak: true});

  api.imply([
    'useraccounts:core@1.12.3',
  ], ['client', 'server']);

  api.add_files([
    'lib/at_error.html',
    'lib/at_error.js',
    'lib/at_form.html',
    'lib/at_form.js',
    'lib/at_input.html',
    'lib/at_input.js',
    'lib/at_message.html',
    'lib/at_message.js',
    'lib/at_nav_button.html',
    'lib/at_nav_button.js',
    'lib/at_oauth.html',
    'lib/at_oauth.js',
    'lib/at_pwd_form.html',
    'lib/at_pwd_form.js',
    'lib/at_pwd_form_btn.html',
    'lib/at_pwd_form_btn.js',
    'lib/at_pwd_link.html',
    'lib/at_pwd_link.js',
    'lib/at_reCaptcha.html',
    'lib/at_reCaptcha.js',
    'lib/at_result.html',
    'lib/at_result.js',
    'lib/at_sep.html',
    'lib/at_sep.js',
    'lib/at_signin_link.html',
    'lib/at_signin_link.js',
    'lib/at_signup_link.html',
    'lib/at_signup_link.js',
    'lib/at_social.html',
    'lib/at_social.js',
    'lib/at_terms_link.html',
    'lib/at_terms_link.js',
    'lib/at_resend_verification_email_link.html',
    'lib/at_resend_verification_email_link.js',
    'lib/at_title.html',
    'lib/at_title.js',
    'lib/full_page_at_form.html',
    'lib/at_semantic-ui.css',
  ], ['client']);
});

Package.on_test(function(api) {
  api.use([
    'useraccounts:semantic-ui',
    'useraccounts:core@1.12.3',
  ]);

  api.use([
    'accounts-password',
    'tinytest',
    'test-helpers'
  ], ['client', 'server']);

  api.add_files([
    'tests/tests.js'
  ], ['client', 'server']);
});
<|endoftext|>


<commit_before>Package.describe({
    summary: "Make signin and signout their own pages with routes."
});

Package.on_use(function(api) {

  // CLIENT
  api.use([
    'deps',
    'service-configuration',
    'accounts-base',
    'underscore',
    'templating',
    'handlebars',
    'session',
    'coffeescript',
    'simple-form',
    'less',
    'sha']
  , 'client');

  api.add_files([
    'client/entry.coffee',
    'client/entry.less',
    'client/helpers.coffee',
    'client/views/signIn/signIn.html',
    'client/views/signIn/signIn.coffee',
    'client/views/signUp/signUp.html',
    'client/views/signUp/signUp.coffee',
    'client/views/signUp/extraSignUpFields.html',
    'client/views/signUp/extraSignUpFields.coffee',
    'client/views/forgotPassword/forgotPassword.html',
    'client/views/forgotPassword/forgotPassword.coffee',
    'client/views/resetPassword/resetPassword.html',
    'client/views/resetPassword/resetPassword.coffee',
    'client/views/social/social.html',
    'client/views/social/social.coffee',
    'client/views/error/error.html',
    'client/views/error/error.coffee',
    'client/views/accountButtons/accountButtons.html',
    'client/views/accountButtons/_wrapLinks.html',
    'client/views/accountButtons/signedIn.html',
    'client/views/accountButtons/accountButtons.coffee',
    'client/t9n/english.coffee',
    'client/t9n/french.coffee',
    'client/t9n/german.coffee',
    'client/t9n/italian.coffee',
    'client/t9n/polish.coffee',
    'client/t9n/spanish.coffee',
    'client/t9n/swedish.coffee',
    'client/t9n/portuguese.coffee',
    'client/t9n/slovene.coffee',
    'client/t9n/russian.coffee',
    'client/t9n/arabic.coffee'
  ], 'client');

  // SERVER
  api.use([
    'deps',
    'service-configuration',
    'accounts-password',
    'accounts-base',
    'underscore',
    'coffeescript'
  ], 'server');

  api.add_files(['server/entry.coffee'], 'server');

  // CLIENT and SERVER
  api.imply('accounts-base', ['client', 'server']);
  api.imply('accounts-password', ['client', 'server']);
  api.export('AccountsEntry', ['client', 'server']);
  api.use('iron-router', ['client', 'server']);
  api.use(['accounts-t9n'], ['client', 'server']);
  api.add_files(['shared/router.coffee'], ['client', 'server']);

});

Package.on_test(function (api) {
  api.use(['tinytest',
            'underscore',
            'handlebars',
            'test-helpers',
            'templating',
            'mongo-livedata',
            'coffeescript',
            'simple-form',
            'iron-router']);
  api.use('accounts-entry');

  api.add_files(['tests/route.coffee', 'tests/client.html', 'tests/client.coffee'], 'client');
})
<commit_msg>Added Hebrew Translation<commit_after>Package.describe({
    summary: "Make signin and signout their own pages with routes."
});

Package.on_use(function(api) {

  // CLIENT
  api.use([
    'deps',
    'service-configuration',
    'accounts-base',
    'underscore',
    'templating',
    'handlebars',
    'session',
    'coffeescript',
    'simple-form',
    'less',
    'sha']
  , 'client');

  api.add_files([
    'client/entry.coffee',
    'client/entry.less',
    'client/helpers.coffee',
    'client/views/signIn/signIn.html',
    'client/views/signIn/signIn.coffee',
    'client/views/signUp/signUp.html',
    'client/views/signUp/signUp.coffee',
    'client/views/signUp/extraSignUpFields.html',
    'client/views/signUp/extraSignUpFields.coffee',
    'client/views/forgotPassword/forgotPassword.html',
    'client/views/forgotPassword/forgotPassword.coffee',
    'client/views/resetPassword/resetPassword.html',
    'client/views/resetPassword/resetPassword.coffee',
    'client/views/social/social.html',
    'client/views/social/social.coffee',
    'client/views/error/error.html',
    'client/views/error/error.coffee',
    'client/views/accountButtons/accountButtons.html',
    'client/views/accountButtons/_wrapLinks.html',
    'client/views/accountButtons/signedIn.html',
    'client/views/accountButtons/accountButtons.coffee',
    'client/t9n/english.coffee',
    'client/t9n/french.coffee',
    'client/t9n/german.coffee',
    'client/t9n/italian.coffee',
    'client/t9n/polish.coffee',
    'client/t9n/spanish.coffee',
    'client/t9n/swedish.coffee',
    'client/t9n/portuguese.coffee',
    'client/t9n/slovene.coffee',
    'client/t9n/russian.coffee',
    'client/t9n/arabic.coffee',
    'client/t9n/hebrew.coffee'
  ], 'client');

  // SERVER
  api.use([
    'deps',
    'service-configuration',
    'accounts-password',
    'accounts-base',
    'underscore',
    'coffeescript'
  ], 'server');

  api.add_files(['server/entry.coffee'], 'server');

  // CLIENT and SERVER
  api.imply('accounts-base', ['client', 'server']);
  api.imply('accounts-password', ['client', 'server']);
  api.export('AccountsEntry', ['client', 'server']);
  api.use('iron-router', ['client', 'server']);
  api.use(['accounts-t9n'], ['client', 'server']);
  api.add_files(['shared/router.coffee'], ['client', 'server']);

});

Package.on_test(function (api) {
  api.use(['tinytest',
            'underscore',
            'handlebars',
            'test-helpers',
            'templating',
            'mongo-livedata',
            'coffeescript',
            'simple-form',
            'iron-router']);
  api.use('accounts-entry');

  api.add_files(['tests/route.coffee', 'tests/client.html', 'tests/client.coffee'], 'client');
})
<|endoftext|>


<commit_before>Package.describe({
    summary: "Send e-mails with attachments.",
    version: "1.0.3",
    git: "www.github.com/priyadarshy/email-att"
});

Package.onUse(function(api) {
    api.versionsFrom('METEOR@0.9.2.1');
    api.addFiles('ashutosh:email-att.js');
});

Package.onTest(function(api) {
    api.use('tinytest');
    api.use('ashutosh:email-att');
    api.addFiles('ashutosh:email-att-tests.js');
});

Npm.depends({
    "simplesmtp": "0.3.10",
    "stream-buffers": "0.2.5",
    "mailcomposer": "0.1.15"
});
<commit_msg>Bump version number.<commit_after>Package.describe({
    summary: "Send e-mails with attachments.",
    version: "1.0.4",
    git: "www.github.com/priyadarshy/email-att"
});

Package.onUse(function(api) {
    api.versionsFrom('METEOR@0.9.2.1');
    api.addFiles('ashutosh:email-att.js');
});

Package.onTest(function(api) {
    api.use('tinytest');
    api.use('ashutosh:email-att');
    api.addFiles('ashutosh:email-att-tests.js');
});

Npm.depends({
    "simplesmtp": "0.3.10",
    "stream-buffers": "0.2.5",
    "mailcomposer": "0.1.15"
});
<|endoftext|>


<commit_before>Package.describe({
    summary: "Meteor sign up and sign in templates core package.",
    version: "1.1.1",
    name: "useraccounts:core",
    git: "https://github.com/meteor-useraccounts/core.git",
});

Package.on_use(function(api) {
    api.versionsFrom("METEOR@1.0");

    api.use([
        "accounts-base",
        "check",
        "underscore",
        "iron:router",
        "reactive-var",
    ], ["client", "server"]);

    api.use([
        "blaze",
        "reactive-dict",
        "sha",
    ], "client");

    api.imply([
        "accounts-base",
        "softwarerero:accounts-t9n@1.0.2",
        "iron:router@1.0.0",
    ], ["client", "server"]);

    api.imply([
        "templating",
    ], ["client"]);

    api.add_files([
        "lib/field.js",
        "lib/core.js",
        "lib/server.js",
        "lib/methods.js",
    ], ["server"]);

    api.add_files([
        "lib/utils.js",
        "lib/field.js",
        "lib/core.js",
        "lib/client.js",
        "lib/templates_helpers/at_error.js",
        "lib/templates_helpers/at_form.js",
        "lib/templates_helpers/at_input.js",
        "lib/templates_helpers/at_nav_button.js",
        "lib/templates_helpers/at_oauth.js",
        "lib/templates_helpers/at_pwd_form.js",
        "lib/templates_helpers/at_pwd_form_btn.js",
        "lib/templates_helpers/at_pwd_link.js",
        "lib/templates_helpers/at_result.js",
        "lib/templates_helpers/at_sep.js",
        "lib/templates_helpers/at_signin_link.js",
        "lib/templates_helpers/at_signup_link.js",
        "lib/templates_helpers/at_social.js",
        "lib/templates_helpers/at_terms_link.js",
        "lib/templates_helpers/at_title.js",
        "lib/methods.js",
    ], ["client"]);

    api.export([
        "AccountsTemplates",
    ], ["client", "server"]);
});

Package.on_test(function(api) {
    api.use("useraccounts:core@1.1.1");

    api.use([
        'accounts-password',
        'tinytest',
        'test-helpers'
    ], ['client', 'server']);

    api.add_files([
        "tests/tests.js",
    ], ["client", "server"]);
});
<commit_msg>updated dep to iron:router@1.0.1<commit_after>Package.describe({
    summary: "Meteor sign up and sign in templates core package.",
    version: "1.1.1",
    name: "useraccounts:core",
    git: "https://github.com/meteor-useraccounts/core.git",
});

Package.on_use(function(api) {
    api.versionsFrom("METEOR@1.0");

    api.use([
        "accounts-base",
        "check",
        "underscore",
        "iron:router",
        "reactive-var",
    ], ["client", "server"]);

    api.use([
        "blaze",
        "reactive-dict",
        "sha",
    ], "client");

    api.imply([
        "accounts-base",
        "softwarerero:accounts-t9n@1.0.2",
        "iron:router@1.0.1",
    ], ["client", "server"]);

    api.imply([
        "templating",
    ], ["client"]);

    api.add_files([
        "lib/field.js",
        "lib/core.js",
        "lib/server.js",
        "lib/methods.js",
    ], ["server"]);

    api.add_files([
        "lib/utils.js",
        "lib/field.js",
        "lib/core.js",
        "lib/client.js",
        "lib/templates_helpers/at_error.js",
        "lib/templates_helpers/at_form.js",
        "lib/templates_helpers/at_input.js",
        "lib/templates_helpers/at_nav_button.js",
        "lib/templates_helpers/at_oauth.js",
        "lib/templates_helpers/at_pwd_form.js",
        "lib/templates_helpers/at_pwd_form_btn.js",
        "lib/templates_helpers/at_pwd_link.js",
        "lib/templates_helpers/at_result.js",
        "lib/templates_helpers/at_sep.js",
        "lib/templates_helpers/at_signin_link.js",
        "lib/templates_helpers/at_signup_link.js",
        "lib/templates_helpers/at_social.js",
        "lib/templates_helpers/at_terms_link.js",
        "lib/templates_helpers/at_title.js",
        "lib/methods.js",
    ], ["client"]);

    api.export([
        "AccountsTemplates",
    ], ["client", "server"]);
});

Package.on_test(function(api) {
    api.use("useraccounts:core@1.1.1");

    api.use([
        'accounts-password',
        'tinytest',
        'test-helpers'
    ], ['client', 'server']);

    api.add_files([
        "tests/tests.js",
    ], ["client", "server"]);
});
<|endoftext|>


<commit_before>Package.describe({
  name: 'packaging:autopublish-test',
  summary: 'Dummy package to test auto-publish with TravisCI. DO NOT USE!',
  version: '0.0.9',
  git: 'https://github.com/MeteorPackaging/autopublish-test.git'
});

Package.onUse(function(api) {
  "use strict";

  api.versionsFrom('1.0.1');
  api.addFiles('lib/main.js');
});

Package.onTest(function(api) {
  "use strict";

  api.use('tinytest');
  api.use('packaging:autopublish-test');
  api.addFiles('tests/main.js');
});
<commit_msg>wrong name -> new package<commit_after>Package.describe({
  name: 'packaging:autopublish-fake-test',
  summary: 'Dummy package to test auto-publish with TravisCI. DO NOT USE!',
  version: '0.0.9',
  git: 'https://github.com/MeteorPackaging/autopublish-test.git'
});

Package.onUse(function(api) {
  "use strict";

  api.versionsFrom('1.0.1');
  api.addFiles('lib/main.js');
});

Package.onTest(function(api) {
  "use strict";

  api.use('tinytest');
  api.use('packaging:autopublish-test');
  api.addFiles('tests/main.js');
});
<|endoftext|>


<commit_before>Package.describe({
  summary: 'Flow Components',
  version: '0.0.36',
  git: 'https://github.com/meteorhacks/flow-components',
  name: "meteorhacks:flow-components"
});

Package.onUse(function (api) {
  api.versionsFrom('1.0');
  api.use('blaze');
  api.use('templating');
  api.use('reactive-var');
  api.use('reactive-dict');
  api.use('underscore');
  api.use('raix:eventemitter@0.1.1');

  api.addFiles('lib/client/utils.js', 'client');
  api.addFiles('lib/client/action_hub.js', 'client');
  api.addFiles('lib/client/component.js', 'client');
  api.addFiles('lib/client/component_instance.js', 'client');
  api.addFiles('lib/client/api.js', 'client');
  api.addFiles('lib/client/lookup.js', 'client');
  api.addFiles('lib/client/render.js', 'client');
  api.export(['FlowComponents']);
});
<commit_msg>Bump versions<commit_after>Package.describe({
  summary: 'Flow Components',
  version: '0.0.37',
  git: 'https://github.com/meteorhacks/flow-components',
  name: "meteorhacks:flow-components"
});

Package.onUse(function (api) {
  api.versionsFrom('1.0');
  api.use('blaze');
  api.use('templating');
  api.use('reactive-var');
  api.use('reactive-dict');
  api.use('underscore');
  api.use('raix:eventemitter@0.1.1');

  api.addFiles('lib/client/utils.js', 'client');
  api.addFiles('lib/client/action_hub.js', 'client');
  api.addFiles('lib/client/component.js', 'client');
  api.addFiles('lib/client/component_instance.js', 'client');
  api.addFiles('lib/client/api.js', 'client');
  api.addFiles('lib/client/lookup.js', 'client');
  api.addFiles('lib/client/render.js', 'client');
  api.export(['FlowComponents']);
});
<|endoftext|>


<commit_before>
Package.describe({
    summary: "a simple tool to define/require modules with dependencies",
});

Package.on_use(function (api) {
    api.use('underscore', ['client', 'server']);
    api.add_files('require.js', ['client', 'server']);
});
<commit_msg>fixed package description<commit_after>
Package.describe({
    summary: "A simple tool to define/require modules with dependencies",
});

Package.on_use(function (api) {
    api.use('underscore', ['client', 'server']);
    api.add_files('require.js', ['client', 'server']);
});
<|endoftext|>


<commit_before>Package.describe({
  name: 'constellation:session',
  version: '0.4.6',
  summary: 'Session variable editor plugin for Constellation',
  git: 'https://github.com/JackAdams/constellation-session.git',
  documentation: 'README.md',
  debugOnly: true
});

Package.onUse(function(api) {
  api.versionsFrom('1.0');

  api.use(['templating','session','blaze','underscore','ejson','tracker','reactive-var','reactive-dict'], 'client');
  api.use('constellation:console@1.4.6', 'client');
  api.use('babrahams:editable-json@0.6.5', 'client');

  api.addFiles('session.css','client');
  api.addFiles('session.html','client');
  api.addFiles('session.js','client');

  api.imply('constellation:console');
});

Package.onTest(function(api) {
  api.use('tinytest');
});
<commit_msg>Updated dependencies<commit_after>Package.describe({
  name: 'constellation:session',
  version: '0.4.7',
  summary: 'Session variable editor plugin for Constellation',
  git: 'https://github.com/JackAdams/constellation-session.git',
  documentation: 'README.md',
  debugOnly: true
});

Package.onUse(function(api) {
  api.versionsFrom('1.0');

  api.use(['templating','session','blaze','underscore','ejson','tracker','reactive-var','reactive-dict'], 'client');
  api.use('constellation:console@1.4.7', 'client');
  api.use('babrahams:editable-json@0.6.5', 'client');

  api.addFiles('session.css','client');
  api.addFiles('session.html','client');
  api.addFiles('session.js','client');

  api.imply('constellation:console');
});

Package.onTest(function(api) {
  api.use('tinytest');
});
<|endoftext|>


<commit_before>Package.describe({
    summary: "Make signin and signout their own pages with routes."
});

Package.on_use(function(api) {

  // CLIENT
  api.use([
    'deps',
    'service-configuration',
    'accounts-base',
    'underscore',
    'templating',
    'handlebars',
    'spark',
    'session',
    'coffeescript',
    'less']
  , 'client');

  api.add_files([
    'client/entry.coffee',
    'client/entry.less',
    'client/helpers.coffee',
    'client/views/signIn/signIn.html',
    'client/views/signIn/signIn.coffee',
    'client/views/signUp/signUp.html',
    'client/views/signUp/signUp.coffee',
    'client/views/forgotPassword/forgotPassword.html',
    'client/views/forgotPassword/forgotPassword.coffee',
    'client/views/resetPassword/resetPassword.html',
    'client/views/resetPassword/resetPassword.coffee',
    'client/views/social/social.html',
    'client/views/social/social.coffee',
    'client/views/error/error.html',
    'client/views/error/error.coffee',
    'client/views/accountButtons/accountButtons.html',
    'client/views/accountButtons/accountButtons.coffee',
    'client/i18n/english.coffee',
    'client/i18n/spanish.coffee'
  ], 'client');

  // SERVER
  api.use([
    'deps',
    'service-configuration',
    'accounts-password',
    'accounts-base',
    'underscore',
    'coffeescript'
  ], 'server');

  api.add_files(['server/entry.coffee'], 'server');

  // CLIENT and SERVER
  api.imply('accounts-base', ['client', 'server']);
  api.export('AccountsEntry', ['client', 'server']);
  api.use('iron-router', ['client', 'server']);
  api.use('just-i18n', ['client']);
  api.use('headers', ['client']);
  api.add_files(['shared/router.coffee'], ['client', 'server']);

});
<commit_msg>Add german translation file to package<commit_after>Package.describe({
    summary: "Make signin and signout their own pages with routes."
});

Package.on_use(function(api) {

  // CLIENT
  api.use([
    'deps',
    'service-configuration',
    'accounts-base',
    'underscore',
    'templating',
    'handlebars',
    'spark',
    'session',
    'coffeescript',
    'less']
  , 'client');

  api.add_files([
    'client/entry.coffee',
    'client/entry.less',
    'client/helpers.coffee',
    'client/views/signIn/signIn.html',
    'client/views/signIn/signIn.coffee',
    'client/views/signUp/signUp.html',
    'client/views/signUp/signUp.coffee',
    'client/views/forgotPassword/forgotPassword.html',
    'client/views/forgotPassword/forgotPassword.coffee',
    'client/views/resetPassword/resetPassword.html',
    'client/views/resetPassword/resetPassword.coffee',
    'client/views/social/social.html',
    'client/views/social/social.coffee',
    'client/views/error/error.html',
    'client/views/error/error.coffee',
    'client/views/accountButtons/accountButtons.html',
    'client/views/accountButtons/accountButtons.coffee',
    'client/i18n/english.coffee',
    'client/i18n/german.coffee',
    'client/i18n/spanish.coffee'
  ], 'client');

  // SERVER
  api.use([
    'deps',
    'service-configuration',
    'accounts-password',
    'accounts-base',
    'underscore',
    'coffeescript'
  ], 'server');

  api.add_files(['server/entry.coffee'], 'server');

  // CLIENT and SERVER
  api.imply('accounts-base', ['client', 'server']);
  api.export('AccountsEntry', ['client', 'server']);
  api.use('iron-router', ['client', 'server']);
  api.use('just-i18n', ['client']);
  api.use('headers', ['client']);
  api.add_files(['shared/router.coffee'], ['client', 'server']);

});
<|endoftext|>


<commit_before>Package.describe({
  name: 'konecty:user-presence',
  summary: 'Track user status',
  version: '1.0.0',
  git: 'https://github.com/Konecty/meteor-user-presence'
});

Package.onUse(function(api) {
  api.versionsFrom('1.0.2.1');

  api.addFiles('server/server.js', ['server']);
  api.addFiles('server/monitor.js', ['server']);
  api.addFiles('client/client.js', ['client']);
  api.addFiles('common/common.js');
});

Package.onTest(function(api) {
  api.use('tinytest');
  api.use('konecty:user-presence');
  api.addFiles('konecty:user-presence-tests.js');
});
<commit_msg>Update version to 1.0.1<commit_after>Package.describe({
  name: 'konecty:user-presence',
  summary: 'Track user status',
  version: '1.0.1',
  git: 'https://github.com/Konecty/meteor-user-presence'
});

Package.onUse(function(api) {
  api.versionsFrom('1.0.2.1');

  api.addFiles('server/server.js', ['server']);
  api.addFiles('server/monitor.js', ['server']);
  api.addFiles('client/client.js', ['client']);
  api.addFiles('common/common.js');
});

Package.onTest(function(api) {
  api.use('tinytest');
  api.use('konecty:user-presence');
  api.addFiles('konecty:user-presence-tests.js');
});
<|endoftext|>


<commit_before>Package.describe({
    summary: "Meteor unit testing framework for packages",
    name: "spacejamio:munit",
    version: "2.0.0",
    git: "https://github.com/spacejamio/meteor-munit.git"
});

Package.onUse(function (api, where) {
  api.versionsFrom('0.9.3');

  api.use(["coffeescript", "underscore"]);
  api.use(["tinytest","test-helpers"]);
  api.use(["spacejamio:chai@1.9.2_1", "spacejamio:sinon@1.10.3_1"]);

  api.imply(["tinytest","test-helpers"]);
  api.imply(["spacejamio:chai@1.9.2_1", "spacejamio:sinon@1.10.3_1"]);

  api.addFiles("namespaces.js");
  api.addFiles("async_multi.js");
  api.addFiles("Munit.coffee");
  api.addFiles("Helpers.coffee");
  api.addFiles("Describe.coffee");

  api.export(['lvTestAsyncMulti']);
  api.export(['Munit']);
  api.export(['describe', 'it', 'beforeAll', 'beforeEach', 'afterEach', 'afterAll']);
});

Package.onTest(function(api) {
    api.use(["coffeescript", "spacejamio:munit@2.0.0"]);
    api.addFiles("tests/TDDTest.js");
    api.addFiles("tests/DescribeTest.js");
    api.addFiles("tests/TestRunnerTest.coffee");
    api.addFiles("tests/HelpersTest.coffee");
    api.addFiles("tests/DescribeTest.coffee");
});
<commit_msg>Fix merge conflict in .gitignore<commit_after>Package.describe({
    summary: "Meteor unit testing framework for packages",
    name: "spacejamio:munit",
    version: "2.0.1",
    git: "https://github.com/spacejamio/meteor-munit.git"
});

Package.onUse(function (api, where) {
  api.versionsFrom('0.9.0');

  api.use(["coffeescript", "underscore"]);
  api.use(["tinytest","test-helpers"]);
  api.use(["spacejamio:chai@1.9.2_2", "spacejamio:sinon@1.10.3_1"]);

  api.imply(["tinytest","test-helpers"]);
  api.imply(["spacejamio:chai@1.9.2_2", "spacejamio:sinon@1.10.3_1"]);

  api.addFiles("namespaces.js");
  api.addFiles("async_multi.js");
  api.addFiles("Munit.coffee");
  api.addFiles("Helpers.coffee");
  api.addFiles("Describe.coffee");

  api.export(['lvTestAsyncMulti']);
  api.export(['Munit']);
  api.export(['describe', 'it', 'beforeAll', 'beforeEach', 'afterEach', 'afterAll']);
});

Package.onTest(function(api) {
    api.use(["coffeescript", "spacejamio:munit"]);
    api.addFiles("tests/TDDTest.js");
    api.addFiles("tests/DescribeTest.js");
    api.addFiles("tests/TestRunnerTest.coffee");
    api.addFiles("tests/HelpersTest.coffee");
    api.addFiles("tests/DescribeTest.coffee");
});
<|endoftext|>


<commit_before>Package.describe({
    summary: "Accounts Templates styled for Twitter Bootstrap.",
    version: "0.9.4",
    name: "splendido:accounts-templates-bootstrap",
    git: "https://github.com/splendido/accounts-templates-bootstrap.git",
});

Package.on_use(function(api, where) {
    api.versionsFrom("METEOR@0.9.2.2");

    api.use([
        "less",
        "templating",
    ], "client");

    api.use([
        "splendido:accounts-templates-core",
    ], ["client", "server"]);

    api.imply([
        "splendido:accounts-templates-core@0.9.4",
    ], ["client", "server"]);

    api.add_files([
        "lib/at_error.html",
        "lib/at_error.js",
        "lib/at_form.html",
        "lib/at_form.js",
        "lib/at_input.html",
        "lib/at_input.js",
        "lib/at_oauth.html",
        "lib/at_oauth.js",
        "lib/at_pwd_form.html",
        "lib/at_pwd_form.js",
        "lib/at_pwd_form_btn.html",
        "lib/at_pwd_form_btn.js",
        "lib/at_pwd_link.html",
        "lib/at_pwd_link.js",
        "lib/at_result.html",
        "lib/at_result.js",
        "lib/at_sep.html",
        "lib/at_sep.js",
        "lib/at_signin_link.html",
        "lib/at_signin_link.js",
        "lib/at_signup_link.html",
        "lib/at_signup_link.js",
        "lib/at_social.html",
        "lib/at_social.js",
        "lib/at_terms_link.html",
        "lib/at_terms_link.js",
        "lib/at_title.html",
        "lib/at_title.js",
        "lib/full_page_at_form.html",
        "lib/at_bootstrap.less"
    ], ["client"]);
});

Package.on_test(function(api) {
    api.use([
        "splendido:accounts-templates-bootstrap",
        "splendido:accounts-templates-core@0.9.4",
    ]);

    api.use([
        "accounts-password",
        "tinytest",
        "test-helpers"
    ], ["client", "server"]);

    api.add_files([
        "tests/tests.js"
    ], ["client", "server"]);
});<commit_msg>patch release - Bump to version 0.9.5<commit_after>Package.describe({
    summary: "Accounts Templates styled for Twitter Bootstrap.",
    version: "0.9.5",
    name: "splendido:accounts-templates-bootstrap",
    git: "https://github.com/splendido/accounts-templates-bootstrap.git",
});

Package.on_use(function(api, where) {
    api.versionsFrom("METEOR@0.9.2.2");

    api.use([
        "less",
        "templating",
    ], "client");

    api.use([
        "splendido:accounts-templates-core",
    ], ["client", "server"]);

    api.imply([
        "splendido:accounts-templates-core@0.9.5",
    ], ["client", "server"]);

    api.add_files([
        "lib/at_error.html",
        "lib/at_error.js",
        "lib/at_form.html",
        "lib/at_form.js",
        "lib/at_input.html",
        "lib/at_input.js",
        "lib/at_oauth.html",
        "lib/at_oauth.js",
        "lib/at_pwd_form.html",
        "lib/at_pwd_form.js",
        "lib/at_pwd_form_btn.html",
        "lib/at_pwd_form_btn.js",
        "lib/at_pwd_link.html",
        "lib/at_pwd_link.js",
        "lib/at_result.html",
        "lib/at_result.js",
        "lib/at_sep.html",
        "lib/at_sep.js",
        "lib/at_signin_link.html",
        "lib/at_signin_link.js",
        "lib/at_signup_link.html",
        "lib/at_signup_link.js",
        "lib/at_social.html",
        "lib/at_social.js",
        "lib/at_terms_link.html",
        "lib/at_terms_link.js",
        "lib/at_title.html",
        "lib/at_title.js",
        "lib/full_page_at_form.html",
        "lib/at_bootstrap.less"
    ], ["client"]);
});

Package.on_test(function(api) {
    api.use([
        "splendido:accounts-templates-bootstrap",
        "splendido:accounts-templates-core@0.9.5",
    ]);

    api.use([
        "accounts-password",
        "tinytest",
        "test-helpers"
    ], ["client", "server"]);

    api.add_files([
        "tests/tests.js"
    ], ["client", "server"]);
});<|endoftext|>


<commit_before>Package.describe({
  name: 'angular2-now',
  version: '0.0.1',
  // Brief, one-line summary of the package.
  summary: 'Use Angular2 @Component syntax with Angular 1.x and Babel',
  // 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.1.0.2');
  api.addFiles('angular2-now.js', ['client']);
  api.export(['angular2']);
});

Package.onTest(function(api) {
  api.use('tinytest');
  api.use('angular2-now');
  api.addFiles('angular2-now-tests.js');
});
<commit_msg>renamed package to pbastowski:angular2-now<commit_after>Package.describe({
  name: 'pbastowski:angular2-now',
  version: '0.0.1',
  // Brief, one-line summary of the package.
  summary: 'Use Angular2 @Component syntax with Angular 1.x and Babel',
  // 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.1.0.2');
  api.addFiles('angular2-now.js', ['client']);
  api.export(['angular2']);
});

Package.onTest(function(api) {
  api.use('tinytest');
  api.use('pbastowski:angular2-now');
  api.addFiles('angular2-now-tests.js');
});
<|endoftext|>


<commit_before>Package.describe({
  name: 'matteodem:easy-search',
  summary: "Easy-to-use search with Blaze Components (+ Elastic Search support)",
  version: "1.4.9",
  git: "https://github.com/matteodem/meteor-easy-search.git"
});

Npm.depends({
  'elasticsearch': '2.2.0'
});

Package.on_use(function (api) {
  if (api.versionsFrom) {
    api.versionsFrom('METEOR@0.9.1');
  }

  api.use(['underscore', 'livedata', 'mongo-livedata', 'meteor',
    'meteor-platform', 'less'], ['client', 'server']);

  api.use(['templating', 'ui', 'jquery'], 'client');

  api.add_files(['lib/easy-search-common.js', 'lib/easy-search-convenience.js']);

  api.add_files([
    'lib/searchers/mongo.js',
    'lib/easy-search-client.js',
    'lib/components/easy-search-components.html',
    'lib/components/easy-search-components.js',
    'lib/components/easy-search-components.less'
  ], 'client');

  api.add_files([
    'lib/searchers/mongo.js',
    'lib/easy-search-server.js',
    'lib/searchers/elastic-search.js'
  ], 'server');

  api.export('EasySearch');
});

Package.on_test(function (api) {
  if (api.versionsFrom) {
    api.use('matteodem:easy-search');
    api.use('tinytest@1.0.0');
  } else {
    api.use(['tinytest', 'easy-search']);
  }

  api.add_files(['tests/javascript-api-tests.js']);
  api.add_files('tests/components-tests.js', 'client');
});
<commit_msg>Update version to 1.4.10 with bugfix for component search method<commit_after>Package.describe({
  name: 'matteodem:easy-search',
  summary: "Easy-to-use search with Blaze Components (+ Elastic Search support)",
  version: "1.4.10",
  git: "https://github.com/matteodem/meteor-easy-search.git"
});

Npm.depends({
  'elasticsearch': '2.2.0'
});

Package.on_use(function (api) {
  if (api.versionsFrom) {
    api.versionsFrom('METEOR@0.9.1');
  }

  api.use(['underscore', 'livedata', 'mongo-livedata', 'meteor',
    'meteor-platform', 'less'], ['client', 'server']);

  api.use(['templating', 'ui', 'jquery'], 'client');

  api.add_files(['lib/easy-search-common.js', 'lib/easy-search-convenience.js']);

  api.add_files([
    'lib/searchers/mongo.js',
    'lib/easy-search-client.js',
    'lib/components/easy-search-components.html',
    'lib/components/easy-search-components.js',
    'lib/components/easy-search-components.less'
  ], 'client');

  api.add_files([
    'lib/searchers/mongo.js',
    'lib/easy-search-server.js',
    'lib/searchers/elastic-search.js'
  ], 'server');

  api.export('EasySearch');
});

Package.on_test(function (api) {
  if (api.versionsFrom) {
    api.use('matteodem:easy-search');
    api.use('tinytest@1.0.0');
  } else {
    api.use(['tinytest', 'easy-search']);
  }

  api.add_files(['tests/javascript-api-tests.js']);
  api.add_files('tests/components-tests.js', 'client');
});
<|endoftext|>


<commit_before>Package.describe({
    summary: "Accounts Templates styled for Zurb Foundation.",
    version: "0.9.8",
    name: "splendido:accounts-templates-foundation",
    git: "https://github.com/splendido/accounts-templates-foundation.git",
});

Package.on_use(function(api, where) {
    api.versionsFrom("METEOR@0.9.2.2");

    api.use([
        "less",
        "templating",
    ], "client");

    api.use([
        "splendido:accounts-templates-core",
    ], ["client", "server"]);

    api.imply([
        "splendido:accounts-templates-core@0.9.8",
    ], ["client", "server"]);

    api.add_files([
        "lib/at_error.html",
        "lib/at_error.js",
        "lib/at_form.html",
        "lib/at_form.js",
        "lib/at_input.html",
        "lib/at_input.js",
        "lib/at_oauth.html",
        "lib/at_oauth.js",
        "lib/at_pwd_form.html",
        "lib/at_pwd_form.js",
        "lib/at_pwd_form_btn.html",
        "lib/at_pwd_form_btn.js",
        "lib/at_pwd_link.html",
        "lib/at_pwd_link.js",
        "lib/at_result.html",
        "lib/at_result.js",
        "lib/at_sep.html",
        "lib/at_sep.js",
        "lib/at_signin_link.html",
        "lib/at_signin_link.js",
        "lib/at_signup_link.html",
        "lib/at_signup_link.js",
        "lib/at_social.html",
        "lib/at_social.js",
        "lib/at_terms_link.html",
        "lib/at_terms_link.js",
        "lib/at_title.html",
        "lib/at_title.js",
        "lib/full_page_at_form.html",
        "lib/at_foundation.less"
    ], ["client"]);
});

Package.on_test(function(api) {
    api.use([
        "splendido:accounts-templates-foundation",
        "splendido:accounts-templates-core@0.9.8",
    ]);

    api.use([
        "accounts-password",
        "tinytest",
        "test-helpers"
    ], ["client", "server"]);

    api.add_files([
        "tests/tests.js"
    ], ["client", "server"]);
});<commit_msg>patch release - Bump to version 0.9.9<commit_after>Package.describe({
    summary: "Accounts Templates styled for Zurb Foundation.",
    version: "0.9.9",
    name: "splendido:accounts-templates-foundation",
    git: "https://github.com/splendido/accounts-templates-foundation.git",
});

Package.on_use(function(api, where) {
    api.versionsFrom("METEOR@0.9.2.2");

    api.use([
        "less",
        "templating",
    ], "client");

    api.use([
        "splendido:accounts-templates-core",
    ], ["client", "server"]);

    api.imply([
        "splendido:accounts-templates-core@0.9.9",
    ], ["client", "server"]);

    api.add_files([
        "lib/at_error.html",
        "lib/at_error.js",
        "lib/at_form.html",
        "lib/at_form.js",
        "lib/at_input.html",
        "lib/at_input.js",
        "lib/at_oauth.html",
        "lib/at_oauth.js",
        "lib/at_pwd_form.html",
        "lib/at_pwd_form.js",
        "lib/at_pwd_form_btn.html",
        "lib/at_pwd_form_btn.js",
        "lib/at_pwd_link.html",
        "lib/at_pwd_link.js",
        "lib/at_result.html",
        "lib/at_result.js",
        "lib/at_sep.html",
        "lib/at_sep.js",
        "lib/at_signin_link.html",
        "lib/at_signin_link.js",
        "lib/at_signup_link.html",
        "lib/at_signup_link.js",
        "lib/at_social.html",
        "lib/at_social.js",
        "lib/at_terms_link.html",
        "lib/at_terms_link.js",
        "lib/at_title.html",
        "lib/at_title.js",
        "lib/full_page_at_form.html",
        "lib/at_foundation.less"
    ], ["client"]);
});

Package.on_test(function(api) {
    api.use([
        "splendido:accounts-templates-foundation",
        "splendido:accounts-templates-core@0.9.9",
    ]);

    api.use([
        "accounts-password",
        "tinytest",
        "test-helpers"
    ], ["client", "server"]);

    api.add_files([
        "tests/tests.js"
    ], ["client", "server"]);
});<|endoftext|>


<commit_before>Package.describe({
	name: 'nathantreid:css-modules-js-compiler',
	version: '0.0.1',
	// Brief, one-line summary of the package.
	summary: 'JS 2015 processor for nathantreid:css-modules',
	// 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.2.0.1');
	api.use([
		'babel-compiler',
		'ecmascript',
		'nathantreid:css-modules-import-path-helpers'
	]);

	api.imply('babel-runtime');
	api.imply('ecmascript-runtime');
	api.imply('promise');

	api.addFiles([
		'js-compiler.js',
	]);

	api.export("ECMAScript");
	api.export("ImportPathHelpers");
	api.export("JsCompiler");
});
<commit_msg>Added reference to git repository<commit_after>Package.describe({
	name: 'nathantreid:css-modules-js-compiler',
	version: '0.0.1',
	// Brief, one-line summary of the package.
	summary: 'JS 2015 processor for nathantreid:css-modules',
	// URL to the Git repository containing the source code for this package.
	git: 'https://github.com/nathantreid/meteor-css-modules-js-compiler.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.2.0.1');
	api.use([
		'babel-compiler',
		'ecmascript',
		'nathantreid:css-modules-import-path-helpers'
	]);

	api.imply('babel-runtime');
	api.imply('ecmascript-runtime');
	api.imply('promise');

	api.addFiles([
		'js-compiler.js',
	]);

	api.export("ECMAScript");
	api.export("ImportPathHelpers");
	api.export("JsCompiler");
});
<|endoftext|>


<commit_before>Package.describe({
  name: 'percolate:google-api',
  summary: "A Meteor library to interact with Google's API",
  version: '1.0.3',
  git: 'https://github.com/percolatestudio/meteor-google-api'
});

Package.on_use(function (api, where) {
  if (api.versionsFrom) {
    api.versionsFrom('0.9.0');
    api.use(['http', 'livedata', 'google', 'mrt:q@1.0.1', 'accounts-base', 'underscore']);
  } else {
    api.use(['http', 'livedata', 'google', 'q', 'accounts-base', 'underscore']);
  }

  api.add_files(['utils.js', 'google-api-async.js'], ['client', 'server']);
  api.add_files(['google-api-methods.js'], ['server']);

  api.export('GoogleApi', ['client', 'server']);
});

Package.on_test(function (api) {
  api.use([
    'percolate:google-api',
    'tinytest',
    'http',
    'accounts-base',
    'service-configuration',
    'underscore']);

  api.add_files('google-api-tests.js', ['client', 'server']);
});
<commit_msg>rename package 'google' -> 'google-oauth' for Meteor 1.4.2.7 compatibility #40; version bump 1.0.3 -> 1.0.4<commit_after>Package.describe({
  name: 'percolate:google-api',
  summary: "A Meteor library to interact with Google's API",
  version: '1.0.4',
  git: 'https://github.com/percolatestudio/meteor-google-api'
});

Package.on_use(function (api, where) {
  if (api.versionsFrom) {
    api.versionsFrom('0.9.0');
    api.use(['http', 'livedata', 'google-oauth', 'mrt:q@1.0.1', 'accounts-base', 'underscore']);
  } else {
    api.use(['http', 'livedata', 'google-oauth', 'q', 'accounts-base', 'underscore']);
  }

  api.add_files(['utils.js', 'google-api-async.js'], ['client', 'server']);
  api.add_files(['google-api-methods.js'], ['server']);

  api.export('GoogleApi', ['client', 'server']);
});

Package.on_test(function (api) {
  api.use([
    'percolate:google-api',
    'tinytest',
    'http',
    'accounts-base',
    'service-configuration',
    'underscore']);

  api.add_files('google-api-tests.js', ['client', 'server']);
});
<|endoftext|>


<commit_before>/**
 * node-archiver
 *
 * Copyright (c) 2012-2013 Chris Talkington, contributors.
 * Licensed under the MIT license.
 * https://github.com/ctalkington/node-archiver/blob/master/LICENSE-MIT
 */
var path = require('path');
var inherits = require('util').inherits;

var util = require('../../util');

var DEFAULT_FILE_MODE = 0664;
var DEFAULT_DIR_MODE = 0755;

function HeaderTar() {
  this.bufferSize = 0;
  this.fields = [];
}

function HeaderTarFile() {
  HeaderTar.call(this);

  this.bufferSize = 512;
  this.fields = [
    {field: 'name', len: 100, type: 'string'},
    {field: 'mode', len: 8, type: 'number'},
    {field: 'uid', len: 8, type: 'number'},
    {field: 'gid', len: 8, type: 'number'},
    {field: 'size',len: 12, type: 'number'},
    {field: 'mtime', len: 12, type: 'number'},
    {field: 'checksum', len: 8, type: 'number'},
    {field: 'type', len: 1, type: 'string', def: '0'},
    {field: 'linkName', len: 100, type: 'string'},
    {field: 'ustar', len: 6, type: 'string', def: 'ustar'},
    {field: 'ustarVersion', len: 2, type: 'string', def: '00'},
    {field: 'owner', len: 32, type: 'string', def: 'root'},
    {field: 'group', len: 32, type: 'string', def: 'root'},
    {field: 'devMajor', len: 8, type: 'number'},
    {field: 'devMinor', len: 8, type: 'number'},
    {field: 'prefix', len: 155, type: 'string'},
    {field: 'padding', len: 12, type: 'padding'}
  ];
}
inherits(HeaderTarFile, HeaderTar);

HeaderTarFile.prototype.toBuffer = function(data) {
  var self = this;
  var buf = util.cleanBuffer(self.bufferSize);
  var offset = 0;

  var val;
  var fallback;

  data = self._normalize(data);

  self.fields.forEach(function(value) {
    fallback = (value.type === 'number') ? 0 : '';
    val = data[value.field] || value.def || fallback;

    if (value.field === 'checksum') {
      val = util.repeat(' ', 8);
    } else if (value.type === 'number') {
      val = self._prepNumeric(val, value.len);
    } else if (value.type === 'string') {
      if (typeof val === 'number') {
        val = val.toString();
      }
    }

    buf.write(val, offset);

    offset += value.len;
  });

  var checksum = this._createChecksum(buf);

  for (var i = 0, length = 6; i < length; i += 1) {
    buf[i + 148] = checksum.charCodeAt(i);
  }

  buf[154] = 0;
  buf[155] = 0x20;

  return buf;
};

HeaderTarFile.prototype.toObject = function(buf) {
  var self = this;

  var data = {};
  var offset = 0;
  var result;

  self.fields.forEach(function(value) {
    result = buf.toString('utf8', offset, offset + value.len).replace(/\0+$/, '');

    if (value.field === 'ustar') {
      result = (result === 'ustar');
    } else if (value.field === 'mtime') {
      result = self._parseNumeric(result);
      data['date'] = util.convertDateTimeEpoch(result);
    } else if (value.type === 'number') {
      result = self._parseNumeric(result);
    }

    data[value.field] = result;

    offset += value.len;
  });

  delete data.padding;

  return data;
};

HeaderTarFile.prototype._normalize = function(data) {
  data.name = util.sanitizeFilePath(data.name);
  data.mode = typeof data.mode === 'number' ? data.mode : DEFAULT_FILE_MODE;
  data.mode &= 0777;

  data.uid = typeof data.uid === 'number' ? data.uid : 0;
  data.gid = typeof data.gid === 'number' ? data.gid : 0;

  if (typeof data.mtime !== 'number') {
    data.date = util.dateify(data.date);
    data.mtime = util.epochDateTime(data.date);
  } else {
    data.date = util.convertDateTimeEpoch(data.mtime);
  }

  var pathParts = this._splitFilePath(data.name);
  data.name = pathParts[0];
  data.prefix = pathParts[1];

  return data;
};

HeaderTarFile.prototype._createChecksum = function(buf) {
  var checksum = 0;
  for (var i = 0, length = buf.length; i < length; i += 1) {
    checksum += buf[i];
  }

  checksum = checksum.toString(8);
  while (checksum.length < 6) {
    checksum = '0' + checksum;
  }

  return checksum;
};

var MAXNUM = {
  12: 077777777777,
  11: 07777777777,
  8: 07777777,
  7: 0777777
};

HeaderTarFile.prototype._prepNumeric = function(num, len) {
  num = num || 0;

  // tar spec calls for field length - 1 + null (\0)
  var maxLen = len - 1;
  var maxVal = MAXNUM[len] || 0;

  if (num < 0 || num > maxVal) {
    // need an extended header if negative or too big. needs implemented..
    throw new Error('tar extended header required but not implemented');
  }

  var str = Math.floor(num).toString(8);

  // if short enough should have a space before null (\0)
  // derived from node-tar logic but needs confirmed by spec
  // if (num < MAXNUM[maxLen]) {
  //   str += ' ';
  // }

  if (str.length < maxLen) {
    str = util.repeat('0', maxLen - str.length) + str;
  }

  return str.substr(0, maxLen) + '\0';
};

HeaderTarFile.prototype._parseNumeric = function(str) {
  var res = parseInt(str.trim(), 8);

  return isNaN(res) ? null : res;
};

HeaderTarFile.prototype._splitFilePath = function(filepath) {
  var fileName = filepath;
  var filePrefix = '';
  var sepIndex;

  if (filepath.length > 100 && filepath.length <= 255) {
    sepIndex = filepath.substring(0, 155).lastIndexOf('/');

    if (sepIndex !== -1) {
      filePrefix = filepath.substring(0, sepIndex);
      fileName = filepath.substring(sepIndex + 1);
    }
  }

  return [fileName, filePrefix];
};

var headers = {
  file: new HeaderTarFile()
};

var encode = exports.encode = function(type, data) {
  if (!headers[type] || typeof headers[type].toBuffer !== 'function') {
    throw new Error('Unknown encode type');
  }

  return headers[type].toBuffer(data);
};

var decode = exports.decode = function(type, buf) {
  if (!headers[type] || typeof headers[type].toObject !== 'function') {
    throw new Error('Unknown decode type');
  }

  return headers[type].toObject(buf);
};

exports.file = HeaderTarFile;<commit_msg>tar: tweak to file mode.<commit_after>/**
 * node-archiver
 *
 * Copyright (c) 2012-2013 Chris Talkington, contributors.
 * Licensed under the MIT license.
 * https://github.com/ctalkington/node-archiver/blob/master/LICENSE-MIT
 */
var path = require('path');
var inherits = require('util').inherits;

var util = require('../../util');

var DEFAULT_FILE_MODE = 0664;
var DEFAULT_DIR_MODE = 0755;

function HeaderTar() {
  this.bufferSize = 0;
  this.fields = [];
}

function HeaderTarFile() {
  HeaderTar.call(this);

  this.bufferSize = 512;
  this.fields = [
    {field: 'name', len: 100, type: 'string'},
    {field: 'mode', len: 8, type: 'number'},
    {field: 'uid', len: 8, type: 'number'},
    {field: 'gid', len: 8, type: 'number'},
    {field: 'size',len: 12, type: 'number'},
    {field: 'mtime', len: 12, type: 'number'},
    {field: 'checksum', len: 8, type: 'number'},
    {field: 'type', len: 1, type: 'string', def: '0'},
    {field: 'linkName', len: 100, type: 'string'},
    {field: 'ustar', len: 6, type: 'string', def: 'ustar'},
    {field: 'ustarVersion', len: 2, type: 'string', def: '00'},
    {field: 'owner', len: 32, type: 'string', def: 'root'},
    {field: 'group', len: 32, type: 'string', def: 'root'},
    {field: 'devMajor', len: 8, type: 'number'},
    {field: 'devMinor', len: 8, type: 'number'},
    {field: 'prefix', len: 155, type: 'string'},
    {field: 'padding', len: 12, type: 'padding'}
  ];
}
inherits(HeaderTarFile, HeaderTar);

HeaderTarFile.prototype.toBuffer = function(data) {
  var self = this;
  var buf = util.cleanBuffer(self.bufferSize);
  var offset = 0;

  var val;
  var fallback;

  data = self._normalize(data);

  self.fields.forEach(function(value) {
    fallback = (value.type === 'number') ? 0 : '';
    val = data[value.field] || value.def || fallback;

    if (value.field === 'checksum') {
      val = util.repeat(' ', 8);
    } else if (value.type === 'number') {
      val = self._prepNumeric(val, value.len);
    } else if (value.type === 'string') {
      if (typeof val === 'number') {
        val = val.toString();
      }
    }

    buf.write(val, offset);

    offset += value.len;
  });

  var checksum = this._createChecksum(buf);

  for (var i = 0, length = 6; i < length; i += 1) {
    buf[i + 148] = checksum.charCodeAt(i);
  }

  buf[154] = 0;
  buf[155] = 0x20;

  return buf;
};

HeaderTarFile.prototype.toObject = function(buf) {
  var self = this;

  var data = {};
  var offset = 0;
  var result;

  self.fields.forEach(function(value) {
    result = buf.toString('utf8', offset, offset + value.len).replace(/\0+$/, '');

    if (value.field === 'ustar') {
      result = (result === 'ustar');
    } else if (value.field === 'mtime') {
      result = self._parseNumeric(result);
      data['date'] = util.convertDateTimeEpoch(result);
    } else if (value.type === 'number') {
      result = self._parseNumeric(result);
    }

    data[value.field] = result;

    offset += value.len;
  });

  delete data.padding;

  return data;
};

HeaderTarFile.prototype._normalize = function(data) {
  data.name = util.sanitizeFilePath(data.name);
  data.mode = typeof data.mode === 'number' ? data.mode & 0777 : DEFAULT_FILE_MODE;

  data.uid = typeof data.uid === 'number' ? data.uid : 0;
  data.gid = typeof data.gid === 'number' ? data.gid : 0;

  if (typeof data.mtime !== 'number') {
    data.date = util.dateify(data.date);
    data.mtime = util.epochDateTime(data.date);
  } else {
    data.date = util.convertDateTimeEpoch(data.mtime);
  }

  var pathParts = this._splitFilePath(data.name);
  data.name = pathParts[0];
  data.prefix = pathParts[1];

  return data;
};

HeaderTarFile.prototype._createChecksum = function(buf) {
  var checksum = 0;
  for (var i = 0, length = buf.length; i < length; i += 1) {
    checksum += buf[i];
  }

  checksum = checksum.toString(8);
  while (checksum.length < 6) {
    checksum = '0' + checksum;
  }

  return checksum;
};

var MAXNUM = {
  12: 077777777777,
  11: 07777777777,
  8: 07777777,
  7: 0777777
};

HeaderTarFile.prototype._prepNumeric = function(num, len) {
  num = num || 0;

  // tar spec calls for field length - 1 + null (\0)
  var maxLen = len - 1;
  var maxVal = MAXNUM[len] || 0;

  if (num < 0 || num > maxVal) {
    // need an extended header if negative or too big. needs implemented..
    throw new Error('tar extended header required but not implemented');
  }

  var str = Math.floor(num).toString(8);

  // if short enough should have a space before null (\0)
  // derived from node-tar logic but needs confirmed by spec
  // if (num < MAXNUM[maxLen]) {
  //   str += ' ';
  // }

  if (str.length < maxLen) {
    str = util.repeat('0', maxLen - str.length) + str;
  }

  return str.substr(0, maxLen) + '\0';
};

HeaderTarFile.prototype._parseNumeric = function(str) {
  var res = parseInt(str.trim(), 8);

  return isNaN(res) ? null : res;
};

HeaderTarFile.prototype._splitFilePath = function(filepath) {
  var fileName = filepath;
  var filePrefix = '';
  var sepIndex;

  if (filepath.length > 100 && filepath.length <= 255) {
    sepIndex = filepath.substring(0, 155).lastIndexOf('/');

    if (sepIndex !== -1) {
      filePrefix = filepath.substring(0, sepIndex);
      fileName = filepath.substring(sepIndex + 1);
    }
  }

  return [fileName, filePrefix];
};

var headers = {
  file: new HeaderTarFile()
};

var encode = exports.encode = function(type, data) {
  if (!headers[type] || typeof headers[type].toBuffer !== 'function') {
    throw new Error('Unknown encode type');
  }

  return headers[type].toBuffer(data);
};

var decode = exports.decode = function(type, buf) {
  if (!headers[type] || typeof headers[type].toObject !== 'function') {
    throw new Error('Unknown decode type');
  }

  return headers[type].toObject(buf);
};

exports.file = HeaderTarFile;<|endoftext|>


<commit_before>
/*
 * copy files to mc
 * node ./bin/copy --mc ../gecko-dev
 *
 * copy files per commit
 * node ./bin/copy --mc ../gecko-dev --sha 123
 *
 * copy files per commit with a message
 * node ./bin/copy --mc ../gecko-dev --sha 123 --message "bug 123 (release 106) __message__.r=dwalsh"
 */

const copyAssets = require("./copy-assets")
const copyModules = require("./copy-modules")
const minimist = require("minimist");
const fs = require("fs");
const chalk = require("chalk");
const shell = require("shelljs");
const path = require("path")

const args = minimist(process.argv.slice(1), {
  string: ["mc", "sha", "message"],
  boolean: ["watch", "symlink", "assets"]
});

const mc = args.mc || "./firefox";
const watch = args.watch;
const symlink = args.symlink;
const assets = args.assets
const sha = args.sha
const message = args.message || ""

const mcPath = path.join(__dirname, mc)

async function copy({assets, mc, watch, symlink}) {
  if (fs.existsSync(mc)) {
    try {
      await copyAssets({ assets, mc, watch, symlink})
      await copyModules.run({ mc, watch })
    } catch (e) {
      console.error(e);
      if (e.code === "ENOENT") {
        missingFilesErrorMessage();
      }
    }
  } else {
    missingFilesErrorMessage();
  }
}

async function start() {
  console.log(`Copying Files to ${mc} with params: `, {watch, assets, symlink})
  return copy()
}

function missingFilesErrorMessage() {
  let errorMessage = [
    'It looks like you are missing some files. The mozilla-central ',
    'codebase may be missing at ${mc}. You can clone mozilla-central by ',
    'running \`./bin/prepare-mochitests-dev\` from the root of the ',
    'debugger.html repository. You can find more information on bundling ',
    'or mochitests at ',
    'https://github.com/devtools-html/debugger.html/blob/master/docs/bundling.md or ',
    'https://github.com/devtools-html/debugger.html/blob/master/docs/mochitests.md'
  ].join('');

  console.warn(chalk.yellow(errorMessage));
}

async function copyCommits() {
  function exec(cmd) {
    return shell.exec(cmd, { silent: true }).stdout;
  }

  function getMessage(sha) {
    return exec(`git log --format=%B -n 1 ${sha}`).split("\n")[0]
  }

  function getCommitsAfter(sha) {
    return exec(`git rev-list --reverse ${sha}^..HEAD`).trim().split("\n");
  }

  function commitChanges({msg}) {
    console.log(`git commit -m "${prefix} ${msg}"`)
    const commitMessage = message.replace('__message__', msg)
    exec(`git add devtools; git commit -m "${prefix} ${commitMessage}"`)
  }

  const commits = getCommitsAfter(sha)
  for (const commit of commits) {
    const message = getMessage(commit);
    console.log(`Copying ${message}`)
    exec(`git checkout ${commit}`);

    await copy({mc});
    shell.cd(mc);
    commitChanges({message});
    shell.cd(`-`);
  }
}

if (sha) {
  copyCommits();
} else {
  start();
}
<commit_msg>Add missing arguments to copy (#7509)<commit_after>
/*
 * copy files to mc
 * node ./bin/copy --mc ../gecko-dev
 *
 * copy files per commit
 * node ./bin/copy --mc ../gecko-dev --sha 123
 *
 * copy files per commit with a message
 * node ./bin/copy --mc ../gecko-dev --sha 123 --message "bug 123 (release 106) __message__.r=dwalsh"
 */

const copyAssets = require("./copy-assets")
const copyModules = require("./copy-modules")
const minimist = require("minimist");
const fs = require("fs");
const chalk = require("chalk");
const shell = require("shelljs");
const path = require("path")

const args = minimist(process.argv.slice(1), {
  string: ["mc", "sha", "message"],
  boolean: ["watch", "symlink", "assets"]
});

const mc = args.mc || "./firefox";
const watch = args.watch;
const symlink = args.symlink;
const assets = args.assets
const sha = args.sha
const message = args.message || ""

const mcPath = path.join(__dirname, mc)

async function copy({assets, mc, watch, symlink}) {
  if (fs.existsSync(mc)) {
    try {
      await copyAssets({ assets, mc, watch, symlink})
      await copyModules.run({ mc, watch })
    } catch (e) {
      console.error(e);
      if (e.code === "ENOENT") {
        missingFilesErrorMessage();
      }
    }
  } else {
    missingFilesErrorMessage();
  }
}

async function start() {
  console.log(`Copying Files to ${mc} with params: `, {watch, assets, symlink})
  return copy({watch, assets, mc, symlink})
}

function missingFilesErrorMessage() {
  let errorMessage = [
    'It looks like you are missing some files. The mozilla-central ',
    'codebase may be missing at ${mc}. You can clone mozilla-central by ',
    'running \`./bin/prepare-mochitests-dev\` from the root of the ',
    'debugger.html repository. You can find more information on bundling ',
    'or mochitests at ',
    'https://github.com/devtools-html/debugger.html/blob/master/docs/bundling.md or ',
    'https://github.com/devtools-html/debugger.html/blob/master/docs/mochitests.md'
  ].join('');

  console.warn(chalk.yellow(errorMessage));
}

async function copyCommits() {
  function exec(cmd) {
    return shell.exec(cmd, { silent: true }).stdout;
  }

  function getMessage(sha) {
    return exec(`git log --format=%B -n 1 ${sha}`).split("\n")[0]
  }

  function getCommitsAfter(sha) {
    return exec(`git rev-list --reverse ${sha}^..HEAD`).trim().split("\n");
  }

  function commitChanges({msg}) {
    console.log(`git commit -m "${prefix} ${msg}"`)
    const commitMessage = message.replace('__message__', msg)
    exec(`git add devtools; git commit -m "${prefix} ${commitMessage}"`)
  }

  const commits = getCommitsAfter(sha)
  for (const commit of commits) {
    const message = getMessage(commit);
    console.log(`Copying ${message}`)
    exec(`git checkout ${commit}`);

    await copy({mc});
    shell.cd(mc);
    commitChanges({message});
    shell.cd(`-`);
  }
}

if (sha) {
  copyCommits();
} else {
  start();
}
<|endoftext|>


<commit_before>'use strict';

var ApiAuthRequestError = require('../error/ApiAuthRequestError');
var JwtAuthenticator = require('../jwt/jwt-authenticator');
var OAuthPasswordGrantRequestAuthenticator = require('../oauth/password-grant').authenticator;
var OAuthRefreshTokenGrantRequestAuthenticator = require('../oauth/refresh-grant').authenticator;
var OAuthIdSiteTokenGrantAuthenticator = require('../oauth/id-site-grant').authenticator;
var OAuthStormpathTokenAuthenticator = require('../oauth/stormpath-token').authenticator;
var OAuthClientCredentialsAuthenticator = require('./client-credentials').authenticator;
var OAuthStormpathSocialAuthenticator = require('../oauth/stormpath-social').authenticator;

function retrieveAuthTokenFromRequest(req) {
  var authHeader = req && req.headers && req.headers.authorization;

  if (!authHeader || !authHeader.match(/Bearer/i)) {
    return false;
  }

  return authHeader.split(' ').pop();
}

/**
 * Intentionally not documented for the time being.  This is essentially middleware
 * for Express, so I'm not sure it belongs in this library.
 *
 * @private
 */
function OAuthAuthenticator(application) {
  if (!(this instanceof OAuthAuthenticator)) {
    return new OAuthAuthenticator(application);
  }

  this.application = application;
}

OAuthAuthenticator.prototype.setScopeFactory = function setScopeFactory(scopeFactory) {
  this.scopeFactory = scopeFactory;
};

OAuthAuthenticator.prototype.setScopeFactorySigningKey = function setScopeFactorySigningKey(key) {
  this.signingKey = key;
};

OAuthAuthenticator.prototype.localValidation = false;

OAuthAuthenticator.prototype.withLocalValidation = function withLocalValidation() {
  this.localValidation = true;
  return this;
};

OAuthAuthenticator.prototype.authenticate = function authenticate(req, callback){
  if (typeof req !== 'object' || typeof callback !== 'function') {
    throw new Error('authenticate must be called with a request object and callback function');
  }

  var authenticator = null;
  var token = retrieveAuthTokenFromRequest(req);

  if (token) {
    authenticator = new JwtAuthenticator(this.application);

    if (this.localValidation) {
      authenticator.withLocalValidation();
    }
  } else if (req.body) {
    token = req.body;
    switch (req.body.grant_type) {
      case 'password':
        authenticator = new OAuthPasswordGrantRequestAuthenticator(this.application);
        break;
      case 'refresh_token':
        authenticator = new OAuthRefreshTokenGrantRequestAuthenticator(this.application);
        break;
      case 'id_site_token':
        authenticator = new OAuthIdSiteTokenGrantAuthenticator(this.application);
        break;
      case 'stormpath_token':
        authenticator = new OAuthStormpathTokenAuthenticator(this.application);
        break;
      case 'client_credentials':
        authenticator = new OAuthClientCredentialsAuthenticator(this.application);
        break;
      case 'stormpath_social':
        authenticator = new OAuthStormpathSocialAuthenticator(this.application);
    }
  }

  if (this.scopeFactory) {
    if (!this.signingKey) {
      callback(new ApiAuthRequestError({
        userMessage: 'Invalid Request',
        developerMessage: 'Scope factory cannot be used without a signing key',
        statusCode: 400
      }));
    }

    authenticator.setScopeFactory(this.scopeFactory);
    authenticator.setScopeFactorySigningKey(this.signingKey);
  }

  if (authenticator) {
    authenticator.authenticate(token, callback);
  } else {
    callback(this.unauthenticated());
  }

  return this;
};

OAuthAuthenticator.prototype.unauthenticated = function unauthenticated(){
  return new ApiAuthRequestError({userMessage: 'Unauthorized', statusCode: 401});
};

module.exports = OAuthAuthenticator;
<commit_msg>Do not apply scope if authenticator does not support this<commit_after>'use strict';

var ApiAuthRequestError = require('../error/ApiAuthRequestError');
var JwtAuthenticator = require('../jwt/jwt-authenticator');
var OAuthPasswordGrantRequestAuthenticator = require('../oauth/password-grant').authenticator;
var OAuthRefreshTokenGrantRequestAuthenticator = require('../oauth/refresh-grant').authenticator;
var OAuthIdSiteTokenGrantAuthenticator = require('../oauth/id-site-grant').authenticator;
var OAuthStormpathTokenAuthenticator = require('../oauth/stormpath-token').authenticator;
var OAuthClientCredentialsAuthenticator = require('./client-credentials').authenticator;
var OAuthStormpathSocialAuthenticator = require('../oauth/stormpath-social').authenticator;

function retrieveAuthTokenFromRequest(req) {
  var authHeader = req && req.headers && req.headers.authorization;

  if (!authHeader || !authHeader.match(/Bearer/i)) {
    return false;
  }

  return authHeader.split(' ').pop();
}

/**
 * Intentionally not documented for the time being.  This is essentially middleware
 * for Express, so I'm not sure it belongs in this library.
 *
 * @private
 */
function OAuthAuthenticator(application) {
  if (!(this instanceof OAuthAuthenticator)) {
    return new OAuthAuthenticator(application);
  }

  this.application = application;
}

OAuthAuthenticator.prototype.setScopeFactory = function setScopeFactory(scopeFactory) {
  this.scopeFactory = scopeFactory;
};

OAuthAuthenticator.prototype.setScopeFactorySigningKey = function setScopeFactorySigningKey(key) {
  this.signingKey = key;
};

OAuthAuthenticator.prototype.localValidation = false;

OAuthAuthenticator.prototype.withLocalValidation = function withLocalValidation() {
  this.localValidation = true;
  return this;
};

OAuthAuthenticator.prototype.authenticate = function authenticate(req, callback){
  if (typeof req !== 'object' || typeof callback !== 'function') {
    throw new Error('authenticate must be called with a request object and callback function');
  }

  var authenticator = null;
  var token = retrieveAuthTokenFromRequest(req);

  if (token) {
    authenticator = new JwtAuthenticator(this.application);

    if (this.localValidation) {
      authenticator.withLocalValidation();
    }
  } else if (req.body) {
    token = req.body;
    switch (req.body.grant_type) {
      case 'password':
        authenticator = new OAuthPasswordGrantRequestAuthenticator(this.application);
        break;
      case 'refresh_token':
        authenticator = new OAuthRefreshTokenGrantRequestAuthenticator(this.application);
        break;
      case 'id_site_token':
        authenticator = new OAuthIdSiteTokenGrantAuthenticator(this.application);
        break;
      case 'stormpath_token':
        authenticator = new OAuthStormpathTokenAuthenticator(this.application);
        break;
      case 'client_credentials':
        authenticator = new OAuthClientCredentialsAuthenticator(this.application);
        break;
      case 'stormpath_social':
        authenticator = new OAuthStormpathSocialAuthenticator(this.application);
    }
  }

  if (this.scopeFactory && typeof authenticator.setScopeFactory === 'function') {
    if (!this.signingKey) {
      callback(new ApiAuthRequestError({
        userMessage: 'Invalid Request',
        developerMessage: 'Scope factory cannot be used without a signing key',
        statusCode: 400
      }));
    }

    authenticator.setScopeFactory(this.scopeFactory);
    authenticator.setScopeFactorySigningKey(this.signingKey);
  }

  if (authenticator) {
    authenticator.authenticate(token, callback);
  } else {
    callback(this.unauthenticated());
  }

  return this;
};

OAuthAuthenticator.prototype.unauthenticated = function unauthenticated(){
  return new ApiAuthRequestError({userMessage: 'Unauthorized', statusCode: 401});
};

module.exports = OAuthAuthenticator;
<|endoftext|>


<commit_before>#!/usr/bin/env node
var program = require('commander');
var chalk = require('chalk');
var version = require('../package.json').version;
var init = require('../lib/init');
var initType = require('../lib/type');

var clr = chalk.bold.cyan;

program
  .command('init <appname>')
  .alias('i')
  .description('initialize flux application')
  .action(function(appname){
    var initializeClr = chalk.bold.yellow;
    console.log(initializeClr('Initializing flux application: %s'), appname);
    init(appname);
  });

program
  .command('action <name>')
  .alias('a')
  .description('create action file')
  .action(function(name){
    console.log(clr('Creating action: %s'), name);
    var argArr = name.split(':');
    var module = argArr[0];
    var actionName = argArr[1];
    initType('action', module, actionName);
  });

program
  .command('component <name>')
  .alias('c')
  .description('create component file')
  .action(function(name){
    console.log(clr('Creating component: %s'), name);
    var argArr = name.split(':');
    var module = argArr[0];
    var actionName = argArr[1];
    initType('component', module, actionName);
  });

program
  .command('store <name>')
  .alias('s')
  .description('create store file')
  .action(function(name){
    console.log(clr('Creating store: %s'), name);
    var argArr = name.split(':');
    var module = argArr[0];
    var actionName = argArr[1];
    initType('store', module, actionName);
  });

program
  .command('constant <name>')
  .alias('k')
  .description('create constant file')
  .action(function(name){
    console.log(clr('Creating constant: %s'), name);
    var argArr = name.split(':');
    var module = argArr[0];
    var actionName = argArr[1];
    initType('constant', module, actionName);
  });

program.parse(process.argv);<commit_msg>add command for creating a module<commit_after>#!/usr/bin/env node
var program = require('commander');
var chalk = require('chalk');
var version = require('../package.json').version;
var init = require('../lib/init');
var initModule = require('../lib/initModule');
var initType = require('../lib/type');

var clr = chalk.bold.cyan;

program
  .command('init <appname>')
  .alias('i')
  .description('initialize flux application')
  .action(function(appname){
    var initializeClr = chalk.bold.yellow;
    console.log(initializeClr('Initializing flux application: %s'), appname);
    init(appname);
  });

program
  .command('action <name>')
  .alias('a')
  .description('create action file')
  .action(function(name){
    console.log(clr('Creating action: %s'), name);
    var argArr = name.split(':');
    var module = argArr[0];
    var actionName = argArr[1];
    initType('action', module, actionName);
  });

program
  .command('component <name>')
  .alias('c')
  .description('create component file')
  .action(function(name){
    console.log(clr('Creating component: %s'), name);
    var argArr = name.split(':');
    var module = argArr[0];
    var actionName = argArr[1];
    initType('component', module, actionName);
  });

program
  .command('store <name>')
  .alias('s')
  .description('create store file')
  .action(function(name){
    console.log(clr('Creating store: %s'), name);
    var argArr = name.split(':');
    var module = argArr[0];
    var actionName = argArr[1];
    initType('store', module, actionName);
  });

program
  .command('constant <name>')
  .alias('k')
  .description('create constant file')
  .action(function(name){
    console.log(clr('Creating constant: %s'), name);
    var argArr = name.split(':');
    var module = argArr[0];
    var actionName = argArr[1];
    initType('constant', module, actionName);
  });

program
  .command('module <name>')
  .alias('m')
  .description('create a module')
  .action(function(name){
    console.log(clr('Creating module: %s'), name);
    var argArr = name.split(':');
    var moduleName = argArr[0];
    initType(moduleName);
  });

program.parse(process.argv);<|endoftext|>


<commit_before>module.exports = class {
  constructor(mongo, model) {
    this.client = mongo
  }

  get(collection, id) {
    return this.client.collection(collection).findOne({ _id: id })
  }

  async create(collection, attrs) {
    await this.client.collection(collection).insertOne(attrs)
    return { id: attrs._id }
  }

  update(collection, query, attrs) {
    return this.client.collection(collection).updateOne(query, {
      $set: attrs
    })
  }

  find(collection, query) {
    return this.client.collection(collection).find(query).toArray()
  }

  count(collection, query) {
    return this.client.collection(collection).find(query).count()
  }

  delete(collection, id) {
    return this.client.collection(collection).deleteOne({ _id: id })
  }

  deleteAll(collection, query) {
    return this.client.collection(collection).deleteMany(query)
  }
}
<commit_msg>fix update function<commit_after>module.exports = class {
  constructor(mongo, model) {
    this.client = mongo
  }

  get(collection, id) {
    return this.client.collection(collection).findOne({ _id: id })
  }

  async create(collection, attrs) {
    await this.client.collection(collection).insertOne(attrs)
    return { id: attrs._id }
  }

  update(collection, query, attrs) {
    return this.client.collection(collection).updateOne({ _id: query }, {
      $set: attrs
    })
  }

  find(collection, query) {
    return this.client.collection(collection).find(query).toArray()
  }

  count(collection, query) {
    return this.client.collection(collection).find(query).count()
  }

  delete(collection, id) {
    return this.client.collection(collection).deleteOne({ _id: id })
  }

  deleteAll(collection, query) {
    return this.client.collection(collection).deleteMany(query)
  }
}
<|endoftext|>