mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2025-07-03 15:16:40 -04:00
finally fix slow typescript compilation!
see https://github.com/stitchesjs/stitches/issues/1038
This commit is contained in:
@ -27,7 +27,7 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
|
||||
}
|
||||
|
||||
const client = new faunadb.Client({
|
||||
secret: process.env.FAUNADB_SERVER_SECRET,
|
||||
secret: process.env.FAUNADB_SERVER_SECRET || "",
|
||||
checkNewVersion: false, // https://github.com/fauna/faunadb-js/pull/504
|
||||
});
|
||||
const { slug } = req.query;
|
||||
|
@ -17,7 +17,7 @@ const Note = ({ frontMatter, source }: Note) => {
|
||||
<>
|
||||
<NextSeo
|
||||
title={frontMatter.title}
|
||||
description={frontMatter.description}
|
||||
description={frontMatter.description || config.longDescription}
|
||||
canonical={frontMatter.permalink}
|
||||
openGraph={{
|
||||
title: frontMatter.title,
|
||||
@ -29,6 +29,7 @@ const Note = ({ frontMatter, source }: Note) => {
|
||||
publishedTime: frontMatter.date,
|
||||
modifiedTime: frontMatter.date,
|
||||
},
|
||||
// @ts-ignore
|
||||
images: frontMatter.image && [
|
||||
{
|
||||
url: `${config.baseUrl}${frontMatter.image}`,
|
||||
@ -43,9 +44,10 @@ const Note = ({ frontMatter, source }: Note) => {
|
||||
<ArticleJsonLd
|
||||
url={frontMatter.permalink}
|
||||
title={frontMatter.title}
|
||||
description={frontMatter.description}
|
||||
description={frontMatter.description || config.longDescription}
|
||||
datePublished={frontMatter.date}
|
||||
dateModified={frontMatter.date}
|
||||
// @ts-ignore
|
||||
images={frontMatter.image && [`${config.baseUrl}${frontMatter.image}`]}
|
||||
{...articleJsonLd}
|
||||
/>
|
||||
@ -74,8 +76,8 @@ const Note = ({ frontMatter, source }: Note) => {
|
||||
);
|
||||
};
|
||||
|
||||
export const getStaticProps: GetStaticProps = async ({ params }: { params: Pick<NoteFrontMatter, "slug"> }) => {
|
||||
const { frontMatter, source } = await compileNote(params.slug);
|
||||
export const getStaticProps: GetStaticProps = async ({ params }) => {
|
||||
const { frontMatter, source } = await compileNote((params as Pick<NoteFrontMatter, "slug">).slug);
|
||||
|
||||
return {
|
||||
props: {
|
||||
|
@ -72,7 +72,8 @@ const Projects = ({ repos }: { repos: Repository[] }) => {
|
||||
|
||||
export const getStaticProps: GetStaticProps = async () => {
|
||||
// https://docs.github.com/en/graphql/reference/objects#repository
|
||||
const { user } = await graphql(
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const response: any = await graphql(
|
||||
`
|
||||
query ($username: String!, $sort: RepositoryOrderField!, $limit: Int) {
|
||||
user(login: $username) {
|
||||
@ -113,7 +114,10 @@ export const getStaticProps: GetStaticProps = async () => {
|
||||
}
|
||||
);
|
||||
|
||||
const repos: Repository[] = user.repositories.edges.map(({ node: repo }) => ({
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const results: { node: { [key: string]: any } }[] = response.user.repositories.edges;
|
||||
|
||||
const repos = results.map<Repository>(({ node: repo }) => ({
|
||||
name: repo.name,
|
||||
url: repo.url,
|
||||
description: repo.description,
|
||||
|
Reference in New Issue
Block a user