Skip to content
This repository has been archived by the owner on Mar 26, 2022. It is now read-only.

Commit

Permalink
Added my similar project to get started
Browse files Browse the repository at this point in the history
  • Loading branch information
torch2424 committed Apr 23, 2017
1 parent 3342129 commit a57ee70
Show file tree
Hide file tree
Showing 59 changed files with 5,934 additions and 0 deletions.
Binary file added .DS_Store
Binary file not shown.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
# Shalom
Angular 1 Starter Client for Sayonara JS.Focuses on a Portfolio-like Design


**Generated From:** [Yeoman Fountain Generator](https://github.com/FountainJS/generator-fountain-angular1)
12 changes: 12 additions & 0 deletions conf/browsersync-dist.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const conf = require('./gulp.conf');

module.exports = function () {
return {
server: {
baseDir: [
conf.paths.dist
]
},
open: false
};
};
13 changes: 13 additions & 0 deletions conf/browsersync.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
const conf = require('./gulp.conf');

module.exports = function () {
return {
server: {
baseDir: [
conf.paths.tmp,
conf.paths.src
]
},
open: false
};
};
54 changes: 54 additions & 0 deletions conf/gulp.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
'use strict';

/**
* This file contains the variables used in other gulp files
* which defines tasks
* By design, we only put there very generic config values
* which are used in several places to keep good readability
* of the tasks
*/

const path = require('path');
const gutil = require('gulp-util');

exports.ngModule = 'app';

/**
* The main paths of your project handle these with care
*/
exports.paths = {
src: 'src',
dist: 'dist',
tmp: '.tmp',
e2e: 'e2e',
tasks: 'gulp_tasks'
};

/**
* used on gulp dist
*/
exports.htmlmin = {
ignoreCustomFragments: [/{{.*?}}/]
};

exports.path = {};
for (const pathName in exports.paths) {
if (Object.prototype.hasOwnProperty.call(exports.paths, pathName)) {
exports.path[pathName] = function () {
const pathValue = exports.paths[pathName];
const funcArgs = Array.prototype.slice.call(arguments);
const joinArgs = [pathValue].concat(funcArgs);
return path.join.apply(this, joinArgs);
};
}
}

/**
* Common implementation for an error handler of a Gulp plugin
*/
exports.errorHandler = function (title) {
return function (err) {
gutil.log(gutil.colors.red(`[${title}]`), err.toString());
this.emit('end');
};
};
55 changes: 55 additions & 0 deletions conf/karma-auto.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
const conf = require('./gulp.conf');

module.exports = function (config) {
const configuration = {
basePath: '../',
singleRun: false,
autoWatch: true,
logLevel: 'INFO',
junitReporter: {
outputDir: 'test-reports'
},
browsers: [
'PhantomJS'
],
frameworks: [
'jasmine'
],
files: [
'node_modules/es6-shim/es6-shim.js',
conf.path.src('index.spec.js'),
conf.path.src('**/*.html')
],
preprocessors: {
[conf.path.src('index.spec.js')]: [
'webpack'
],
[conf.path.src('**/*.html')]: [
'ng-html2js'
]
},
ngHtml2JsPreprocessor: {
stripPrefix: `${conf.paths.src}/`
},
reporters: ['progress', 'coverage'],
coverageReporter: {
type: 'html',
dir: 'coverage/'
},
webpack: require('./webpack-test.conf'),
webpackMiddleware: {
noInfo: true
},
plugins: [
require('karma-jasmine'),
require('karma-junit-reporter'),
require('karma-coverage'),
require('karma-phantomjs-launcher'),
require('karma-phantomjs-shim'),
require('karma-ng-html2js-preprocessor'),
require('karma-webpack')
]
};

config.set(configuration);
};
55 changes: 55 additions & 0 deletions conf/karma.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
const conf = require('./gulp.conf');

module.exports = function (config) {
const configuration = {
basePath: '../',
singleRun: true,
autoWatch: false,
logLevel: 'INFO',
junitReporter: {
outputDir: 'test-reports'
},
browsers: [
'PhantomJS'
],
frameworks: [
'jasmine'
],
files: [
'node_modules/es6-shim/es6-shim.js',
conf.path.src('index.spec.js'),
conf.path.src('**/*.html')
],
preprocessors: {
[conf.path.src('index.spec.js')]: [
'webpack'
],
[conf.path.src('**/*.html')]: [
'ng-html2js'
]
},
ngHtml2JsPreprocessor: {
stripPrefix: `${conf.paths.src}/`
},
reporters: ['progress', 'coverage'],
coverageReporter: {
type: 'html',
dir: 'coverage/'
},
webpack: require('./webpack-test.conf'),
webpackMiddleware: {
noInfo: true
},
plugins: [
require('karma-jasmine'),
require('karma-junit-reporter'),
require('karma-coverage'),
require('karma-phantomjs-launcher'),
require('karma-phantomjs-shim'),
require('karma-ng-html2js-preprocessor'),
require('karma-webpack')
]
};

config.set(configuration);
};
88 changes: 88 additions & 0 deletions conf/webpack-dist.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
const webpack = require('webpack');
const conf = require('./gulp.conf');
const path = require('path');

const HtmlWebpackPlugin = require('html-webpack-plugin');
const FailPlugin = require('webpack-fail-plugin');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const pkg = require('../package.json');
const autoprefixer = require('autoprefixer');

module.exports = {
module: {
loaders: [
{
test: /\.json$/,
loaders: [
'json-loader'
]
},
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'eslint-loader',
enforce: 'pre'
},
{
test: /\.(css|scss)$/,
loaders: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: 'css-loader?minimize!sass-loader!postcss-loader'
})
},
{
test: /\.(png|jpg|svg)$/,
exclude: /node_modules/,
loader: 'url-loader?limit=8192'
},
{
test: /\.js$/,
exclude: /node_modules/,
loaders: [
'ng-annotate-loader',
'babel-loader'
]
},
{
test: /\.html$/,
loaders: [
'html-loader?' + JSON.stringify({
attrs: ['img:src', 'img:ng-src']
})
]
}
]
},
plugins: [
new webpack.optimize.OccurrenceOrderPlugin(),
new webpack.NoEmitOnErrorsPlugin(),
FailPlugin,
new webpack.DefinePlugin({
PRODUCTION: JSON.stringify(true),
API_URL: JSON.stringify('')
}),
new HtmlWebpackPlugin({
template: conf.path.src('index.html')
}),
new webpack.optimize.UglifyJsPlugin({
mangle: false,
output: {comments: false},
compress: {unused: false, dead_code: false, warnings: false} // eslint-disable-line camelcase
}),
new ExtractTextPlugin('index-[contenthash].css'),
new webpack.optimize.CommonsChunkPlugin({name: 'vendor'}),
new webpack.LoaderOptionsPlugin({
options: {
postcss: () => [autoprefixer]
}
})
],
output: {
path: path.join(process.cwd(), conf.paths.dist),
filename: '[name]-[hash].js'
},
entry: {
app: `./${conf.path.src('index')}`,
vendor: Object.keys(pkg.dependencies)
}
};
46 changes: 46 additions & 0 deletions conf/webpack-test.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
const webpack = require('webpack');

module.exports = {
module: {
loaders: [
{
test: /\.json$/,
loaders: [
'json-loader'
]
},
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'eslint-loader',
enforce: 'pre'
},
{
test: /\.js$/,
exclude: /node_modules/,
loaders: [
'ng-annotate-loader',
'babel-loader'
]
},
{
test: /\.(png|jpg|svg)$/,
exclude: /node_modules/,
loader: 'url-loader?limit=8192'
},
{
test: /\.html$/,
loaders: [
'html-loader'
]
}
]
},
plugins: [
new webpack.LoaderOptionsPlugin({
options: {},
debug: true
})
],
devtool: 'source-map'
};
Loading

0 comments on commit a57ee70

Please sign in to comment.