Unverified Commit aac51214 authored by Joe Haddad's avatar Joe Haddad Committed by GitHub

Apply missing formatting (#8079)

* Reapply missing formatting

* Fix lint
parent ab57978d
...@@ -17,16 +17,19 @@ The following types are different: ...@@ -17,16 +17,19 @@ The following types are different:
> This list was created by the community to help you upgrade, if you find other differences please send a pull-request to this list to help other users. > This list was created by the community to help you upgrade, if you find other differences please send a pull-request to this list to help other users.
From: From:
```tsx ```tsx
import { NextContext } from "next"; import { NextContext } from 'next'
import { NextAppContext } from "next/app"; import { NextAppContext } from 'next/app'
import { NextDocumentContext } from "next/document"; import { NextDocumentContext } from 'next/document'
``` ```
to to
```tsx ```tsx
import { NextPageContext } from "next"; import { NextPageContext } from 'next'
import { AppContext } from "next/app"; import { AppContext } from 'next/app'
import { DocumentContext } from "next/document"; import { DocumentContext } from 'next/document'
``` ```
#### The `config` key is now a special export on a page #### The `config` key is now a special export on a page
......
...@@ -11,6 +11,7 @@ Updating code that relies on this behavior is relatively straightforward! We've ...@@ -11,6 +11,7 @@ Updating code that relies on this behavior is relatively straightforward! We've
Migrate to using separate dynamic calls for each module. Migrate to using separate dynamic calls for each module.
Before Before
```js ```js
import dynamic from 'next/dynamic' import dynamic from 'next/dynamic'
...@@ -40,6 +41,7 @@ export default DynamicBundle ...@@ -40,6 +41,7 @@ export default DynamicBundle
``` ```
After After
```js ```js
import dynamic from 'next/dynamic' import dynamic from 'next/dynamic'
......
...@@ -4,7 +4,8 @@ import Page from '../components/layouts/page' ...@@ -4,7 +4,8 @@ import Page from '../components/layouts/page'
export const meta = { export const meta = {
title: 'About', title: 'About',
summary: 'Hi! This is a placeholder page. I thought that the header was too empty so I wanted to add an element to show how to add additional pages and put a small navigation here.', summary:
'Hi! This is a placeholder page. I thought that the header was too empty so I wanted to add an element to show how to add additional pages and put a small navigation here.',
} }
export default withRouter(({ children, router }) => ( export default withRouter(({ children, router }) => (
......
...@@ -11,7 +11,10 @@ const defaultHandlerWrapper = app => async ({ raw: { req, res }, url }, h) => { ...@@ -11,7 +11,10 @@ const defaultHandlerWrapper = app => async ({ raw: { req, res }, url }, h) => {
return h.response(html).code(res.statusCode) return h.response(html).code(res.statusCode)
} }
const pathWrapper = (app, pathName, opts) => async ({ raw, query, params }, h) => { const pathWrapper = (app, pathName, opts) => async (
{ raw, query, params },
h
) => {
const html = await app.renderToHTML( const html = await app.renderToHTML(
raw.req, raw.req,
raw.res, raw.res,
......
...@@ -2,4 +2,4 @@ ...@@ -2,4 +2,4 @@
"watch": ["server", "static"], "watch": ["server", "static"],
"exec": "ts-node --project tsconfig.server.json server/index.ts", "exec": "ts-node --project tsconfig.server.json server/index.ts",
"ext": "js ts" "ext": "js ts"
} }
\ No newline at end of file
# rbx & bulma-pro example # rbx & bulma-pro example
## How to use ## How to use
### Using `create-next-app` ### Using `create-next-app`
Execute create-next-app with yarn or npm to bootstrap the example: Execute create-next-app with yarn or npm to bootstrap the example:
``` ```
npm create-next-app --example with-rbx-bulma-pro with-rbx-bulma-pro-app npm create-next-app --example with-rbx-bulma-pro with-rbx-bulma-pro-app
# or # or
yarn create next-app --example with-rbx-bulma-pro with-rbx-bulma-pro-app yarn create next-app --example with-rbx-bulma-pro with-rbx-bulma-pro-app
``` ```
### Download manually ### Download manually
Download the example: Download the example:
``` ```
curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-rbx-bulma-pro curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-rbx-bulma-pro
cd with-rbx-bulma-pro cd with-rbx-bulma-pro
``` ```
Install it and run: Install it and run:
``` ```
npm install npm install
npm run dev npm run dev
......
...@@ -5,7 +5,7 @@ export const dataArray: User[] = [ ...@@ -5,7 +5,7 @@ export const dataArray: User[] = [
{ id: 101, name: 'Alice' }, { id: 101, name: 'Alice' },
{ id: 102, name: 'Bob' }, { id: 102, name: 'Bob' },
{ id: 103, name: 'Caroline' }, { id: 103, name: 'Caroline' },
{ id: 104, name: 'Dave' } { id: 104, name: 'Dave' },
] ]
/** /**
...@@ -13,7 +13,7 @@ export const dataArray: User[] = [ ...@@ -13,7 +13,7 @@ export const dataArray: User[] = [
* *
* Throws an error if not found. * Throws an error if not found.
*/ */
export async function findData (id: number | string) { export async function findData(id: number | string) {
const selected = dataArray.find(data => data.id === Number(id)) const selected = dataArray.find(data => data.id === Number(id))
if (!selected) { if (!selected) {
...@@ -24,7 +24,7 @@ export async function findData (id: number | string) { ...@@ -24,7 +24,7 @@ export async function findData (id: number | string) {
} }
/** Calls a mock API which returns the above array to simulate "get all". */ /** Calls a mock API which returns the above array to simulate "get all". */
export async function findAll () { export async function findAll() {
// Throw an error, just for example. // Throw an error, just for example.
if (!Array.isArray(dataArray)) { if (!Array.isArray(dataArray)) {
throw new Error('Cannot find users') throw new Error('Cannot find users')
......
...@@ -7,7 +7,7 @@ const isTest = env === 'test' ...@@ -7,7 +7,7 @@ const isTest = env === 'test'
type StyledJsxPlugin = [string, any] | string type StyledJsxPlugin = [string, any] | string
type StyledJsxBabelOptions = type StyledJsxBabelOptions =
| { | {
plugins?: StyledJsxPlugin[], plugins?: StyledJsxPlugin[]
'babel-test'?: boolean 'babel-test'?: boolean
} }
| undefined | undefined
...@@ -119,7 +119,12 @@ module.exports = ( ...@@ -119,7 +119,12 @@ module.exports = (
...options['transform-runtime'], ...options['transform-runtime'],
}, },
], ],
[(isTest && options['styled-jsx'] && options['styled-jsx']['babel-test']) ? require('styled-jsx/babel-test') : require('styled-jsx/babel'), styledJsxOptions(options['styled-jsx'])], [
isTest && options['styled-jsx'] && options['styled-jsx']['babel-test']
? require('styled-jsx/babel-test')
: require('styled-jsx/babel'),
styledJsxOptions(options['styled-jsx']),
],
require('./plugins/amp-attributes'), require('./plugins/amp-attributes'),
isProduction && [ isProduction && [
require('babel-plugin-transform-react-remove-prop-types'), require('babel-plugin-transform-react-remove-prop-types'),
......
...@@ -61,15 +61,7 @@ ...@@ -61,15 +61,7 @@
"registered": "2014-07-30T10:07:08 -02:00", "registered": "2014-07-30T10:07:08 -02:00",
"latitude": -9.239109, "latitude": -9.239109,
"longitude": 123.085402, "longitude": 123.085402,
"tags": [ "tags": ["incididunt", "laboris", "culpa", "non", "sint", "sunt", "et"],
"incididunt",
"laboris",
"culpa",
"non",
"sint",
"sunt",
"et"
],
"friends": [ "friends": [
{ {
"id": 0, "id": 0,
...@@ -190,15 +182,7 @@ ...@@ -190,15 +182,7 @@
"registered": "2017-03-03T08:55:12 -01:00", "registered": "2017-03-03T08:55:12 -01:00",
"latitude": -54.522447, "latitude": -54.522447,
"longitude": -80.499064, "longitude": -80.499064,
"tags": [ "tags": ["officia", "non", "culpa", "non", "deserunt", "ex", "velit"],
"officia",
"non",
"culpa",
"non",
"deserunt",
"ex",
"velit"
],
"friends": [ "friends": [
{ {
"id": 0, "id": 0,
...@@ -300,4 +284,4 @@ ...@@ -300,4 +284,4 @@
} }
] ]
} }
] ]
\ No newline at end of file
...@@ -15,9 +15,7 @@ const $comment = ({ gipQuery }) => { ...@@ -15,9 +15,7 @@ const $comment = ({ gipQuery }) => {
} }
$comment.getInitialProps = async ({ query }) => { $comment.getInitialProps = async ({ query }) => {
return { return { gipQuery: query }
gipQuery: query
}
} }
export default $comment export default $comment
...@@ -6,9 +6,7 @@ const Page = () => { ...@@ -6,9 +6,7 @@ const Page = () => {
return ( return (
<> <>
<p> <p>{`Blog post ${post} comment ${id || '(all)'}`}</p>
{`Blog post ${post} comment ${id || '(all)'}`}
</p>
</> </>
) )
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment