diff --git a/.eslintrc.json b/.eslintrc.json index edca7d4..8328816 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -9,10 +9,7 @@ ], "parserOptions": { "ecmaVersion": 2017, - "sourceType": "module", - "ecmaFeatures": { - "experimentalObjectRestSpread": true - } + "sourceType": "module" }, "rules": { "indent": ["error", 2, { "SwitchCase": 1 }], diff --git a/app/components/ecosystem.js b/app/components/ecosystem.js index 3dd2b52..0bc1399 100644 --- a/app/components/ecosystem.js +++ b/app/components/ecosystem.js @@ -1,5 +1,7 @@ "use strict"; + + // V A R I A B L E S const APPLICATIONS = require("./ecosystem/module-applications"); @@ -10,6 +12,10 @@ const LIGHTHOUSE = require("./ecosystem/submodule-lighthouse"); const REFLECTOR = require("./ecosystem/submodule-reflector"); const WALLET = require("./ecosystem/submodule-wallet"); + + +// E X P O R T + export default function () { return `
@@ -30,4 +36,4 @@ export default function () {
`; -}; +} diff --git a/app/components/feature-links.js b/app/components/feature-links.js index 2a77fde..a85a384 100644 --- a/app/components/feature-links.js +++ b/app/components/feature-links.js @@ -1,5 +1,7 @@ "use strict"; + + // V A R I A B L E const links = [ // TODO: Update images @@ -39,6 +41,10 @@ const links = [ // TODO: Update images } ]; + + +// E X P O R T + export default function () { const renderedLinks = []; let imageLink = ""; @@ -51,7 +57,11 @@ export default function () { return ` `; -}; +} + + + +// H E L P E R function returnLinkTemplate(url, title, image) { return ` diff --git a/app/components/link-grid.js b/app/components/link-grid.js index 9e0d42c..ffa4399 100644 --- a/app/components/link-grid.js +++ b/app/components/link-grid.js @@ -1,7 +1,28 @@ "use strict"; + + +// P A C K A G E + import html from "choo/html"; + + +// E X P O R T + +export default (links) => { + const renderedLinks = links.map((link) => returnLinkTemplate(link.title, link.description, link.destination, link.label)); + return html` + + `; +}; + + + +// H E L P E R + function returnLinkTemplate(title, description, destination, label) { return ` `; } - -export default (links) => { - const renderedLinks = links.map((link) => returnLinkTemplate(link.title, link.description, link.destination, link.label)); - return html` - - `; -} diff --git a/app/views/home.js b/app/views/home.js index b24b74b..8cd4b97 100644 --- a/app/views/home.js +++ b/app/views/home.js @@ -5,11 +5,30 @@ // P A C K A G E import html from "choo/html"; + +// V A R I A B L E + import linkGrid from "../components/link-grid"; + // E X P O R T +const featureLinks = linkGrid([ + { + description: "Learn how LBRY works with 3 easy examples", + destination: "/tour", + label: "Take the Tour", + title: "New to LBRY?" + }, + { + description: "Help make LBRY better!", + destination: "/contribute", + label: "Explore our repos", + title: "Want to contribute?" + } +]); + module.exports = exports = () => html`
@@ -22,17 +41,7 @@ module.exports = exports = () => html`
- ${linkGrid([{ - title: "New to LBRY?", - description: "Learn how LBRY works with 3 easy examples", - destination: "/tour", - label: "Take the Tour" - }, { - title: "New to LBRY?", - description: "Learn how LBRY works with 3 easy examples", - destination: "/tour", - label: "Take the Tour" - }])} + ${featureLinks}
diff --git a/app/views/redirect.js b/app/views/redirect.js index 15a3d94..0fa3857 100644 --- a/app/views/redirect.js +++ b/app/views/redirect.js @@ -145,8 +145,8 @@ function partialFinder(markdownBody) { if (fileExistsTest) { const partialFunction = require(path.join(__dirname, "..", `./components/${filename}.js`)); - const markdownHtml = filename === "glossary-toc" ? partialFunction : partialFunction.default(); //kill special case - markdownBody = markdownBody.replace(partial, '
' + markdownHtml + '
'); + const markdownHtml = filename === "glossary-toc" ? partialFunction : partialFunction.default(); // kill special case + markdownBody = markdownBody.replace(partial, `
${markdownHtml}
`); } } diff --git a/package.json b/package.json index 7ae3955..15587e6 100755 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "decamelize": "^2.0.0", "dedent": "^0.7.0", "dotenv": "^6.0.0", - "fastify": "^1.12.0", + "fastify": "^1.12.1", "fastify-compress": "^0.7.0", "fastify-helmet": "^2.1.0", "fastify-plugin": "^1.2.1", @@ -59,6 +59,7 @@ "@babel/plugin-syntax-import-meta": "7.0.0", "@babel/preset-env": "^7.1.0", "@babel/register": "^7.0.0", + "husky": "^1.0.0", "nodemon": "^1.18.4", "npm-run-all": "^4.1.3", "sass": "^1.14.0", @@ -69,6 +70,11 @@ "engines": { "node": "10.2.x" }, + "husky": { + "hooks": { + "pre-commit": "npm run test:lint" + } + }, "main": "server.js", "name": "lbry.tech", "private": true,