diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index 2a9bc03613b7..403cdf3a5c9e 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -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. diff --git a/.nvmrc b/.nvmrc index b8626c4cff28..8b137891791f 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -4 + diff --git a/addon/ng2/blueprints/component/files/__path__/__name__.component.spec.ts b/addon/ng2/blueprints/component/files/__path__/__name__.component.spec.ts index 880bcc1c792f..bc928721d088 100644 --- a/addon/ng2/blueprints/component/files/__path__/__name__.component.spec.ts +++ b/addon/ng2/blueprints/component/files/__path__/__name__.component.spec.ts @@ -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 %>', () => { diff --git a/addon/ng2/blueprints/component/files/__path__/__name__.component.ts b/addon/ng2/blueprints/component/files/__path__/__name__.component.ts index cc31f7820898..ddef63fead2a 100644 --- a/addon/ng2/blueprints/component/files/__path__/__name__.component.ts +++ b/addon/ng2/blueprints/component/files/__path__/__name__.component.ts @@ -14,7 +14,7 @@ import { Component, OnInit } from '@angular/core'; }) export class <%= classifiedModuleName %>Component implements OnInit { - constructor() { } + constructor() {} ngOnInit() { } diff --git a/addon/ng2/blueprints/component/files/__path__/__name__.model.spec.ts b/addon/ng2/blueprints/component/files/__path__/__name__.model.spec.ts new file mode 100644 index 000000000000..4c56ef982423 --- /dev/null +++ b/addon/ng2/blueprints/component/files/__path__/__name__.model.spec.ts @@ -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(); + }); +}); diff --git a/addon/ng2/blueprints/component/files/__path__/__name__.model.ts b/addon/ng2/blueprints/component/files/__path__/__name__.model.ts new file mode 100644 index 000000000000..54c3f4c0b4cb --- /dev/null +++ b/addon/ng2/blueprints/component/files/__path__/__name__.model.ts @@ -0,0 +1,2 @@ +export class <%= classifiedModuleName %> { +} diff --git a/addon/ng2/blueprints/component/files/__path__/__name__.service.spec.ts b/addon/ng2/blueprints/component/files/__path__/__name__.service.spec.ts new file mode 100644 index 000000000000..08b55740bad8 --- /dev/null +++ b/addon/ng2/blueprints/component/files/__path__/__name__.service.spec.ts @@ -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(); + })); +}); diff --git a/addon/ng2/blueprints/component/files/__path__/__name__.service.ts b/addon/ng2/blueprints/component/files/__path__/__name__.service.ts new file mode 100644 index 000000000000..af543328afe0 --- /dev/null +++ b/addon/ng2/blueprints/component/files/__path__/__name__.service.ts @@ -0,0 +1,8 @@ +import { Injectable } from '@angular/core'; + +@Injectable() +export class <%= classifiedModuleName %>Service { + + constructor() {} + +} diff --git a/addon/ng2/blueprints/component/files/__path__/index.ts b/addon/ng2/blueprints/component/files/__path__/index.ts index 031eb01977aa..3d6d7f08c54a 100644 --- a/addon/ng2/blueprints/component/files/__path__/index.ts +++ b/addon/ng2/blueprints/component/files/__path__/index.ts @@ -1 +1,2 @@ export * from './<%= dasherizedModuleName %>.component'; +export * from './<%= dasherizedModuleName %>.service'; diff --git a/addon/ng2/blueprints/ng2/files/angular-cli-build.js b/addon/ng2/blueprints/ng2/files/angular-cli-build.js index bd905df03188..f0c78bdea010 100644 --- a/addon/ng2/blueprints/ng2/files/angular-cli-build.js +++ b/addon/ng2/blueprints/ng2/files/angular-cli-build.js @@ -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, { diff --git a/addon/ng2/blueprints/ng2/files/package.json b/addon/ng2/blueprints/ng2/files/package.json index 01ada2be0e42..2db824906965 100644 --- a/addon/ng2/blueprints/ng2/files/package.json +++ b/addon/ng2/blueprints/ng2/files/package.json @@ -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", diff --git a/addon/ng2/commands/generate.ts b/addon/ng2/commands/generate.ts index 80b34ceca9b7..fd9d03fe5df1 100644 --- a/addon/ng2/commands/generate.ts +++ b/addon/ng2/commands/generate.ts @@ -19,9 +19,9 @@ 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')); @@ -29,7 +29,7 @@ const GenerateCommand = EmberGenerateCommand.extend({ .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) { @@ -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); } }); diff --git a/addon/ng2/commands/init.js b/addon/ng2/commands/init.js index 7c7fff8aa460..7c2be559b6f9 100644 --- a/addon/ng2/commands/init.js +++ b/addon/ng2/commands/init.js @@ -94,7 +94,7 @@ module.exports = Command.extend({ return Promise.reject(new SilentError(message)); } - + var blueprintOpts = { dryRun: commandOptions.dryRun, blueprint: commandOptions.blueprint || this._defaultBlueprint(), diff --git a/addon/ng2/commands/version.ts b/addon/ng2/commands/version.ts index 5c34b91af81c..cc265b4a1e98 100644 --- a/addon/ng2/commands/version.ts +++ b/addon/ng2/commands/version.ts @@ -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', @@ -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) { diff --git a/addon/ng2/utilities/completion.sh b/addon/ng2/utilities/completion.sh index ebb5227cd06b..3eafa9a07e47 100644 --- a/addon/ng2/utilities/completion.sh +++ b/addon/ng2/utilities/completion.sh @@ -1,4 +1,4 @@ -###-begin-ng-completion### +###-begin-ng-completion### # # ng command completion script # @@ -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### \ No newline at end of file +###-end-ng-completion### diff --git a/bin/ng b/bin/ng old mode 100755 new mode 100644 index ffc6c2b830f0..f376e171abf2 --- a/bin/ng +++ b/bin/ng @@ -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 @@ -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); } diff --git a/docs/design/third-party-libraries.md b/docs/design/third-party-libraries.md index db25c5303d2d..51a7769d5dfb 100644 --- a/docs/design/third-party-libraries.md +++ b/docs/design/third-party-libraries.md @@ -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. diff --git a/lib/cli/index.js b/lib/cli/index.js index bcf0fdd2c3c5..f5fd01744f17 100644 --- a/lib/cli/index.js +++ b/lib/cli/index.js @@ -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); } @@ -78,7 +78,7 @@ 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); }; @@ -86,7 +86,7 @@ module.exports = function(options) { 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); }; @@ -94,7 +94,7 @@ module.exports = function(options) { options.cli = { name: 'ng', root: path.join(__dirname, '..', '..'), - npmPackage: 'angular-cli' + npmPackage: 'nashtech-angular-cli' }; // ensure the environemnt variable for dynamic paths diff --git a/package.json b/package.json index 4aafdb5f276e..348ddf912898 100644 --- a/package.json +++ b/package.json @@ -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", @@ -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" diff --git a/tests/acceptance/generate-class.spec.js b/tests/acceptance/generate-class.spec.js index 9215bd32cfc9..738a9db6178c 100644 --- a/tests/acceptance/generate-class.spec.js +++ b/tests/acceptance/generate-class.spec.js @@ -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); @@ -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); diff --git a/tests/acceptance/generate-route.spec.js b/tests/acceptance/generate-route.spec.js index 579d9ad2fd21..1b33ae5da526 100644 --- a/tests/acceptance/generate-route.spec.js +++ b/tests/acceptance/generate-route.spec.js @@ -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'])) diff --git a/tests/acceptance/init.spec.js b/tests/acceptance/init.spec.js index f6d7f07f4801..63bc616cb098 100644 --- a/tests/acceptance/init.spec.js +++ b/tests/acceptance/init.spec.js @@ -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); diff --git a/tests/acceptance/new.spec.js b/tests/acceptance/new.spec.js index 3f943de414dc..5d7003a3bd17 100644 --- a/tests/acceptance/new.spec.js +++ b/tests/acceptance/new.spec.js @@ -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(); diff --git a/tests/e2e/e2e_workflow.spec.js b/tests/e2e/e2e_workflow.spec.js index 5d8930bfe655..cc3843b172b6 100644 --- a/tests/e2e/e2e_workflow.spec.js +++ b/tests/e2e/e2e_workflow.spec.js @@ -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'); }); @@ -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'))); diff --git a/tests/runner.js b/tests/runner.js index 2cfdb58071fe..43900e2cc166 100644 --- a/tests/runner.js +++ b/tests/runner.js @@ -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); }