Skip to content

Commit d111286

Browse files
committed
Merge branch 'master' of https://github.com/yeoman/generator-angular into add-decorator-generator
2 parents 3564d0b + fce54bd commit d111286

File tree

7 files changed

+14
-14
lines changed

7 files changed

+14
-14
lines changed

app/index.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ var Generator = module.exports = function Generator(args, options) {
1414

1515
if (typeof this.env.options.appPath === 'undefined') {
1616
try {
17-
this.env.options.appPath = require(path.join(process.cwd(), 'component.json')).appPath;
17+
this.env.options.appPath = require(path.join(process.cwd(), 'bower.json')).appPath;
1818
} catch (e) {}
1919
this.env.options.appPath = this.env.options.appPath || 'app';
2020
}
@@ -103,17 +103,17 @@ Generator.prototype.askForModules = function askForModules() {
103103
name: 'resourceModule',
104104
message: 'Would you like to include angular-resource.js?',
105105
default: 'Y/n',
106-
warning: 'Yes: angular-resource added to component.json'
106+
warning: 'Yes: angular-resource added to bower.json'
107107
}, {
108108
name: 'cookiesModule',
109109
message: 'Would you like to include angular-cookies.js?',
110110
default: 'Y/n',
111-
warning: 'Yes: angular-cookies added to component.json'
111+
warning: 'Yes: angular-cookies added to bower.json'
112112
}, {
113113
name: 'sanitizeModule',
114114
message: 'Would you like to include angular-sanitize.js?',
115115
default: 'Y/n',
116-
warning: 'Yes: angular-sanitize added to component.json'
116+
warning: 'Yes: angular-sanitize added to bower.json'
117117
}];
118118

119119
this.prompt(prompts, function (err, props) {
@@ -159,7 +159,7 @@ Generator.prototype.createIndexHtml = function createIndexHtml() {
159159
};
160160

161161
Generator.prototype.packageFiles = function () {
162-
this.template('../../templates/common/component.json', 'component.json');
162+
this.template('../../templates/common/bower.json', 'bower.json');
163163
this.template('../../templates/common/package.json', 'package.json');
164164
this.template('../../templates/common/Gruntfile.js', 'Gruntfile.js');
165165
};

readme.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ All of these can be updated with `bower update` as new versions of AngularJS are
238238
Yeoman generated projects can be further tweaked according to your needs by modifying project files appropriately.
239239

240240
### Output
241-
You can change the `app` directory by adding a `appPath` property to `component.json`. For instance, if you wanted to easily integrate with Express.js, you could add the following:
241+
You can change the `app` directory by adding a `appPath` property to `bower.json`. For instance, if you wanted to easily integrate with Express.js, you could add the following:
242242

243243
```json
244244
{
@@ -254,7 +254,7 @@ This will cause Yeoman-generated client-side files to be placed in `public`.
254254
## Testing
255255

256256
For tests to work properly, karma needs the `angular-mocks` bower package.
257-
This script is included in the component.json in the `devDependencies` section, which will
257+
This script is included in the bower.json in the `devDependencies` section, which will
258258
be available very soon, probably with the next minor release of bower.
259259

260260
While bower `devDependencies` are not yet implemented, you can fix it by running:

script-base.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,21 @@ function Generator() {
1010
yeoman.generators.NamedBase.apply(this, arguments);
1111

1212
try {
13-
this.appname = require(path.join(process.cwd(), 'component.json')).name;
13+
this.appname = require(path.join(process.cwd(), 'bower.json')).name;
1414
} catch (e) {
1515
this.appname = path.basename(process.cwd());
1616
}
1717

1818
if (typeof this.env.options.appPath === 'undefined') {
1919
try {
20-
this.env.options.appPath = require(path.join(process.cwd(), 'component.json')).appPath;
20+
this.env.options.appPath = require(path.join(process.cwd(), 'bower.json')).appPath;
2121
} catch (e) {}
2222
this.env.options.appPath = this.env.options.appPath || 'app';
2323
}
2424

2525
if (typeof this.env.options.testPath === 'undefined') {
2626
try {
27-
this.env.options.testPath = require(path.join(process.cwd(), 'component.json')).testPath;
27+
this.env.options.testPath = require(path.join(process.cwd(), 'bower.json')).testPath;
2828
} catch (e) {}
2929
this.env.options.testPath = this.env.options.testPath || 'test/spec';
3030
}

templates/common/Gruntfile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ module.exports = function (grunt) {
1515
};
1616

1717
try {
18-
yeomanConfig.app = require('./component.json').appPath || yeomanConfig.app;
18+
yeomanConfig.app = require('./bower.json').appPath || yeomanConfig.app;
1919
} catch (e) {}
2020

2121
grunt.initConfig({

test/test-file-creation.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ describe('Angular generator', function () {
5050
['.bowerrc', /"directory": "app\/components"/],
5151
'Gruntfile.js',
5252
'package.json',
53-
['component.json', /"name":\s+"temp"/],
53+
['bower.json', /"name":\s+"temp"/],
5454
'app/scripts/app.js',
5555
'app/index.html',
5656
'app/scripts/controllers/main.js',
@@ -74,7 +74,7 @@ describe('Angular generator', function () {
7474
['.bowerrc', /"directory": "app\/components"/],
7575
'Gruntfile.js',
7676
'package.json',
77-
['component.json', /"name":\s+"temp"/],
77+
['bower.json', /"name":\s+"temp"/],
7878
'app/scripts/app.coffee',
7979
'app/index.html',
8080
'app/scripts/controllers/main.coffee',

view/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ function Generator() {
1212

1313
if (typeof this.env.options.appPath === 'undefined') {
1414
try {
15-
this.env.options.appPath = require(path.join(process.cwd(), 'component.json')).appPath;
15+
this.env.options.appPath = require(path.join(process.cwd(), 'bower.json')).appPath;
1616
} catch (e) {}
1717
this.env.options.appPath = this.env.options.appPath || 'app';
1818
}

0 commit comments

Comments
 (0)