main.js 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. process.logging = process.logging || require('./lib/util/log');
  2. // The generator system is a framework for node to author reusable and
  3. // composable Generators, for a vast majority of use-case.
  4. //
  5. // Inspired and based off the work done on Thor and Rails 3 Generators, we try
  6. // to provide the same kind of infrastructure.
  7. //
  8. // var generators = require('yeoman-generators');
  9. //
  10. // var env = generators('angular:model')
  11. // .run(function(err) {
  12. // console.log('done!');
  13. // });
  14. //
  15. // Generators are registered by namespace, where namespaces are mapping the
  16. // structure of the file system with `:` being simply converted to `/`.
  17. //
  18. // Generators are standard node modules, they are simply required as usual, and
  19. // they can be shipped into reusable npm packages.
  20. //
  21. // The lookup is done depending on the configured load path, which is by
  22. // default `lib/generators` in every generators package installed (ie.
  23. // node_modules/yeoman-backbone/lib/generators)
  24. var Environment = require('./lib/env');
  25. var generators = module.exports = function createEnv(args, opts) {
  26. return new Environment(args, opts);
  27. };
  28. // Reference general dependencies on the top level object
  29. generators.inquirer = require('inquirer');
  30. // hoist up top level class the generator extend
  31. generators.Base = require('./lib/base');
  32. generators.NamedBase = require('./lib/named-base');
  33. // expose test helpers for generators.
  34. generators.test = require('./lib/test/helpers');
  35. // backward compat, make them available as generators.generators.Base &
  36. // NamedBase (as most of generators use yeoman.generators.Stuff)
  37. generators.generators = {};
  38. generators.generators.Base = generators.Base;
  39. generators.generators.NamedBase = generators.NamedBase;