diff --git a/app/client.js b/app/client.js index 388c0e8..76e4235 100755 --- a/app/client.js +++ b/app/client.js @@ -11,8 +11,8 @@ import ssr from "choo-ssr"; // U T I L S -import head from "./components/head"; -import wrapper from "./components/wrapper"; +import head from "@component/head"; +import wrapper from "@component/wrapper"; diff --git a/app/components/ecosystem/module-applications.js b/app/components/ecosystem/module-applications.js index 8289ad4..891dbec 100644 --- a/app/components/ecosystem/module-applications.js +++ b/app/components/ecosystem/module-applications.js @@ -4,7 +4,7 @@ // U T I L -import markdown from "../markdown"; +import markdown from "@component/markdown"; diff --git a/app/components/ecosystem/module-lbry.js b/app/components/ecosystem/module-lbry.js index fca744a..833eaf5 100644 --- a/app/components/ecosystem/module-lbry.js +++ b/app/components/ecosystem/module-lbry.js @@ -4,7 +4,7 @@ // U T I L -import markdown from "../markdown"; +import markdown from "@component/markdown"; diff --git a/app/components/ecosystem/module-lbrycrd.js b/app/components/ecosystem/module-lbrycrd.js index 7c632fd..dadbfac 100644 --- a/app/components/ecosystem/module-lbrycrd.js +++ b/app/components/ecosystem/module-lbrycrd.js @@ -4,7 +4,7 @@ // U T I L -import markdown from "../markdown"; +import markdown from "@component/markdown"; diff --git a/app/components/ecosystem/submodule-chainquery.js b/app/components/ecosystem/submodule-chainquery.js index 92364bb..6e62af9 100644 --- a/app/components/ecosystem/submodule-chainquery.js +++ b/app/components/ecosystem/submodule-chainquery.js @@ -4,7 +4,7 @@ // U T I L -import markdown from "../markdown"; +import markdown from "@component/markdown"; diff --git a/app/components/ecosystem/submodule-lighthouse.js b/app/components/ecosystem/submodule-lighthouse.js index 1a044d2..c1ac0c1 100644 --- a/app/components/ecosystem/submodule-lighthouse.js +++ b/app/components/ecosystem/submodule-lighthouse.js @@ -4,7 +4,7 @@ // U T I L -import markdown from "../markdown"; +import markdown from "@component/markdown"; diff --git a/app/components/ecosystem/submodule-reflector.js b/app/components/ecosystem/submodule-reflector.js index 8b64d4d..6604162 100644 --- a/app/components/ecosystem/submodule-reflector.js +++ b/app/components/ecosystem/submodule-reflector.js @@ -4,7 +4,7 @@ // U T I L -import markdown from "../markdown"; +import markdown from "@component/markdown"; diff --git a/app/components/ecosystem/submodule-wallet.js b/app/components/ecosystem/submodule-wallet.js index be717af..d0bba0a 100644 --- a/app/components/ecosystem/submodule-wallet.js +++ b/app/components/ecosystem/submodule-wallet.js @@ -4,7 +4,7 @@ // U T I L -import markdown from "../markdown"; +import markdown from "@component/markdown"; diff --git a/app/components/edit-link.js b/app/components/edit-link.js index 9251edf..6e26e70 100644 --- a/app/components/edit-link.js +++ b/app/components/edit-link.js @@ -2,14 +2,13 @@ -// I M P O R T S +// I M P O R T import html from "choo/html"; -import { require as local } from "app-root-path"; // U T I L -const config = local("/config"); +import config from "@root/config"; diff --git a/app/components/footer.js b/app/components/footer.js index 55e09f1..e47472f 100644 --- a/app/components/footer.js +++ b/app/components/footer.js @@ -2,18 +2,16 @@ -// I M P O R T S +// I M P O R T import html from "choo/html"; -import { require as local } from "app-root-path"; // U T I L S +import config from "@root/config"; import editLink from "./edit-link"; import emailSubscribe from "./email-subscribe"; -const config = local("/config"); - // E X P O R T diff --git a/app/components/head.js b/app/components/head.js index 3cd6834..65a9d4f 100644 --- a/app/components/head.js +++ b/app/components/head.js @@ -2,14 +2,13 @@ -// I M P O R T S +// I M P O R T import html from "choo/html"; -import { require as local } from "app-root-path"; // U T I L S -const config = local("/config"); +import config from "@root/config"; let title = ""; diff --git a/app/components/markdown.js b/app/components/markdown.js index 89c314a..dfb7262 100644 --- a/app/components/markdown.js +++ b/app/components/markdown.js @@ -9,9 +9,10 @@ import exists from "fs-exists-sync"; import fm from "front-matter"; import fs from "graceful-fs"; import html from "choo/html"; +import markdownAnchor from "markdown-it-anchor"; +import markdownSup from "@module/markdown-it-sup"; import path from "path"; import raw from "choo/html/raw"; -import { require as local } from "app-root-path"; // U T I L S @@ -19,8 +20,8 @@ const numberRegex = /^[0-9]/g; const md = require("markdown-it")({ html: true, typographer: true -}).use(local("/app/modules/markdown-it-sup")) - .use(require("markdown-it-anchor"), { +}).use(markdownSup) + .use(markdownAnchor, { slugify: stringToSlugify => { let finalString = stringToSlugify .toLowerCase() diff --git a/app/helpers/github.js b/app/helpers/github.js index a973c1b..2beaf95 100644 --- a/app/helpers/github.js +++ b/app/helpers/github.js @@ -4,16 +4,16 @@ // P A C K A G E S -const async = require("async"); -const color = require("colorette"); -const local = require("app-root-path").require; -const Octokit = require("@octokit/rest"); -const redis = require("redis"); +import async from "async"; +import color from "colorette"; +import Octokit from "@octokit/rest"; +import redis from "redis"; // U T I L S -const messageSlack = local("/app/helpers/slack"); -const relativeDate = local("/app/modules/relative-date"); +import messageSlack from "@helper/slack"; +import relativeDate from "@module/relative-date"; + let octokit; String.prototype.escape = function() { @@ -365,7 +365,8 @@ function updateGithubFeed() { // H E L P E R function refToBranch(ref) { - if (ref) return ref.replace("refs/heads/", ""); + if (ref) + return ref.replace("refs/heads/", ""); } diff --git a/app/index.js b/app/index.js index 24ec78e..5e33c60 100755 --- a/app/index.js +++ b/app/index.js @@ -16,8 +16,8 @@ import websockets from "@inc/fastify-ws"; // U T I L S import handleSocketMessages from "./sockets"; -import messageSlack from "./helpers/slack"; -import redirects from "./data/redirects.json"; +import messageSlack from "@helper/slack"; +import redirects from "@data/redirects.json"; const server = fastify({ logger: { diff --git a/app/sockets.js b/app/sockets.js index 54dd9ce..f246d76 100644 --- a/app/sockets.js +++ b/app/sockets.js @@ -9,9 +9,9 @@ import html from "choo/html"; // U T I L S -import fetchMetadata from "./helpers/fetch-metadata"; -import { generateGitHubFeed } from "./helpers/github"; -import messageSlack from "./helpers/slack"; +import fetchMetadata from "@helper/fetch-metadata"; +import { generateGitHubFeed } from "@helper/github"; +import messageSlack from "@helper/slack"; diff --git a/app/views/api.js b/app/views/api.js index 41c0e2e..e1aea10 100644 --- a/app/views/api.js +++ b/app/views/api.js @@ -10,9 +10,9 @@ import got from "got"; // U T I L S -import headerBlockchain from "../components/api/header-blockchain"; -import headerSdk from "../components/api/header-sdk"; -import redirects from "../data/redirects.json"; +import headerBlockchain from "@component/api/header-blockchain"; +import headerSdk from "@component/api/header-sdk"; +import redirects from "@data/redirects.json"; const blockchainApi = "https://cdn.jsdelivr.net/gh/lbryio/lbrycrd@master/contrib/devtools/generated/api_v1.json"; const cache = new Map(); diff --git a/app/views/home.js b/app/views/home.js index 14a649f..62899e4 100644 --- a/app/views/home.js +++ b/app/views/home.js @@ -8,7 +8,7 @@ import html from "choo/html"; // U T I L -import linkGrid from "../components/link-grid"; +import linkGrid from "@component/link-grid"; diff --git a/app/views/redirect.js b/app/views/redirect.js index 0e6289a..c6f382f 100644 --- a/app/views/redirect.js +++ b/app/views/redirect.js @@ -11,7 +11,7 @@ import raw from "choo/html/raw"; // U T I L S -import markdown from "../components/markdown"; +import markdown from "@component/markdown"; import page404 from "./404"; diff --git a/app/views/spec.js b/app/views/spec.js index 2c6906c..f351039 100644 --- a/app/views/spec.js +++ b/app/views/spec.js @@ -14,7 +14,7 @@ export default state => { state.hideFooter = true; return html` -