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 81226c0 commit 0ae38a1
Show file tree
Hide file tree
Showing 8 changed files with 258 additions and 169 deletions.
33 changes: 17 additions & 16 deletions installer/index.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
#!/usr/bin/env node
/**
* Main Installer for FuzzyMail
* 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';

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;
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];

program
.version(version, '-v, --vers', 'output the current version')
Expand All @@ -34,14 +36,14 @@ program
});

if (response.value) {
// If below Node 8
if (8 > major) {
// If below Node 12
if (12 > major) {
console.error(
chalk.red(
'You are running Node ' +
currentNodeVersion +
'.\n' +
'Install FuzzyMail requires Node 8 or higher. \n' +
'Install FuzzyMail 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 📨 FuzzyMail files to the current directory. ',
Expand Down Expand Up @@ -64,3 +64,5 @@ module.exports = () => {
);
process.exit();
};

export { printNextSteps };
40 changes: 26 additions & 14 deletions installer/modules/run.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,27 @@
const fs = require('fs');
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 = () => {
/**
* 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 run = () => {
// Init
clearConsole();

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

export { run };
17 changes: 10 additions & 7 deletions installer/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fuzzymail",
"version": "0.0.9-3",
"version": "0.0.9-4",
"description": "Responsive email template generator.",
"keywords": [
"boilerplate",
Expand All @@ -22,31 +22,34 @@
],
"homepage": "https://www.fuzzymail.co",
"repository": "https://github.com/luangjokaj/fuzzymail",
"exports": "./index.js",
"type": "module",
"node": "^12.20.0 || ^14.13.1 || >=16.0.0",
"scripts": {
"dev": "gulp dev",
"prod": "gulp prod"
},
"author": "Luan Gjokaj <[email protected]>",
"license": "MIT",
"dependencies": {
"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",
"gulp": "^4.0.2",
"gulp-file-include": "^2.3.0",
"gulp-htmlmin": "^5.0.1",
"gulp-imagemin": "^7.1.0",
"gulp-imagemin": "^8.0.0",
"gulp-inject-string": "^1.1.2",
"gulp-inline": "^0.1.3",
"gulp-inline-css": "^4.0.0",
"gulp-plumber": "^1.2.1",
"gulp-postcss": "^9.0.0",
"gulp-postcss": "^9.0.1",
"gulp-sourcemaps": "^3.0.0",
"gulp-util": "^3.0.8",
"postcss": "^8.3.4",
"postcss": "^8.3.6",
"postcss-flexbugs-fixes": "^5.0.2",
"postcss-import": "^14.0.2",
"postcss-preset-env": "^6.7.0"
Expand Down
Loading

0 comments on commit 0ae38a1

Please sign in to comment.