Skip to content

master #1365

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 6 commits into from
Closed

master #1365

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
1. OS? Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)


2. Versions. Please run `ng --version`. If there's nothing outputted, please
2. Versions. Please run `ntng --version`. If there's nothing outputted, please
run in a Terminal:
node --version
And paste the result here.
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,14 @@

import { By } from '@angular/platform-browser';
import { DebugElement } from '@angular/core';
import { addProviders, async, inject } from '@angular/core/testing';

import {
beforeEach, beforeEachProviders,
describe, xdescribe,
expect, it, xit,
async, inject
} from '@angular/core/testing';

import { <%= classifiedModuleName %>Component } from './<%= dasherizedModuleName %>.component';

describe('Component: <%= classifiedModuleName %>', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { Component, OnInit } from '@angular/core';
})
export class <%= classifiedModuleName %>Component implements OnInit {

constructor() { }
constructor() {}

ngOnInit() {
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/* tslint:disable:no-unused-variable */

import {
beforeEach, beforeEachProviders,
describe, xdescribe,
expect, it, xit,
async, inject
} from '@angular/core/testing';
import {<%= classifiedModuleName %>} from './<%= dasherizedModuleName %>.model';

describe('<%= classifiedModuleName %>', () => {
it('should create an instance', () => {
expect(new <%= classifiedModuleName %>()).toBeTruthy();
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export class <%= classifiedModuleName %> {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/* tslint:disable:no-unused-variable */

import {
beforeEach, beforeEachProviders,
describe, xdescribe,
expect, it, xit,
async, inject
} from '@angular/core/testing';
import { <%= classifiedModuleName %>Service } from './<%= dasherizedModuleName %>.service';

describe('<%= classifiedModuleName %> Service', () => {
beforeEachProviders(() => [<%= classifiedModuleName %>Service]);

it('should ...',
inject([<%= classifiedModuleName %>Service], (service: <%= classifiedModuleName %>Service) => {
expect(service).toBeTruthy();
}));
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { Injectable } from '@angular/core';

@Injectable()
export class <%= classifiedModuleName %>Service {

constructor() {}

}
1 change: 1 addition & 0 deletions addon/ng2/blueprints/component/files/__path__/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export * from './<%= dasherizedModuleName %>.component';
export * from './<%= dasherizedModuleName %>.service';
2 changes: 1 addition & 1 deletion addon/ng2/blueprints/ng2/files/angular-cli-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

/* global require, module */

var Angular2App = require('angular-cli/lib/broccoli/angular2-app');
var Angular2App = require('nashtech-angular-cli/lib/broccoli/angular2-app');

module.exports = function(defaults) {
return new Angular2App(defaults, {
Expand Down
2 changes: 1 addition & 1 deletion addon/ng2/blueprints/ng2/files/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"angular2-universal":"0.104.5",
"angular2-universal-polyfills": "0.4.1",
"preboot": "2.0.10",<% } %>
"angular-cli": "<%= version %>",
"nashtech-angular-cli": "<%= version %>",
"codelyzer": "0.0.20",
"ember-cli-inject-live-reload": "1.4.0",
"jasmine-core": "2.4.1",
Expand Down
8 changes: 4 additions & 4 deletions addon/ng2/commands/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@ const GenerateCommand = EmberGenerateCommand.extend({

if (rawArgs[0] !== '--help' &&
!fs.existsSync(path.join(__dirname, '..', 'blueprints', rawArgs[0]))) {
SilentError.debugOrThrow('angular-cli/commands/generate', `Invalid blueprint: ${rawArgs[0]}`);
SilentError.debugOrThrow('nashtech-angular-cli/commands/generate', `Invalid blueprint: ${rawArgs[0]}`);
}

// Override default help to hide ember blueprints
EmberGenerateCommand.prototype.printDetailedHelp = function (options) {
var blueprintList = fs.readdirSync(path.join(__dirname, '..', 'blueprints'));
var blueprints = blueprintList
.filter(bp => bp.indexOf('-test') === -1)
.filter(bp => bp !== 'ng2')
.map(bp => Blueprint.load(path.join(__dirname, '..', 'blueprints', bp)));

var output = '';
blueprints
.forEach(function (bp) {
Expand All @@ -38,7 +38,7 @@ const GenerateCommand = EmberGenerateCommand.extend({
this.ui.writeLine(chalk.cyan(' Available blueprints'));
this.ui.writeLine(output);
};

return EmberGenerateCommand.prototype.beforeRun.apply(this, arguments);
}
});
Expand Down
2 changes: 1 addition & 1 deletion addon/ng2/commands/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ module.exports = Command.extend({

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

var blueprintOpts = {
dryRun: commandOptions.dryRun,
blueprint: commandOptions.blueprint || this._defaultBlueprint(),
Expand Down
4 changes: 2 additions & 2 deletions addon/ng2/commands/version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import * as child_process from 'child_process';

const VersionCommand = Command.extend({
name: 'version',
description: 'outputs angular-cli version',
description: 'outputs nashtech-angular-cli version',
aliases: ['v', '--version', '-v'],
works: 'everywhere',

Expand Down Expand Up @@ -33,7 +33,7 @@ const VersionCommand = Command.extend({
ngCliVersion = `local (v${pkg.version}, branch: ${gitBranch})`;
}

this.printVersion('angular-cli', ngCliVersion);
this.printVersion('nashtech-angular-cli', ngCliVersion);

for (var module in versions) {
if (options.verbose || alwaysPrint.indexOf(module) > -1) {
Expand Down
6 changes: 3 additions & 3 deletions addon/ng2/utilities/completion.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
###-begin-ng-completion###
###-begin-ng-completion###
#
# ng command completion script
#
Expand Down Expand Up @@ -53,11 +53,11 @@ elif type compctl &>/dev/null; then
g|generate) opts=$generate_opts ;;
test) opts=$test_opts ;;
esac

setopt shwordsplit
reply=($opts)
unset shwordsplit
}
compctl -K _ng_completion ng
fi
###-end-ng-completion###
###-end-ng-completion###
6 changes: 4 additions & 2 deletions bin/ng
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,18 @@
'use strict';

// Provide a title to the process in `ps`
process.title = 'angular-cli';
process.title = 'nashtech-angular-cli';

const resolve = require('resolve');
const exit = require('exit');
const packageJson = require('../package.json');
const Leek = require('leek');

resolve('angular-cli', { basedir: process.cwd() },
resolve('nashtech-angular-cli', { basedir: process.cwd() },
function (error, projectLocalCli) {
var cli;
if (error) {

// If there is an error, resolve could not find the ember-cli
// library from a package.json. Instead, include it from a relative
// path to this script file (which is likely a globally installed
Expand All @@ -21,6 +22,7 @@ resolve('angular-cli', { basedir: process.cwd() },
} else {
// No error implies a projectLocalCli, which will load whatever
// version of ember-cli you have installed in a local package.json

cli = require(projectLocalCli);
}

Expand Down
2 changes: 1 addition & 1 deletion docs/design/third-party-libraries.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ The third party library can implement hooks into the scaffolding, and the build
CLI's tasks will look for the proper hooks prior to running and execute them.

The order of execution of these hooks is breadth first, going through all node packages and
checking for the `package['angular-cli']['hooks']['${hookName}']`. The hooks are then
checking for the `package['nashtech-angular-cli']['hooks']['${hookName}']`. The hooks are then
`require()`'d as is, from within the app root folder. Within the same level of the dependency
tree, there is no guarantee for the order of execution.

Expand Down
8 changes: 4 additions & 4 deletions lib/cli/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ require.extensions['.ts'] = function(m, filename) {
// If we're in node module, either call the old hook or simply compile the
// file without transpilation. We do not touch node_modules/**.
// We do touch `angular-cli` files anywhere though.
if (!filename.match(/angular-cli/) && filename.match(/node_modules/)) {
if (!filename.match(/nashtech-angular-cli/) && filename.match(/node_modules/)) {
if (old) {
return old(m, filename);
}
Expand Down Expand Up @@ -78,23 +78,23 @@ module.exports = function(options) {
// don't replace 'ember-cli-live-reload' on ng init diffs
return oldStdoutWrite.apply(process.stdout, arguments);
}
line = line.replace(/ember-cli(?!.com)/g, 'angular-cli')
line = line.replace(/ember-cli(?!.com)/g, 'nashtech-angular-cli')
.replace(/ember(?!-cli.com)/g, 'ng');
return oldStdoutWrite.apply(process.stdout, arguments);
};

const oldStderrWrite = process.stderr.write;
process.stderr.write = function (line) {
line = line.toString()
.replace(/ember-cli(?!.com)/g, 'angular-cli')
.replace(/ember-cli(?!.com)/g, 'nashtech-angular-cli')
.replace(/ember(?!-cli.com)/g, 'ng');
return oldStderrWrite.apply(process.stdout, arguments);
};

options.cli = {
name: 'ng',
root: path.join(__dirname, '..', '..'),
npmPackage: 'angular-cli'
npmPackage: 'nashtech-angular-cli'
};

// ensure the environemnt variable for dynamic paths
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-cli",
"version": "1.0.0-beta.9",
"name": "nashtech-angular-cli",
"version": "1.0.0-beta.11",
"description": "CLI tool for Angular",
"main": "lib/cli/index.js",
"trackingCode": "UA-8594346-19",
Expand All @@ -15,7 +15,7 @@
},
"repository": {
"type": "git",
"url": "https://github.com/angular/angular-cli.git"
"url": "https://github.com/nguyenletan/angular-cli.git"
},
"engines": {
"node": ">= 4.1.0"
Expand Down
4 changes: 2 additions & 2 deletions tests/acceptance/generate-class.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ describe('Acceptance: ng generate class', function () {
expect(existsSync(path.join(testPath, 'my-class.ts'))).to.equal(true);
});
});

it('ng generate class my-class model', function () {
return ng(['generate', 'class', 'my-class', 'model']).then(() => {
expect(existsSync(path.join(testPath, 'my-class.model.ts'))).to.equal(true);
Expand All @@ -47,7 +47,7 @@ describe('Acceptance: ng generate class', function () {
expect(existsSync(path.join(testPath, 'shared', 'my-class.ts'))).to.equal(true);
});
});

it(`ng generate class shared${path.sep}my-class model`, function () {
return ng(['generate', 'class', 'shared/my-class', 'model']).then(() => {
expect(existsSync(path.join(testPath, 'shared', 'my-class.model.ts'))).to.equal(true);
Expand Down
2 changes: 1 addition & 1 deletion tests/acceptance/generate-route.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ xdescribe('Acceptance: ng generate route', function () {
expect(afterGenerateParentHtml).to.equal(unmodifiedParentComponentHtml);
});
});

it('lazy route prefix', () => {
return ng(['set', 'defaults.lazyRoutePrefix', 'myprefix'])
.then(() => ng(['generate', 'route', 'prefix-test']))
Expand Down
2 changes: 1 addition & 1 deletion tests/acceptance/init.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ describe('Acceptance: ng init', function () {
expected[index] = expected[index].replace(/__styleext__/g, 'css');
expected[index] = expected[index].replace(/__path__/g, 'src');
});

if (isMobile) {
expected = expected.filter(p => p.indexOf('tmp.component.html') < 0);
expected = expected.filter(p => p.indexOf('tmp.component.css') < 0);
Expand Down
2 changes: 1 addition & 1 deletion tests/acceptance/new.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ describe('Acceptance: ng new', function () {
});

expected.forEach(function (file, index) {
expected[index] = file.replace(/__name__/g, 'angular-cli');
expected[index] = file.replace(/__name__/g, 'nashtech-angular-cli');
});

expected.sort();
Expand Down
4 changes: 2 additions & 2 deletions tests/e2e/e2e_workflow.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ describe('Basic end-to-end Workflow', function () {
this.timeout(300000);

sh.exec('npm pack', { silent: true });
expect(existsSync(path.join(process.cwd(), `angular-cli-${repoPkgJson.version}.tgz`)));
expect(existsSync(path.join(process.cwd(), `nashtech-angular-cli-${repoPkgJson.version}.tgz`)));
return tmp.setup('./tmp').then(function () {
process.chdir('./tmp');
});
Expand All @@ -65,7 +65,7 @@ describe('Basic end-to-end Workflow', function () {
}
return ng(['new', 'test-project'].concat(args)).then(function () {
// Install Angular CLI from packed version
let tarball = path.resolve(root, `../angular-cli-${repoPkgJson.version}.tgz`);
let tarball = path.resolve(root, `../nashtech-angular-cli-${repoPkgJson.version}.tgz`);
sh.exec(`npm install && npm install ${tarball}`);
sh.exec(`rm ${tarball}`);
expect(existsSync(path.join(root, 'test-project')));
Expand Down
2 changes: 1 addition & 1 deletion tests/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const ts = require('typescript');
const old = require.extensions['.ts'];

require.extensions['.ts'] = function(m, filename) {
if (!filename.match(/angular-cli/) && filename.match(/node_modules/)) {
if (!filename.match(/nashtech-angular-cli/) && filename.match(/node_modules/)) {
if (old) {
return old(m, filename);
}
Expand Down