From 3cc186f7e4dcd9ba77d197efdfdb0aac7d528c9d Mon Sep 17 00:00:00 2001 From: Nicholas Hubbard Date: Thu, 8 Sep 2016 15:10:17 -0400 Subject: [PATCH 01/14] Clean Up the Contributing Documentation and Process: Part I * Remove the HTML Validator * Replace JSCS with ESLint * Replace `npm` commands with equivalent `grunt` commands --- .github/CONTRIBUTING.md | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 7025dd7c..49c00ccb 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -5,34 +5,21 @@ Thanks for contributing to MagicMirror²! We hold our code to standard, and these standards are documented below. -First, before you run the linters, you will need to install them all **and** install the development dependencies: +### JavaScript: Run ESLint -```bash -(sudo) npm install -g jscs stylelint html-validator-cli -npm install -``` +We use [ESLint](http://eslint.org) on our JavaScript files. -### JavaScript: Run JSCS +Our ESLint configuration is in our .eslintrc.json and .eslintignore files. -We use [JSCS](http://jscs.info) on our JavaScript files. - -Our JSCS configuration is in our .jscsrc file. - -To run JSCS, use `npm run jscs`. +To run ESLint, use `grunt eslint`. ### CSS: Run StyleLint We use [StyleLint](http://stylelint.io) to lint our CSS. Our configuration is in our .stylelintrc file. -To run StyleLint, use `npm run stylelint`. +To run StyleLint, use `grunt postcss:lint`. -### HTML: Run HTML Validator - -We use [NU Validator](https://validator.w3.org/nu) to validate our HTML. The configuration is in the command in the package.json file. - -To run HTML Validator, use `npm run htmlvalidator`. - -## Submitting Issues +### Submitting Issues Please only submit reproducible issues. From 1a54bafdd55505675dca2d080d463217dadde902 Mon Sep 17 00:00:00 2001 From: Nicholas Hubbard Date: Thu, 8 Sep 2016 15:14:00 -0400 Subject: [PATCH 02/14] Clean Up the Contributing Documentation and Process: Part II * Add `grunt-stylelint` over the complicated PostCSS method previously used. * Remove PostCSS dependencies. --- package.json | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 8c2b226b..977a4bb1 100644 --- a/package.json +++ b/package.json @@ -5,9 +5,6 @@ "main": "js/electron.js", "scripts": { "start": "electron js/electron.js", - "jscs": "jscs **/**/**/**/*.js", - "stylelint": "stylelint css/main.css fonts/roboto.css", - "htmlvalidator": "html-validator --file=index.html", "test": "snyk test", "snyk-protect": "snyk protect", "prepublish": "npm run snyk-protect" @@ -33,11 +30,9 @@ "electron-prebuilt": "latest", "grunt": "latest", "grunt-eslint": "latest", - "grunt-postcss": "latest", - "postcss-reporter": "latest", - "stylelint": "latest", "stylelint-config-standard": "latest", - "time-grunt": "latest" + "time-grunt": "latest", + "grunt-stylelint": "latest" }, "dependencies": { "express": "^4.14.0", @@ -52,4 +47,4 @@ "walk": "latest" }, "snyk": true -} \ No newline at end of file +} From a90f2cb1560956ab3354a370ad881a61f5bc91dc Mon Sep 17 00:00:00 2001 From: Nicholas Hubbard Date: Thu, 8 Sep 2016 15:17:20 -0400 Subject: [PATCH 03/14] Clean Up the Contributing Documentation and Process: Part III * Remove PostCSS from Grunt. * Add StyleLint to Grunt. --- Gruntfile.js | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index ac499fe3..ff1552a8 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -8,21 +8,16 @@ module.exports = function(grunt) { }, target: ["js/*.js", "modules/default/*.js", "serveronly/*.js", "*.js"] }, - postcss: { - lint: { + stylelint: { + simple: { options: { - processors: [ - require("stylelint")({"extends": "stylelint-config-standard", "font-family-name-quotes": "double-where-recommended"}), - require("postcss-reporter")({ clearMessages: true }) - ] + configFile: ".stylelintrc" }, - dist: { - src: "**/**/**/**/**/**/**/**.css" - } + src: "**/**/**/**/**/**/**/**/*.css" } } }); grunt.loadNpmTasks("grunt-eslint"); - grunt.loadNpmTasks("grunt-postcss"); - grunt.registerTask("default", ["eslint", "postcss:lint"]); -}; \ No newline at end of file + grunt.loadNpmTasks("grunt-stylelint"); + grunt.registerTask("default", ["eslint", "stylelint"]); +}; From 83ed298eba1c8827c34733b8777a16fa9f7d2987 Mon Sep 17 00:00:00 2001 From: Nicholas Hubbard Date: Thu, 8 Sep 2016 15:22:40 -0400 Subject: [PATCH 04/14] Clean Up the Contributing Documentation and Process: Part IV * Replace `postcss:lint` with `stylelint`. * Update the contribution instructions. --- .github/CONTRIBUTING.md | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 49c00ccb..ee3b7219 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -3,7 +3,9 @@ Contribution Policy for MagicMirror² Thanks for contributing to MagicMirror²! -We hold our code to standard, and these standards are documented below. +We hold our code to standard, and these standards are documented below. + +If you wish to run both linters, use `grunt` without any arguments. ### JavaScript: Run ESLint @@ -17,30 +19,31 @@ To run ESLint, use `grunt eslint`. We use [StyleLint](http://stylelint.io) to lint our CSS. Our configuration is in our .stylelintrc file. -To run StyleLint, use `grunt postcss:lint`. +To run StyleLint, use `grunt stylelint`. ### Submitting Issues Please only submit reproducible issues. -If you're not sure if it's a real bug or if it's just you, please open a topic on the forum: https://forum.magicmirror.builders/category/15/bug-hunt - Problems installing or configuring your MagicMirror? Check out: https://forum.magicmirror.builders/category/10/troubleshooting +If you're not sure if it's a real bug or if it's just you, please open a topic on the forum: [https://forum.magicmirror.builders/category/15/bug-hunt](https://forum.magicmirror.builders/category/15/bug-hunt) +Problems installing or configuring your MagicMirror? Check out: [https://forum.magicmirror.builders/category/10/troubleshooting](https://forum.magicmirror.builders/category/10/troubleshooting) When submitting a new issue, please supply the following information: -**Platform** [ Raspberry Pi 2/3, Windows, Mac OS X, Linux, Etc ... ]: +**Platform**: Place your platform here... give us your web browser/Electron version *and* your hardware (Raspberry Pi 2/3, Windows, Mac, Linux, System V UNIX). -**Node Version** [ 0.12.13 or later ]: +**Node Version**: Make sure it's version 0.12.13 or later. -**MagicMirror Version** [ V1 / V2-Beta ]: +**MagicMirror Version**: Now that the versions have split, tell us if you are using the PHP version (v1) or the newer JavaScript version (v2). -**Description:** Provide a detailed description about the issue and include specific details to help us understand the problem. Adding screenshots will help describing the problem. +**Description**: Provide a detailed description about the issue and include specific details to help us understand the problem. Adding screenshots will help describing the problem. -**Steps to Reproduce:** List the step by step process to reproduce the issue. +**Steps to Reproduce**: List the step by step process to reproduce the issue. -**Expected Results:** Describe what you expected to see. +**Expected Results**: Describe what you expected to see. -**Actual Results:** Describe what you actually saw. +**Actual Results**: Describe what you actually saw. -**Configuration:** What does the used config.js file look like? (Don't forget to remove any sensitive information.) +**Configuration**: What does the used config.js file look like? Don't forget to remove any sensitive information! -**Additional Notes:** Provide any other relevant notes not previously mentioned (optional) +**Additional Notes**: Provide any other relevant notes not previously mentioned. This is optional. From 504d3cd13148558aa647f6ca603b718f6917aa39 Mon Sep 17 00:00:00 2001 From: Nicholas Hubbard Date: Thu, 8 Sep 2016 15:23:45 -0400 Subject: [PATCH 05/14] Clean Up the Contributing Documentation and Process: Part V * Replace the contribution instructions with the ones from CONTRIBUTING.md. --- .github/ISSUE_TEMPLATE.md | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index 6d039bf1..736795d7 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -1,21 +1,24 @@ Please only submit reproducible issues. -If you're not sure if it's a real bug or if it's just you, please open a topic on the forum: https://forum.magicmirror.builders/category/15/bug-hunt - Problems installing or configuring your MagicMirror? Check out: https://forum.magicmirror.builders/category/10/troubleshooting +If you're not sure if it's a real bug or if it's just you, please open a topic on the forum: [https://forum.magicmirror.builders/category/15/bug-hunt](https://forum.magicmirror.builders/category/15/bug-hunt) +Problems installing or configuring your MagicMirror? Check out: [https://forum.magicmirror.builders/category/10/troubleshooting](https://forum.magicmirror.builders/category/10/troubleshooting) -**Platform** [ Raspberry Pi 2/3, Windows, Mac OS X, Linux, Etc ... ]: +When submitting a new issue, please supply the following information: -**Node Version** [ 0.12.13 or later ]: +**Platform**: Place your platform here... give us your web browser/Electron version *and* your hardware (Raspberry Pi 2/3, Windows, Mac, Linux, System V UNIX). -**MagicMirror Version** [ V1 / V2-Beta ]: +**Node Version**: Make sure it's version 0.12.13 or later. -**Description:** Provide a detailed description about the issue and include specific details to help us understand the problem. Adding screenshots will help describing the problem. +**MagicMirror Version**: Now that the versions have split, tell us if you are using the PHP version (v1) or the newer JavaScript version (v2). -**Steps to Reproduce:** List the step by step process to reproduce the issue. +**Description**: Provide a detailed description about the issue and include specific details to help us understand the problem. Adding screenshots will help describing the problem. -**Expected Results:** Describe what you expected to see. +**Steps to Reproduce**: List the step by step process to reproduce the issue. -**Actual Results:** Describe what you actually saw. +**Expected Results**: Describe what you expected to see. -**Configuration:** What does the used config.js file look like? (Don't forget to remove any sensitive information.) +**Actual Results**: Describe what you actually saw. -**Additional Notes:** Provide any other relevant notes not previously mentioned (optional) +**Configuration**: What does the used config.js file look like? Don't forget to remove any sensitive information! + +**Additional Notes**: Provide any other relevant notes not previously mentioned. This is optional. From 8549aeb466781393cec1af0cc93fee2de475a7a8 Mon Sep 17 00:00:00 2001 From: Nicholas Hubbard Date: Thu, 8 Sep 2016 15:24:52 -0400 Subject: [PATCH 06/14] Clean Up the Contributing Documentation and Process: Part VI * Alter the pull request template to look a little better. --- .github/PULL_REQUEST_TEMPLATE.md | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 1ac9aaa1..215950e0 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,9 +1,7 @@ -> Please send your PR's the develop branch. -> Don't forget to add the change to changelog.md. +> Please send your pull requests the develop branch. +> Don't forget to add the change to CHANGELOG.md. -* Does the pull request solve a **related** issue? [yes | no] +* Does the pull request solve a **related** issue? * If so, can you reference the issue? -* What does the pull request accomplish? (please list) +* What does the pull request accomplish? Use a list if needed. * If it includes major visual changes please add screenshots. - - From 0ec5371b617c1106438cfccf4f485518f555ed14 Mon Sep 17 00:00:00 2001 From: Nicholas Hubbard Date: Thu, 8 Sep 2016 15:26:50 -0400 Subject: [PATCH 07/14] Clean Up the Contributing Documentation and Process: Part VII * Update the changelog to mention my changes. --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e402e066..5659ae66 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,8 @@ This project adheres to [Semantic Versioning](http://semver.org/). ### Updated - Force fullscreen when kioskmode is active. +- Update the .github templates and information with more modern information. +- Update the Gruntfile with a more functional StyleLint implementation. ## [2.0.4] - 2016-08-07 From c76f2c8483b3f9fee80f020927d086f9a2087d71 Mon Sep 17 00:00:00 2001 From: Nicholas Hubbard Date: Thu, 8 Sep 2016 15:41:12 -0400 Subject: [PATCH 08/14] Clean Up the Contributing Documentation and Process: Part VII * Fix the globbing error in the previous commits. --- Gruntfile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gruntfile.js b/Gruntfile.js index ff1552a8..3c7c00cc 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -13,7 +13,7 @@ module.exports = function(grunt) { options: { configFile: ".stylelintrc" }, - src: "**/**/**/**/**/**/**/**/*.css" + src: ["css/custom.css", "css/main.css", "modules/default/calendar/calendar.css", "modules/default/clock/clock_styles.css", "modules/default/currentweather/currentweather.css", "modules/default/weatherforcast/weatherforcast.css"] } } }); From 17452cd5b65bc9d1e23da42a984ec93c9ba2a1b2 Mon Sep 17 00:00:00 2001 From: Nicholas Hubbard Date: Thu, 8 Sep 2016 15:44:43 -0400 Subject: [PATCH 09/14] Clean Up the Contributing Documentation and Process: Part VII.XXXIII * Fix the css/custom.css issues. --- Gruntfile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gruntfile.js b/Gruntfile.js index 3c7c00cc..38f7247b 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -13,7 +13,7 @@ module.exports = function(grunt) { options: { configFile: ".stylelintrc" }, - src: ["css/custom.css", "css/main.css", "modules/default/calendar/calendar.css", "modules/default/clock/clock_styles.css", "modules/default/currentweather/currentweather.css", "modules/default/weatherforcast/weatherforcast.css"] + src: ["css/main.css", "modules/default/calendar/calendar.css", "modules/default/clock/clock_styles.css", "modules/default/currentweather/currentweather.css", "modules/default/weatherforcast/weatherforcast.css"] } } }); From e023a68780745239c077d020f243264ddaff712c Mon Sep 17 00:00:00 2001 From: Nicholas Hubbard Date: Thu, 8 Sep 2016 15:47:16 -0400 Subject: [PATCH 10/14] Clean Up the Contributing Documentation and Process: Part VII.LXVI * Fix the issues in css/main.css. --- css/main.css | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/css/main.css b/css/main.css index 93d6a7ee..7ae902d6 100644 --- a/css/main.css +++ b/css/main.css @@ -1,10 +1,10 @@ html { cursor: none; - overflow:hidden; + overflow: hidden; } -::-webkit-scrollbar { - display: none; +::-webkit-scrollbar { + display: none; } body { From 4e919199907b87f022d92c24cdd251dc4d3fc350 Mon Sep 17 00:00:00 2001 From: Nicholas Hubbard Date: Thu, 8 Sep 2016 15:49:24 -0400 Subject: [PATCH 11/14] Clean Up the Contributing Documentation and Process: Part VII.LXVI.I * Fix the StyleLint config to allow the empty blocks in the clock module CSS. --- .stylelintrc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.stylelintrc b/.stylelintrc index 02300404..db05c713 100644 --- a/.stylelintrc +++ b/.stylelintrc @@ -1,4 +1,5 @@ { "extends": "stylelint-config-standard", - "font-family-name-quotes": "double-where-recommended" -} \ No newline at end of file + "font-family-name-quotes": "double-where-recommended", + "block-no-empty": false +} From 0ca903a146a5ba94ab164fce5857c5337a4e2fb2 Mon Sep 17 00:00:00 2001 From: Nicholas Hubbard Date: Thu, 8 Sep 2016 15:51:58 -0400 Subject: [PATCH 12/14] Clean Up the Contributing Documentation and Process: Part VII.LXVI.II * Fix the indentation in the clock CSS. --- modules/default/clock/clock_styles.css | 102 ++++++++++++------------- 1 file changed, 51 insertions(+), 51 deletions(-) diff --git a/modules/default/clock/clock_styles.css b/modules/default/clock/clock_styles.css index 6020e579..b6eba047 100644 --- a/modules/default/clock/clock_styles.css +++ b/modules/default/clock/clock_styles.css @@ -5,70 +5,70 @@ } .clockCircle { - margin: 0 auto; - position: relative; - border-radius: 50%; - background-size: 100%; + margin: 0 auto; + position: relative; + border-radius: 50%; + background-size: 100%; } .clockFace { - width: 100%; - height: 100%; + width: 100%; + height: 100%; } .clockFace:after { - position: absolute; - top: 50%; - left: 50%; - width: 6px; - height: 6px; - margin: -3px 0 0 -3px; - background: white; - border-radius: 3px; - content: ""; - display: block; + position: absolute; + top: 50%; + left: 50%; + width: 6px; + height: 6px; + margin: -3px 0 0 -3px; + background: white; + border-radius: 3px; + content: ""; + display: block; } .clockHour { - width: 0; - height: 0; - position: absolute; - top: 50%; - left: 50%; - margin: -2px 0 -2px -25%; /* numbers much match negative length & thickness */ - padding: 2px 0 2px 25%; /* indicator length & thickness */ - background: white; - -webkit-transform-origin: 100% 50%; - -ms-transform-origin: 100% 50%; - transform-origin: 100% 50%; - border-radius: 3px 0 0 3px; + width: 0; + height: 0; + position: absolute; + top: 50%; + left: 50%; + margin: -2px 0 -2px -25%; /* numbers much match negative length & thickness */ + padding: 2px 0 2px 25%; /* indicator length & thickness */ + background: white; + -webkit-transform-origin: 100% 50%; + -ms-transform-origin: 100% 50%; + transform-origin: 100% 50%; + border-radius: 3px 0 0 3px; } .clockMinute { - width: 0; - height: 0; - position: absolute; - top: 50%; - left: 50%; - margin: -35% -2px 0; /* numbers must match negative length & thickness */ - padding: 35% 2px 0; /* indicator length & thickness */ - background: white; - -webkit-transform-origin: 50% 100%; - -ms-transform-origin: 50% 100%; - transform-origin: 50% 100%; - border-radius: 3px 0 0 3px; + width: 0; + height: 0; + position: absolute; + top: 50%; + left: 50%; + margin: -35% -2px 0; /* numbers must match negative length & thickness */ + padding: 35% 2px 0; /* indicator length & thickness */ + background: white; + -webkit-transform-origin: 50% 100%; + -ms-transform-origin: 50% 100%; + transform-origin: 50% 100%; + border-radius: 3px 0 0 3px; } .clockSecond { - width: 0; - height: 0; - position: absolute; - top: 50%; - left: 50%; - margin: -38% -1px 0 0; /* numbers must match negative length & thickness */ - padding: 38% 1px 0 0; /* indicator length & thickness */ - background: #888888; - -webkit-transform-origin: 50% 100%; - -ms-transform-origin: 50% 100%; - transform-origin: 50% 100%; + width: 0; + height: 0; + position: absolute; + top: 50%; + left: 50%; + margin: -38% -1px 0 0; /* numbers must match negative length & thickness */ + padding: 38% 1px 0 0; /* indicator length & thickness */ + background: #888888; + -webkit-transform-origin: 50% 100%; + -ms-transform-origin: 50% 100%; + transform-origin: 50% 100%; } From 5ab4b5741150675f124a1114c50a187432b6cf24 Mon Sep 17 00:00:00 2001 From: Nicholas Hubbard Date: Thu, 8 Sep 2016 15:57:25 -0400 Subject: [PATCH 13/14] Clean Up the Contributing Documentation and Process: Part VII.LXVI.III * Fix the errors that popped up out of the blue from Stylelint. --- modules/default/clock/clock_styles.css | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/modules/default/clock/clock_styles.css b/modules/default/clock/clock_styles.css index b6eba047..7dc2d2a8 100644 --- a/modules/default/clock/clock_styles.css +++ b/modules/default/clock/clock_styles.css @@ -1,9 +1,3 @@ -#analog { -} - -#digital { -} - .clockCircle { margin: 0 auto; position: relative; @@ -16,7 +10,7 @@ height: 100%; } -.clockFace:after { +.clockFace::after { position: absolute; top: 50%; left: 50%; @@ -31,6 +25,7 @@ .clockHour { width: 0; + height: 0; position: absolute; top: 50%; @@ -67,7 +62,7 @@ left: 50%; margin: -38% -1px 0 0; /* numbers must match negative length & thickness */ padding: 38% 1px 0 0; /* indicator length & thickness */ - background: #888888; + background: #888; -webkit-transform-origin: 50% 100%; -ms-transform-origin: 50% 100%; transform-origin: 50% 100%; From c87c588c799ecafe5dfe0db4f4715d2328fa5055 Mon Sep 17 00:00:00 2001 From: Nicholas Hubbard Date: Thu, 8 Sep 2016 16:00:48 -0400 Subject: [PATCH 14/14] Clean Up the Contributing Documentation and Process: Part VII.LXVI.IV * Fix yet another out-of-the-blue error that Stylelint found. --- modules/default/clock/clock_styles.css | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/default/clock/clock_styles.css b/modules/default/clock/clock_styles.css index 7dc2d2a8..1df9bf83 100644 --- a/modules/default/clock/clock_styles.css +++ b/modules/default/clock/clock_styles.css @@ -25,7 +25,6 @@ .clockHour { width: 0; - height: 0; position: absolute; top: 50%;