Skip to content

Commit

Permalink
Merge pull request #2563 from angular-fullstack/canary-fixes
Browse files Browse the repository at this point in the history
Canary fixes
  • Loading branch information
Awk34 authored May 14, 2017
2 parents 451e4b6 + 26b28ab commit b5f2194
Show file tree
Hide file tree
Showing 32 changed files with 344 additions and 1,002 deletions.
110 changes: 59 additions & 51 deletions circle.yml
Original file line number Diff line number Diff line change
@@ -1,51 +1,59 @@
general:
branches:
ignore:
- gh-pages

## Customize the test machine
machine:
node:
version: 5.11.1
post:
- npm install -g gulp-cli

## Customize checkout
checkout:
post:
- git submodule sync
- git submodule update --init # use submodules

## Customize dependencies
dependencies:
# we automatically cache and restore many dependencies between
# builds. If you need to, you can add custom paths to cache:
cache_directories:
- "test/fixtures/node_modules"
# post:
# - wget https://saucelabs.com/downloads/sc-latest-linux.tar.gz
# - tar -xzf sc-latest-linux.tar.gz

## Custom notifications
#notify:
notify:
webhooks:
# A list of hook hashes, containing the url field
# gitter hook
- url: https://webhooks.gitter.im/e/ac3980c61cb722b9e789

# deployment:
# docs:
# branch: master
# commands:
# - composer global require justinwalsh/daux.io
# - gulp docs

#test:
# pre:
# - cd sc-*-linux && ./bin/sc --user $SAUCE_USERNAME --api-key $SAUCE_ACCESS_KEY --readyfile ~/sauce_is_ready:
# background: true
# # Wait for tunnel to be ready
# - while [ ! -e ~/sauce_is_ready ]; do sleep 1; done
# post:
# - killall --wait sc # wait for Sauce Connect to close the tunnel
version: 2
jobs:
build:
docker:
- image: node:7
- image: mongo
command: [mongod, --smallfiles]

working_directory: ~/generator-angular-fullstack

environment:
NODE_ENV: test

branches:
ignore:
- gh-pages

steps:
- checkout
- run: git submodule sync && git submodule update --init

# Global npm dependencies
- restore_cache:
keys:
- generator-angular-fullstack-npm-global-{{ .Branch }}
- generator-angular-fullstack-npm-global-
- run: npm install --global gulp-cli
- save_cache:
key: generator-angular-fullstack-npm-global-{{ .Branch }}
paths:
- /usr/local/lib/node_modules

# Generator npm dependencies
- restore_cache:
keys:
- generator-angular-fullstack-npm-{{ .Branch }}-{{ checksum "package.json" }}
- generator-angular-fullstack-npm-{{ .Branch }}
- generator-angular-fullstack-npm-
- run: npm install --quiet
- save_cache:
key: generator-angular-fullstack-npm-{{ .Branch }}-{{ checksum "package.json" }}
paths:
- ~/generator-angular-fullstack/node_modules

# Test fixtures
- run: gulp updateFixtures:test
- restore_cache:
keys:
- generator-angular-fullstack-npm-fixtures-{{ .Branch }}-{{ checksum "templates/app/_package.json" }}
- generator-angular-fullstack-npm-fixtures-{{ .Branch }}
- generator-angular-fullstack-npm-fixtures-
- run: gulp installFixtures
- save_cache:
key: generator-angular-fullstack-npm-fixtures-{{ .Branch }}-{{ checksum "templates/app/_package.json" }}
paths:
- ~/generator-angular-fullstack/test/fixtures/node_modules

- run: gulp build
- run: gulp test
3 changes: 0 additions & 3 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,6 @@ gulp.task('deps', () => console.log('TODO')); // updateFixtures, david
gulp.task('release', () => console.log('TODO'));
gulp.task('lint', () => console.log('TODO')); // ['gulpfile.js', 'src/**/*.js']

gulp.task('daux', () => {
return execAsync('daux');
});
gulp.task('copy_docs_images', () => {
return gulp.src('./media/svg/*')
.pipe(gulp.dest('./static/'));
Expand Down
9 changes: 3 additions & 6 deletions src/generators/app/index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
import fs from 'fs';
import path from 'path';
import Promise from 'bluebird';
import { runCmd } from '../util';
import chalk from 'chalk';
import { Base } from '../generator-base';
import insight from '../insight-init';
import { exec } from 'child_process';
import tap from 'gulp-tap';
import filter from 'gulp-filter';
import eslint from 'gulp-eslint';
Expand Down Expand Up @@ -505,7 +502,7 @@ export class Generator extends Base {
clientJsFilter,
codeshiftStream,
eslint({
fix: true,
fix: true,
configFile: path.join(genDir, 'templates/app/client/.eslintrc(babel)')
}),
clientJsFilter.restore
Expand Down Expand Up @@ -542,7 +539,7 @@ export class Generator extends Base {

// Convert HTML into Pug
if(this.filters.pug) {
let pugFilter = filter(['**/*.html'], {restore: true});
let pugFilter = filter(['**/*.html', '!client/_index.html'], {restore: true});
this.registerTransformStream([
pugFilter,
html2jade({
Expand All @@ -562,7 +559,7 @@ export class Generator extends Base {
this.registerTransformStream([
serverJsFilter,
eslint({
fix: true,
fix: true,
configFile: path.join(genDir, 'templates/app/server/.eslintrc')
}),
serverJsFilter.restore
Expand Down
1 change: 1 addition & 0 deletions src/generators/endpoint/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export class Generator extends NamedBase {
}

prompting() {
this.filters = this.filters || this.config.get('filters');
let promptCb = props => {
if(props.route.charAt(0) !== '/') {
props.route = `/${props.route}`;
Expand Down
1 change: 0 additions & 1 deletion src/generators/generator-base.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
'use strict';

import util from 'util';
import path from 'path';
import _ from 'lodash';
import s from 'underscore.string';
Expand Down
123 changes: 54 additions & 69 deletions src/test/get-expected-files.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,32 @@
const mapping = {
stylesheet: {
sass: 'scss',
stylus: 'styl',
less: 'less',
css: 'css'
},
markup: {
pug: 'pug',
html: 'html'
},
script: {
js: 'js',
ts: 'ts'
}
};

/**
* Generate an array of OAuth files based on type
*
* @param {String} type - type of oauth
* @return {Array} - array of files
*
*/
var oauthFiles = type => ([
`server/auth/${type}/index.js`,
`server/auth/${type}/passport.js`,
]);

/**
* Generate an array of files to expect from a set of options
*
Expand All @@ -6,68 +35,37 @@
*
*/
export function app(options) {
var mapping = {
stylesheet: {
sass: 'scss',
stylus: 'styl',
less: 'less',
css: 'css'
},
markup: {
pug: 'pug',
html: 'html'
},
script: {
js: 'js',
ts: 'ts'
}
},
files = [];

/**
* Generate an array of OAuth files based on type
*
* @param {String} type - type of oauth
* @return {Array} - array of files
*
*/
var oauthFiles = function(type) {
return [
'server/auth/' + type + '/index.js',
'server/auth/' + type + '/passport.js',
];
};


var script = mapping.script[options.transpiler === 'ts' ? 'ts' : 'js'],
markup = mapping.markup[options.markup],
stylesheet = mapping.stylesheet[options.stylesheet],
models = options.models ? options.models : options.odms[0];
let script = mapping.script[options.transpiler === 'ts' ? 'ts' : 'js'];
let markup = mapping.markup[options.markup];
let stylesheet = mapping.stylesheet[options.stylesheet];
let models = options.models ? options.models : options.odms[0];

/* Core Files */
files = files.concat([
'client/.htaccess',
let files = [
'client/favicon.ico',
'client/robots.txt',
'client/_index.html',
`client/polyfills.${script}`,
'client/app/app.' + script,
'client/app/app.component.' + script,
'client/app/app.config.' + script,
'client/app/app.constants.' + script,
'client/app/app.module.' + script,
'client/app/app.' + stylesheet,
`client/app/polyfills.${script}`,
'client/app/main/main.component.' + script,
'client/app/main/main.component.spec.' + script,
'client/app/main/main.routes.' + script,
'client/app/main/main.module.' + script,
'client/app/main/main.' + markup,
'client/app/main/main.' + stylesheet,
'client/assets/images/yeoman.png',
'client/components/directives.module.' + script,
'client/components/util.' + script,
'client/components/util.spec.' + script,
'client/components/footer/footer.' + stylesheet,
'client/components/footer/footer.' + markup,
'client/components/footer/footer.component.' + script,
'client/components/navbar/navbar.' + markup,
'client/components/navbar/navbar.component.' + script,
'client/components/util/util.module.' + script,
'client/components/util/util.service.' + script,
'server/.eslintrc',
'server/app.js',
'server/index.js',
Expand Down Expand Up @@ -107,16 +105,16 @@ export function app(options) {
'spec.js',
'webpack.build.js',
'webpack.dev.js',
'webpack.make.js',
'webpack.test.js',
'webpack.make.js'
]);
'webpack.server.js'
];

/* TypeScript */
if (options.transpiler === 'ts') {
files = files.concat([
'tsconfig.client.test.json',
'tsconfig.client.json',
'typings.json',
'tsconfig.json',
'client/tslint.json'
]);
} else {
Expand All @@ -137,15 +135,6 @@ export function app(options) {
]);
}

/* Ui-Bootstrap */
if (options.uibootstrap) {
files = files.concat([
'client/components/modal/modal.' + markup,
'client/components/modal/modal.' + stylesheet,
'client/components/modal/modal.service.' + script
]);
}

/* Models - Mongoose or Sequelize */
if (models) {
files = files.concat([
Expand All @@ -165,21 +154,18 @@ export function app(options) {
/* Authentication */
if (options.auth) {
files = files.concat([
'client/app/account/index.' + script,
'client/app/account/account.module.' + script,
'client/app/account/account.routes.' + script,
'client/app/account/login/login.' + markup,
'client/app/account/login/index.' + script,
'client/app/account/login/login.controller.' + script,
'client/app/account/login/login.component.' + script,
'client/app/account/settings/settings.' + markup,
'client/app/account/settings/index.' + script,
'client/app/account/settings/settings.controller.' + script,
'client/app/account/settings/settings.component.' + script,
'client/app/account/signup/signup.' + markup,
'client/app/account/signup/index.' + script,
'client/app/account/signup/signup.controller.' + script,
'client/app/admin/index.' + script,
'client/app/account/signup/signup.component.' + script,
'client/app/admin/admin.' + markup,
'client/app/admin/admin.' + stylesheet,
'client/app/admin/admin.controller.' + script,
'client/app/admin/admin.component.' + script,
'client/app/admin/admin.module.' + script,
'client/app/admin/admin.routes.' + script,
'client/components/auth/auth.module.' + script,
'client/components/auth/auth.service.' + script,
Expand Down Expand Up @@ -208,17 +194,16 @@ export function app(options) {

if (options.oauth && options.oauth.length) {
/* OAuth (see oauthFiles function above) */
options.oauth.forEach(function(type, i) {
options.oauth.forEach(type => {
files = files.concat(oauthFiles(type.replace('Auth', '')));
});


files = files.concat([
'client/components/oauth-buttons/index.' + script,
'client/components/oauth-buttons/oauth-buttons.' + stylesheet,
'client/components/oauth-buttons/oauth-buttons.' + markup,
'client/components/oauth-buttons/oauth-buttons.controller.spec.' + script,
'client/components/oauth-buttons/oauth-buttons.directive.spec.' + script,
'client/components/oauth-buttons/oauth-buttons.component.' + script,
'client/components/oauth-buttons/oauth-buttons.component.spec.' + script,
'e2e/components/oauth-buttons/oauth-buttons.po.js'
]);
}
Expand Down
Loading

0 comments on commit b5f2194

Please sign in to comment.