Skip to content

Commit

Permalink
[grunt] added "bump" command
Browse files Browse the repository at this point in the history
  • Loading branch information
Grovkillen committed Feb 24, 2020
1 parent e589fbd commit edd915e
Show file tree
Hide file tree
Showing 21 changed files with 237 additions and 86 deletions.
63 changes: 63 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -409,4 +409,67 @@ module.exports = function(grunt) {
files = files.replace(/\r?\n|\r/g, "");
grunt.file.write( 'build/' + version + '/info/release.txt', releaseInfo + "\n" + files);
});

grunt.registerTask('bump', function(level) {
let settings_from = grunt.file.read('src/gui_easy_settings.js');
let settings = settings_from.match(/--GRUNT-START--([\s\S]*?)\/\/--GRUNT-END--/)[1];
let guiEasy = "{" + settings + "}";
guiEasy = guiEasy.replace(/'/g,"\"");
guiEasy = JSON.parse(guiEasy);
let version_from;
if (guiEasy.development === true && guiEasy.releaseCandidate > 0) {
version_from = guiEasy.major + '.' + guiEasy.minor + '.rc' + guiEasy.releaseCandidate + '.' + guiEasy.minimal;
} else if (guiEasy.development === true) {
version_from = guiEasy.major + '.' + guiEasy.minor + '.nightly.' + guiEasy.minimal;
} else {
version_from = guiEasy.major + '.' + guiEasy.minor + '.' + guiEasy.minimal;
}
if (level === "minimal") {
guiEasy.minimal++;
}
if (level === "minor") {
guiEasy.minor++;
guiEasy.minimal = 0;
guiEasy.releaseCandidate = 0;
guiEasy.development = false;
}
if (level === "major") {
guiEasy.major++;
guiEasy.minor = 0;
guiEasy.minimal = 0;
guiEasy.releaseCandidate = 0;
guiEasy.development = false;
}
if (level === "rc") {
guiEasy.minimal++;
guiEasy.releaseCandidate++;
guiEasy.development = true;
}
if (level === "dev=true") {
guiEasy.development = true;
}
if (level === "dev=false") {
guiEasy.development = false;
}
let version_to;
if (guiEasy.development === true && guiEasy.releaseCandidate > 0) {
version_to = guiEasy.major + '.' + guiEasy.minor + '.rc' + guiEasy.releaseCandidate + '.' + guiEasy.minimal;
} else if (guiEasy.development === true) {
version_to = guiEasy.major + '.' + guiEasy.minor + '.nightly.' + guiEasy.minimal;
} else {
version_to = guiEasy.major + '.' + guiEasy.minor + '.' + guiEasy.minimal;
}
grunt.log.ok(version_from + " --> " + version_to);
let replaceText = "//--GRUNT-START--\n" +
" 'major': " + guiEasy.major + ",\n" +
" 'minor': " + guiEasy.minor + ",\n" +
" 'minimal': " + guiEasy.minimal + ",\n" +
" 'development': " + guiEasy.development + ",\n" +
" 'releaseCandidate': " + guiEasy.releaseCandidate + "\n" +
" //--GRUNT-END--"
;
settings = settings_from.replace(/\/\/--GRUNT-START--([\s\S]*?)\/\/--GRUNT-END--/, replaceText);
grunt.file.write( 'src/gui_easy_settings.js', settings);
}
);
};
2 changes: 1 addition & 1 deletion build/0.0.nightly.2/gui.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/0.0.nightly.2/info/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gui-easy",
"timestamp": 1582321622455,
"timestamp": 1582530833543,
"version": "0.0.2",
"versionName": "0.0.nightly.2",
"author": "Jimmy 'Grovkillen' Westberg <jimmy@grovkillen.com> (https://grovkillen.com)",
Expand Down
4 changes: 2 additions & 2 deletions build/0.0.nightly.2/info/release.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
timestamp:1582321622455
timestamp:1582530833543
major:0
minor:0
minimal:2
rc:0
dev:true
files:[{"build":"main","size":77486},{"build":"noDash","size":66433},{"build":"mini","size":1451}]
files:[{"build":"main","size":78383},{"build":"noDash","size":67319},{"build":"mini","size":1655}]
2 changes: 1 addition & 1 deletion build/0.0.nightly.2/info/source_files.json

Large diffs are not rendered by default.

Binary file modified build/0.0.nightly.2/main/index.htm.gz
Binary file not shown.
Binary file modified build/0.0.nightly.2/mini/index.htm.gz
Binary file not shown.
Binary file modified build/0.0.nightly.2/noDash/index.htm.gz
Binary file not shown.
Binary file modified build/0.0.nightly.2/src-0.0.nightly.2.zip
Binary file not shown.
1 change: 1 addition & 0 deletions build/0.0.nightly.3/gui.min.css

Large diffs are not rendered by default.

43 changes: 43 additions & 0 deletions build/0.0.nightly.3/info/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"name": "gui-easy",
"timestamp": 1582578472664,
"version": "0.0.3",
"versionName": "0.0.nightly.3",
"author": "Jimmy 'Grovkillen' Westberg <jimmy@grovkillen.com> (https://grovkillen.com)",
"description": "Front End for ESP Easy",
"main": "build/0.0.nightly.3/main/index.html.gz",
"repository": {
"type": "git",
"url": "git+https://github.com/letscontrolit/GUIEasy.git"
},
"license": "SEE LICENSE IN LICENSE.md",
"bugs": {
"url": "https://github.com/letscontrolit/GUIEasy/issues"
},
"homepage": "https://github.com/letscontrolit/GUIEasy#readme",
"devDependencies": {
"grunt": "^1.0.4",
"grunt-contrib-uglify-es": "^3.3.0",
"grunt-contrib-cssmin": "^3.0.0",
"grunt-contrib-rename": "^0.2.0",
"grunt-contrib-clean": "^2.0.0",
"grunt-contrib-compress": "^1.6.0",
"grunt-zopfli-native": "^2.0.0",
"grunt-processhtml": "^0.4.2",
"grunt-file-append": "^0.0.7",
"grunt-contrib-copy": "^1.0.0",
"grunt-folder-list": "^1.1.0",
"grunt-size-report": "^0.1.4",
"grunt-filesize": "^0.0.7",
"npm": "^6.13.4"
},
"scripts": {
"build": "node Gruntfile.js"
},
"keywords": [
"ESP Easy",
"CSS framework",
"GUI",
"Frontend"
]
}
7 changes: 7 additions & 0 deletions build/0.0.nightly.3/info/release.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
timestamp:1582578472664
major:0
minor:0
minimal:3
rc:0
dev:true
files:[{"build":"main","size":78383},{"build":"noDash","size":67319},{"build":"mini","size":1655}]
1 change: 1 addition & 0 deletions build/0.0.nightly.3/info/source_files.json

Large diffs are not rendered by default.

Binary file added build/0.0.nightly.3/main/index.htm.gz
Binary file not shown.
Binary file added build/0.0.nightly.3/mini/index.htm.gz
Binary file not shown.
Binary file added build/0.0.nightly.3/noDash/index.htm.gz
Binary file not shown.
Binary file added build/0.0.nightly.3/src-0.0.nightly.3.zip
Binary file not shown.
1 change: 1 addition & 0 deletions build/releases.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
0.0.nightly.1
0.0.nightly.2
0.0.nightly.3
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "gui-easy",
"timestamp": 1582321622455,
"version": "0.0.2",
"versionName": "0.0.nightly.2",
"timestamp": 1582578472664,
"version": "0.0.3",
"versionName": "0.0.nightly.3",
"author": "Jimmy 'Grovkillen' Westberg <jimmy@grovkillen.com> (https://grovkillen.com)",
"description": "Front End for ESP Easy",
"main": "build/0.0.nightly.2/main/index.html.gz",
"main": "build/0.0.nightly.3/main/index.html.gz",
"repository": {
"type": "git",
"url": "git+https://github.com/letscontrolit/GUIEasy.git"
Expand Down
140 changes: 70 additions & 70 deletions src/gui_easy_settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const guiEasy = {
//--GRUNT-START--
'major': 0,
'minor': 0,
'minimal': 2,
'minimal': 3,
'development': true,
'releaseCandidate': 0
//--GRUNT-END--
Expand Down Expand Up @@ -168,54 +168,54 @@ const guiEasy = {
},
'timelist': {
'week': [
{"text":"Last","value":0, "disabled":false, "note":""},
{"text":"1st","value":1, "disabled":false, "note":""},
{"text":"2nd","value":2, "disabled":false, "note":""},
{"text":"3rd","value":3, "disabled":false, "note":""},
{"text":"4th","value":4, "disabled":false, "note":""}
],
{"text":"Last","value":0, "disabled":false, "note":""},
{"text":"1st","value":1, "disabled":false, "note":""},
{"text":"2nd","value":2, "disabled":false, "note":""},
{"text":"3rd","value":3, "disabled":false, "note":""},
{"text":"4th","value":4, "disabled":false, "note":""}
],
'day': [
{"text":"Sunday","value":1, "disabled":false, "note":""},
{"text":"Monday","value":2, "disabled":false, "note":""},
{"text":"Tuesday","value":3, "disabled":false, "note":""},
{"text":"Wednesday","value":4, "disabled":false, "note":""},
{"text":"Thursday","value":5, "disabled":false, "note":""},
{"text":"Friday","value":6, "disabled":false, "note":""},
{"text":"Saturday","value":7, "disabled":false, "note":""}
],
{"text":"Sunday","value":1, "disabled":false, "note":""},
{"text":"Monday","value":2, "disabled":false, "note":""},
{"text":"Tuesday","value":3, "disabled":false, "note":""},
{"text":"Wednesday","value":4, "disabled":false, "note":""},
{"text":"Thursday","value":5, "disabled":false, "note":""},
{"text":"Friday","value":6, "disabled":false, "note":""},
{"text":"Saturday","value":7, "disabled":false, "note":""}
],
'month':[
{"text":"January","value":1, "disabled":false, "note":""},
{"text":"February","value":2, "disabled":false, "note":""},
{"text":"March","value":3, "disabled":false, "note":""},
{"text":"April","value":4, "disabled":false, "note":""},
{"text":"May","value":5, "disabled":false, "note":""},
{"text":"June","value":6, "disabled":false, "note":""},
{"text":"July","value":7, "disabled":false, "note":""},
{"text":"August","value":8, "disabled":false, "note":""},
{"text":"September","value":9, "disabled":false, "note":""},
{"text":"October","value":10, "disabled":false, "note":""},
{"text":"November","value":11, "disabled":false, "note":""},
{"text":"December","value":12, "disabled":false, "note":""}
]
{"text":"January","value":1, "disabled":false, "note":""},
{"text":"February","value":2, "disabled":false, "note":""},
{"text":"March","value":3, "disabled":false, "note":""},
{"text":"April","value":4, "disabled":false, "note":""},
{"text":"May","value":5, "disabled":false, "note":""},
{"text":"June","value":6, "disabled":false, "note":""},
{"text":"July","value":7, "disabled":false, "note":""},
{"text":"August","value":8, "disabled":false, "note":""},
{"text":"September","value":9, "disabled":false, "note":""},
{"text":"October","value":10, "disabled":false, "note":""},
{"text":"November","value":11, "disabled":false, "note":""},
{"text":"December","value":12, "disabled":false, "note":""}
]
},
'gpiolist': function (board = 'ESP82XX') {
if (board === 'ESP82XX') {
return [
{'text':'- None -', 'value':-1, 'disabled':false, 'note':''},
{'text':'GPIO 0 (D3)', 'value':0, 'disabled':false, 'note':'\u26A0'},
{'text':'GPIO 1 (D10)', 'value':1, 'disabled':true, 'note':'Tx0'},
{'text':'GPIO 2 (D4)', 'value':2, 'disabled':false, 'note':'\u26A0'},
{'text':'GPIO 3 (D9)', 'value':3, 'disabled':true, 'note':'Rx0'},
{'text':'GPIO 4 (D2)', 'value':4, 'disabled':false, 'note':''},
{'text':'GPIO 5 (D1)', 'value':5, 'disabled':false, 'note':''},
{'text':'GPIO 9 (D11)', 'value':9, 'disabled':false, 'note':'\u26A0'},
{'text':'GPIO 10 (D10)', 'value':10, 'disabled':false, 'note':'\u26A0'},
{'text':'GPIO 12 (D12)', 'value':12, 'disabled':false, 'note':''},
{'text':'GPIO 13 (D13)', 'value':13, 'disabled':false, 'note':''},
{'text':'GPIO 14 (D14)', 'value':14, 'disabled':false, 'note':''},
{'text':'GPIO 15 (D15)', 'value':15, 'disabled':false, 'note':'\u26A0'},
{'text':'GPIO 16 (D16)', 'value':16, 'disabled':false, 'note':''}
]
{'text':'- None -', 'value':-1, 'disabled':false, 'note':''},
{'text':'GPIO 0 (D3)', 'value':0, 'disabled':false, 'note':'\u26A0'},
{'text':'GPIO 1 (D10)', 'value':1, 'disabled':true, 'note':'Tx0'},
{'text':'GPIO 2 (D4)', 'value':2, 'disabled':false, 'note':'\u26A0'},
{'text':'GPIO 3 (D9)', 'value':3, 'disabled':true, 'note':'Rx0'},
{'text':'GPIO 4 (D2)', 'value':4, 'disabled':false, 'note':''},
{'text':'GPIO 5 (D1)', 'value':5, 'disabled':false, 'note':''},
{'text':'GPIO 9 (D11)', 'value':9, 'disabled':false, 'note':'\u26A0'},
{'text':'GPIO 10 (D10)', 'value':10, 'disabled':false, 'note':'\u26A0'},
{'text':'GPIO 12 (D12)', 'value':12, 'disabled':false, 'note':''},
{'text':'GPIO 13 (D13)', 'value':13, 'disabled':false, 'note':''},
{'text':'GPIO 14 (D14)', 'value':14, 'disabled':false, 'note':''},
{'text':'GPIO 15 (D15)', 'value':15, 'disabled':false, 'note':'\u26A0'},
{'text':'GPIO 16 (D16)', 'value':16, 'disabled':false, 'note':''}
]
}
if (board === 'ESP32') {
return null;
Expand All @@ -239,7 +239,7 @@ const guiEasy = {
'tabs': {
'left': ['main', 'config', 'hardware', 'tasks'],
'right': ['controllers', 'notification', 'tools', 'rules']
},
},
'guiStats': { //Not to be mistaken for the unit's stats, this is the queen bee gui buildup stats
'pageSize': 0, //the other is how the unit themselves are doing fetch-wise
'bootTime': 0,
Expand All @@ -249,31 +249,31 @@ const guiEasy = {
'syntax': {
'curlyLC': 0, //USED TO SEE HOW MANY LOOPS ARE NEEDED TO REPLACE ALL CURLY
'curly': [
// PUT CURLY's WITH NO SUB-CURLY's FIRST FOR OPTIMIZATION
// FIRST LEVEL ONLY, the rest will dig down automatically
// We create this array manually for optimization purpose
'fetching',
'input',
'table',
'goto',
'button',
'version',
'tasktable',
'controllertable',
'notificationtable',
'setup',
'notifier',
'drawer',
'navbar',
'unit',
'unitname',
'modal',
'info',
'menu',
'wave',
'page',
'logo',
'icon'
]
// PUT CURLY's WITH NO SUB-CURLY's FIRST FOR OPTIMIZATION
// FIRST LEVEL ONLY, the rest will dig down automatically
// We create this array manually for optimization purpose
'fetching',
'input',
'table',
'goto',
'button',
'version',
'tasktable',
'controllertable',
'notificationtable',
'setup',
'notifier',
'drawer',
'navbar',
'unit',
'unitname',
'modal',
'info',
'menu',
'wave',
'page',
'logo',
'icon'
]
}
};
Loading

0 comments on commit edd915e

Please sign in to comment.