Skip to content
This repository was archived by the owner on Dec 22, 2024. It is now read-only.

Commit 3bd3fe3

Browse files
committed
Migrate gatsby files from Javascript to Typescript
1 parent 9ea205d commit 3bd3fe3

12 files changed

+640
-14773
lines changed

.gatsby/gatsby-config.ts

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import { TSConfigFn } from "gatsby-plugin-ts-config";
2+
3+
const configuration: TSConfigFn<'config'> = ({ projectRoot }) => ({
4+
siteMetadata: {
5+
title: `Gatsby Default Starter`,
6+
description: `Kick off your next, great Gatsby project with this default starter. This barebones starter ships with the main Gatsby configuration files you might need.`,
7+
author: `@gatsbyjs`,
8+
siteUrl: `https://gatsbystarterdefaultsource.gatsbyjs.io/`,
9+
},
10+
plugins: [
11+
`gatsby-plugin-react-helmet`,
12+
`gatsby-plugin-image`,
13+
{
14+
resolve: `gatsby-source-filesystem`,
15+
options: {
16+
name: `images`,
17+
path: `${projectRoot}/src/images`,
18+
},
19+
},
20+
`gatsby-transformer-sharp`,
21+
`gatsby-plugin-sharp`,
22+
{
23+
resolve: `gatsby-plugin-manifest`,
24+
options: {
25+
name: `gatsby-starter-default`,
26+
short_name: `starter`,
27+
start_url: `/`,
28+
background_color: `#663399`,
29+
theme_color: `#663399`,
30+
display: `minimal-ui`,
31+
icon: `src/images/gatsby-icon.png`, // This path is relative to the root of the site.
32+
},
33+
},
34+
`gatsby-plugin-gatsby-cloud`,
35+
// this (optional) plugin enables Progressive Web App + Offline functionality
36+
// To learn more, visit: https://gatsby.dev/offline
37+
// `gatsby-plugin-offline`,
38+
],
39+
});
40+
41+
export default configuration;

.gatsby/gatsby-node.ts

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/**
2+
* Implement Gatsby's Node APIs in this file.
3+
*
4+
* See: https://www.gatsbyjs.com/docs/node-apis/
5+
*/
6+
7+
// You can delete this file if you're not using it

LICENSE

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
The BSD Zero Clause License (0BSD)
22

3+
Copyright (c) 2021 https://github.com/openscript
34
Copyright (c) 2020 Gatsby Inc.
45

56
Permission to use, copy, modify, and/or distribute this software for any

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22

33
This is a quite opinionated Gatsby starter. It features:
44

5-
- Gatsby Configuration with Typescript using
5+
- Gatsby Configuration with Typescript using [gatsby-plugin-ts-config](https://github.com/Js-Brecht/gatsby-plugin-ts-config)
66
- Preconfigured VSCode Development Container
File renamed without changes.

gatsby-config.js

+5-37
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,5 @@
1-
module.exports = {
2-
siteMetadata: {
3-
title: `Gatsby Default Starter`,
4-
description: `Kick off your next, great Gatsby project with this default starter. This barebones starter ships with the main Gatsby configuration files you might need.`,
5-
author: `@gatsbyjs`,
6-
siteUrl: `https://gatsbystarterdefaultsource.gatsbyjs.io/`,
7-
},
8-
plugins: [
9-
`gatsby-plugin-react-helmet`,
10-
`gatsby-plugin-image`,
11-
{
12-
resolve: `gatsby-source-filesystem`,
13-
options: {
14-
name: `images`,
15-
path: `${__dirname}/src/images`,
16-
},
17-
},
18-
`gatsby-transformer-sharp`,
19-
`gatsby-plugin-sharp`,
20-
{
21-
resolve: `gatsby-plugin-manifest`,
22-
options: {
23-
name: `gatsby-starter-default`,
24-
short_name: `starter`,
25-
start_url: `/`,
26-
background_color: `#663399`,
27-
theme_color: `#663399`,
28-
display: `minimal-ui`,
29-
icon: `src/images/gatsby-icon.png`, // This path is relative to the root of the site.
30-
},
31-
},
32-
`gatsby-plugin-gatsby-cloud`,
33-
// this (optional) plugin enables Progressive Web App + Offline functionality
34-
// To learn more, visit: https://gatsby.dev/offline
35-
// `gatsby-plugin-offline`,
36-
],
37-
}
1+
const { useGatsbyConfig } = require('gatsby-plugin-ts-config');
2+
3+
module.exports = useGatsbyConfig("./.gatsby/gatsby-config", {
4+
type: 'ts-node'
5+
});

gatsby-node.js

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
/**
2-
* Implement Gatsby's Node APIs in this file.
3-
*
4-
* See: https://www.gatsbyjs.com/docs/node-apis/
5-
*/
1+
// eslint-disable-next-line @typescript-eslint/no-var-requires
2+
const { useGatsbyNode } = require("gatsby-plugin-ts-config");
63

7-
// You can delete this file if you're not using it
4+
module.exports = useGatsbyNode(() => require("./.gatsby/gatsby-node"), {
5+
type: 'ts-node'
6+
});

gatsby-ssr.js gatsby-ssr.ts

File renamed without changes.

0 commit comments

Comments
 (0)