Skip to content

Commit

Permalink
update builder
Browse files Browse the repository at this point in the history
  • Loading branch information
csscoder committed Dec 13, 2018
1 parent 8d6926b commit 0851fe7
Show file tree
Hide file tree
Showing 12 changed files with 133 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ Desktop.ini
node_modules
**/generated/_icons.sass
npm-debug.log
.vscode/
.vscode/
/_helpers/_accessDeploy.json
6 changes: 6 additions & 0 deletions _helpers/_accessDeployExample.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"hostname": "1.1.1.1",
"username": "user",
"port": 22,
"hostDestination": "/home/www/"
}
29 changes: 29 additions & 0 deletions _helpers/_deploy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
//Rsync
const Rsync = require('rsync');
const pkg = require('../package.json');
const access = require('./_accessDeploy.json');

const directory = pkg.name;
const startDate = pkg.startDate;
const localPath = 'public/';
const hostname = access.hostname;
const username = access.username;
const port = access.port;
const hostDestination = `${access.hostDestination}${startDate}_${directory}`;
const rsync = new Rsync()
.set('progress')
.shell(`ssh -p ${port}`)
.exclude(['.DS_Store'])
.flags('az')
.source(localPath)
.destination(`${username}@${hostname}:${hostDestination}/`);

rsync.execute(function (error, code) {
if (error) {
console.log(error);
}
if (code === 0) {
console.log(`Deployed 'build/' to ${username}@${hostname}:${hostDestination}/`);
console.log(`http://dev.csscoder.pro/${directory}/csscoder.html`);
}
});
1 change: 1 addition & 0 deletions extras/default/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ Desktop.ini
node_modules
**/generated/_icons.sass
npm-debug.log
_accessDeploy.json
21 changes: 21 additions & 0 deletions extras/default/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
For npm package management- use YARN https://yarnpkg.com/lang/en/

# Tasks

### Development task

yarn run blendid
// or
yarn dev

### Production task

yarn run blendid -- build
// or
yarn build

### Note

1. Sources build to 'public' folder.

2. All sources in 'src' folder
6 changes: 6 additions & 0 deletions extras/default/_helpers/_accessDeployExample.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"hostname": "1.1.1.1",
"username": "user",
"port": 22,
"hostDestination": "/home/www/"
}
29 changes: 29 additions & 0 deletions extras/default/_helpers/_deploy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
//Rsync
const Rsync = require('rsync');
const pkg = require('../package.json');
const access = require('./_accessDeploy.json');

const directory = pkg.name;
const localPath = 'public/';
const hostname = access.hostname;
const username = access.username;
const port = access.port;
const hostDestination = `${access.hostDestination}${directory}`;
const rsync = new Rsync()
.set('progress')
.shell(`ssh -p ${port}`)
.exclude(['.DS_Store'])
.set('delete')
.flags('az')
.source(localPath)
.destination(`${username}@${hostname}:${hostDestination}/`);

rsync.execute(function (error, code) {
if (error) {
console.log(error);
}
if (code === 0) {
console.log(`Deployed 'public/' to ${username}@${hostname}:${hostDestination}/`);
console.log(`http://dev.csscoder.pro/${directory}/csscoder.html`);
}
});
11 changes: 11 additions & 0 deletions gulpfile.js/lib/task-defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@ const path = require('path')
const projectPath = require('./projectPath')
const pkg = require(projectPath('package.json'))

const moment = require('moment-timezone');
const timeUpdate = moment().tz(pkg.clientTimeZone).format('DD MMM YYYY, HH:mm');

let manageEnvironment = function(environment) {
environment.addGlobal('globalTimeBuild', timeUpdate);
environment.addGlobal('globalTimeZone', pkg.clientTimeZone);
environment.addGlobal('globalTitle', pkg.title);
environment.addGlobal('globalStartDate', pkg.startDate);
};

module.exports = {
javascripts: {
extensions: ['js', 'jsx'],
Expand Down Expand Up @@ -46,6 +56,7 @@ module.exports = {
html: {
dataFile: "data/global.json",
nunjucksRender: {
manageEnv: manageEnvironment,
envOptions: {
watch: false
}
Expand Down
4 changes: 3 additions & 1 deletion gulpfile.js/task-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ module.exports = {
// should match `dest` in
// path-config.json
baseDir: 'public'
}
},
// xip: true,
// online: true
},

production: {
Expand Down
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{
"name": "blendid",
"title": "Blendid",
"startDate": "2018.12.11",
"clientTimeZone": "America/Los_Angeles",
"version": "4.4.2",
"description": "(formerly gulp-starter) A full featured configurable gulp asset pipeline and static site builder",
"license": "MIT",
Expand Down Expand Up @@ -60,6 +63,7 @@
"lost": "^8.3.0",
"merge-stream": "^1.0.1",
"minimist": "^1.2.0",
"moment-timezone": "^0.5.23",
"node-fs-extra": "^0.8.2",
"node-sass-glob-importer": "^5.0.0-alpha.5",
"open": "0.0.5",
Expand All @@ -68,6 +72,7 @@
"postcss-sorting": "^4.0.1",
"pretty-hrtime": "1.0.3",
"require-dir": "0.3.2",
"rsync": "^0.6.1",
"vue": "^2.5.21",
"vue-loader": "^15.4.2",
"vue-template-compiler": "^2.5.21",
Expand Down
5 changes: 3 additions & 2 deletions src/html/layouts/csscoder.nunj.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,15 @@
<meta name="twitter:description" content="CSSCODER - I'm expert PSD to HTML, I will conver your design to
HTML/CSS/JS with love and based on modern technology.">
<link rel="stylesheet" href="https://use.typekit.net/ffm6dvh.css">
<style> body {font-family:"din-condensed", sans-serif;font-size: 62.5%;line-height: 1.3;background-color: #fafafa;color: #a1a1a1;margin: 0;min-width: 1000px;} .page {width: 80%;max-width: 1280px;margin: 0 auto;font-size: 3em;position: relative;} .frontend-developer span {font-size: 1em;line-height: 110%;vertical-align: top;display: inline-block;color: #181818;font-weight: 400;} .frontend-developer:hover {opacity: 1;} .frontend-developer {-webkit-transition: opacity .3s;transition: opacity .3s;opacity: .7;text-align: center;position: absolute;right: 0;top: 0;display: block;width: 6em;padding-top: 4.2em;text-decoration: none;background-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 796 927" xmlns="http://www.w3.org/2000/svg"><g fill="%23181818" transform="translate(13)"><path d="m527.12 255.5 97.83 56.5-240.55 139.1-240.91-139.1 240.74-139 97.85 56.51-50.22 29-47.63-27.5-140.26 80.99 140.25 81 140.27-81-47.64-27.5zm-157.12 216.06v57.52l-191.62-110.05v51.87l191.91 110.17v167.93l-242.56-139.42v-57.87l191.18 109.75v-51.86l-190.89-109.77v-167.81zm219.79 108.57v-51.63l-191.21 109.51v-166.43l241.31-139.88v57.88l-191.12 109.99v51.62l191.4-109.73v167.61l-241.3 138.69v-57.96z"/><path d="m385 927-398-231.75v-463.5l398-231.75 398 231.75v463.5zm-355.95-255.88 355.95 207.26 355.95-207.26v-415.24l-355.95-207.26-355.95 207.26z"/></g></svg>');background-repeat: no-repeat;background-position: 50% 0;background-size: 4em 4em;-webkit-background-size: 4em 4em;} li {margin: 0.4em 0;} small {font-size: .6em;} a {color: #0087ff;-webkit-transition: opacity .3s;transition: color .3s;text-decoration: none;} a:hover {color: #ff9d00;} h2 i {padding-top: .4em;display: block;font-size: .4em;font-weight: normal;color: #67b64a;font-style: normal;} h2 span {color: #141414;}</style>
<style> body {font-family:"din-condensed", sans-serif;font-size: 62.5%;line-height: 1.3;background-color: #fafafa;color: #a1a1a1;margin: 0;min-width: 1000px;} .page {width: 80%;max-width: 1280px;margin: 0 auto;font-size: 3em;position: relative;} .frontend-developer span {font-size: 1em;line-height: 110%;vertical-align: top;display: inline-block;color: #181818;font-weight: 400;} .frontend-developer:hover {opacity: 1;} .frontend-developer {-webkit-transition: opacity .3s;transition: opacity .3s;opacity: .7;text-align: center;position: absolute;right: 0;top: 0;display: block;width: 6em;padding-top: 4.2em;text-decoration: none;background-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 796 927" xmlns="http://www.w3.org/2000/svg"><g fill="%23181818" transform="translate(13)"><path d="m527.12 255.5 97.83 56.5-240.55 139.1-240.91-139.1 240.74-139 97.85 56.51-50.22 29-47.63-27.5-140.26 80.99 140.25 81 140.27-81-47.64-27.5zm-157.12 216.06v57.52l-191.62-110.05v51.87l191.91 110.17v167.93l-242.56-139.42v-57.87l191.18 109.75v-51.86l-190.89-109.77v-167.81zm219.79 108.57v-51.63l-191.21 109.51v-166.43l241.31-139.88v57.88l-191.12 109.99v51.62l191.4-109.73v167.61l-241.3 138.69v-57.96z"/><path d="m385 927-398-231.75v-463.5l398-231.75 398 231.75v463.5zm-355.95-255.88 355.95 207.26 355.95-207.26v-415.24l-355.95-207.26-355.95 207.26z"/></g></svg>');background-repeat: no-repeat;background-position: 50% 0;background-size: 4em 4em;-webkit-background-size: 4em 4em;} li {margin: 0.4em 0;} small {font-size: .6em;} a {color: #0087ff;-webkit-transition: opacity .3s;transition: color .3s;text-decoration: none;} a:hover {color: #ff9d00;} h2 i {padding-top: .4em;display: block;font-size: .4em;font-weight: normal;color: #67b64a;font-style: normal;font-family: 'Helvetica Neue', 'Helvetica', 'Arial', 'sans-serif';} h2 span {color: #141414;} h2 span b {color: #484848; font-size: .4em }</style>

</head>
<body class="l-body">
<div class="l-page">
<div class="page">
<h2>
<span>{{nameProject}}</span>
<span>Project Name: {{globalTitle}} <b>({{ globalStartDate }})</b></span>
<i>Last update: {{globalTimeBuild}} ({{ globalTimeZone }})</i>
</h2>
<a href="https://csscoder.pro/" target="_blank" class="frontend-developer">
<span>CSSCODER.PRO</span>
Expand Down
17 changes: 17 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5228,6 +5228,18 @@ modify-filename@^1.0.0, modify-filename@^1.1.0:
resolved "https://registry.yarnpkg.com/modify-filename/-/modify-filename-1.1.0.tgz#9a2dec83806fbb2d975f22beec859ca26b393aa1"
integrity sha1-mi3sg4Bvuy2XXyK+7IWcoms5OqE=

moment-timezone@^0.5.23:
version "0.5.23"
resolved "https://registry.yarnpkg.com/moment-timezone/-/moment-timezone-0.5.23.tgz#7cbb00db2c14c71b19303cb47b0fb0a6d8651463"
integrity sha512-WHFH85DkCfiNMDX5D3X7hpNH3/PUhjTGcD0U1SgfBGZxJ3qUmJh5FdvaFjcClxOvB3rzdfj4oRffbI38jEnC1w==
dependencies:
moment ">= 2.9.0"

"moment@>= 2.9.0":
version "2.23.0"
resolved "https://registry.yarnpkg.com/moment/-/moment-2.23.0.tgz#759ea491ac97d54bac5ad776996e2a58cc1bc225"
integrity sha512-3IE39bHVqFbWWaPOMHZF98Q9c3LDKGTmypMiTM2QygGXXElkFWIH7GxfmlwmY2vwa+wmNsoYZmG2iusf1ZjJoA==

ms@0.7.1:
version "0.7.1"
resolved "https://registry.yarnpkg.com/ms/-/ms-0.7.1.tgz#9cd13c03adbff25b65effde7ce864ee952017098"
Expand Down Expand Up @@ -6858,6 +6870,11 @@ ripemd160@^2.0.0, ripemd160@^2.0.1:
hash-base "^3.0.0"
inherits "^2.0.1"

rsync@^0.6.1:
version "0.6.1"
resolved "https://registry.yarnpkg.com/rsync/-/rsync-0.6.1.tgz#3681a0098bd8750448f8bf9da1fee09f7763742b"
integrity sha1-NoGgCYvYdQRI+L+dof7gn3djdCs=

rx@4.1.0:
version "4.1.0"
resolved "https://registry.yarnpkg.com/rx/-/rx-4.1.0.tgz#a5f13ff79ef3b740fe30aa803fb09f98805d4782"
Expand Down

0 comments on commit 0851fe7

Please sign in to comment.