aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfragosti <francesco.agosti93@gmail.com>2018-10-03 06:48:00 +0800
committerfragosti <francesco.agosti93@gmail.com>2018-10-03 06:48:00 +0800
commit2540660262313c2d53a2d38af190748857ba3f8d (patch)
tree51d59c5d458e785038282469c0941db00714a026
parent20f18c305495c0d9656bd0cbdfd322f60764c847 (diff)
downloaddexon-sol-tools-2540660262313c2d53a2d38af190748857ba3f8d.tar
dexon-sol-tools-2540660262313c2d53a2d38af190748857ba3f8d.tar.gz
dexon-sol-tools-2540660262313c2d53a2d38af190748857ba3f8d.tar.bz2
dexon-sol-tools-2540660262313c2d53a2d38af190748857ba3f8d.tar.lz
dexon-sol-tools-2540660262313c2d53a2d38af190748857ba3f8d.tar.xz
dexon-sol-tools-2540660262313c2d53a2d38af190748857ba3f8d.tar.zst
dexon-sol-tools-2540660262313c2d53a2d38af190748857ba3f8d.zip
Add dev environment
-rw-r--r--packages/instant/package.json14
-rw-r--r--packages/instant/src/index.ts2
-rw-r--r--packages/instant/tsconfig.json5
-rw-r--r--packages/instant/webpack.config.js12
-rw-r--r--yarn.lock143
5 files changed, 150 insertions, 26 deletions
diff --git a/packages/instant/package.json b/packages/instant/package.json
index 7f1530fa8..d33dfb7c3 100644
--- a/packages/instant/package.json
+++ b/packages/instant/package.json
@@ -8,19 +8,26 @@
"main": "lib/src/index.js",
"types": "lib/src/index.d.ts",
"scripts": {
+ "build": "yarn build:all",
+ "build:all": "run-p build:umd:prod build:commonjs",
+ "build:umd:prod": "webpack --mode production",
+ "build:commonjs": "tsc -b",
"watch_without_deps": "tsc -w",
+ "dev": "webpack-dev-server --mode development",
"lint": "tslint --project .",
"test": "jest",
"test:coverage": "jest --coverage",
"rebuild_and_test": "run-s clean build test",
"test:circleci": "yarn test:coverage",
"clean": "shx rm -rf lib coverage scripts",
- "build": "webpack --mode production && copyfiles -u 3 './lib/src/monorepo_scripts/**/*' ./scripts",
"manual:postpublish": "yarn build; node ./scripts/postpublish.js"
},
"config": {
"postpublish": {
- "assets": []
+ "assets": [
+ "packages/instant/public/index.js",
+ "packages/instant/public/index.min.js"
+ ]
}
},
"repository": {
@@ -66,7 +73,8 @@
"typedoc": "0.12.0",
"typescript": "3.0.1",
"webpack": "^4.20.2",
- "webpack-cli": "^3.1.1"
+ "webpack-cli": "^3.1.1",
+ "webpack-dev-server": "^3.1.9"
},
"publishConfig": {
"access": "private"
diff --git a/packages/instant/src/index.ts b/packages/instant/src/index.ts
index 345246d09..54059cdad 100644
--- a/packages/instant/src/index.ts
+++ b/packages/instant/src/index.ts
@@ -1 +1 @@
-export { ZeroExInstant } from './components/zero_ex_instant';
+export { ZeroExInstant, ZeroExInstantProps } from './components/zero_ex_instant';
diff --git a/packages/instant/tsconfig.json b/packages/instant/tsconfig.json
index 69d2520fa..28a6190b8 100644
--- a/packages/instant/tsconfig.json
+++ b/packages/instant/tsconfig.json
@@ -8,9 +8,10 @@
"noImplicitAny": true,
"module": "ESNext",
"moduleResolution": "node",
- "lib": ["es2015"],
+ "lib": ["es2015", "dom"],
"target": "es5",
"sourceMap": true
},
- "include": ["./src/**/*", "./test/**/*"]
+ "include": ["./src/**/*", "./test/**/*"],
+ "exclude": ["./src/index.umd.ts"]
}
diff --git a/packages/instant/webpack.config.js b/packages/instant/webpack.config.js
index f7500c69c..78a33ce90 100644
--- a/packages/instant/webpack.config.js
+++ b/packages/instant/webpack.config.js
@@ -1,9 +1,13 @@
const path = require('path');
+// The common js bundle (not this one) is built using tsc.
+// The umd bundle (this one) has a different entrypoint.
module.exports = {
- entry: './src/index.ts',
+ entry: './src/index.umd.ts',
output: {
filename: '[name].bundle.js',
- path: path.resolve(__dirname, 'lib'),
+ path: path.resolve(__dirname, 'public'),
+ library: 'zeroExInstant',
+ libraryTarget: 'umd',
},
devtool: 'source-map',
resolve: {
@@ -17,4 +21,8 @@ module.exports = {
},
],
},
+ devServer: {
+ contentBase: path.join(__dirname, 'public'),
+ port: 5000,
+ },
};
diff --git a/yarn.lock b/yarn.lock
index b16c0da06..aa799cbad 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -1570,6 +1570,10 @@ aes-js@^3.1.1:
version "3.1.1"
resolved "https://registry.npmjs.org/aes-js/-/aes-js-3.1.1.tgz#89fd1f94ae51b4c72d62466adc1a7323ff52f072"
+ajv-errors@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.npmjs.org/ajv-errors/-/ajv-errors-1.0.0.tgz#ecf021fa108fd17dfb5e6b383f2dd233e31ffc59"
+
ajv-keywords@^2.1.0:
version "2.1.1"
resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-2.1.1.tgz#617997fc5f60576894c435f940d819e135b80762"
@@ -1625,6 +1629,10 @@ ansi-align@^2.0.0:
dependencies:
string-width "^2.0.0"
+ansi-colors@^3.0.0:
+ version "3.1.0"
+ resolved "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.1.0.tgz#dcfaacc90ef9187de413ec3ef8d5eb981a98808f"
+
ansi-escapes@^1.0.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-1.4.0.tgz#d3a8a83b319aa67793662b13e761c7911422306e"
@@ -4702,6 +4710,13 @@ deepmerge@^2.0.1:
version "2.1.1"
resolved "https://registry.npmjs.org/deepmerge/-/deepmerge-2.1.1.tgz#e862b4e45ea0555072bf51e7fd0d9845170ae768"
+default-gateway@^2.6.0:
+ version "2.7.2"
+ resolved "https://registry.npmjs.org/default-gateway/-/default-gateway-2.7.2.tgz#b7ef339e5e024b045467af403d50348db4642d0f"
+ dependencies:
+ execa "^0.10.0"
+ ip-regex "^2.1.0"
+
default-require-extensions@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/default-require-extensions/-/default-require-extensions-1.0.0.tgz#f37ea15d3e13ffd9b437d33e1a75b5fb97874cb8"
@@ -7479,6 +7494,15 @@ http-proxy-middleware@~0.17.4:
lodash "^4.17.2"
micromatch "^2.3.11"
+http-proxy-middleware@~0.18.0:
+ version "0.18.0"
+ resolved "http://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-0.18.0.tgz#0987e6bb5a5606e5a69168d8f967a87f15dd8aab"
+ dependencies:
+ http-proxy "^1.16.2"
+ is-glob "^4.0.0"
+ lodash "^4.17.5"
+ micromatch "^3.1.9"
+
http-proxy@^1.16.2:
version "1.16.2"
resolved "https://registry.yarnpkg.com/http-proxy/-/http-proxy-1.16.2.tgz#06dff292952bf64dbe8471fa9df73066d4f37742"
@@ -7768,6 +7792,13 @@ internal-ip@1.2.0:
dependencies:
meow "^3.3.0"
+internal-ip@^3.0.1:
+ version "3.0.1"
+ resolved "https://registry.npmjs.org/internal-ip/-/internal-ip-3.0.1.tgz#df5c99876e1d2eb2ea2d74f520e3f669a00ece27"
+ dependencies:
+ default-gateway "^2.6.0"
+ ipaddr.js "^1.5.2"
+
interpret@^1.0.0, interpret@^1.0.4, interpret@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.1.0.tgz#7ed1b1410c6a0e0f78cf95d3b8440c63f78b8614"
@@ -7793,6 +7824,10 @@ invert-kv@^2.0.0:
version "2.0.0"
resolved "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz#7393f5afa59ec9ff5f67a27620d11c226e3eec02"
+ip-regex@^2.1.0:
+ version "2.1.0"
+ resolved "https://registry.npmjs.org/ip-regex/-/ip-regex-2.1.0.tgz#fa78bf5d2e6913c911ce9f819ee5146bb6d844e9"
+
ip@^1.1.0, ip@^1.1.5:
version "1.1.5"
resolved "https://registry.yarnpkg.com/ip/-/ip-1.1.5.tgz#bdded70114290828c0a039e72ef25f5aaec4354a"
@@ -7801,6 +7836,10 @@ ipaddr.js@1.6.0:
version "1.6.0"
resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.6.0.tgz#e3fa357b773da619f26e95f049d055c72796f86b"
+ipaddr.js@^1.5.2:
+ version "1.8.1"
+ resolved "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.8.1.tgz#fa4b79fa47fd3def5e3b159825161c0a519c9427"
+
irregular-plurals@^1.0.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/irregular-plurals/-/irregular-plurals-1.4.0.tgz#2ca9b033651111855412f16be5d77c62a458a766"
@@ -10129,7 +10168,7 @@ mime@^1.2.11, mime@^1.3.4, mime@^1.5.0:
version "1.6.0"
resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1"
-mime@^2.0.3:
+mime@^2.0.3, mime@^2.3.1:
version "2.3.1"
resolved "https://registry.npmjs.org/mime/-/mime-2.3.1.tgz#b1621c54d63b97c47d3cfe7f7215f7d64517c369"
@@ -13517,6 +13556,14 @@ schema-utils@^0.4.5:
ajv "^6.1.0"
ajv-keywords "^3.1.0"
+schema-utils@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.npmjs.org/schema-utils/-/schema-utils-1.0.0.tgz#0b79a93204d7b600d4b2850d1f66c2a34951c770"
+ dependencies:
+ ajv "^6.1.0"
+ ajv-errors "^1.0.0"
+ ajv-keywords "^3.1.0"
+
scoped-regex@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/scoped-regex/-/scoped-regex-1.0.0.tgz#a346bb1acd4207ae70bd7c0c7ca9e566b6baddb8"
@@ -13956,6 +14003,17 @@ sockjs-client@1.1.4:
json3 "^3.3.2"
url-parse "^1.1.8"
+sockjs-client@1.1.5:
+ version "1.1.5"
+ resolved "https://registry.npmjs.org/sockjs-client/-/sockjs-client-1.1.5.tgz#1bb7c0f7222c40f42adf14f4442cbd1269771a83"
+ dependencies:
+ debug "^2.6.6"
+ eventsource "0.1.6"
+ faye-websocket "~0.11.0"
+ inherits "^2.0.1"
+ json3 "^3.3.2"
+ url-parse "^1.1.8"
+
sockjs@0.3.19:
version "0.3.19"
resolved "https://registry.yarnpkg.com/sockjs/-/sockjs-0.3.19.tgz#d976bbe800af7bd20ae08598d582393508993c0d"
@@ -16317,6 +16375,15 @@ webpack-dev-middleware@1.12.2, webpack-dev-middleware@^1.10.0:
range-parser "^1.0.3"
time-stamp "^2.0.0"
+webpack-dev-middleware@3.4.0:
+ version "3.4.0"
+ resolved "https://registry.npmjs.org/webpack-dev-middleware/-/webpack-dev-middleware-3.4.0.tgz#1132fecc9026fd90f0ecedac5cbff75d1fb45890"
+ dependencies:
+ memory-fs "~0.4.1"
+ mime "^2.3.1"
+ range-parser "^1.0.3"
+ webpack-log "^2.0.0"
+
webpack-dev-server@^2.5.0:
version "2.11.2"
resolved "https://registry.yarnpkg.com/webpack-dev-server/-/webpack-dev-server-2.11.2.tgz#1f4f4c78bf1895378f376815910812daf79a216f"
@@ -16349,6 +16416,39 @@ webpack-dev-server@^2.5.0:
webpack-dev-middleware "1.12.2"
yargs "6.6.0"
+webpack-dev-server@^3.1.9:
+ version "3.1.9"
+ resolved "https://registry.npmjs.org/webpack-dev-server/-/webpack-dev-server-3.1.9.tgz#8b32167624d2faff40dcedc2cbce17ed1f34d3e0"
+ dependencies:
+ ansi-html "0.0.7"
+ bonjour "^3.5.0"
+ chokidar "^2.0.0"
+ compression "^1.5.2"
+ connect-history-api-fallback "^1.3.0"
+ debug "^3.1.0"
+ del "^3.0.0"
+ express "^4.16.2"
+ html-entities "^1.2.0"
+ http-proxy-middleware "~0.18.0"
+ import-local "^2.0.0"
+ internal-ip "^3.0.1"
+ ip "^1.1.5"
+ killable "^1.0.0"
+ loglevel "^1.4.1"
+ opn "^5.1.0"
+ portfinder "^1.0.9"
+ schema-utils "^1.0.0"
+ selfsigned "^1.9.1"
+ serve-index "^1.7.2"
+ sockjs "0.3.19"
+ sockjs-client "1.1.5"
+ spdy "^3.4.1"
+ strip-ansi "^3.0.0"
+ supports-color "^5.1.0"
+ webpack-dev-middleware "3.4.0"
+ webpack-log "^2.0.0"
+ yargs "12.0.2"
+
webpack-log@^1.2.0:
version "1.2.0"
resolved "https://registry.npmjs.org/webpack-log/-/webpack-log-1.2.0.tgz#a4b34cda6b22b518dbb0ab32e567962d5c72a43d"
@@ -16358,6 +16458,13 @@ webpack-log@^1.2.0:
loglevelnext "^1.0.1"
uuid "^3.1.0"
+webpack-log@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.npmjs.org/webpack-log/-/webpack-log-2.0.0.tgz#5b7928e0637593f119d32f6227c1e0ac31e1b47f"
+ dependencies:
+ ansi-colors "^3.0.0"
+ uuid "^3.3.2"
+
webpack-node-externals@^1.6.0:
version "1.7.2"
resolved "https://registry.yarnpkg.com/webpack-node-externals/-/webpack-node-externals-1.7.2.tgz#6e1ee79ac67c070402ba700ef033a9b8d52ac4e3"
@@ -16830,6 +16937,23 @@ yargs@11.1.0, yargs@^11.1.0:
y18n "^3.2.1"
yargs-parser "^9.0.2"
+yargs@12.0.2, yargs@^12.0.2:
+ version "12.0.2"
+ resolved "https://registry.npmjs.org/yargs/-/yargs-12.0.2.tgz#fe58234369392af33ecbef53819171eff0f5aadc"
+ dependencies:
+ cliui "^4.0.0"
+ decamelize "^2.0.0"
+ find-up "^3.0.0"
+ get-caller-file "^1.0.1"
+ os-locale "^3.0.0"
+ require-directory "^2.1.1"
+ require-main-filename "^1.0.1"
+ set-blocking "^2.0.0"
+ string-width "^2.0.0"
+ which-module "^2.0.0"
+ y18n "^3.2.1 || ^4.0.0"
+ yargs-parser "^10.1.0"
+
yargs@6.6.0:
version "6.6.0"
resolved "https://registry.yarnpkg.com/yargs/-/yargs-6.6.0.tgz#782ec21ef403345f830a808ca3d513af56065208"
@@ -16899,23 +17023,6 @@ yargs@^12.0.1:
y18n "^3.2.1 || ^4.0.0"
yargs-parser "^10.1.0"
-yargs@^12.0.2:
- version "12.0.2"
- resolved "https://registry.npmjs.org/yargs/-/yargs-12.0.2.tgz#fe58234369392af33ecbef53819171eff0f5aadc"
- dependencies:
- cliui "^4.0.0"
- decamelize "^2.0.0"
- find-up "^3.0.0"
- get-caller-file "^1.0.1"
- os-locale "^3.0.0"
- require-directory "^2.1.1"
- require-main-filename "^1.0.1"
- set-blocking "^2.0.0"
- string-width "^2.0.0"
- which-module "^2.0.0"
- y18n "^3.2.1 || ^4.0.0"
- yargs-parser "^10.1.0"
-
yargs@^3.7.2:
version "3.32.0"
resolved "https://registry.npmjs.org/yargs/-/yargs-3.32.0.tgz#03088e9ebf9e756b69751611d2a5ef591482c995"