Update packages and run prettier

This commit is contained in:
Kyle Mathews 2017-08-04 18:12:17 -07:00
parent 6bc49591c3
commit 8f03c8589e
6 changed files with 63 additions and 65 deletions

View file

@ -7,32 +7,33 @@
"url": "https://github.com/gatsbyjs/gatsby-starter-blog/issues"
},
"dependencies": {
"gatsby": "^1.0.0",
"gatsby-link": "^1.0.0",
"gatsby": "^1.6.5",
"gatsby-link": "^1.6.5",
"gatsby-plugin-google-analytics": "^1.0.0",
"gatsby-plugin-manifest": "^1.0.0",
"gatsby-plugin-offline": "^1.0.0",
"gatsby-plugin-preact": "^1.0.0",
"gatsby-plugin-react-helmet": "^1.0.0",
"gatsby-plugin-sharp": "^1.0.0",
"gatsby-remark-copy-linked-files": "^1.0.0",
"gatsby-remark-prismjs": "^1.0.0",
"gatsby-remark-responsive-iframe": "^1.0.0",
"gatsby-remark-images": "^1.0.0",
"gatsby-remark-smartypants": "^1.0.0",
"gatsby-source-filesystem": "^1.0.0",
"gatsby-transformer-remark": "^1.0.0",
"gatsby-transformer-sharp": "^1.0.0",
"gatsby-plugin-sharp": "^1.6.0",
"gatsby-remark-copy-linked-files": "^1.5.0",
"gatsby-remark-images": "^1.5.0",
"gatsby-remark-prismjs": "^1.2.0",
"gatsby-remark-responsive-iframe": "^1.4.1",
"gatsby-remark-smartypants": "^1.4.1",
"gatsby-source-filesystem": "^1.4.1",
"gatsby-transformer-remark": "^1.6.3",
"gatsby-transformer-sharp": "^1.6.0",
"lodash": "^4.15.0",
"react-responsive-grid": "^0.3.3",
"react-typography": "^0.15.0",
"typeface-merriweather": "^0.0.25",
"typeface-montserrat": "^0.0.24",
"typography": "^0.15.8",
"react-typography": "^0.16.1",
"typeface-merriweather": "0.0.25",
"typeface-montserrat": "0.0.24",
"typography": "^0.16.0",
"typography-theme-wordpress-2016": "^0.15.1"
},
"devDependencies": {
"gh-pages": "^0.12.0"
"gh-pages": "^0.12.0",
"prettier": "^1.5.3"
},
"homepage": "https://github.com/gatsbyjs/gatsby-starter-blog#readme",
"keywords": [
@ -48,6 +49,7 @@
"dev": "gatsby develop",
"lint": "./node_modules/.bin/eslint --ext .js,.jsx --ignore-pattern public .",
"test": "echo \"Error: no test specified\" && exit 1",
"format": "prettier --trailing-comma es5 --no-semi --single-quote --write 'src/**/*.js'",
"develop": "gatsby develop",
"build": "gatsby build",
"deploy": "gatsby build --prefix-paths && gh-pages -d public",

View file

@ -1,11 +1,11 @@
import React from "react"
import React from 'react'
// Import typefaces
import "typeface-montserrat"
import "typeface-merriweather"
import 'typeface-montserrat'
import 'typeface-merriweather'
import profilePic from "./profile-pic.jpg"
import { rhythm } from "../utils/typography"
import profilePic from './profile-pic.jpg'
import { rhythm } from '../utils/typography'
class Bio extends React.Component {
render() {
@ -19,19 +19,15 @@ class Bio extends React.Component {
src={profilePic}
alt={`Kyle Mathews`}
style={{
float: "left",
float: 'left',
marginRight: rhythm(1 / 4),
marginBottom: 0,
width: rhythm(2),
height: rhythm(2),
}}
/>
Written by
{" "}
<strong>Kyle Mathews</strong>
{" "}
who lives and works in San Francisco building useful things.
{" "}
Written by <strong>Kyle Mathews</strong> who lives and works in San
Francisco building useful things.{' '}
<a href="https://twitter.com/kylemathews">
You should follow him on Twitter
</a>

View file

@ -1,7 +1,7 @@
import React from "react"
import { TypographyStyle } from "react-typography"
import React from 'react'
import { TypographyStyle } from 'react-typography'
import typography from "./utils/typography"
import typography from './utils/typography'
let stylesStr
if (process.env.NODE_ENV === `production`) {

View file

@ -1,14 +1,14 @@
import React from "react"
import Link from "gatsby-link"
import { Container } from "react-responsive-grid"
import React from 'react'
import Link from 'gatsby-link'
import { Container } from 'react-responsive-grid'
import { rhythm, scale } from "../utils/typography"
import { rhythm, scale } from '../utils/typography'
class Template extends React.Component {
render() {
const { location, children } = this.props
let header
if (location.pathname === "/") {
if (location.pathname === '/') {
header = (
<h1
style={{
@ -19,11 +19,11 @@ class Template extends React.Component {
>
<Link
style={{
boxShadow: "none",
textDecoration: "none",
color: "inherit",
boxShadow: 'none',
textDecoration: 'none',
color: 'inherit',
}}
to={"/"}
to={'/'}
>
Gatsby Starter Blog
</Link>
@ -33,18 +33,18 @@ class Template extends React.Component {
header = (
<h3
style={{
fontFamily: "Montserrat, sans-serif",
fontFamily: 'Montserrat, sans-serif',
marginTop: 0,
marginBottom: rhythm(-1),
}}
>
<Link
style={{
boxShadow: "none",
textDecoration: "none",
color: "inherit",
boxShadow: 'none',
textDecoration: 'none',
color: 'inherit',
}}
to={"/"}
to={'/'}
>
Gatsby Starter Blog
</Link>

View file

@ -1,20 +1,20 @@
import React from "react"
import Link from "gatsby-link"
import get from "lodash/get"
import Helmet from "react-helmet"
import React from 'react'
import Link from 'gatsby-link'
import get from 'lodash/get'
import Helmet from 'react-helmet'
import Bio from "../components/Bio"
import { rhythm } from "../utils/typography"
import Bio from '../components/Bio'
import { rhythm } from '../utils/typography'
class BlogIndex extends React.Component {
render() {
// console.log("props", this.props)
const pageLinks = []
const siteTitle = get(this, "props.data.site.siteMetadata.title")
const posts = get(this, "props.data.allMarkdownRemark.edges")
const siteTitle = get(this, 'props.data.site.siteMetadata.title')
const posts = get(this, 'props.data.allMarkdownRemark.edges')
posts.forEach(post => {
if (post.node.path !== "/404/") {
const title = get(post, "node.frontmatter.title") || post.node.path
if (post.node.path !== '/404/') {
const title = get(post, 'node.frontmatter.title') || post.node.path
pageLinks.push(
<li
key={post.node.frontmatter.path}
@ -22,7 +22,7 @@ class BlogIndex extends React.Component {
marginBottom: rhythm(1 / 4),
}}
>
<Link style={{ boxShadow: "none" }} to={post.node.frontmatter.path}>
<Link style={{ boxShadow: 'none' }} to={post.node.frontmatter.path}>
{post.node.frontmatter.title}
</Link>
</li>
@ -32,7 +32,7 @@ class BlogIndex extends React.Component {
return (
<div>
<Helmet title={get(this, "props.data.site.siteMetadata.title")} />
<Helmet title={get(this, 'props.data.site.siteMetadata.title')} />
<Bio />
<ul>
{pageLinks}

View file

@ -1,15 +1,15 @@
import React from "react"
import Helmet from "react-helmet"
import Link from "gatsby-link"
import get from "lodash/get"
import React from 'react'
import Helmet from 'react-helmet'
import Link from 'gatsby-link'
import get from 'lodash/get'
import Bio from "../components/Bio"
import { rhythm, scale } from "../utils/typography"
import Bio from '../components/Bio'
import { rhythm, scale } from '../utils/typography'
class BlogPostTemplate extends React.Component {
render() {
const post = this.props.data.markdownRemark
const siteTitle = get(this.props, "data.site.siteMetadata.title")
const siteTitle = get(this.props, 'data.site.siteMetadata.title')
return (
<div>
@ -20,7 +20,7 @@ class BlogPostTemplate extends React.Component {
<p
style={{
...scale(-1 / 5),
display: "block",
display: 'block',
marginBottom: rhythm(1),
marginTop: rhythm(-1),
}}