diff options
author | fragosti <francesco.agosti93@gmail.com> | 2018-11-29 08:36:52 +0800 |
---|---|---|
committer | fragosti <francesco.agosti93@gmail.com> | 2018-11-29 08:36:52 +0800 |
commit | 76259352229881287a94cb561f82498920de5443 (patch) | |
tree | 09bd604f3d9fb3ef941618e25747b01cbae38133 /packages | |
parent | 8b05db35104bf6853bdec81b2a1f25b16914608f (diff) | |
download | dexon-0x-contracts-76259352229881287a94cb561f82498920de5443.tar.gz dexon-0x-contracts-76259352229881287a94cb561f82498920de5443.tar.zst dexon-0x-contracts-76259352229881287a94cb561f82498920de5443.zip |
feat: write version info directly to exported object
Diffstat (limited to 'packages')
-rw-r--r-- | packages/instant/README.md | 6 | ||||
-rw-r--r-- | packages/instant/src/index.umd.ts | 7 | ||||
-rw-r--r-- | packages/instant/src/util/version.ts | 8 |
3 files changed, 7 insertions, 14 deletions
diff --git a/packages/instant/README.md b/packages/instant/README.md index 0fb4dfe62..a38e4f85c 100644 --- a/packages/instant/README.md +++ b/packages/instant/README.md @@ -20,7 +20,7 @@ The package is available as a UMD module named `zeroExInstant`. ## Deploying -You can deploy a work-in-progress version of 0x Instant at http://0x-instant-dogfood.s3-website-us-east-1.amazonaws.com for easy sharing. +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 @@ -28,7 +28,7 @@ To build and deploy the bundle run yarn deploy_dogfood ``` -We also have a staging bucket that is to be updated less frequently can be used to share a beta version of instant externally: http://0x-instant-staging.s3-website-us-east-1.amazonaws.com/ +We also have a staging bucket that is to be updated less frequently can be used to share a beta version of instant externally: http://0x-instant-staging.s3-website-us-east-1.amazonaws.com/instant.js To build and deploy to this bundle, run @@ -36,7 +36,7 @@ To build and deploy to this bundle, run yarn deploy_staging ``` -Finally, we have our live production bundle that is only meant to be updated with stable, polished releases. +Finally, we have our live production bundle that is only meant to be updated with stable, polished releases: https://instant.0xproject.com/instant.js To build and deploy to this bundle, run diff --git a/packages/instant/src/index.umd.ts b/packages/instant/src/index.umd.ts index 063874d36..45369d9ee 100644 --- a/packages/instant/src/index.umd.ts +++ b/packages/instant/src/index.umd.ts @@ -6,9 +6,6 @@ import { DEFAULT_ZERO_EX_CONTAINER_SELECTOR, INJECTED_DIV_CLASS, INJECTED_DIV_ID import { ZeroExInstantOverlay, ZeroExInstantOverlayProps } from './index'; import { assert } from './util/assert'; import { util } from './util/util'; -import { versionUtil } from './util/version'; - -versionUtil.writeVersionInfoToWindow(); const isInstantRendered = (): boolean => !!document.getElementById(INJECTED_DIV_ID); @@ -113,3 +110,7 @@ export const render = (config: ZeroExInstantConfig, selector: string = DEFAULT_Z }; window.onpopstate = onPopStateHandler; }; + +// Write version info to the exported object for debugging +export const GitSha = process.env.GIT_SHA; +export const NpmVersion = process.env.NPM_PACKAGE_VERSION; diff --git a/packages/instant/src/util/version.ts b/packages/instant/src/util/version.ts deleted file mode 100644 index 5264cd659..000000000 --- a/packages/instant/src/util/version.ts +++ /dev/null @@ -1,8 +0,0 @@ -const anyWindow = window as any; - -export const versionUtil = { - writeVersionInfoToWindow: () => { - anyWindow.__zeroExInstantGitSha = process.env.GIT_SHA; - anyWindow.__zeroExInstantNpmVersion = process.env.NPM_PACKAGE_VERSION; - }, -}; |