Skip to content

Commit 3c48b08

Browse files
committed
CHORE: add typescript
1 parent 8e11fb2 commit 3c48b08

16 files changed

+148
-2467
lines changed

.prettierrc

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
2-
"endOfLine": "lf",
3-
"semi": false,
4-
"singleQuote": false,
2+
"semi": true,
3+
"singleQuote": true,
54
"tabWidth": 2,
65
"trailingComma": "es5"
76
}

gatsby-config.js

+2-14
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,6 @@ module.exports = {
66
},
77
plugins: [
88
`gatsby-plugin-react-helmet`,
9-
{
10-
resolve: `gatsby-source-filesystem`,
11-
options: {
12-
name: `images`,
13-
path: `${__dirname}/src/images`,
14-
},
15-
},
16-
`gatsby-transformer-sharp`,
17-
`gatsby-plugin-sharp`,
189
{
1910
resolve: `gatsby-plugin-manifest`,
2011
options: {
@@ -24,11 +15,8 @@ module.exports = {
2415
background_color: `#663399`,
2516
theme_color: `#663399`,
2617
display: `minimal-ui`,
27-
icon: `src/images/gatsby-icon.png`, // This path is relative to the root of the site.
2818
},
2919
},
30-
// this (optional) plugin enables Progressive Web App + Offline functionality
31-
// To learn more, visit: https://gatsby.dev/offline
32-
// `gatsby-plugin-offline`,
20+
`gatsby-plugin-typescript`,
3321
],
34-
}
22+
};

package.json

+11-17
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,37 @@
11
{
2-
"name": "gatsby-starter-default",
2+
"name": "staccato",
33
"private": true,
4-
"description": "A simple starter to get up and developing quickly with Gatsby",
4+
"description": "Short music reviews",
55
"version": "0.1.0",
6-
"author": "Kyle Mathews <mathews.kyle@gmail.com>",
6+
"author": "John Sylvain <john.n.sylvain@gmail.com>",
77
"dependencies": {
88
"gatsby": "^2.13.73",
9-
"gatsby-image": "^2.2.10",
109
"gatsby-plugin-manifest": "^2.2.6",
1110
"gatsby-plugin-offline": "^2.2.7",
1211
"gatsby-plugin-react-helmet": "^3.1.4",
13-
"gatsby-plugin-sharp": "^2.2.13",
14-
"gatsby-source-filesystem": "^2.1.11",
15-
"gatsby-transformer-sharp": "^2.2.7",
16-
"prop-types": "^15.7.2",
12+
"gatsby-plugin-typescript": "^2.1.5",
1713
"react": "^16.9.0",
1814
"react-dom": "^16.9.0",
1915
"react-helmet": "^5.2.1"
2016
},
2117
"devDependencies": {
18+
"@types/react": "^16.9.2",
19+
"@types/react-dom": "^16.9.0",
20+
"@types/react-helmet": "^5.0.9",
2221
"prettier": "^1.18.2"
2322
},
2423
"keywords": [
25-
"gatsby"
24+
"gatsby",
25+
"music"
2626
],
2727
"license": "MIT",
2828
"scripts": {
2929
"build": "gatsby build",
3030
"develop": "gatsby develop",
31-
"format": "prettier --write \"**/*.{js,jsx,json,md}\"",
31+
"format": "prettier --write \"**/*.{js,jsx,tsx,ts,json,md}\"",
3232
"start": "npm run develop",
3333
"serve": "gatsby serve",
3434
"test": "echo \"Write tests! -> https://gatsby.dev/unit-testing \""
3535
},
36-
"repository": {
37-
"type": "git",
38-
"url": "https://github.com/gatsbyjs/gatsby-starter-default"
39-
},
40-
"bugs": {
41-
"url": "https://github.com/gatsbyjs/gatsby/issues"
42-
}
36+
"repository": "[email protected]:johnsylvain/staccato.git"
4337
}

readme.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
# staccato
1+
# staccato

src/components/header.js renamed to src/components/header.tsx

+6-15
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
import { Link } from "gatsby"
2-
import PropTypes from "prop-types"
3-
import React from "react"
1+
import { Link } from 'gatsby';
2+
import React from 'react';
43

5-
const Header = ({ siteTitle }) => (
4+
type HeaderProps = { siteTitle: string };
5+
6+
export const Header: React.FC<HeaderProps> = ({ siteTitle }) => (
67
<header
78
style={{
89
background: `rebeccapurple`,
@@ -29,14 +30,4 @@ const Header = ({ siteTitle }) => (
2930
</h1>
3031
</div>
3132
</header>
32-
)
33-
34-
Header.propTypes = {
35-
siteTitle: PropTypes.string,
36-
}
37-
38-
Header.defaultProps = {
39-
siteTitle: ``,
40-
}
41-
42-
export default Header
33+
);

src/components/image.js

-32
This file was deleted.

0 commit comments

Comments
 (0)