aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancesco Agosti <francesco.agosti93@gmail.com>2018-12-04 02:32:51 +0800
committerGitHub <noreply@github.com>2018-12-04 02:32:51 +0800
commit3662ab25246a53128d85e8427ebe07518245b611 (patch)
tree2f652e3be6d764ace2adb288a57b7bc073da93b1
parent57986c0e1e4f3fb79a78d13f09e5b55efa3b8547 (diff)
parent937235c4fd872912accfd33cf45afdebd3f372a7 (diff)
downloaddexon-0x-contracts-3662ab25246a53128d85e8427ebe07518245b611.tar.gz
dexon-0x-contracts-3662ab25246a53128d85e8427ebe07518245b611.tar.zst
dexon-0x-contracts-3662ab25246a53128d85e8427ebe07518245b611.zip
Merge pull request #1364 from 0xProject/feature/instant/allow-env-vars-in-env-file
[instant] Add dotenv to make env dependencies more explicit
-rw-r--r--packages/instant/.dogfood.discharge.json2
-rw-r--r--packages/instant/.env_example4
-rw-r--r--packages/instant/.gitignore3
-rw-r--r--packages/instant/.npmignore3
-rw-r--r--packages/instant/.production.discharge.json2
-rw-r--r--packages/instant/.staging.discharge.json2
-rw-r--r--packages/instant/README.md2
-rw-r--r--packages/instant/package.json7
-rw-r--r--yarn.lock10
9 files changed, 27 insertions, 8 deletions
diff --git a/packages/instant/.dogfood.discharge.json b/packages/instant/.dogfood.discharge.json
index b0e4edaff..5d6a09a16 100644
--- a/packages/instant/.dogfood.discharge.json
+++ b/packages/instant/.dogfood.discharge.json
@@ -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",
diff --git a/packages/instant/.env_example b/packages/instant/.env_example
new file mode 100644
index 000000000..ebbbebc06
--- /dev/null
+++ b/packages/instant/.env_example
@@ -0,0 +1,4 @@
+INSTANT_ROLLBAR_PUBLISH_TOKEN=
+INSTANT_ROLLBAR_CLIENT_TOKEN=
+INSTANT_HEAP_ANALYTICS_ID_PRODUCTION=
+INSTANT_HEAP_ANALYTICS_ID_DEVELOPMENT= \ No newline at end of file
diff --git a/packages/instant/.gitignore b/packages/instant/.gitignore
index a99cea187..2e65f192d 100644
--- a/packages/instant/.gitignore
+++ b/packages/instant/.gitignore
@@ -1,3 +1,4 @@
public/instant.js
public/instant.js.map
-umd/* \ No newline at end of file
+umd/*
+.env \ No newline at end of file
diff --git a/packages/instant/.npmignore b/packages/instant/.npmignore
index a4f7810c0..563923652 100644
--- a/packages/instant/.npmignore
+++ b/packages/instant/.npmignore
@@ -2,4 +2,5 @@
*
*/
!lib/**/*
-!umd/**/* \ No newline at end of file
+!umd/**/*
+.env \ No newline at end of file
diff --git a/packages/instant/.production.discharge.json b/packages/instant/.production.discharge.json
index 4aa5337ba..947f68b1a 100644
--- a/packages/instant/.production.discharge.json
+++ b/packages/instant/.production.discharge.json
@@ -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",
diff --git a/packages/instant/.staging.discharge.json b/packages/instant/.staging.discharge.json
index 56ffee4e9..bd5f28ba8 100644
--- a/packages/instant/.staging.discharge.json
+++ b/packages/instant/.staging.discharge.json
@@ -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",
diff --git a/packages/instant/README.md b/packages/instant/README.md
index 45a871124..2092b45d9 100644
--- a/packages/instant/README.md
+++ b/packages/instant/README.md
@@ -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
diff --git a/packages/instant/package.json b/packages/instant/package.json
index 62904949b..4daec883b 100644
--- a/packages/instant/package.json
+++ b/packages/instant/package.json
@@ -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",
diff --git a/yarn.lock b/yarn.lock
index dff01f1b9..80e070200 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -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"