Merge pull request #1364 from 0xProject/feature/instant/allow-env-vars-in-env-file

[instant] Add dotenv to make env dependencies more explicit
This commit is contained in:
Francesco Agosti
2018-12-03 10:32:51 -08:00
committed by GitHub
9 changed files with 27 additions and 8 deletions

View File

@@ -1,6 +1,6 @@
{
"domain": "0x-instant-dogfood",
"build_command": "WEBPACK_OUTPUT_PATH=public yarn build --env.discharge_target=dogfood",
"build_command": "WEBPACK_OUTPUT_PATH=public dotenv yarn build --env.discharge_target=dogfood",
"upload_directory": "public",
"index_key": "index.html",
"error_key": "index.html",

View File

@@ -0,0 +1,4 @@
INSTANT_ROLLBAR_PUBLISH_TOKEN=
INSTANT_ROLLBAR_CLIENT_TOKEN=
INSTANT_HEAP_ANALYTICS_ID_PRODUCTION=
INSTANT_HEAP_ANALYTICS_ID_DEVELOPMENT=

View File

@@ -1,3 +1,4 @@
public/instant.js
public/instant.js.map
umd/*
umd/*
.env

View File

@@ -2,4 +2,5 @@
*
*/
!lib/**/*
!umd/**/*
!umd/**/*
.env

View File

@@ -1,6 +1,6 @@
{
"domain": "instant.0xproject.com",
"build_command": "yarn build --env.discharge_target=production",
"build_command": "dotenv yarn build --env.discharge_target=production",
"upload_directory": "umd",
"index_key": "instant.js",
"error_key": "404.html",

View File

@@ -1,6 +1,6 @@
{
"domain": "0x-instant-staging",
"build_command": "WEBPACK_OUTPUT_PATH=public yarn build --env.discharge_target=staging",
"build_command": "dotenv WEBPACK_OUTPUT_PATH=public yarn build --env.discharge_target=staging",
"upload_directory": "public",
"index_key": "index.html",
"error_key": "index.html",

View File

@@ -20,6 +20,8 @@ The package is available as a UMD module named `zeroExInstant` at https://instan
## Deploying
To run any of the following commands you need to configure your `.env` file. There is an example `.env_example` file to show you what values are required.
You can deploy a work-in-progress version of 0x Instant at http://0x-instant-dogfood.s3-website-us-east-1.amazonaws.com/instant.js for easy sharing.
To build and deploy the bundle run

View File

@@ -7,7 +7,6 @@
"private": true,
"description": "0x Instant React Component",
"main": "umd/instant.js",
"private": true,
"scripts": {
"build": "webpack --mode production",
"build:ci": "yarn build",
@@ -25,7 +24,10 @@
},
"config": {
"postpublish": {
"assets": ["packages/instant/umd/instant.js", "packages/instant/umd/instant.js.map"]
"assets": [
"packages/instant/umd/instant.js",
"packages/instant/umd/instant.js.map"
]
}
},
"repository": {
@@ -75,6 +77,7 @@
"@types/redux": "^3.6.0",
"@types/styled-components": "^4.0.1",
"awesome-typescript-loader": "^5.2.1",
"dotenv-cli": "^1.4.0",
"enzyme": "^3.6.0",
"enzyme-adapter-react-16": "^1.5.0",
"ip": "^1.1.5",

View File

@@ -4520,7 +4520,7 @@ cross-fetch@^2.1.0:
node-fetch "2.1.1"
whatwg-fetch "2.0.3"
cross-spawn@^4:
cross-spawn@^4, cross-spawn@^4.0.0:
version "4.0.2"
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-4.0.2.tgz#7b9247621c23adfdd3856004a823cbe397424d41"
dependencies:
@@ -5279,6 +5279,14 @@ dot-prop@^4.1.0, dot-prop@^4.2.0:
dependencies:
is-obj "^1.0.0"
dotenv-cli@^1.4.0:
version "1.4.0"
resolved "https://registry.npmjs.org/dotenv-cli/-/dotenv-cli-1.4.0.tgz#e8e80830ed88b48a03b5eb7ec26147ca717f7409"
dependencies:
cross-spawn "^4.0.0"
dotenv "^4.0.0"
minimist "^1.1.3"
dotenv@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-4.0.0.tgz#864ef1379aced55ce6f95debecdce179f7a0cd1d"