Skip to content

Commit b5f2194

Browse files
authored
Merge pull request #2563 from angular-fullstack/canary-fixes
Canary fixes
2 parents 451e4b6 + 26b28ab commit b5f2194

32 files changed

+344
-1002
lines changed

Diff for: circle.yml

+59-51
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,59 @@
1-
general:
2-
branches:
3-
ignore:
4-
- gh-pages
5-
6-
## Customize the test machine
7-
machine:
8-
node:
9-
version: 5.11.1
10-
post:
11-
- npm install -g gulp-cli
12-
13-
## Customize checkout
14-
checkout:
15-
post:
16-
- git submodule sync
17-
- git submodule update --init # use submodules
18-
19-
## Customize dependencies
20-
dependencies:
21-
# we automatically cache and restore many dependencies between
22-
# builds. If you need to, you can add custom paths to cache:
23-
cache_directories:
24-
- "test/fixtures/node_modules"
25-
# post:
26-
# - wget https://saucelabs.com/downloads/sc-latest-linux.tar.gz
27-
# - tar -xzf sc-latest-linux.tar.gz
28-
29-
## Custom notifications
30-
#notify:
31-
notify:
32-
webhooks:
33-
# A list of hook hashes, containing the url field
34-
# gitter hook
35-
- url: https://webhooks.gitter.im/e/ac3980c61cb722b9e789
36-
37-
# deployment:
38-
# docs:
39-
# branch: master
40-
# commands:
41-
# - composer global require justinwalsh/daux.io
42-
# - gulp docs
43-
44-
#test:
45-
# pre:
46-
# - cd sc-*-linux && ./bin/sc --user $SAUCE_USERNAME --api-key $SAUCE_ACCESS_KEY --readyfile ~/sauce_is_ready:
47-
# background: true
48-
# # Wait for tunnel to be ready
49-
# - while [ ! -e ~/sauce_is_ready ]; do sleep 1; done
50-
# post:
51-
# - killall --wait sc # wait for Sauce Connect to close the tunnel
1+
version: 2
2+
jobs:
3+
build:
4+
docker:
5+
- image: node:7
6+
- image: mongo
7+
command: [mongod, --smallfiles]
8+
9+
working_directory: ~/generator-angular-fullstack
10+
11+
environment:
12+
NODE_ENV: test
13+
14+
branches:
15+
ignore:
16+
- gh-pages
17+
18+
steps:
19+
- checkout
20+
- run: git submodule sync && git submodule update --init
21+
22+
# Global npm dependencies
23+
- restore_cache:
24+
keys:
25+
- generator-angular-fullstack-npm-global-{{ .Branch }}
26+
- generator-angular-fullstack-npm-global-
27+
- run: npm install --global gulp-cli
28+
- save_cache:
29+
key: generator-angular-fullstack-npm-global-{{ .Branch }}
30+
paths:
31+
- /usr/local/lib/node_modules
32+
33+
# Generator npm dependencies
34+
- restore_cache:
35+
keys:
36+
- generator-angular-fullstack-npm-{{ .Branch }}-{{ checksum "package.json" }}
37+
- generator-angular-fullstack-npm-{{ .Branch }}
38+
- generator-angular-fullstack-npm-
39+
- run: npm install --quiet
40+
- save_cache:
41+
key: generator-angular-fullstack-npm-{{ .Branch }}-{{ checksum "package.json" }}
42+
paths:
43+
- ~/generator-angular-fullstack/node_modules
44+
45+
# Test fixtures
46+
- run: gulp updateFixtures:test
47+
- restore_cache:
48+
keys:
49+
- generator-angular-fullstack-npm-fixtures-{{ .Branch }}-{{ checksum "templates/app/_package.json" }}
50+
- generator-angular-fullstack-npm-fixtures-{{ .Branch }}
51+
- generator-angular-fullstack-npm-fixtures-
52+
- run: gulp installFixtures
53+
- save_cache:
54+
key: generator-angular-fullstack-npm-fixtures-{{ .Branch }}-{{ checksum "templates/app/_package.json" }}
55+
paths:
56+
- ~/generator-angular-fullstack/test/fixtures/node_modules
57+
58+
- run: gulp build
59+
- run: gulp test

Diff for: gulpfile.js

-3
Original file line numberDiff line numberDiff line change
@@ -181,9 +181,6 @@ gulp.task('deps', () => console.log('TODO')); // updateFixtures, david
181181
gulp.task('release', () => console.log('TODO'));
182182
gulp.task('lint', () => console.log('TODO')); // ['gulpfile.js', 'src/**/*.js']
183183

184-
gulp.task('daux', () => {
185-
return execAsync('daux');
186-
});
187184
gulp.task('copy_docs_images', () => {
188185
return gulp.src('./media/svg/*')
189186
.pipe(gulp.dest('./static/'));

Diff for: src/generators/app/index.js

+3-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
1-
import fs from 'fs';
21
import path from 'path';
32
import Promise from 'bluebird';
43
import { runCmd } from '../util';
5-
import chalk from 'chalk';
64
import { Base } from '../generator-base';
75
import insight from '../insight-init';
8-
import { exec } from 'child_process';
96
import tap from 'gulp-tap';
107
import filter from 'gulp-filter';
118
import eslint from 'gulp-eslint';
@@ -505,7 +502,7 @@ export class Generator extends Base {
505502
clientJsFilter,
506503
codeshiftStream,
507504
eslint({
508-
fix: true,
505+
fix: true,
509506
configFile: path.join(genDir, 'templates/app/client/.eslintrc(babel)')
510507
}),
511508
clientJsFilter.restore
@@ -542,7 +539,7 @@ export class Generator extends Base {
542539

543540
// Convert HTML into Pug
544541
if(this.filters.pug) {
545-
let pugFilter = filter(['**/*.html'], {restore: true});
542+
let pugFilter = filter(['**/*.html', '!client/_index.html'], {restore: true});
546543
this.registerTransformStream([
547544
pugFilter,
548545
html2jade({
@@ -562,7 +559,7 @@ export class Generator extends Base {
562559
this.registerTransformStream([
563560
serverJsFilter,
564561
eslint({
565-
fix: true,
562+
fix: true,
566563
configFile: path.join(genDir, 'templates/app/server/.eslintrc')
567564
}),
568565
serverJsFilter.restore

Diff for: src/generators/endpoint/index.js

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export class Generator extends NamedBase {
2424
}
2525

2626
prompting() {
27+
this.filters = this.filters || this.config.get('filters');
2728
let promptCb = props => {
2829
if(props.route.charAt(0) !== '/') {
2930
props.route = `/${props.route}`;

Diff for: src/generators/generator-base.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
'use strict';
22

3-
import util from 'util';
43
import path from 'path';
54
import _ from 'lodash';
65
import s from 'underscore.string';

Diff for: src/test/get-expected-files.js

+54-69
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,32 @@
1+
const mapping = {
2+
stylesheet: {
3+
sass: 'scss',
4+
stylus: 'styl',
5+
less: 'less',
6+
css: 'css'
7+
},
8+
markup: {
9+
pug: 'pug',
10+
html: 'html'
11+
},
12+
script: {
13+
js: 'js',
14+
ts: 'ts'
15+
}
16+
};
17+
18+
/**
19+
* Generate an array of OAuth files based on type
20+
*
21+
* @param {String} type - type of oauth
22+
* @return {Array} - array of files
23+
*
24+
*/
25+
var oauthFiles = type => ([
26+
`server/auth/${type}/index.js`,
27+
`server/auth/${type}/passport.js`,
28+
]);
29+
130
/**
231
* Generate an array of files to expect from a set of options
332
*
@@ -6,68 +35,37 @@
635
*
736
*/
837
export function app(options) {
9-
var mapping = {
10-
stylesheet: {
11-
sass: 'scss',
12-
stylus: 'styl',
13-
less: 'less',
14-
css: 'css'
15-
},
16-
markup: {
17-
pug: 'pug',
18-
html: 'html'
19-
},
20-
script: {
21-
js: 'js',
22-
ts: 'ts'
23-
}
24-
},
25-
files = [];
26-
27-
/**
28-
* Generate an array of OAuth files based on type
29-
*
30-
* @param {String} type - type of oauth
31-
* @return {Array} - array of files
32-
*
33-
*/
34-
var oauthFiles = function(type) {
35-
return [
36-
'server/auth/' + type + '/index.js',
37-
'server/auth/' + type + '/passport.js',
38-
];
39-
};
40-
41-
42-
var script = mapping.script[options.transpiler === 'ts' ? 'ts' : 'js'],
43-
markup = mapping.markup[options.markup],
44-
stylesheet = mapping.stylesheet[options.stylesheet],
45-
models = options.models ? options.models : options.odms[0];
38+
let script = mapping.script[options.transpiler === 'ts' ? 'ts' : 'js'];
39+
let markup = mapping.markup[options.markup];
40+
let stylesheet = mapping.stylesheet[options.stylesheet];
41+
let models = options.models ? options.models : options.odms[0];
4642

4743
/* Core Files */
48-
files = files.concat([
49-
'client/.htaccess',
44+
let files = [
5045
'client/favicon.ico',
5146
'client/robots.txt',
5247
'client/_index.html',
53-
`client/polyfills.${script}`,
5448
'client/app/app.' + script,
49+
'client/app/app.component.' + script,
5550
'client/app/app.config.' + script,
5651
'client/app/app.constants.' + script,
52+
'client/app/app.module.' + script,
5753
'client/app/app.' + stylesheet,
54+
`client/app/polyfills.${script}`,
5855
'client/app/main/main.component.' + script,
5956
'client/app/main/main.component.spec.' + script,
60-
'client/app/main/main.routes.' + script,
57+
'client/app/main/main.module.' + script,
6158
'client/app/main/main.' + markup,
6259
'client/app/main/main.' + stylesheet,
6360
'client/assets/images/yeoman.png',
61+
'client/components/directives.module.' + script,
62+
'client/components/util.' + script,
63+
'client/components/util.spec.' + script,
6464
'client/components/footer/footer.' + stylesheet,
6565
'client/components/footer/footer.' + markup,
6666
'client/components/footer/footer.component.' + script,
6767
'client/components/navbar/navbar.' + markup,
6868
'client/components/navbar/navbar.component.' + script,
69-
'client/components/util/util.module.' + script,
70-
'client/components/util/util.service.' + script,
7169
'server/.eslintrc',
7270
'server/app.js',
7371
'server/index.js',
@@ -107,16 +105,16 @@ export function app(options) {
107105
'spec.js',
108106
'webpack.build.js',
109107
'webpack.dev.js',
108+
'webpack.make.js',
110109
'webpack.test.js',
111-
'webpack.make.js'
112-
]);
110+
'webpack.server.js'
111+
];
113112

114113
/* TypeScript */
115114
if (options.transpiler === 'ts') {
116115
files = files.concat([
117116
'tsconfig.client.test.json',
118-
'tsconfig.client.json',
119-
'typings.json',
117+
'tsconfig.json',
120118
'client/tslint.json'
121119
]);
122120
} else {
@@ -137,15 +135,6 @@ export function app(options) {
137135
]);
138136
}
139137

140-
/* Ui-Bootstrap */
141-
if (options.uibootstrap) {
142-
files = files.concat([
143-
'client/components/modal/modal.' + markup,
144-
'client/components/modal/modal.' + stylesheet,
145-
'client/components/modal/modal.service.' + script
146-
]);
147-
}
148-
149138
/* Models - Mongoose or Sequelize */
150139
if (models) {
151140
files = files.concat([
@@ -165,21 +154,18 @@ export function app(options) {
165154
/* Authentication */
166155
if (options.auth) {
167156
files = files.concat([
168-
'client/app/account/index.' + script,
157+
'client/app/account/account.module.' + script,
169158
'client/app/account/account.routes.' + script,
170159
'client/app/account/login/login.' + markup,
171-
'client/app/account/login/index.' + script,
172-
'client/app/account/login/login.controller.' + script,
160+
'client/app/account/login/login.component.' + script,
173161
'client/app/account/settings/settings.' + markup,
174-
'client/app/account/settings/index.' + script,
175-
'client/app/account/settings/settings.controller.' + script,
162+
'client/app/account/settings/settings.component.' + script,
176163
'client/app/account/signup/signup.' + markup,
177-
'client/app/account/signup/index.' + script,
178-
'client/app/account/signup/signup.controller.' + script,
179-
'client/app/admin/index.' + script,
164+
'client/app/account/signup/signup.component.' + script,
180165
'client/app/admin/admin.' + markup,
181166
'client/app/admin/admin.' + stylesheet,
182-
'client/app/admin/admin.controller.' + script,
167+
'client/app/admin/admin.component.' + script,
168+
'client/app/admin/admin.module.' + script,
183169
'client/app/admin/admin.routes.' + script,
184170
'client/components/auth/auth.module.' + script,
185171
'client/components/auth/auth.service.' + script,
@@ -208,17 +194,16 @@ export function app(options) {
208194

209195
if (options.oauth && options.oauth.length) {
210196
/* OAuth (see oauthFiles function above) */
211-
options.oauth.forEach(function(type, i) {
197+
options.oauth.forEach(type => {
212198
files = files.concat(oauthFiles(type.replace('Auth', '')));
213199
});
214200

215201

216202
files = files.concat([
217-
'client/components/oauth-buttons/index.' + script,
218203
'client/components/oauth-buttons/oauth-buttons.' + stylesheet,
219204
'client/components/oauth-buttons/oauth-buttons.' + markup,
220-
'client/components/oauth-buttons/oauth-buttons.controller.spec.' + script,
221-
'client/components/oauth-buttons/oauth-buttons.directive.spec.' + script,
205+
'client/components/oauth-buttons/oauth-buttons.component.' + script,
206+
'client/components/oauth-buttons/oauth-buttons.component.spec.' + script,
222207
'e2e/components/oauth-buttons/oauth-buttons.po.js'
223208
]);
224209
}

0 commit comments

Comments
 (0)