From 8ba4adf1995f43e898604927d7d6a63a1e118567 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20=E2=80=9CAd=C3=A6dra=E2=80=9D=20Hamel?= Date: Mon, 24 Jun 2024 19:44:08 +0200 Subject: [PATCH] Move TypeScript files into `lib` --- {src => lib}/constants.ts | 0 lib/tasks/articles.ts | 8 ++++---- {src => lib/views}/article.tsx | 2 +- {src => lib/views}/index.tsx | 2 +- {src => lib/views}/layout.tsx | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) rename {src => lib}/constants.ts (100%) rename {src => lib/views}/article.tsx (94%) rename {src => lib/views}/index.tsx (98%) rename {src => lib/views}/layout.tsx (89%) diff --git a/src/constants.ts b/lib/constants.ts similarity index 100% rename from src/constants.ts rename to lib/constants.ts diff --git a/lib/tasks/articles.ts b/lib/tasks/articles.ts index 666e44b..dae602c 100644 --- a/lib/tasks/articles.ts +++ b/lib/tasks/articles.ts @@ -13,11 +13,11 @@ import { PRODUCTION, DEFAULT_DATE } from "../environment.js"; import rehypeExternalLinks from "rehype-external-links"; import visit from "unist-util-visit"; import { src, dest } from "gulp"; -import renderLayout from "../../src/layout.js"; -import renderArticleLayout from "../../src/article.js"; -import renderIndex from "../../src/index.js"; +import renderLayout from "../views/layout.js"; +import renderArticleLayout from "../views/article.js"; +import renderIndex from "../views/index.js"; import { renderToStaticMarkup } from "preact-render-to-string"; -import { SITE_TITLE, SITE_DESCRIPTION } from "../../src/constants.js"; +import { SITE_TITLE, SITE_DESCRIPTION } from "../constants.js"; import { JSX } from "preact/jsx-runtime"; import { reloadAssets } from "../assets.js"; diff --git a/src/article.tsx b/lib/views/article.tsx similarity index 94% rename from src/article.tsx rename to lib/views/article.tsx index eab5006..f2e76bf 100644 --- a/src/article.tsx +++ b/lib/views/article.tsx @@ -1,6 +1,6 @@ import { Document } from "asciidoctor"; import { DateTime } from "luxon"; -import { asset } from "../lib/assets.js"; +import { asset } from "../assets.js"; type Props = { article: Document; diff --git a/src/index.tsx b/lib/views/index.tsx similarity index 98% rename from src/index.tsx rename to lib/views/index.tsx index 35d96e8..0eb4242 100644 --- a/src/index.tsx +++ b/lib/views/index.tsx @@ -1,6 +1,6 @@ import { Document } from "asciidoctor"; import { DateTime } from "luxon"; -import { asset } from "../lib/assets.js"; +import { asset } from "../assets.js"; const Header = () => (
diff --git a/src/layout.tsx b/lib/views/layout.tsx similarity index 89% rename from src/layout.tsx rename to lib/views/layout.tsx index 4804c0c..7020462 100644 --- a/src/layout.tsx +++ b/lib/views/layout.tsx @@ -1,6 +1,6 @@ -import { SITE_DEFAULT_META, SITE_TITLE } from "./constants.js"; +import { SITE_DEFAULT_META, SITE_TITLE } from "../constants.js"; import { JSX } from "preact/jsx-runtime"; -import { asset } from "../lib/assets.js"; +import { asset } from "../assets.js"; type Props = { title?: string;