refactor(starter): upgrade to new version of gatsby

This commit is contained in:
Alexander Shelepenok
2022-01-09 20:12:31 +00:00
parent 84bdc5899d
commit 67ebabbaac
397 changed files with 26665 additions and 34984 deletions

View File

@@ -0,0 +1,11 @@
import Edge from "./edge";
interface AllMarkdownRemark {
edges: Array<Edge>;
group: Array<{
fieldValue: string;
totalCount: number;
}>;
}
export default AllMarkdownRemark;

5
src/types/dictionary.ts Normal file
View File

@@ -0,0 +1,5 @@
interface Dictionary<T> {
[key: string]: T;
}
export default Dictionary;

7
src/types/edge.ts Normal file
View File

@@ -0,0 +1,7 @@
import Node from "./node";
interface Edge {
node: Node;
}
export default Edge;

7
src/types/fields.ts Normal file
View File

@@ -0,0 +1,7 @@
interface Fields {
slug: string;
categorySlug: string;
tagSlugs?: Array<string>;
}
export default Fields;

13
src/types/frontmatter.ts Normal file
View File

@@ -0,0 +1,13 @@
interface Frontmatter {
date: string;
title: string;
category: string;
template: string;
description?: string;
tags?: Array<string>;
socialImage?: {
publicURL: string;
};
}
export default Frontmatter;

View File

@@ -1,61 +0,0 @@
// @flow strict
import type { Node as ReactNode } from 'react';
export type RenderCallback = {
// $FlowFixMe
render: (data: any) => ReactNode;
}
export type Entry = {
getIn: (string[]) => string;
}
export type WidgetFor = (string) => string;
export type PageContext = {
tag: string,
category: string,
currentPage: number,
prevPagePath: string,
nextPagePath: string,
hasPrevPage: boolean,
hasNextPage: boolean
};
export type Node = {
fields: {
slug: string,
categorySlug?: string,
tagSlugs?: string[]
},
frontmatter: {
date: string,
description?: string,
category?: string,
tags?: string[],
title: string,
socialImage?: {
publicURL: string
}
},
html: string,
id: string
};
export type Edge = {
node: Node
};
export type Edges = Array<Edge>;
export type AllMarkdownRemark = {
allMarkdownRemark: {
edges: Edges,
},
group: {
fieldValue: string,
totalCount: number
}[]
};
export type MarkdownRemark = Node;

7
src/types/index.ts Normal file
View File

@@ -0,0 +1,7 @@
export type { default as Edge } from "./edge";
export type { default as Node } from "./node";
export type { default as Dictionary } from "./dictionary";
export type { default as Nullable } from "./nullable";
export type { default as PageContext } from "./page-context";
export type { default as Pagination } from "./pagination";
export type { default as AllMarkdownRemark } from "./all-markdown-remark";

11
src/types/node.ts Normal file
View File

@@ -0,0 +1,11 @@
import Fields from "./fields";
import Frontmatter from "./frontmatter";
interface Node {
id: string;
fields: Fields;
frontmatter: Frontmatter;
html: string;
}
export default Node;

3
src/types/nullable.ts Normal file
View File

@@ -0,0 +1,3 @@
type Nullable<T> = T | null;
export default Nullable;

View File

@@ -0,0 +1,8 @@
import Pagination from "./pagination";
interface PageContext {
group?: string;
pagination: Pagination;
}
export default PageContext;

9
src/types/pagination.ts Normal file
View File

@@ -0,0 +1,9 @@
interface Pagination {
currentPage: number;
prevPagePath: string;
nextPagePath: string;
hasPrevPage: boolean;
hasNextPage: boolean;
}
export default Pagination;