This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const plugin = require("tailwindcss/plugin"); | |
| module.exports = { | |
| mode: "jit", | |
| purge: { | |
| content: ["./src/**/*.{js,ts,jsx,tsx,mdx,vue}"], | |
| }, | |
| theme: { extend: {} }, | |
| variants: {}, | |
| plugins: [ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let { withProse } = require("./src/remark/withProse"); | |
| let { withSyntaxHighlighting } = require("./src/remark/withSyntaxHighlighting"); | |
| let { withTableOfContents } = require("./src/remark/withTableOfContents"); | |
| let { withExamples } = require("./src/remark/withExamples"); | |
| let { withLayout } = require("./src/remark/withLayout"); | |
| let { withNextLinks } = require("./src/remark/withNextLinks"); | |
| let { VueLoaderPlugin } = require("vue-loader"); | |
| let path = require("path"); | |
| const withMDX = require("@next/mdx")({ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function useOnRead({ | |
| parentElRef, | |
| onRead, | |
| enabled = true, | |
| }: { | |
| parentElRef: React.RefObject<HTMLElement> | |
| onRead: () => void | |
| enabled: boolean | |
| }) { | |
| React.useEffect(() => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //<script> | |
| function clearBlock(el) { | |
| const node = el.parentElement.parentElement; | |
| node.innerHTML = ''; | |
| return node; | |
| } | |
| const SELECTOR = 'code:not([super-embed-seen])'; | |
| function setupEmbeds() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import childProcess from 'child_process'; | |
| import fs from 'fs'; | |
| import dotenv from 'dotenv'; | |
| import prettier from 'prettier'; | |
| const rootDir = process.cwd(); | |
| dotenv.config({ | |
| path: `${rootDir}/.env.production`, | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // This approach uses: | |
| // - Remix's Express Adapter | |
| // - An external Socket.io server on port 3050 | |
| // - http-proxy-middleware | |
| // | |
| // install http-proxy-middleware and apply these lines to `server/index.js`: | |
| // | |
| const { createProxyMiddleware } = require("http-proxy-middleware"); | |
| // Add the middleware before remix's catch-all '*' route |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import type { FC, HTMLAttributes, ReactElement } from 'react'; | |
| import { Children } from 'react'; | |
| import invariant from 'tiny-invariant'; | |
| import Highlight, { Language, defaultProps } from 'prism-react-renderer'; | |
| import CopyClipboardButton from '../button/copyClipboardButton'; | |
| function getLanguageFromClassName(className: string) { | |
| const match = className.match(/language-(\w+)/); | |
| return match ? match[1] : ''; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { createHash } from "crypto"; | |
| import fs from "fs"; | |
| import fsp from "fs/promises"; | |
| import path from "path"; | |
| import https from "https"; | |
| import { PassThrough } from "stream"; | |
| import type { Readable } from "stream"; | |
| import type { LoaderFunction } from "remix"; | |
| import sharp from "sharp"; | |
| import type { Request as NodeRequest } from "@remix-run/node"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { json, ActionFunction, useActionData, Form } from "remix"; | |
| import { z } from "zod"; | |
| // This type infer errors from a ZodType, as produced by `flatten()` of a parsed schema. | |
| type inferSafeParseErrors<T extends z.ZodType<any, any, any>, U = string> = { | |
| formErrors: U[]; | |
| fieldErrors: { | |
| [P in keyof z.infer<T>]?: U[]; | |
| }; | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import invariant from "tiny-invariant"; | |
| class AmalgoBox extends HTMLElement { | |
| get input() { | |
| return this.querySelector("input") as HTMLInputElement; | |
| } | |
| get button() { | |
| return this.querySelector("button") as HTMLButtonElement; | |
| } |