Skip to content

Commit ff9755b

Browse files
authored
Chore: Package updates (#49)
* Initial commit * Update jest * Update jest again (just published) * Update eslint * Update uuid * Upgrade size-limit * Remove unused coverage reporter * Bump patch * Upgrade travis node * Update branch name reference in travis * Specify dist b/c travis cannot figure it out
1 parent 61eae02 commit ff9755b

9 files changed

+3904
-7456
lines changed

.eslintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
jasmine: true
66
jest: true
77
es6: true
8-
parser: babel-eslint
8+
parser: "@babel/eslint-parser"
99
parserOptions:
1010
sourceType: module
1111
ecmaFeatures:

.travis.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
language: node_js
22
node_js:
3-
- '8'
3+
- '18'
4+
dist: 'jammy'
45
notifications:
56
email: false
67
before_script: yarn size
@@ -10,5 +11,5 @@ deploy:
1011
api_key:
1112
secure: Mu68/DGE+RC2TilCle7RXuqeluOCsR2MMSFge2MLNGWDdtv/j5S5gMYFuHKw61ASpBQ1bJsJmuIJ1/MHrAQ5S67N6/8lA2LVVSzWMB30h28anUm+lCSGZMWcy+Z+z1xXLMOAMrDglHGwAmt5NabUKIpHc9YWuPE3T3yp2ilVq81ameFObPZ08ISM8pmF90bp1qIXwk1iUPTcCWa6UkIfhpfAdMVHVWXLWIyaZ3+/p8mYNpc27mW23GrWcejDfgUUI9Oe+5pv/fb3RBO2HXLmIt582s+H3/evY9VSHTKt2e/CbBO2umgE1Bgn5Al7VIX8YRb62effbxUyNMVLk15UQnTVWu7m3/V2+N3pnFrJzMFJMS7JNmIPzCb+xFKvKaqo6qklfc6Wir8IW8mMyB1KznoaqEeOJ9daehmQgCQkCulzl5h6HLQ08OFQ5WUcsSHgAJgUlXsL2u5izQNZhbhT1eMP/YwNZvbI072Yxw468U0oaeGaj1Y0rnmtQR0UT3QcfyEyzzZ/2+FwDRF9AfZwhMDx7BNrlCuQ0Z2lnj54fggXe2q0G6NBrpC6Vw610FTCwBQ3yzQKnQ8IQckYxp/nD7ew2mnaQJnj0V4wn9MqquijOukBKUfEFmRjliKYLdTIUZBPJ9wBua1PrBlO6QIeBJzPlsDA039CB4icBYE2CCw=
1213
on:
13-
branch: master
14+
branch: main
1415
skip_cleanup: true
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
{
1+
module.exports = {
22
"presets": [ "@launchpadlab/babel-preset/react" ]
33
}

package.json

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "redux-flash",
3-
"version": "2.0.6",
3+
"version": "2.0.7",
44
"description": "Redux action creators for displaying flash messages",
55
"main": "lib/index.js",
66
"scripts": {
@@ -12,8 +12,7 @@
1212
"prepublish": "yarn run lint && yarn run clean && yarn run build",
1313
"test": "jest",
1414
"size": "yarn build && size-limit",
15-
"test:coverage": "jest --coverage",
16-
"report-coverage": "codeclimate-test-reporter < coverage/lcov.info"
15+
"test:coverage": "jest --coverage"
1716
},
1817
"repository": "launchpadlab/redux-flash",
1918
"keywords": [
@@ -31,23 +30,23 @@
3130
"lib/"
3231
],
3332
"devDependencies": {
33+
"@babel/eslint-parser": "^7.22.6",
3434
"@launchpadlab/babel-preset": "^2.1.0",
35-
"@size-limit/preset-small-lib": "^2.1.1",
36-
"babel-eslint": "^10.0.2",
37-
"codeclimate-test-reporter": "^0.4.1",
38-
"eslint": "^6.1.0",
35+
"@size-limit/file": "^8.2.6",
36+
"@size-limit/webpack": "^8.2.6",
37+
"eslint": "^8.44.0",
3938
"eslint-plugin-import": "^2.2.0",
40-
"jest": "^24.8.0",
39+
"jest": "^29.5.0",
4140
"redux": "^4.0.4",
4241
"redux-mock-store": "^1.3.0",
43-
"size-limit": "^2.1.1"
42+
"size-limit": "^8.2.6"
4443
},
4544
"dependencies": {
4645
"@babel/cli": "^7.5.5",
4746
"@babel/core": "^7.5.5",
4847
"prop-types": "^15.6.1",
4948
"redux-actions": "^2.6.5",
50-
"uuid": "^3.1.0"
49+
"uuid": "^9.0.0"
5150
},
5251
"peerDependencies": {
5352
"redux": "^4.0.0 || ^3.0.0"

src/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ export {
55
clearMessages,
66
removeMessage,
77
} from './actions'
8-
export flashMessageType from './flashMessageType'
9-
export middleware from './middleware'
8+
export { default as flashMessageType } from './flashMessageType'
9+
export { default as middleware } from './middleware'
1010
export {
1111
reducer,
1212
getFlashMessages,

src/middleware.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import uuid from 'uuid/v4'
1+
import { v4 as uuidv4 } from 'uuid'
22
import * as actions from './actions'
33

44
const DEFAULT_TIMEOUT = 3000
@@ -26,7 +26,7 @@ function middleware (options={}) {
2626
}
2727
}
2828
} = action
29-
const id = uuid()
29+
const id = uuidv4()
3030
// Dispatch appropriate internal actions
3131
if (push) next(actions.clearMessages())
3232
next(actions._addMessage({ id, message, isError, props: { ...globalProps, ...props }}))

test/actions.test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,31 +21,31 @@ test('flashMessage sets default timeout if none is provided', () => {
2121
const store = createMockStore()
2222
store.dispatch(flashMessage('Hi'))
2323
expect(store.getActionTypes()).toEqual([ADD_MESSAGE_ACTION_TYPE])
24-
jest.runTimersToTime(4000)
24+
jest.advanceTimersByTime(4000)
2525
expect(store.getActionTypes()).toEqual([ADD_MESSAGE_ACTION_TYPE, REMOVE_MESSAGE_ACTION_TYPE])
2626
})
2727

2828
test('flashMessage sets custom timeout if one is provided in action creator', () => {
2929
const store = createMockStore()
3030
store.dispatch(flashMessage('Hi', { timeout: 500 }))
3131
expect(store.getActionTypes()).toEqual([ADD_MESSAGE_ACTION_TYPE])
32-
jest.runTimersToTime(1000)
32+
jest.advanceTimersByTime(1000)
3333
expect(store.getActionTypes()).toEqual([ADD_MESSAGE_ACTION_TYPE, REMOVE_MESSAGE_ACTION_TYPE])
3434
})
3535

3636
test('flashMessage sets custom timeout if one is provided in middleware config', () => {
3737
const store = createMockStore({}, { timeout: 500 })
3838
store.dispatch(flashMessage('Hi'))
3939
expect(store.getActionTypes()).toEqual([ADD_MESSAGE_ACTION_TYPE])
40-
jest.runTimersToTime(1000)
40+
jest.advanceTimersByTime(1000)
4141
expect(store.getActionTypes()).toEqual([ADD_MESSAGE_ACTION_TYPE, REMOVE_MESSAGE_ACTION_TYPE])
4242
})
4343

4444
test('flashMessage sets no timeout if "false" is provided', () => {
4545
const store = createMockStore()
4646
store.dispatch(flashMessage('Hi', { timeout: false }))
4747
expect(store.getActionTypes()).toEqual([ADD_MESSAGE_ACTION_TYPE])
48-
jest.runTimersToTime(4000)
48+
jest.advanceTimersByTime(4000)
4949
expect(store.getActionTypes()).toEqual([ADD_MESSAGE_ACTION_TYPE])
5050
})
5151

test/flashMessageType.test.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import {
55
} from '../src'
66
import { createMockStore } from './helpers'
77

8+
jest.useFakeTimers()
9+
810
function validatePropType (propType, value) {
911
// checkPropTypes will log an error if it fails
1012
const spy = jest.spyOn(console, 'error')

0 commit comments

Comments
 (0)