From faf80f85959ce157435f3bd500b00fd33e828084 Mon Sep 17 00:00:00 2001 From: fragosti Date: Mon, 26 Nov 2018 17:37:03 -0500 Subject: feat: make package private --- packages/instant/package.json | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'packages') diff --git a/packages/instant/package.json b/packages/instant/package.json index d3a85a646..af23af3b9 100644 --- a/packages/instant/package.json +++ b/packages/instant/package.json @@ -5,13 +5,10 @@ "node": ">=6.12" }, "description": "0x Instant React Component", - "main": "lib/index.js", - "types": "lib/index.d.ts", + "main": "umd/instant.js", + "private": true, "scripts": { - "build": "yarn build:all", - "build:all": "run-p build:umd:prod build:commonjs", - "build:umd:prod": "webpack --mode production", - "build:commonjs": "tsc -b", + "build": "webpack --mode production", "build:ci": "yarn build", "watch_without_deps": "tsc -w", "dev": "webpack-dev-server --mode development", @@ -98,6 +95,6 @@ "webpack-dev-server": "^3.1.9" }, "publishConfig": { - "access": "public" + "access": "private" } } -- cgit v1.2.3 From 35d8525f5563e877752fd1bd9e5a5c7ffa395b78 Mon Sep 17 00:00:00 2001 From: fragosti Date: Mon, 26 Nov 2018 17:37:21 -0500 Subject: feat: update README to reflect lack of commonjs module --- packages/instant/README.md | 30 +----------------------------- 1 file changed, 1 insertion(+), 29 deletions(-) (limited to 'packages') diff --git a/packages/instant/README.md b/packages/instant/README.md index b83a10508..fd94d37d1 100644 --- a/packages/instant/README.md +++ b/packages/instant/README.md @@ -2,35 +2,7 @@ ## Installation -```bash -yarn add @0x/instant -``` - -**Import** - -**CommonJS module** - -```typescript -import { ZeroExInstant } from '@0x/instant'; -``` - -or - -```javascript -var ZeroExInstant = require('@0x/instant').ZeroExInstant; -``` - -If your project is in [TypeScript](https://www.typescriptlang.org/), add the following to your `tsconfig.json`: - -```json -"compilerOptions": { - "typeRoots": ["node_modules/@0x/typescript-typings/types", "node_modules/@types"], -} -``` - -**UMD Module** - -The package is also available as a UMD module named `zeroExInstant`. +The package is available as a UMD module named `zeroExInstant`. ```html -- cgit v1.2.3 From 5415d1589e922dc689eaa9ec64ab830f3fd46af4 Mon Sep 17 00:00:00 2001 From: fragosti Date: Wed, 28 Nov 2018 10:58:41 -0800 Subject: feat: write version info to window --- packages/instant/src/index.umd.ts | 3 +++ packages/instant/src/util/version.ts | 8 ++++++++ 2 files changed, 11 insertions(+) create mode 100644 packages/instant/src/util/version.ts (limited to 'packages') diff --git a/packages/instant/src/index.umd.ts b/packages/instant/src/index.umd.ts index 3a8694d6a..063874d36 100644 --- a/packages/instant/src/index.umd.ts +++ b/packages/instant/src/index.umd.ts @@ -6,6 +6,9 @@ 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); diff --git a/packages/instant/src/util/version.ts b/packages/instant/src/util/version.ts new file mode 100644 index 000000000..5264cd659 --- /dev/null +++ b/packages/instant/src/util/version.ts @@ -0,0 +1,8 @@ +const anyWindow = window as any; + +export const versionUtil = { + writeVersionInfoToWindow: () => { + anyWindow.__zeroExInstantGitSha = process.env.GIT_SHA; + anyWindow.__zeroExInstantNpmVersion = process.env.NPM_PACKAGE_VERSION; + }, +}; -- cgit v1.2.3 From 8b05db35104bf6853bdec81b2a1f25b16914608f Mon Sep 17 00:00:00 2001 From: fragosti Date: Wed, 28 Nov 2018 11:07:32 -0800 Subject: feat: add deploy_live command --- packages/instant/.production.discharge.json | 13 +++++++++++++ packages/instant/README.md | 14 +++++++++++--- packages/instant/package.json | 1 + 3 files changed, 25 insertions(+), 3 deletions(-) create mode 100644 packages/instant/.production.discharge.json (limited to 'packages') diff --git a/packages/instant/.production.discharge.json b/packages/instant/.production.discharge.json new file mode 100644 index 000000000..447fa1756 --- /dev/null +++ b/packages/instant/.production.discharge.json @@ -0,0 +1,13 @@ +{ + "domain": "instant.0xproject.com", + "build_command": "yarn build", + "upload_directory": "umd", + "index_key": "instant.js", + "error_key": "404.html", + "trailing_slashes": true, + "cache": 3600, + "aws_profile": "default", + "aws_region": "us-east-1", + "cdn": true, + "dns_configured": true +} diff --git a/packages/instant/README.md b/packages/instant/README.md index fd94d37d1..0fb4dfe62 100644 --- a/packages/instant/README.md +++ b/packages/instant/README.md @@ -22,20 +22,28 @@ The package is available as a UMD module named `zeroExInstant`. 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. -To build and deploy the site run +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 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/ -To build and deploy to this bucket, run +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. + +To build and deploy to this bundle, run + +``` +yarn deploy_live +``` + **NOTE: On deploying the site, it will say the site is available at a non-existent URL. Please ignore and use the (now updated) URL above.** ## Contributing diff --git a/packages/instant/package.json b/packages/instant/package.json index af23af3b9..427d5984e 100644 --- a/packages/instant/package.json +++ b/packages/instant/package.json @@ -20,6 +20,7 @@ "clean": "shx rm -rf lib coverage scripts", "deploy_dogfood": "discharge deploy -c .dogfood.discharge.json", "deploy_staging": "discharge deploy -c .staging.discharge.json", + "deploy_live": "discharge deploy -c .production.discharge.json", "manual:postpublish": "yarn build; node ./scripts/postpublish.js" }, "config": { -- cgit v1.2.3 From 76259352229881287a94cb561f82498920de5443 Mon Sep 17 00:00:00 2001 From: fragosti Date: Wed, 28 Nov 2018 16:36:52 -0800 Subject: feat: write version info directly to exported object --- packages/instant/README.md | 6 +++--- packages/instant/src/index.umd.ts | 7 ++++--- packages/instant/src/util/version.ts | 8 -------- 3 files changed, 7 insertions(+), 14 deletions(-) delete mode 100644 packages/instant/src/util/version.ts (limited to 'packages') 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; - }, -}; -- cgit v1.2.3 From b55f7aef7f508debf190d6a09b81023493925481 Mon Sep 17 00:00:00 2001 From: fragosti Date: Wed, 28 Nov 2018 16:38:21 -0800 Subject: feat: add URL to other parts of README --- packages/instant/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'packages') diff --git a/packages/instant/README.md b/packages/instant/README.md index a38e4f85c..fece84d2a 100644 --- a/packages/instant/README.md +++ b/packages/instant/README.md @@ -2,11 +2,11 @@ ## Installation -The package is available as a UMD module named `zeroExInstant`. +The package is available as a UMD module named `zeroExInstant` at https://instant.0xproject.com/instant.js. ```html - +
-- cgit v1.2.3 From 42e83ae643bbcb04d9c9ccf4c9eca476d055f47a Mon Sep 17 00:00:00 2001 From: fragosti Date: Wed, 28 Nov 2018 16:39:27 -0800 Subject: fix: add clarification to NOTE in README --- packages/instant/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages') diff --git a/packages/instant/README.md b/packages/instant/README.md index fece84d2a..c6621cbed 100644 --- a/packages/instant/README.md +++ b/packages/instant/README.md @@ -44,7 +44,7 @@ To build and deploy to this bundle, run yarn deploy_live ``` -**NOTE: On deploying the site, it will say the site is available at a non-existent URL. Please ignore and use the (now updated) URL above.** +**NOTE: On deploying the site to staging and dogfood, it will say the site is available at a non-existent URL. Please ignore and use the (now updated) URL above.** ## Contributing -- cgit v1.2.3 From 09813cb1d83da4c571cf69a448c35c5f6af94dec Mon Sep 17 00:00:00 2001 From: fragosti Date: Fri, 30 Nov 2018 11:20:07 -0800 Subject: fix: address PR feedback --- packages/instant/.dogfood.discharge.json | 2 +- packages/instant/.staging.discharge.json | 2 +- packages/instant/package.json | 1 - packages/instant/src/index.umd.ts | 4 ++-- packages/instant/webpack.config.js | 3 --- 5 files changed, 4 insertions(+), 8 deletions(-) (limited to 'packages') diff --git a/packages/instant/.dogfood.discharge.json b/packages/instant/.dogfood.discharge.json index ca36b3861..85a48044b 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:umd:prod", + "build_command": "WEBPACK_OUTPUT_PATH=public yarn build", "upload_directory": "public", "index_key": "index.html", "error_key": "index.html", diff --git a/packages/instant/.staging.discharge.json b/packages/instant/.staging.discharge.json index c917a650b..93fd94f40 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:umd:prod", + "build_command": "WEBPACK_OUTPUT_PATH=public yarn build", "upload_directory": "public", "index_key": "index.html", "error_key": "index.html", diff --git a/packages/instant/package.json b/packages/instant/package.json index 427d5984e..4c26d2dae 100644 --- a/packages/instant/package.json +++ b/packages/instant/package.json @@ -10,7 +10,6 @@ "scripts": { "build": "webpack --mode production", "build:ci": "yarn build", - "watch_without_deps": "tsc -w", "dev": "webpack-dev-server --mode development", "lint": "tslint --format stylish --project .", "test": "jest", diff --git a/packages/instant/src/index.umd.ts b/packages/instant/src/index.umd.ts index 45369d9ee..95080f829 100644 --- a/packages/instant/src/index.umd.ts +++ b/packages/instant/src/index.umd.ts @@ -112,5 +112,5 @@ export const render = (config: ZeroExInstantConfig, selector: string = DEFAULT_Z }; // Write version info to the exported object for debugging -export const GitSha = process.env.GIT_SHA; -export const NpmVersion = process.env.NPM_PACKAGE_VERSION; +export const GIT_SHA = process.env.GIT_SHA; +export const NPM_VERSION = process.env.NPM_PACKAGE_VERSION; diff --git a/packages/instant/webpack.config.js b/packages/instant/webpack.config.js index 41276809c..2a517bb59 100644 --- a/packages/instant/webpack.config.js +++ b/packages/instant/webpack.config.js @@ -3,9 +3,6 @@ const ip = require('ip'); const path = require('path'); const webpack = require('webpack'); -// The common js bundle (not this one) is built using tsc. -// The umd bundle (this one) has a different entrypoint. - const GIT_SHA = childProcess .execSync('git rev-parse HEAD') .toString() -- cgit v1.2.3 From a7fc5975c1fe1d82d9250f0849e17b4764260176 Mon Sep 17 00:00:00 2001 From: fragosti Date: Fri, 30 Nov 2018 11:28:26 -0800 Subject: feat: update tsconfig --- packages/instant/tsconfig.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'packages') diff --git a/packages/instant/tsconfig.json b/packages/instant/tsconfig.json index 14b0ad8f7..21bd3b821 100644 --- a/packages/instant/tsconfig.json +++ b/packages/instant/tsconfig.json @@ -7,6 +7,5 @@ "noImplicitAny": true, "allowSyntheticDefaultImports": true }, - "include": ["./src/**/*"], - "exclude": ["./src/index.umd.ts"] + "include": ["./src/**/*"] } -- cgit v1.2.3 From d6ba7298d45d60d204b556a3b29e91d253a0824a Mon Sep 17 00:00:00 2001 From: fragosti Date: Fri, 30 Nov 2018 11:59:59 -0800 Subject: chore: deploy_live -> deploy_production --- packages/instant/README.md | 2 +- packages/instant/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'packages') diff --git a/packages/instant/README.md b/packages/instant/README.md index c6621cbed..45a871124 100644 --- a/packages/instant/README.md +++ b/packages/instant/README.md @@ -41,7 +41,7 @@ Finally, we have our live production bundle that is only meant to be updated wit To build and deploy to this bundle, run ``` -yarn deploy_live +yarn deploy_production ``` **NOTE: On deploying the site to staging and dogfood, it will say the site is available at a non-existent URL. Please ignore and use the (now updated) URL above.** diff --git a/packages/instant/package.json b/packages/instant/package.json index 4c26d2dae..cfd681cc9 100644 --- a/packages/instant/package.json +++ b/packages/instant/package.json @@ -19,7 +19,7 @@ "clean": "shx rm -rf lib coverage scripts", "deploy_dogfood": "discharge deploy -c .dogfood.discharge.json", "deploy_staging": "discharge deploy -c .staging.discharge.json", - "deploy_live": "discharge deploy -c .production.discharge.json", + "deploy_production": "discharge deploy -c .production.discharge.json", "manual:postpublish": "yarn build; node ./scripts/postpublish.js" }, "config": { -- cgit v1.2.3 From fc2055cd93a5e847947dad10073dd0d29bfb9e29 Mon Sep 17 00:00:00 2001 From: fragosti Date: Fri, 30 Nov 2018 12:26:59 -0800 Subject: feat: remove instant from project references --- packages/instant/tsconfig.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'packages') diff --git a/packages/instant/tsconfig.json b/packages/instant/tsconfig.json index 21bd3b821..2b3c11c9f 100644 --- a/packages/instant/tsconfig.json +++ b/packages/instant/tsconfig.json @@ -5,7 +5,10 @@ "rootDir": "src", "jsx": "react", "noImplicitAny": true, - "allowSyntheticDefaultImports": true + "allowSyntheticDefaultImports": true, + "declaration": false, + "declarationMap": false, + "composite": false }, "include": ["./src/**/*"] } -- cgit v1.2.3