diff --git a/.eslintrc.yml b/.eslintrc.yml
new file mode 100644
index 0000000..395850a
--- /dev/null
+++ b/.eslintrc.yml
@@ -0,0 +1,96 @@
+---
+
+env:
+ es6: true
+
+extends:
+ # https://github.com/airbnb/javascript
+ - airbnb
+ - eslint:recommended
+ - prettier
+
+parser: babel-eslint
+
+rules:
+ # best practices
+ arrow-parens:
+ - 2
+ - as-needed
+ semi:
+ - 2
+ - never
+ class-methods-use-this: 0
+ comma-dangle:
+ - 2
+ - always-multiline
+ no-console:
+ - 2
+ no-unused-expressions: 0
+ no-param-reassign:
+ - 2
+ - props: false
+ no-useless-escape: 0
+ func-names: 0
+ quotes:
+ - 2
+ - single
+ - allowTemplateLiterals: true
+ no-underscore-dangle: 0
+ object-curly-newline: 0
+ function-paren-newline: 0
+ operator-linebreak:
+ - 2
+ - after
+ no-unused-vars:
+ - 2
+ - argsIgnorePattern: "^_"
+ # jsx a11y
+ jsx-a11y/no-static-element-interactions: 0
+ jsx-a11y/anchor-is-valid:
+ - 2
+ - specialLink:
+ - to
+ # react
+ react/prop-types: 0
+ react/jsx-filename-extension: 0
+ react/jsx-no-bind:
+ - 2
+ - ignoreRefs: true
+ react/jsx-first-prop-new-line:
+ - 2
+ - never
+ react/jsx-indent-props:
+ - 2
+ - 2
+ react/jsx-closing-bracket-location:
+ - 1
+ - selfClosing: after-props
+ nonEmpty: after-props
+ react/prefer-stateless-function:
+ - 1
+ - ignorePureComponents: true
+ react/jsx-boolean-value:
+ - 2
+ - always
+ react/no-unused-prop-types: 0
+ # import - wyłączone! jak pogodzić resolver webpack i react-native?
+ import/no-unresolved: 0
+ import/extensions: 0
+ import/no-extraneous-dependencies: 0
+ import/prefer-default-export: 0
+ flowtype/delimiter-dangle:
+ - 2
+ - always-multiline
+ flowtype/require-return-type:
+ - 2
+ - always
+ - excludeArrowFunctions: true
+ annotateUndefined: always
+
+globals:
+ document: true
+ requestAnimationFrame: true
+ window: true
+ self: true
+ fetch: true
+ Headers: true
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..b512c09
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+node_modules
\ No newline at end of file
diff --git a/.prettierrc b/.prettierrc
new file mode 100644
index 0000000..8c6cd7a
--- /dev/null
+++ b/.prettierrc
@@ -0,0 +1,5 @@
+{
+ "parser": "babylon",
+ "printWidth": 100,
+ "trailingComma": "all"
+}
diff --git a/layouts/partials/inject.script.html b/layouts/partials/inject.script.html
index 81868f4..d9de605 100644
--- a/layouts/partials/inject.script.html
+++ b/layouts/partials/inject.script.html
@@ -1,9 +1,5 @@
-
-
-
-
diff --git a/package.json b/package.json
index f18fda3..9373331 100644
--- a/package.json
+++ b/package.json
@@ -14,22 +14,24 @@
"@babel/plugin-transform-runtime": "^7.0.0-beta.54",
"@babel/preset-env": "^7.0.0-beta.54",
"@babel/preset-stage-2": "^7.0.0-beta.54",
+ "babel-eslint": "8.2.1",
"babel-loader": "^8.0.0-beta.0",
"browserslist": "^4.0.1",
"clean-webpack-plugin": "^0.1.16",
"css-loader": "^1.0.0",
+ "cssnano": "^4.0.3",
"eslint-config-prettier": "^2.9.0",
"extract-text-webpack-plugin": "^4.0.0-beta.0",
"file-loader": "^1.1.11",
"html-webpack-plugin": "^3.2.0",
"postcss": "^7.0.0",
"postcss-browser-reporter": "^0.5.0",
+ "postcss-cli": "^6.0.0",
"postcss-import": "^11.1.0",
"postcss-loader": "^2.0.5",
"postcss-nested": "^3.0.0",
"postcss-preset-env": "^5.2.2",
"postcss-reporter": "^5.0.0",
- "postcss-strip-inline-comments": "^0.1.5",
"postcss-url": "^7.3.2",
"prettier-eslint-cli": "^4.7.1",
"ramda": "^0.25.0",
diff --git a/postcss.config.js b/postcss.config.js
index 8a0240b..7c46026 100644
--- a/postcss.config.js
+++ b/postcss.config.js
@@ -1,19 +1,21 @@
-const url = require('postcss-url')
-const imports = require('postcss-import')
-const nested = require('postcss-nested')
-const stripComments = require('postcss-strip-inline-comments')
-const postCSSPresetEnv = require('postcss-preset-env')
-const browsers = require('browserslist')
+const url = require("postcss-url");
+const imports = require("postcss-import");
+const nested = require("postcss-nested");
+const postCSSPresetEnv = require("postcss-preset-env");
+const browsers = require("browserslist");
+const cssnano = require("cssnano");
module.exports = () => ({
plugins: [
- stripComments,
url,
imports,
nested,
postCSSPresetEnv({
stage: 1,
- browsers: 'last 2 versions',
- })
- ]
-})
+ browsers: "last 2 versions",
+ }),
+ cssnano({
+ preset: "default",
+ }),
+ ],
+});
diff --git a/static/assets/main.js b/static/assets/main.js
index 592c508..6fc3317 100644
--- a/static/assets/main.js
+++ b/static/assets/main.js
@@ -1 +1 @@
-!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=4)}({4:function(e,t,r){"use strict"}});
\ No newline at end of file
+!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){n(1),n(2),e.exports=n(3)},function(e,t,n){"use strict"},function(e,t,n){"use strict";var r=document.querySelector(".menu-trigger"),o=document.querySelector(".menu"),u=getComputedStyle(document.body).getPropertyValue("--phoneWidth"),i=function(){return window.matchMedia(u).matches},c=function(){r&&r.classList.toggle("hidden",!i()),o&&o.classList.toggle("hidden",i())};c(),r.addEventListener("click",function(){return o&&o.classList.toggle("hidden")}),window.addEventListener("resize",c)},function(e,t,n){"use strict";var r=localStorage.getItem("theme"),o=document.querySelector(".theme-toggle"),u="dark"===r;document.body.classList.toggle("dark-theme",u),o.addEventListener("click",function(){document.body.classList.toggle("dark-theme"),localStorage.setItem("theme",document.body.classList.contains("dark-theme")?"dark":"light")})}]);
\ No newline at end of file
diff --git a/static/assets/menu.js b/static/assets/menu.js
deleted file mode 100644
index 6bbc741..0000000
--- a/static/assets/menu.js
+++ /dev/null
@@ -1 +0,0 @@
-!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=3)}({3:function(e,t,n){"use strict";var r=document.querySelector(".menu-trigger"),o=document.querySelector(".menu"),u=getComputedStyle(document.body).getPropertyValue("--phoneWidth"),i=function(){return window.matchMedia(u).matches},c=function(){r&&r.classList.toggle("hidden",!i()),o&&o.classList.toggle("hidden",i())};c(),r.addEventListener("click",function(){return o&&o.classList.toggle("hidden")}),window.addEventListener("resize",c)}});
\ No newline at end of file
diff --git a/static/assets/prism.js b/static/assets/prism.js
index ef95a07..ec291bc 100644
--- a/static/assets/prism.js
+++ b/static/assets/prism.js
@@ -1 +1 @@
-!function(e){var t={};function n(a){if(t[a])return t[a].exports;var r=t[a]={i:a,l:!1,exports:{}};return e[a].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=e,n.c=t,n.d=function(e,t,a){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(n.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(a,r,function(t){return e[t]}.bind(null,r));return a},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1)}([function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";(function(t){var n="undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{},a=function(){var e=/\blang(?:uage)?-([\w-]+)\b/i,t=0,a=n.Prism={manual:n.Prism&&n.Prism.manual,disableWorkerMessageHandler:n.Prism&&n.Prism.disableWorkerMessageHandler,util:{encode:function(e){return e instanceof r?new r(e.type,a.util.encode(e.content),e.alias):"Array"===a.util.type(e)?e.map(a.util.encode):e.replace(/&/g,"&").replace(/e.length)return;if(!(v instanceof l)){if(m&&y!=t.length-1){if(p.lastIndex=w,!($=p.exec(e)))break;for(var x=$.index+(f?$[1].length:0),_=$.index+$[0].length,j=y,S=w,F=t.length;F>j&&(_>S||!t[j].type&&!t[j-1].greedy);++j)x>=(S+=t[j].length)&&(++y,w=S);if(t[y]instanceof l)continue;A=j-y,v=e.slice(w,S),$.index-=w}else{p.lastIndex=0;var $=p.exec(v),A=1}if($){f&&(h=$[1]?$[1].length:0);_=(x=$.index+h)+($=$[0].slice(h)).length;var z=v.slice(0,x),B=v.slice(_),O=[y,A];z&&(++y,w+=z.length,O.push(z));var P=new l(u,d?a.tokenize($,d):$,b,$,m);if(O.push(P),B&&O.push(B),Array.prototype.splice.apply(t,O),1!=A&&a.matchGrammar(e,t,n,y,w,!0,u),s)break}else if(s)break}}}}},tokenize:function(e,t){var n=[e],r=t.rest;if(r){for(var i in r)t[i]=r[i];delete t.rest}return a.matchGrammar(e,n,t,0,0,!1),n},hooks:{all:{},add:function(e,t){var n=a.hooks.all;n[e]=n[e]||[],n[e].push(t)},run:function(e,t){var n=a.hooks.all[e];if(n&&n.length)for(var r,i=0;r=n[i++];)r(t)}}},r=a.Token=function(e,t,n,a,r){this.type=e,this.content=t,this.alias=n,this.length=0|(a||"").length,this.greedy=!!r};if(r.stringify=function(e,t,n){if("string"==typeof e)return e;if("Array"===a.util.type(e))return e.map(function(n){return r.stringify(n,t,e)}).join("");var i={type:e.type,content:r.stringify(e.content,t,n),tag:"span",classes:["token",e.type],attributes:{},language:t,parent:n};if(e.alias){var s="Array"===a.util.type(e.alias)?e.alias:[e.alias];Array.prototype.push.apply(i.classes,s)}a.hooks.run("wrap",i);var o=Object.keys(i.attributes).map(function(e){return e+'="'+(i.attributes[e]||"").replace(/"/g,""")+'"'}).join(" ");return"<"+i.tag+' class="'+i.classes.join(" ")+'"'+(o?" "+o:"")+">"+i.content+""+i.tag+">"},!n.document)return n.addEventListener?(a.disableWorkerMessageHandler||n.addEventListener("message",function(e){var t=JSON.parse(e.data),r=t.language,i=t.code,s=t.immediateClose;n.postMessage(a.highlight(i,a.languages[r],r)),s&&n.close()},!1),n.Prism):n.Prism;var i=document.currentScript||[].slice.call(document.getElementsByTagName("script")).pop();return i&&(a.filename=i.src,a.manual||i.hasAttribute("data-manual")||("loading"!==document.readyState?window.requestAnimationFrame?window.requestAnimationFrame(a.highlightAll):window.setTimeout(a.highlightAll,16):document.addEventListener("DOMContentLoaded",a.highlightAll))),n.Prism}();void 0!==e&&e.exports&&(e.exports=a),void 0!==t&&(t.Prism=a),a.languages.markup={comment://,prolog:/<\?[\s\S]+?\?>/,doctype://i,cdata://i,tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|[^\s'">=]+))?)*\s*\/?>/i,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/i,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"attr-value":{pattern:/=(?:("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|[^\s'">=]+)/i,inside:{punctuation:[/^=/,{pattern:/(^|[^\\])["']/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:/?[\da-z]{1,8};/i},a.languages.markup.tag.inside["attr-value"].inside.entity=a.languages.markup.entity,a.hooks.add("wrap",function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&/,"&"))}),a.languages.xml=a.languages.markup,a.languages.html=a.languages.markup,a.languages.mathml=a.languages.markup,a.languages.svg=a.languages.markup,a.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:/@[\w-]+?.*?(?:;|(?=\s*\{))/i,inside:{rule:/@[\w-]+/}},url:/url\((?:(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1|.*?)\)/i,selector:/[^{}\s][^{};]*?(?=\s*\{)/,string:{pattern:/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},property:/[-_a-z\xA0-\uFFFF][-\w\xA0-\uFFFF]*(?=\s*:)/i,important:/\B!important\b/i,function:/[-a-z0-9]+(?=\()/i,punctuation:/[(){};:]/},a.languages.css.atrule.inside.rest=a.languages.css,a.languages.markup&&(a.languages.insertBefore("markup","tag",{style:{pattern:/(