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

Commit 8855775

Browse files
committed
Merge branch 'release/1.5.0'
2 parents 64e0bc6 + 0bf0dd6 commit 8855775

File tree

13 files changed

+3573
-2608
lines changed

13 files changed

+3573
-2608
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# Toolbox Utils - CHANGELOG
22

3+
*1.5.0* (2019-05-07)
4+
- ✨ add seemless offline support (6767f7a)
5+
- ✨ add future proof reader CDN (see you in a year XD) (8721b4a)
6+
- 💄 use nicer template log (16bbcb7)
7+
- 🔨 drop gulp-utils for fancy-log #24 (5774132)
8+
- 🔨 move vendors.min.css before projects CSSs for a safer future #32 (ff573d7)
9+
- 🔨 replace deploy Gulp task by a stronger shell script #21 (2541b2d)
10+
- ⬆️ update all dependencies (e0f09fc)
11+
- 🔧 stop renaming keyframes, counter and gridTemplate (23dfe4c)
12+
313
*1.4.5* (2018-07-19)
414
- 🐛 fix broken components dirtree (b3ad176)
515

bin/deploy.sh

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#!/bin/bash
2+
3+
jq --version || { echo "⚠️ You must have jq installed on your machine (brew install jq)" ; exit 1; }
4+
5+
cd $2
6+
7+
DEST=`jq -er ".ghpages" "$2/toolbox.json"`
8+
DIRECTORY="$2/${DEST%?}"
9+
BRANCH="gh-pages"
10+
CURRENT_BRANCH=$(git branch | sed -n -e 's/^\* \(.*\)/\1/p')
11+
12+
# Check if the environment is ready for publishing ===========================
13+
if [[ $(git status -s) ]]
14+
then
15+
echo "⚠️ The working directory is dirty. Please commit any pending changes."
16+
exit 1;
17+
fi
18+
19+
# Proceed =====================================================================
20+
# yarn build --dev
21+
echo "backup dist content"
22+
echo $DIRECTORY
23+
mkdir "$DIRECTORY-tmp"
24+
cp -r $DIRECTORY/* "$DIRECTORY-tmp/"
25+
26+
echo "Deleting dist"
27+
rm -rf $DIRECTORY
28+
mkdir $DIRECTORY
29+
git worktree prune
30+
rm -rf .git/worktrees/$DIRECTORY/
31+
32+
echo "Checking out $BRANCH branch into dist"
33+
git worktree add -B $BRANCH $DIRECTORY
34+
35+
echo "Removing existing files"
36+
rm -rf $DIRECTORY/*
37+
38+
echo "Generating dist using the backup"
39+
cp -r "$DIRECTORY-tmp"/* $DIRECTORY/
40+
rm -rf "$DIRECTORY-tmp"
41+
42+
echo "Updating $BRANCH branch"
43+
cd $DIRECTORY && git add --all && git commit -m "Publishing to $BRANCH (publish.sh)"
44+
git push --force origin $BRANCH --tags

gulpfile.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ const vendors = require('./tasks/vendors');
1111
const single = require('./tasks/single');
1212
const serve = require('./tasks/serve');
1313
const prepare = require('./tasks/prepare');
14-
const deploy = require('./tasks/deploy');
1514
const icons = require('./tasks/icons');
1615

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

9392
gulp.task('serve', gulp.series(build, serve));
9493
gulp.task('prepare', prepare);
95-
gulp.task('deploy', deploy);
9694
gulp.task('build', build);
9795
gulp.task('clean', clean);
9896
gulp.task('copy-assets', copyAssets);
@@ -101,5 +99,4 @@ gulp.task('scripts', scripts);
10199
gulp.task('vendors', vendors);
102100
gulp.task('icons', icons);
103101
gulp.task('single', gulp.series(single));
104-
gulp.task('deploy', deploy);
105102
gulp.task('default', build);

index.js

Lines changed: 31 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
'use strict';
44

5+
const axios = require('axios');
56
const spawn = require('cross-spawn');
67
const yargs = require('yargs');
78

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

1213
// Display update notification if it's not the last version
13-
latestVersion('toolbox-utils').then(version => {
14-
if (version !== pkg.version) {
15-
const msg = ` Version ${version} (current ${pkg.version}) of toolbox-utils is available ! `;
16-
console.log(`
17-
${chalk.white.bgRed.bold(` ${' '.repeat(msg.length)} \n ${msg} \n${' '.repeat(msg.length)} `)}
18-
19-
To update your beloved builder, do :
20-
$ ${chalk.green('yarn upgrade toolbox-utils')} (recommended)
21-
or
22-
$ ${chalk.green('npm update toolbox-utils')}
23-
`);
24-
}
25-
});
14+
latestVersion('toolbox-utils')
15+
.then(version => {
16+
if (version !== pkg.version) {
17+
const msg = ` Version ${version} (current ${pkg.version}) of toolbox-utils is available ! `;
18+
console.log(`
19+
${chalk.white.bgRed.bold(` ${' '.repeat(msg.length)} \n ${msg} \n${' '.repeat(msg.length)} `)}
20+
21+
To update your beloved builder, do :
22+
$ ${chalk.green('yarn upgrade toolbox-utils')} (recommended)
23+
or
24+
$ ${chalk.green('npm update toolbox-utils')}
25+
`);
26+
}
27+
})
28+
.catch(err => err);
2629

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

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

32-
const result = spawn(
33-
'./node_modules/.bin/gulp',
34-
[script, '--project', process.cwd(), env, args],
35-
{ stdio: 'inherit', cwd: './node_modules/toolbox-utils' },
36-
);
35+
const binaries = ['deploy'];
36+
37+
if (binaries.includes(script)) {
38+
spawn(
39+
'sh',
40+
[`./bin/${script}.sh`, '--project', process.cwd(), env, args],
41+
{ stdio: 'inherit', cwd: './node_modules/toolbox-utils' },
42+
);
43+
} else {
44+
spawn(
45+
'./node_modules/.bin/gulp',
46+
[script, '--project', process.cwd(), env, args],
47+
{ stdio: 'inherit', cwd: './node_modules/toolbox-utils' },
48+
);
49+
}

package.json

Lines changed: 49 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "toolbox-utils",
3-
"version": "1.4.5",
3+
"version": "1.5.0",
44
"description": "Resources for generator-toolbox",
55
"license": "MIT",
66
"engines": {
@@ -32,61 +32,66 @@
3232
"import/no-unresolved": 0
3333
}
3434
},
35+
"scripts": {
36+
"postinstall": "ln -s \"$(pwd)/index.js\" \"$(pwd)/node_modules/.bin/toolbox\" && ln -s \"$(pwd)\" \"$(pwd)/node_modules/toolbox-utils\"",
37+
"postuninstall": "npm run postinstall"
38+
},
3539
"dependencies": {
36-
"autoprefixer": "^8.4.1",
37-
"babel-eslint": "^8.2.3",
38-
"babel-loader": "^7.1.4",
39-
"babel-plugin-transform-es2015-spread": "^6.22.0",
40-
"babel-plugin-transform-object-rest-spread": "^6.26.0",
41-
"babel-preset-es2015": "^6.24.1",
40+
"@babel/core": "^7.4.4",
41+
"@babel/preset-env": "^7.4.4",
42+
"autoprefixer": "^9.5.1",
43+
"axios": "^0.18.0",
44+
"babel-eslint": "^10.0.1",
45+
"babel-loader": "^8.0.5",
4246
"babel-register": "^6.26.0",
43-
"browser-sync": "^2.24.4",
44-
"chalk": "^2.4.1",
47+
"browser-sync": "^2.26.5",
48+
"chalk": "^2.4.2",
4549
"child_process": "^1.0.2",
4650
"cross-spawn": "^6.0.5",
47-
"cssnano": "^3.10.0",
48-
"del": "^3.0.0",
49-
"eslint": "^4.19.1",
50-
"eslint-config-airbnb": "^16.1.0",
51-
"eslint-plugin-import": "^2.11.0",
52-
"eslint-plugin-jsx-a11y": "^6.0.3",
53-
"eslint-plugin-react": "^7.7.0",
54-
"fs-extra": "^6.0.0",
55-
"gulp": "github:gulpjs/gulp#4.0",
51+
"cssnano": "^4.1.10",
52+
"del": "^4.1.1",
53+
"download": "^7.1.0",
54+
"eslint": "^5.16.0",
55+
"eslint-config-airbnb": "^17.1.0",
56+
"eslint-plugin-import": "^2.17.2",
57+
"eslint-plugin-jsx-a11y": "^6.2.1",
58+
"eslint-plugin-react": "^7.12.4",
59+
"fancy-log": "^1.3.3",
60+
"fs-extra": "^7.0.1",
61+
"gulp": "^4.0.0",
5662
"gulp-cheerio": "^0.6.3",
5763
"gulp-concat": "^2.6.1",
5864
"gulp-consolidate": "^0.2.0",
59-
"gulp-eslint": "^4.0.2",
60-
"gulp-gh-pages": "^0.5.4",
65+
"gulp-eslint": "^5.0.0",
6166
"gulp-load-plugins": "^1.5.0",
67+
"gulp-noop": "^1.0.0",
6268
"gulp-notify": "^3.2.0",
63-
"gulp-plumber": "^1.2.0",
64-
"gulp-postcss": "^7.0.1",
65-
"gulp-rename": "^1.2.2",
66-
"gulp-replace": "^0.6.1",
67-
"gulp-sass": "^4.0.1",
69+
"gulp-plumber": "^1.2.1",
70+
"gulp-postcss": "^8.0.0",
71+
"gulp-rename": "^1.4.0",
72+
"gulp-replace": "^1.0.0",
73+
"gulp-sass": "^4.0.2",
6874
"gulp-size": "^3.0.0",
69-
"gulp-sourcemaps": "^2.6.4",
70-
"gulp-stylelint": "^7.0.0",
71-
"gulp-svgo": "^1.5.4",
72-
"gulp-svgstore": "^6.1.1",
73-
"gulp-uglify": "^3.0.0",
74-
"gulp-util": "^3.0.8",
75-
"jquery": "^3.3.1",
76-
"latest-version": "^3.1.0",
75+
"gulp-sourcemaps": "^2.6.5",
76+
"gulp-stylelint": "^9.0.0",
77+
"gulp-svgo": "^2.1.1",
78+
"gulp-svgstore": "^7.0.1",
79+
"gulp-uglify": "^3.0.2",
80+
"jquery": "^3.4.1",
81+
"latest-version": "^5.1.0",
7782
"merge-stream": "^1.0.1",
78-
"node-fetch": "^2.1.2",
79-
"postcss-reporter": "^5.0.0",
80-
"postcss-scss": "^1.0.5",
81-
"stylelint": "^9.2.0",
82-
"stylelint-config-standard": "^18.2.0",
83-
"stylelint-order": "^0.8.1",
84-
"webpack": "^4.8.1",
85-
"webpack-dev-middleware": "^3.1.3",
86-
"webpack-dev-server": "^3.1.4",
87-
"webpack-hot-middleware": "^2.22.1",
83+
"node-fetch": "^2.5.0",
84+
"postcss-reporter": "^6.0.1",
85+
"postcss-scss": "^2.0.0",
86+
"stylelint": "^10.0.1",
87+
"stylelint-config-standard": "^18.3.0",
88+
"stylelint-order": "^3.0.0",
89+
"webpack": "^4.30.0",
90+
"webpack-dev-middleware": "^3.6.2",
91+
"webpack-dev-server": "^3.3.1",
92+
"webpack-hot-middleware": "^2.24.4",
8893
"webpack-module-hot-accept": "^1.0.5",
8994
"yamljs": "^0.3.0",
90-
"yargs": "^11.0.0"
95+
"yargs": "^13.2.2"
9196
}
9297
}

tasks/deploy.js

Lines changed: 0 additions & 17 deletions
This file was deleted.

tasks/helpers.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
const yargs = require('yargs');
2+
const log = require('fancy-log');
23
const config = require('./config');
34
const gulpLoadPlugins = require('gulp-load-plugins');
45
const fs = require('fs');
@@ -9,7 +10,7 @@ const $ = gulpLoadPlugins();
910
function errorAlert(error) {
1011
if (!config.production) {
1112
$.notify.onError({ title: 'SCSS Error', message: 'Check your terminal', sound: 'Sosumi' })(error);
12-
$.util.log(error.messageFormatted ? error.messageFormatted : error.message);
13+
log(error.messageFormatted ? error.messageFormatted : error.message);
1314
}
1415
this.emit('end');
1516
}

0 commit comments

Comments
 (0)