Skip to content

Commit

Permalink
chore: Update infrastructure and rename/move js files
Browse files Browse the repository at this point in the history
  • Loading branch information
clayreimann committed Apr 27, 2016
1 parent 7da4d28 commit efffc70
Show file tree
Hide file tree
Showing 30 changed files with 207 additions and 349 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.yml]
[*.yml,package.json]
indent_size = 2

[*.md]
Expand Down
26 changes: 26 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"extends": "eslint:recommended",

"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module"
},

"rules": {
"no-bitwise": 1,
"eqeqeq": 2,
"guard-for-in": 2,
"no-extend-native": 2
},

"env": {
"browser": true,
"node": true
},

"globals": {
"require": false,
"define": false,
"escape": false
}
}
9 changes: 6 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
.DS_Store
.idea
node_modules/
docs/
dist/
coverage/
node_modules/
.nyc_output/

.DS_Store
.idea
.zuulrc
npm-debug.log
sauce.json
146 changes: 10 additions & 136 deletions .jscsrc
Original file line number Diff line number Diff line change
@@ -1,142 +1,16 @@
{
"disallowDanglingUnderscores": false,
"disallowIdentifierNames": [],
"disallowImplicitTypeConversion": [],
"disallowKeywordsOnNewLine": [
"catch",
"else"
],
"disallowKeywords": [
"void",
"with"
],
"disallowMixedSpacesAndTabs": true,
"disallowMultipleLineBreaks": true,
"disallowMultipleLineStrings": true,
"disallowMultipleSpaces": true,
"disallowMultipleVarDecl": "exceptUndefined",
"disallowNewlineBeforeBlockStatements": true,
"disallowPaddingNewlinesBeforeKeywords": [
"case",
"typeof"
],
"disallowPaddingNewlinesInBlocks": true,
"disallowQuotedKeysInObjects": true,
"disallowSpaceAfterKeywords": [
"catch",
"for",
"switch",
"while"
],
"disallowSpaceAfterObjectKeys": true,
"disallowSpaceAfterPrefixUnaryOperators": true,
"disallowSpaceBeforePostfixUnaryOperators": true,
"disallowSpacesInCallExpression": true,
"disallowSpacesInsideParentheses": true,
"disallowTrailingComma": true,
"disallowTrailingWhitespace": true,
"disallowYodaConditions": true,
"preset": "google",

"disallowVar": true,
"jsDoc": {
"checkParamExistence": true,
"checkParamNames": true,
"checkTypes": true,
"requireParamTypes": true,
"requireHyphenBeforeDescription": true,
},
"maximumLineLength": 120,
"requireBlocksOnNewline": true,
"requireCamelCaseOrUpperCaseIdentifiers": false,
"requireCapitalizedComments": {
"allExcept": [
"exported",
"global",
"jshint"
]
},
"requireCapitalizedConstructors": true,
"requireCommaBeforeLineBreak": true,
"requireCurlyBraces": [
"catch",
"do",
"else",
"for",
"if",
"try",
"while"
],
"requireDollarBeforejQueryAssignment": true,
"requireDotNotation": true,
"requireKeywordsOnNewLine": [
"break",
"case",
"default"
],
"requireLineBreakAfterVariableAssignment": true,
"requireOperatorBeforeLineBreak": true,
"requirePaddingNewLineAfterVariableDeclaration": true,
"requirePaddingNewLinesAfterBlocks": {
"allExcept": [
"inArrayExpressions",
"inCallExpressions",
"inProperties"
]
},
"requirePaddingNewLinesAfterUseStrict": true,
"requirePaddingNewLinesBeforeExport": true,
"requirePaddingNewlinesBeforeKeywords": [
"do",
"for",
"function",
"if",
"return",
"switch",
"try",
"void",
"while",
"with"
],
"requirePaddingNewLinesBeforeLineComments": {
"allExcept": "firstAfterCurly"
},
"requirePaddingNewLinesInObjects": true,
"requireParenthesesAroundIIFE": true,
"requireSemicolons": true,
"requireSpaceAfterBinaryOperators": true,
"requireSpaceAfterKeywords": [
"case",
"do",
"else",
"if",
"return",
"try",
"typeof"
],
"requireSpaceAfterLineComment": true,
"requireSpaceBeforeBinaryOperators": true,
"requireSpaceBeforeBlockStatements": true,
"requireSpaceBeforeKeywords": [
"catch",
"else"
],
"requireSpaceBeforeObjectValues": true,
"requireSpaceBetweenArguments": true,
"requireSpacesInAnonymousFunctionExpression": {
"beforeOpeningCurlyBrace": true
},
"requireSpacesInConditionalExpression": true,
"requireSpacesInForStatement": true,
"requireSpacesInFunctionDeclaration": {
"beforeOpeningCurlyBrace": true
},
"requireSpacesInFunctionExpression": {
"beforeOpeningCurlyBrace": true
},
"requireSpacesInFunction": {
"beforeOpeningCurlyBrace": true
},
"requireSpacesInNamedFunctionExpression": {
"beforeOpeningCurlyBrace": true
},
"safeContextKeyword": ["that"],
"validateAlignedFunctionParameters": true,
"validateIndentation": 3,
"validateLineBreaks": "LF",
"validateNewlineAfterArrayElements": {
"maximum": 3
},
"validateParameterSeparator": ", ",
"validateQuoteMarks": "'"
}
23 changes: 23 additions & 0 deletions .jsdoc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"tags": {
"dictionaries": ["jsdoc"]
},
"source": {
"include": ["src", "package.json", "README.md"],
"includePattern": ".js$",
"excludePattern": "(node_modules/|docs)"
},
"plugins": [
"plugins/markdown"
],
"templates": {
"cleverLinks": false,
"monospaceLinks": true
},
"opts": {
"destination": "./docs/",
"encoding": "utf8",
"recurse": true,
"template": "./node_modules/minami"
}
}
65 changes: 0 additions & 65 deletions .jshintrc

This file was deleted.

4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ cache:
- node_modules

before_install:
- npm i -g npm@^3.3.0
- npm install -g npm@latest

script:
- gulp lint
- gulp test:mocha
- npm run codecov
# - npm run codecov # disabled temporarialy while I work out how to generate accurate coverage of ES2015 code
87 changes: 87 additions & 0 deletions gulpfile.babel.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
import gulp from 'gulp';
import jscs from 'gulp-jscs';
import eslint from 'gulp-eslint';
import stylish from 'gulp-jscs-stylish';

import babel from 'gulp-babel';
import rename from 'gulp-rename';

import browserify from 'browserify';
import buffer from 'vinyl-buffer';
import del from 'del';
import path from 'path';
import {Promise} from 'es6-promise';
import source from 'vinyl-source-stream';
import sourcemaps from 'gulp-sourcemaps';
import uglify from 'gulp-uglify';

const ALL_SOURCES = [
path.join(__dirname, '/*.js'),
path.join(__dirname, '/src/*.js'),
path.join(__dirname, '/test/*.js')
];

gulp.task('lint', function() {
const opts = {
base: './'
};
return gulp.src(ALL_SOURCES, opts)
.pipe(eslint())
.pipe(jscs())
.pipe(stylish.combineWithHintResults())
.pipe(stylish())
;
});

gulp.task('clean', function() {
return Promise.all([del('dist/'), del('coverage/')]);
});

const browserifyConfig = {
debug: true,
entries: 'src/Github.js',
standalone: 'Github'
};
gulp.task('build', function() {
browserify(browserifyConfig)
.transform('babelify')
.bundle()
.pipe(source('Github.js'))
.pipe(buffer())
.pipe(sourcemaps.init({
loadMaps: true
}))
.pipe(uglify())
.pipe(rename({
extname: '.bundle.min.js'
}))
.pipe(sourcemaps.write('.'))
.pipe(gulp.dest('dist'))
;

browserify(browserifyConfig)
.transform('babelify')
.bundle()
.pipe(source('Github.js'))
.pipe(buffer())
.pipe(sourcemaps.init({
loadMaps: true
}))
.pipe(rename({
extname: '.bundle.js'
}))
.pipe(sourcemaps.write('.'))
.pipe(gulp.dest('dist'))
;

return gulp.src('src/*.js')
.pipe(babel())
.pipe(sourcemaps.init())
.pipe(sourcemaps.write('.'))
.pipe(gulp.dest('dist/components'))
;
});

gulp.task('default', ['clean'], function() {
gulp.start('lint', 'test:mocha', 'build');
});
Loading

0 comments on commit efffc70

Please sign in to comment.