Skip to content

Commit 330e620

Browse files
authored
Merge pull request #2022 from angular-fullstack/remove-grunt-bower-etc
Remove grunt bower etc [skip ci]
2 parents 1ddf83d + b4e5630 commit 330e620

31 files changed

+127
-1198
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ before_install:
1414
- ./scripts/sauce_connect_setup.sh
1515
- gem update --system
1616
- gem install sass --version "=3.3.7"
17-
- npm install -g bower grunt-cli
17+
- npm install -g gulp-cli
1818
services: mongodb
1919
cache:
2020
directories:

ISSUE_TEMPLATE.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ Transpiler | Babel / TypeScript
1414
Markup | HTML / Jade
1515
CSS | CSS / LESS / SCSS / Stylus
1616
Router | ngRoute / ui-router
17-
Build Tool | Grunt / Gulp
1817
Client Tests | Jasmine / Mocha
1918
DB | MongoDB / SQL
2019
Auth | Y / N

docs/generators/heroku.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,12 @@ Your app should now be live. To view it run `heroku open`.
4141
> heroku config:set DOMAIN=<your-custom-domain>
4242
>
4343
44-
> WARNING: Deployment is untested with Gulp
45-
4644
To make your deployment process easier consider using [grunt-build-control](https://github.com/robwierzbowski/grunt-build-control).
4745

4846
#### Pushing Updates
4947

50-
grunt
48+
gulp build
5149

5250
Commit and push the resulting build, located in your dist folder:
5351

54-
grunt buildcontrol:heroku
52+
gulp buildcontrol:heroku

docs/generators/openshift.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ To make your deployment process easier consider using [grunt-build-control](http
3131

3232
**Pushing Updates**
3333

34-
grunt
34+
gulp build
3535

3636
Commit and push the resulting build, located in your dist folder:
3737

38-
grunt buildcontrol:openshift
38+
gulp buildcontrol:openshift

docs/index.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ All of these can be updated with `bower update` as new versions are released.
5050

5151
## Injection
5252

53-
A grunt/gulp task looks for new files in your `client/app` and `client/components` folder and automatically injects them in the appropriate places based on an injection block.
53+
A gulp task looks for new files in your `client/app` and `client/components` folder and automatically injects them in the appropriate places based on an injection block.
5454

5555
* `less` files into `client/app/app.less`
5656
* `scss` files into `client/app/app.scss`
@@ -68,23 +68,23 @@ A `.yo-rc` file is generated for helping you copy configuration across projects,
6868

6969
## Testing
7070

71-
Running `grunt test` will run the client and server unit tests with karma and mocha.
71+
Running `gulp test` will run the client and server unit tests with karma and mocha.
7272

73-
Use `grunt test:server` to only run server tests.
73+
Use `gulp test:server` to only run server tests.
7474

75-
Use `grunt test:client` to only run client tests.
75+
Use `gulp test:client` to only run client tests.
7676

7777
**Protractor tests**
7878

7979
To setup protractor e2e tests, you must first run
8080

8181
`npm run update-webdriver`
8282

83-
Use `grunt test:e2e` to have protractor go through tests located in the `e2e` folder.
83+
Use `gulp test:e2e` to have protractor go through tests located in the `e2e` folder.
8484

8585
**Code Coverage**
8686

87-
Use `grunt test:coverage` to run mocha-istanbul and generate code coverage reports.
87+
Use `gulp test:coverage` to run mocha-istanbul and generate code coverage reports.
8888

8989
`coverage/server` will be populated with `e2e` and `unit` folders containing the `lcov` reports.
9090

@@ -97,11 +97,12 @@ The coverage taget has 3 available options:
9797

9898
**Debugging**
9999

100-
Use `grunt serve:debug` for a more debugging-friendly environment.
100+
Use `gulp serve:debug` for a more debugging-friendly environment.
101101

102102
## Environment Variables
103103

104-
Keeping your app secrets and other sensitive information in source control isn't a good idea. To have grunt launch your app with specific environment variables, add them to the git ignored environment config file: `server/config/local.env.js`.
104+
Keeping your app secrets and other sensitive information in source control isn't a good idea.
105+
To have gulp launch your app with specific environment variables, add them to the git ignored environment config file: `server/config/local.env.js`.
105106

106107
## Project Structure
107108

gulpfile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ var processJson = function(src, dest, opt) {
8686

8787
if(/package.json/g.test(src) && opt.test) {
8888
delete json.scripts.postinstall;
89-
json.scripts['update-webdriver'] = 'node node_modules/grunt-protractor-runner/node_modules/protractor/bin/webdriver-manager update || node node_modules/protractor/bin/webdriver-manager update';
89+
json.scripts['update-webdriver'] = 'node node_modules/gulp-protractor-runner/node_modules/protractor/bin/webdriver-manager update || node node_modules/protractor/bin/webdriver-manager update';
9090
}
9191

9292
// set properties

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@
8787
"yeoman-test": "~1.4.0"
8888
},
8989
"engines": {
90-
"node": "^5.10.1",
91-
"npm": "^3.8.3"
90+
"node": "^6.2.2",
91+
"npm": "^3.9.5"
9292
},
9393
"license": "BSD-2-Clause"
9494
}

readme.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414

1515
## Usage
1616

17-
Install `yo`, `grunt-cli`/`gulp-cli`, `bower`, and `generator-angular-fullstack`:
17+
Install `yo`, `gulp-cli`, and `generator-angular-fullstack`:
1818
```
19-
npm install -g yo grunt-cli gulp-cli bower generator-angular-fullstack
19+
npm install -g yo gulp-cli generator-angular-fullstack
2020
```
2121

2222
> To install the latest 4.0.0 Beta with Webpack support, use `generator-angular-fullstack@beta`
@@ -31,7 +31,7 @@ Run `yo angular-fullstack`, optionally passing an app name:
3131
yo angular-fullstack [app-name]
3232
```
3333

34-
Run `grunt`/`gulp build` for building, `grunt serve`/`gulp serve` for development, and `grunt serve:dist`/`gulp serve:dist` for a preview of the built app.
34+
Run `gulp build` for building, `gulp serve` for development, and `gulp serve:dist` for a preview of the built app.
3535

3636
## Prerequisites
3737

@@ -42,7 +42,7 @@ Run `grunt`/`gulp build` for building, `grunt serve`/`gulp serve` for developmen
4242

4343
**General**
4444

45-
* Build Systems: `Grunt` (deprecated, will be removed in 4.0.0), `Gulp`
45+
* Build Systems: `Gulp`
4646
* Testing:
4747
* `Jasmine`
4848
* `Mocha + Chai + Sinon`

src/generators/app/index.js

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -328,16 +328,6 @@ export class Generator extends Base {
328328
this.log('\n# Project\n');
329329

330330
return this.prompt([{
331-
type: 'list',
332-
name: 'buildtool',
333-
message: 'Would you like to use Gulp or Grunt?',
334-
choices: ['Gulp', 'Grunt (deprecated)'],
335-
default: 0,
336-
filter: val => ({
337-
'Gulp': 'gulp',
338-
'Grunt (deprecated)': 'grunt'
339-
})[val]
340-
}, {
341331
type: 'list',
342332
name: 'testing',
343333
message: 'What would you like to write tests with?',
@@ -357,9 +347,6 @@ export class Generator extends Base {
357347
filter: val => val.toLowerCase(),
358348
when: answers => answers.testing === 'mocha'
359349
}]).then(answers => {
360-
this.filters[answers.buildtool] = true;
361-
insight.track('buildtool', answers.buildtool);
362-
363350
this.filters[answers.testing] = true;
364351
insight.track('testing', answers.testing);
365352
if(answers.testing === 'mocha') {

src/generators/endpoint/index.js

Lines changed: 26 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import {Base} from 'yeoman-generator';
55
import {genNamedBase} from '../generator-base';
66

77
export class Generator extends Base {
8-
98
constructor(...args) {
109
super(...args);
1110

@@ -33,69 +32,68 @@ export class Generator extends Base {
3332
}
3433

3534
prompting() {
36-
var promptCb = (props) => {
35+
let promptCb = props => {
3736
if(props.route.charAt(0) !== '/') {
38-
props.route = '/' + props.route;
37+
props.route = `/${props.route}`;
3938
}
4039

4140
this.route = props.route;
4241

43-
if (props.models) {
42+
if(props.models) {
4443
delete this.filters.mongoose;
4544
delete this.filters.mongooseModels;
4645
delete this.filters.sequelize;
4746
delete this.filters.sequelizeModels;
4847

4948
this.filters[props.models] = true;
50-
this.filters[props.models + 'Models'] = true;
49+
this.filters[`${props.models}Models`] = true;
5150
}
5251
};
5352

54-
if (this.options.route) {
55-
if (this.filters.mongoose && this.filters.sequelize) {
56-
if (this.options.models) {
57-
return promptCb(this.options);
58-
}
53+
if(this.options.route) {
54+
if(this.filters.mongoose && this.filters.sequelize && this.options.models) {
55+
return promptCb(this.options);
5956
} else {
60-
if (this.filters.mongooseModels) { this.options.models = 'mongoose'; }
61-
else if (this.filters.sequelizeModels) { this.options.models = 'sequelize'; }
62-
else { delete this.options.models; }
57+
if(this.filters.mongooseModels) this.options.models = 'mongoose';
58+
else if(this.filters.sequelizeModels) this.options.models = 'sequelize';
59+
else delete this.options.models;
6360
return promptCb(this.options);
6461
}
6562
}
6663

6764
var name = this.name;
6865

6966
var base = this.config.get('routesBase') || '/api/';
70-
if(base.charAt(base.length-1) !== '/') {
71-
base = base + '/';
67+
if(base.charAt(base.length - 1) !== '/') {
68+
base = `${base}/`;
7269
}
7370

7471
// pluralization defaults to true for backwards compat
75-
if (this.config.get('pluralizeRoutes') !== false) {
76-
name = name + 's';
72+
if(this.config.get('pluralizeRoutes') !== false) {
73+
name = `${name}s`;
7774
}
7875

7976
var prompts = [{
8077
name: 'route',
8178
message: 'What will the url of your endpoint be?',
82-
default: base + name
79+
default: `${base}${name}`
8380
}, {
8481
type: 'list',
8582
name: 'models',
8683
message: 'What would you like to use for the endpoint\'s models?',
87-
choices: [ 'Mongoose', 'Sequelize' ],
84+
choices: ['Mongoose', 'Sequelize'],
8885
default: this.filters.sequelizeModels ? 1 : 0,
89-
filter: (val) => val.toLowerCase(),
86+
filter: val => val.toLowerCase(),
9087
when: () => this.filters.mongoose && this.filters.sequelize
9188
}];
9289

9390
return this.prompt(prompts).then(promptCb);
9491
}
9592

9693
configuring() {
97-
this.routeDest = path.join(this.options.endpointDirectory ||
98-
this.config.get('endpointDirectory') || 'server/api/', this.name);
94+
this.routeDest = path.join(this.options.endpointDirectory
95+
|| this.config.get('endpointDirectory')
96+
|| 'server/api/', this.name);
9997
}
10098

10199
writing() {
@@ -111,34 +109,34 @@ export class Generator extends Base {
111109
file: routesFile,
112110
needle: this.config.get('routesNeedle'),
113111
splicable: [
114-
"app.use(\'" + this.route +"\', require(\'" + reqPath + "\'));"
112+
`app.use('${this.route}', require('${reqPath}'));`
115113
]
116114
};
117115
this.rewriteFile(routeConfig);
118116
}
119117

120-
if (this.filters.socketio && this.config.get('insertSockets')) {
118+
if(this.filters.socketio && this.config.get('insertSockets')) {
121119
var socketsFile = this.config.get('registerSocketsFile');
122120
var reqPath = this.relativeRequire(this.routeDest + '/' + this.basename +
123121
'.socket', socketsFile);
124122
var socketConfig = {
125123
file: socketsFile,
126124
needle: this.config.get('socketsNeedle'),
127125
splicable: [
128-
"require(\'" + reqPath + "\').register(socket);"
126+
`require('${reqPath}').register(socket);`
129127
]
130128
};
131129
this.rewriteFile(socketConfig);
132130
}
133131

134-
if (this.filters.sequelize && this.config.get('insertModels')) {
132+
if(this.filters.sequelize && this.config.get('insertModels')) {
135133
var modelsFile = this.config.get('registerModelsFile');
136-
var reqPath = this.relativeRequire(this.routeDest + '/' + this.basename + '.model', modelsFile);
134+
var reqPath = this.relativeRequire(`${this.routeDest}/${this.basename}.model`, modelsFile);
137135
var modelConfig = {
138136
file: modelsFile,
139137
needle: this.config.get('modelsNeedle'),
140138
splicable: [
141-
"db." + this.classedName + " = db.sequelize.import(\'" + reqPath +"\');"
139+
`db.${this.classedName} = db.sequelize.import('${reqPath}');`
142140
]
143141
};
144142
this.rewriteFile(modelConfig);

src/generators/heroku/index.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,9 @@ Generator.prototype.copyProcfile = function copyProcfile() {
115115
Generator.prototype.build = function build() {
116116
if(this.abort) return;
117117
var done = this.async();
118-
var buildCommand = this.filters.grunt ? 'grunt build' : 'gulp build';
119118

120119
this.log(chalk.bold('\nBuilding dist folder, please wait...'));
121-
var child = exec(buildCommand, function (err, stdout) {
120+
var child = exec('gulp build', function (err, stdout) {
122121
done();
123122
}.bind(this));
124123
child.stdout.on('data', function(data) {
@@ -189,10 +188,10 @@ Generator.prototype.gitForcePush = function gitForcePush() {
189188
}
190189

191190
this.log(chalk.yellow(
192-
'After app modification run\n\t' +
193-
chalk.bold(this.filters.grunt ? 'grunt build' : 'gulp build') +
191+
'After app modification run\n\t' +
192+
chalk.bold('gulp build') +
194193
'\nThen deploy with\n\t' +
195-
chalk.bold(this.filters.grunt ? 'grunt buildcontrol:heroku' : 'gulp buildcontrol:heroku')
194+
chalk.bold('gulp buildcontrol:heroku')
196195
));
197196
}
198197
done();

src/generators/openshift/index.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -196,10 +196,9 @@ Generator.prototype.enableOpenShiftHotDeploy = function enableOpenshiftHotDeploy
196196
Generator.prototype.build = function build() {
197197
if(this.abort || !this.openshift_remote_exists ) return;
198198
var done = this.async();
199-
var buildCommand = this.filters.grunt ? 'grunt build' : 'gulp build';
200199

201200
this.log(chalk.bold('\nBuilding dist folder, please wait...'));
202-
var child = exec(buildCommand, function (err, stdout) {
201+
var child = exec('gulp build', function (err, stdout) {
203202
if (err) {
204203
this.log.error(err);
205204
}
@@ -297,10 +296,10 @@ Generator.prototype.restartApp = function restartApp() {
297296
}
298297

299298
this.log(chalk.yellow(
300-
'After app modification run\n\t' +
301-
chalk.bold(this.filters.grunt ? 'grunt build' : 'gulp build') +
299+
'After app modification run\n\t' +
300+
chalk.bold('gulp build') +
302301
'\nThen deploy with\n\t' +
303-
chalk.bold(this.filters.grunt ? 'grunt buildcontrol:openshift' : 'gulp buildcontrol:openshift')
302+
chalk.bold('gulp buildcontrol:openshift')
304303
));
305304
}.bind(this));
306305
};

src/test/endpoint.test.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import {
1818
const TEST_DIR = __dirname;
1919

2020
const defaultOptions = {
21-
buildtool: 'grunt',
2221
script: 'js',
2322
transpiler: 'babel',
2423
markup: 'html',

src/test/fixtures/.yo-rc.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
"models": true,
2727
"mongooseModels": true,
2828
"mongoose": true,
29-
"gulp": true,
3029
"mocha": true,
3130
"jasmine": false,
3231
"expect": true

src/test/get-expected-files.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ export function app(options) {
5353
`client/polyfills.${script}`,
5454
'client/app/app.' + script,
5555
'client/app/app.config.' + script,
56+
'client/app/app.constants.' + script,
5657
'client/app/app.' + stylesheet,
5758
'client/app/main/main.component.' + script,
5859
'client/app/main/main.component.spec.' + script,

0 commit comments

Comments
 (0)