Skip to content

Commit

Permalink
more fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
hansl committed Aug 28, 2016
1 parent 342df56 commit afc5b1d
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 29 deletions.
29 changes: 16 additions & 13 deletions addon/ng2/commands/init.js → addon/ng2/commands/init.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
'use strict';

var Command = require('ember-cli/lib/models/command');
var Promise = require('ember-cli/lib/ext/promise');
var SilentError = require('silent-error');
var validProjectName = require('ember-cli/lib/utilities/valid-project-name');
var normalizeBlueprint = require('ember-cli/lib/utilities/normalize-blueprint-option');
var GitInit = require('../tasks/git-init');
var LinkCli = require('../tasks/link-cli');
var NpmInstall = require('../tasks/npm-install');

module.exports = Command.extend({
import LinkCli from '../tasks/link-cli';

const Command = require('ember-cli/lib/models/command');
const Promise = require('ember-cli/lib/ext/promise');
const SilentError = require('silent-error');
const validProjectName = require('ember-cli/lib/utilities/valid-project-name');
const normalizeBlueprint = require('ember-cli/lib/utilities/normalize-blueprint-option');
const GitInit = require('../tasks/git-init');
const NpmInstall = require('../tasks/npm-install');


const InitCommand: any = Command.extend({
name: 'init',
description: 'Creates a new angular-cli project in the current folder.',
aliases: ['i'],
Expand Down Expand Up @@ -39,7 +41,7 @@ module.exports = Command.extend({
}
},

run: function (commandOptions, rawArgs) {
run: function (commandOptions: any, rawArgs: string[]) {
if (commandOptions.dryRun) {
commandOptions.skipNpm = true;
commandOptions.skipBower = true;
Expand Down Expand Up @@ -94,7 +96,7 @@ module.exports = Command.extend({

return Promise.reject(new SilentError(message));
}

var blueprintOpts = {
dryRun: commandOptions.dryRun,
blueprint: commandOptions.blueprint || this._defaultBlueprint(),
Expand Down Expand Up @@ -146,4 +148,5 @@ module.exports = Command.extend({
}
});

module.exports.overrideCore = true;
InitCommand.overrideCore = true;
export default InitCommand;
2 changes: 1 addition & 1 deletion addon/ng2/commands/new.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const SilentError = require('silent-error');
const validProjectName = require('ember-cli/lib/utilities/valid-project-name');

const normalizeBlueprint = require('ember-cli/lib/utilities/normalize-blueprint-option');
const InitCommand = require('./init');
import InitCommand from './init';

const NewCommand = Command.extend({
name: 'new',
Expand Down
30 changes: 15 additions & 15 deletions addon/ng2/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,25 @@ module.exports = {

includedCommands: function () {
return {
'build': require('./commands/build'),
'serve': require('./commands/serve'),
'new': require('./commands/new'),
'generate': require('./commands/generate'),
'init': require('./commands/init'),
'test': require('./commands/test'),
'e2e': require('./commands/e2e'),
'lint': require('./commands/lint'),
'version': require('./commands/version'),
'completion': require('./commands/completion'),
'doc': require('./commands/doc'),
'github-pages-deploy': require('./commands/github-pages-deploy'),
'build': require('./commands/build').default,
'serve': require('./commands/serve').default,
'new': require('./commands/new').default,
'generate': require('./commands/generate').default,
'init': require('./commands/init').default,
'test': require('./commands/test').default,
'e2e': require('./commands/e2e').default,
'lint': require('./commands/lint').default,
'version': require('./commands/version').default,
'completion': require('./commands/completion').default,
'doc': require('./commands/doc').default,
'github-pages-deploy': require('./commands/github-pages-deploy').default,

// Easter eggs.
'make-this-awesome': require('./commands/easter-egg')('make-this-awesome'),
'make-this-awesome': require('./commands/easter-egg').default,

// Configuration.
'set': require('./commands/set'),
'get': require('./commands/get')
'set': require('./commands/set').default,
'get': require('./commands/get').default,
};
}
};
1 change: 1 addition & 0 deletions packages/ast-tools/src/ast-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ function _addSymbolToNgModuleMetadata(ngModulePath: string, metadataField: strin
})
.then((node: ts.Node) => {
if (!node) {
/* eslint-disable no-console */
console.log('No app module found. Please add your new class to your component.');
return new NoopChange();
}
Expand Down

0 comments on commit afc5b1d

Please sign in to comment.