Skip to content

Commit 2d98037

Browse files
committed
Merge pull request #1822 from angular-fullstack/build-gen-files
Build gen files
2 parents 2b051b4 + c5a1b41 commit 2d98037

File tree

187 files changed

+72
-38
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

187 files changed

+72
-38
lines changed

Diff for: .gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ demo
66
.DS_Store
77
release.txt
88
test/fixtures/bower.json
9-
test/fixtures/package.json
9+
test/fixtures/package.json
10+
generators

Diff for: .npmignore

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
11
angular-fullstack-deps
22
test
33
.idea
4+
src
5+
scripts
6+
ISSUE_TEMPLATE.md
7+
PULL_REQUEST_TEMPLATE.md
8+
.travis.yml
9+
gulpfile.babel.js
10+
Gruntfile.js
11+
.jshintrc

Diff for: Gruntfile.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ module.exports = function (grunt) {
8787
curly: false,
8888
node: true
8989
},
90-
all: ['Gruntfile.js', '*/index.js']
90+
all: ['Gruntfile.js', 'src/**/*.js']
9191
},
9292
env: {
9393
fast: {
@@ -276,8 +276,8 @@ module.exports = function (grunt) {
276276
fs.writeFileSync(path.resolve(d), JSON.stringify(json, null, 2));
277277
};
278278

279-
processJson('app/templates/_package.json', dest + 'package.json');
280-
processJson('app/templates/_bower.json', dest + 'bower.json');
279+
processJson('templates/app/_package.json', dest + 'package.json');
280+
processJson('templates/app/_bower.json', dest + 'bower.json');
281281
});
282282

283283
grunt.registerTask('installFixtures', 'install package and bower fixtures', function() {

Diff for: app/index.js

-9
This file was deleted.

Diff for: endpoint/index.js

-9
This file was deleted.

Diff for: gulpfile.babel.js

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
'use strict';
2+
// import _ from 'lodash';
3+
// import fs from 'fs';
4+
import gulp from 'gulp';
5+
import babel from 'gulp-babel';
6+
import del from 'del';
7+
import runSequence from 'run-sequence';
8+
9+
gulp.task('clean', () => {
10+
return del(['generators/**/*']);
11+
});
12+
13+
gulp.task('babel', () => {
14+
return gulp.src(['src/**/*.js'])
15+
.pipe(babel())
16+
.pipe(gulp.dest('generators'));
17+
});
18+
19+
gulp.task('watch', () => {
20+
return gulp.watch('src/**/*.js', ['babel']);
21+
});
22+
23+
gulp.task('copy', () => {
24+
return gulp.src(['src/**/*', '!src/**/*.js'])
25+
.pipe(gulp.dest('generators'));
26+
});
27+
28+
gulp.task('build', cb => {
29+
return runSequence(
30+
'clean',
31+
'babel',
32+
'copy',
33+
cb
34+
);
35+
});

Diff for: package.json

+7-5
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,12 @@
3131
"url": "git://github.com/angular-fullstack/generator-angular-fullstack.git"
3232
},
3333
"scripts": {
34-
"test": "grunt test"
34+
"test": "gulp build && grunt test"
3535
},
3636
"dependencies": {
37-
"babel-core": "^6.7.0",
3837
"babel-plugin-syntax-class-properties": "^6.5.0",
3938
"babel-plugin-syntax-flow": "^6.5.0",
40-
"babel-plugin-transform-class-properties": "^6.6.0",
4139
"babel-plugin-transform-flow-strip-types": "^6.7.0",
42-
"babel-preset-es2015": "^6.6.0",
43-
"babel-register": "^6.6.5",
4440
"chalk": "^1.1.0",
4541
"generator-ng-component": "~0.2.1",
4642
"glob": "^7.0.3",
@@ -54,7 +50,11 @@
5450
"yeoman-welcome": "^1.0.1"
5551
},
5652
"devDependencies": {
53+
"babel-plugin-transform-class-properties": "^6.6.0",
54+
"babel-preset-es2015": "^6.6.0",
55+
"babel-register": "^6.6.5",
5756
"chai": "^3.2.0",
57+
"del": "^2.2.0",
5858
"grunt": "^1.0.1",
5959
"grunt-build-control": "^0.7.0",
6060
"grunt-contrib-clean": "^1.0.0",
@@ -64,10 +64,12 @@
6464
"grunt-env": "^0.4.1",
6565
"grunt-mocha-test": "^0.12.7",
6666
"grunt-release": "^0.13.0",
67+
"gulp": "^3.9.1",
6768
"jit-grunt": "~0.10.0",
6869
"mocha": "^2.2.5",
6970
"q": "^1.0.1",
7071
"recursive-readdir": "^2.0.0",
72+
"run-sequence": "^1.1.5",
7173
"shelljs": "^0.6.0",
7274
"yeoman-assert": "^2.0.0",
7375
"yeoman-test": "^1.1.0"

Diff for: app/USAGE renamed to src/app/USAGE

File renamed without changes.

Diff for: app/generator.js renamed to src/app/index.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import babelStream from 'gulp-babel';
1111
import beaufityStream from 'gulp-beautify';
1212
import filter from 'gulp-filter';
1313

14-
export default class Generator extends Base {
14+
export class Generator extends Base {
1515
constructor(...args) {
1616
super(...args);
1717

@@ -496,7 +496,7 @@ export default class Generator extends Base {
496496
]);
497497

498498
let self = this;
499-
this.sourceRoot(path.join(__dirname, './templates'));
499+
this.sourceRoot(path.join(__dirname, '../../templates/app'));
500500
this.processDirectory('.', '.');
501501
},
502502
generateEndpoint: function() {
@@ -531,3 +531,5 @@ export default class Generator extends Base {
531531
return {};
532532
}
533533
}
534+
535+
module.exports = Generator;
File renamed without changes.
File renamed without changes.
File renamed without changes.

Diff for: endpoint/generator.js renamed to src/endpoint/index.js

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
'use strict';
22

33
import path from 'path';
4-
import {NamedBase} from 'yeoman-generator';
4+
import {Base} from 'yeoman-generator';
55
import {genNamedBase} from '../generator-base';
66

7-
export default class Generator extends NamedBase {
7+
export class Generator extends Base {
88

99
constructor(...args) {
1010
super(...args);
1111

12+
this.argument('name', { type: String, required: true });
13+
1214
this.option('route', {
1315
desc: 'URL for the endpoint',
1416
type: String
@@ -99,7 +101,7 @@ export default class Generator extends NamedBase {
99101
}
100102

101103
writing() {
102-
this.sourceRoot(path.join(__dirname, './templates'));
104+
this.sourceRoot(path.join(__dirname, '../../templates/endpoint'));
103105
this.processDirectory('.', this.routeDest);
104106
}
105107

@@ -145,3 +147,5 @@ export default class Generator extends NamedBase {
145147
}
146148
}
147149
}
150+
151+
module.exports = Generator;

Diff for: factory/index.js renamed to src/factory/index.js

File renamed without changes.

Diff for: filter/index.js renamed to src/filter/index.js

File renamed without changes.
File renamed without changes.

Diff for: heroku/USAGE renamed to src/heroku/USAGE

File renamed without changes.

Diff for: heroku/index.js renamed to src/heroku/index.js

File renamed without changes.
File renamed without changes.

Diff for: insight-init.js renamed to src/insight-init.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22
var Insight = require('insight');
3-
var pkg = require('./package.json');
3+
var pkg = require('../package.json');
44

55
var insight = new Insight({
66
// Google Analytics tracking code

Diff for: openshift/USAGE renamed to src/openshift/USAGE

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

Diff for: route/index.js renamed to src/route/index.js

File renamed without changes.

Diff for: service/index.js renamed to src/service/index.js

File renamed without changes.

Diff for: util.js renamed to src/util.js

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

Diff for: test/test-file-creation.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ describe('angular-fullstack generator', function () {
3232
function generatorTest(generatorType, name, mockPrompt, callback) {
3333
gen.run(function () {
3434
var afGenerator;
35-
var deps = [path.join('../..', generatorType)];
35+
var deps = [path.join('../../generators', generatorType)];
3636
afGenerator = helpers.createGenerator('angular-fullstack:' + generatorType, deps, [name], {
3737
skipInstall: true
3838
});
@@ -351,8 +351,8 @@ describe('angular-fullstack generator', function () {
351351
beforeEach(function (done) {
352352
this.timeout(10000);
353353
var deps = [
354-
'../../app',
355-
'../../endpoint',
354+
'../../generators/app',
355+
'../../generators/endpoint',
356356
[
357357
helpers.createDummyGenerator(),
358358
'ng-component:app'
@@ -484,8 +484,8 @@ describe('angular-fullstack generator', function () {
484484
this.timeout(60000);
485485
copySync(__dirname + '/fixtures/.yo-rc.json', __dirname + '/temp/.yo-rc.json');
486486
var gen = helpers.createGenerator('angular-fullstack:app', [
487-
'../../app',
488-
'../../endpoint',
487+
'../../generators/app',
488+
'../../generators/endpoint',
489489
[
490490
helpers.createDummyGenerator(),
491491
'ng-component:app'

0 commit comments

Comments
 (0)