ember-cli
Advanced tools
Comparing version 0.0.1 to 0.0.2
@@ -12,7 +12,7 @@ var broccoli = require('broccoli'), | ||
broccoli.server.serve(getBuilder(), { | ||
host: '0.0.0.0', | ||
port: (process.env.PORT || 4200) | ||
host: options.host, | ||
port: options.port | ||
}); | ||
return Promise.resolve(); // server current runs forever | ||
return new Promise(function(){ }); // runs for-ever | ||
}; |
@@ -5,3 +5,2 @@ var nopt = require('nopt'), | ||
Promise = RSVP.Promise, | ||
rest = require('lodash-node/modern/arrays/rest'), | ||
merge = require('lodash-node/modern/objects/merge'), | ||
@@ -35,5 +34,7 @@ path = require('path'), | ||
function Cli(argv, commands, ui) { | ||
this.argv = argv; | ||
this.opts = nopt(types, shorthands, argv); | ||
this.cmd = this.opts.argv.remain[0]; | ||
this.commands = commands; | ||
this.ui = ui; | ||
@@ -55,6 +56,5 @@ } | ||
var opts = nopt.apply(null, action.options); | ||
var opts = nopt(action.types, action.shorthands, this.argv); | ||
var args = rest(this.opts.argv.remain); | ||
var options = merge(opts, { | ||
var options = merge({}, opts, { | ||
appRoot: process.cwd(), | ||
@@ -64,5 +64,3 @@ cliRoot: path.resolve(path.join(__dirname, '..')) | ||
args.push(options); | ||
return action.run.apply(this, args); | ||
return action.run(options); | ||
}; | ||
@@ -69,0 +67,0 @@ |
@@ -8,7 +8,9 @@ var Promise = require('rsvp').Promise, | ||
module.exports.options = [{ | ||
module.exports.types = { | ||
output: path | ||
}, { | ||
}; | ||
module.exports.shorthands = { | ||
o: ['output'] | ||
}]; | ||
}; | ||
@@ -15,0 +17,0 @@ module.exports.run = function run(env, options) { |
@@ -8,3 +8,3 @@ var path = require('path'), | ||
module.exports.options = { | ||
module.exports.types = { | ||
dryRun: [Boolean] | ||
@@ -11,0 +11,0 @@ }; |
@@ -8,15 +8,26 @@ var Promise = require('rsvp').Promise, | ||
module.exports.options = [{ | ||
module.exports.types = { | ||
'port': Number, | ||
'host': String, | ||
'autotest': Boolean, // TODO | ||
'environment': ['development', 'production'], | ||
'environment': [ | ||
'development', | ||
'production' | ||
], | ||
'app': path | ||
}]; | ||
}; | ||
module.exports.shorthands = { | ||
p: '--port' | ||
}; | ||
var DEFAULT_PORT = process.env.PORT || 4200; | ||
var DEFAULT_HOST = '0.0.0.0'; | ||
module.exports.run = function run(options) { | ||
var adapter = adapt.to('broccoli'); | ||
adapter.server(options); | ||
return new Promise(function(){ }); // runs for-ever | ||
options.port = options.port || DEFAULT_PORT; | ||
options.host = options.host || DEFAULT_HOST; | ||
return adapter.server(options); | ||
}; | ||
@@ -27,3 +38,4 @@ | ||
' --autotest ' + chalk.green('[default: false]')+'\n' + | ||
' --port ' + chalk.green('[default: 8000]')+'\n' + | ||
' --port ' + chalk.green('[default: ' + DEFAULT_PORT + ']') + '\n' + | ||
' --host ' + chalk.green('[default: ' + DEFAULT_HOST + ']') + '\n' + | ||
' --subscribe ' + chalk.green('[default:release, optional: (beta|canary)]')+'\n' + | ||
@@ -30,0 +42,0 @@ ' ' + chalk.green('#') + ' on "start" of an app, it will prompt the user if the channel they\n' + |
{ | ||
"name": "ember-cli", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "Command line tool for developing ambitious ember.js apps", | ||
@@ -33,3 +33,3 @@ "bin": { | ||
"dependencies": { | ||
"broccoli": "0.2.4", | ||
"broccoli": "0.3.0", | ||
"lodash-node": "~2.4.1", | ||
@@ -36,0 +36,0 @@ "chalk": "~0.4.0", |
@@ -1,2 +0,2 @@ | ||
ember-cli | ||
ember-cli [![Build Status](https://travis-ci.org/stefanpenner/ember-cli.png?branch=master)](https://travis-ci.org/stefanpenner/ember-cli) | ||
========= | ||
@@ -12,2 +12,15 @@ | ||
Getting Started | ||
=============== | ||
```sh | ||
npm install -g ember-cli | ||
mkdir my-cool-app | ||
cd my-cool-app | ||
ember init | ||
ember server | ||
``` | ||
Why? | ||
@@ -14,0 +27,0 @@ ==== |
@@ -1,2 +0,2 @@ | ||
import Resolver from 'resolver'; | ||
import Resolver from 'ember/resolver'; | ||
@@ -3,0 +3,0 @@ var App = Ember.Application.extend({ |
{ | ||
"name": "ember-app-kit", | ||
"dependencies": { | ||
"handlebars": "~1.1.2", | ||
"handlebars": "~1.3.0", | ||
"jquery": "~1.9.1", | ||
"qunit": "~1.12.0", | ||
"ember": "~1.4.0-beta.2", | ||
"ember": "~1.4.0", | ||
"ember-data": "~1.0.0-beta.6", | ||
@@ -12,6 +12,3 @@ "ember-resolver": "git://github.com/stefanpenner/ember-jj-abrams-resolver.git#master", | ||
"ember-testing-httpRespond": "~0.1.1" | ||
}, | ||
"resolutions": { | ||
"ember": "~1.4.0-beta.2" | ||
} | ||
} |
@@ -54,3 +54,3 @@ /* global require, module */ | ||
ignoredModules: [ | ||
'resolver' | ||
'ember/resolver' | ||
], | ||
@@ -57,0 +57,0 @@ inputFiles: [ |
@@ -24,14 +24,13 @@ { | ||
"devDependencies": { | ||
"bower": "~1.2.7", | ||
"loom-generators-ember-appkit": "~1.0.2", | ||
"bower": "~1.2.8", | ||
"loom-generators-ember-appkit": "~1.0.5", | ||
"originate": "~0.1.5", | ||
"loom": "~3.1.2", | ||
"broccoli-cli": "0.0.1", | ||
"broccoli-es6-concatenator": "0.0.7", | ||
"broccoli": "~0.2.0", | ||
"broccoli-static-compiler": "0.0.5", | ||
"broccoli-template": "0.0.5", | ||
"broccoli-uglify-js": "0.0.4", | ||
"broccoli-es6-concatenator": "0.1.0", | ||
"broccoli": "~0.2.4", | ||
"broccoli-static-compiler": "0.1.1", | ||
"broccoli-template": "0.1.0", | ||
"broccoli-uglify-js": "0.1.0", | ||
"broccoli-env": "0.0.1" | ||
} | ||
} |
@@ -29,3 +29,7 @@ var describe = require('mocha').describe; | ||
function command(name) { | ||
commands[name] = {}; | ||
var mod; | ||
try { | ||
mod = require('../../lib/commands/' + name); | ||
} catch(e) { } | ||
commands[name] = mod || {}; | ||
return stub(commands[name], 'run'); | ||
@@ -63,2 +67,7 @@ } | ||
it("ember -v", function(){ | ||
ember(['-v']); | ||
assert(/ember-cli \d+\.\d+\.\d+/.test(ui.output[0]), 'expected the output to contain the version string'); | ||
}); | ||
it("ember --help", function(){ | ||
@@ -70,5 +79,66 @@ var help = command('help'); | ||
assert.equal(help.called, 1, 'expected the help command to be run'); | ||
assert.deepEqual(ui.output, [], 'expected no outout'); | ||
assert.deepEqual(ui.output, [], 'expected no output'); | ||
}); | ||
it("ember -h", function(){ | ||
var help = command('help'); | ||
ember(['-h']); | ||
assert.equal(help.called, 1, 'expected the help command to be run'); | ||
assert.deepEqual(ui.output, [], 'expected no output'); | ||
}); | ||
it("ember --help --version", function(){ | ||
var help = command('help'); | ||
ember(['--version', '--help']); | ||
// --version takes priority | ||
assert.equal(help.called, 0, 'expected the help command to be run'); | ||
assert(/ember-cli \d+\.\d+\.\d+/.test(ui.output[0]), 'expected the output to contain the version string'); | ||
assert.deepEqual(ui.output.length, 1, 'expected one line of output'); | ||
}); | ||
it("ember server --port 9999", function(){ | ||
var server = command('server'); | ||
ember(['server', '--port', '9999']); | ||
assert.equal(server.called, 1, 'expected the server command to be run'); | ||
assert.equal(server.calledWith[0][0].port, 9999, 'correct port'); | ||
assert.deepEqual(ui.output.length, 0, 'expected one line of output'); | ||
}); | ||
it("ember server -p 9999", function(){ | ||
var server = command('server'); | ||
ember(['server', '-p', '9999']); | ||
assert.equal(server.called, 1, 'expected the server command to be run'); | ||
assert.equal(server.calledWith[0][0].port, 9999, 'correct port'); | ||
assert.deepEqual(ui.output.length, 0, 'expected one line of output'); | ||
}); | ||
it("ember server --host localhost", function(){ | ||
var server = command('server'); | ||
ember(['server', '--host', 'localhost']); | ||
assert.equal(server.called, 1, 'expected the server command to be run'); | ||
assert.equal(server.calledWith[0][0].host, 'localhost', 'correct localhost'); | ||
assert.deepEqual(ui.output.length, 0, 'expected one line of output'); | ||
}); | ||
it("ember server --port 9292 --host localhost", function(){ | ||
var server = command('server'); | ||
ember(['server', '--port', '9292', '--host', 'localhost']); | ||
assert.equal(server.called, 1, 'expected the server command to be run'); | ||
assert.equal(server.calledWith[0][0].host, 'localhost', 'correct localhost'); | ||
assert.equal(server.calledWith[0][0].port, '9292', 'correct localhost'); | ||
assert.deepEqual(ui.output.length, 0, 'expected one line of output'); | ||
}); | ||
it("ember <valid command>", function(){ | ||
@@ -75,0 +145,0 @@ var help = command('help'); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
51783
89
1308
128
8
Updatedbroccoli@0.3.0