Uniformity

This commit is contained in:
ポール ウェッブ 2018-10-10 12:56:35 -05:00
parent 3fc6a57012
commit 20c90187cb
18 changed files with 69 additions and 65 deletions

View file

@ -11,7 +11,7 @@ import devtools from "choo-devtools";
import { require as local } from "app-root-path";
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 wrapper = local("app/components/wrapper").default;

View file

@ -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 CHAINQUERY = require("./ecosystem/submodule-chainquery");
const LBRY = require("./ecosystem/module-lbry");
const LBRYCRD = require("./ecosystem/module-lbrycrd");
const LIGHTHOUSE = require("./ecosystem/submodule-lighthouse");
const REFLECTOR = require("./ecosystem/submodule-reflector");
const WALLET = require("./ecosystem/submodule-wallet");
const local = require("app-root-path").require;
// U T I L S
const applications = local("/app/components/ecosystem/module-applications");
const chainquery = local("/app/components/ecosystem/submodule-chainquery");
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 `
<section class="ecosystem">
<aside class="ecosystem__submodules">
${CHAINQUERY()}
${WALLET()}
${chainquery()}
${wallet()}
</aside>
<section class="ecosystem__modules">
${LBRYCRD()}
${LBRY()}
${APPLICATIONS()}
${lbrycrd()}
${lbry()}
${applications()}
</section>
<aside class="ecosystem__submodules">
${LIGHTHOUSE()}
${REFLECTOR()}
${lighthouse()}
${reflector()}
</aside>
</section>
`;

View file

@ -7,7 +7,7 @@
import html from "choo/html";
import { require as local } from "app-root-path";
// V A R I A B L E
// U T I L
const config = local("/config");

View file

@ -2,7 +2,7 @@
// V A R I A B L E
// U T I L
const links = [
{

View file

@ -7,12 +7,11 @@
import html from "choo/html";
import { require as local } from "app-root-path";
// V A R I A B L E S
import editLink from "./edit-link";
import emailSubscribe from "./email-subscribe";
// U T I L S
const config = local("/config");
const editLink = local("/app/components/edit-link").default;
const emailSubscribe = local("/app/components/email-subscribe").default;

View file

@ -7,7 +7,7 @@
import html from "choo/html";
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");
let title = "";

View file

@ -2,7 +2,7 @@
// P A C K A G E S
// P A C K A G E
import html from "choo/html";

View file

@ -6,9 +6,9 @@
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;

View file

@ -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 { 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 navigation = local("app/components/navigation").default;
const footer = local("/app/components/footer").default;
const navigation = local("/app/components/navigation").default;

View file

@ -4,19 +4,19 @@
// P A C K A G E S
const loadLanguages = require("prismjs/components/");
const local = require("app-root-path").require;
const prism = require("prismjs");
const raw = require("choo/html/raw");
const request = require("request-promise-native");
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 loadLanguages = require("prismjs/components/");
const logSlackError = local("app/helpers/slack");
const publishMeme = local("app/helpers/publish-meme");
const uploadImage = local("app/helpers/upload-image");
const randomString = local("/app/helpers/random-string");
const logSlackError = local("/app/helpers/slack");
const publishMeme = local("/app/helpers/publish-meme");
const uploadImage = local("/app/helpers/upload-image");
loadLanguages(["json"]);

View file

@ -10,14 +10,15 @@ const local = require("app-root-path").require;
const octokit = require("@octokit/rest")();
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 relativeDate = local("app/modules/relative-date");
let client;
const logSlackError = local("/app/helpers/slack");
const relativeDate = local("/app/modules/relative-date");
// R E D I S
let client;
if (typeof process.env.GITHUB_OAUTH_TOKEN !== "undefined") {
octokit.authenticate({
type: "oauth",

View file

@ -2,7 +2,7 @@
// P A C K A G E
// N A T I V E
const crypto = require("crypto");

View file

@ -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 { 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 redirects = local("app/data/redirects.json");

View file

@ -8,7 +8,7 @@ const html = require("choo/html");
const local = require("app-root-path").require;
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 { generateGitHubFeed } = local("app/helpers/github");

View file

@ -8,7 +8,7 @@ import asyncHtml from "choo-async/html";
import dedent from "dedent";
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 headerBlockchain = local("app/components/api/header-blockchain").default;

View file

@ -7,7 +7,7 @@
import html from "choo/html";
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;

View file

@ -13,9 +13,12 @@ import path from "path";
import { require as local } from "app-root-path";
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;
// U T I L S
const redirect404 = local("app/modules/redirect-404");
const md = require("markdown-it")({

View file

@ -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 logSlackError = local("app/helpers/slack");
@ -24,21 +24,18 @@ const logSlackError = local("app/helpers/slack");
// P R O G R A M
fastify.use(cors());
fastify.register(require("fastify-compress"));
fastify.register(require("fastify-ws"));
fastify.register(require("fastify-helmet"), {
fastify
.use(cors())
.register(require("fastify-compress"))
.register(require("fastify-ws"))
.register(require("fastify-helmet"), {
hidePoweredBy: { setTo: "LBRY" }
});
fastify.register(require("fastify-static"), {
})
.register(require("fastify-static"), {
prefix: "/assets/",
root: `${__dirname}/app/dist/`
});
fastify.register(require("choo-ssr/fastify"), {
})
.register(require("choo-ssr/fastify"), {
app: require("./app")
});