Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Init

  • Loading branch information...
commit 32d75d2209766e3abaee1d0c1a278b1caf85750d 0 parents
@sindresorhus sindresorhus authored
10 .editorconfig
@@ -0,0 +1,10 @@
+# editorconfig.org
+root = true
+
+[*]
+indent_style = space
+indent_size = 2
+end_of_line = lf
+charset = utf-8
+trim_trailing_whitespace = true
+insert_final_newline = true
1  .gitattributes
@@ -0,0 +1 @@
+* text=auto
3  .gitignore
@@ -0,0 +1,3 @@
+# ignore hidden folders
+.*/
+node_modules
17 .jshintrc
@@ -0,0 +1,17 @@
+{
+ "node": true,
+ "es5": true,
+ "esnext": true,
+ "bitwise": true,
+ "curly": true,
+ "eqeqeq": true,
+ "eqnull": true,
+ "immed": true,
+ "latedef": true,
+ "newcap": true,
+ "noarg": true,
+ "undef": true,
+ "strict": false,
+ "trailing": true,
+ "smarttabs": true
+}
6 .npmignore
@@ -0,0 +1,6 @@
+.npmignore
+.editorconfig
+.jshintrc
+.gitattributes
+test
+Gruntfile.js
9 .travis.yml
@@ -0,0 +1,9 @@
+language: node_js
+node_js:
+ - 0.8
+notifications:
+ irc:
+ channels:
+ - "irc.freenode.org#yeoman"
+ template:
+ - "%{repository}: %{message} -- %{build_url}"
35 Gruntfile.js
@@ -0,0 +1,35 @@
+var util = require('util');
+var path = require('path');
+
+module.exports = function( grunt ) {
+ 'use strict';
+
+ grunt.initConfig({
+ lint: {
+ options: {
+ options: '<json:.jshintrc>',
+ global: {
+ process: true
+ }
+ },
+ grunt: [
+ 'Gruntfile.js',
+ //'tasks/*.js',
+ ],
+ lib: [
+ //'lib/{plugins,utils}/*.js',
+ //'lib/generators/*.js'
+ ],
+ test: [
+ //'test/**/*.js'
+ ]
+ },
+ watch: {
+ files: '<config:lint>',
+ tasks: 'lint'
+ }
+ });
+
+ // Disable lint for now until we upgrade to latest grunt with latest jshint
+ grunt.registerTask( 'default', 'lint' );
+};
52 bin/help.txt
@@ -0,0 +1,52 @@
+
+                                                      
+                                                          
+                                                            
+                                                              
+                                                              
+                                                             
+                                                             
+                                                             
+                                                            
+                                                            
+                                                           
+                                                                 
+                                                                
+                                                              
+                                                                
+                                                                 
+                                                                
+                                                               
+                                                            
+                                                             
+                                                                 
+                                                                
+                                                                
+                                                          
+                                                          
+                                                          
+                                                         
+                                                         
+                                                         
+                                                             
+                                                               
+                                                                  
+                                                                    
+                                                                   
+                                                                 
+                                                               
+                                                            
+                                                         
+                                                    
+ 
+
+Usage: <%= 'yo'.bold.red %> <%= '<generator>'.yellow %> [arguments] [--help]
+
+The <%= 'webapp'.yellow %> generator is bundled, while others can be installed with <%= 'npm install -g <generator-name>'.bold %>
+
+Officially supported generators:
+<%= 'webapp angular ember backbone chromeapp chrome-extension bootstrap mocha jasmine testacular'.yellow %>
+
+See a list of all available generators with <%= 'npm search yeoman-generator'.bold %>
+
+Now just run <%= 'yo'.bold.red %> <%= 'webapp'.yellow %> and have a great day :)
107 bin/yo
@@ -0,0 +1,107 @@
+#!/usr/bin/env node
+'use strict';
+var fs = require('fs');
+var path = require('path');
+var execFile = require('child_process').execFile;
+var nopt = require('nopt');
+var colors = require('colors');
+var _ = require('lodash');
+var pkg = require('../package.json');
+var updateNotifier = require('update-notifier');
+var Insight = require('insight');
+
+var helpScreen = _.template(fs.readFileSync(path.join(__dirname, 'help.txt'), 'utf8'));
+var opts = nopt({
+ help: Boolean
+}, {
+ h: '--help'
+});
+var args = opts.argv.remain;
+var cmd = args[0];
+
+var insight = new Insight({
+ trackingCode: 'UA-31537568-1',
+ packageName: pkg.name,
+ packageVersion: pkg.version
+});
+
+/*jshint multistr:true */
+var insightMsg = '\
+=========================================================================='.grey + '\n\
+We\'re constantly looking for ways to make '.yellow + pkg.name.bold.red + ' better! \n\
+May we anonymously report usage statistics to improve the tool over time? \n\
+More info: yeoman.io/insight.html & http://yeoman.io'.yellow + '\n\
+=========================================================================='.grey;
+
+
+function init() {
+ var env = require('yeoman-generator')();
+
+ // register each built-in generator individually
+ env.plugins('node_modules', __dirname);
+
+ // alias any single namespace to `*:all` and `webapp` namespace specifically
+ // to webapp:app.
+ env.alias(/^([^:]+)$/, '$1:all');
+ env.alias(/^([^:]+)$/, '$1:app');
+
+ // lookup for every namespaces, within the environments.paths and lookups
+ env.lookup('*:*');
+
+ if (opts.help) {
+ return console.log(env.help('yo'));
+ }
+
+ env.on('end', function () {
+ console.log('done running sir');
+ });
+
+ env.on('error', function (err) {
+ console.error('Error', process.argv.slice(2).join(' '), '\n');
+ console.error(opts.debug ? err.stack : err.message);
+ process.exit(err.code || 1);
+ });
+
+ // Note: at some point, nopt needs to know about the generator options, the
+ // one that will be triggered by the below args. Maybe the nopt parsing
+ // should be done internally, from the args.
+ env.run(args, opts);
+}
+
+function pre() {
+ if (opts.version) {
+ return console.log(pkg.version);
+ }
+
+ if (!cmd) {
+ return console.log(helpScreen());
+ }
+
+ init();
+}
+
+// TODO: Update docs to flag `--no-insight`
+if (!process.env.yeoman_test && opts.insight !== false) {
+ if (insight.optOut === undefined) {
+ insight.optOut = false;
+ insight.track('downloaded');
+ insight.askPermission(insightMsg, pre);
+ return;
+ }
+ // only track the two first subcommands
+ // TODO: Enable this before release
+ //insight.track.apply(insight, args.slice(0, 2));
+}
+
+// TODO: Update docs to flag `--no-update-notifier`
+if (!process.env.yeoman_test && opts['update-notifier'] !== false) {
+ var notifier = updateNotifier({
+ packagePath: '../package',
+ });
+
+ if (notifier.update) {
+ notifier.notify(true);
+ }
+}
+
+pre();
1  contributing.md
@@ -0,0 +1 @@
+See the [contributing docs](https://github.com/yeoman/yeoman/blob/master/contributing.md)
53 package.json
@@ -0,0 +1,53 @@
+{
+ "name": "yo",
+ "version": "1.0.0-beta.1",
+ "description": "Yo is a CLI tool for scaffolding out Yeoman projects",
+ "keywords": [
+ "front-end",
+ "development",
+ "dev",
+ "build",
+ "web",
+ "tool",
+ "cli",
+ "scaffold",
+ "stack"
+ ],
+ "homepage": "http://yeoman.io",
+ "bugs": "https://github.com/yeoman/yo/issues",
+ "author": "Chrome Developer Relations",
+ "bin": {
+ "yo": "bin/yo"
+ },
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/yeoman/yo.git"
+ },
+ "scripts": {
+ "test": "mocha test/test-*.js"
+ },
+ "dependencies": {
+ "yeoman-generator": "https://github.com/yeoman/generator/archive/master.tar.gz",
+ "generator-webapp": "https://github.com/yeoman/generator-webapp/archive/master.tar.gz",
+ "generator-mocha": "http://github.com/yeoman/generator-mocha/archive/master.tar.gz",
+ "colors": "~0.6.0",
+ "nopt": "~2.1.1",
+ "lodash": "~1.0.0-rc.3",
+ "update-notifier": "~0.1.2",
+ "insight": "~0.1.0"
+ },
+ "devDependencies": {
+ "mocha": "~1.8.1",
+ "ronn": "~0.3.8",
+ "grunt": "~0.4.0rc7"
+ },
+ "engines": {
+ "node": ">=0.8.0"
+ },
+ "preferGlobal": true,
+ "licenses": [
+ {
+ "type": "BSD"
+ }
+ ]
+}
8 test/mocha.opts
@@ -0,0 +1,8 @@
+--slow 1500
+--timeout 50000
+
+--reporter spec
+
+--globals events
+--globals AssertionError
+--globals TAP_Global_Harness
0  test/test.js
No changes.
Please sign in to comment.
Something went wrong with that request. Please try again.