Skip to content

Commit

Permalink
Update build environment and add git projects support
Browse files Browse the repository at this point in the history
  • Loading branch information
mdeboer committed May 12, 2018
1 parent 98a5346 commit 52a2e9a
Show file tree
Hide file tree
Showing 20 changed files with 12,172 additions and 3,300 deletions.
7 changes: 3 additions & 4 deletions .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@
"comments": false,
"compact": true,
"plugins": [
"transform-class-properties",
"transform-runtime"
"@babel/transform-runtime"
],
"presets": [
"flow",
"@babel/preset-flow",
[
"env",
"@babel/preset-env",
{
"targets": {
"node": 4
Expand Down
32 changes: 0 additions & 32 deletions gulp/index.js

This file was deleted.

22 changes: 0 additions & 22 deletions gulp/tasks/babel.js

This file was deleted.

12 changes: 0 additions & 12 deletions gulp/tasks/eslint.js

This file was deleted.

8 changes: 0 additions & 8 deletions gulp/tasks/watch.js

This file was deleted.

36 changes: 36 additions & 0 deletions gulpfile.babel.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
const fs = require('fs');
const gulp = require('gulp');
const babel = require('gulp-babel');
const rename = require('gulp-rename');
const sourcemaps = require('gulp-sourcemaps');
const eslint = require('gulp-eslint');

let babelrc = JSON.parse(fs.readFileSync('.babelrc', 'utf8') || '{}');

function babelTask() {
return gulp.src(['./**/*.js.flow', '!node_modules', '!node_modules/**'])
.pipe(sourcemaps.init())
.pipe(babel(babelrc))
.pipe(rename(path => {
// Fix file extension for double ext files (.js.flow)
path.extname = path.basename.endsWith('.js') ? '' : '.js';
}))
.pipe(sourcemaps.write('.'))
.pipe(gulp.dest('.'));
}

function eslintTask() {
return gulp.src(['./**/*.js.flow', './tests/*.js', '!node_modules', '!node_modules/**'])
.pipe(eslint())
.pipe(eslint.format('node_modules/eslint-formatter-pretty'))
.pipe(eslint.failAfterError());
}

function watchTask() {
gulp.watch(['./**/*.js.flow', '!node_modules', '!node_modules/**'], babelTask);
}

gulp.task('babel', babelTask);
gulp.task('eslint', eslintTask);
gulp.task('default', gulp.series('eslint', 'babel'));
gulp.task('watch', gulp.series('default', watchTask));
9 changes: 0 additions & 9 deletions gulpfile.js

This file was deleted.

2 changes: 1 addition & 1 deletion icons.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 13 additions & 8 deletions icons.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@ try {
class Icons {
/**
* SVG icon path color
* @return {string}
*
* @return {string} SVG icon color as hex RGB
*/
_pathColor(): string {
let iconColor = color('#FFFFFF');

// Decide color based on text or background color
if (Hugo.alfredThemeFile) {
if (Hugo.alfredMeta.themeFile) {
try {
iconColor = color(Hugo.alfredTheme.result.text.color);
} catch (e) {}
Expand All @@ -37,8 +38,10 @@ class Icons {

/**
* Get list of used icons in projects
* @param {Array.Object} projects
* @return {Array.string}
*
* @param {Array.Object} projects List of Atom project definitions
*
* @return {Array.string} List of icons
*/
usedIcons(projects: Array<Object>): Array<string> {
let icons = [];
Expand Down Expand Up @@ -68,7 +71,8 @@ class Icons {

/**
* Check icon building dependencies
* @return {boolean}
*
* @return {boolean} True if all icon dependencies are available
*/
checkDependencies(): boolean {
try {
Expand All @@ -82,9 +86,10 @@ class Icons {

/**
* Rebuild icon(s)
* @param {Array.Object} projects
* @param {Object} options
* @return {Promise}
*
* @param {Array.Object} projects List of Atom project definitions
* @param {Object} options Options
* @return {Promise} Async promise
* @async
*/
async rebuild(projects: Array<Object>, options: Object = {}) {
Expand Down
Loading

0 comments on commit 52a2e9a

Please sign in to comment.