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

.gitignore

Lines changed: 2 additions & 1 deletion
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

.npmignore

Lines changed: 8 additions & 0 deletions
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

Gruntfile.js

Lines changed: 3 additions & 3 deletions
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() {

app/index.js

Lines changed: 0 additions & 9 deletions
This file was deleted.

endpoint/index.js

Lines changed: 0 additions & 9 deletions
This file was deleted.

gulpfile.babel.js

Lines changed: 35 additions & 0 deletions
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+
});

package.json

Lines changed: 7 additions & 5 deletions
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"
File renamed without changes.

app/generator.js renamed to src/app/index.js

Lines changed: 4 additions & 2 deletions
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;

0 commit comments

Comments
 (0)