Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
6b7864e5
Commit
6b7864e5
authored
Dec 10, 2018
by
Tim Neutkens
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix linting
parent
616c3d7a
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
53 additions
and
52 deletions
+53
-52
next.config.js
examples/with-firebase-hosting-and-docker/next.config.js
+2
-2
App.js
...ith-firebase-hosting-and-docker/src/app/components/App.js
+8
-8
Header.js
...-firebase-hosting-and-docker/src/app/components/Header.js
+10
-10
about.js
...s/with-firebase-hosting-and-docker/src/app/pages/about.js
+3
-3
index.js
...s/with-firebase-hosting-and-docker/src/app/pages/index.js
+3
-3
index.js
...s/with-firebase-hosting-and-docker/src/functions/index.js
+21
-21
firebase.js
...firebase-hosting-and-docker/src/functions/lib/firebase.js
+4
-4
createRelayEnvironment.js
...relay-modern-server-express/lib/createRelayEnvironment.js
+1
-1
package.json
package.json
+1
-0
No files found.
examples/with-firebase-hosting-and-docker/next.config.js
View file @
6b7864e5
module
.
exports
=
{
module
.
exports
=
{
distDir
:
'../../dist/functions/next'
,
distDir
:
'../../dist/functions/next'
}
;
}
examples/with-firebase-hosting-and-docker/src/app/components/App.js
View file @
6b7864e5
import
React
from
'react'
;
import
React
from
'react'
import
PropTypes
from
'prop-types'
;
import
PropTypes
from
'prop-types'
import
Header
from
'./Header'
;
import
Header
from
'./Header'
const
propTypes
=
{
const
propTypes
=
{
children
:
PropTypes
.
element
,
children
:
PropTypes
.
element
}
;
}
const
App
=
({
children
})
=>
(
const
App
=
({
children
})
=>
(
<
main
>
<
main
>
<
Header
/>
<
Header
/>
{
children
}
{
children
}
<
/main
>
<
/main
>
)
;
)
App
.
propTypes
=
propTypes
;
App
.
propTypes
=
propTypes
export
default
App
;
export
default
App
examples/with-firebase-hosting-and-docker/src/app/components/Header.js
View file @
6b7864e5
import
React
from
'react'
;
import
React
from
'react'
import
PropTypes
from
'prop-types'
;
import
PropTypes
from
'prop-types'
import
Link
from
'next/link'
;
import
Link
from
'next/link'
const
propTypes
=
{
const
propTypes
=
{
pathname
:
PropTypes
.
String
,
pathname
:
PropTypes
.
String
}
;
}
const
Header
=
({
pathname
})
=>
(
const
Header
=
({
pathname
})
=>
(
<
header
>
<
header
>
<
Link
href
=
"/"
>
<
Link
href
=
'/'
>
<
a
className
=
{
pathname
===
'/'
?
'is-active'
:
''
}
>
Home
<
/a
>
<
a
className
=
{
pathname
===
'/'
?
'is-active'
:
''
}
>
Home
<
/a
>
<
/Link
>
<
/Link
>
<
span
>
-
<
/span
>
<
span
>
-
<
/span
>
<
Link
href
=
"/about"
>
<
Link
href
=
'/about'
>
<
a
className
=
{
pathname
===
'/about'
?
'is-active'
:
''
}
>
About
<
/a
>
<
a
className
=
{
pathname
===
'/about'
?
'is-active'
:
''
}
>
About
<
/a
>
<
/Link
>
<
/Link
>
<
/header
>
<
/header
>
)
;
)
Header
.
propTypes
=
propTypes
;
Header
.
propTypes
=
propTypes
export
default
Header
;
export
default
Header
examples/with-firebase-hosting-and-docker/src/app/pages/about.js
View file @
6b7864e5
import
*
as
React
from
'react'
;
import
*
as
React
from
'react'
import
App
from
'../components/App'
;
import
App
from
'../components/App'
export
default
()
=>
(
export
default
()
=>
(
<
App
>
<
App
>
<
p
>
About
Page
<
/p
>
<
p
>
About
Page
<
/p
>
<
/App
>
<
/App
>
)
;
)
examples/with-firebase-hosting-and-docker/src/app/pages/index.js
View file @
6b7864e5
import
*
as
React
from
'react'
;
import
*
as
React
from
'react'
import
App
from
'../components/App'
;
import
App
from
'../components/App'
export
default
()
=>
(
export
default
()
=>
(
<
App
>
<
App
>
<
p
>
Index
Page
<
/p
>
<
p
>
Index
Page
<
/p
>
<
/App
>
<
/App
>
)
;
)
examples/with-firebase-hosting-and-docker/src/functions/index.js
View file @
6b7864e5
/* eslint-disable import/no-unresolved,import/extensions */
/* eslint-disable import/no-unresolved,import/extensions */
import
next
from
'next'
;
import
next
from
'next'
import
express
from
'express'
;
import
express
from
'express'
import
compression
from
'compression'
;
import
compression
from
'compression'
import
helmet
from
'helmet'
;
import
helmet
from
'helmet'
import
cors
from
'cors'
;
import
cors
from
'cors'
import
bodyParser
from
'body-parser'
;
import
bodyParser
from
'body-parser'
import
{
functions
}
from
'./lib/firebase'
;
import
{
functions
}
from
'./lib/firebase'
const
nextApp
=
next
({
dev
:
false
,
conf
:
{
distDir
:
'next'
}
})
;
const
nextApp
=
next
({
dev
:
false
,
conf
:
{
distDir
:
'next'
}
})
const
handle
=
nextApp
.
getRequestHandler
()
;
const
handle
=
nextApp
.
getRequestHandler
()
const
server
=
express
()
;
const
server
=
express
()
server
.
disable
(
'x-powered-by'
)
;
server
.
disable
(
'x-powered-by'
)
server
.
use
(
cors
())
;
server
.
use
(
cors
())
server
.
use
(
bodyParser
.
json
())
;
server
.
use
(
bodyParser
.
json
())
server
.
set
(
'trust proxy'
,
1
)
;
server
.
set
(
'trust proxy'
,
1
)
server
.
use
(
compression
())
;
server
.
use
(
compression
())
server
.
use
(
helmet
())
;
server
.
use
(
helmet
())
server
.
get
(
'*'
,
(
req
,
res
)
=>
handle
(
req
,
res
))
;
server
.
get
(
'*'
,
(
req
,
res
)
=>
handle
(
req
,
res
))
const
app
=
functions
.
https
.
onRequest
(
async
(
req
,
res
)
=>
{
const
app
=
functions
.
https
.
onRequest
(
async
(
req
,
res
)
=>
{
await
nextApp
.
prepare
()
;
await
nextApp
.
prepare
()
return
server
(
req
,
res
)
;
return
server
(
req
,
res
)
})
;
})
export
{
app
}
;
export
{
app
}
examples/with-firebase-hosting-and-docker/src/functions/lib/firebase.js
View file @
6b7864e5
import
admin
from
'firebase-admin'
;
import
admin
from
'firebase-admin'
import
*
as
functions
from
'firebase-functions'
;
import
*
as
functions
from
'firebase-functions'
export
{
functions
}
;
export
{
functions
}
export
const
firebase
=
admin
.
initializeApp
()
;
export
const
firebase
=
admin
.
initializeApp
()
examples/with-relay-modern-server-express/lib/createRelayEnvironment.js
View file @
6b7864e5
...
@@ -9,7 +9,7 @@ function fetchQuery (
...
@@ -9,7 +9,7 @@ function fetchQuery (
operation
,
operation
,
variables
,
variables
,
cacheConfig
,
cacheConfig
,
uploadables
,
uploadables
)
{
)
{
// Because we implement the graphql server, the client must to point to the same host
// Because we implement the graphql server, the client must to point to the same host
const
relayServer
=
process
.
browser
?
''
:
process
.
env
.
RELAY_SERVER
const
relayServer
=
process
.
browser
?
''
:
process
.
env
.
RELAY_SERVER
...
...
package.json
View file @
6b7864e5
...
@@ -14,6 +14,7 @@
...
@@ -14,6 +14,7 @@
"test"
:
"npm run testall || npm run testall"
,
"test"
:
"npm run testall || npm run testall"
,
"coveralls"
:
"cat ./test/coverage/lcov.info | coveralls"
,
"coveralls"
:
"cat ./test/coverage/lcov.info | coveralls"
,
"lint"
:
"lerna run typescript && standard && standard --parser typescript-eslint-parser --plugin typescript packages/**/*.ts"
,
"lint"
:
"lerna run typescript && standard && standard --parser typescript-eslint-parser --plugin typescript packages/**/*.ts"
,
"lint-fix"
:
"standard --fix && standard --fix --parser typescript-eslint-parser --plugin typescript packages/**/*.ts"
,
"typescript"
:
"lerna run typescript"
,
"typescript"
:
"lerna run typescript"
,
"prepublish"
:
"lerna run prepublish"
,
"prepublish"
:
"lerna run prepublish"
,
"publish-canary"
:
"lerna version prerelease --preid canary --force-publish"
,
"publish-canary"
:
"lerna version prerelease --preid canary --force-publish"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment