Uniformity
This commit is contained in:
parent
3fc6a57012
commit
20c90187cb
18 changed files with 69 additions and 65 deletions
|
@ -11,7 +11,7 @@ import devtools from "choo-devtools";
|
||||||
import { require as local } from "app-root-path";
|
import { require as local } from "app-root-path";
|
||||||
import ssr from "choo-ssr";
|
import ssr from "choo-ssr";
|
||||||
|
|
||||||
// V A R I A B L E S
|
// U T I L S
|
||||||
|
|
||||||
const head = local("app/components/head").default;
|
const head = local("app/components/head").default;
|
||||||
const wrapper = local("app/components/wrapper").default;
|
const wrapper = local("app/components/wrapper").default;
|
||||||
|
|
|
@ -2,15 +2,19 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// V A R I A B L E S
|
// P A C K A G E
|
||||||
|
|
||||||
const APPLICATIONS = require("./ecosystem/module-applications");
|
const local = require("app-root-path").require;
|
||||||
const CHAINQUERY = require("./ecosystem/submodule-chainquery");
|
|
||||||
const LBRY = require("./ecosystem/module-lbry");
|
// U T I L S
|
||||||
const LBRYCRD = require("./ecosystem/module-lbrycrd");
|
|
||||||
const LIGHTHOUSE = require("./ecosystem/submodule-lighthouse");
|
const applications = local("/app/components/ecosystem/module-applications");
|
||||||
const REFLECTOR = require("./ecosystem/submodule-reflector");
|
const chainquery = local("/app/components/ecosystem/submodule-chainquery");
|
||||||
const WALLET = require("./ecosystem/submodule-wallet");
|
const lbry = local("/app/components/ecosystem/module-lbry");
|
||||||
|
const lbrycrd = local("/app/components/ecosystem/module-lbrycrd");
|
||||||
|
const lighthouse = local("/app/components/ecosystem/submodule-lighthouse");
|
||||||
|
const reflector = local("/app/components/ecosystem/submodule-reflector");
|
||||||
|
const wallet = local("/app/components/ecosystem/submodule-wallet");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -20,19 +24,19 @@ export default () => {
|
||||||
return `
|
return `
|
||||||
<section class="ecosystem">
|
<section class="ecosystem">
|
||||||
<aside class="ecosystem__submodules">
|
<aside class="ecosystem__submodules">
|
||||||
${CHAINQUERY()}
|
${chainquery()}
|
||||||
${WALLET()}
|
${wallet()}
|
||||||
</aside>
|
</aside>
|
||||||
|
|
||||||
<section class="ecosystem__modules">
|
<section class="ecosystem__modules">
|
||||||
${LBRYCRD()}
|
${lbrycrd()}
|
||||||
${LBRY()}
|
${lbry()}
|
||||||
${APPLICATIONS()}
|
${applications()}
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<aside class="ecosystem__submodules">
|
<aside class="ecosystem__submodules">
|
||||||
${LIGHTHOUSE()}
|
${lighthouse()}
|
||||||
${REFLECTOR()}
|
${reflector()}
|
||||||
</aside>
|
</aside>
|
||||||
</section>
|
</section>
|
||||||
`;
|
`;
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
import html from "choo/html";
|
import html from "choo/html";
|
||||||
import { require as local } from "app-root-path";
|
import { require as local } from "app-root-path";
|
||||||
|
|
||||||
// V A R I A B L E
|
// U T I L
|
||||||
|
|
||||||
const config = local("/config");
|
const config = local("/config");
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// V A R I A B L E
|
// U T I L
|
||||||
|
|
||||||
const links = [
|
const links = [
|
||||||
{
|
{
|
||||||
|
|
|
@ -7,12 +7,11 @@
|
||||||
import html from "choo/html";
|
import html from "choo/html";
|
||||||
import { require as local } from "app-root-path";
|
import { require as local } from "app-root-path";
|
||||||
|
|
||||||
// V A R I A B L E S
|
// U T I L S
|
||||||
|
|
||||||
import editLink from "./edit-link";
|
|
||||||
import emailSubscribe from "./email-subscribe";
|
|
||||||
|
|
||||||
const config = local("/config");
|
const config = local("/config");
|
||||||
|
const editLink = local("/app/components/edit-link").default;
|
||||||
|
const emailSubscribe = local("/app/components/email-subscribe").default;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
import html from "choo/html";
|
import html from "choo/html";
|
||||||
import { require as local } from "app-root-path";
|
import { require as local } from "app-root-path";
|
||||||
|
|
||||||
// V A R I A B L E S
|
// U T I L S
|
||||||
|
|
||||||
const config = local("/config");
|
const config = local("/config");
|
||||||
let title = "";
|
let title = "";
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// P A C K A G E S
|
// P A C K A G E
|
||||||
|
|
||||||
import html from "choo/html";
|
import html from "choo/html";
|
||||||
|
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
|
|
||||||
import { require as local } from "app-root-path";
|
import { require as local } from "app-root-path";
|
||||||
|
|
||||||
// V A R I A B L E
|
// U T I L
|
||||||
|
|
||||||
const linkGrid = local("app/components/link-grid").default;
|
const linkGrid = local("/app/components/link-grid").default;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -2,15 +2,15 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// P A C K A G E
|
// P A C K A G E S
|
||||||
|
|
||||||
import asyncHtml from "choo-async/html";
|
import asyncHtml from "choo-async/html";
|
||||||
import { require as local } from "app-root-path";
|
import { require as local } from "app-root-path";
|
||||||
|
|
||||||
// V A R I A B L E S
|
// U T I L S
|
||||||
|
|
||||||
const footer = local("app/components/footer").default;
|
const footer = local("/app/components/footer").default;
|
||||||
const navigation = local("app/components/navigation").default;
|
const navigation = local("/app/components/navigation").default;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -4,19 +4,19 @@
|
||||||
|
|
||||||
// P A C K A G E S
|
// P A C K A G E S
|
||||||
|
|
||||||
|
const loadLanguages = require("prismjs/components/");
|
||||||
const local = require("app-root-path").require;
|
const local = require("app-root-path").require;
|
||||||
const prism = require("prismjs");
|
const prism = require("prismjs");
|
||||||
const raw = require("choo/html/raw");
|
const raw = require("choo/html/raw");
|
||||||
const request = require("request-promise-native");
|
const request = require("request-promise-native");
|
||||||
const stringifyObject = require("stringify-object");
|
const stringifyObject = require("stringify-object");
|
||||||
|
|
||||||
// V A R I A B L E S
|
// U T I L S
|
||||||
|
|
||||||
const randomString = local("app/helpers/random-string");
|
const randomString = local("/app/helpers/random-string");
|
||||||
const loadLanguages = require("prismjs/components/");
|
const logSlackError = local("/app/helpers/slack");
|
||||||
const logSlackError = local("app/helpers/slack");
|
const publishMeme = local("/app/helpers/publish-meme");
|
||||||
const publishMeme = local("app/helpers/publish-meme");
|
const uploadImage = local("/app/helpers/upload-image");
|
||||||
const uploadImage = local("app/helpers/upload-image");
|
|
||||||
|
|
||||||
loadLanguages(["json"]);
|
loadLanguages(["json"]);
|
||||||
|
|
||||||
|
|
|
@ -10,14 +10,15 @@ const local = require("app-root-path").require;
|
||||||
const octokit = require("@octokit/rest")();
|
const octokit = require("@octokit/rest")();
|
||||||
const redis = require("redis");
|
const redis = require("redis");
|
||||||
|
|
||||||
// V A R I A B L E S
|
// U T I L S
|
||||||
|
|
||||||
const logSlackError = local("app/helpers/slack");
|
const logSlackError = local("/app/helpers/slack");
|
||||||
const relativeDate = local("app/modules/relative-date");
|
const relativeDate = local("/app/modules/relative-date");
|
||||||
let client;
|
|
||||||
|
|
||||||
// R E D I S
|
// R E D I S
|
||||||
|
|
||||||
|
let client;
|
||||||
|
|
||||||
if (typeof process.env.GITHUB_OAUTH_TOKEN !== "undefined") {
|
if (typeof process.env.GITHUB_OAUTH_TOKEN !== "undefined") {
|
||||||
octokit.authenticate({
|
octokit.authenticate({
|
||||||
type: "oauth",
|
type: "oauth",
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// P A C K A G E
|
// N A T I V E
|
||||||
|
|
||||||
const crypto = require("crypto");
|
const crypto = require("crypto");
|
||||||
|
|
||||||
|
|
|
@ -2,12 +2,12 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// P A C K A G E
|
// P A C K A G E S
|
||||||
|
|
||||||
import html from "choo/html";
|
import html from "choo/html";
|
||||||
import { require as local } from "app-root-path";
|
import { require as local } from "app-root-path";
|
||||||
|
|
||||||
// V A R I A B L E S
|
// U T I L S
|
||||||
|
|
||||||
const page404 = local("app/views/404.js");
|
const page404 = local("app/views/404.js");
|
||||||
const redirects = local("app/data/redirects.json");
|
const redirects = local("app/data/redirects.json");
|
||||||
|
|
|
@ -8,7 +8,7 @@ const html = require("choo/html");
|
||||||
const local = require("app-root-path").require;
|
const local = require("app-root-path").require;
|
||||||
const request = require("request-promise-native");
|
const request = require("request-promise-native");
|
||||||
|
|
||||||
// V A R I A B L E S
|
// U T I L S
|
||||||
|
|
||||||
const fetchMetadata = local("app/helpers/fetch-metadata");
|
const fetchMetadata = local("app/helpers/fetch-metadata");
|
||||||
const { generateGitHubFeed } = local("app/helpers/github");
|
const { generateGitHubFeed } = local("app/helpers/github");
|
||||||
|
|
|
@ -8,7 +8,7 @@ import asyncHtml from "choo-async/html";
|
||||||
import dedent from "dedent";
|
import dedent from "dedent";
|
||||||
import { require as local } from "app-root-path";
|
import { require as local } from "app-root-path";
|
||||||
|
|
||||||
// V A R I A B L E S
|
// U T I L S
|
||||||
|
|
||||||
const fetch = require("make-fetch-happen").defaults({ cacheManager: "./cache" });
|
const fetch = require("make-fetch-happen").defaults({ cacheManager: "./cache" });
|
||||||
const headerBlockchain = local("app/components/api/header-blockchain").default;
|
const headerBlockchain = local("app/components/api/header-blockchain").default;
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
import html from "choo/html";
|
import html from "choo/html";
|
||||||
import { require as local } from "app-root-path";
|
import { require as local } from "app-root-path";
|
||||||
|
|
||||||
// V A R I A B L E
|
// U T I L
|
||||||
|
|
||||||
const linkGrid = local("app/components/link-grid").default;
|
const linkGrid = local("app/components/link-grid").default;
|
||||||
|
|
||||||
|
|
|
@ -13,9 +13,12 @@ import path from "path";
|
||||||
import { require as local } from "app-root-path";
|
import { require as local } from "app-root-path";
|
||||||
import raw from "choo/html/raw";
|
import raw from "choo/html/raw";
|
||||||
|
|
||||||
// V A R I A B L E S
|
// V A R I A B L E
|
||||||
|
|
||||||
const numberRegex = /^[0-9]/g;
|
const numberRegex = /^[0-9]/g;
|
||||||
|
|
||||||
|
// U T I L S
|
||||||
|
|
||||||
const redirect404 = local("app/modules/redirect-404");
|
const redirect404 = local("app/modules/redirect-404");
|
||||||
|
|
||||||
const md = require("markdown-it")({
|
const md = require("markdown-it")({
|
||||||
|
|
25
server.js
25
server.js
|
@ -15,7 +15,7 @@ const fastify = require("fastify")({
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// V A R I A B L E S
|
// U T I L S
|
||||||
|
|
||||||
const handleSocketMessages = local("app/sockets");
|
const handleSocketMessages = local("app/sockets");
|
||||||
const logSlackError = local("app/helpers/slack");
|
const logSlackError = local("app/helpers/slack");
|
||||||
|
@ -24,23 +24,20 @@ const logSlackError = local("app/helpers/slack");
|
||||||
|
|
||||||
// P R O G R A M
|
// P R O G R A M
|
||||||
|
|
||||||
fastify.use(cors());
|
fastify
|
||||||
|
.use(cors())
|
||||||
fastify.register(require("fastify-compress"));
|
.register(require("fastify-compress"))
|
||||||
fastify.register(require("fastify-ws"));
|
.register(require("fastify-ws"))
|
||||||
|
.register(require("fastify-helmet"), {
|
||||||
fastify.register(require("fastify-helmet"), {
|
|
||||||
hidePoweredBy: { setTo: "LBRY" }
|
hidePoweredBy: { setTo: "LBRY" }
|
||||||
});
|
})
|
||||||
|
.register(require("fastify-static"), {
|
||||||
fastify.register(require("fastify-static"), {
|
|
||||||
prefix: "/assets/",
|
prefix: "/assets/",
|
||||||
root: `${__dirname}/app/dist/`
|
root: `${__dirname}/app/dist/`
|
||||||
});
|
})
|
||||||
|
.register(require("choo-ssr/fastify"), {
|
||||||
fastify.register(require("choo-ssr/fastify"), {
|
|
||||||
app: require("./app")
|
app: require("./app")
|
||||||
});
|
});
|
||||||
|
|
||||||
fastify.ready(err => {
|
fastify.ready(err => {
|
||||||
if (err) throw err;
|
if (err) throw err;
|
||||||
|
|
Loading…
Reference in a new issue