Skip to content

Commit

Permalink
chore: update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
luangjokaj committed Sep 4, 2021
1 parent 91e62a2 commit fa79832
Show file tree
Hide file tree
Showing 8 changed files with 70 additions and 46 deletions.
23 changes: 12 additions & 11 deletions installer/index.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,27 @@
#!/usr/bin/env node
/**
* Main Installer for GoPablo
* Check the node version if above 8 then run the app.
* Check the node version if above 12 then run the app.
*
* Credits:
* Ahmad Awais - https://twitter.com/MrAhmadAwais/
* Luan Gjokaj - https://twitter.com/luangjokaj/
*/

'use strict';
import prompts from 'prompts';
import chalk from 'chalk';
import program from 'commander';
import { createRequire } from 'module';
import { run } from './modules/run.js';

const require = createRequire(import.meta.url);
const packageData = require('./package.json');

const version = packageData.version;
const currentNodeVersion = process.versions.node;
const semver = currentNodeVersion.split('.');
const major = semver[0];

const prompts = require('prompts');
const chalk = require('chalk');

const program = require('commander');
const version = require('../package.json').version;

program
.version(version, '-v, --vers', 'output the current version')
.parse(process.argv);
Expand All @@ -35,13 +37,13 @@ program

if (response.value) {
// If below Node 8
if (8 > major) {
if (12 > major) {
console.error(
chalk.red(
'You are running Node ' +
currentNodeVersion +
'.\n' +
'Install GoPablo requires Node 8 or higher. \n' +
'Install GoPablo requires Node 12 or higher. \n' +
'Kindly, update your version of Node.'
)
);
Expand All @@ -60,7 +62,6 @@ program
*
* Runs all the functions with async/await
*/
const run = require('./modules/run');
run();
}
})();
10 changes: 5 additions & 5 deletions installer/modules/clearConsole.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
/**
* Cross platform clear console
* Cross platform clear console.
*
* Support for win32 and others
* Support for win32 and others.
*/

'use strict';

module.exports = () => {
const clearConsole = () => {
process.stdout.write(
'win32' === process.platform ? '\x1B[2J\x1B[0f' : '\x1B[2J\x1B[3J\x1B[H'
);
};

export { clearConsole };
8 changes: 6 additions & 2 deletions installer/modules/handleError.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
'use strict';
/**
* Error handler
*/

module.exports = (err) => {
const handleError = (err) => {
if (err) {
console.log('ERROR: ' + err);
}
};

export { handleError };
6 changes: 4 additions & 2 deletions installer/modules/printNextSteps.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const chalk = require('chalk');
import chalk from 'chalk';

module.exports = () => {
const printNextSteps = () => {
console.log('\n\n✅ ', chalk.black.bgGreen(' All done! Happy coding. \n'));
console.log(
'Installer has added 🐺 GoPablo files to the current directory. ',
Expand Down Expand Up @@ -64,3 +64,5 @@ module.exports = () => {
);
process.exit();
};

export { printNextSteps };
34 changes: 23 additions & 11 deletions installer/modules/run.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,27 @@
const fs = require('fs');
/**
* Installation
*/

import fs from 'fs';
import ora from 'ora';
import execa from 'execa';
import chalk from 'chalk';
import download from 'download';
import { createRequire } from 'module';
import { handleError } from './handleError.js';
import { clearConsole } from './clearConsole.js';
import { printNextSteps } from './printNextSteps.js';

const require = createRequire(import.meta.url);
const packageData = require('../package.json');

const version = packageData.version;

const theCWD = process.cwd();
const theCWDArray = theCWD.split('/');
const theDir = theCWDArray[theCWDArray.length - 1];
const ora = require('ora');
const execa = require('execa');
const chalk = require('chalk');
const download = require('download');
const handleError = require('./handleError.js');
const clearConsole = require('./clearConsole.js');
const printNextSteps = require('./printNextSteps.js');
const version = require('../package.json').version;

module.exports = () => {

const run = () => {
// Init
clearConsole();

Expand Down Expand Up @@ -140,3 +150,5 @@ module.exports = () => {
}
);
};

export { run };
21 changes: 12 additions & 9 deletions installer/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gopablo",
"version": "0.1.5-2",
"version": "0.1.5-3",
"description": "Create optimized static websites.",
"keywords": [
"babel",
Expand All @@ -25,6 +25,9 @@
],
"homepage": "https://www.gopablo.co",
"repository": "https://github.com/luangjokaj/gopablo",
"exports": "./index.js",
"type": "module",
"node": "^12.20.0 || ^14.13.1 || >=16.0.0",
"scripts": {
"start": "npm run prod && node server.js",
"dev": "gulp dev",
Expand All @@ -34,31 +37,31 @@
"author": "Luan Gjokaj <[email protected]>",
"license": "MIT",
"dependencies": {
"@babel/core": "^7.14.6",
"@babel/preset-env": "^7.14.5",
"@babel/core": "^7.15.5",
"@babel/preset-env": "^7.15.4",
"aos": "^2.3.4",
"autoprefixer": "^10.2.6",
"browser-sync": "^2.26.14",
"autoprefixer": "^10.3.4",
"browser-sync": "^2.27.5",
"cherry-postcss": "^0.0.2-11",
"connect-modrewrite": "^0.10.2",
"cssnano": "^5.0.6",
"cssnano": "^5.0.8",
"del": "^6.0.0",
"express": "^4.17.1",
"gulp": "^4.0.2",
"gulp-babel": "^8.0.0",
"gulp-concat": "^2.6.1",
"gulp-file-include": "^2.3.0",
"gulp-htmlmin": "^5.0.1",
"gulp-imagemin": "^7.1.0",
"gulp-imagemin": "^8.0.0",
"gulp-plumber": "^1.2.1",
"gulp-postcss": "^9.0.0",
"gulp-postcss": "^9.0.1",
"gulp-purgecss": "^4.0.3",
"gulp-rev-all": "^3.0.0",
"gulp-sourcemaps": "^3.0.0",
"gulp-uglify": "^3.0.2",
"gulp-util": "^3.0.8",
"jquery": "^3.6.0",
"postcss": "^8.3.4",
"postcss": "^8.3.6",
"postcss-flexbugs-fixes": "^5.0.2",
"postcss-import": "^14.0.2",
"postcss-mixins": "^8.1.0",
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

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

10 changes: 6 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gopablo",
"version": "0.1.5-2",
"version": "0.1.5-3",
"description": "Create optimized static websites.",
"keywords": [
"babel",
Expand All @@ -26,17 +26,19 @@
"homepage": "https://www.gopablo.co",
"repository": "https://github.com/luangjokaj/gopablo",
"main": "./installer/index.js",
"type": "module",
"node": "^12.20.0 || ^14.13.1 || >=16.0.0",
"bin": {
"gopablo": "./installer/index.js"
},
"author": "Luan Gjokaj <[email protected]>",
"license": "MIT",
"dependencies": {
"chalk": "^4.1.1",
"commander": "^7.2.0",
"chalk": "^4.1.2",
"commander": "^8.1.0",
"download": "^8.0.0",
"execa": "^5.1.1",
"ora": "^5.4.1",
"ora": "^6.0.0",
"prompts": "^2.4.1"
}
}

0 comments on commit fa79832

Please sign in to comment.