Skip to content

Commit

Permalink
Merge branch 'master' into webpack-feature-basehref
Browse files Browse the repository at this point in the history
  • Loading branch information
dzonatan authored Aug 16, 2016
2 parents b216b06 + fa7a927 commit b3925fc
Show file tree
Hide file tree
Showing 52 changed files with 2,046 additions and 502 deletions.
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
<a name="1.0.0-beta.11-webpack.2"></a>
# [1.0.0-beta.11-webpack.2](https://github.com/angular/angular-cli/compare/v1.0.0-beta.10-webpack...v1.0.0-beta.11-webpack.2) (2016-08-10)


### Bug Fixes

* **webpack-copy:** copies files from public/ directory to dist/ and preserves references ([b11bc94](https://github.com/angular/angular-cli/commit/b11bc94))
* Set fs building/polyfill empty for better package support ([#1599](https://github.com/angular/angular-cli/issues/1599)) ([560ae8f](https://github.com/angular/angular-cli/commit/560ae8f))
* Updated webpack-karma which has proper peer deps settings ([#1597](https://github.com/angular/angular-cli/issues/1597)) ([ace720b](https://github.com/angular/angular-cli/commit/ace720b))


### Features

* add utility functions for route generation ([#1330](https://github.com/angular/angular-cli/issues/1330)) ([4fd8e9c](https://github.com/angular/angular-cli/commit/4fd8e9c))
* ngmodules and insert components based on the AST ([#1616](https://github.com/angular/angular-cli/issues/1616)) ([5bcb7be](https://github.com/angular/angular-cli/commit/5bcb7be))



<a name="1.0.0-beta.11-webpack"></a>
# [1.0.0-beta.11-webpack](https://github.com/angular/angular-cli/compare/v1.0.0-beta.10...v1.0.0-beta.11-webpack) (2016-08-02)

Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ We're updating the build system in Angular-CLI to use webpack instead of Broccol

You can install and update your projects using [these instructions](https://github.com/angular/angular-cli/blob/master/WEBPACK_UPDATE.md).

**The current instructions on this file reflect usage for the `webpack` version.**

## Prerequisites

The generated project has dependencies that require **Node 4 or greater**.
Expand Down
1 change: 1 addition & 0 deletions WEBPACK_UPDATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ Here is a summary of the file changes:

Lastly, you can delete these files as they are not needed anymore.
* `./config/karma-test-shim.js`
* `./config/environment.js`
* `./src/system-config.ts`
* `./angular-cli-build.js`
* `./typings.json`
Expand Down
8 changes: 0 additions & 8 deletions addon/ng2/blueprints/class/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const stringUtils = require('ember-cli-string-utils');
var dynamicPathParser = require('../../utilities/dynamic-path-parser');
var addBarrelRegistration = require('../../utilities/barrel-management');

module.exports = {
description: '',
Expand Down Expand Up @@ -40,12 +39,5 @@ module.exports = {
return this.fileName;
}
};
},

afterInstall: function() {
return addBarrelRegistration(
this,
this.generatePath,
this.fileName);
}
};
1 change: 0 additions & 1 deletion addon/ng2/blueprints/component/files/__path__/index.ts

This file was deleted.

Empty file.
34 changes: 17 additions & 17 deletions addon/ng2/blueprints/component/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ var path = require('path');
var chalk = require('chalk');
var Blueprint = require('ember-cli/lib/models/blueprint');
var dynamicPathParser = require('../../utilities/dynamic-path-parser');
var addBarrelRegistration = require('../../utilities/barrel-management');
var getFiles = Blueprint.prototype.files;
const stringUtils = require('ember-cli-string-utils');
const astUtils = require('../../utilities/ast-utils');

module.exports = {
description: '',
Expand All @@ -15,7 +15,7 @@ module.exports = {
{ name: 'inline-template', type: Boolean, default: false, aliases: ['it'] },
{ name: 'inline-style', type: Boolean, default: false, aliases: ['is'] },
{ name: 'prefix', type: Boolean, default: true },
{ name: 'nospec', type: Boolean, default: false }
{ name: 'spec', type: Boolean, default: true }
],

normalizeEntityName: function (entityName) {
Expand Down Expand Up @@ -50,7 +50,7 @@ module.exports = {
return {
dynamicPath: this.dynamicPath.dir.replace(this.dynamicPath.appRoot, ''),
flat: options.flat,
nospec: options.nospec,
spec: options.spec,
inlineTemplate: options.inlineTemplate,
inlineStyle: options.inlineStyle,
route: options.route,
Expand All @@ -64,19 +64,13 @@ module.exports = {
files: function() {
var fileList = getFiles.call(this);

if (this.options && this.options.flat) {
fileList = fileList.filter(p => p.indexOf('index.ts') <= 0);
}
if (this.options && !this.options.route) {
fileList = fileList.filter(p => p.indexOf(path.join('shared', 'index.ts')) <= 0);
}
if (this.options && this.options.inlineTemplate) {
fileList = fileList.filter(p => p.indexOf('.html') < 0);
}
if (this.options && this.options.inlineStyle) {
fileList = fileList.filter(p => p.indexOf('.__styleext__') < 0);
}
if (this.options && this.options.nospec) {
if (this.options && !this.options.spec) {
fileList = fileList.filter(p => p.indexOf('__name__.component.spec.ts') < 0);
}

Expand Down Expand Up @@ -119,13 +113,19 @@ module.exports = {
return;
}

if (!options.flat) {
return addBarrelRegistration(this, this.generatePath);
} else {
return addBarrelRegistration(
this,
this.generatePath,
options.entity.name + '.component');
const returns = [];
const modulePath = path.join(this.project.root, this.dynamicPath.appRoot, 'app.module.ts');
const className = stringUtils.classify(`${options.entity.name}Component`);
const fileName = stringUtils.dasherize(`${options.entity.name}.component`);
const componentDir = path.relative(this.dynamicPath.appRoot, this.generatePath);
const importPath = componentDir ? `./${componentDir}/${fileName}` : `./${fileName}`;

if (!options['skip-import']) {
returns.push(
astUtils.addComponentToModule(modulePath, className, importPath)
.then(change => change.apply()));
}

return Promise.all(returns);
}
};
1 change: 0 additions & 1 deletion addon/ng2/blueprints/directive/files/__path__/index.ts

This file was deleted.

41 changes: 19 additions & 22 deletions addon/ng2/blueprints/directive/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
var path = require('path');
var Blueprint = require('ember-cli/lib/models/blueprint');
var dynamicPathParser = require('../../utilities/dynamic-path-parser');
var addBarrelRegistration = require('../../utilities/barrel-management');
var getFiles = Blueprint.prototype.files;
const stringUtils = require('ember-cli-string-utils');
const astUtils = require('../../utilities/ast-utils');

module.exports = {
description: '',
Expand All @@ -27,16 +26,6 @@ module.exports = {
};
},

files: function() {
var fileList = getFiles.call(this);

if (this.options && this.options.flat) {
fileList = fileList.filter(p => p.indexOf('index.ts') <= 0);
}

return fileList;
},

fileMapTokens: function (options) {
// Return custom template variables here.
return {
Expand All @@ -52,15 +41,23 @@ module.exports = {
},

afterInstall: function(options) {
if (!options.flat) {
return addBarrelRegistration(
this,
this.generatePath);
} else {
return addBarrelRegistration(
this,
this.generatePath,
options.entity.name + '.directive');
if (options.dryRun) {
return;
}

const returns = [];
const modulePath = path.join(this.project.root, this.dynamicPath.appRoot, 'app.module.ts');
const className = stringUtils.classify(`${options.entity.name}`);
const fileName = stringUtils.dasherize(`${options.entity.name}.directive`);
const componentDir = path.relative(this.dynamicPath.appRoot, this.generatePath);
const importPath = componentDir ? `./${componentDir}/${fileName}` : `./${fileName}`;

if (!options['skip-import']) {
returns.push(
astUtils.addComponentToModule(modulePath, className, importPath)
.then(change => change.apply()));
}

return Promise.all(returns);
}
};
8 changes: 0 additions & 8 deletions addon/ng2/blueprints/enum/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const stringUtils = require('ember-cli-string-utils');
var dynamicPathParser = require('../../utilities/dynamic-path-parser');
var addBarrelRegistration = require('../../utilities/barrel-management');

module.exports = {
description: '',
Expand Down Expand Up @@ -33,12 +32,5 @@ module.exports = {
return this.fileName;
}
};
},

afterInstall: function() {
return addBarrelRegistration(
this,
this.generatePath,
this.fileName);
}
};
8 changes: 0 additions & 8 deletions addon/ng2/blueprints/interface/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const stringUtils = require('ember-cli-string-utils');
var dynamicPathParser = require('../../utilities/dynamic-path-parser');
var addBarrelRegistration = require('../../utilities/barrel-management');

module.exports = {
description: '',
Expand Down Expand Up @@ -47,12 +46,5 @@ module.exports = {
return this.fileName;
}
};
},

afterInstall: function() {
return addBarrelRegistration(
this,
this.generatePath,
this.fileName);
}
};
30 changes: 12 additions & 18 deletions addon/ng2/blueprints/mobile/files/__path__/manifest.webapp
Original file line number Diff line number Diff line change
Expand Up @@ -3,40 +3,34 @@
"short_name": "<%= fullAppName %>",
"icons": [
{
"src": "/android-chrome-36x36.png",
"src": "icons/android-chrome-36x36.png",
"sizes": "36x36",
"type": "image/png",
"density": 0.75
"type": "image/png"
},
{
"src": "/android-chrome-48x48.png",
"src": "icons/android-chrome-48x48.png",
"sizes": "48x48",
"type": "image/png",
"density": 1
"type": "image/png"
},
{
"src": "/android-chrome-72x72.png",
"src": "icons/android-chrome-72x72.png",
"sizes": "72x72",
"type": "image/png",
"density": 1.5
"type": "image/png"
},
{
"src": "/android-chrome-96x96.png",
"src": "icons/android-chrome-96x96.png",
"sizes": "96x96",
"type": "image/png",
"density": 2
"type": "image/png"
},
{
"src": "/android-chrome-144x144.png",
"src": "icons/android-chrome-144x144.png",
"sizes": "144x144",
"type": "image/png",
"density": 3
"type": "image/png"
},
{
"src": "/android-chrome-192x192.png",
"src": "icons/android-chrome-192x192.png",
"sizes": "192x192",
"type": "image/png",
"density": 4
"type": "image/png"
}
],
"theme_color": "#000000",
Expand Down
15 changes: 15 additions & 0 deletions addon/ng2/blueprints/module/files/__path__/__name__.module.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/* tslint:disable:no-unused-variable */

import <%= classifiedModuleName %>Module from './<%= dasherizedModuleName %>.module';

describe('<%= classifiedModuleName %>Module', () => {
let <%= camelizedModuleName %>Module;

beforeEach(() => {
<%= camelizedModuleName %>Module = new <%= classifiedModuleName %>Module();
});

it('should create an instance', () => {
expect(<%= camelizedModuleName %>Module).toBeTruthy();
})
});
8 changes: 8 additions & 0 deletions addon/ng2/blueprints/module/files/__path__/__name__.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';

@NgModule({
imports: [ CommonModule ],
declarations: []
})
export default class <%= classifiedModuleName %>Module { }
45 changes: 45 additions & 0 deletions addon/ng2/blueprints/module/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
var dynamicPathParser = require('../../utilities/dynamic-path-parser');
var Blueprint = require('ember-cli/lib/models/blueprint');
var getFiles = Blueprint.prototype.files;

module.exports = {
description: '',

availableOptions: [
{ name: 'spec', type: Boolean, default: false }
],

normalizeEntityName: function (entityName) {
var parsedPath = dynamicPathParser(this.project, entityName);

this.dynamicPath = parsedPath;
return parsedPath.name;
},

locals: function (options) {
return {
dynamicPath: this.dynamicPath.dir,
spec: options.spec
};
},

files: function() {
var fileList = getFiles.call(this);

if (!this.options || !this.options.spec) {
fileList = fileList.filter(p => p.indexOf('__name__.module.spec.ts') < 0);
}

return fileList;
},

fileMapTokens: function () {
// Return custom template variables here.
return {
__path__: () => {
this.generatePath = this.dynamicPath.dir;
return this.generatePath;
}
};
}
};
21 changes: 21 additions & 0 deletions addon/ng2/blueprints/ng2/files/__path__/app/app.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms'
import { HttpModule } from '@angular/http'

import { AppComponent } from './app.component';

@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
FormsModule,
HttpModule
],
providers: [],
entryComponents: [AppComponent],
bootstrap: [AppComponent]
})
export class AppModule { }
1 change: 1 addition & 0 deletions addon/ng2/blueprints/ng2/files/__path__/app/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export * from './environments/environment';
export * from './app.component';
export * from './app.module';
Loading

0 comments on commit b3925fc

Please sign in to comment.