Skip to content

Commit

Permalink
release 0.6.1 (#142)
Browse files Browse the repository at this point in the history
* Support and implement absolute imports from src/ where appropriate (#97)

* Allow absolute imports from src/

* Fix tests not supporting absolute imports from src

* Use absolute imports where appropriate

* Fix calls to jest.mock

* Use babel-plugin-root-import for absolute imports (#119)

* Implement event --> UI integration tests (#102)

* refactored transaction-queue

* updated tests

* updated to use new transaction queue methods

* more refactoring

* more test updates

* add missing handleError calls

* made sure promise is returned to avoid warnings

* Lint jest functions correctly

* refactored duplicate transaction check to be more robust

* added args equal check function

* Mock date.now() when in test env

* Remove redundant .eslintrc files

* implemented txSpeedUp functionality

* Fix date.now() mocking in test env

* Initial UI render tests

* Update snapshots based on refactor/transaction-queue-use-id

* Remove redundant input validation

* Handle 'nonce' and 'startTime' seperately

* Revert "remove speed up commit"

This reverts commit d7c5cb5.

* Add placeholder transactionMessage

* Test remainder of eventCodes

* added txConfirmClient transactionMsgs obj

* Add UI tests activeContract category events

* Improve comments
Improve variable naming

* Remove redundant comments

* Add activePreflight notificationUI tests

* Test passing inlineCustomMsgs works correctly

* Improve comment

* Improve comments

* - Make adding custom state to tests more flexible
- Improve comments

* - Clean up logic
- Improve comments

* Add support for object-rest-spread

* - Restructure ui-rendering.test.js to be more flexible
- Allow easy testing of clickHandlers
- Improve test coverage

* - Improve mockTxFactory
- Add UI test for browserFail event

* - Allow testing custom localstorage values
- Allow testing primary btn clicks
- Test welcomeUser event

* Allow to easily specify custom states for tests

* Fix test name typo

* Improve test names

* Add custom initial states for welcomeUser

* Test welcomeUser category activePreflight

* Add UI test for walletFail event

* Add UI tests for event walletLogin

* Add UI tests for event walletLoginEnable

* Add UI tests for event walletEnable

* Add UI test for networkFail event

* Add UI tests for event nsfFail category onboard

* Add UI test for onboard-newOnboardComplete event

* Add UI test for event mobileBlocked-activePreflight

* Improve onboarding complete tests

* Improve ability to define custom stores in UI tests

* Abstract some code duplication

* Improve comments

* Improve integration test file structure

* Improve comments

* Improve test naming generation

* Improve comments

* Add UI test for txSpeedUp

* - Improve comments
- Improve function naming

* Improve comments

* Override user timezone in test environment

* Add tests for iframe visibility

* - Update event-definitions (#120)

- Update snapshots

* Library initialization integration tests (#117)

* Export a copy of initialState for use in tests

* Export getState for testing

* Initial initialization integration tests

* Improve test wording

* Remove redundant comment

* Call getState from an assistInstance

* Use absolute imports

* removed regex check that was causing inconsistent behaviour for overloaded methods (#121)

* Address babel corejs warning (#128)

* Parallelize async calls in getTransactionParams

* Parallelize some async calls in sendTransaction

* Handle window resize events while modal is open (#132)

* Move babel-eslint to devDependencies (#138)

* Delegate image processing to babel (#136)

* Add integration tests for logic triggered by websockets (#122)

* Export a copy of initialState for use in tests

* Export getState for testing

* Initial initialization integration tests

* Improve test wording

* Remove redundant comment

* Add integration tests for websocket related logic

* Remove redundant file

* Minor code quality improvement

* Improve import path readibility

* Improve readability of websocket integration tests

* Improve readability

* Code readability

* Remove redundant export

* update 0.6.1

* fix yarn lock from merge
  • Loading branch information
cmeisl authored May 3, 2019
1 parent fdc98d5 commit ff58d50
Show file tree
Hide file tree
Showing 30 changed files with 5,023 additions and 631 deletions.
12 changes: 10 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
module.exports = {
env: {
browser: true,
es6: true
es6: true,
jest: true
},
extends: ['airbnb/base', 'plugin:prettier/recommended'],
parserOptions: {
ecmaVersion: 2017,
ecmaVersion: 2018,
sourceType: 'module'
},
plugins: ['prettier'],
Expand All @@ -24,5 +25,12 @@ module.exports = {
'no-nested-ternary': 'off',
'import/no-cycle': 'off',
'no-lonely-if': 'off'
},
settings: {
'import/resolver': {
'babel-plugin-root-import': {
rootPathSuffix: 'src'
}
}
}
}
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,16 @@ yarn add bnc-assist
#### Script Tag

The library uses [semantic versioning](https://semver.org/spec/v2.0.0.html).
The current version is 0.6.0.
The current version is 0.6.1.
There are minified and non-minified versions.
Put this script at the top of your `<head>`

```html
<script src="https://assist.blocknative.com/0-6-0/assist.js"></script>
<script src="https://assist.blocknative.com/0-6-1/assist.js"></script>

<!-- OR... -->

<script src="https://assist.blocknative.com/0-6-0/assist.min.js"></script>
<script src="https://assist.blocknative.com/0-6-1/assist.min.js"></script>
```

### Initialize the Library
Expand Down
16 changes: 15 additions & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,19 @@ module.exports = {
'@babel/preset-env',
{
useBuiltIns: 'entry',
corejs: '2.0.0',
modules: false,
targets: '> 2%'
}
]
],
plugins: [
[
'babel-plugin-root-import',
{
rootPathSuffix: 'src'
}
],
[
'@babel/plugin-transform-runtime',
{
Expand All @@ -18,7 +25,14 @@ module.exports = {
regenerator: true,
useESModules: false
}
]
],
['@babel/plugin-proposal-object-rest-spread'],
['inline-import-data-uri', {
'extensions': [
'.png',
'.jpg'
]
}]
],
env: {
test: {
Expand Down
5 changes: 0 additions & 5 deletions build.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ const resolve = require('rollup-plugin-node-resolve')
const commonjs = require('rollup-plugin-commonjs')
const { uglify } = require('rollup-plugin-uglify')
const string = require('rollup-plugin-string')
const image = require('rollup-plugin-img')
const json = require('rollup-plugin-json')

const defaultPlugins = [
Expand All @@ -17,10 +16,6 @@ const defaultPlugins = [
string({
include: '**/*.css'
}),
image({
exclude: ['node_modules/**'],
limit: 51200
}),
resolve({
jsnext: true,
main: true,
Expand Down
5 changes: 5 additions & 0 deletions internals/jestSetup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// eslint-disable-next-line import/no-extraneous-dependencies
import MockDate from 'mockdate'

// Mock Date.now()
MockDate.set('1/1/2010')
6 changes: 2 additions & 4 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,7 @@ module.exports = {
},

// An array of directory names to be searched recursively up from the requiring module's location
// moduleDirectories: [
// "node_modules"
// ],
moduleDirectories: ['node_modules', 'src'],

// An array of file extensions your modules use
// moduleFileExtensions: [
Expand Down Expand Up @@ -121,7 +119,7 @@ module.exports = {
// runner: "jest-runner",

// The paths to modules that run some code to configure or set up the testing environment before each test
// setupFiles: [],
setupFiles: ['./internals/jestSetup.js'],

// The path to a module that runs some code to configure or set up the testing framework before each test
// setupTestFrameworkScriptFile: null,
Expand Down
19 changes: 13 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
{
"name": "bnc-assist",
"version": "0.6.0",
"version": "0.6.1",
"description": "Blocknative Assist js library for Dapp developers",
"main": "lib/assist.min.js",
"scripts": {
"build": "yarn lint && yarn test && node build.js",
"build:dev": "node build.js",
"lint": "eslint src/ --fix",
"test": "jest"
"test": "TZ=Europe/Paris jest"
},
"husky": {
"hooks": {
Expand All @@ -29,38 +30,44 @@
"homepage": "https://github.com/blocknative/assist#readme",
"dependencies": {
"@babel/polyfill": "^7.0.0",
"babel-eslint": "^10.0.1",
"bluebird": "^3.5.3",
"bowser": "^2.0.0-beta.3",
"core-js": "2",
"uuid": "^3.3.2"
},
"devDependencies": {
"@babel/core": "^7.2.2",
"@babel/plugin-proposal-object-rest-spread": "^7.4.3",
"@babel/plugin-transform-runtime": "^7.1.0",
"@babel/preset-env": "^7.1.6",
"@babel/runtime": "^7.1.5",
"babel-core": "^7.0.0-bridge.0",
"babel-eslint": "^10.0.1",
"babel-jest": "^23.6.0",
"babel-plugin-external-helpers": "^6.22.0",
"babel-plugin-inline-import-data-uri": "^1.0.1",
"babel-plugin-root-import": "^6.1.0",
"dom-testing-library": "^3.16.2",
"eslint": "^5.9.0",
"eslint-config-airbnb": "^17.1.0",
"eslint-config-prettier": "^3.3.0",
"eslint-plugin-import": "^2.14.0",
"eslint-import-resolver-babel-plugin-root-import": "^1.1.1",
"eslint-plugin-import": "^2.17.2",
"eslint-plugin-jsx-a11y": "^6.1.2",
"eslint-plugin-prettier": "^3.0.0",
"husky": "^1.3.1",
"jest": "^23.6.0",
"jest-cli": "^23.6.0",
"jest-css-modules": "^1.1.0",
"jest-dom": "^3.0.0",
"mock-socket": "^8.0.5",
"mockdate": "^2.0.2",
"prettier": "^1.15.2",
"regenerator-runtime": "^0.13.1",
"rollup": "^0.67.3",
"rollup-plugin-babel": "^4.0.3",
"rollup-plugin-commonjs": "^9.2.0",
"rollup-plugin-eslint": "^5.0.0",
"rollup-plugin-img": "^1.1.0",
"rollup-plugin-json": "^4.0.0",
"rollup-plugin-node-resolve": "^3.4.0",
"rollup-plugin-string": "^2.0.2",
Expand All @@ -70,4 +77,4 @@
"eslintIgnore": [
"package.json"
]
}
}
Loading

0 comments on commit ff58d50

Please sign in to comment.