Skip to content

Commit

Permalink
chore(docs): debug
Browse files Browse the repository at this point in the history
  • Loading branch information
krisantrobus committed Dec 19, 2024
1 parent e414dc9 commit d1f8da7
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion packages/paste-website/src/pages/sitemap.xml.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import fs from "fs";
import path from "path";

Check failure on line 2 in packages/paste-website/src/pages/sitemap.xml.tsx

View workflow job for this annotation

GitHub Actions / Lint repository

There should be at least one empty line between import groups
import { globby } from "globby-esm";
import type { GetServerSideProps } from "next";

Expand All @@ -7,9 +9,24 @@ const Sitemap = (): React.ReactElement | null => {

export const revalidate = "force-cache";

function getRoutes() {

Check failure on line 12 in packages/paste-website/src/pages/sitemap.xml.tsx

View workflow job for this annotation

GitHub Actions / Lint repository

Missing return type on function
const pagesDirectory = path.join(process.cwd(), "pages");
const fileNames = fs.readdirSync(pagesDirectory);

const files = fileNames
.filter((fileName) => fileName.endsWith(".js") || fileName.endsWith(".jsx"))
.map((fileName) => {
const route = fileName === "index.js" ? "/" : `/${fileName.replace(/\.js(x)?$/, "")}`;

Check failure on line 19 in packages/paste-website/src/pages/sitemap.xml.tsx

View workflow job for this annotation

GitHub Actions / Lint repository

Immediately return this expression instead of assigning it to the temporary variable "route"
return route;
});

// eslint-disable-next-line no-console
console.log("ai generated", files);
}

export const getServerSideProps: GetServerSideProps = async ({ res }) => {
const BASE_URL = "https://paste.twilio.design";

getRoutes();
// Get a list of all pages currently in the site, must be mdx and not tsx which they all currently are
const uncompiledPaths = await globby(["**/*.mdx"], { cwd: process.cwd() });

Expand Down

0 comments on commit d1f8da7

Please sign in to comment.