Skip to content

Commit

Permalink
submodule enyo for init:enyo, update bootplate, add .bowerrc for init…
Browse files Browse the repository at this point in the history
…:enyo, lint everything, update readme and version, update CLI
  • Loading branch information
phated committed Nov 7, 2012
1 parent 3608fbb commit a13070d
Show file tree
Hide file tree
Showing 122 changed files with 6,113 additions and 3,792 deletions.
5 changes: 3 additions & 2 deletions .gitignore
@@ -1,2 +1,3 @@
node_modules
*.log
node_modules/
*~
*.log
3 changes: 3 additions & 0 deletions .gitmodules
@@ -0,0 +1,3 @@
[submodule "tasks/init/module/root/enyo"]
path = tasks/init/module/root/enyo
url = git://github.com/enyojs/enyo
47 changes: 38 additions & 9 deletions README.md
Expand Up @@ -64,15 +64,44 @@ In lieu of a formal styleguide, take care to maintain the existing coding style.

## Release History

0.1.0alpha5 - Bower added - remove task - fixed add task

0.1.0alpha4 - Build task - no need for minify.sh or minify.bat

0.1.0alpha3 - Add task - local only (add:layout)

0.1.0alpha2 - More init tasks (init:enyo and init:module tasks)

0.1.0alpha1 - Initial Release (init:bootplate and debug tasks)
0.1.0alpha6 -
* Switched from Bower fork to actual Bower (thanks to .bowerrc)
* Added .bowerrc to init templates
* More Bower tasks implemented (install/add, uninstall/remove, update, search, lookup, list/ls)
* Update Bootplate template
* Git Submodule Enyo in init:enyo
* Add gitignore to init:module
* Update Grunt to 0.3.17 and make everything pass lint (use strict)
* Update CLI help to display info about Bower tasks (and remove concat, min, server, watch since we have debug and build)


0.1.0alpha5 -
* Bower added
* Remove task
* Fixed add task

0.1.0alpha4 -
* Build task
* No need for minify.sh or minify.bat

0.1.0alpha3 -
* Add task
* Local only (add:layout)

0.1.0alpha2 -
* More init tasks (init:enyo and init:module tasks)

0.1.0alpha1 -
* Initial Release (init:bootplate and debug tasks)

## Roadmap

* Add tests (before Beta)
* Documentation/examples for Bower tasks
* Move templates out of bootplate in order to git submodule it for easy upgrades
* Submit/standardize a module bootplate and git submodule it as a init template
* Upgrade to Grunt 0.4
* Create dedicated task for debug server instead of an alias for `server watch`

## License
Copyright 2012 Blaine Bublitz
Expand Down
97 changes: 41 additions & 56 deletions bin/grunt-enyo 100644 → 100755
@@ -1,4 +1,6 @@
#!/usr/bin/env node
'use strict';

var grunt = require('grunt');
var path = require('path');
var nopt = require('nopt');
Expand Down Expand Up @@ -38,13 +40,7 @@ function displayHelp(withFlags) {

var enyoTasks = [
'init',
'add',
'remove',
'concat',
'min',
'server',
'lint',
'watch',
'debug',
'build'
];
Expand All @@ -55,12 +51,16 @@ function displayHelp(withFlags) {
'init:module'
];

var enyoAdds = [
'add:layout',
'add:onyx',
'add:fu',
'add:canvas',
'add:extra'
var enyoBowers = [
'install',
'add',
'uninstall',
'remove',
'update',
'search',
'lookup',
'list',
'ls'
];

var enyoOptions = [
Expand All @@ -77,67 +77,52 @@ function displayHelp(withFlags) {
'version'
];

var initDefs = {
'init:enyo': {
info: 'Basic Enyo application ' + '(Default)'.cyan
},
'init:bootplate': {
info: 'Enyo application based on Bootplate'
},
'init:module': {
info: 'Structure for Enyo modules'
}
};

var addDefs = {
'add:layout': {
info: 'Add layout package to you project'
},
'add:onyx': {
info: 'Add onyx package to you project'
},
'add:fu': {
info: 'Add fu package to you project'
},
'add:canvas': {
info: 'Add canvas package to you project'
},
'add:extra': {
info: 'Add extra package to you project'
}
};
// Taken from the Grunt init task and tweaked a little
var templates = {};
grunt.task.expandFiles('../tasks/init/*.js').forEach(function(fileobj) {
// Add template (plus its path) to the templates object.
templates[path.basename(fileobj.abs, '.js')] = require(fileobj.abs);
});

var initDefs = {};
Object.keys(templates).map(function(name) {
var description = templates[name].description || '(no description)';
initDefs['init:' + name] = {
info: description
};
});

var tasks = map(enyoTasks, grunt.task._tasks);
var inits = map(enyoInits, initDefs);
var add = map(enyoAdds, addDefs);
var bowers = map(enyoBowers, grunt.task._tasks);
var opts = map(enyoOptions, grunt.cli.optlist, true);

function displayTasks(header, tasks) {

grunt.log.header(header.cyan.bold);
grunt.log.writeln();

tasks.forEach(function(task) {
grunt.log.writetableln(widths, ['', _.pad(task.name, col1len), '', task.desc]);
});
}

if(enyoTasks.length){
displayTasks('Enyo tasks:', tasks);
displayTasks('Enyo Tasks:', tasks);
}

if(enyoInits.length){
displayTasks('Init templates:', inits);
displayTasks('Init Templates:', inits);
}

if(enyoAdds.length){
displayTasks('Packages:', add);
if(enyoBowers.length){
displayTasks('Package Management:', bowers);
}

if(withFlags && enyoOptions.length){
displayTasks('Flags:', opts);
}

function displayTasks(header, tasks) {

grunt.log.header(header.cyan.bold);
grunt.log.writeln();

tasks.forEach(function(task) {
grunt.log.writetableln(widths, ['', _.pad(task.name, col1len), '', task.desc]);
});
}

grunt.log.writeln();
}

Expand Down
3 changes: 2 additions & 1 deletion grunt.js
@@ -1,12 +1,13 @@
module.exports = function(grunt) {
'use strict';

// Project configuration.
grunt.initConfig({
test: {
files: ['test/**/*.js']
},
lint: {
files: ['grunt.js', 'tasks/*/*.js', 'test/**/*.js']
files: ['grunt.js', 'init.js', 'bin/grunt-enyo', 'tasks/*.js', 'tasks/*/*.js', 'test/**/*.js']
},
server: {},
watch: {
Expand Down
2 changes: 1 addition & 1 deletion init.js
Expand Up @@ -5,4 +5,4 @@ var path = require('path');
grunt.file.copy(
path.normalize(process.cwd() + '/licenses/LICENSE-Apache'),
path.normalize(path.dirname(require.resolve('grunt'))) + '/../tasks/init/licenses/LICENSE-Apache'
);
);
4 changes: 2 additions & 2 deletions package.json
@@ -1,7 +1,7 @@
{
"name": "enyo",
"description": "CLI for EnyoJS",
"version": "0.1.0alpha5",
"version": "0.1.0alpha6",
"homepage": "https://github.com/phated/grunt-enyo",
"author": {
"name": "Blaine Bublitz",
Expand Down Expand Up @@ -33,7 +33,7 @@
"dependencies": {
"nopt": "~2.0.0",
"grunt": "~0.3.17",
"bower": "~0.3.0"
"bower": "~0.3.x"
},
"keywords": [
"gruntplugin"
Expand Down
3 changes: 2 additions & 1 deletion tasks/build.js
@@ -1,4 +1,5 @@
module.exports = function(grunt) {
'use strict';

var path = require('path');

Expand Down Expand Up @@ -40,4 +41,4 @@ module.exports = function(grunt) {
require(minifyModule);
});

};
};
4 changes: 3 additions & 1 deletion tasks/debug.js
@@ -1,3 +1,5 @@
module.exports = function(grunt) {
'use strict';

grunt.registerTask('debug', 'static file server/watcher', 'server watch');
};
};
4 changes: 4 additions & 0 deletions tasks/init/bootplate.js
Expand Up @@ -53,6 +53,10 @@ exports.template = function(grunt, init, done) {
warning: 'Space separated list of enyo libraries dependencies'
}
], function(err, props) {
// Scrub name of hyphens and underscores
// A little heavy handed but don't want dashes at beginning because that is difficult to deal with in templates
props.name = grunt.utils._.camelize(props.name);

// Make an array out of the enyo_dependencies string
var words = grunt.utils._.words;
var clean = grunt.utils._.clean;
Expand Down
14 changes: 11 additions & 3 deletions tasks/init/bootplate/rename.json
@@ -1,4 +1,12 @@
{
"source/App.js": "source/{%= name %}.js",
"source/App.css": "source/{%= name %}.css"
}
"index.html.template": "index.html",
"index.html": false,
"debug.html.template": "debug.html",
"debug.html": false,
"source/App.js.template": "source/{%= name %}.js",
"source/App.js": false,
"source/App.css.template": "source/{%= name %}.css",
"source/App.css": false,
"source/package.js.template": "source/package.js",
"source/package.js": false
}
23 changes: 0 additions & 23 deletions tasks/init/bootplate/root/api/README.md

This file was deleted.

22 changes: 13 additions & 9 deletions tasks/init/bootplate/root/api/assets/manifest.json
@@ -1,9 +1,13 @@
[
{"name": "enyo", "path": "../enyo/source"},
{"name": "layout/fittable", "path": "../lib/layout/fittable"},
{"name": "layout/list", "path": "../lib/layout/list"},
{"name": "layout/panels", "path": "../lib/layout/panels"},
{"name": "layout/slideable", "path": "../lib/layout/slideable"},
{"name": "layout/tree", "path": "../lib/layout/tree"},
{"name": "onyx", "path": "../lib/onyx"}
]
{
"version": "2.1",
"packages": [
{"name": "enyo", "path": "../enyo/source"},
{"name": "layout/fittable", "path": "../lib/layout/fittable"},
{"name": "layout/imageview", "path": "../lib/layout/imageview"},
{"name": "layout/list", "path": "../lib/layout/list"},
{"name": "layout/panels", "path": "../lib/layout/panels"},
{"name": "layout/slideable", "path": "../lib/layout/slideable"},
{"name": "layout/tree", "path": "../lib/layout/tree"},
{"name": "onyx", "path": "../lib/onyx"}
]
}

0 comments on commit a13070d

Please sign in to comment.