From 9d00bb95e4fd3c903bf698ac81ef50aee363c3ed Mon Sep 17 00:00:00 2001 From: Leo Joseph <58416454+rleojoseph@users.noreply.github.com> Date: Mon, 19 Dec 2022 15:48:47 +0900 Subject: [PATCH] Update dependencies to latest versions (#233) * JS Sample app dependencies * Removed unused file * SDK & Bridge dependencies * Revert yarn.lock * Update node for circleci * Node image update * Prettier fix * Prettier * Typedoc fix * Prettier * Downgrade few router versions * Revert * Downgrade typedoc --- .circleci/config.yml | 14 +++++------ "Icon\r" | 0 icon.png | Bin 0 -> 6223 bytes js-miniapp-bridge/package.json | 8 +++---- js-miniapp-sample/package.json | 22 +++++++++--------- js-miniapp-sample/src/pages/ads.js | 3 ++- .../src/pages/app-close-alert.js | 4 ++-- js-miniapp-sample/src/pages/camera.js | 1 + js-miniapp-sample/src/pages/event-listener.js | 2 +- .../src/pages/inapp-purchases.js | 2 +- js-miniapp-sample/src/pages/landing.js | 5 ++-- js-miniapp-sample/src/pages/media.js | 3 ++- js-miniapp-sample/src/pages/secure-storage.js | 21 ++++++++++------- js-miniapp-sample/src/pages/share.js | 2 +- .../src/pages/universal-bridge.js | 4 ++-- js-miniapp-sample/src/pages/uri-schemes.js | 4 ++-- js-miniapp-sample/src/pages/uuid-sdk.js | 2 +- js-miniapp-sample/src/routes.js | 22 +++++++++--------- .../src/services/landing/reducers.js | 3 ++- .../src/services/message/actions.js | 5 ++-- js-miniapp-sample/src/services/reducers.js | 10 ++++---- .../src/services/secure-storage/actions.js | 4 ++-- .../src/services/secure-storage/reducers.js | 15 ++++++------ .../src/services/user/reducers.js | 2 +- js-miniapp-sdk/package.json | 10 ++++---- 25 files changed, 89 insertions(+), 79 deletions(-) delete mode 100644 "Icon\r" create mode 100644 icon.png diff --git a/.circleci/config.yml b/.circleci/config.yml index 693f39a57..761ddf89e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -29,7 +29,7 @@ jobs: build-bridge: working_directory: ~/mini-js-bridge docker: - - image: circleci/node:12.0.0 + - image: circleci/node:14.17.0 steps: - checkout - restore_cache: @@ -64,7 +64,7 @@ jobs: export-bridge: working_directory: ~/mini-js-bridge docker: - - image: circleci/node:12.0.0 + - image: circleci/node:14.17.0 steps: - checkout - attach_workspace: @@ -77,7 +77,7 @@ jobs: build-sdk: working_directory: ~/mini-js-sdk docker: - - image: circleci/node:12.0.0 + - image: circleci/node:14.17.0 steps: - checkout - restore_cache: @@ -131,7 +131,7 @@ jobs: publish-sdk: working_directory: ~/mini-js-sdk docker: - - image: circleci/node:12.0.0 + - image: circleci/node:14.17.0 steps: - checkout - attach_workspace: @@ -173,7 +173,7 @@ jobs: build-sample: # builds & tests the sample app against latest sdk build. working_directory: ~/js-miniapp-sample docker: - - image: circleci/node:12.16.2 + - image: circleci/node:14.17.0 # TODO get the sdk build from saved workspace environment: PUBLIC_URL: . @@ -210,7 +210,7 @@ jobs: deploy-sample: working_directory: ~/js-miniapp-sample docker: - - image: circleci/node:12.0.0 + - image: circleci/node:14.17.0 steps: - checkout - attach_workspace: @@ -236,7 +236,7 @@ jobs: upload-coverage: working_directory: ~/js-miniapp docker: - - image: circleci/node:12.0.0 + - image: circleci/node:14.17.0 steps: - checkout - attach_workspace: diff --git "a/Icon\r" "b/Icon\r" deleted file mode 100644 index e69de29bb..000000000 diff --git a/icon.png b/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..45b6a1b6b33a9f4fd84a80766ab56098e4203877 GIT binary patch literal 6223 zcmb7IWmptUwBB7sC?vRpRx&_Il z5fG#=-=BMb-yiRsGc)I%dFGsX<~(!W=eZ8itl5qfVH$&!1U8eD)>@8?WP9!@*&;!dU4(`9h*%`wI`HW8j-Fsx*O$ z%(k{f>+RP!8-9zM4C_Plvb7h#TClA~zI(fKwHL=Si>KRVtw(sDLm{>pq9hdOy`Qyt z%;scCs1GPm37aV=5IoE0>t;ve;@HMV!h?es8Ik6~_zB>eFm#PpruluaIYYS?2vYTI zYy1Zft`GI>o<63;5KH$24JRs2M1ee#pw%LfDlyw6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GvMy-HG|+QOC=FZ~>&>u5 zh&v?TKGNlUSANfYs?1kuFRtcXYkodgxL%d7J1$l!mfLi*^UaTHijO3(Yy(9O6Tjj7 zj3@O8c1r|aHeUw?dheRoQz`h0T2Xh4MCoE2BV%6zOTN{vp)M{k9?7`(;HuCODeWng zAhG<&d{=Vhb7dOLt_DR8(PsvKo6*&iU-{aOT`H8laxYGYog6>lf&`hxquX>NedqOnpnU5+{m@mNb@m`2}u`Lf~M=?pkBrW9ko-R$u2)UhA~~?7-jpQ zZ%9b#hq464fx`!E{IS-ia+r(`U#1Ta$|5-YCUKDMTniAW0=eU`go14~*REWVt z&er4}6=85(oCUEIedL(A=NF*!n-oAQP*PHiDpTauTCGg!SoW@xHmNp}ZZTrKx&lG% z;^-QB_HRFay|mqBk1=k&L~LN(Y)HzybI;{kORDo|!CE0vM>XD^6P-agE7H$s-Sxu}=h4wp^@!o=R-MHxQ8hCm*91pGU2y88PUH>Do7zrU3+md1&*$< z?i%64fLH`WEo{uevq7}#-%t=l)v-sYEA9WActiQMn$WxLhe^qQ#e7XQUDZ-$+wlJZ Dp1SI* literal 0 HcmV?d00001 diff --git a/js-miniapp-bridge/package.json b/js-miniapp-bridge/package.json index 5b8315176..b23a1ecef 100644 --- a/js-miniapp-bridge/package.json +++ b/js-miniapp-bridge/package.json @@ -4,12 +4,12 @@ "description": "Mini App JavaScript Bridge", "dependencies": {}, "devDependencies": { - "@istanbuljs/nyc-config-typescript": "^1.0.1", + "@istanbuljs/nyc-config-typescript": "^1.0.2", "@types/chai": "^4.2.11", "@types/mocha": "^7.0.2", "@types/node": "^10.0.3", "@types/sinon": "^9.0.0", - "browserify": "^16.5.1", + "browserify": "^17.0.0", "chai": "^4.2.0", "chai-as-promised": "^7.1.1", "gts": "^1.1.2", @@ -18,10 +18,10 @@ "nyc": "^15.0.0", "sinon": "^9.0.1", "sinon-chai": "^3.5.0", - "source-map-support": "^0.5.16", + "source-map-support": "^0.5.21", "ts-node": "^8.8.1", "tslint": "^6.1.0", - "typescript": "^3.8.3" + "typescript": "^4.9.4" }, "scripts": { "lint": "gts check", diff --git a/js-miniapp-sample/package.json b/js-miniapp-sample/package.json index 0536005e7..de6118ce1 100644 --- a/js-miniapp-sample/package.json +++ b/js-miniapp-sample/package.json @@ -3,13 +3,13 @@ "version": "1.15.0", "description": "Mini App Sample for JavaScript SDK", "dependencies": { - "@brightcove/react-player-loader": "^1.4.1", - "@emotion/react": "^11.9.0", - "@emotion/styled": "^11.8.1", + "@brightcove/react-player-loader": "^1.4.2", + "@emotion/react": "^11.10.5", + "@emotion/styled": "^11.10.5", "@material-ui/core": "^4.12.4", "@material-ui/icons": "^4.11.3", "@material-ui/lab": "^4.0.0-alpha.61", - "@mui/material": "^5.8.1", + "@mui/material": "^5.10.17", "bowser": "^2.11.0", "react": "^18.0.0", "react-copy-to-clipboard": "^5.0.4", @@ -19,7 +19,7 @@ "react-scripts": "3.4.1", "redux": "^4.1.2", "redux-thunk": "^2.4.1", - "semver": "^7.3.5" + "semver": "^7.3.8" }, "scripts": { "format": "prettier --config ./prettier.config.js --write 'src/**/*.js'", @@ -41,14 +41,14 @@ "iOS>=11" ], "devDependencies": { - "eslint": "^6.8.0", - "eslint-plugin-import": "^2.20.2", - "eslint-plugin-react": "^7.19.0", + "eslint": "^8.29.0", + "eslint-plugin-import": "^2.26.0", + "eslint-plugin-react": "^7.31.11", "flow-bin": "^0.121.0", "flow-typed": "^3.7.0", - "husky": "^4.2.3", - "lint-staged": "^10.1.1", - "prettier": "^2.6.2" + "husky": "^8.0.2", + "lint-staged": "^13.1.0", + "prettier": "^2.8.1" }, "husky": { "hooks": { diff --git a/js-miniapp-sample/src/pages/ads.js b/js-miniapp-sample/src/pages/ads.js index bcdc927fe..8a397ec3d 100644 --- a/js-miniapp-sample/src/pages/ads.js +++ b/js-miniapp-sample/src/pages/ads.js @@ -1,5 +1,4 @@ import React, { useReducer, useState } from 'react'; -import MiniApp from 'js-miniapp-sdk'; import { Button, @@ -11,6 +10,8 @@ import { Typography, makeStyles, } from '@material-ui/core'; +import MiniApp from 'js-miniapp-sdk'; + import GreyCard from '../components/GreyCard'; const useStyles = makeStyles((theme) => ({ diff --git a/js-miniapp-sample/src/pages/app-close-alert.js b/js-miniapp-sample/src/pages/app-close-alert.js index 5c84050e0..b191b2801 100644 --- a/js-miniapp-sample/src/pages/app-close-alert.js +++ b/js-miniapp-sample/src/pages/app-close-alert.js @@ -1,4 +1,5 @@ import React, { useState, useReducer } from 'react'; + import { Button, Container, @@ -7,10 +8,9 @@ import { makeStyles, Typography, } from '@material-ui/core'; - +import { red } from '@material-ui/core/colors'; import Checkbox from '@mui/material/Checkbox'; import FormControlLabel from '@mui/material/FormControlLabel'; -import { red } from '@material-ui/core/colors'; import MiniApp, { CloseAlertInfo } from 'js-miniapp-sdk'; const useStyles = makeStyles((theme) => ({ diff --git a/js-miniapp-sample/src/pages/camera.js b/js-miniapp-sample/src/pages/camera.js index 1a00a6591..47378a855 100644 --- a/js-miniapp-sample/src/pages/camera.js +++ b/js-miniapp-sample/src/pages/camera.js @@ -1,4 +1,5 @@ import React, { useRef, useState } from 'react'; + import { Card, Grid, Button, makeStyles } from '@material-ui/core'; const useStyles = makeStyles((theme) => ({ diff --git a/js-miniapp-sample/src/pages/event-listener.js b/js-miniapp-sample/src/pages/event-listener.js index eaaf34b04..411b99e97 100644 --- a/js-miniapp-sample/src/pages/event-listener.js +++ b/js-miniapp-sample/src/pages/event-listener.js @@ -1,5 +1,4 @@ import React, { useState } from 'react'; -import { MiniAppEvents, MiniAppKeyboardEvents } from 'js-miniapp-sdk'; import { Button, @@ -8,6 +7,7 @@ import { CardActions, makeStyles, } from '@material-ui/core'; +import { MiniAppEvents, MiniAppKeyboardEvents } from 'js-miniapp-sdk'; import GreyCard from '../components/GreyCard'; diff --git a/js-miniapp-sample/src/pages/inapp-purchases.js b/js-miniapp-sample/src/pages/inapp-purchases.js index 370451c59..1a3b1e823 100644 --- a/js-miniapp-sample/src/pages/inapp-purchases.js +++ b/js-miniapp-sample/src/pages/inapp-purchases.js @@ -1,5 +1,4 @@ import React, { useState } from 'react'; -import MiniApp from 'js-miniapp-sdk'; import { Button, @@ -8,6 +7,7 @@ import { CardActions, makeStyles, } from '@material-ui/core'; +import MiniApp from 'js-miniapp-sdk'; import GreyCard from '../components/GreyCard'; diff --git a/js-miniapp-sample/src/pages/landing.js b/js-miniapp-sample/src/pages/landing.js index aceca0a1b..bdcf8aa64 100644 --- a/js-miniapp-sample/src/pages/landing.js +++ b/js-miniapp-sample/src/pages/landing.js @@ -1,13 +1,14 @@ import React, { useEffect } from 'react'; + import { CardContent, makeStyles } from '@material-ui/core'; +import { connect } from 'react-redux'; + import GreyCard from '../components/GreyCard'; import { setHostEnvironmentInfo, onSecureStorageReady, } from '../services/landing/actions'; -import { connect } from 'react-redux'; - type LandingProps = { platform: ?string, platformVersion: ?string, diff --git a/js-miniapp-sample/src/pages/media.js b/js-miniapp-sample/src/pages/media.js index bf73da7f8..19fa09025 100644 --- a/js-miniapp-sample/src/pages/media.js +++ b/js-miniapp-sample/src/pages/media.js @@ -1,12 +1,13 @@ // @flow import React, { useState } from 'react'; + +import ReactPlayerLoader from '@brightcove/react-player-loader'; import { Button, CardContent, CardActions, makeStyles, } from '@material-ui/core'; -import ReactPlayerLoader from '@brightcove/react-player-loader'; import MiniApp from 'js-miniapp-sdk'; import { ScreenOrientation } from 'js-miniapp-sdk'; diff --git a/js-miniapp-sample/src/pages/secure-storage.js b/js-miniapp-sample/src/pages/secure-storage.js index 044be5c65..b508c0a10 100644 --- a/js-miniapp-sample/src/pages/secure-storage.js +++ b/js-miniapp-sample/src/pages/secure-storage.js @@ -1,3 +1,5 @@ +import React, { useReducer, useState, Fragment } from 'react'; + import { Button, CircularProgress, @@ -14,8 +16,8 @@ import TabList from '@material-ui/lab/TabList'; import TabPanel from '@material-ui/lab/TabPanel'; import clsx from 'clsx'; import { MiniAppError, MiniAppSecureStorageSize } from 'js-miniapp-sdk'; -import React, { useReducer, useState, Fragment } from 'react'; import { connect } from 'react-redux'; + import { clear, getItem, @@ -614,13 +616,16 @@ function SecureStorageComponent(props: SecureStorageProps) { {state.error} )} - {!state.isLoading && !state.isError && state.isSuccess && props.size && ( - -
Maximum Size: {props.size.max}
-
Used Space: {props.size.used}
-
Available: {props.size.max - props.size.used}
-
- )} + {!state.isLoading && + !state.isError && + state.isSuccess && + props.size && ( + +
Maximum Size: {props.size.max}
+
Used Space: {props.size.used}
+
Available: {props.size.max - props.size.used}
+
+ )} {!state.isLoading && !state.isError && state.isStorageCleaned && ( Storage Cleared Successfully diff --git a/js-miniapp-sample/src/pages/share.js b/js-miniapp-sample/src/pages/share.js index 2838a31b5..6df87b81e 100644 --- a/js-miniapp-sample/src/pages/share.js +++ b/js-miniapp-sample/src/pages/share.js @@ -1,5 +1,4 @@ import React from 'react'; -import MiniApp from 'js-miniapp-sdk'; import { Button, @@ -8,6 +7,7 @@ import { CardActions, makeStyles, } from '@material-ui/core'; +import MiniApp from 'js-miniapp-sdk'; import GreyCard from '../components/GreyCard'; diff --git a/js-miniapp-sample/src/pages/universal-bridge.js b/js-miniapp-sample/src/pages/universal-bridge.js index b75531606..9328df737 100644 --- a/js-miniapp-sample/src/pages/universal-bridge.js +++ b/js-miniapp-sample/src/pages/universal-bridge.js @@ -1,6 +1,4 @@ import React, { useState } from 'react'; -import MiniApp from 'js-miniapp-sdk'; -import { HostAppEvents } from 'js-miniapp-sdk'; import { Button, @@ -9,6 +7,8 @@ import { CardActions, makeStyles, } from '@material-ui/core'; +import MiniApp from 'js-miniapp-sdk'; +import { HostAppEvents } from 'js-miniapp-sdk'; import GreyCard from '../components/GreyCard'; diff --git a/js-miniapp-sample/src/pages/uri-schemes.js b/js-miniapp-sample/src/pages/uri-schemes.js index c46994a62..2100d7e39 100644 --- a/js-miniapp-sample/src/pages/uri-schemes.js +++ b/js-miniapp-sample/src/pages/uri-schemes.js @@ -74,7 +74,7 @@ const UriSchemes = () => { ); const [externalUrl, setExternalUrl] = useState(''); - function validateParams(params) { + function validateParams(params: string) { return params.startsWith('?') && params.indexOf('=') >= 0; } @@ -95,7 +95,7 @@ const UriSchemes = () => { onOpenUrl(url); } - function onOpenUrl(url) { + function onOpenUrl(url: URL) { window.location.href = url; } diff --git a/js-miniapp-sample/src/pages/uuid-sdk.js b/js-miniapp-sample/src/pages/uuid-sdk.js index be23b3dba..b5a16b97c 100644 --- a/js-miniapp-sample/src/pages/uuid-sdk.js +++ b/js-miniapp-sample/src/pages/uuid-sdk.js @@ -7,11 +7,11 @@ import { makeStyles, Snackbar, } from '@material-ui/core'; +import { CopyToClipboard } from 'react-copy-to-clipboard'; import { connect } from 'react-redux'; import GreyCard from '../components/GreyCard'; import { setMessagingUniqueId, setMauid } from '../services/uuid/actions'; -import { CopyToClipboard } from 'react-copy-to-clipboard'; const useStyles = makeStyles((theme) => ({ card: { diff --git a/js-miniapp-sample/src/routes.js b/js-miniapp-sample/src/routes.js index 1ba42273d..bd0c6040b 100644 --- a/js-miniapp-sample/src/routes.js +++ b/js-miniapp-sample/src/routes.js @@ -3,6 +3,7 @@ import React from 'react'; import AttachFileIcon from '@material-ui/icons/AttachFile'; import ChatIcon from '@material-ui/icons/Chat'; import CloudDownloadIcon from '@material-ui/icons/CloudDownload'; +import EventIcon from '@material-ui/icons/CompareArrows'; import FingerprintIcon from '@material-ui/icons/Fingerprint'; import GifIcon from '@material-ui/icons/Gif'; import HomeIcon from '@material-ui/icons/Home'; @@ -11,38 +12,37 @@ import LinkIcon from '@material-ui/icons/Link'; import AdsIcon from '@material-ui/icons/LocalPlay'; import LocationOnIcon from '@material-ui/icons/LocationOn'; import MediaIcon from '@material-ui/icons/MusicVideo'; +import NotificationImportantOutlinedIcon from '@material-ui/icons/NotificationImportantOutlined'; import PersonIcon from '@material-ui/icons/Person'; -import ShareIcon from '@material-ui/icons/Share'; -import StorageIcon from '@material-ui/icons/Storage'; -import VpnKeyIcon from '@material-ui/icons/VpnKey'; -import EventIcon from '@material-ui/icons/CompareArrows'; import PhotoCamera from '@material-ui/icons/PhotoCamera'; import SecurityIcon from '@material-ui/icons/Security'; -import NotificationImportantOutlinedIcon from '@material-ui/icons/NotificationImportantOutlined'; -import ShoppingCartIcon from '@material-ui/icons/ShoppingCart'; import SendIcon from '@material-ui/icons/SendSharp'; +import ShareIcon from '@material-ui/icons/Share'; +import ShoppingCartIcon from '@material-ui/icons/ShoppingCart'; +import StorageIcon from '@material-ui/icons/Storage'; +import VpnKeyIcon from '@material-ui/icons/VpnKey'; import Ads from './pages/ads'; +import { CloseConfirmAlert } from './pages/app-close-alert'; import AuthToken from './pages/auth-token'; import Camera from './pages/camera'; +import EventListener from './pages/event-listener'; import FileDownload from './pages/file-download'; import FileUploader from './pages/file-upload'; import GifPage from './pages/gifs'; +import Purchases from './pages/inapp-purchases'; import Landing from './pages/landing'; import LocalStorage from './pages/local-storage'; import Media from './pages/media'; import TalkToChatBot from './pages/message'; +import SecureStorageComponent from './pages/secure-storage'; import Share from './pages/share'; +import UniversalBridge from './pages/universal-bridge'; import UriSchemes from './pages/uri-schemes'; -import EventListener from './pages/event-listener'; import UserDetails from './pages/user-details'; import UuidFetcher from './pages/uuid-sdk'; import WebLocation from './pages/web-location'; import WindowActions from './pages/window-actions'; -import SecureStorageComponent from './pages/secure-storage'; -import { CloseConfirmAlert } from './pages/app-close-alert'; -import Purchases from './pages/inapp-purchases'; -import UniversalBridge from './pages/universal-bridge'; const homeItem = [ { diff --git a/js-miniapp-sample/src/services/landing/reducers.js b/js-miniapp-sample/src/services/landing/reducers.js index b97885ffc..e09108616 100644 --- a/js-miniapp-sample/src/services/landing/reducers.js +++ b/js-miniapp-sample/src/services/landing/reducers.js @@ -1,8 +1,9 @@ +import { HostEnvironmentInfo } from 'js-miniapp-sdk'; + import type { RequestHostInfoSuccessAction, OnStorageReadySuccessAction, } from './actions'; -import { HostEnvironmentInfo } from 'js-miniapp-sdk'; import { REQUEST_HOST_ENVIRONMENT_INFO_SUCCESS, ON_SECURE_STORAGE_READY_SUCCESS, diff --git a/js-miniapp-sample/src/services/message/actions.js b/js-miniapp-sample/src/services/message/actions.js index c37fd8491..fbe971dcc 100644 --- a/js-miniapp-sample/src/services/message/actions.js +++ b/js-miniapp-sample/src/services/message/actions.js @@ -1,11 +1,12 @@ -import { SET_MESSAGE_TYPES } from './types'; -import type { SetMessageTypeAction } from './types'; import MiniApp, { CustomPermissionStatus, CustomPermissionName, } from 'js-miniapp-sdk'; import { MessageToContact } from 'js-miniapp-sdk'; +import { SET_MESSAGE_TYPES } from './types'; +import type { SetMessageTypeAction } from './types'; + const getMessageTypeList = (): SetMessageTypeAction => { return { type: SET_MESSAGE_TYPES, diff --git a/js-miniapp-sample/src/services/reducers.js b/js-miniapp-sample/src/services/reducers.js index c780aa626..a30921048 100644 --- a/js-miniapp-sample/src/services/reducers.js +++ b/js-miniapp-sample/src/services/reducers.js @@ -1,16 +1,16 @@ import { combineReducers } from 'redux'; -import MessageReducer from './message/reducers'; +import { FileDownloadReducer } from './filedownload/reducers'; import HomeStateReducer from './home/reducers'; -import { grantedPermissionsReducer } from './permissions/reducers'; -import userReducer from './user/reducers'; -import { UUIDReducer } from './uuid/reducers'; import { HostEnvironmentInfoReducer, SecureStorageStatusReducer, } from './landing/reducers'; -import { FileDownloadReducer } from './filedownload/reducers'; +import MessageReducer from './message/reducers'; +import { grantedPermissionsReducer } from './permissions/reducers'; import storageReducer from './secure-storage/reducers'; +import userReducer from './user/reducers'; +import { UUIDReducer } from './uuid/reducers'; export default combineReducers({ message: MessageReducer, diff --git a/js-miniapp-sample/src/services/secure-storage/actions.js b/js-miniapp-sample/src/services/secure-storage/actions.js index a36f21471..389e15537 100644 --- a/js-miniapp-sample/src/services/secure-storage/actions.js +++ b/js-miniapp-sample/src/services/secure-storage/actions.js @@ -1,4 +1,6 @@ import MiniApp from 'js-miniapp-sdk'; +import { MiniAppSecureStorageSize } from 'js-miniapp-sdk'; + import { SET_SECURE_STORAGE_SUCCESS, SET_SECURE_STORAGE_FAILURE, @@ -12,8 +14,6 @@ import { GET_SIZE_SECURE_STORAGE_FAILURE, } from './types'; -import { MiniAppSecureStorageSize } from 'js-miniapp-sdk'; - type SetItemsSuccessAction = { type: string }; type GetItemSuccessAction = { type: string, item: string }; type RemoveItemsSuccessAction = { type: string }; diff --git a/js-miniapp-sample/src/services/secure-storage/reducers.js b/js-miniapp-sample/src/services/secure-storage/reducers.js index c9acc2dec..542ff742a 100644 --- a/js-miniapp-sample/src/services/secure-storage/reducers.js +++ b/js-miniapp-sample/src/services/secure-storage/reducers.js @@ -1,13 +1,5 @@ import { combineReducers } from 'redux'; -import { - CLEAR_SECURE_STORAGE_SUCCESS, - GET_SECURE_STORAGE_SUCCESS, - GET_SIZE_SECURE_STORAGE_SUCCESS, - REMOVE_ITEMS_STORAGE_SUCCESS, - SET_SECURE_STORAGE_SUCCESS, -} from './types'; - import type { SetItemsSuccessAction, GetItemSuccessAction, @@ -15,6 +7,13 @@ import type { SizeSuccessAction, ClearSuccessAction, } from './actions'; +import { + CLEAR_SECURE_STORAGE_SUCCESS, + GET_SECURE_STORAGE_SUCCESS, + GET_SIZE_SECURE_STORAGE_SUCCESS, + REMOVE_ITEMS_STORAGE_SUCCESS, + SET_SECURE_STORAGE_SUCCESS, +} from './types'; const defaultSetItems = null; const setItemsReducer = ( diff --git a/js-miniapp-sample/src/services/user/reducers.js b/js-miniapp-sample/src/services/user/reducers.js index 0f1a9d1b4..2c7242c24 100644 --- a/js-miniapp-sample/src/services/user/reducers.js +++ b/js-miniapp-sample/src/services/user/reducers.js @@ -1,5 +1,5 @@ -import { combineReducers } from 'redux'; import { Points } from 'js-miniapp-sdk'; +import { combineReducers } from 'redux'; import type { UserNameSuccessAction, diff --git a/js-miniapp-sdk/package.json b/js-miniapp-sdk/package.json index 4ed2c2100..779bf8d41 100644 --- a/js-miniapp-sdk/package.json +++ b/js-miniapp-sdk/package.json @@ -8,13 +8,13 @@ "types": "build/js-miniapp-sdk/src/index.d.ts", "dependencies": {}, "devDependencies": { - "@istanbuljs/nyc-config-typescript": "^1.0.1", + "@istanbuljs/nyc-config-typescript": "^1.0.2", "@types/chai": "^4.2.11", "@types/chai-as-promised": "^7.1.2", "@types/mocha": "^7.0.2", "@types/node": "^10.0.3", "@types/sinon": "^9.0.0", - "browserify": "^16.5.1", + "browserify": "^17.0.0", "chai": "^4.2.0", "chai-as-promised": "^7.1.1", "gts": "^1.1.2", @@ -24,12 +24,12 @@ "sinon": "^9.0.1", "sinon-chai": "^3.5.0", "source-map-support": "^0.5.16", - "tinyify": "3.0.0", + "tinyify": "4.0.0", "ts-node": "^8.8.1", - "tslint": "^6.1.0", + "tslint": "^6.1.3", "typedoc": "^0.19.2", "typedoc-plugin-markdown": "^3.0.11", - "typescript": "^3.8.3" + "typescript": "^4.9.4" }, "scripts": { "lint": "gts check",