Skip to content
This repository has been archived by the owner on Jun 17, 2021. It is now read-only.

Commit

Permalink
Merge branch 'release/1.5.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Yago committed May 7, 2019
2 parents 64e0bc6 + 0bf0dd6 commit 8855775
Show file tree
Hide file tree
Showing 13 changed files with 3,573 additions and 2,608 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Toolbox Utils - CHANGELOG

*1.5.0* (2019-05-07)
- ✨ add seemless offline support (6767f7a)
- ✨ add future proof reader CDN (see you in a year XD) (8721b4a)
- 💄 use nicer template log (16bbcb7)
- 🔨 drop gulp-utils for fancy-log #24 (5774132)
- 🔨 move vendors.min.css before projects CSSs for a safer future #32 (ff573d7)
- 🔨 replace deploy Gulp task by a stronger shell script #21 (2541b2d)
- ⬆️ update all dependencies (e0f09fc)
- 🔧 stop renaming keyframes, counter and gridTemplate (23dfe4c)

*1.4.5* (2018-07-19)
- 🐛 fix broken components dirtree (b3ad176)

Expand Down
44 changes: 44 additions & 0 deletions bin/deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/bin/bash

jq --version || { echo "⚠️ You must have jq installed on your machine (brew install jq)" ; exit 1; }

cd $2

DEST=`jq -er ".ghpages" "$2/toolbox.json"`
DIRECTORY="$2/${DEST%?}"
BRANCH="gh-pages"
CURRENT_BRANCH=$(git branch | sed -n -e 's/^\* \(.*\)/\1/p')

# Check if the environment is ready for publishing ===========================
if [[ $(git status -s) ]]
then
echo "⚠️ The working directory is dirty. Please commit any pending changes."
exit 1;
fi

# Proceed =====================================================================
# yarn build --dev
echo "backup dist content"
echo $DIRECTORY
mkdir "$DIRECTORY-tmp"
cp -r $DIRECTORY/* "$DIRECTORY-tmp/"

echo "Deleting dist"
rm -rf $DIRECTORY
mkdir $DIRECTORY
git worktree prune
rm -rf .git/worktrees/$DIRECTORY/

echo "Checking out $BRANCH branch into dist"
git worktree add -B $BRANCH $DIRECTORY

echo "Removing existing files"
rm -rf $DIRECTORY/*

echo "Generating dist using the backup"
cp -r "$DIRECTORY-tmp"/* $DIRECTORY/
rm -rf "$DIRECTORY-tmp"

echo "Updating $BRANCH branch"
cd $DIRECTORY && git add --all && git commit -m "Publishing to $BRANCH (publish.sh)"
git push --force origin $BRANCH --tags
3 changes: 0 additions & 3 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ const vendors = require('./tasks/vendors');
const single = require('./tasks/single');
const serve = require('./tasks/serve');
const prepare = require('./tasks/prepare');
const deploy = require('./tasks/deploy');
const icons = require('./tasks/icons');

const config = require('./tasks/config');
Expand Down Expand Up @@ -92,7 +91,6 @@ const build = gulp.series(

gulp.task('serve', gulp.series(build, serve));
gulp.task('prepare', prepare);
gulp.task('deploy', deploy);
gulp.task('build', build);
gulp.task('clean', clean);
gulp.task('copy-assets', copyAssets);
Expand All @@ -101,5 +99,4 @@ gulp.task('scripts', scripts);
gulp.task('vendors', vendors);
gulp.task('icons', icons);
gulp.task('single', gulp.series(single));
gulp.task('deploy', deploy);
gulp.task('default', build);
49 changes: 31 additions & 18 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

'use strict';

const axios = require('axios');
const spawn = require('cross-spawn');
const yargs = require('yargs');

Expand All @@ -10,27 +11,39 @@ const latestVersion = require('latest-version');
const pkg = require('./package.json');

// Display update notification if it's not the last version
latestVersion('toolbox-utils').then(version => {
if (version !== pkg.version) {
const msg = ` Version ${version} (current ${pkg.version}) of toolbox-utils is available ! `;
console.log(`
${chalk.white.bgRed.bold(` ${' '.repeat(msg.length)} \n ${msg} \n${' '.repeat(msg.length)} `)}
To update your beloved builder, do :
$ ${chalk.green('yarn upgrade toolbox-utils')} (recommended)
or
$ ${chalk.green('npm update toolbox-utils')}
`);
}
});
latestVersion('toolbox-utils')
.then(version => {
if (version !== pkg.version) {
const msg = ` Version ${version} (current ${pkg.version}) of toolbox-utils is available ! `;
console.log(`
${chalk.white.bgRed.bold(` ${' '.repeat(msg.length)} \n ${msg} \n${' '.repeat(msg.length)} `)}
To update your beloved builder, do :
$ ${chalk.green('yarn upgrade toolbox-utils')} (recommended)
or
$ ${chalk.green('npm update toolbox-utils')}
`);
}
})
.catch(err => err);

const script = process.argv[2];
const args = process.argv[3] ? '--' + process.argv[3] : process.argv[3];

let env = script === 'build' ? '--production' : '--dev';

const result = spawn(
'./node_modules/.bin/gulp',
[script, '--project', process.cwd(), env, args],
{ stdio: 'inherit', cwd: './node_modules/toolbox-utils' },
);
const binaries = ['deploy'];

if (binaries.includes(script)) {
spawn(
'sh',
[`./bin/${script}.sh`, '--project', process.cwd(), env, args],
{ stdio: 'inherit', cwd: './node_modules/toolbox-utils' },
);
} else {
spawn(
'./node_modules/.bin/gulp',
[script, '--project', process.cwd(), env, args],
{ stdio: 'inherit', cwd: './node_modules/toolbox-utils' },
);
}
93 changes: 49 additions & 44 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "toolbox-utils",
"version": "1.4.5",
"version": "1.5.0",
"description": "Resources for generator-toolbox",
"license": "MIT",
"engines": {
Expand Down Expand Up @@ -32,61 +32,66 @@
"import/no-unresolved": 0
}
},
"scripts": {
"postinstall": "ln -s \"$(pwd)/index.js\" \"$(pwd)/node_modules/.bin/toolbox\" && ln -s \"$(pwd)\" \"$(pwd)/node_modules/toolbox-utils\"",
"postuninstall": "npm run postinstall"
},
"dependencies": {
"autoprefixer": "^8.4.1",
"babel-eslint": "^8.2.3",
"babel-loader": "^7.1.4",
"babel-plugin-transform-es2015-spread": "^6.22.0",
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-preset-es2015": "^6.24.1",
"@babel/core": "^7.4.4",
"@babel/preset-env": "^7.4.4",
"autoprefixer": "^9.5.1",
"axios": "^0.18.0",
"babel-eslint": "^10.0.1",
"babel-loader": "^8.0.5",
"babel-register": "^6.26.0",
"browser-sync": "^2.24.4",
"chalk": "^2.4.1",
"browser-sync": "^2.26.5",
"chalk": "^2.4.2",
"child_process": "^1.0.2",
"cross-spawn": "^6.0.5",
"cssnano": "^3.10.0",
"del": "^3.0.0",
"eslint": "^4.19.1",
"eslint-config-airbnb": "^16.1.0",
"eslint-plugin-import": "^2.11.0",
"eslint-plugin-jsx-a11y": "^6.0.3",
"eslint-plugin-react": "^7.7.0",
"fs-extra": "^6.0.0",
"gulp": "github:gulpjs/gulp#4.0",
"cssnano": "^4.1.10",
"del": "^4.1.1",
"download": "^7.1.0",
"eslint": "^5.16.0",
"eslint-config-airbnb": "^17.1.0",
"eslint-plugin-import": "^2.17.2",
"eslint-plugin-jsx-a11y": "^6.2.1",
"eslint-plugin-react": "^7.12.4",
"fancy-log": "^1.3.3",
"fs-extra": "^7.0.1",
"gulp": "^4.0.0",
"gulp-cheerio": "^0.6.3",
"gulp-concat": "^2.6.1",
"gulp-consolidate": "^0.2.0",
"gulp-eslint": "^4.0.2",
"gulp-gh-pages": "^0.5.4",
"gulp-eslint": "^5.0.0",
"gulp-load-plugins": "^1.5.0",
"gulp-noop": "^1.0.0",
"gulp-notify": "^3.2.0",
"gulp-plumber": "^1.2.0",
"gulp-postcss": "^7.0.1",
"gulp-rename": "^1.2.2",
"gulp-replace": "^0.6.1",
"gulp-sass": "^4.0.1",
"gulp-plumber": "^1.2.1",
"gulp-postcss": "^8.0.0",
"gulp-rename": "^1.4.0",
"gulp-replace": "^1.0.0",
"gulp-sass": "^4.0.2",
"gulp-size": "^3.0.0",
"gulp-sourcemaps": "^2.6.4",
"gulp-stylelint": "^7.0.0",
"gulp-svgo": "^1.5.4",
"gulp-svgstore": "^6.1.1",
"gulp-uglify": "^3.0.0",
"gulp-util": "^3.0.8",
"jquery": "^3.3.1",
"latest-version": "^3.1.0",
"gulp-sourcemaps": "^2.6.5",
"gulp-stylelint": "^9.0.0",
"gulp-svgo": "^2.1.1",
"gulp-svgstore": "^7.0.1",
"gulp-uglify": "^3.0.2",
"jquery": "^3.4.1",
"latest-version": "^5.1.0",
"merge-stream": "^1.0.1",
"node-fetch": "^2.1.2",
"postcss-reporter": "^5.0.0",
"postcss-scss": "^1.0.5",
"stylelint": "^9.2.0",
"stylelint-config-standard": "^18.2.0",
"stylelint-order": "^0.8.1",
"webpack": "^4.8.1",
"webpack-dev-middleware": "^3.1.3",
"webpack-dev-server": "^3.1.4",
"webpack-hot-middleware": "^2.22.1",
"node-fetch": "^2.5.0",
"postcss-reporter": "^6.0.1",
"postcss-scss": "^2.0.0",
"stylelint": "^10.0.1",
"stylelint-config-standard": "^18.3.0",
"stylelint-order": "^3.0.0",
"webpack": "^4.30.0",
"webpack-dev-middleware": "^3.6.2",
"webpack-dev-server": "^3.3.1",
"webpack-hot-middleware": "^2.24.4",
"webpack-module-hot-accept": "^1.0.5",
"yamljs": "^0.3.0",
"yargs": "^11.0.0"
"yargs": "^13.2.2"
}
}
17 changes: 0 additions & 17 deletions tasks/deploy.js

This file was deleted.

3 changes: 2 additions & 1 deletion tasks/helpers.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const yargs = require('yargs');
const log = require('fancy-log');
const config = require('./config');
const gulpLoadPlugins = require('gulp-load-plugins');
const fs = require('fs');
Expand All @@ -9,7 +10,7 @@ const $ = gulpLoadPlugins();
function errorAlert(error) {
if (!config.production) {
$.notify.onError({ title: 'SCSS Error', message: 'Check your terminal', sound: 'Sosumi' })(error);
$.util.log(error.messageFormatted ? error.messageFormatted : error.message);
log(error.messageFormatted ? error.messageFormatted : error.message);
}
this.emit('end');
}
Expand Down
Loading

0 comments on commit 8855775

Please sign in to comment.