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 000000000..45b6a1b6b Binary files /dev/null and b/icon.png differ 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",