Unverified Commit 9c4eefcd authored by Tim Neutkens's avatar Tim Neutkens Committed by GitHub

Add prettier for examples directory (#5909)

* Add prettier for examples directory

* Fix files

* Fix linting

* Add prettier script in case it has to be ran again
parent 6e2cbfaf
......@@ -7,7 +7,9 @@ const ActiveLink = ({ router, children, ...props }) => {
let className = child.props.className || null
if (router.pathname === props.href && props.activeClassName) {
className = `${className !== null ? className : ''} ${props.activeClassName}`.trim()
className = `${className !== null ? className : ''} ${
props.activeClassName
}`.trim()
}
delete props.activeClassName
......
export default () => (
<div>About us</div>
)
export default () => <div>About us</div>
export default () => (
<div>
This is the contact page.
</div>
)
export default () => <div>This is the contact page.</div>
......@@ -21,7 +21,9 @@ export default class Index extends React.Component {
<h1>Home Page</h1>
<p>Welcome, {name}</p>
<div>
<Link href='/about'><a>About Page</a></Link>
<Link href='/about'>
<a>About Page</a>
</Link>
</div>
</div>
)
......
export default () => (
<div>About us</div>
)
export default () => <div>About us</div>
export default () => (
<div>About 2</div>
)
export default () => <div>About 2</div>
export default () => (
<div>Hello Day</div>
)
export default () => <div>Hello Day</div>
import Link from 'next/link'
export default () => (
<div>Hello World. <Link href='/about'><a>About</a></Link></div>
<div>
Hello World.{' '}
<Link href='/about'>
<a>About</a>
</Link>
</div>
)
......@@ -7,15 +7,13 @@ const dev = process.env.NODE_ENV !== 'production'
const app = next({ dev })
const handle = app.getRequestHandler()
app.prepare()
.then(() => {
createServer((req, res) => {
const parsedUrl = parse(req.url, true)
res.setHeader('Content-Type', 'text/html; charset=iso-8859-2')
handle(req, res, parsedUrl)
})
.listen(port, (err) => {
if (err) throw err
console.log(`> Ready on http://localhost:${port}`)
})
app.prepare().then(() => {
createServer((req, res) => {
const parsedUrl = parse(req.url, true)
res.setHeader('Content-Type', 'text/html; charset=iso-8859-2')
handle(req, res, parsedUrl)
}).listen(port, err => {
if (err) throw err
console.log(`> Ready on http://localhost:${port}`)
})
})
'use strict'
const {Action, api} = require('actionhero')
const { Action, api } = require('actionhero')
module.exports = class CreateChatRoom extends Action {
constructor () {
......
......@@ -3,7 +3,7 @@
const path = require('path')
exports['default'] = {
general: (api) => {
general: api => {
const packageJSON = require(api.projectRoot + path.sep + 'package.json')
return {
......@@ -46,16 +46,16 @@ exports['default'] = {
cliIncludeInternal: true,
// configuration for your actionhero project structure
paths: {
'action': [path.join(__dirname, '/../actions')],
'task': [path.join(__dirname, '/../tasks')],
'public': [path.join(__dirname, '/../static')],
'pid': [path.join(__dirname, '/../pids')],
'log': [path.join(__dirname, '/../log')],
'server': [path.join(__dirname, '/../servers')],
'cli': [path.join(__dirname, '/../bin')],
'initializer': [path.join(__dirname, '/../initializers')],
'plugin': [path.join(__dirname, '/../node_modules')],
'locale': [path.join(__dirname, '/../locales')]
action: [path.join(__dirname, '/../actions')],
task: [path.join(__dirname, '/../tasks')],
public: [path.join(__dirname, '/../static')],
pid: [path.join(__dirname, '/../pids')],
log: [path.join(__dirname, '/../log')],
server: [path.join(__dirname, '/../servers')],
cli: [path.join(__dirname, '/../bin')],
initializer: [path.join(__dirname, '/../initializers')],
plugin: [path.join(__dirname, '/../node_modules')],
locale: [path.join(__dirname, '/../locales')]
},
// hash containing chat rooms you wish to be created at server boot
startingChatRooms: {
......@@ -67,17 +67,17 @@ exports['default'] = {
}
exports.test = {
general: (api) => {
general: api => {
return {
id: 'test-server-' + process.pid,
serverToken: 'serverToken-' + process.pid,
developmentMode: true,
startingChatRooms: {
'defaultRoom': {},
'otherRoom': {}
defaultRoom: {},
otherRoom: {}
},
paths: {
'locale': [
locale: [
// require('os').tmpdir() + require('path').sep + 'locales',
path.join(__dirname, '/../locales')
]
......@@ -88,7 +88,7 @@ exports.test = {
}
exports.production = {
general: (api) => {
general: api => {
return {
fileRequestLogLevel: 'debug',
developmentMode: false
......
......@@ -2,9 +2,9 @@
// error messages can be strings of objects
exports['default'] = {
errors: (api) => {
errors: api => {
return {
'_toExpand': false,
_toExpand: false,
// ///////////////
// SERIALIZERS //
......@@ -12,28 +12,28 @@ exports['default'] = {
serializers: {
servers: {
web: (error) => {
web: error => {
if (error.message) {
return String(error.message)
} else {
return error
}
},
websocket: (error) => {
websocket: error => {
if (error.message) {
return String(error.message)
} else {
return error
}
},
socket: (error) => {
socket: error => {
if (error.message) {
return String(error.message)
} else {
return error
}
},
specHelper: (error) => {
specHelper: error => {
if (error.message) {
return 'Error: ' + String(error.message)
} else {
......@@ -49,38 +49,51 @@ exports['default'] = {
// When a params for an action is invalid
invalidParams: (data, validationErrors) => {
if (validationErrors.length >= 0) { return validationErrors[0] }
if (validationErrors.length >= 0) {
return validationErrors[0]
}
return data.connection.localize('actionhero.errors.invalidParams')
},
// When a required param for an action is not provided
missingParams: (data, missingParams) => {
return data.connection.localize(['actionhero.errors.missingParams', {param: missingParams[0]}])
return data.connection.localize([
'actionhero.errors.missingParams',
{ param: missingParams[0] }
])
},
// user requested an unknown action
unknownAction: (data) => {
unknownAction: data => {
return data.connection.localize('actionhero.errors.unknownAction')
},
// action not useable by this client/server type
unsupportedServerType: (data) => {
return data.connection.localize(['actionhero.errors.unsupportedServerType', {type: data.connection.type}])
unsupportedServerType: data => {
return data.connection.localize([
'actionhero.errors.unsupportedServerType',
{ type: data.connection.type }
])
},
// action failed because server is mid-shutdown
serverShuttingDown: (data) => {
serverShuttingDown: data => {
return data.connection.localize('actionhero.errors.serverShuttingDown')
},
// action failed because this client already has too many pending acitons
// limit defined in api.config.general.simultaneousActions
tooManyPendingActions: (data) => {
return data.connection.localize('actionhero.errors.tooManyPendingActions')
tooManyPendingActions: data => {
return data.connection.localize(
'actionhero.errors.tooManyPendingActions'
)
},
dataLengthTooLarge: (maxLength, receivedLength) => {
return api.i18n.localize(['actionhero.errors.dataLengthTooLarge', {maxLength: maxLength, receivedLength: receivedLength}])
return api.i18n.localize([
'actionhero.errors.dataLengthTooLarge',
{ maxLength: maxLength, receivedLength: receivedLength }
])
},
// ///////////////
......@@ -89,18 +102,21 @@ exports['default'] = {
// The body message to accompany 404 (file not found) errors regarding flat files
// You may want to load in the contnet of 404.html or similar
fileNotFound: (connection) => {
fileNotFound: connection => {
return connection.localize(['actionhero.errors.fileNotFound'])
},
// user didn't request a file
fileNotProvided: (connection) => {
fileNotProvided: connection => {
return connection.localize('actionhero.errors.fileNotProvided')
},
// something went wrong trying to read the file
fileReadError: (connection, error) => {
return connection.localize(['actionhero.errors.fileReadError', {error: String(error)}])
return connection.localize([
'actionhero.errors.fileReadError',
{ error: String(error) }
])
},
// ///////////////
......@@ -108,41 +124,54 @@ exports['default'] = {
// ///////////////
verbNotFound: (connection, verb) => {
return connection.localize(['actionhero.errors.verbNotFound', {verb: verb}])
return connection.localize([
'actionhero.errors.verbNotFound',
{ verb: verb }
])
},
verbNotAllowed: (connection, verb) => {
return connection.localize(['actionhero.errors.verbNotAllowed', {verb: verb}])
return connection.localize([
'actionhero.errors.verbNotAllowed',
{ verb: verb }
])
},
connectionRoomAndMessage: (connection) => {
connectionRoomAndMessage: connection => {
return connection.localize('actionhero.errors.connectionRoomAndMessage')
},
connectionNotInRoom: (connection, room) => {
return connection.localize(['actionhero.errors.connectionNotInRoom', {room: room}])
return connection.localize([
'actionhero.errors.connectionNotInRoom',
{ room: room }
])
},
connectionAlreadyInRoom: (connection, room) => {
return connection.localize(['actionhero.errors.connectionAlreadyInRoom', {room: room}])
return connection.localize([
'actionhero.errors.connectionAlreadyInRoom',
{ room: room }
])
},
connectionRoomHasBeenDeleted: (room) => {
return api.i18n.localize('actionhero.errors.connectionRoomHasBeenDeleted')
connectionRoomHasBeenDeleted: room => {
return api.i18n.localize(
'actionhero.errors.connectionRoomHasBeenDeleted'
)
},
connectionRoomNotExist: (room) => {
connectionRoomNotExist: room => {
return api.i18n.localize('actionhero.errors.connectionRoomNotExist')
},
connectionRoomExists: (room) => {
connectionRoomExists: room => {
return api.i18n.localize('actionhero.errors.connectionRoomExists')
},
connectionRoomRequired: (room) => {
connectionRoomRequired: room => {
return api.i18n.localize('actionhero.errors.connectionRoomRequired')
}
}
}
}
exports['default'] = {
i18n: (api) => {
i18n: api => {
return {
// visit https://github.com/mashpie/i18n-node to see all configuration options
// locale path can be configired from within ./config/api.js
......@@ -28,7 +28,7 @@ exports['default'] = {
}
exports.test = {
i18n: (api) => {
i18n: api => {
return {
updateFiles: true
}
......
......@@ -4,16 +4,18 @@ const fs = require('fs')
const cluster = require('cluster')
exports['default'] = {
logger: (api) => {
let logger = {transports: []}
logger: api => {
let logger = { transports: [] }
// console logger
if (cluster.isMaster) {
logger.transports.push(function (api, winston) {
return new (winston.transports.Console)({
return new winston.transports.Console({
colorize: true,
level: 'info',
timestamp: function () { return api.id + ' @ ' + new Date().toISOString() }
timestamp: function () {
return api.id + ' @ ' + new Date().toISOString()
}
})
})
}
......@@ -26,15 +28,18 @@ exports['default'] = {
fs.mkdirSync(logDirectory)
} catch (e) {
if (e.code !== 'EEXIST') {
throw (new Error('Cannot create log directory @ ' + logDirectory))
throw new Error('Cannot create log directory @ ' + logDirectory)
}
}
}
return new (winston.transports.File)({
filename: api.config.general.paths.log[0] + '/' + api.pids.title + '.log',
return new winston.transports.File({
filename:
api.config.general.paths.log[0] + '/' + api.pids.title + '.log',
level: 'info',
timestamp: function () { return api.id + ' @ ' + new Date().toISOString() }
timestamp: function () {
return api.id + ' @ ' + new Date().toISOString()
}
})
})
......@@ -52,7 +57,7 @@ exports['default'] = {
}
exports.test = {
logger: (api) => {
logger: api => {
return {
transports: null
}
......
exports['default'] = {
plugins: (api) => {
plugins: api => {
/*
If you want to use plugins in your application, include them here:
......
......@@ -11,15 +11,20 @@ if (process.env.REDIS_URL) {
}
exports['default'] = {
redis: (api) => {
redis: api => {
// konstructor: The redis client constructor method. All redis methods must be promises
// args: The arguments to pass to the constructor
// buildNew: is it `new konstructor()` or just `konstructor()`?
function retryStrategy (times) {
if (times === 1) {
const error = 'Unable to connect to Redis - please check your Redis config!'
if (process.env.NODE_ENV === 'test') { console.error(error) } else { api.log(error, 'error') }
const error =
'Unable to connect to Redis - please check your Redis config!'
if (process.env.NODE_ENV === 'test') {
console.error(error)
} else {
api.log(error, 'error')
}
return 5000
}
return Math.min(times * 50, maxBackoff)
......@@ -28,20 +33,44 @@ exports['default'] = {
return {
enabled: true,
'_toExpand': false,
_toExpand: false,
client: {
konstructor: require('ioredis'),
args: [{ port: port, host: host, password: password, db: db, retryStrategy: retryStrategy }],
args: [
{
port: port,
host: host,
password: password,
db: db,
retryStrategy: retryStrategy
}
],
buildNew: true
},
subscriber: {
konstructor: require('ioredis'),
args: [{ port: port, host: host, password: password, db: db, retryStrategy: retryStrategy }],
args: [
{
port: port,
host: host,
password: password,
db: db,
retryStrategy: retryStrategy
}
],
buildNew: true
},
tasks: {
konstructor: require('ioredis'),
args: [{ port: port, host: host, password: password, db: db, retryStrategy: retryStrategy }],
args: [
{
port: port,
host: host,
password: password,
db: db,
retryStrategy: retryStrategy
}
],
buildNew: true
}
}
......
exports['default'] = {
routes: (api) => {
routes: api => {
return {
get: [
{ path: '/', matchTrailingPathParts: true, action: 'render' }
]
get: [{ path: '/', matchTrailingPathParts: true, action: 'render' }]
}
}
}
......@@ -2,9 +2,9 @@
exports['default'] = {
servers: {
socket: (api) => {
socket: api => {
return {
enabled: (process.env.ENABLE_TCP_SERVER !== undefined),
enabled: process.env.ENABLE_TCP_SERVER !== undefined,
// TCP or TLS?
secure: false,
// Passed to tls.createServer if secure=true. Should contain SSL certificates
......@@ -26,7 +26,7 @@ exports['default'] = {
exports.test = {
servers: {
socket: (api) => {
socket: api => {
return {
enabled: true,
port: 1001 + (process.pid % 64535),
......
......@@ -4,7 +4,7 @@ const os = require('os')
exports['default'] = {
servers: {
web: (api) => {
web: api => {
return {
enabled: true,
// HTTP or HTTPS?
......@@ -13,7 +13,9 @@ exports['default'] = {
serverOptions: {},
// Should we redirect all traffic to the first host in this array if hte request header doesn't match?
// i.e.: [ 'https://www.site.com' ]
allowedRequestHosts: process.env.ALLOWED_HOSTS ? process.env.ALLOWED_HOSTS.split(',') : [],
allowedRequestHosts: process.env.ALLOWED_HOSTS
? process.env.ALLOWED_HOSTS.split(',')
: [],
// Port or Socket Path
port: process.env.PORT || 8080,
// Which IP to listen on (use '0.0.0.0' for all; '::' for all on ipv4 and ipv6)
......@@ -23,7 +25,8 @@ exports['default'] = {
httpHeaders: {
'X-Powered-By': api.config.general.serverName,
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Methods': 'HEAD, GET, POST, PUT, PATCH, DELETE, OPTIONS, TRACE',
'Access-Control-Allow-Methods':
'HEAD, GET, POST, PUT, PATCH, DELETE, OPTIONS, TRACE',
'Access-Control-Allow-Headers': 'Content-Type'
},
// Route that actions will be served from; secondary route against this route will be treated as actions,
......@@ -92,7 +95,7 @@ exports['default'] = {
exports.production = {
servers: {
web: (api) => {
web: api => {
return {
padding: null,
metadataOptions: {
......@@ -106,7 +109,7 @@ exports.production = {
exports.test = {
servers: {
web: (api) => {
web: api => {
return {
secure: false,
port: process.env.PORT || 1000 + (process.pid % 64535),
......
......@@ -4,7 +4,7 @@
exports['default'] = {
servers: {
websocket: (api) => {
websocket: api => {
return {
enabled: true,
// you can pass a FQDN (string) here or 'window.location.origin'
......@@ -55,7 +55,7 @@ exports['default'] = {
exports['test'] = {
servers: {
websocket: (api) => {
websocket: api => {
return { clientUrl: null }
}
}
......
exports['default'] = {
tasks: (api) => {
tasks: api => {
return {
// Should this node run a scheduler to promote delayed tasks?
scheduler: false,
......@@ -52,7 +52,7 @@ exports['default'] = {
}
exports.test = {
tasks: (api) => {
tasks: api => {
return {
timeout: 100,
checkTimeout: 50
......
'use strict'
const {Initializer, api} = require('actionhero')
const { Initializer, api } = require('actionhero')
const next = require('next')
module.exports = class NextInitializer extends Initializer {
......@@ -10,18 +10,22 @@ module.exports = class NextInitializer extends Initializer {
async initialize () {
api.next = {
render: async (connection) => {
if (connection.type !== 'web') { throw new Error('Connections for NEXT apps must be of type "web"') }
render: async connection => {
if (connection.type !== 'web') {
throw new Error('Connections for NEXT apps must be of type "web"')
}
const req = connection.rawConnection.req
const res = connection.rawConnection.res
return api.next.handle(req, res)
}
}
api.next.dev = (api.env === 'development')
if (api.next.dev) { api.log('Running next in development mode...') }
api.next.dev = api.env === 'development'
if (api.next.dev) {
api.log('Running next in development mode...')
}
api.next.app = next({dev: api.next.dev})
api.next.app = next({ dev: api.next.dev })
api.next.handle = api.next.app.getRequestHandler()
await api.next.app.prepare()
}
......
......@@ -3,7 +3,15 @@ import Link from 'next/link'
export default () => (
<ul>
<li><Link href='/b' as='/a'><a>a</a></Link></li>
<li><Link href='/a' as='/b'><a>b</a></Link></li>
<li>
<Link href='/b' as='/a'>
<a>a</a>
</Link>
</li>
<li>
<Link href='/a' as='/b'>
<a>b</a>
</Link>
</li>
</ul>
)
......@@ -3,13 +3,18 @@ import Link from 'next/link'
export default () => (
<ul>
<li><Link href='/b' as='/a'><a>a</a></Link></li>
<li><Link href='/a' as='/b'><a>b</a></Link></li>
<li>
<Link
href={{pathname: '/posts', query: { id: '2' }}}
as='/posts/2'
>
<Link href='/b' as='/a'>
<a>a</a>
</Link>
</li>
<li>
<Link href='/a' as='/b'>
<a>b</a>
</Link>
</li>
<li>
<Link href={{ pathname: '/posts', query: { id: '2' } }} as='/posts/2'>
<a>post #2</a>
</Link>
</li>
......
......@@ -6,12 +6,14 @@ export default class extends Component {
}
render () {
return <div>
<h1>My blog post #{this.props.postId}</h1>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua.
</p>
</div>
return (
<div>
<h1>My blog post #{this.props.postId}</h1>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
eiusmod tempor incididunt ut labore et dolore magna aliqua.
</p>
</div>
)
}
}
......@@ -6,28 +6,27 @@ const dev = process.env.NODE_ENV !== 'production'
const app = next({ dev })
const handle = app.getRequestHandler()
app.prepare()
.then(() => {
const server = express()
app.prepare().then(() => {
const server = express()
server.get('/a', (req, res) => {
return app.render(req, res, '/b', req.query)
})
server.get('/a', (req, res) => {
return app.render(req, res, '/b', req.query)
})
server.get('/b', (req, res) => {
return app.render(req, res, '/a', req.query)
})
server.get('/b', (req, res) => {
return app.render(req, res, '/a', req.query)
})
server.get('/posts/:id', (req, res) => {
return app.render(req, res, '/posts', { id: req.params.id })
})
server.get('/posts/:id', (req, res) => {
return app.render(req, res, '/posts', { id: req.params.id })
})
server.get('*', (req, res) => {
return handle(req, res)
})
server.get('*', (req, res) => {
return handle(req, res)
})
server.listen(port, (err) => {
if (err) throw err
console.log(`> Ready on http://localhost:${port}`)
})
server.listen(port, err => {
if (err) throw err
console.log(`> Ready on http://localhost:${port}`)
})
})
......@@ -3,7 +3,15 @@ import Link from 'next/link'
export default () => (
<ul>
<li><Link href='/b' as='/a'><a>a</a></Link></li>
<li><Link href='/a' as='/b'><a>b</a></Link></li>
<li>
<Link href='/b' as='/a'>
<a>a</a>
</Link>
</li>
<li>
<Link href='/a' as='/b'>
<a>b</a>
</Link>
</li>
</ul>
)
......@@ -6,51 +6,47 @@ const dev = process.env.NODE_ENV !== 'production'
fastify.register((fastify, opts, next) => {
const app = Next({ dev })
app.prepare()
app
.prepare()
.then(() => {
if (dev) {
fastify.get('/_next/*', (req, reply) => {
return app.handleRequest(req.req, reply.res)
.then(() => {
reply.sent = true
})
return app.handleRequest(req.req, reply.res).then(() => {
reply.sent = true
})
})
}
fastify.get('/a', (req, reply) => {
return app.render(req.req, reply.res, '/b', req.query)
.then(() => {
reply.sent = true
})
return app.render(req.req, reply.res, '/b', req.query).then(() => {
reply.sent = true
})
})
fastify.get('/b', (req, reply) => {
return app.render(req.req, reply.res, '/a', req.query)
.then(() => {
reply.sent = true
})
return app.render(req.req, reply.res, '/a', req.query).then(() => {
reply.sent = true
})
})
fastify.get('/*', (req, reply) => {
return app.handleRequest(req.req, reply.res)
.then(() => {
reply.sent = true
})
return app.handleRequest(req.req, reply.res).then(() => {
reply.sent = true
})
})
fastify.setNotFoundHandler((request, reply) => {
return app.render404(request.req, reply.res)
.then(() => {
reply.sent = true
})
return app.render404(request.req, reply.res).then(() => {
reply.sent = true
})
})
next()
})
.catch((err) => next(err))
.catch(err => next(err))
})
fastify.listen(port, (err) => {
fastify.listen(port, err => {
if (err) throw err
console.log(`> Ready on http://localhost:${port}`)
})
......@@ -13,7 +13,13 @@ const defaultHandlerWrapper = app => async ({ raw: { req, res }, url }) => {
}
const pathWrapper = (app, pathName, opts) => async ({ raw, query, params }) => {
return app.renderToHTML(raw.req, raw.res, pathName, { ...query, ...params }, opts)
return app.renderToHTML(
raw.req,
raw.res,
pathName,
{ ...query, ...params },
opts
)
}
module.exports = { pathWrapper, defaultHandlerWrapper, nextHandlerWrapper }
......@@ -3,7 +3,15 @@ import Link from 'next/link'
export default () => (
<ul>
<li><Link href='/b' as='/a'><a>a</a></Link></li>
<li><Link href='/a' as='/b'><a>b</a></Link></li>
<li>
<Link href='/b' as='/a'>
<a>a</a>
</Link>
</li>
<li>
<Link href='/a' as='/b'>
<a>b</a>
</Link>
</li>
</ul>
)
const next = require('next')
const Hapi = require('hapi')
const { pathWrapper, defaultHandlerWrapper, nextHandlerWrapper } = require('./next-wrapper')
const {
pathWrapper,
defaultHandlerWrapper,
nextHandlerWrapper
} = require('./next-wrapper')
const port = parseInt(process.env.PORT, 10) || 3000
const dev = process.env.NODE_ENV !== 'production'
......@@ -9,38 +13,36 @@ const server = new Hapi.Server({
port
})
app
.prepare()
.then(async () => {
server.route({
method: 'GET',
path: '/a',
handler: pathWrapper(app, '/a')
})
server.route({
method: 'GET',
path: '/b',
handler: pathWrapper(app, '/b')
})
app.prepare().then(async () => {
server.route({
method: 'GET',
path: '/a',
handler: pathWrapper(app, '/a')
})
server.route({
method: 'GET',
path: '/_next/{p*}', /* next specific routes */
handler: nextHandlerWrapper(app)
})
server.route({
method: 'GET',
path: '/b',
handler: pathWrapper(app, '/b')
})
server.route({
method: 'GET',
path: '/{p*}', /* catch all route */
handler: defaultHandlerWrapper(app)
})
server.route({
method: 'GET',
path: '/_next/{p*}' /* next specific routes */,
handler: nextHandlerWrapper(app)
})
try {
await server.start()
console.log(`> Ready on http://localhost:${port}`)
} catch (error) {
console.log('Error starting server')
console.log(error)
}
server.route({
method: 'GET',
path: '/{p*}' /* catch all route */,
handler: defaultHandlerWrapper(app)
})
try {
await server.start()
console.log(`> Ready on http://localhost:${port}`)
} catch (error) {
console.log('Error starting server')
console.log(error)
}
})
......@@ -3,7 +3,15 @@ import Link from 'next/link'
export default () => (
<ul>
<li><Link href='/b' as='/a'><a>a</a></Link></li>
<li><Link href='/a' as='/b'><a>b</a></Link></li>
<li>
<Link href='/b' as='/a'>
<a>a</a>
</Link>
</li>
<li>
<Link href='/a' as='/b'>
<a>b</a>
</Link>
</li>
</ul>
)
......@@ -7,33 +7,32 @@ const dev = process.env.NODE_ENV !== 'production'
const app = next({ dev })
const handle = app.getRequestHandler()
app.prepare()
.then(() => {
const server = new Koa()
const router = new Router()
app.prepare().then(() => {
const server = new Koa()
const router = new Router()
router.get('/a', async ctx => {
await app.render(ctx.req, ctx.res, '/b', ctx.query)
ctx.respond = false
})
router.get('/a', async ctx => {
await app.render(ctx.req, ctx.res, '/b', ctx.query)
ctx.respond = false
})
router.get('/b', async ctx => {
await app.render(ctx.req, ctx.res, '/a', ctx.query)
ctx.respond = false
})
router.get('/b', async ctx => {
await app.render(ctx.req, ctx.res, '/a', ctx.query)
ctx.respond = false
})
router.get('*', async ctx => {
await handle(ctx.req, ctx.res)
ctx.respond = false
})
router.get('*', async ctx => {
await handle(ctx.req, ctx.res)
ctx.respond = false
})
server.use(async (ctx, next) => {
ctx.res.statusCode = 200
await next()
})
server.use(async (ctx, next) => {
ctx.res.statusCode = 200
await next()
})
server.use(router.routes())
server.listen(port, () => {
console.log(`> Ready on http://localhost:${port}`)
})
server.use(router.routes())
server.listen(port, () => {
console.log(`> Ready on http://localhost:${port}`)
})
})
......@@ -3,7 +3,15 @@ import Link from 'next/link'
export default () => (
<ul>
<li><Link href='/b' as='/a'><a>a</a></Link></li>
<li><Link href='/a' as='/b'><a>b</a></Link></li>
<li>
<Link href='/b' as='/a'>
<a>a</a>
</Link>
</li>
<li>
<Link href='/a' as='/b'>
<a>b</a>
</Link>
</li>
</ul>
)
......@@ -3,7 +3,15 @@ import Link from 'next/link'
export default () => (
<ul>
<li><Link href='/b' as='/a'><a>a</a></Link></li>
<li><Link href='/a' as='/b'><a>b</a></Link></li>
<li>
<Link href='/b' as='/a'>
<a>a</a>
</Link>
</li>
<li>
<Link href='/a' as='/b'>
<a>b</a>
</Link>
</li>
</ul>
)
......@@ -7,22 +7,20 @@ const dev = process.env.NODE_ENV !== 'production'
const app = next({ dev })
const handle = app.getRequestHandler()
app.prepare()
.then(() => {
createServer((req, res) => {
const parsedUrl = parse(req.url, true)
const { pathname, query } = parsedUrl
app.prepare().then(() => {
createServer((req, res) => {
const parsedUrl = parse(req.url, true)
const { pathname, query } = parsedUrl
if (pathname === '/a') {
app.render(req, res, '/b', query)
} else if (pathname === '/b') {
app.render(req, res, '/a', query)
} else {
handle(req, res, parsedUrl)
}
})
.listen(port, (err) => {
if (err) throw err
console.log(`> Ready on http://localhost:${port}`)
})
if (pathname === '/a') {
app.render(req, res, '/b', query)
} else if (pathname === '/b') {
app.render(req, res, '/a', query)
} else {
handle(req, res, parsedUrl)
}
}).listen(port, err => {
if (err) throw err
console.log(`> Ready on http://localhost:${port}`)
})
})
......@@ -3,7 +3,15 @@ import Link from 'next/link'
export default () => (
<ul>
<li><Link href='/b' as='/a'><a>a</a></Link></li>
<li><Link href='/a' as='/b'><a>b</a></Link></li>
<li>
<Link href='/b' as='/a'>
<a>a</a>
</Link>
</li>
<li>
<Link href='/a' as='/b'>
<a>b</a>
</Link>
</li>
</ul>
)
......@@ -7,22 +7,20 @@ const dev = process.env.NODE_ENV !== 'production'
const app = next({ dev })
const handle = app.getRequestHandler()
app.prepare()
.then(() => {
createServer((req, res) => {
const parsedUrl = parse(req.url, true)
const { pathname, query } = parsedUrl
app.prepare().then(() => {
createServer((req, res) => {
const parsedUrl = parse(req.url, true)
const { pathname, query } = parsedUrl
if (pathname === '/a') {
app.render(req, res, '/b', query)
} else if (pathname === '/b') {
app.render(req, res, '/a', query)
} else {
handle(req, res, parsedUrl)
}
})
.listen(port, (err) => {
if (err) throw err
console.log(`> Ready on http://localhost:${port}`)
})
if (pathname === '/a') {
app.render(req, res, '/b', query)
} else if (pathname === '/b') {
app.render(req, res, '/a', query)
} else {
handle(req, res, parsedUrl)
}
}).listen(port, err => {
if (err) throw err
console.log(`> Ready on http://localhost:${port}`)
})
})
......@@ -14,7 +14,9 @@ export default class Index extends React.Component {
return (
<div>
<p>Next.js has {this.props.stars} ⭐️</p>
<Link prefetch href='/preact'><a>How about preact?</a></Link>
<Link prefetch href='/preact'>
<a>How about preact?</a>
</Link>
</div>
)
}
......
......@@ -14,7 +14,9 @@ export default class Preact extends React.Component {
return (
<div>
<p>Preact has {this.props.stars} ⭐️</p>
<Link prefetch href='/'><a>I bet next has more stars (?)</a></Link>
<Link prefetch href='/'>
<a>I bet next has more stars (?)</a>
</Link>
</div>
)
}
......
import { INPUT_VALUE } from '../constants'
export const inputChange = (title, name, val) => dispatch => {
return dispatch({type: INPUT_VALUE, title, name, val})
return dispatch({ type: INPUT_VALUE, title, name, val })
}
import React, {Component} from 'react'
import React, { Component } from 'react'
import { Col, Row } from 'react-bootstrap'
import { connect } from 'react-redux'
......@@ -9,7 +9,7 @@ class DisplayForm extends Component {
<div>
<Row>
<Col lg={8} lgOffset={2}>
<pre>{JSON.stringify(state, null, 2) }</pre>
<pre>{JSON.stringify(state, null, 2)}</pre>
</Col>
</Row>
</div>
......
......@@ -6,7 +6,7 @@ const Header = () => {
<Row style={{ marginTop: '10px' }}>
<Col lg={8} lgOffset={2}>
<Jumbotron style={{ borderRadius: '15px' }}>
<h1 style={{textAlign: 'center'}}>Form Handler</h1>
<h1 style={{ textAlign: 'center' }}>Form Handler</h1>
</Jumbotron>
</Col>
</Row>
......
......@@ -16,7 +16,12 @@ const UserForm = () => {
<Input controlLabel='Email' type='email' title='user' name='email' />
</Col>
<Col lg={8} lgOffset={4}>
<Input controlLabel='Password' type='password' title='user' name='password' />
<Input
controlLabel='Password'
type='password'
title='user'
name='password'
/>
</Col>
</Row>
</div>
......
import React, {Component} from 'react'
import React, { Component } from 'react'
import Head from 'next/head'
import { Col, Row } from 'react-bootstrap'
......@@ -14,7 +14,10 @@ class Main extends Component {
<div>
<Head>
<title>Form Handler</title>
<link rel='stylesheet' href='https://maxcdn.bootstrapcdn.com/bootstrap/latest/css/bootstrap.min.css' />
<link
rel='stylesheet'
href='https://maxcdn.bootstrapcdn.com/bootstrap/latest/css/bootstrap.min.css'
/>
</Head>
<Header />
<DisplayForm />
......
import React, {Component} from 'react'
import React, { Component } from 'react'
import { FormGroup, ControlLabel, FormControl } from 'react-bootstrap'
import { connect } from 'react-redux'
import { bindActionCreators } from 'redux'
......@@ -6,7 +6,7 @@ import { bindActionCreators } from 'redux'
import { inputChange } from '../actions'
class Input extends Component {
inputChange = (e) => {
inputChange = e => {
const { inputChange, title, name } = this.props
inputChange(title, name, e.target.value)
}
......@@ -35,4 +35,7 @@ const mapDispatchToProps = dispatch => {
}
}
export default connect(null, mapDispatchToProps)(Input)
export default connect(
null,
mapDispatchToProps
)(Input)
......@@ -3,11 +3,9 @@ import { INPUT_VALUE } from '../constants'
export default (state = {}, action) => {
switch (action.type) {
case INPUT_VALUE:
return { ...state,
[action.title]:
{ ...state[action.title],
[action.name]: action.val
}
return {
...state,
[action.title]: { ...state[action.title], [action.name]: action.val }
}
default:
return state
......
......@@ -5,7 +5,8 @@ const dev = process.env.NODE_ENV !== 'production'
const app = next({ dev })
const handle = app.getRequestHandler()
app.prepare()
app
.prepare()
.then(() => {
const server = express()
......@@ -17,12 +18,12 @@ app.prepare()
return handle(req, res)
})
server.listen(3000, (err) => {
server.listen(3000, err => {
if (err) throw err
console.log('> Ready on http://localhost:3000')
})
})
.catch((ex) => {
.catch(ex => {
console.error(ex.stack)
process.exit(1)
})
const env = require('./env-config')
module.exports = {
'presets': [
'next/babel'
],
'plugins': [
['transform-define', env]
]
presets: ['next/babel'],
plugins: [['transform-define', env]]
}
......@@ -2,6 +2,11 @@ import Link from 'next/link'
export default () => (
<div>
<div>About us</div>
<div>Back to <Link href='/' as={process.env.BACKEND_URL + '/'}><a>Home</a></Link></div>
<div>
Back to{' '}
<Link href='/' as={process.env.BACKEND_URL + '/'}>
<a>Home</a>
</Link>
</div>
</div>
)
import Link from 'next/link'
export default () => (
<div>Hello World. <Link href='/about' as={process.env.BACKEND_URL + '/about'}><a>About</a></Link></div>
<div>
Hello World.{' '}
<Link href='/about' as={process.env.BACKEND_URL + '/about'}>
<a>About</a>
</Link>
</div>
)
export default () => (
<div>About us</div>
)
export default () => <div>About us</div>
export default () => (
<div>Hello Day</div>
)
export default () => <div>Hello Day</div>
import Link from 'next/link'
export default () => (
<div>Hello World. <Link href='/about'><a>About</a></Link></div>
<div>
Hello World.{' '}
<Link href='/about'>
<a>About</a>
</Link>
</div>
)
......@@ -4,22 +4,28 @@ import Head from 'next/head'
export default ({ children, title = 'This is the default title' }) => (
<div>
<Head>
<title>{ title }</title>
<title>{title}</title>
<meta charSet='utf-8' />
<meta name='viewport' content='initial-scale=1.0, width=device-width' />
</Head>
<header>
<nav>
<Link href='/'><a>Home</a></Link> |
<Link href='/about'><a>About</a></Link> |
<Link href='/contact'><a>Contact</a></Link>
<Link href='/'>
<a>Home</a>
</Link>{' '}
|
<Link href='/about'>
<a>About</a>
</Link>{' '}
|
<Link href='/contact'>
<a>Contact</a>
</Link>
</nav>
</header>
{ children }
{children}
<footer>
{'I`m here to stay'}
</footer>
<footer>{'I`m here to stay'}</footer>
</div>
)
export default ({ title, children }) => (
<div className='main'>
<h1>{ title }</h1>
{ children }
<h1>{title}</h1>
{children}
<style jsx>{`
.main {
font: 15px Helvetica, Arial;
......
......@@ -37,7 +37,7 @@ export default () => (
}
hr::before {
content: "***";
content: '***';
color: #ccc;
}
`}</style>
......
......@@ -5,8 +5,9 @@ export default dynamic({
BarChart: import('recharts').then(({ BarChart }) => BarChart),
Bar: import('recharts').then(({ Bar }) => Bar)
}),
render: (props, { BarChart, Bar }) =>
render: (props, { BarChart, Bar }) => (
<BarChart width={props.width} height={props.height} data={props.data}>
<Bar dataKey='uv' fill='#8884d8' />
</BarChart>
)
})
......@@ -5,8 +5,9 @@ export default dynamic({
LineChart: import('recharts').then(({ LineChart }) => LineChart),
Line: import('recharts').then(({ Line }) => Line)
}),
render: (props, { LineChart, Line }) =>
render: (props, { LineChart, Line }) => (
<LineChart width={props.width} height={props.height} data={props.data}>
<Line type='monotone' dataKey='uv' stroke='#8884d8' />
</LineChart>
)
})
......@@ -2,13 +2,13 @@ import React from 'react'
import BarChart from '../components/BarChart'
const data = [
{name: 'Page A', uv: 4000, pv: 2400, amt: 2400},
{name: 'Page B', uv: 3000, pv: 1398, amt: 2210},
{name: 'Page C', uv: 2000, pv: 9800, amt: 2290},
{name: 'Page D', uv: 2780, pv: 3908, amt: 2000},
{name: 'Page E', uv: 1890, pv: 4800, amt: 2181},
{name: 'Page F', uv: 2390, pv: 3800, amt: 2500},
{name: 'Page G', uv: 3490, pv: 4300, amt: 2100}
{ name: 'Page A', uv: 4000, pv: 2400, amt: 2400 },
{ name: 'Page B', uv: 3000, pv: 1398, amt: 2210 },
{ name: 'Page C', uv: 2000, pv: 9800, amt: 2290 },
{ name: 'Page D', uv: 2780, pv: 3908, amt: 2000 },
{ name: 'Page E', uv: 1890, pv: 4800, amt: 2181 },
{ name: 'Page F', uv: 2390, pv: 3800, amt: 2500 },
{ name: 'Page G', uv: 3490, pv: 4300, amt: 2100 }
]
const Chart = () => (
......
......@@ -3,13 +3,13 @@ import Link from 'next/link'
import LineChart from '../components/LineChart'
const data = [
{name: 'Page A', uv: 1000, pv: 2400, amt: 2400},
{name: 'Page B', uv: 3000, pv: 1398, amt: 2210},
{name: 'Page C', uv: 2000, pv: 9800, amt: 2290},
{name: 'Page D', uv: 2780, pv: 3908, amt: 2000},
{name: 'Page E', uv: 1890, pv: 4800, amt: 2181},
{name: 'Page F', uv: 2390, pv: 3800, amt: 2500},
{name: 'Page G', uv: 3490, pv: 4300, amt: 2100}
{ name: 'Page A', uv: 1000, pv: 2400, amt: 2400 },
{ name: 'Page B', uv: 3000, pv: 1398, amt: 2210 },
{ name: 'Page C', uv: 2000, pv: 9800, amt: 2290 },
{ name: 'Page D', uv: 2780, pv: 3908, amt: 2000 },
{ name: 'Page E', uv: 1890, pv: 4800, amt: 2181 },
{ name: 'Page F', uv: 2390, pv: 3800, amt: 2500 },
{ name: 'Page G', uv: 3490, pv: 4300, amt: 2100 }
]
const Index = () => (
......
......@@ -6,12 +6,14 @@ export default class extends React.Component {
}
render () {
return <div>
<h1>My {this.props.id} blog post</h1>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua.
</p>
</div>
return (
<div>
<h1>My {this.props.id} blog post</h1>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
eiusmod tempor incididunt ut labore et dolore magna aliqua.
</p>
</div>
)
}
}
......@@ -2,8 +2,20 @@ import Link from 'next/link'
export default () => (
<ul>
<li><Link href='/blog?id=first' as='/blog/first'><a>My first blog post</a></Link></li>
<li><Link href='/blog?id=second' as='/blog/second'><a>My second blog post</a></Link></li>
<li><Link href='/blog?id=last' as='/blog/last'><a>My last blog post</a></Link></li>
<li>
<Link href='/blog?id=first' as='/blog/first'>
<a>My first blog post</a>
</Link>
</li>
<li>
<Link href='/blog?id=second' as='/blog/second'>
<a>My second blog post</a>
</Link>
</li>
<li>
<Link href='/blog?id=last' as='/blog/last'>
<a>My last blog post</a>
</Link>
</li>
</ul>
)
......@@ -10,22 +10,20 @@ const handle = app.getRequestHandler()
const route = pathMatch()
const match = route('/blog/:id')
app.prepare()
.then(() => {
createServer((req, res) => {
const { pathname, query } = parse(req.url, true)
const params = match(pathname)
if (params === false) {
handle(req, res)
return
}
// assigning `query` into the params means that we still
// get the query string passed to our application
// i.e. /blog/foo?show-comments=true
app.render(req, res, '/blog', Object.assign(params, query))
})
.listen(port, (err) => {
if (err) throw err
console.log(`> Ready on http://localhost:${port}`)
})
app.prepare().then(() => {
createServer((req, res) => {
const { pathname, query } = parse(req.url, true)
const params = match(pathname)
if (params === false) {
handle(req, res)
return
}
// assigning `query` into the params means that we still
// get the query string passed to our application
// i.e. /blog/foo?show-comments=true
app.render(req, res, '/blog', Object.assign(params, query))
}).listen(port, err => {
if (err) throw err
console.log(`> Ready on http://localhost:${port}`)
})
})
......@@ -3,6 +3,10 @@ import Link from 'next/link'
export default () => (
<ul>
<li><Link href='/item'><a>View Item</a></Link></li>
<li>
<Link href='/item'>
<a>View Item</a>
</Link>
</li>
</ul>
)
import {Component} from 'react'
import { Component } from 'react'
import Link from 'next/link'
import fetch from 'isomorphic-unfetch'
......@@ -15,7 +15,9 @@ export default class extends Component {
return { item: query.itemData }
} else {
// On the client, we should fetch the data remotely
const res = await fetch('/_data/item', {headers: {'Accept': 'application/json'}})
const res = await fetch('/_data/item', {
headers: { Accept: 'application/json' }
})
const json = await res.json()
return { item: json }
}
......@@ -24,9 +26,15 @@ export default class extends Component {
render () {
return (
<div className='item'>
<div><Link href='/'><a>Back Home</a></Link></div>
<div>
<Link href='/'>
<a>Back Home</a>
</Link>
</div>
<h1>{this.props.item.title}</h1>
<h2>{this.props.item.subtitle} - {this.props.item.seller}</h2>
<h2>
{this.props.item.subtitle} - {this.props.item.seller}
</h2>
</div>
)
}
......
......@@ -32,7 +32,7 @@ app.prepare().then(() => {
return handle(req, res)
})
server.listen(3000, (err) => {
server.listen(3000, err => {
if (err) throw err
console.log('> Ready on http://localhost:3000')
})
......
......@@ -5,9 +5,7 @@ import Loading from '../components/Loading'
export default () => (
<main>
<section>
<h1>
This section is server-side rendered.
</h1>
<h1>This section is server-side rendered.</h1>
</section>
<NoSSR onSSR={<Loading />}>
......
export default () => (
<ul>
<li><a href='/robots.txt'>/robots.txt</a></li>
<li><a href='/sitemap.xml'>/sitemap.xml</a></li>
<li><a href='/favicon.ico'>/favicon.ico</a></li>
<li>
<a href='/robots.txt'>/robots.txt</a>
</li>
<li>
<a href='/sitemap.xml'>/sitemap.xml</a>
</li>
<li>
<a href='/favicon.ico'>/favicon.ico</a>
</li>
</ul>
)
......@@ -8,24 +8,18 @@ const dev = process.env.NODE_ENV !== 'production'
const app = next({ dev })
const handle = app.getRequestHandler()
app.prepare()
.then(() => {
createServer((req, res) => {
const parsedUrl = parse(req.url, true)
const rootStaticFiles = [
'/robots.txt',
'/sitemap.xml',
'/favicon.ico'
]
if (rootStaticFiles.indexOf(parsedUrl.pathname) > -1) {
const path = join(__dirname, 'static', parsedUrl.pathname)
app.serveStatic(req, res, path)
} else {
handle(req, res, parsedUrl)
}
})
.listen(port, (err) => {
if (err) throw err
console.log(`> Ready on http://localhost:${port}`)
})
app.prepare().then(() => {
createServer((req, res) => {
const parsedUrl = parse(req.url, true)
const rootStaticFiles = ['/robots.txt', '/sitemap.xml', '/favicon.ico']
if (rootStaticFiles.indexOf(parsedUrl.pathname) > -1) {
const path = join(__dirname, 'static', parsedUrl.pathname)
app.serveStatic(req, res, path)
} else {
handle(req, res, parsedUrl)
}
}).listen(port, err => {
if (err) throw err
console.log(`> Ready on http://localhost:${port}`)
})
})
......@@ -3,11 +3,11 @@ import Link from 'next/link'
export default () => (
<div>
<Link href='/'>
<a style={styles.a} >Home</a>
<a style={styles.a}>Home</a>
</Link>
<Link href='/about'>
<a style={styles.a} >About</a>
<a style={styles.a}>About</a>
</Link>
</div>
)
......
......@@ -6,12 +6,14 @@ export default class extends React.Component {
}
render () {
return <div>
<h1>My {this.props.id} blog post</h1>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua.
</p>
</div>
return (
<div>
<h1>My {this.props.id} blog post</h1>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
eiusmod tempor incididunt ut labore et dolore magna aliqua.
</p>
</div>
)
}
}
......@@ -2,8 +2,20 @@ import Link from 'next/link'
export default () => (
<ul>
<li><Link href='/blog?id=first' as='/blog/first'><a>My first blog post</a></Link></li>
<li><Link href='/blog?id=second' as='/blog/second'><a>My second blog post</a></Link></li>
<li><Link href='/blog?id=last' as='/blog/last'><a>My last blog post</a></Link></li>
<li>
<Link href='/blog?id=first' as='/blog/first'>
<a>My first blog post</a>
</Link>
</li>
<li>
<Link href='/blog?id=second' as='/blog/second'>
<a>My second blog post</a>
</Link>
</li>
<li>
<Link href='/blog?id=last' as='/blog/last'>
<a>My last blog post</a>
</Link>
</li>
</ul>
)
......@@ -16,29 +16,28 @@ const ssrCache = new LRUCache({
maxAge: 1000 * 60 * 60 // 1hour
})
app.prepare()
.then(() => {
const server = express()
app.prepare().then(() => {
const server = express()
// Use the `renderAndCache` utility defined below to serve pages
server.get('/', (req, res) => {
renderAndCache(req, res, '/')
})
// Use the `renderAndCache` utility defined below to serve pages
server.get('/', (req, res) => {
renderAndCache(req, res, '/')
})
server.get('/blog/:id', (req, res) => {
const queryParams = { id: req.params.id }
renderAndCache(req, res, '/blog', queryParams)
})
server.get('/blog/:id', (req, res) => {
const queryParams = { id: req.params.id }
renderAndCache(req, res, '/blog', queryParams)
})
server.get('*', (req, res) => {
return handle(req, res)
})
server.get('*', (req, res) => {
return handle(req, res)
})
server.listen(port, (err) => {
if (err) throw err
console.log(`> Ready on http://localhost:${port}`)
})
server.listen(port, err => {
if (err) throw err
console.log(`> Ready on http://localhost:${port}`)
})
})
/*
* NB: make sure to modify this to take into account anything that should trigger
......
......@@ -7,7 +7,7 @@ module.exports = {
}
config.resolve.alias = {
'react': 'inferno-compat',
react: 'inferno-compat',
'react-dom': 'inferno-compat'
}
return config
......
import React from 'react'
export default () => (
<div>About us</div>
)
export default () => <div>About us</div>
......@@ -2,5 +2,10 @@ import React from 'react'
import Link from 'next/link'
export default () => (
<div>Hello World. <Link prefetch href='/about'><a>About</a></Link></div>
<div>
Hello World.{' '}
<Link prefetch href='/about'>
<a>About</a>
</Link>
</div>
)
......@@ -17,14 +17,12 @@ const next = require('next')
const app = next({ dev })
const handle = app.getRequestHandler()
app.prepare()
.then(() => {
createServer((req, res) => {
const parsedUrl = parse(req.url, true)
handle(req, res, parsedUrl)
})
.listen(port, (err) => {
if (err) throw err
console.log(`> Ready on http://localhost:${port}`)
})
app.prepare().then(() => {
createServer((req, res) => {
const parsedUrl = parse(req.url, true)
handle(req, res, parsedUrl)
}).listen(port, err => {
if (err) throw err
console.log(`> Ready on http://localhost:${port}`)
})
})
import React from 'react'
export default () => (
<div>About us</div>
)
export default () => <div>About us</div>
......@@ -2,5 +2,10 @@ import React from 'react'
import Link from 'next/link'
export default () => (
<div>Hello World. <Link href='/about'><a>About</a></Link></div>
<div>
Hello World.{' '}
<Link href='/about'>
<a>About</a>
</Link>
</div>
)
......@@ -16,14 +16,12 @@ const next = require('next')
const app = next({ dev })
const handle = app.getRequestHandler()
app.prepare()
.then(() => {
createServer((req, res) => {
const parsedUrl = parse(req.url, true)
handle(req, res, parsedUrl)
})
.listen(port, (err) => {
if (err) throw err
console.log(`> Ready on http://localhost:${port}`)
})
app.prepare().then(() => {
createServer((req, res) => {
const parsedUrl = parse(req.url, true)
handle(req, res, parsedUrl)
}).listen(port, err => {
if (err) throw err
console.log(`> Ready on http://localhost:${port}`)
})
})
import React from 'react'
export default () => (
<div>About us</div>
)
export default () => <div>About us</div>
......@@ -2,5 +2,10 @@ import React from 'react'
import Link from 'next/link'
export default () => (
<div>Hello World. <Link href='/about'><a>About</a></Link></div>
<div>
Hello World.{' '}
<Link href='/about'>
<a>About</a>
</Link>
</div>
)
......@@ -10,14 +10,12 @@ const next = require('next')
const app = next({ dev })
const handle = app.getRequestHandler()
app.prepare()
.then(() => {
createServer((req, res) => {
const parsedUrl = parse(req.url, true)
handle(req, res, parsedUrl)
})
.listen(port, (err) => {
if (err) throw err
console.log(`> Ready on http://localhost:${port}`)
})
app.prepare().then(() => {
createServer((req, res) => {
const parsedUrl = parse(req.url, true)
handle(req, res, parsedUrl)
}).listen(port, err => {
if (err) throw err
console.log(`> Ready on http://localhost:${port}`)
})
})
......@@ -13,7 +13,7 @@ export default () => (
// and use it manually
function onClickHandler (href) {
return (e) => {
return e => {
e.preventDefault()
Router.push(href)
}
......
import {Component} from 'react'
import { Component } from 'react'
import Header from '../components/Header'
import Router from 'next/router'
......
......@@ -10,7 +10,7 @@ const ActiveLink = ({ children, router, href }) => {
color: router.pathname === href ? 'red' : 'black'
}
const handleClick = (e) => {
const handleClick = e => {
e.preventDefault()
router.push(href)
}
......
import {Component} from 'react'
import { Component } from 'react'
import Header from '../components/Header'
import Router from 'next/router'
......
......@@ -10,7 +10,7 @@ import {
} from 'react-instantsearch/dom'
import { InstantSearch } from './instantsearch'
const HitComponent = ({ hit }) =>
const HitComponent = ({ hit }) => (
<div className='hit'>
<div>
<div className='hit-picture'>
......@@ -20,12 +20,8 @@ const HitComponent = ({ hit }) =>
<div className='hit-content'>
<div>
<Highlight attributeName='name' hit={hit} />
<span>
{' '}- ${hit.price}
</span>
<span>
{' '}- {hit.rating} stars
</span>
<span> - ${hit.price}</span>
<span> - {hit.rating} stars</span>
</div>
<div className='hit-type'>
<Highlight attributeName='type' hit={hit} />
......@@ -35,6 +31,7 @@ const HitComponent = ({ hit }) =>
</div>
</div>
</div>
)
HitComponent.propTypes = {
hit: PropTypes.object
......@@ -45,7 +42,7 @@ export default class extends React.Component {
searchState: PropTypes.object,
resultsState: PropTypes.oneOfType([PropTypes.object, PropTypes.array]),
onSearchStateChange: PropTypes.func
};
}
render () {
return (
......
......@@ -6,7 +6,7 @@ const defaultDescription = ''
const defaultOGURL = ''
const defaultOGImage = ''
export const Head = props =>
export const Head = props => (
<NextHead>
<meta charSet='UTF-8' />
<title>{props.title || ''}</title>
......@@ -37,6 +37,7 @@ export const Head = props =>
/>
<link rel='stylesheet' href='../static/instantsearch.css' />
</NextHead>
)
Head.propTypes = {
title: string,
......
......@@ -13,7 +13,7 @@ export default class extends React.Component {
static propTypes = {
resultsState: PropTypes.object,
searchState: PropTypes.object
};
}
constructor (props) {
super(props)
......@@ -42,7 +42,7 @@ export default class extends React.Component {
})
}, updateAfter)
this.setState({ searchState })
};
}
componentDidMount () {
this.setState({ searchState: qs.parse(window.location.search.slice(1)) })
......
export default ({ author }) => (
<div className='byline'>
By {author}
</div>
)
export default ({ author }) => <div className='byline'>By {author}</div>
......@@ -8,8 +8,14 @@ export default class MyDocument extends Document {
<Head>
<link rel='canonical' href='/' />
<meta name='viewport' content='width=device-width,minimum-scale=1' />
<link rel='stylesheet' href='https://fonts.googleapis.com/css?family=Roboto' />
<style amp-boilerplate=''>{`body{-webkit-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 8s steps(1,end) 0s 1 normal both;animation:-amp-start 8s steps(1,end) 0s 1 normal both}@-webkit-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-moz-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-ms-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-o-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}`}</style><noscript><style amp-boilerplate=''>{`body{-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}`}</style></noscript>
<link
rel='stylesheet'
href='https://fonts.googleapis.com/css?family=Roboto'
/>
<style amp-boilerplate=''>{`body{-webkit-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 8s steps(1,end) 0s 1 normal both;animation:-amp-start 8s steps(1,end) 0s 1 normal both}@-webkit-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-moz-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-ms-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-o-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}`}</style>
<noscript>
<style amp-boilerplate=''>{`body{-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}`}</style>
</noscript>
<style amp-custom=''>{`body {font-family: Roboto, sans-serif; padding: 30px; color: #444;} h1 {margin-bottom: 5px;} .byline { color: #aaa; margin-bottom: 25px; } p {font-size: 18px; line-height: 30px; margin-top: 30px;} .caption {color: #ccc; margin-top: 0; font-size: 14px; text-align: center;}`}</style>
<script async src='https://cdn.ampproject.org/v0.js' />
</Head>
......
......@@ -8,12 +8,76 @@ export default () => (
</Head>
<h1>The Dog</h1>
<Byline author='Meow Meow Fuzzyface' />
<amp-img src='/static/dog.jpg' width='470' height='350' layout='responsive' alt='Woof' />
<amp-img
src='/static/dog.jpg'
width='470'
height='350'
layout='responsive'
alt='Woof'
/>
<p className='caption'>Woooooooooooof</p>
<p>Wafer donut candy soufflé lemon drops icing. Marzipan gummi bears pie danish lollipop pudding powder gummi bears sweet. Pie sweet roll sweet roll topping chocolate bar dragée pudding chocolate cake. Croissant sweet chocolate bar cheesecake candy canes. Tootsie roll icing macaroon bonbon cupcake apple pie candy canes biscuit candy canes. Jujubes jelly liquorice toffee gingerbread. Candy tootsie roll macaroon chocolate bar icing sugar plum pie. Icing gummies chocolate bar chocolate marzipan bonbon cookie chocolate tart. Caramels danish halvah croissant. Cheesecake cookie tootsie roll ice cream. Powder dessert carrot cake muffin tiramisu lemon drops liquorice topping brownie. Soufflé chocolate cake croissant cupcake jelly.</p>
<p>Muffin gummies dessert cheesecake candy canes. Candy canes danish cotton candy tart dessert powder bear claw marshmallow. Muffin chocolate marshmallow danish. Chocolate bar biscuit cake tiramisu. Topping sweet brownie jujubes powder marzipan. Croissant wafer bonbon chupa chups cake cake marzipan caramels jujubes. Cupcake cheesecake sweet roll marshmallow lollipop danish jujubes jelly icing. Apple pie chupa chups lollipop jelly-o cheesecake jelly beans cake dessert. Tootsie roll tootsie roll bonbon pastry croissant gummi bears cake cake. Fruitcake sugar plum halvah gingerbread cookie pastry chupa chups wafer lemon drops. Marshmallow liquorice oat cake lollipop. Lemon drops oat cake halvah liquorice danish powder cupcake soufflé. Cake tart topping jelly-o tart sugar plum. Chocolate bar cookie wafer tootsie roll candy cotton candy toffee pie donut.</p>
<p>Ice cream lollipop marshmallow tiramisu jujubes croissant. Bear claw lemon drops marzipan candy bonbon cupcake powder. Candy canes cheesecake bear claw pastry cake donut jujubes. Icing tart jelly-o soufflé bonbon apple pie. Cheesecake pie chupa chups toffee powder. Bonbon lemon drops carrot cake pudding candy halvah cheesecake lollipop cupcake. Pudding marshmallow fruitcake. Gummi bears bonbon chupa chups lemon drops. Wafer dessert gummies gummi bears biscuit donut tiramisu gummi bears brownie. Tootsie roll liquorice bonbon cookie. Sesame snaps chocolate bar cake croissant chupa chups cheesecake gingerbread tiramisu jelly. Cheesecake ice cream muffin lollipop gummies. Sesame snaps jelly beans sweet bear claw tart.</p>
<p>Sweet topping chupa chups chocolate cake jelly-o liquorice danish. Pastry jelly beans apple pie dessert pastry lemon drops marzipan gummies. Jelly beans macaroon bear claw cotton candy. Toffee sweet lollipop toffee oat cake. Jelly-o oat cake fruitcake chocolate bar sweet. Lemon drops gummies chocolate cake lollipop bear claw croissant danish icing. Chocolate bar donut brownie chocolate cake lemon drops chocolate bar. Cake fruitcake pudding chocolate apple pie. Brownie tiramisu chocolate macaroon lemon drops wafer soufflé jujubes icing. Cheesecake tiramisu cake macaroon tart lollipop donut. Gummi bears dragée pudding bear claw. Muffin cake cupcake candy canes. Soufflé candy canes biscuit. Macaroon gummies danish.</p>
<p>Cupcake cupcake tart. Cotton candy danish candy canes oat cake ice cream candy canes powder wafer. Chocolate sesame snaps oat cake dragée cheesecake. Sesame snaps marshmallow topping liquorice cookie marshmallow. Liquorice pudding chocolate bar. Cake powder brownie fruitcake. Carrot cake dessert marzipan sugar plum cupcake cheesecake pastry. Apple pie macaroon ice cream fruitcake apple pie cookie. Tootsie roll ice cream oat cake cheesecake donut cheesecake bear claw. Sesame snaps marzipan jelly beans chocolate tootsie roll. Chocolate bar donut dragée ice cream biscuit. Pie candy canes muffin candy canes ice cream tiramisu.</p>
<p>
Wafer donut candy soufflé lemon drops icing. Marzipan gummi bears pie
danish lollipop pudding powder gummi bears sweet. Pie sweet roll sweet
roll topping chocolate bar dragée pudding chocolate cake. Croissant sweet
chocolate bar cheesecake candy canes. Tootsie roll icing macaroon bonbon
cupcake apple pie candy canes biscuit candy canes. Jujubes jelly liquorice
toffee gingerbread. Candy tootsie roll macaroon chocolate bar icing sugar
plum pie. Icing gummies chocolate bar chocolate marzipan bonbon cookie
chocolate tart. Caramels danish halvah croissant. Cheesecake cookie
tootsie roll ice cream. Powder dessert carrot cake muffin tiramisu lemon
drops liquorice topping brownie. Soufflé chocolate cake croissant cupcake
jelly.
</p>
<p>
Muffin gummies dessert cheesecake candy canes. Candy canes danish cotton
candy tart dessert powder bear claw marshmallow. Muffin chocolate
marshmallow danish. Chocolate bar biscuit cake tiramisu. Topping sweet
brownie jujubes powder marzipan. Croissant wafer bonbon chupa chups cake
cake marzipan caramels jujubes. Cupcake cheesecake sweet roll marshmallow
lollipop danish jujubes jelly icing. Apple pie chupa chups lollipop
jelly-o cheesecake jelly beans cake dessert. Tootsie roll tootsie roll
bonbon pastry croissant gummi bears cake cake. Fruitcake sugar plum halvah
gingerbread cookie pastry chupa chups wafer lemon drops. Marshmallow
liquorice oat cake lollipop. Lemon drops oat cake halvah liquorice danish
powder cupcake soufflé. Cake tart topping jelly-o tart sugar plum.
Chocolate bar cookie wafer tootsie roll candy cotton candy toffee pie
donut.
</p>
<p>
Ice cream lollipop marshmallow tiramisu jujubes croissant. Bear claw lemon
drops marzipan candy bonbon cupcake powder. Candy canes cheesecake bear
claw pastry cake donut jujubes. Icing tart jelly-o soufflé bonbon apple
pie. Cheesecake pie chupa chups toffee powder. Bonbon lemon drops carrot
cake pudding candy halvah cheesecake lollipop cupcake. Pudding marshmallow
fruitcake. Gummi bears bonbon chupa chups lemon drops. Wafer dessert
gummies gummi bears biscuit donut tiramisu gummi bears brownie. Tootsie
roll liquorice bonbon cookie. Sesame snaps chocolate bar cake croissant
chupa chups cheesecake gingerbread tiramisu jelly. Cheesecake ice cream
muffin lollipop gummies. Sesame snaps jelly beans sweet bear claw tart.
</p>
<p>
Sweet topping chupa chups chocolate cake jelly-o liquorice danish. Pastry
jelly beans apple pie dessert pastry lemon drops marzipan gummies. Jelly
beans macaroon bear claw cotton candy. Toffee sweet lollipop toffee oat
cake. Jelly-o oat cake fruitcake chocolate bar sweet. Lemon drops gummies
chocolate cake lollipop bear claw croissant danish icing. Chocolate bar
donut brownie chocolate cake lemon drops chocolate bar. Cake fruitcake
pudding chocolate apple pie. Brownie tiramisu chocolate macaroon lemon
drops wafer soufflé jujubes icing. Cheesecake tiramisu cake macaroon tart
lollipop donut. Gummi bears dragée pudding bear claw. Muffin cake cupcake
candy canes. Soufflé candy canes biscuit. Macaroon gummies danish.
</p>
<p>
Cupcake cupcake tart. Cotton candy danish candy canes oat cake ice cream
candy canes powder wafer. Chocolate sesame snaps oat cake dragée
cheesecake. Sesame snaps marshmallow topping liquorice cookie marshmallow.
Liquorice pudding chocolate bar. Cake powder brownie fruitcake. Carrot
cake dessert marzipan sugar plum cupcake cheesecake pastry. Apple pie
macaroon ice cream fruitcake apple pie cookie. Tootsie roll ice cream oat
cake cheesecake donut cheesecake bear claw. Sesame snaps marzipan jelly
beans chocolate tootsie roll. Chocolate bar donut dragée ice cream
biscuit. Pie candy canes muffin candy canes ice cream tiramisu.
</p>
</div>
)
This diff is collapsed.
......@@ -6,21 +6,17 @@ const path = require('path')
// Where your antd-custom.less file lives
const themeVariables = lessToJS(
fs.readFileSync(
path.resolve(__dirname, './assets/antd-custom.less'),
'utf8'
)
fs.readFileSync(path.resolve(__dirname, './assets/antd-custom.less'), 'utf8')
)
// fix: prevents error when .less files are required by node
if (typeof require !== 'undefined') {
require.extensions['.less'] = (file) => {}
require.extensions['.less'] = file => {}
}
module.exports = withLess({
lessLoaderOptions: {
javascriptEnabled: true,
modifyVars: themeVariables // make your antd custom effective
},
}
})
import { Form, Select, InputNumber, DatePicker, Switch, Slider, Button } from 'antd'
import {
Form,
Select,
InputNumber,
DatePicker,
Switch,
Slider,
Button
} from 'antd'
const FormItem = Form.Item
const Option = Select.Option
......@@ -11,35 +19,37 @@ export default () => (
labelCol={{ span: 8 }}
wrapperCol={{ span: 8 }}
>
<InputNumber size='large' min={1} max={10} style={{ width: 100 }} defaultValue={3} name='inputNumber' />
<InputNumber
size='large'
min={1}
max={10}
style={{ width: 100 }}
defaultValue={3}
name='inputNumber'
/>
<a href='#'>Link</a>
</FormItem>
<FormItem
label='Switch'
labelCol={{ span: 8 }}
wrapperCol={{ span: 8 }}
>
<FormItem label='Switch' labelCol={{ span: 8 }} wrapperCol={{ span: 8 }}>
<Switch defaultChecked name='switch' />
</FormItem>
<FormItem
label='Slider'
labelCol={{ span: 8 }}
wrapperCol={{ span: 8 }}
>
<FormItem label='Slider' labelCol={{ span: 8 }} wrapperCol={{ span: 8 }}>
<Slider defaultValue={70} />
</FormItem>
<FormItem
label='Select'
labelCol={{ span: 8 }}
wrapperCol={{ span: 8 }}
>
<Select size='large' defaultValue='lucy' style={{ width: 192 }} name='select'>
<FormItem label='Select' labelCol={{ span: 8 }} wrapperCol={{ span: 8 }}>
<Select
size='large'
defaultValue='lucy'
style={{ width: 192 }}
name='select'
>
<Option value='jack'>jack</Option>
<Option value='lucy'>lucy</Option>
<Option value='disabled' disabled>disabled</Option>
<Option value='disabled' disabled>
disabled
</Option>
<Option value='yiminghe'>yiminghe</Option>
</Select>
</FormItem>
......@@ -51,15 +61,12 @@ export default () => (
>
<DatePicker name='startDate' />
</FormItem>
<FormItem
style={{ marginTop: 48 }}
wrapperCol={{ span: 8, offset: 8 }}
>
<FormItem style={{ marginTop: 48 }} wrapperCol={{ span: 8, offset: 8 }}>
<Button size='large' type='primary' htmlType='submit'>
OK
OK
</Button>
<Button size='large' style={{ marginLeft: 8 }}>
Cancel
Cancel
</Button>
</FormItem>
</Form>
......
......@@ -3,7 +3,7 @@ const withCss = require('@zeit/next-css')
// fix: prevents error when .css files are required by node
if (typeof require !== 'undefined') {
require.extensions['.css'] = (file) => {}
require.extensions['.css'] = file => {}
}
module.exports = withCss()
import { Form, Select, InputNumber, DatePicker, Switch, Slider, Button } from 'antd'
import {
Form,
Select,
InputNumber,
DatePicker,
Switch,
Slider,
Button
} from 'antd'
const FormItem = Form.Item
const Option = Select.Option
......@@ -11,35 +19,37 @@ export default () => (
labelCol={{ span: 8 }}
wrapperCol={{ span: 8 }}
>
<InputNumber size='large' min={1} max={10} style={{ width: 100 }} defaultValue={3} name='inputNumber' />
<InputNumber
size='large'
min={1}
max={10}
style={{ width: 100 }}
defaultValue={3}
name='inputNumber'
/>
<a href='#'>Link</a>
</FormItem>
<FormItem
label='Switch'
labelCol={{ span: 8 }}
wrapperCol={{ span: 8 }}
>
<FormItem label='Switch' labelCol={{ span: 8 }} wrapperCol={{ span: 8 }}>
<Switch defaultChecked name='switch' />
</FormItem>
<FormItem
label='Slider'
labelCol={{ span: 8 }}
wrapperCol={{ span: 8 }}
>
<FormItem label='Slider' labelCol={{ span: 8 }} wrapperCol={{ span: 8 }}>
<Slider defaultValue={70} />
</FormItem>
<FormItem
label='Select'
labelCol={{ span: 8 }}
wrapperCol={{ span: 8 }}
>
<Select size='large' defaultValue='lucy' style={{ width: 192 }} name='select'>
<FormItem label='Select' labelCol={{ span: 8 }} wrapperCol={{ span: 8 }}>
<Select
size='large'
defaultValue='lucy'
style={{ width: 192 }}
name='select'
>
<Option value='jack'>jack</Option>
<Option value='lucy'>lucy</Option>
<Option value='disabled' disabled>disabled</Option>
<Option value='disabled' disabled>
disabled
</Option>
<Option value='yiminghe'>yiminghe</Option>
</Select>
</FormItem>
......@@ -51,15 +61,12 @@ export default () => (
>
<DatePicker name='startDate' />
</FormItem>
<FormItem
style={{ marginTop: 48 }}
wrapperCol={{ span: 8, offset: 8 }}
>
<FormItem style={{ marginTop: 48 }} wrapperCol={{ span: 8, offset: 8 }}>
<Button size='large' type='primary' htmlType='submit'>
OK
OK
</Button>
<Button size='large' style={{ marginLeft: 8 }}>
Cancel
Cancel
</Button>
</FormItem>
</Form>
......
......@@ -26,8 +26,6 @@ export default withRouter(({ router, children, title }) => (
position: relative;
}
`}</style>
<WingBlank>
{children}
</WingBlank>
<WingBlank>{children}</WingBlank>
</div>
))
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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