Use Now 2.0 for building and deployment (#611)

main
Timothy 6 years ago committed by Michael Fix
parent 18eae4acfc
commit 5f369876d7

@ -0,0 +1,8 @@
.github
LICENSE
README.md
bin
node_modules
cypress
cypress.json
docs

@ -1,13 +0,0 @@
# Source: https://github.com/zeit/now-static-build-starter/blob/master/Dockerfile
FROM mhart/alpine-node:10
# We store all our files in /usr/src to perform the build
WORKDIR /usr/src
# We first add only the files required for installing deps
# If package.json or yarn.lock don't change, no need to re-install later
COPY package.json yarn.lock ./
# We install our deps
RUN yarn
# We copy all source files
COPY . .
# We run the build and expose as /public
RUN yarn build && yarn export -o /public

@ -1,14 +1,21 @@
{ {
"name": "carbon", "name": "carbon",
"type": "static", "version": 2,
"public": true, "public": true,
"static": { "builds": [
"rewrites": [ { "src": "package.json", "use": "@now/static-build" }
{ ],
"source": "!/?(about)?(embed)", "routes": [
"destination": "/index.html" { "src": "^/about(.*)", "dest": "/about" },
} { "src": "^/embed(.*)", "dest": "/embed" },
] { "src": "^/_next/(.*)", "dest": "/_next/$1" },
{ "src": "^/static/(.*)", "dest": "/static/$1" },
{ "src": "^/(.*)", "dest": "/index.html" }
],
"build": {
"env": {
"NODE_ENV": "production"
}
}, },
"github": { "github": {
"autoAlias": false "autoAlias": false

@ -15,13 +15,15 @@
"contrib:add": "all-contributors add", "contrib:add": "all-contributors add",
"contrib:build": "all-contributors generate", "contrib:build": "all-contributors generate",
"cy:run": "cypress run", "cy:run": "cypress run",
"cy:open": "cypress open" "cy:open": "cypress open",
"now-build": "cross-env NODE_ENV=production yarn build && yarn export -o dist"
}, },
"dependencies": { "dependencies": {
"axios": "^0.18.0", "axios": "^0.18.0",
"codemirror": "^5.40.2", "codemirror": "^5.40.2",
"codemirror-graphql": "0.7.1", "codemirror-graphql": "0.7.1",
"codemirror-mode-elixir": "^1.1.1", "codemirror-mode-elixir": "^1.1.1",
"cross-env": "^5.2.0",
"dom-to-image": "^2.5.2", "dom-to-image": "^2.5.2",
"downshift": "^3.1.4", "downshift": "^3.1.4",
"dropperx": "0.2.1", "dropperx": "0.2.1",
@ -34,6 +36,7 @@
"ms": "^2.0.0", "ms": "^2.0.0",
"next": "^7.0.2", "next": "^7.0.2",
"next-offline": "^3.0.3", "next-offline": "^3.0.3",
"prettier": "^1.14.3",
"react": "^16.6.0", "react": "^16.6.0",
"react-addons-shallow-compare": "^15.6.2", "react-addons-shallow-compare": "^15.6.2",
"react-click-outside": "^3.0.0", "react-click-outside": "^3.0.0",
@ -60,8 +63,7 @@
"hex2rgb": "^2.2.0", "hex2rgb": "^2.2.0",
"husky": "^1.1.2", "husky": "^1.1.2",
"lint-staged": "^7.3.0", "lint-staged": "^7.3.0",
"now": "^11.4.6", "now": "^11.4.6"
"prettier": "^1.14.3"
}, },
"lint-staged": { "lint-staged": {
"*.js": [ "*.js": [

@ -2078,6 +2078,14 @@ create-hmac@^1.1.0, create-hmac@^1.1.2, create-hmac@^1.1.4:
safe-buffer "^5.0.1" safe-buffer "^5.0.1"
sha.js "^2.4.8" sha.js "^2.4.8"
cross-env@^5.2.0:
version "5.2.0"
resolved "https://registry.npmjs.org/cross-env/-/cross-env-5.2.0.tgz#6ecd4c015d5773e614039ee529076669b9d126f2"
integrity sha512-jtdNFfFW1hB7sMhr/H6rW1Z45LFqyI431m3qU6bFXcQ3Eh7LtBuG3h74o7ohHZ3crrRkkqHlo4jYHFPcjroANg==
dependencies:
cross-spawn "^6.0.5"
is-windows "^1.0.0"
cross-fetch@2.2.2: cross-fetch@2.2.2:
version "2.2.2" version "2.2.2"
resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-2.2.2.tgz#a47ff4f7fc712daba8f6a695a11c948440d45723" resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-2.2.2.tgz#a47ff4f7fc712daba8f6a695a11c948440d45723"
@ -3903,7 +3911,7 @@ is-typedarray@~1.0.0:
resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a"
integrity sha1-5HnICFjfDBsR3dppQPlgEfzaSpo= integrity sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=
is-windows@^1.0.2: is-windows@^1.0.0, is-windows@^1.0.2:
version "1.0.2" version "1.0.2"
resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d"
integrity sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA== integrity sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==
@ -5300,9 +5308,9 @@ prelude-ls@~1.1.2:
resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54"
integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ= integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=
prettier@^1.14.3: prettier@1.14.3:
version "1.14.3" version "1.14.3"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.14.3.tgz#90238dd4c0684b7edce5f83b0fb7328e48bd0895" resolved "https://registry.npmjs.org/prettier/-/prettier-1.14.3.tgz#90238dd4c0684b7edce5f83b0fb7328e48bd0895"
integrity sha512-qZDVnCrnpsRJJq5nSsiHCE3BYMED2OtsI+cmzIzF1QIfqm5ALf8tEJcO27zV1gKNKRPdhjO0dNWnrzssDQ1tFg== integrity sha512-qZDVnCrnpsRJJq5nSsiHCE3BYMED2OtsI+cmzIzF1QIfqm5ALf8tEJcO27zV1gKNKRPdhjO0dNWnrzssDQ1tFg==
pretty-bytes@^4.0.2: pretty-bytes@^4.0.2:

Loading…
Cancel
Save