From 707783f3a06be34507386c82e31a5affa02cbd19 Mon Sep 17 00:00:00 2001 From: zhongjianfei Date: Tue, 14 Sep 2021 15:37:45 +0800 Subject: [PATCH] zhongjianfei@huawei.com Signed-off-by: zhongjianfei Change-Id: I8f85afce8872ae510c2819979d8930db8a3e3519 --- .babelrc | 14 + .eslintrc | 3 +- BUILD.gn | 146 +- build.js | 40 +- gen_snapshot.sh | 17 + js_framework_build.sh | 51 +- package-lock.json | 4109 +++++++++++++++++ package.json | 42 +- prebuild_env.sh | 34 + runtime/main/app/bundle.ts | 6 +- runtime/main/app/index.ts | 49 +- runtime/main/extend/mediaquery/mediaQuery.ts | 122 +- .../extend/mediaquery/pluginMediaQuery.ts | 1 + runtime/main/extend/systemplugin/ability.js | 336 ++ .../main/extend/systemplugin/accessibility.js | 30 + runtime/main/extend/systemplugin/ai.js | 87 + runtime/main/extend/systemplugin/battery.js | 15 + .../main/extend/systemplugin/batteryinfo.js | 12 + runtime/main/extend/systemplugin/bluetooth.js | 45 + .../main/extend/systemplugin/brightness.js | 46 + runtime/main/extend/systemplugin/cipher.js | 20 + runtime/main/extend/systemplugin/data.js | 173 + .../main/extend/systemplugin/deviceInfo.js | 33 + .../main/extend/systemplugin/deviceManager.js | 85 + runtime/main/extend/systemplugin/display.js | 72 + .../systemplugin/distributedSchedule.js | 47 + runtime/main/extend/systemplugin/document.js | 42 + runtime/main/extend/systemplugin/entry.js | 3 + .../extend/systemplugin/featureAbility.js | 70 + runtime/main/extend/systemplugin/fetch.js | 118 + runtime/main/extend/systemplugin/file.js | 95 + .../main/extend/systemplugin/geolocation.js | 48 + runtime/main/extend/systemplugin/index.js | 104 + .../main/extend/systemplugin/inputmethod.js | 25 + .../main/extend/systemplugin/multimedia.js | 237 + .../main/extend/systemplugin/napi/fileio.js | 708 +++ .../main/extend/systemplugin/napi/index.js | 25 + .../main/extend/systemplugin/napi/power.js | 27 + .../extend/systemplugin/napi/runningLock.js | 46 + .../systemplugin/napi/systemParameter.js | 40 + runtime/main/extend/systemplugin/napi/util.js | 40 + .../main/extend/systemplugin/napi/worker.js | 71 + runtime/main/extend/systemplugin/net.js | 137 + runtime/main/extend/systemplugin/network.js | 29 + runtime/main/extend/systemplugin/nfc.js | 12 + .../main/extend/systemplugin/notification.js | 8 + .../extend/systemplugin/ohos/reminderAgent.js | 111 + .../main/extend/systemplugin/ohos/request.js | 198 + .../main/extend/systemplugin/pasteboard.js | 49 + runtime/main/extend/systemplugin/request.js | 35 + runtime/main/extend/systemplugin/sensor.js | 263 ++ runtime/main/extend/systemplugin/storage.js | 30 + .../main/extend/systemplugin/systemPackage.js | 12 + .../main/extend/systemplugin/systemPlugins.js | 502 -- runtime/main/extend/systemplugin/telephony.js | 19 + runtime/main/extend/systemplugin/userIAM.js | 26 + runtime/main/extend/systemplugin/utils.js | 24 + runtime/main/extend/systemplugin/vibrator.js | 12 + runtime/main/extend/systemplugin/wifi.js | 35 + runtime/main/extend/systemplugin/window.js | 327 ++ runtime/main/index.ts | 10 +- runtime/main/manage/event/CallbackManager.ts | 9 +- runtime/main/manage/event/TaskCenter.ts | 4 + runtime/main/manage/instance/life.ts | 2 +- runtime/main/model/compiler.ts | 27 +- runtime/main/model/directive.ts | 56 +- runtime/main/model/domHelper.ts | 3 - runtime/main/model/index.ts | 65 +- runtime/main/model/pageLife.ts | 6 +- runtime/main/model/vmOptions.ts | 1 + runtime/main/page/Image.ts | 4 +- runtime/main/page/OffscreenCanvas.ts | 75 + runtime/main/page/Page.ts | 12 +- runtime/main/page/api/Differ.ts | 12 +- runtime/main/page/api/misc.ts | 2 +- runtime/main/page/entry/bundle.ts | 9 + runtime/main/page/entry/init.ts | 8 +- runtime/main/page/register.ts | 5 + runtime/main/reactivity/array.js | 28 + runtime/preparation/init.ts | 101 +- runtime/preparation/methods.ts | 4 +- runtime/utils/utils.ts | 8 +- runtime/vdom/Element.ts | 156 +- runtime/vdom/NativeElementClassFactory.ts | 20 + test/ut/manage/bridge.ts | 1 + test/ut/runtime.ts | 3 +- tslint.json | 8 + 87 files changed, 9116 insertions(+), 686 deletions(-) create mode 100644 .babelrc create mode 100644 gen_snapshot.sh create mode 100644 package-lock.json create mode 100755 prebuild_env.sh create mode 100644 runtime/main/extend/systemplugin/ability.js create mode 100644 runtime/main/extend/systemplugin/accessibility.js create mode 100644 runtime/main/extend/systemplugin/ai.js create mode 100644 runtime/main/extend/systemplugin/battery.js create mode 100644 runtime/main/extend/systemplugin/batteryinfo.js create mode 100644 runtime/main/extend/systemplugin/bluetooth.js create mode 100644 runtime/main/extend/systemplugin/brightness.js create mode 100644 runtime/main/extend/systemplugin/cipher.js create mode 100644 runtime/main/extend/systemplugin/data.js create mode 100644 runtime/main/extend/systemplugin/deviceInfo.js create mode 100644 runtime/main/extend/systemplugin/deviceManager.js create mode 100644 runtime/main/extend/systemplugin/display.js create mode 100644 runtime/main/extend/systemplugin/distributedSchedule.js create mode 100644 runtime/main/extend/systemplugin/document.js create mode 100644 runtime/main/extend/systemplugin/entry.js create mode 100644 runtime/main/extend/systemplugin/featureAbility.js create mode 100644 runtime/main/extend/systemplugin/fetch.js create mode 100644 runtime/main/extend/systemplugin/file.js create mode 100644 runtime/main/extend/systemplugin/geolocation.js create mode 100644 runtime/main/extend/systemplugin/index.js create mode 100644 runtime/main/extend/systemplugin/inputmethod.js create mode 100644 runtime/main/extend/systemplugin/multimedia.js create mode 100644 runtime/main/extend/systemplugin/napi/fileio.js create mode 100644 runtime/main/extend/systemplugin/napi/index.js create mode 100644 runtime/main/extend/systemplugin/napi/power.js create mode 100644 runtime/main/extend/systemplugin/napi/runningLock.js create mode 100644 runtime/main/extend/systemplugin/napi/systemParameter.js create mode 100644 runtime/main/extend/systemplugin/napi/util.js create mode 100644 runtime/main/extend/systemplugin/napi/worker.js create mode 100644 runtime/main/extend/systemplugin/net.js create mode 100644 runtime/main/extend/systemplugin/network.js create mode 100644 runtime/main/extend/systemplugin/nfc.js create mode 100644 runtime/main/extend/systemplugin/notification.js create mode 100644 runtime/main/extend/systemplugin/ohos/reminderAgent.js create mode 100644 runtime/main/extend/systemplugin/ohos/request.js create mode 100644 runtime/main/extend/systemplugin/pasteboard.js create mode 100644 runtime/main/extend/systemplugin/request.js create mode 100644 runtime/main/extend/systemplugin/sensor.js create mode 100644 runtime/main/extend/systemplugin/storage.js create mode 100644 runtime/main/extend/systemplugin/systemPackage.js delete mode 100644 runtime/main/extend/systemplugin/systemPlugins.js create mode 100644 runtime/main/extend/systemplugin/telephony.js create mode 100644 runtime/main/extend/systemplugin/userIAM.js create mode 100644 runtime/main/extend/systemplugin/utils.js create mode 100644 runtime/main/extend/systemplugin/vibrator.js create mode 100644 runtime/main/extend/systemplugin/wifi.js create mode 100644 runtime/main/extend/systemplugin/window.js mode change 100755 => 100644 runtime/main/model/index.ts create mode 100644 runtime/main/page/OffscreenCanvas.ts create mode 100644 tslint.json diff --git a/.babelrc b/.babelrc new file mode 100644 index 00000000..3ae7b612 --- /dev/null +++ b/.babelrc @@ -0,0 +1,14 @@ + +{ + "presets": [ + [ + "env", + { + "modules": false + } + ] + ], + "plugins": [ + "external-helpers" + ] +} \ No newline at end of file diff --git a/.eslintrc b/.eslintrc index 3ca3f736..ede6f447 100644 --- a/.eslintrc +++ b/.eslintrc @@ -90,7 +90,8 @@ "wrap-iife": [2, "any"], "no-var": 2, "prefer-const": 2, - "array-bracket-spacing": 2 + "array-bracket-spacing": 2, + "no-useless-escape": 0 }, "settings": { diff --git a/BUILD.gn b/BUILD.gn index 71ccd0ab..973ae22c 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -11,31 +11,44 @@ # See the License for the specific language governing permissions and # limitations under the License. +import("//ark/ts2abc/ts2panda/ts2abc_config.gni") import("//build/ohos.gni") import("//foundation/ace/ace_engine/ace_config.gni") prebuilt_js_path = - get_label_info(":gen_jsf_c", "root_out_dir") + "/dist/strip.native.min.js" + get_label_info(":gen_jsf_c", "target_out_dir") + "/dist/strip.native.min.js" -snapshot_path = - get_label_info(":gen_snapshot", "target_out_dir") + "/strip.native.min.js" +#snapshot_path = +# get_label_info(":gen_snapshot", "target_out_dir") + "/strip.native.min.js" + +action("gen_node_modules") { + script = "//third_party/jsframework/prebuild_env.sh" + args = [] + inputs = [ + "package.json", + "package-lock.json", + ] + outputs = [ "$root_out_dir/jsframework/node_modules" ] +} action("gen_snapshot") { script = "//third_party/jsframework/js_framework_build.sh" + deps = [ ":gen_node_modules" ] + js_framework = "//third_party/jsframework/runtime" + is_mac = "false" node_modules = "//prebuilts/build-tools/common/js-framework/node_modules" + nodejs_path = "//prebuilts/build-tools/common/nodejs/node-v12.18.4-linux-x64" buildfile = "//third_party/jsframework/build.js" package_file = "//third_party/jsframework/package.json" tsconfig = "//third_party/jsframework/tsconfig.json" eslint = "//third_party/jsframework/.eslintrc" + babel = "//third_party/jsframework/.babelrc" test_file = "//third_party/jsframework/test" - nodejs_path = - "//prebuilts/build-tools/common/nodejs/node-v12.18.4-linux-x64/bin/node" - args = [ rebase_path(buildfile, root_build_dir), rebase_path(nodejs_path, root_build_dir), @@ -45,9 +58,107 @@ action("gen_snapshot") { rebase_path(tsconfig, root_build_dir), rebase_path(eslint, root_build_dir), rebase_path(test_file, root_build_dir), + rebase_path(target_out_dir, root_build_dir), + rebase_path(babel, root_build_dir), + is_mac, ] - outputs = [ snapshot_path ] + inputs = [ + # app + "runtime/main/app/App.ts", + "runtime/main/app/bundle.ts", + "runtime/main/app/helper.ts", + "runtime/main/app/index.ts", + "runtime/main/app/map.ts", + + # plugin + "runtime/main/extend/dpi/Dpi.ts", + "runtime/main/extend/dpi/index.ts", + "runtime/main/extend/i18n/I18n.ts", + "runtime/main/extend/i18n/index.ts", + "runtime/main/extend/mediaquery/mediaQuery.ts", + "runtime/main/extend/mediaquery/pluginMediaQuery.ts", + "runtime/main/extend/mediaquery/plugins.ts", + + # manage event + "runtime/main/manage/event/bridge.ts", + "runtime/main/manage/event/callbackIntercept.ts", + "runtime/main/manage/event/CallbackManager.ts", + "runtime/main/manage/event/TaskCenter.ts", + + # manage instance + "runtime/main/manage/instance/life.ts", + "runtime/main/manage/instance/misc.ts", + "runtime/main/manage/instance/register.ts", + + # vdom + "runtime/main/model/compiler.ts", + "runtime/main/model/directive.ts", + "runtime/main/model/domHelper.ts", + "runtime/main/model/events.ts", + "runtime/main/model/index.ts", + "runtime/main/model/pageLife.ts", + "runtime/main/model/selector.ts", + "runtime/main/model/vmOptions.ts", + + # page + "runtime/main/page/api/Differ.ts", + "runtime/main/page/api/index.ts", + "runtime/main/page/api/misc.ts", + "runtime/main/page/entry/bundle.ts", + "runtime/main/page/entry/init.ts", + "runtime/main/page/Image.ts", + "runtime/main/page/index.ts", + "runtime/main/page/Page.ts", + "runtime/main/page/register.ts", + + # third reactivity + "runtime/main/reactivity/array.js", + "runtime/main/reactivity/dep.js", + "runtime/main/reactivity/object.js", + "runtime/main/reactivity/observer.js", + "runtime/main/reactivity/state.js", + "runtime/main/reactivity/watcher.js", + + # third util + "runtime/main/util/index.js", + "runtime/main/util/props.js", + "runtime/main/util/shared.js", + + # framework expose + "runtime/main/config.ts", + "runtime/main/index.ts", + + # preparation of init framework + "runtime/preparation/index.ts", + "runtime/preparation/init.ts", + "runtime/preparation/methods.ts", + "runtime/preparation/service.ts", + + # utils + "runtime/utils/index.ts", + "runtime/utils/utils.ts", + + # vdom + "runtime/vdom/Comment.ts", + "runtime/vdom/Document.ts", + "runtime/vdom/DocumentElement.ts", + "runtime/vdom/Element.ts", + "runtime/vdom/index.ts", + "runtime/vdom/NativeElementClassFactory.ts", + "runtime/vdom/Node.ts", + + # global + "runtime/lib.d.ts", + + # config of compiler + ".babelrc", + ".eslintrc", + "build.js", + "tsconfig.json", + "tslint.json", + ] + outputs = [ prebuilt_js_path ] } jsfc_path = get_label_info(":jsf", "target_out_dir") + "/src/jsf.c" @@ -70,7 +181,7 @@ action("gen_jsf_c") { rebase_path(prebuilt_js_path), ] - inputs = [ snapshot_path ] + inputs = [ prebuilt_js_path ] outputs = [ jsfc_path ] } @@ -78,3 +189,22 @@ ohos_static_library("jsf") { deps = [ ":gen_jsf_c" ] sources = [ jsfc_path ] } + +ark_abc_path = + get_label_info(":ark_build", "target_out_dir") + "/strip.native.min.abc" + +ts2abc_gen_abc("ark_jsf") { + extra_visibility = [ ":*" ] # Only targets in this file can depend on this + extra_dependencies = [ ":gen_snapshot" ] + + src_js = rebase_path(prebuilt_js_path) + dst_file = rebase_path(ark_abc_path) + + in_puts = [ prebuilt_js_path ] + out_puts = [ ark_abc_path ] +} + +ohos_prebuilt_etc("ark_built") { + deps = [ ":ark_jsf" ] + source = ark_abc_path +} diff --git a/build.js b/build.js index adc4a890..73d4e330 100644 --- a/build.js +++ b/build.js @@ -25,7 +25,7 @@ const commonjs = require('rollup-plugin-commonjs'); const json = require('rollup-plugin-json'); -const buble = require('rollup-plugin-buble'); +const babel = require('rollup-plugin-babel'); const typescript = require('rollup-plugin-typescript2'); @@ -58,7 +58,32 @@ const esPlugin = eslint({ const configInput = { input: path.resolve(__dirname, 'runtime/preparation/index.ts'), onwarn, - plugins: [esPlugin, tsPlugin, json(), resolve(), commonjs(), buble(), uglify()] + plugins: [ + esPlugin, + tsPlugin, + json(), + resolve(), + commonjs(), + babel({ + exclude: 'node_moduels/**' + }), + uglify() + ] +}; + +const configJSAPIMockInput = { + input: path.resolve(__dirname, 'runtime/main/extend/systemplugin/entry.js'), + onwarn, + plugins: [ + esPlugin, + tsPlugin, + json(), + resolve(), + commonjs(), + babel({ + exclude: 'node_moduels/**' + }) + ] }; const configOutput = { @@ -67,12 +92,23 @@ const configOutput = { banner: frameworkBanner }; +const configJSAPIMockOutput = { + file: path.resolve(__dirname, 'dist/jsMockSystemPlugin.js'), + format: 'umd' +}; + rollup.rollup(configInput).then(bundle => { bundle.write(configOutput).then(() => { countSize(configOutput.file); }); }); +rollup.rollup(configJSAPIMockInput).then(bundle => { + bundle.write(configJSAPIMockOutput).then(() => { + countSize(configJSAPIMockOutput.file); + }); +}); + function countSize(filePath) { const file = path.relative(__dirname, filePath); fs.stat(filePath, function(error, stats) { diff --git a/gen_snapshot.sh b/gen_snapshot.sh new file mode 100644 index 00000000..1f09c1b0 --- /dev/null +++ b/gen_snapshot.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# Copyright (c) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +rm -rf ./gen/third_party/jsframework/snapshot +LD_LIBRARY_PATH=./clang_x64/ark/ark:./clang_x64/global/i18n:./../../libs/android_libs/ndk/libcxx/linux_x86:./../../libs/android_libs/ndk/libcxx/linux_x86_64:./../../libs/android_libs/ndk/libcxx/aosp_x86_64:./../../prebuilts/clang/ohos/linux-x86_64/llvm/lib/:$LD_LIBRARY_PATH $@ +echo "general snapshot file" diff --git a/js_framework_build.sh b/js_framework_build.sh index 196330cb..2b5a6b80 100755 --- a/js_framework_build.sh +++ b/js_framework_build.sh @@ -1,3 +1,4 @@ +#!/bin/bash # Copyright (c) 2021 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -11,37 +12,51 @@ # See the License for the specific language governing permissions and # limitations under the License. -#! /bin/bash set -e echo "copy source code..." -prebuiltsPath="../../prebuilts" - +prebuilts_path="../../prebuilts" # copy dependency file to generate dir of gn # the params come from .gn # $2 => node $4 => node_modules -cp -r $3 ./ -cp -f $5 ./ +cp -r $3 $9 +cp -f $5 $9 -if [ -d "$prebuiltsPath" ]; then +if [ -d "$prebuilts_path" ]; then echo "copy node_modules..." - cp -r $4 ./ + if [ "${11}" == 'true' ];then + cp -R $4 $9 + else + cp -r $4 $9 + fi else echo "download node_modules..." npm install cp -r ./node_modules ../../third_party/jsframework fi -cp -f $6 ./ -cp -f $7 ./ -cp -f $1 ./ -cp -r $8 ./ +cp -f $6 $9 +cp -f $7 $9 +cp -f ${10} $9 +cp -f $1 $9 +cp -r $8 $9 -if [ -d "$prebuiltsPath" ]; then +if [ -d "$prebuilts_path" ]; then echo "prebuilts exists" - $2 build.js - # run unit test - $2 ./node_modules/.bin/mocha -r ts-node/register test/lib.ts test/ut/**/*.ts test/ut/*.ts + # address problme of parallzing compile + rm -rf "$9/node-v12.18.4-linux-x64" + rm -rf "$9/node-v12.18.4-darwin-x64" + cp -r $2 $9 + cd $9 + if [ "${11}" == 'true' ];then + ./node-v12.18.4-darwin-x64/bin/node build.js + # run unit test + ./node-v12.18.4-darwin-x64/bin/node node_modules/.bin/mocha -r ts-node/register test/lib.ts test/ut/**/*.ts test/ut/*.ts + else + ./node-v12.18.4-linux-x64/bin/node build.js + # run unit test + ./node-v12.18.4-linux-x64/bin/node node_modules/.bin/mocha -r ts-node/register test/lib.ts test/ut/**/*.ts test/ut/*.ts + fi else npm run build # run unit test @@ -50,9 +65,15 @@ fi # after running, remove dependency file rm -rf ./node_modules +if [ "${11}" == 'true' ];then + rm -rf ./node-v12.18.4-darwin-x64 +else + rm -rf ./node-v12.18.4-linux-x64 +fi rm -rf ./runtime rm -rf ./tsconfig.json rm -rf ./build.js rm -rf ./test rm -rf ./.eslintrc +rm -rf ./.babelrc rm -rf ./package.json diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 00000000..3baacfe1 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,4109 @@ +{ + "name": "JSFramework", + "version": "1.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@babel/code-frame": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.13.tgz", + "integrity": "sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g==", + "dev": true, + "requires": { + "@babel/highlight": "^7.12.13" + } + }, + "@babel/helper-validator-identifier": { + "version": "7.12.11", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.12.11.tgz", + "integrity": "sha512-np/lG3uARFybkoHokJUmf1QfEvRVCPbmQeUQpKow5cQ3xWrV9i3rUHodKDJPQfTVX61qKi+UdYk8kik84n7XOw==", + "dev": true + }, + "@babel/highlight": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.12.13.tgz", + "integrity": "sha512-kocDQvIbgMKlWxXe9fof3TQ+gkIPOUSEYhJjqUjvKMez3krV7vbzYCDq39Oj11UAVK7JqPVGQPlgE85dPNlQww==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.12.11", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + } + }, + "@eslint/eslintrc": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.2.2.tgz", + "integrity": "sha512-EfB5OHNYp1F4px/LI/FEnGylop7nOqkQ1LRzCM0KccA2U8tvV8w01KBv37LbO7nW4H+YhKyo2LcJhRwjjV17QQ==", + "dev": true, + "requires": { + "ajv": "^6.12.4", + "debug": "^4.1.1", + "espree": "^7.3.0", + "globals": "^12.1.0", + "ignore": "^4.0.6", + "import-fresh": "^3.2.1", + "js-yaml": "^3.13.1", + "lodash": "^4.17.19", + "minimatch": "^3.0.4", + "strip-json-comments": "^3.1.1" + }, + "dependencies": { + "ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "dev": true + } + } + }, + "@nodelib/fs.scandir": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.4.tgz", + "integrity": "sha512-33g3pMJk3bg5nXbL/+CY6I2eJDzZAni49PfJnL5fghPTggPvBd/pFNSgJsdAgWptuFu7qq/ERvOYFlhvsLTCKA==", + "dev": true, + "requires": { + "@nodelib/fs.stat": "2.0.4", + "run-parallel": "^1.1.9" + } + }, + "@nodelib/fs.stat": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.4.tgz", + "integrity": "sha512-IYlHJA0clt2+Vg7bccq+TzRdJvv19c2INqBSsoOLp1je7xjtr7J26+WXR72MCdvU9q1qTzIWDfhMf+DRvQJK4Q==", + "dev": true + }, + "@nodelib/fs.walk": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.6.tgz", + "integrity": "sha512-8Broas6vTtW4GIXTAHDoE32hnN2M5ykgCpWGbuXHQ15vEMqr23pB76e/GZcYsZCHALv50ktd24qhEyKr6wBtow==", + "dev": true, + "requires": { + "@nodelib/fs.scandir": "2.1.4", + "fastq": "^1.6.0" + } + }, + "@sinonjs/commons": { + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.2.tgz", + "integrity": "sha512-sruwd86RJHdsVf/AtBoijDmUqJp3B6hF/DGC23C+JaegnDHaZyewCjoVGTdg3J0uz3Zs7NnIT05OBOmML72lQw==", + "dev": true, + "requires": { + "type-detect": "4.0.8" + } + }, + "@sinonjs/fake-timers": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-6.0.1.tgz", + "integrity": "sha512-MZPUxrmFubI36XS1DI3qmI0YdN1gks62JtFZvxR67ljjSNCeK6U08Zx4msEWOXuofgqUt6zPHSi1H9fbjR/NRA==", + "dev": true, + "requires": { + "@sinonjs/commons": "^1.7.0" + } + }, + "@sinonjs/formatio": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@sinonjs/formatio/-/formatio-5.0.1.tgz", + "integrity": "sha512-KaiQ5pBf1MpS09MuA0kp6KBQt2JUOQycqVG1NZXvzeaXe5LGFqAKueIS0bw4w0P9r7KuBSVdUk5QjXsUdu2CxQ==", + "dev": true, + "requires": { + "@sinonjs/commons": "^1", + "@sinonjs/samsam": "^5.0.2" + } + }, + "@sinonjs/samsam": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-5.3.1.tgz", + "integrity": "sha512-1Hc0b1TtyfBu8ixF/tpfSHTVWKwCBLY4QJbkgnE7HcwyvT2xArDxb4K7dMgqRm3szI+LJbzmW/s4xxEhv6hwDg==", + "dev": true, + "requires": { + "@sinonjs/commons": "^1.6.0", + "lodash.get": "^4.4.2", + "type-detect": "^4.0.8" + } + }, + "@sinonjs/text-encoding": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/@sinonjs/text-encoding/-/text-encoding-0.7.1.tgz", + "integrity": "sha512-+iTbntw2IZPb/anVDbypzfQa+ay64MW0Zo8aJ8gZPWMMK6/OubMVb6lUPMagqjOPnmtauXnFCACVl3O7ogjeqQ==", + "dev": true + }, + "@types/estree": { + "version": "0.0.46", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.46.tgz", + "integrity": "sha512-laIjwTQaD+5DukBZaygQ79K1Z0jb1bPEMRrkXSLjtCcZm+abyp5YbrqpSLzD42FwWW6gK/aS4NYpJ804nG2brg==", + "dev": true + }, + "@types/json-schema": { + "version": "7.0.7", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.7.tgz", + "integrity": "sha512-cxWFQVseBm6O9Gbw1IWb8r6OS4OhSt3hPZLkFApLjM8TEXROBuQGLAH2i2gZpcXdLBIrpXuTDhH7Vbm1iXmNGA==", + "dev": true + }, + "@types/node": { + "version": "14.14.25", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.25.tgz", + "integrity": "sha512-EPpXLOVqDvisVxtlbvzfyqSsFeQxltFbluZNRndIb8tr9KiBnYNLzrc1N3pyKUCww2RNrfHDViqDWWE1LCJQtQ==", + "dev": true + }, + "@types/resolve": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-0.0.8.tgz", + "integrity": "sha512-auApPaJf3NPfe18hSoJkp8EbZzer2ISk7o8mCC3M9he/a04+gbMF97NkpD2S8riMGvm4BMRI59/SZQSaLTKpsQ==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, + "@typescript-eslint/eslint-plugin": { + "version": "4.8.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.8.2.tgz", + "integrity": "sha512-gQ06QLV5l1DtvYtqOyFLXD9PdcILYqlrJj2l+CGDlPtmgLUzc1GpqciJFIRvyfvgLALpnxYINFuw+n9AZhPBKQ==", + "dev": true, + "requires": { + "@typescript-eslint/experimental-utils": "4.8.2", + "@typescript-eslint/scope-manager": "4.8.2", + "debug": "^4.1.1", + "functional-red-black-tree": "^1.0.1", + "regexpp": "^3.0.0", + "semver": "^7.3.2", + "tsutils": "^3.17.1" + } + }, + "@typescript-eslint/experimental-utils": { + "version": "4.8.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.8.2.tgz", + "integrity": "sha512-hpTw6o6IhBZEsQsjuw/4RWmceRyESfAiEzAEnXHKG1X7S5DXFaZ4IO1JO7CW1aQ604leQBzjZmuMI9QBCAJX8Q==", + "dev": true, + "requires": { + "@types/json-schema": "^7.0.3", + "@typescript-eslint/scope-manager": "4.8.2", + "@typescript-eslint/types": "4.8.2", + "@typescript-eslint/typescript-estree": "4.8.2", + "eslint-scope": "^5.0.0", + "eslint-utils": "^2.0.0" + } + }, + "@typescript-eslint/parser": { + "version": "4.8.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.8.2.tgz", + "integrity": "sha512-u0leyJqmclYr3KcXOqd2fmx6SDGBO0MUNHHAjr0JS4Crbb3C3d8dwAdlazy133PLCcPn+aOUFiHn72wcuc5wYw==", + "dev": true, + "requires": { + "@typescript-eslint/scope-manager": "4.8.2", + "@typescript-eslint/types": "4.8.2", + "@typescript-eslint/typescript-estree": "4.8.2", + "debug": "^4.1.1" + } + }, + "@typescript-eslint/scope-manager": { + "version": "4.8.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.8.2.tgz", + "integrity": "sha512-qHQ8ODi7mMin4Sq2eh/6eu03uVzsf5TX+J43xRmiq8ujng7ViQSHNPLOHGw/Wr5dFEoxq/ubKhzClIIdQy5q3g==", + "dev": true, + "requires": { + "@typescript-eslint/types": "4.8.2", + "@typescript-eslint/visitor-keys": "4.8.2" + } + }, + "@typescript-eslint/types": { + "version": "4.8.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.8.2.tgz", + "integrity": "sha512-z1/AVcVF8ju5ObaHe2fOpZYEQrwHyZ7PTOlmjd3EoFeX9sv7UekQhfrCmgUO7PruLNfSHrJGQvrW3Q7xQ8EoAw==", + "dev": true + }, + "@typescript-eslint/typescript-estree": { + "version": "4.8.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.8.2.tgz", + "integrity": "sha512-HToGNwI6fekH0dOw3XEVESUm71Onfam0AKin6f26S2FtUmO7o3cLlWgrIaT1q3vjB3wCTdww3Dx2iGq5wtUOCg==", + "dev": true, + "requires": { + "@typescript-eslint/types": "4.8.2", + "@typescript-eslint/visitor-keys": "4.8.2", + "debug": "^4.1.1", + "globby": "^11.0.1", + "is-glob": "^4.0.1", + "lodash": "^4.17.15", + "semver": "^7.3.2", + "tsutils": "^3.17.1" + } + }, + "@typescript-eslint/visitor-keys": { + "version": "4.8.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.8.2.tgz", + "integrity": "sha512-Vg+/SJTMZJEKKGHW7YC21QxgKJrSbxoYYd3MEUGtW7zuytHuEcksewq0DUmo4eh/CTNrVJGSdIY9AtRb6riWFw==", + "dev": true, + "requires": { + "@typescript-eslint/types": "4.8.2", + "eslint-visitor-keys": "^2.0.0" + } + }, + "@ungap/promise-all-settled": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz", + "integrity": "sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q==", + "dev": true + }, + "acorn-jsx": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.1.tgz", + "integrity": "sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng==", + "dev": true + }, + "ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "ansi-colors": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", + "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", + "dev": true + }, + "ansi-escapes": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.1.tgz", + "integrity": "sha512-JWF7ocqNrp8u9oqpgV+wH5ftbt+cfvv+PTjOvKLT3AdYly/LmORARfEVT1iyjwN+4MqE5UmVKoAdIBqeoCHgLA==", + "dev": true, + "requires": { + "type-fest": "^0.11.0" + }, + "dependencies": { + "type-fest": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.11.0.tgz", + "integrity": "sha512-OdjXJxnCN1AvyLSzeKIgXTXxV+99ZuXl3Hpo9XpJAv9MBcHrrJOQ5kV7ypXOuQie+AmWG25hLbiKdwYTifzcfQ==", + "dev": true + } + } + }, + "ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "dev": true + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "anymatch": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.1.tgz", + "integrity": "sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg==", + "dev": true, + "requires": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + } + }, + "arg": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", + "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", + "dev": true + }, + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "requires": { + "sprintf-js": "~1.0.2" + } + }, + "array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true + }, + "assertion-error": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", + "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", + "dev": true + }, + "astral-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", + "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", + "dev": true + }, + "babel-code-frame": { + "version": "6.26.0", + "resolved": "https://registry.npm.taobao.org/babel-code-frame/download/babel-code-frame-6.26.0.tgz", + "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", + "dev": true, + "requires": { + "chalk": "^1.1.3", + "esutils": "^2.0.2", + "js-tokens": "^3.0.2" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.nlark.com/ansi-regex/download/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.nlark.com/ansi-styles/download/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "dev": true + }, + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.nlark.com/chalk/download/chalk-1.1.3.tgz?cache=0&sync_timestamp=1627646697260&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fchalk%2Fdownload%2Fchalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "dev": true, + "requires": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + } + }, + "js-tokens": { + "version": "3.0.2", + "resolved": "https://registry.nlark.com/js-tokens/download/js-tokens-3.0.2.tgz?cache=0&sync_timestamp=1619345098261&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fjs-tokens%2Fdownload%2Fjs-tokens-3.0.2.tgz", + "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=", + "dev": true + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.nlark.com/strip-ansi/download/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.nlark.com/supports-color/download/supports-color-2.0.0.tgz?cache=0&sync_timestamp=1626703342506&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fsupports-color%2Fdownload%2Fsupports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", + "dev": true + } + } + }, + "babel-core": { + "version": "6.26.3", + "resolved": "https://registry.nlark.com/babel-core/download/babel-core-6.26.3.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fbabel-core%2Fdownload%2Fbabel-core-6.26.3.tgz", + "integrity": "sha1-suLwnjQtDwyI4vAuBneUEl51wgc=", + "dev": true, + "requires": { + "babel-code-frame": "^6.26.0", + "babel-generator": "^6.26.0", + "babel-helpers": "^6.24.1", + "babel-messages": "^6.23.0", + "babel-register": "^6.26.0", + "babel-runtime": "^6.26.0", + "babel-template": "^6.26.0", + "babel-traverse": "^6.26.0", + "babel-types": "^6.26.0", + "babylon": "^6.18.0", + "convert-source-map": "^1.5.1", + "debug": "^2.6.9", + "json5": "^0.5.1", + "lodash": "^4.17.4", + "minimatch": "^3.0.4", + "path-is-absolute": "^1.0.1", + "private": "^0.1.8", + "slash": "^1.0.0", + "source-map": "^0.5.7" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.nlark.com/debug/download/debug-2.6.9.tgz?cache=0&sync_timestamp=1625374675284&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fdebug%2Fdownload%2Fdebug-2.6.9.tgz", + "integrity": "sha1-XRKFFd8TT/Mn6QpMk/Tgd6U2NB8=", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.nlark.com/ms/download/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "slash": { + "version": "1.0.0", + "resolved": "https://registry.nlark.com/slash/download/slash-1.0.0.tgz", + "integrity": "sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU=", + "dev": true + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.nlark.com/source-map/download/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + } + } + }, + "babel-generator": { + "version": "6.26.1", + "resolved": "https://registry.nlark.com/babel-generator/download/babel-generator-6.26.1.tgz", + "integrity": "sha1-GERAjTuPDTWkBOp6wYDwh6YBvZA=", + "dev": true, + "requires": { + "babel-messages": "^6.23.0", + "babel-runtime": "^6.26.0", + "babel-types": "^6.26.0", + "detect-indent": "^4.0.0", + "jsesc": "^1.3.0", + "lodash": "^4.17.4", + "source-map": "^0.5.7", + "trim-right": "^1.0.1" + }, + "dependencies": { + "jsesc": { + "version": "1.3.0", + "resolved": "https://registry.nlark.com/jsesc/download/jsesc-1.3.0.tgz", + "integrity": "sha1-RsP+yMGJKxKwgz25vHYiF226s0s=", + "dev": true + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.nlark.com/source-map/download/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + } + } + }, + "babel-helper-builder-binary-assignment-operator-visitor": { + "version": "6.24.1", + "resolved": "https://registry.nlark.com/babel-helper-builder-binary-assignment-operator-visitor/download/babel-helper-builder-binary-assignment-operator-visitor-6.24.1.tgz", + "integrity": "sha1-zORReto1b0IgvK6KAsKzRvmlZmQ=", + "dev": true, + "requires": { + "babel-helper-explode-assignable-expression": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "babel-helper-call-delegate": { + "version": "6.24.1", + "resolved": "https://registry.nlark.com/babel-helper-call-delegate/download/babel-helper-call-delegate-6.24.1.tgz", + "integrity": "sha1-7Oaqzdx25Bw0YfiL/Fdb0Nqi340=", + "dev": true, + "requires": { + "babel-helper-hoist-variables": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" + } + }, + "babel-helper-define-map": { + "version": "6.26.0", + "resolved": "https://registry.nlark.com/babel-helper-define-map/download/babel-helper-define-map-6.26.0.tgz", + "integrity": "sha1-pfVtq0GiX5fstJjH66ypgZ+Vvl8=", + "dev": true, + "requires": { + "babel-helper-function-name": "^6.24.1", + "babel-runtime": "^6.26.0", + "babel-types": "^6.26.0", + "lodash": "^4.17.4" + } + }, + "babel-helper-explode-assignable-expression": { + "version": "6.24.1", + "resolved": "https://registry.npm.taobao.org/babel-helper-explode-assignable-expression/download/babel-helper-explode-assignable-expression-6.24.1.tgz", + "integrity": "sha1-8luCz33BBDPFX3BZLVdGQArCLKo=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" + } + }, + "babel-helper-function-name": { + "version": "6.24.1", + "resolved": "https://registry.npm.taobao.org/babel-helper-function-name/download/babel-helper-function-name-6.24.1.tgz", + "integrity": "sha1-00dbjAPtmCQqJbSDUasYOZ01gKk=", + "dev": true, + "requires": { + "babel-helper-get-function-arity": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" + } + }, + "babel-helper-get-function-arity": { + "version": "6.24.1", + "resolved": "https://registry.npm.taobao.org/babel-helper-get-function-arity/download/babel-helper-get-function-arity-6.24.1.tgz", + "integrity": "sha1-j3eCqpNAfEHTqlCQj4mwMbG2hT0=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "babel-helper-hoist-variables": { + "version": "6.24.1", + "resolved": "https://registry.nlark.com/babel-helper-hoist-variables/download/babel-helper-hoist-variables-6.24.1.tgz", + "integrity": "sha1-HssnaJydJVE+rbyZFKc/VAi+enY=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "babel-helper-optimise-call-expression": { + "version": "6.24.1", + "resolved": "https://registry.npm.taobao.org/babel-helper-optimise-call-expression/download/babel-helper-optimise-call-expression-6.24.1.tgz", + "integrity": "sha1-96E0J7qfc/j0+pk8VKl4gtEkQlc=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "babel-helper-regex": { + "version": "6.26.0", + "resolved": "https://registry.nlark.com/babel-helper-regex/download/babel-helper-regex-6.26.0.tgz", + "integrity": "sha1-MlxZ+QL4LyS3T6zu0DY5VPZJXnI=", + "dev": true, + "requires": { + "babel-runtime": "^6.26.0", + "babel-types": "^6.26.0", + "lodash": "^4.17.4" + } + }, + "babel-helper-remap-async-to-generator": { + "version": "6.24.1", + "resolved": "https://registry.nlark.com/babel-helper-remap-async-to-generator/download/babel-helper-remap-async-to-generator-6.24.1.tgz", + "integrity": "sha1-XsWBgnrXI/7N04HxySg5BnbkVRs=", + "dev": true, + "requires": { + "babel-helper-function-name": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" + } + }, + "babel-helper-replace-supers": { + "version": "6.24.1", + "resolved": "https://registry.npm.taobao.org/babel-helper-replace-supers/download/babel-helper-replace-supers-6.24.1.tgz", + "integrity": "sha1-v22/5Dk40XNpohPKiov3S2qQqxo=", + "dev": true, + "requires": { + "babel-helper-optimise-call-expression": "^6.24.1", + "babel-messages": "^6.23.0", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" + } + }, + "babel-helpers": { + "version": "6.24.1", + "resolved": "https://registry.npm.taobao.org/babel-helpers/download/babel-helpers-6.24.1.tgz", + "integrity": "sha1-NHHenK7DiOXIUOWX5Yom3fN2ArI=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1" + } + }, + "babel-loader": { + "version": "6.4.1", + "resolved": "https://registry.npm.taobao.org/babel-loader/download/babel-loader-6.4.1.tgz", + "integrity": "sha1-CzQRLVsHSKjc2/Uaz2+b1C1QuMo=", + "dev": true, + "requires": { + "find-cache-dir": "^0.1.1", + "loader-utils": "^0.2.16", + "mkdirp": "^0.5.1", + "object-assign": "^4.0.1" + } + }, + "babel-messages": { + "version": "6.23.0", + "resolved": "https://registry.nlark.com/babel-messages/download/babel-messages-6.23.0.tgz", + "integrity": "sha1-8830cDhYA1sqKVHG7F7fbGLyYw4=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-check-es2015-constants": { + "version": "6.22.0", + "resolved": "https://registry.nlark.com/babel-plugin-check-es2015-constants/download/babel-plugin-check-es2015-constants-6.22.0.tgz", + "integrity": "sha1-NRV7EBQm/S/9PaP3XH0ekYNbv4o=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-external-helpers": { + "version": "6.22.0", + "resolved": "https://registry.npm.taobao.org/babel-plugin-external-helpers/download/babel-plugin-external-helpers-6.22.0.tgz", + "integrity": "sha1-IoX0iwK9Xe3oUXXK+MYuhq3M76E=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-syntax-async-functions": { + "version": "6.13.0", + "resolved": "https://registry.npm.taobao.org/babel-plugin-syntax-async-functions/download/babel-plugin-syntax-async-functions-6.13.0.tgz", + "integrity": "sha1-ytnK0RkbWtY0vzCuCHI5HgZHvpU=", + "dev": true + }, + "babel-plugin-syntax-exponentiation-operator": { + "version": "6.13.0", + "resolved": "https://registry.nlark.com/babel-plugin-syntax-exponentiation-operator/download/babel-plugin-syntax-exponentiation-operator-6.13.0.tgz", + "integrity": "sha1-nufoM3KQ2pUoggGmpX9BcDF4MN4=", + "dev": true + }, + "babel-plugin-syntax-trailing-function-commas": { + "version": "6.22.0", + "resolved": "https://registry.nlark.com/babel-plugin-syntax-trailing-function-commas/download/babel-plugin-syntax-trailing-function-commas-6.22.0.tgz", + "integrity": "sha1-ugNgk3+NBuQBgKQ/4NVhb/9TLPM=", + "dev": true + }, + "babel-plugin-transform-async-to-generator": { + "version": "6.24.1", + "resolved": "https://registry.npm.taobao.org/babel-plugin-transform-async-to-generator/download/babel-plugin-transform-async-to-generator-6.24.1.tgz", + "integrity": "sha1-ZTbjeK/2yx1VF6wOQOs+n8jQh2E=", + "dev": true, + "requires": { + "babel-helper-remap-async-to-generator": "^6.24.1", + "babel-plugin-syntax-async-functions": "^6.8.0", + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-es2015-arrow-functions": { + "version": "6.22.0", + "resolved": "https://registry.nlark.com/babel-plugin-transform-es2015-arrow-functions/download/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz", + "integrity": "sha1-RSaSy3EdX3ncf4XkQM5BufJE0iE=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-es2015-block-scoped-functions": { + "version": "6.22.0", + "resolved": "https://registry.nlark.com/babel-plugin-transform-es2015-block-scoped-functions/download/babel-plugin-transform-es2015-block-scoped-functions-6.22.0.tgz", + "integrity": "sha1-u8UbSflk1wy42OC5ToICRs46YUE=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-es2015-block-scoping": { + "version": "6.26.0", + "resolved": "https://registry.npm.taobao.org/babel-plugin-transform-es2015-block-scoping/download/babel-plugin-transform-es2015-block-scoping-6.26.0.tgz", + "integrity": "sha1-1w9SmcEwjQXBL0Y4E7CgnnOxiV8=", + "dev": true, + "requires": { + "babel-runtime": "^6.26.0", + "babel-template": "^6.26.0", + "babel-traverse": "^6.26.0", + "babel-types": "^6.26.0", + "lodash": "^4.17.4" + } + }, + "babel-plugin-transform-es2015-classes": { + "version": "6.24.1", + "resolved": "https://registry.npm.taobao.org/babel-plugin-transform-es2015-classes/download/babel-plugin-transform-es2015-classes-6.24.1.tgz", + "integrity": "sha1-WkxYpQyclGHlZLSyo7+ryXolhNs=", + "dev": true, + "requires": { + "babel-helper-define-map": "^6.24.1", + "babel-helper-function-name": "^6.24.1", + "babel-helper-optimise-call-expression": "^6.24.1", + "babel-helper-replace-supers": "^6.24.1", + "babel-messages": "^6.23.0", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" + } + }, + "babel-plugin-transform-es2015-computed-properties": { + "version": "6.24.1", + "resolved": "https://registry.npm.taobao.org/babel-plugin-transform-es2015-computed-properties/download/babel-plugin-transform-es2015-computed-properties-6.24.1.tgz", + "integrity": "sha1-b+Ko0WiV1WNPTNmZttNICjCBWbM=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1" + } + }, + "babel-plugin-transform-es2015-destructuring": { + "version": "6.23.0", + "resolved": "https://registry.npm.taobao.org/babel-plugin-transform-es2015-destructuring/download/babel-plugin-transform-es2015-destructuring-6.23.0.tgz", + "integrity": "sha1-mXux8auWf2gtKwh2/jWNYOdlxW0=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-es2015-duplicate-keys": { + "version": "6.24.1", + "resolved": "https://registry.nlark.com/babel-plugin-transform-es2015-duplicate-keys/download/babel-plugin-transform-es2015-duplicate-keys-6.24.1.tgz", + "integrity": "sha1-c+s9MQypaePvnskcU3QabxV2Qj4=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "babel-plugin-transform-es2015-for-of": { + "version": "6.23.0", + "resolved": "https://registry.npm.taobao.org/babel-plugin-transform-es2015-for-of/download/babel-plugin-transform-es2015-for-of-6.23.0.tgz", + "integrity": "sha1-9HyVsrYT3x0+zC/bdXNiPHUkhpE=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-es2015-function-name": { + "version": "6.24.1", + "resolved": "https://registry.nlark.com/babel-plugin-transform-es2015-function-name/download/babel-plugin-transform-es2015-function-name-6.24.1.tgz", + "integrity": "sha1-g0yJhTvDaxrw86TF26qU/Y6sqos=", + "dev": true, + "requires": { + "babel-helper-function-name": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "babel-plugin-transform-es2015-literals": { + "version": "6.22.0", + "resolved": "https://registry.npm.taobao.org/babel-plugin-transform-es2015-literals/download/babel-plugin-transform-es2015-literals-6.22.0.tgz", + "integrity": "sha1-T1SgLWzWbPkVKAAZox0xklN3yi4=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-es2015-modules-amd": { + "version": "6.24.1", + "resolved": "https://registry.nlark.com/babel-plugin-transform-es2015-modules-amd/download/babel-plugin-transform-es2015-modules-amd-6.24.1.tgz", + "integrity": "sha1-Oz5UAXI5hC1tGcMBHEvS8AoA0VQ=", + "dev": true, + "requires": { + "babel-plugin-transform-es2015-modules-commonjs": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1" + } + }, + "babel-plugin-transform-es2015-modules-commonjs": { + "version": "6.26.2", + "resolved": "https://registry.nlark.com/babel-plugin-transform-es2015-modules-commonjs/download/babel-plugin-transform-es2015-modules-commonjs-6.26.2.tgz", + "integrity": "sha1-WKeThjqefKhwvcWogRF/+sJ9tvM=", + "dev": true, + "requires": { + "babel-plugin-transform-strict-mode": "^6.24.1", + "babel-runtime": "^6.26.0", + "babel-template": "^6.26.0", + "babel-types": "^6.26.0" + } + }, + "babel-plugin-transform-es2015-modules-systemjs": { + "version": "6.24.1", + "resolved": "https://registry.nlark.com/babel-plugin-transform-es2015-modules-systemjs/download/babel-plugin-transform-es2015-modules-systemjs-6.24.1.tgz", + "integrity": "sha1-/4mhQrkRmpBhlfXxBuzzBdlAfSM=", + "dev": true, + "requires": { + "babel-helper-hoist-variables": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1" + } + }, + "babel-plugin-transform-es2015-modules-umd": { + "version": "6.24.1", + "resolved": "https://registry.nlark.com/babel-plugin-transform-es2015-modules-umd/download/babel-plugin-transform-es2015-modules-umd-6.24.1.tgz", + "integrity": "sha1-rJl+YoXNGO1hdq22B9YCNErThGg=", + "dev": true, + "requires": { + "babel-plugin-transform-es2015-modules-amd": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1" + } + }, + "babel-plugin-transform-es2015-object-super": { + "version": "6.24.1", + "resolved": "https://registry.npm.taobao.org/babel-plugin-transform-es2015-object-super/download/babel-plugin-transform-es2015-object-super-6.24.1.tgz", + "integrity": "sha1-JM72muIcuDp/hgPa0CH1cusnj40=", + "dev": true, + "requires": { + "babel-helper-replace-supers": "^6.24.1", + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-es2015-parameters": { + "version": "6.24.1", + "resolved": "https://registry.nlark.com/babel-plugin-transform-es2015-parameters/download/babel-plugin-transform-es2015-parameters-6.24.1.tgz", + "integrity": "sha1-V6w1GrScrxSpfNE7CfZv3wpiXys=", + "dev": true, + "requires": { + "babel-helper-call-delegate": "^6.24.1", + "babel-helper-get-function-arity": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" + } + }, + "babel-plugin-transform-es2015-shorthand-properties": { + "version": "6.24.1", + "resolved": "https://registry.npm.taobao.org/babel-plugin-transform-es2015-shorthand-properties/download/babel-plugin-transform-es2015-shorthand-properties-6.24.1.tgz", + "integrity": "sha1-JPh11nIch2YbvZmkYi5R8U3jiqA=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "babel-plugin-transform-es2015-spread": { + "version": "6.22.0", + "resolved": "https://registry.nlark.com/babel-plugin-transform-es2015-spread/download/babel-plugin-transform-es2015-spread-6.22.0.tgz", + "integrity": "sha1-1taKmfia7cRTbIGlQujdnxdG+NE=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-es2015-sticky-regex": { + "version": "6.24.1", + "resolved": "https://registry.npm.taobao.org/babel-plugin-transform-es2015-sticky-regex/download/babel-plugin-transform-es2015-sticky-regex-6.24.1.tgz", + "integrity": "sha1-AMHNsaynERLN8M9hJsLta0V8zbw=", + "dev": true, + "requires": { + "babel-helper-regex": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "babel-plugin-transform-es2015-template-literals": { + "version": "6.22.0", + "resolved": "https://registry.nlark.com/babel-plugin-transform-es2015-template-literals/download/babel-plugin-transform-es2015-template-literals-6.22.0.tgz", + "integrity": "sha1-qEs0UPfp+PH2g51taH2oS7EjbY0=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-es2015-typeof-symbol": { + "version": "6.23.0", + "resolved": "https://registry.nlark.com/babel-plugin-transform-es2015-typeof-symbol/download/babel-plugin-transform-es2015-typeof-symbol-6.23.0.tgz", + "integrity": "sha1-3sCfHN3/lLUqxz1QXITfWdzOs3I=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-es2015-unicode-regex": { + "version": "6.24.1", + "resolved": "https://registry.npm.taobao.org/babel-plugin-transform-es2015-unicode-regex/download/babel-plugin-transform-es2015-unicode-regex-6.24.1.tgz", + "integrity": "sha1-04sS9C6nMj9yk4fxinxa4frrNek=", + "dev": true, + "requires": { + "babel-helper-regex": "^6.24.1", + "babel-runtime": "^6.22.0", + "regexpu-core": "^2.0.0" + }, + "dependencies": { + "regexpu-core": { + "version": "2.0.0", + "resolved": "https://registry.nlark.com/regexpu-core/download/regexpu-core-2.0.0.tgz", + "integrity": "sha1-SdA4g3uNz4v6W5pCE5k45uoq4kA=", + "dev": true, + "requires": { + "regenerate": "^1.2.1", + "regjsgen": "^0.2.0", + "regjsparser": "^0.1.4" + } + }, + "regjsgen": { + "version": "0.2.0", + "resolved": "https://registry.nlark.com/regjsgen/download/regjsgen-0.2.0.tgz", + "integrity": "sha1-bAFq3qxVT3WCP+N6wFuS1aTtsfc=", + "dev": true + }, + "regjsparser": { + "version": "0.1.5", + "resolved": "https://registry.npm.taobao.org/regjsparser/download/regjsparser-0.1.5.tgz", + "integrity": "sha1-fuj4Tcb6eS0/0K4ijSS9lJ6tIFw=", + "dev": true, + "requires": { + "jsesc": "~0.5.0" + } + } + } + }, + "babel-plugin-transform-exponentiation-operator": { + "version": "6.24.1", + "resolved": "https://registry.nlark.com/babel-plugin-transform-exponentiation-operator/download/babel-plugin-transform-exponentiation-operator-6.24.1.tgz", + "integrity": "sha1-KrDJx/MJj6SJB3cruBP+QejeOg4=", + "dev": true, + "requires": { + "babel-helper-builder-binary-assignment-operator-visitor": "^6.24.1", + "babel-plugin-syntax-exponentiation-operator": "^6.8.0", + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-regenerator": { + "version": "6.26.0", + "resolved": "https://registry.nlark.com/babel-plugin-transform-regenerator/download/babel-plugin-transform-regenerator-6.26.0.tgz", + "integrity": "sha1-4HA2lvveJ/Cj78rPi03KL3s6jy8=", + "dev": true, + "requires": { + "regenerator-transform": "^0.10.0" + } + }, + "babel-plugin-transform-strict-mode": { + "version": "6.24.1", + "resolved": "https://registry.npm.taobao.org/babel-plugin-transform-strict-mode/download/babel-plugin-transform-strict-mode-6.24.1.tgz", + "integrity": "sha1-1fr3qleKZbvlkc9e2uBKDGcCB1g=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "babel-preset-env": { + "version": "1.7.0", + "resolved": "https://registry.nlark.com/babel-preset-env/download/babel-preset-env-1.7.0.tgz", + "integrity": "sha1-3qefpOvriDzTXasH4mDBycBN93o=", + "dev": true, + "requires": { + "babel-plugin-check-es2015-constants": "^6.22.0", + "babel-plugin-syntax-trailing-function-commas": "^6.22.0", + "babel-plugin-transform-async-to-generator": "^6.22.0", + "babel-plugin-transform-es2015-arrow-functions": "^6.22.0", + "babel-plugin-transform-es2015-block-scoped-functions": "^6.22.0", + "babel-plugin-transform-es2015-block-scoping": "^6.23.0", + "babel-plugin-transform-es2015-classes": "^6.23.0", + "babel-plugin-transform-es2015-computed-properties": "^6.22.0", + "babel-plugin-transform-es2015-destructuring": "^6.23.0", + "babel-plugin-transform-es2015-duplicate-keys": "^6.22.0", + "babel-plugin-transform-es2015-for-of": "^6.23.0", + "babel-plugin-transform-es2015-function-name": "^6.22.0", + "babel-plugin-transform-es2015-literals": "^6.22.0", + "babel-plugin-transform-es2015-modules-amd": "^6.22.0", + "babel-plugin-transform-es2015-modules-commonjs": "^6.23.0", + "babel-plugin-transform-es2015-modules-systemjs": "^6.23.0", + "babel-plugin-transform-es2015-modules-umd": "^6.23.0", + "babel-plugin-transform-es2015-object-super": "^6.22.0", + "babel-plugin-transform-es2015-parameters": "^6.23.0", + "babel-plugin-transform-es2015-shorthand-properties": "^6.22.0", + "babel-plugin-transform-es2015-spread": "^6.22.0", + "babel-plugin-transform-es2015-sticky-regex": "^6.22.0", + "babel-plugin-transform-es2015-template-literals": "^6.22.0", + "babel-plugin-transform-es2015-typeof-symbol": "^6.23.0", + "babel-plugin-transform-es2015-unicode-regex": "^6.22.0", + "babel-plugin-transform-exponentiation-operator": "^6.22.0", + "babel-plugin-transform-regenerator": "^6.22.0", + "browserslist": "^3.2.6", + "invariant": "^2.2.2", + "semver": "^5.3.0" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.nlark.com/semver/download/semver-5.7.1.tgz?cache=0&sync_timestamp=1618847119601&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fsemver%2Fdownload%2Fsemver-5.7.1.tgz", + "integrity": "sha1-qVT5Ma66UI0we78Gnv8MAclhFvc=", + "dev": true + } + } + }, + "babel-register": { + "version": "6.26.0", + "resolved": "https://registry.npm.taobao.org/babel-register/download/babel-register-6.26.0.tgz", + "integrity": "sha1-btAhFz4vy0htestFxgCahW9kcHE=", + "dev": true, + "requires": { + "babel-core": "^6.26.0", + "babel-runtime": "^6.26.0", + "core-js": "^2.5.0", + "home-or-tmp": "^2.0.0", + "lodash": "^4.17.4", + "mkdirp": "^0.5.1", + "source-map-support": "^0.4.15" + }, + "dependencies": { + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.nlark.com/source-map/download/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + }, + "source-map-support": { + "version": "0.4.18", + "resolved": "https://registry.nlark.com/source-map-support/download/source-map-support-0.4.18.tgz", + "integrity": "sha1-Aoam3ovkJkEzhZTpfM6nXwosWF8=", + "dev": true, + "requires": { + "source-map": "^0.5.6" + } + } + } + }, + "babel-runtime": { + "version": "6.26.0", + "resolved": "https://registry.npm.taobao.org/babel-runtime/download/babel-runtime-6.26.0.tgz", + "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=", + "dev": true, + "requires": { + "core-js": "^2.4.0", + "regenerator-runtime": "^0.11.0" + } + }, + "babel-template": { + "version": "6.26.0", + "resolved": "https://registry.npm.taobao.org/babel-template/download/babel-template-6.26.0.tgz", + "integrity": "sha1-3gPi0WOWsGn0bdn/+FIfsaDjXgI=", + "dev": true, + "requires": { + "babel-runtime": "^6.26.0", + "babel-traverse": "^6.26.0", + "babel-types": "^6.26.0", + "babylon": "^6.18.0", + "lodash": "^4.17.4" + } + }, + "babel-traverse": { + "version": "6.26.0", + "resolved": "https://registry.nlark.com/babel-traverse/download/babel-traverse-6.26.0.tgz", + "integrity": "sha1-RqnL1+3MYsjlwGTi0tjQ9ANXZu4=", + "dev": true, + "requires": { + "babel-code-frame": "^6.26.0", + "babel-messages": "^6.23.0", + "babel-runtime": "^6.26.0", + "babel-types": "^6.26.0", + "babylon": "^6.18.0", + "debug": "^2.6.8", + "globals": "^9.18.0", + "invariant": "^2.2.2", + "lodash": "^4.17.4" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.nlark.com/debug/download/debug-2.6.9.tgz?cache=0&sync_timestamp=1625374675284&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fdebug%2Fdownload%2Fdebug-2.6.9.tgz", + "integrity": "sha1-XRKFFd8TT/Mn6QpMk/Tgd6U2NB8=", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "globals": { + "version": "9.18.0", + "resolved": "https://registry.nlark.com/globals/download/globals-9.18.0.tgz?cache=0&sync_timestamp=1628810148451&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fglobals%2Fdownload%2Fglobals-9.18.0.tgz", + "integrity": "sha1-qjiWs+abSH8X4x7SFD1pqOMMLYo=", + "dev": true + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.nlark.com/ms/download/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } + } + }, + "babel-types": { + "version": "6.26.0", + "resolved": "https://registry.nlark.com/babel-types/download/babel-types-6.26.0.tgz?cache=0&sync_timestamp=1618847238487&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fbabel-types%2Fdownload%2Fbabel-types-6.26.0.tgz", + "integrity": "sha1-o7Bz+Uq0nrb6Vc1lInozQ4BjJJc=", + "dev": true, + "requires": { + "babel-runtime": "^6.26.0", + "esutils": "^2.0.2", + "lodash": "^4.17.4", + "to-fast-properties": "^1.0.3" + } + }, + "babylon": { + "version": "6.18.0", + "resolved": "https://registry.nlark.com/babylon/download/babylon-6.18.0.tgz", + "integrity": "sha1-ry87iPpvXB5MY00aD46sT1WzleM=", + "dev": true + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "big.js": { + "version": "3.2.0", + "resolved": "https://registry.nlark.com/big.js/download/big.js-3.2.0.tgz?cache=0&sync_timestamp=1620132748267&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fbig.js%2Fdownload%2Fbig.js-3.2.0.tgz", + "integrity": "sha1-pfwpi4G54Nyi5FiCR4S2XFK6WI4=", + "dev": true + }, + "binary-extensions": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", + "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", + "dev": true + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "requires": { + "fill-range": "^7.0.1" + } + }, + "browser-stdout": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", + "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", + "dev": true + }, + "browserslist": { + "version": "3.2.8", + "resolved": "https://registry.nlark.com/browserslist/download/browserslist-3.2.8.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fbrowserslist%2Fdownload%2Fbrowserslist-3.2.8.tgz", + "integrity": "sha1-sABTYdZHHw9ZUnl6dvyYXx+Xj8Y=", + "dev": true, + "requires": { + "caniuse-lite": "^1.0.30000844", + "electron-to-chromium": "^1.3.47" + } + }, + "buffer-from": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", + "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", + "dev": true + }, + "builtin-modules": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.2.0.tgz", + "integrity": "sha512-lGzLKcioL90C7wMczpkY0n/oART3MbBa8R9OFGE1rJxoVI86u4WAGfEk8Wjv10eKSyTHVGkSo3bvBylCEtk7LA==", + "dev": true + }, + "callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true + }, + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true + }, + "caniuse-lite": { + "version": "1.0.30001251", + "resolved": "https://registry.nlark.com/caniuse-lite/download/caniuse-lite-1.0.30001251.tgz?cache=0&sync_timestamp=1628744198573&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fcaniuse-lite%2Fdownload%2Fcaniuse-lite-1.0.30001251.tgz", + "integrity": "sha1-aFOmBuxQiTEV22YPgsCU0Y8JbYU=", + "dev": true + }, + "chai": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.2.0.tgz", + "integrity": "sha512-XQU3bhBukrOsQCuwZndwGcCVQHyZi53fQ6Ys1Fym7E4olpIqqZZhhoFJoaKVvV17lWQoXYwgWN2nF5crA8J2jw==", + "dev": true, + "requires": { + "assertion-error": "^1.1.0", + "check-error": "^1.0.2", + "deep-eql": "^3.0.1", + "get-func-name": "^2.0.0", + "pathval": "^1.1.0", + "type-detect": "^4.0.5" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "chardet": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", + "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", + "dev": true + }, + "check-error": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", + "integrity": "sha1-V00xLt2Iu13YkS6Sht1sCu1KrII=", + "dev": true + }, + "chokidar": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.4.3.tgz", + "integrity": "sha512-DtM3g7juCXQxFVSNPNByEC2+NImtBuxQQvWlHunpJIS5Ocr0lG306cC7FCi7cEA0fzmybPUIl4txBIobk1gGOQ==", + "dev": true, + "requires": { + "anymatch": "~3.1.1", + "braces": "~3.0.2", + "fsevents": "~2.1.2", + "glob-parent": "~5.1.0", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.5.0" + } + }, + "cli-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", + "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", + "dev": true, + "requires": { + "restore-cursor": "^3.1.0" + } + }, + "cli-width": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-3.0.0.tgz", + "integrity": "sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw==", + "dev": true + }, + "cliui": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", + "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", + "dev": true, + "requires": { + "string-width": "^3.1.0", + "strip-ansi": "^5.2.0", + "wrap-ansi": "^5.1.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + } + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "dev": true + }, + "commondir": { + "version": "1.0.1", + "resolved": "https://registry.nlark.com/commondir/download/commondir-1.0.1.tgz", + "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "convert-source-map": { + "version": "1.8.0", + "resolved": "https://registry.nlark.com/convert-source-map/download/convert-source-map-1.8.0.tgz?cache=0&sync_timestamp=1624045420970&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fconvert-source-map%2Fdownload%2Fconvert-source-map-1.8.0.tgz", + "integrity": "sha1-8zc8MtIbTXgN2ABFFGhPt5HKQ2k=", + "dev": true, + "requires": { + "safe-buffer": "~5.1.1" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npm.taobao.org/safe-buffer/download/safe-buffer-5.1.2.tgz", + "integrity": "sha1-mR7GnSluAxN0fVm9/St0XDX4go0=", + "dev": true + } + } + }, + "core-js": { + "version": "2.6.12", + "resolved": "https://registry.nlark.com/core-js/download/core-js-2.6.12.tgz?cache=0&sync_timestamp=1628444181233&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fcore-js%2Fdownload%2Fcore-js-2.6.12.tgz", + "integrity": "sha1-2TM9+nsGXjR8xWgiGdb2kIWcwuw=", + "dev": true + }, + "cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + } + }, + "css-what": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/css-what/-/css-what-2.1.3.tgz", + "integrity": "sha512-a+EPoD+uZiNfh+5fxw2nO9QwFa6nJe2Or35fGY6Ipw1R3R4AGz1d1TEZrCegvw2YTmZ0jXirGYlzxxpYSHwpEg==" + }, + "debug": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", + "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "dev": true + }, + "deep-eql": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-3.0.1.tgz", + "integrity": "sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw==", + "dev": true, + "requires": { + "type-detect": "^4.0.0" + } + }, + "deep-is": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", + "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", + "dev": true + }, + "detect-indent": { + "version": "4.0.0", + "resolved": "https://registry.nlark.com/detect-indent/download/detect-indent-4.0.0.tgz", + "integrity": "sha1-920GQ1LN9Docts5hnE7jqUdd4gg=", + "dev": true, + "requires": { + "repeating": "^2.0.0" + } + }, + "diff": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "dev": true + }, + "dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "requires": { + "path-type": "^4.0.0" + } + }, + "doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "requires": { + "esutils": "^2.0.2" + } + }, + "electron-to-chromium": { + "version": "1.3.806", + "resolved": "https://registry.nlark.com/electron-to-chromium/download/electron-to-chromium-1.3.806.tgz", + "integrity": "sha1-IVAhAPEa6tbFAdHNfyUE8WyTZkI=", + "dev": true + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "emojis-list": { + "version": "2.1.0", + "resolved": "https://registry.nlark.com/emojis-list/download/emojis-list-2.1.0.tgz", + "integrity": "sha1-TapNnbAPmBmIDHn6RXrlsJof04k=", + "dev": true + }, + "enquirer": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", + "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", + "dev": true, + "requires": { + "ansi-colors": "^4.1.1" + } + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, + "eslint": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.14.0.tgz", + "integrity": "sha512-5YubdnPXrlrYAFCKybPuHIAH++PINe1pmKNc5wQRB9HSbqIK1ywAnntE3Wwua4giKu0bjligf1gLF6qxMGOYRA==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "@eslint/eslintrc": "^0.2.1", + "ajv": "^6.10.0", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.0.1", + "doctrine": "^3.0.0", + "enquirer": "^2.3.5", + "eslint-scope": "^5.1.1", + "eslint-utils": "^2.1.0", + "eslint-visitor-keys": "^2.0.0", + "espree": "^7.3.0", + "esquery": "^1.2.0", + "esutils": "^2.0.2", + "file-entry-cache": "^5.0.1", + "functional-red-black-tree": "^1.0.1", + "glob-parent": "^5.0.0", + "globals": "^12.1.0", + "ignore": "^4.0.6", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "js-yaml": "^3.13.1", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash": "^4.17.19", + "minimatch": "^3.0.4", + "natural-compare": "^1.4.0", + "optionator": "^0.9.1", + "progress": "^2.0.0", + "regexpp": "^3.1.0", + "semver": "^7.2.1", + "strip-ansi": "^6.0.0", + "strip-json-comments": "^3.1.0", + "table": "^5.2.3", + "text-table": "^0.2.0", + "v8-compile-cache": "^2.0.3" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "eslint-scope": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "dev": true, + "requires": { + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" + } + }, + "eslint-utils": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", + "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^1.1.0" + }, + "dependencies": { + "eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "dev": true + } + } + }, + "eslint-visitor-keys": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.0.0.tgz", + "integrity": "sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ==", + "dev": true + }, + "espree": { + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.1.tgz", + "integrity": "sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==", + "dev": true, + "requires": { + "acorn": "^7.4.0", + "acorn-jsx": "^5.3.1", + "eslint-visitor-keys": "^1.3.0" + }, + "dependencies": { + "acorn": { + "version": "7.4.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", + "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", + "dev": true + }, + "eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "dev": true + } + } + }, + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true + }, + "esquery": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.3.1.tgz", + "integrity": "sha512-olpvt9QG0vniUBZspVRN6lwB7hOZoTRtT+jzR+tS4ffYx2mzbw+z0XCOk44aaLYKApNX5nMm+E+P6o25ip/DHQ==", + "dev": true, + "requires": { + "estraverse": "^5.1.0" + }, + "dependencies": { + "estraverse": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", + "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", + "dev": true + } + } + }, + "esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "requires": { + "estraverse": "^5.2.0" + }, + "dependencies": { + "estraverse": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", + "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", + "dev": true + } + } + }, + "estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true + }, + "estree-walker": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.6.1.tgz", + "integrity": "sha512-SqmZANLWS0mnatqbSfRP5g8OXZC12Fgg1IwNtLsyHDzJizORW4khDfjPqJZsemPWBB2uqykUah5YpQ6epsqC/w==", + "dev": true + }, + "esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true + }, + "external-editor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", + "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==", + "dev": true, + "requires": { + "chardet": "^0.7.0", + "iconv-lite": "^0.4.24", + "tmp": "^0.0.33" + } + }, + "fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, + "fast-glob": { + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.5.tgz", + "integrity": "sha512-2DtFcgT68wiTTiwZ2hNdJfcHNke9XOfnwmBRWXhmeKM8rF0TGwmC/Qto3S7RoZKp5cilZbxzO5iTNTQsJ+EeDg==", + "dev": true, + "requires": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.0", + "merge2": "^1.3.0", + "micromatch": "^4.0.2", + "picomatch": "^2.2.1" + } + }, + "fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true + }, + "fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "dev": true + }, + "fastq": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.11.0.tgz", + "integrity": "sha512-7Eczs8gIPDrVzT+EksYBcupqMyxSHXXrHOLRRxU2/DicV8789MRBRR8+Hc2uWzUupOs4YS4JzBmBxjjCVBxD/g==", + "dev": true, + "requires": { + "reusify": "^1.0.4" + } + }, + "figures": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", + "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", + "dev": true, + "requires": { + "escape-string-regexp": "^1.0.5" + } + }, + "file-entry-cache": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-5.0.1.tgz", + "integrity": "sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g==", + "dev": true, + "requires": { + "flat-cache": "^2.0.1" + } + }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "requires": { + "to-regex-range": "^5.0.1" + } + }, + "find-cache-dir": { + "version": "0.1.1", + "resolved": "https://registry.nlark.com/find-cache-dir/download/find-cache-dir-0.1.1.tgz?cache=0&sync_timestamp=1618847023946&other_urls=https%3A%2F%2Fregistry.nlark.com%2Ffind-cache-dir%2Fdownload%2Ffind-cache-dir-0.1.1.tgz", + "integrity": "sha1-yN765XyKUqinhPnjHFfHQumToLk=", + "dev": true, + "requires": { + "commondir": "^1.0.1", + "mkdirp": "^0.5.1", + "pkg-dir": "^1.0.0" + } + }, + "find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "requires": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + } + }, + "flat": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", + "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", + "dev": true + }, + "flat-cache": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz", + "integrity": "sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA==", + "dev": true, + "requires": { + "flatted": "^2.0.0", + "rimraf": "2.6.3", + "write": "1.0.3" + } + }, + "flatted": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.2.tgz", + "integrity": "sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA==", + "dev": true + }, + "fs-extra": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-4.0.3.tgz", + "integrity": "sha512-q6rbdDd1o2mAnQreO7YADIxf/Whx4AHBiRf6d+/cVT8h44ss+lHgxf1FemcqDnQt9X3ct4McHr+JMGlYSsK7Cg==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "fsevents": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz", + "integrity": "sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==", + "dev": true, + "optional": true + }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, + "functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", + "dev": true + }, + "get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true + }, + "get-func-name": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", + "integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE=", + "dev": true + }, + "glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "glob-parent": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz", + "integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==", + "dev": true, + "requires": { + "is-glob": "^4.0.1" + } + }, + "globals": { + "version": "12.4.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", + "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==", + "dev": true, + "requires": { + "type-fest": "^0.8.1" + } + }, + "globby": { + "version": "11.0.2", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.0.2.tgz", + "integrity": "sha512-2ZThXDvvV8fYFRVIxnrMQBipZQDr7MxKAmQK1vujaj9/7eF0efG7BPUKJ7jP7G5SLF37xKDXvO4S/KKLj/Z0og==", + "dev": true, + "requires": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.1.1", + "ignore": "^5.1.4", + "merge2": "^1.3.0", + "slash": "^3.0.0" + } + }, + "graceful-fs": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", + "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", + "dev": true + }, + "growl": { + "version": "1.10.5", + "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", + "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", + "dev": true + }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, + "requires": { + "function-bind": "^1.1.1" + } + }, + "has-ansi": { + "version": "2.0.0", + "resolved": "https://registry.npm.taobao.org/has-ansi/download/has-ansi-2.0.0.tgz", + "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.nlark.com/ansi-regex/download/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + } + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "he": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", + "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", + "dev": true + }, + "home-or-tmp": { + "version": "2.0.0", + "resolved": "https://registry.npm.taobao.org/home-or-tmp/download/home-or-tmp-2.0.0.tgz?cache=0&sync_timestamp=1618599551277&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fhome-or-tmp%2Fdownload%2Fhome-or-tmp-2.0.0.tgz", + "integrity": "sha1-42w/LSyufXRqhX440Y1fMqeILbg=", + "dev": true, + "requires": { + "os-homedir": "^1.0.0", + "os-tmpdir": "^1.0.1" + }, + "dependencies": { + "os-homedir": { + "version": "1.0.2", + "resolved": "https://registry.npm.taobao.org/os-homedir/download/os-homedir-1.0.2.tgz", + "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", + "dev": true + } + } + }, + "iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dev": true, + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + }, + "ignore": { + "version": "5.1.8", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz", + "integrity": "sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==", + "dev": true + }, + "import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "dev": true, + "requires": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + } + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "inquirer": { + "version": "7.3.3", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-7.3.3.tgz", + "integrity": "sha512-JG3eIAj5V9CwcGvuOmoo6LB9kbAYT8HXffUl6memuszlwDC/qvFAJw49XJ5NROSFNPxp3iQg1GqkFhaY/CR0IA==", + "dev": true, + "requires": { + "ansi-escapes": "^4.2.1", + "chalk": "^4.1.0", + "cli-cursor": "^3.1.0", + "cli-width": "^3.0.0", + "external-editor": "^3.0.3", + "figures": "^3.0.0", + "lodash": "^4.17.19", + "mute-stream": "0.0.8", + "run-async": "^2.4.0", + "rxjs": "^6.6.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0", + "through": "^2.3.6" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "invariant": { + "version": "2.2.4", + "resolved": "https://registry.nlark.com/invariant/download/invariant-2.2.4.tgz", + "integrity": "sha1-YQ88ksk1nOHbYW5TgAjSP/NRWOY=", + "dev": true, + "requires": { + "loose-envify": "^1.0.0" + } + }, + "is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "requires": { + "binary-extensions": "^2.0.0" + } + }, + "is-core-module": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.2.0.tgz", + "integrity": "sha512-XRAfAdyyY5F5cOXn7hYQDqh2Xmii+DEfIcQGxK/uNwMHhIkPWO0g8msXcbzLe+MpGoR951MlqM/2iIlU4vKDdQ==", + "dev": true, + "requires": { + "has": "^1.0.3" + } + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true + }, + "is-finite": { + "version": "1.1.0", + "resolved": "https://registry.npm.taobao.org/is-finite/download/is-finite-1.1.0.tgz", + "integrity": "sha1-kEE1x3+0LAZB1qobzbxNqo2ggvM=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + }, + "is-glob": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", + "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "dev": true, + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-module": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-module/-/is-module-1.0.0.tgz", + "integrity": "sha1-Mlj7afeMFNW4FdZkM2tM/7ZEFZE=", + "dev": true + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true + }, + "is-plain-obj": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", + "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", + "dev": true + }, + "is-reference": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-1.2.1.tgz", + "integrity": "sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==", + "dev": true, + "requires": { + "@types/estree": "*" + } + }, + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "jest-worker": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-24.9.0.tgz", + "integrity": "sha512-51PE4haMSXcHohnSMdM42anbvZANYTqMrr52tVKPqqsPJMzoP6FYYDVqahX/HrAoKEKz3uUPzSvKs9A3qR4iVw==", + "dev": true, + "requires": { + "merge-stream": "^2.0.0", + "supports-color": "^6.1.0" + }, + "dependencies": { + "supports-color": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz", + "integrity": "sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "js-yaml": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + }, + "jsesc": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", + "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=", + "dev": true + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "dev": true + }, + "json5": { + "version": "0.5.1", + "resolved": "https://registry.npm.taobao.org/json5/download/json5-0.5.1.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fjson5%2Fdownload%2Fjson5-0.5.1.tgz", + "integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=", + "dev": true + }, + "jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6" + } + }, + "just-extend": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-4.1.1.tgz", + "integrity": "sha512-aWgeGFW67BP3e5181Ep1Fv2v8z//iBJfrvyTnq8wG86vEESwmonn1zPBJ0VfmT9CJq2FIT0VsETtrNFm2a+SHA==", + "dev": true + }, + "levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "requires": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + } + }, + "loader-utils": { + "version": "0.2.17", + "resolved": "https://registry.npm.taobao.org/loader-utils/download/loader-utils-0.2.17.tgz", + "integrity": "sha1-+G5jdNQyBabmxg6RlvF8Apm/s0g=", + "dev": true, + "requires": { + "big.js": "^3.1.3", + "emojis-list": "^2.0.0", + "json5": "^0.5.0", + "object-assign": "^4.0.1" + } + }, + "locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "requires": { + "p-locate": "^5.0.0" + } + }, + "lodash": { + "version": "4.17.20", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", + "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==", + "dev": true + }, + "lodash.get": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", + "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=", + "dev": true + }, + "log-symbols": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.0.0.tgz", + "integrity": "sha512-FN8JBzLx6CzeMrB0tg6pqlGU1wCrXW+ZXGH481kfsBqer0hToTIiHdjH4Mq8xJUbvATujKCvaREGWpGUionraA==", + "dev": true, + "requires": { + "chalk": "^4.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.nlark.com/loose-envify/download/loose-envify-1.4.0.tgz", + "integrity": "sha1-ce5R+nvkyuwaY4OffmgtgTLTDK8=", + "dev": true, + "requires": { + "js-tokens": "^3.0.0 || ^4.0.0" + } + }, + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "requires": { + "yallist": "^4.0.0" + } + }, + "magic-string": { + "version": "0.25.7", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.7.tgz", + "integrity": "sha512-4CrMT5DOHTDk4HYDlzmwu4FVCcIYI8gauveasrdCu2IKIFOJ3f0v/8MDGJCDL9oD2ppz/Av1b0Nj345H9M+XIA==", + "dev": true, + "requires": { + "sourcemap-codec": "^1.4.4" + } + }, + "make-error": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", + "dev": true + }, + "merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "dev": true + }, + "merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true + }, + "micromatch": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.2.tgz", + "integrity": "sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==", + "dev": true, + "requires": { + "braces": "^3.0.1", + "picomatch": "^2.0.5" + } + }, + "mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true + }, + "mkdirp": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", + "dev": true, + "requires": { + "minimist": "^1.2.5" + } + }, + "mocha": { + "version": "8.2.1", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-8.2.1.tgz", + "integrity": "sha512-cuLBVfyFfFqbNR0uUKbDGXKGk+UDFe6aR4os78XIrMQpZl/nv7JYHcvP5MFIAb374b2zFXsdgEGwmzMtP0Xg8w==", + "dev": true, + "requires": { + "@ungap/promise-all-settled": "1.1.2", + "ansi-colors": "4.1.1", + "browser-stdout": "1.3.1", + "chokidar": "3.4.3", + "debug": "4.2.0", + "diff": "4.0.2", + "escape-string-regexp": "4.0.0", + "find-up": "5.0.0", + "glob": "7.1.6", + "growl": "1.10.5", + "he": "1.2.0", + "js-yaml": "3.14.0", + "log-symbols": "4.0.0", + "minimatch": "3.0.4", + "ms": "2.1.2", + "nanoid": "3.1.12", + "serialize-javascript": "5.0.1", + "strip-json-comments": "3.1.1", + "supports-color": "7.2.0", + "which": "2.0.2", + "wide-align": "1.1.3", + "workerpool": "6.0.2", + "yargs": "13.3.2", + "yargs-parser": "13.1.2", + "yargs-unparser": "2.0.0" + }, + "dependencies": { + "debug": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.2.0.tgz", + "integrity": "sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "js-yaml": { + "version": "3.14.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.0.tgz", + "integrity": "sha512-/4IbIeHcD9VMHFqDR/gQ7EdZdLimOvW2DdcxFjdyyZ9NsbS+ccrXqVWDtab/lRl5AlUqmpBx8EhPaWR+OtY17A==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "mute-stream": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz", + "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==", + "dev": true + }, + "nanoid": { + "version": "3.1.12", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.12.tgz", + "integrity": "sha512-1qstj9z5+x491jfiC4Nelk+f8XBad7LN20PmyWINJEMRSf3wcAjAWysw1qaA8z6NSKe2sjq1hRSDpBH5paCb6A==", + "dev": true + }, + "natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", + "dev": true + }, + "nice-try": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", + "dev": true + }, + "nise": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/nise/-/nise-4.1.0.tgz", + "integrity": "sha512-eQMEmGN/8arp0xsvGoQ+B1qvSkR73B1nWSCh7nOt5neMCtwcQVYQGdzQMhcNscktTsWB54xnlSQFzOAPJD8nXA==", + "dev": true, + "requires": { + "@sinonjs/commons": "^1.7.0", + "@sinonjs/fake-timers": "^6.0.0", + "@sinonjs/text-encoding": "^0.7.1", + "just-extend": "^4.0.2", + "path-to-regexp": "^1.7.0" + } + }, + "normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.nlark.com/object-assign/download/object-assign-4.1.1.tgz?cache=0&sync_timestamp=1618847198142&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fobject-assign%2Fdownload%2Fobject-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "requires": { + "wrappy": "1" + } + }, + "onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "dev": true, + "requires": { + "mimic-fn": "^2.1.0" + } + }, + "optionator": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", + "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", + "dev": true, + "requires": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.3" + } + }, + "os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", + "dev": true + }, + "p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "requires": { + "yocto-queue": "^0.1.0" + } + }, + "p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "requires": { + "p-limit": "^3.0.2" + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true + }, + "parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "requires": { + "callsites": "^3.0.0" + } + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true + }, + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true + }, + "path-parse": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", + "dev": true + }, + "path-to-regexp": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.8.0.tgz", + "integrity": "sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==", + "dev": true, + "requires": { + "isarray": "0.0.1" + } + }, + "path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true + }, + "pathval": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", + "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", + "dev": true + }, + "picomatch": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", + "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==", + "dev": true + }, + "pinkie": { + "version": "2.0.4", + "resolved": "https://registry.npm.taobao.org/pinkie/download/pinkie-2.0.4.tgz", + "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", + "dev": true + }, + "pinkie-promise": { + "version": "2.0.1", + "resolved": "https://registry.npm.taobao.org/pinkie-promise/download/pinkie-promise-2.0.1.tgz", + "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", + "dev": true, + "requires": { + "pinkie": "^2.0.0" + } + }, + "pkg-dir": { + "version": "1.0.0", + "resolved": "https://registry.npm.taobao.org/pkg-dir/download/pkg-dir-1.0.0.tgz", + "integrity": "sha1-ektQio1bstYp1EcFb/TpyTFM89Q=", + "dev": true, + "requires": { + "find-up": "^1.0.0" + }, + "dependencies": { + "find-up": { + "version": "1.1.2", + "resolved": "https://registry.nlark.com/find-up/download/find-up-1.1.2.tgz?cache=0&sync_timestamp=1618846778775&other_urls=https%3A%2F%2Fregistry.nlark.com%2Ffind-up%2Fdownload%2Ffind-up-1.1.2.tgz", + "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", + "dev": true, + "requires": { + "path-exists": "^2.0.0", + "pinkie-promise": "^2.0.0" + } + }, + "path-exists": { + "version": "2.1.0", + "resolved": "https://registry.nlark.com/path-exists/download/path-exists-2.1.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fpath-exists%2Fdownload%2Fpath-exists-2.1.0.tgz", + "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", + "dev": true, + "requires": { + "pinkie-promise": "^2.0.0" + } + } + } + }, + "prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true + }, + "private": { + "version": "0.1.8", + "resolved": "https://registry.nlark.com/private/download/private-0.1.8.tgz", + "integrity": "sha1-I4Hts2ifelPWUxkAYPz4ItLzaP8=", + "dev": true + }, + "progress": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", + "dev": true + }, + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true + }, + "queue-microtask": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.2.tgz", + "integrity": "sha512-dB15eXv3p2jDlbOiNLyMabYg1/sXvppd8DP2J3EOCQ0AkuSXCW2tP7mnVouVLJKgUMY6yP0kcQDVpLCN13h4Xg==", + "dev": true + }, + "randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dev": true, + "requires": { + "safe-buffer": "^5.1.0" + } + }, + "readdirp": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.5.0.tgz", + "integrity": "sha512-cMhu7c/8rdhkHXWsY+osBhfSy0JikwpHK/5+imo+LpeasTF8ouErHrlYkwT0++njiyuDvc7OFY5T3ukvZ8qmFQ==", + "dev": true, + "requires": { + "picomatch": "^2.2.1" + } + }, + "regenerate": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.2.tgz", + "integrity": "sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A==", + "dev": true + }, + "regenerator-runtime": { + "version": "0.11.1", + "resolved": "https://registry.nlark.com/regenerator-runtime/download/regenerator-runtime-0.11.1.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fregenerator-runtime%2Fdownload%2Fregenerator-runtime-0.11.1.tgz", + "integrity": "sha1-vgWtf5v30i4Fb5cmzuUBf78Z4uk=", + "dev": true + }, + "regenerator-transform": { + "version": "0.10.1", + "resolved": "https://registry.nlark.com/regenerator-transform/download/regenerator-transform-0.10.1.tgz?cache=0&sync_timestamp=1627057502723&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fregenerator-transform%2Fdownload%2Fregenerator-transform-0.10.1.tgz", + "integrity": "sha1-HkmWg3Ix2ot/PPQRTXG1aRoGgN0=", + "dev": true, + "requires": { + "babel-runtime": "^6.18.0", + "babel-types": "^6.19.0", + "private": "^0.1.6" + } + }, + "regexpp": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz", + "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==", + "dev": true + }, + "repeating": { + "version": "2.0.1", + "resolved": "https://registry.nlark.com/repeating/download/repeating-2.0.1.tgz", + "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=", + "dev": true, + "requires": { + "is-finite": "^1.0.0" + } + }, + "require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", + "dev": true + }, + "require-main-filename": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", + "dev": true + }, + "resolve": { + "version": "1.19.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.19.0.tgz", + "integrity": "sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg==", + "dev": true, + "requires": { + "is-core-module": "^2.1.0", + "path-parse": "^1.0.6" + } + }, + "resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true + }, + "restore-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", + "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", + "dev": true, + "requires": { + "onetime": "^5.1.0", + "signal-exit": "^3.0.2" + } + }, + "reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true + }, + "rimraf": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", + "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, + "rollup": { + "version": "2.32.1", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.32.1.tgz", + "integrity": "sha512-Op2vWTpvK7t6/Qnm1TTh7VjEZZkN8RWgf0DHbkKzQBwNf748YhXbozHVefqpPp/Fuyk/PQPAnYsBxAEtlMvpUw==", + "dev": true, + "requires": { + "fsevents": "~2.1.2" + } + }, + "rollup-plugin-babel": { + "version": "3.0.7", + "resolved": "https://registry.npm.taobao.org/rollup-plugin-babel/download/rollup-plugin-babel-3.0.7.tgz", + "integrity": "sha1-WxNhHxq4kiSX6dFRl65diiP+Ox4=", + "dev": true, + "requires": { + "rollup-pluginutils": "^1.5.0" + }, + "dependencies": { + "estree-walker": { + "version": "0.2.1", + "resolved": "https://registry.npm.taobao.org/estree-walker/download/estree-walker-0.2.1.tgz", + "integrity": "sha1-va/oCVOD2EFNXcLs9MkXO225QS4=", + "dev": true + }, + "rollup-pluginutils": { + "version": "1.5.2", + "resolved": "https://registry.npm.taobao.org/rollup-pluginutils/download/rollup-pluginutils-1.5.2.tgz", + "integrity": "sha1-HhVud4+UtyVb+hs9AXi+j1xVJAg=", + "dev": true, + "requires": { + "estree-walker": "^0.2.1", + "minimatch": "^3.0.2" + } + } + } + }, + "rollup-plugin-commonjs": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/rollup-plugin-commonjs/-/rollup-plugin-commonjs-10.1.0.tgz", + "integrity": "sha512-jlXbjZSQg8EIeAAvepNwhJj++qJWNJw1Cl0YnOqKtP5Djx+fFGkp3WRh+W0ASCaFG5w1jhmzDxgu3SJuVxPF4Q==", + "dev": true, + "requires": { + "estree-walker": "^0.6.1", + "is-reference": "^1.1.2", + "magic-string": "^0.25.2", + "resolve": "^1.11.0", + "rollup-pluginutils": "^2.8.1" + } + }, + "rollup-plugin-eslint": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/rollup-plugin-eslint/-/rollup-plugin-eslint-7.0.0.tgz", + "integrity": "sha512-u35kXiY11ULeNQGTlRkYx7uGJ/hS/Dx3wj8f9YVC3oMLTGU9fOqQJsAKYtBFZU3gJ8Vt3gu8ppB1vnKl+7gatQ==", + "dev": true, + "requires": { + "eslint": "^6.0.0", + "rollup-pluginutils": "^2.7.1" + }, + "dependencies": { + "acorn": { + "version": "7.4.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", + "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", + "dev": true + }, + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "astral-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", + "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", + "dev": true + }, + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, + "requires": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } + } + }, + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "dev": true + }, + "eslint": { + "version": "6.8.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-6.8.0.tgz", + "integrity": "sha512-K+Iayyo2LtyYhDSYwz5D5QdWw0hCacNzyq1Y821Xna2xSJj7cijoLLYmLxTQgcgZ9mC61nryMy9S7GRbYpI5Ig==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "ajv": "^6.10.0", + "chalk": "^2.1.0", + "cross-spawn": "^6.0.5", + "debug": "^4.0.1", + "doctrine": "^3.0.0", + "eslint-scope": "^5.0.0", + "eslint-utils": "^1.4.3", + "eslint-visitor-keys": "^1.1.0", + "espree": "^6.1.2", + "esquery": "^1.0.1", + "esutils": "^2.0.2", + "file-entry-cache": "^5.0.1", + "functional-red-black-tree": "^1.0.1", + "glob-parent": "^5.0.0", + "globals": "^12.1.0", + "ignore": "^4.0.6", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "inquirer": "^7.0.0", + "is-glob": "^4.0.0", + "js-yaml": "^3.13.1", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.3.0", + "lodash": "^4.17.14", + "minimatch": "^3.0.4", + "mkdirp": "^0.5.1", + "natural-compare": "^1.4.0", + "optionator": "^0.8.3", + "progress": "^2.0.0", + "regexpp": "^2.0.1", + "semver": "^6.1.2", + "strip-ansi": "^5.2.0", + "strip-json-comments": "^3.0.1", + "table": "^5.2.3", + "text-table": "^0.2.0", + "v8-compile-cache": "^2.0.3" + } + }, + "eslint-utils": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.4.3.tgz", + "integrity": "sha512-fbBN5W2xdY45KulGXmLHZ3c3FHfVYmKg0IrAKGOkT/464PQsx2UeIzfz1RmEci+KLm1bBaAzZAh8+/E+XAeZ8Q==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^1.1.0" + } + }, + "eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "dev": true + }, + "espree": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-6.2.1.tgz", + "integrity": "sha512-ysCxRQY3WaXJz9tdbWOwuWr5Y/XrPTGX9Kiz3yoUXwW0VZ4w30HTkQLaGx/+ttFjF8i+ACbArnB4ce68a9m5hw==", + "dev": true, + "requires": { + "acorn": "^7.1.1", + "acorn-jsx": "^5.2.0", + "eslint-visitor-keys": "^1.1.0" + } + }, + "file-entry-cache": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-5.0.1.tgz", + "integrity": "sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g==", + "dev": true, + "requires": { + "flat-cache": "^2.0.1" + } + }, + "flat-cache": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz", + "integrity": "sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA==", + "dev": true, + "requires": { + "flatted": "^2.0.0", + "rimraf": "2.6.3", + "write": "1.0.3" + } + }, + "flatted": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.2.tgz", + "integrity": "sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA==", + "dev": true + }, + "ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "levn": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", + "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", + "dev": true, + "requires": { + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2" + } + }, + "optionator": { + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", + "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", + "dev": true, + "requires": { + "deep-is": "~0.1.3", + "fast-levenshtein": "~2.0.6", + "levn": "~0.3.0", + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2", + "word-wrap": "~1.2.3" + } + }, + "path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "dev": true + }, + "prelude-ls": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", + "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", + "dev": true + }, + "regexpp": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz", + "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==", + "dev": true + }, + "rimraf": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", + "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + }, + "shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "dev": true, + "requires": { + "shebang-regex": "^1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "dev": true + }, + "slice-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz", + "integrity": "sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.0", + "astral-regex": "^1.0.0", + "is-fullwidth-code-point": "^2.0.0" + } + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + }, + "table": { + "version": "5.4.6", + "resolved": "https://registry.npmjs.org/table/-/table-5.4.6.tgz", + "integrity": "sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug==", + "dev": true, + "requires": { + "ajv": "^6.10.2", + "lodash": "^4.17.14", + "slice-ansi": "^2.1.0", + "string-width": "^3.0.0" + } + }, + "type-check": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", + "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", + "dev": true, + "requires": { + "prelude-ls": "~1.1.2" + } + }, + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + } + } + }, + "rollup-plugin-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/rollup-plugin-json/-/rollup-plugin-json-4.0.0.tgz", + "integrity": "sha512-hgb8N7Cgfw5SZAkb3jf0QXii6QX/FOkiIq2M7BAQIEydjHvTyxXHQiIzZaTFgx1GK0cRCHOCBHIyEkkLdWKxow==", + "dev": true, + "requires": { + "rollup-pluginutils": "^2.5.0" + } + }, + "rollup-plugin-node-resolve": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/rollup-plugin-node-resolve/-/rollup-plugin-node-resolve-5.2.0.tgz", + "integrity": "sha512-jUlyaDXts7TW2CqQ4GaO5VJ4PwwaV8VUGA7+km3n6k6xtOEacf61u0VXwN80phY/evMcaS+9eIeJ9MOyDxt5Zw==", + "dev": true, + "requires": { + "@types/resolve": "0.0.8", + "builtin-modules": "^3.1.0", + "is-module": "^1.0.0", + "resolve": "^1.11.1", + "rollup-pluginutils": "^2.8.1" + } + }, + "rollup-plugin-tslint": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/rollup-plugin-tslint/-/rollup-plugin-tslint-0.2.2.tgz", + "integrity": "sha512-1yF7bnDALlqgReMIsNDCNXOYqzCw9A8Ur5AS4RzlY7IsRBKB0yb+wx8ZCh0zBcXCeJP5tx36oqec4aX2Pzzttw==", + "dev": true, + "requires": { + "rollup-pluginutils": "^2.0.1", + "tslint": "^5.9.1", + "typescript": "^3.0.0" + }, + "dependencies": { + "typescript": { + "version": "3.9.7", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.7.tgz", + "integrity": "sha512-BLbiRkiBzAwsjut4x/dsibSTB6yWpwT5qWmC2OfuCg3GgVQCSgMs4vEctYPhsaGtd0AeuuHMkjZ2h2WG8MSzRw==", + "dev": true + } + } + }, + "rollup-plugin-typescript2": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/rollup-plugin-typescript2/-/rollup-plugin-typescript2-0.9.0.tgz", + "integrity": "sha512-nM2oP7mduvmAv4HSCmJFRJ18XRhULIuoMMDuqP+wQIjuJbKdm3wJne0dRym2q8DgUmarxE3N3IzJs2xq/GuyPQ==", + "dev": true, + "requires": { + "fs-extra": "^4.0.2", + "resolve": "^1.5.0", + "rollup-pluginutils": "^2.0.1", + "tslib": "^1.8.0" + }, + "dependencies": { + "tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + } + } + }, + "rollup-plugin-uglify": { + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/rollup-plugin-uglify/-/rollup-plugin-uglify-6.0.4.tgz", + "integrity": "sha512-ddgqkH02klveu34TF0JqygPwZnsbhHVI6t8+hGTcYHngPkQb5MIHI0XiztXIN/d6V9j+efwHAqEL7LspSxQXGw==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "jest-worker": "^24.0.0", + "serialize-javascript": "^2.1.2", + "uglify-js": "^3.4.9" + }, + "dependencies": { + "serialize-javascript": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-2.1.2.tgz", + "integrity": "sha512-rs9OggEUF0V4jUSecXazOYsLfu7OGK2qIn3c7IPBiffz32XniEp/TX9Xmc9LQfK2nQ2QKHvZ2oygKUGU0lG4jQ==", + "dev": true + } + } + }, + "rollup-pluginutils": { + "version": "2.8.2", + "resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.8.2.tgz", + "integrity": "sha512-EEp9NhnUkwY8aif6bxgovPHMoMoNr2FulJziTndpt5H9RdwC47GSGuII9XxpSdzVGM0GWrNPHV6ie1LTNJPaLQ==", + "dev": true, + "requires": { + "estree-walker": "^0.6.1" + } + }, + "run-async": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz", + "integrity": "sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==", + "dev": true + }, + "run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "requires": { + "queue-microtask": "^1.2.2" + } + }, + "rxjs": { + "version": "6.6.3", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.3.tgz", + "integrity": "sha512-trsQc+xYYXZ3urjOiJOuCOa5N3jAZ3eiSpQB5hIT8zGlL2QfnHLJ2r7GMkBGuIausdJN1OneaI6gQlsqNHHmZQ==", + "dev": true, + "requires": { + "tslib": "^1.9.0" + }, + "dependencies": { + "tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + } + } + }, + "safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true + }, + "semver": { + "version": "7.3.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.4.tgz", + "integrity": "sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + }, + "serialize-javascript": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-5.0.1.tgz", + "integrity": "sha512-SaaNal9imEO737H2c05Og0/8LUXG7EnsZyMa8MzkmuHoELfT6txuj0cMqRj6zfPKnmQ1yasR4PCJc8x+M4JSPA==", + "dev": true, + "requires": { + "randombytes": "^2.1.0" + } + }, + "set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", + "dev": true + }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true + }, + "signal-exit": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", + "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==", + "dev": true + }, + "sinon": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/sinon/-/sinon-9.2.2.tgz", + "integrity": "sha512-9Owi+RisvCZpB0bdOVFfL314I6I4YoRlz6Isi4+fr8q8YQsDPoCe5UnmNtKHRThX3negz2bXHWIuiPa42vM8EQ==", + "dev": true, + "requires": { + "@sinonjs/commons": "^1.8.1", + "@sinonjs/fake-timers": "^6.0.1", + "@sinonjs/formatio": "^5.0.1", + "@sinonjs/samsam": "^5.3.0", + "diff": "^4.0.2", + "nise": "^4.0.4", + "supports-color": "^7.1.0" + }, + "dependencies": { + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true + }, + "slice-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz", + "integrity": "sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.0", + "astral-regex": "^1.0.0", + "is-fullwidth-code-point": "^2.0.0" + }, + "dependencies": { + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + } + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "source-map-support": { + "version": "0.5.19", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz", + "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==", + "dev": true, + "requires": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "sourcemap-codec": { + "version": "1.4.8", + "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz", + "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==", + "dev": true + }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + }, + "string-width": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", + "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" + } + }, + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.0" + } + }, + "strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + }, + "table": { + "version": "5.4.6", + "resolved": "https://registry.npmjs.org/table/-/table-5.4.6.tgz", + "integrity": "sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug==", + "dev": true, + "requires": { + "ajv": "^6.10.2", + "lodash": "^4.17.14", + "slice-ansi": "^2.1.0", + "string-width": "^3.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + } + } + }, + "text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", + "dev": true + }, + "through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", + "dev": true + }, + "tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "dev": true, + "requires": { + "os-tmpdir": "~1.0.2" + } + }, + "to-fast-properties": { + "version": "1.0.3", + "resolved": "https://registry.nlark.com/to-fast-properties/download/to-fast-properties-1.0.3.tgz?cache=0&sync_timestamp=1628418893613&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fto-fast-properties%2Fdownload%2Fto-fast-properties-1.0.3.tgz", + "integrity": "sha1-uDVx+k2MJbguIxsG46MFXeTKGkc=", + "dev": true + }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "requires": { + "is-number": "^7.0.0" + } + }, + "trim-right": { + "version": "1.0.1", + "resolved": "https://registry.nlark.com/trim-right/download/trim-right-1.0.1.tgz", + "integrity": "sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM=", + "dev": true + }, + "ts-node": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-9.0.0.tgz", + "integrity": "sha512-/TqB4SnererCDR/vb4S/QvSZvzQMJN8daAslg7MeaiHvD8rDZsSfXmNeNumyZZzMned72Xoq/isQljYSt8Ynfg==", + "dev": true, + "requires": { + "arg": "^4.1.0", + "diff": "^4.0.1", + "make-error": "^1.1.1", + "source-map-support": "^0.5.17", + "yn": "3.1.1" + } + }, + "tslib": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.0.3.tgz", + "integrity": "sha512-uZtkfKblCEQtZKBF6EBXVZeQNl82yqtDQdv+eck8u7tdPxjLu2/lp5/uPW+um2tpuxINHWy3GhiccY7QgEaVHQ==", + "dev": true + }, + "tslint": { + "version": "5.20.1", + "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.20.1.tgz", + "integrity": "sha512-EcMxhzCFt8k+/UP5r8waCf/lzmeSyVlqxqMEDQE7rWYiQky8KpIBz1JAoYXfROHrPZ1XXd43q8yQnULOLiBRQg==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "builtin-modules": "^1.1.1", + "chalk": "^2.3.0", + "commander": "^2.12.1", + "diff": "^4.0.1", + "glob": "^7.1.1", + "js-yaml": "^3.13.1", + "minimatch": "^3.0.4", + "mkdirp": "^0.5.1", + "resolve": "^1.3.2", + "semver": "^5.3.0", + "tslib": "^1.8.0", + "tsutils": "^2.29.0" + }, + "dependencies": { + "builtin-modules": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", + "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", + "dev": true + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + }, + "tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + }, + "tsutils": { + "version": "2.29.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.29.0.tgz", + "integrity": "sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA==", + "dev": true, + "requires": { + "tslib": "^1.8.1" + } + } + } + }, + "tsutils": { + "version": "3.20.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.20.0.tgz", + "integrity": "sha512-RYbuQuvkhuqVeXweWT3tJLKOEJ/UUw9GjNEZGWdrLLlM+611o1gwLHBpxoFJKKl25fLprp2eVthtKs5JOrNeXg==", + "dev": true, + "requires": { + "tslib": "^1.8.1" + }, + "dependencies": { + "tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + } + } + }, + "type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "requires": { + "prelude-ls": "^1.2.1" + } + }, + "type-detect": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "dev": true + }, + "type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "dev": true + }, + "typescript": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.1.2.tgz", + "integrity": "sha512-thGloWsGH3SOxv1SoY7QojKi0tc+8FnOmiarEGMbd/lar7QOEd3hvlx3Fp5y6FlDUGl9L+pd4n2e+oToGMmhRQ==", + "dev": true + }, + "uglify-js": { + "version": "3.12.6", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.12.6.tgz", + "integrity": "sha512-aqWHe3DfQmZUDGWBbabZ2eQnJlQd1fKlMUu7gV+MiTuDzdgDw31bI3wA2jLLsV/hNcDP26IfyEgSVoft5+0SVw==", + "dev": true + }, + "universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "dev": true + }, + "uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "requires": { + "punycode": "^2.1.0" + } + }, + "v8-compile-cache": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.2.0.tgz", + "integrity": "sha512-gTpR5XQNKFwOd4clxfnhaqvfqMpqEwr4tOtCyz4MtYZX2JYhfr1JvBFKdS+7K/9rfpZR3VLX+YWBbKoxCgS43Q==", + "dev": true + }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + }, + "which-module": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", + "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", + "dev": true + }, + "wide-align": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", + "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", + "dev": true, + "requires": { + "string-width": "^1.0.2 || 2" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + } + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + } + } + }, + "word-wrap": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", + "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "dev": true + }, + "workerpool": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.0.2.tgz", + "integrity": "sha512-DSNyvOpFKrNusaaUwk+ej6cBj1bmhLcBfj80elGk+ZIo5JSkq+unB1dLKEOcNfJDZgjGICfhQ0Q5TbP0PvF4+Q==", + "dev": true + }, + "wrap-ansi": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", + "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.0", + "string-width": "^3.0.0", + "strip-ansi": "^5.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + } + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "write": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/write/-/write-1.0.3.tgz", + "integrity": "sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig==", + "dev": true, + "requires": { + "mkdirp": "^0.5.1" + } + }, + "y18n": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.1.tgz", + "integrity": "sha512-wNcy4NvjMYL8gogWWYAO7ZFWFfHcbdbE57tZO8e4cbpj8tfUcwrwqSl3ad8HxpYWCdXcJUCeKKZS62Av1affwQ==", + "dev": true + }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, + "yargs": { + "version": "13.3.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz", + "integrity": "sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==", + "dev": true, + "requires": { + "cliui": "^5.0.0", + "find-up": "^3.0.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^3.0.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^13.1.2" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "dev": true + }, + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "requires": { + "locate-path": "^3.0.0" + } + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "dev": true, + "requires": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + } + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "dev": true, + "requires": { + "p-limit": "^2.0.0" + } + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + } + } + }, + "yargs-parser": { + "version": "13.1.2", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.2.tgz", + "integrity": "sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + }, + "yargs-unparser": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz", + "integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==", + "dev": true, + "requires": { + "camelcase": "^6.0.0", + "decamelize": "^4.0.0", + "flat": "^5.0.2", + "is-plain-obj": "^2.1.0" + }, + "dependencies": { + "camelcase": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.2.0.tgz", + "integrity": "sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg==", + "dev": true + }, + "decamelize": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", + "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", + "dev": true + } + } + }, + "yn": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", + "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", + "dev": true + }, + "yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true + } + } +} diff --git a/package.json b/package.json index 412ff2df..3d59235c 100644 --- a/package.json +++ b/package.json @@ -20,24 +20,28 @@ "css-what": "2.1.3" }, "devDependencies": { - "@typescript-eslint/eslint-plugin": "4.8.2", - "@typescript-eslint/parser": "4.8.2", - "buble": "0.20.0", - "chai": "4.2.0", - "eslint": "7.14.0", - "mocha": "8.2.1", - "rollup": "2.32.1", - "rollup-plugin-buble": "0.19.8", - "rollup-plugin-commonjs": "10.1.0", - "rollup-plugin-eslint": "7.0.0", - "rollup-plugin-json": "4.0.0", - "rollup-plugin-node-resolve": "5.2.0", - "rollup-plugin-tslint": "0.2.2", - "rollup-plugin-typescript2": "0.9.0", - "rollup-plugin-uglify": "6.0.4", - "sinon": "9.2.2", - "ts-node": "9.0.0", - "tslib": "2.0.3", - "typescript": "4.1.2" + "@typescript-eslint/eslint-plugin": "^4.8.2", + "@typescript-eslint/parser": "^4.8.2", + "babel-core": "^6.26.3", + "babel-loader": "^6.4.1", + "babel-plugin-external-helpers": "^6.22.0", + "babel-preset-env": "^1.7.0", + "babel-runtime": "^6.26.0", + "chai": "^4.2.0", + "eslint": "^7.14.0", + "mocha": "^8.2.1", + "rollup": "^2.32.1", + "rollup-plugin-babel": "^3.0.7", + "rollup-plugin-commonjs": "^10.1.0", + "rollup-plugin-eslint": "^7.0.0", + "rollup-plugin-json": "^4.0.0", + "rollup-plugin-node-resolve": "^5.2.0", + "rollup-plugin-tslint": "^0.2.2", + "rollup-plugin-typescript2": "^0.9.0", + "rollup-plugin-uglify": "^6.0.4", + "sinon": "^9.2.2", + "ts-node": "^9.0.0", + "tslib": "^2.0.3", + "typescript": "^4.1.2" } } diff --git a/prebuild_env.sh b/prebuild_env.sh new file mode 100755 index 00000000..b4538225 --- /dev/null +++ b/prebuild_env.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Copyright (c) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -e + +script_path=$(cd $(dirname $0);pwd) +code_dir=$(dirname ${script_path})/../ + +cd ${code_dir}/third_party/jsframework/ +export PATH=${code_dir}/prebuilts/build-tools/common/nodejs/node-v12.18.4-linux-x64/bin:$PATH +npm config set registry http://registry.npm.taobao.org +npm install + +cd ${code_dir} +if [ -d "${code_dir}/prebuilts/build-tools/common/js-framework" ]; then + echo -e "\n" + echo "${code_dir}/prebuilts/build-tools/common/js-framework already exist, it will be replaced with node-${node_js_ver}" + /bin/rm -rf ${code_dir}/prebuilts/build-tools/common/js-framework + echo -e "\n" +fi + +mkdir -p ${code_dir}/prebuilts/build-tools/common/js-framework +/bin/cp -rf ${code_dir}/third_party/jsframework/node_modules ${code_dir}/prebuilts/build-tools/common/js-framework/ diff --git a/runtime/main/app/bundle.ts b/runtime/main/app/bundle.ts index e63ec6eb..a7b382f1 100644 --- a/runtime/main/app/bundle.ts +++ b/runtime/main/app/bundle.ts @@ -37,7 +37,7 @@ import { updateLocale, updateDpi } from './index'; import Page from '../page/index'; import { App } from './App'; -const APP_LIFE_CYCLE_TYPES: string[] = ['onCreate', 'onError', 'onDestroy']; +const APP_LIFE_CYCLE_TYPES: string[] = ['onCreate', 'onError', 'onDestroy', 'onShow', 'onHide']; /** * Parse app page code. @@ -98,6 +98,10 @@ export function bootstrap(page: Page, packageName: string, name: string, config: // Init global data when page first load, // global.aceapp.$data means config.data in manifest.json, can add new data by this.$app.$data api. if (page.options && page.options.appCreate) { + const getApp = function() { + return global.aceapp; + }; + global.getApp = getApp; global.aceapp = {}; global.aceapp.$data = page.options.appGlobalData || {}; diff --git a/runtime/main/app/index.ts b/runtime/main/app/index.ts index 839da988..bdc572cb 100644 --- a/runtime/main/app/index.ts +++ b/runtime/main/app/index.ts @@ -24,7 +24,7 @@ import { getPageGlobal } from './helper'; import { App } from './App'; import Page from '../page/index'; import { destroy } from '../page/api/index'; -import { mockSystemPlugin } from '../extend/systemplugin/systemPlugins'; +import { mockSystemPlugin } from '../extend/systemplugin/index'; import { compileBundle } from '../page/entry/init'; import { removePrefix } from '../util/index'; import { requireModule } from '../page/register'; @@ -43,6 +43,7 @@ export interface MediaQueryInfo { 'isInit': boolean; 'resolution': string; 'aspectRatio': string; + 'darkMode': string; } /** @@ -52,7 +53,7 @@ export interface Options extends MediaQueryInfo { 'appInstanceId': string; 'packageName': string; 'appCreate': boolean; - 'appCode': string; + 'appCode': string | Function; 'pcPreview': string; 'resourcesConfiguration': object; 'i18n': object; @@ -93,13 +94,13 @@ export function appCreate(page: Page, options: Options, data: object, services: mockSystemPlugin(); } const packageName: string = page.packageName; - const appPage: Page = new Page(options.appInstanceId, options, packageName); + const appPage: Page = new Page(options.appInstanceId, options, packageName, data); pageMap.set(appPage.id, appPage); Log.debug(`Create a page with: ${packageName}.`); appMap[packageName] = new App(packageName, options.appInstanceId); const timerAPIs: object = genTimerAPI(appPage); appMap[packageName].setTimer(timerAPIs); - const code: string = options.appCode; + const code = options.appCode; global.__appProto__ = getPageGlobal(packageName); // prepare page env methods @@ -117,11 +118,15 @@ export function appCreate(page: Page, options: Options, data: object, services: $app_require$: appRequireModule }; - // Function with code and use strict mode. - const functionCode: string = `(function(global){\n\n"use strict";\n\n ${code} \n\n})(this.__appProto__)`; - // Compile js bundle code and get result. - compileBundle(functionCode, 'app.js', parseOptions, timerAPIs, services); + if (typeof code === 'function') { + Log.info('call Function directly when appCreate'); + code.call(global, parseOptions); + } else { + // Function with code and use strict mode. + const functionCode: string = `(function(global){\n\n"use strict";\n\n ${code} \n\n})(this.__appProto__)`; + compileBundle(functionCode, 'app.js', parseOptions, timerAPIs, services); + } } /** @@ -140,6 +145,34 @@ export function appError(packageName: string, errors: any): void { app.emitEvent('hook:onError', errors); } +/** + * Emit onShow event. + * @param {string} packageName - Package name. + */ +export function appShow(packageName: string): void { + Log.debug(`Show an app with: ${packageName}.`); + const app: App = appMap[packageName]; + if (!app) { + Log.debug(`Show an app error ${packageName}.`); + return; + } + app.emitEvent('hook:onShow'); +} + +/** + * Emit onHide event. + * @param {string} packageName - Package name. + */ +export function appHide(packageName: string): void { + Log.debug(`Hide an app with: ${packageName}.`); + const app: App = appMap[packageName]; + if (!app) { + Log.debug(`Hide an app error ${packageName}.`); + return; + } + app.emitEvent('hook:onHide'); +} + /** * Emit onDestroy event. * @param {string} packageName - Package name. diff --git a/runtime/main/extend/mediaquery/mediaQuery.ts b/runtime/main/extend/mediaquery/mediaQuery.ts index 1a21faa1..bd227c0b 100644 --- a/runtime/main/extend/mediaquery/mediaQuery.ts +++ b/runtime/main/extend/mediaquery/mediaQuery.ts @@ -16,16 +16,19 @@ import { Log } from '../../../utils/index'; const MEDIA_QUERY_RULE = { - CONDITION_WITH_SCREEN: /^(((only|not)screen)|screen)((and|or|,)\([\w.:><=-]+\))*$/, - CONDITION_WITHOUT_SCREEN: /^\([\w.:><=-]+\)((and|or|,)\([\w.:><=-]+\))*$/, - CONDITION_WITH_AND: /^\([.a-z0-9:>=<-]+\)(and\([.a-z0-9:>=<-]+\))+/, - CSS_LEVEL4_MULTI: /^\(([\d.]+(dpi|dppx|dpcm|px)?)(>|<|>=|<=)[a-z0-9:-]+(>|<|>=|<=)([\d.]+(dpi|dppx|dpcm|px)?)\)$/, - CSS_LEVEL4_LEFT: /^\([^m][a-z-]+(>|<|>=|<=)[\d.]+(dpi|dppx|dpcm|px)?\)$/, - CSS_LEVEL4_RIGHT: /^\([\d.]+(dpi|dppx|dpcm|px)?(>|<|>=|<=)[^m][a-z-]+\)$/, - CSS_LEVEL3_RULE: /^\((min|max)-[a-z-]+:[\d.]+(dpi|dppx|dpcm)?\)$/, + CONDITION_WITH_SCREEN: /^(((only|not)screen)|screen)((and|or|,)\([\w\/\.:><=-]+\))*$/, + CONDITION_WITHOUT_SCREEN: /^\([\w\/\.:><=-]+\)((and|or|,)\([\w\/\.:><=-]+\))*$/, + CONDITION_WITH_AND: /^\([\/\.a-z0-9:>=<-]+\)(and\([\/\.a-z0-9:>=<-]+\))+/, + CSS_LEVEL4_MULTI: /^\(([\d\.]+(dpi|dppx|dpcm|px)?)(>|<|>=|<=)[a-z0-9:-]+(>|<|>=|<=)([\d\.]+(dpi|dppx|dpcm|px)?)\)$/, + CSS_LEVEL4_LEFT: /^\([^m][a-z-]+(>|<|>=|<=)[\d\.]+(dpi|dppx|dpcm|px)?\)$/, + CSS_LEVEL4_RIGHT: /^\([\d\.]+(dpi|dppx|dpcm|px)?(>|<|>=|<=)[^m][a-z-]+\)$/, + CSS_LEVEL3_RULE: /^\((min|max)-[a-z-]+:[\d\.]+(dpi|dppx|dpcm|px)?\)$/, ORIENTATION_RULE: /^\(orientation:[a-z]+\)/, DEVICETYPE_RULE: /^\(device-type:[a-z]+\)/, - SCREEN_SHAPE_RULE: /^\(round-screen:[a-z]+\)/ + SCREEN_SHAPE_RULE: /^\(round-screen:[a-z]+\)/, + DARK_MODE: /^\(dark-mode:[a-z]+\)/, + ASPECT_RATIO: /^\((min|max)?-?(device)?-?aspect-ratio:[\d(\/)?(\d)*]+\)/, + PATTERN: /^\(pattern:[a-z]+\)/ }; /** @@ -181,6 +184,18 @@ function parseSingleCondition(condition: string, mediaStatus: object, failReason if (parseScreenShapeCondition(condition, mediaStatus, failReason)) { return true; } + } else if (MEDIA_QUERY_RULE.DARK_MODE.exec(condition)) { + if (parseDarkModeCondition(condition, mediaStatus, failReason)) { + return true; + } + } else if (MEDIA_QUERY_RULE.ASPECT_RATIO.exec(condition)) { + if (parseAspectRatioCondition(condition, mediaStatus, failReason)) { + return true; + } + } else if (MEDIA_QUERY_RULE.PATTERN.exec(condition)) { + if (parsePatternCondition(condition, mediaStatus, failReason)) { + return true; + } } else { Log.debug('Illegal condition'); failReason.type = MEDIAERROR.SYNTAX; @@ -309,6 +324,42 @@ function parseCss3Condition(condition: string, mediaStatus: object, failReason: return calculateExpression(statusValue, relationship, conditionValue, failReason); } +/** + * Parse paatern style condition, such as: (pattern: normal). + * @param {String} condition - pattern style condition. + * @param {Object} mediaStatus - Device info. + * @param {FailReason} failReason - Parse fail reason. + * @return {boolean} + */ +function parsePatternCondition(condition: string, mediaStatus: object, failReason: FailReason): boolean { + const pattern = condition.match(/[a-z-]+/g); + if (!pattern || pattern.length !== 2) { + failReason.type = MEDIAERROR.SYNTAX; + return false; + } + return getVpType(mediaStatus['resolution'], mediaStatus['width']) === pattern[1]; +} + +/** + * get the type of vp. + * @param {number} resolution - the resolution of device. + * @param {number} width - the width of view page. + */ +function getVpType(resolution: number, width: number): string { + const value = width / resolution; + if (value > 0 && value < 320) { + return 'small'; + } else if (value >= 320 && value < 600) { + return 'normal'; + } else if (value >= 600 && value < 840) { + return 'large'; + } else if (value >= 840) { + return 'xLarge'; + } else { + return ''; + } +} + /** * Parse screen orientation condition, such as: (orientation: portrait). * @param {string} condition - Orientation type condition. @@ -357,6 +408,56 @@ function parseScreenShapeCondition(condition: string, mediaStatus: object, failR return shape[1] === mediaStatus['round-screen'].toString(); } +/** + * parse dark mode condition, such as: (dark-mode: true) + * @param {String} condition: dark condition + * @param {Object} mediaStatus: device info + * @param {Object} failReason: parse fail reason + */ +function parseDarkModeCondition(condition: string, mediaStatus: object, failReason: FailReason): boolean { + const darkMode = condition.match(/[a-z-]+/g); + if (!darkMode || darkMode.length !== 2) { + failReason.type = MEDIAERROR.SYNTAX; + return false; + } + return darkMode[1] === mediaStatus['dark-mode'].toString(); +} + +/** + * parse aspect ratio condition, such as: (aspect-ratio: 8/3) + * @param {String} condition: (device)?-aspect-ratio condition + * @param {Object} mediaStatus: aspect-ratio, device-width, device-height + * @param {Object} failReason: parse fail reason + */ +function parseAspectRatioCondition(condition: string, mediaStatus: object, failReason: FailReason): boolean { + let conditionValue; + const aspectRatio = condition.match(/[a-z-\d-\/]+/g); + let relationship; + if (aspectRatio[0].match(/^(max-)/)) { + relationship = '<='; + } else if (aspectRatio[0].match(/^(min-)/)) { + relationship = '>='; + } else { + relationship = '=='; + } + let statusValue; + if (aspectRatio[0].match(/device/)) { + Log.info('query device status'); + statusValue = mediaStatus['device-width'] / mediaStatus['device-height']; + } else { + Log.info('query page status'); + statusValue = mediaStatus['aspect-ratio']; + } + const numbers = aspectRatio[1].split('/'); + if (numbers.length === 2) { + conditionValue = parseInt(numbers[0]) / parseInt(numbers[1]); + } else { + failReason.type = MEDIAERROR.SYNTAX; + return false; + } + return calculateExpression(statusValue, relationship, conditionValue, failReason); +} + /** * Transfer unit the same with condition value unit. * @param {number} value - Device value should be transfer unit the same with condition value. @@ -396,6 +497,9 @@ function calculateExpression(leftValue: number | string, relationship: string, } else if (typeof rightValue === 'string') { lvalue = leftValue; rvalue = rightValue.match(/[\d]+\.[\d]+/) ? parseFloat(rightValue) : parseInt(rightValue); + } else if (typeof rightValue === 'number') { + lvalue = leftValue; + rvalue = rightValue; } else { failReason.type = MEDIAERROR.SYNTAX; return false; @@ -409,6 +513,8 @@ function calculateExpression(leftValue: number | string, relationship: string, return lvalue <= rvalue; case '<': return lvalue < rvalue; + case '==': + return lvalue === rvalue; default: failReason.type = MEDIAERROR.SYNTAX; } diff --git a/runtime/main/extend/mediaquery/pluginMediaQuery.ts b/runtime/main/extend/mediaquery/pluginMediaQuery.ts index 97420b8e..a5b82729 100644 --- a/runtime/main/extend/mediaquery/pluginMediaQuery.ts +++ b/runtime/main/extend/mediaquery/pluginMediaQuery.ts @@ -95,6 +95,7 @@ export class MediaQueryApi { data['device-width'] = data.deviceWidth; data['device-height'] = data.deviceHeight; data['round-screen'] = data.roundScreen; + data['dark-mode'] = data.darkMode; for (let i = 0; i < this._mqlArray.length; i++) { const mediaQueryList:MediaQueryList = this._mqlArray[i]; const result: boolean = matchMediaQueryCondition(mediaQueryList.condition, data, true); diff --git a/runtime/main/extend/systemplugin/ability.js b/runtime/main/extend/systemplugin/ability.js new file mode 100644 index 00000000..7c777344 --- /dev/null +++ b/runtime/main/extend/systemplugin/ability.js @@ -0,0 +1,336 @@ +import { paramMock } from "./utils" + +export function mockAbilityFeatureAbility() { + global.systemplugin.ability = {} + const WantMock = { + deviceId: "[PC Preview] unknow deviceId", + bundleName: "[PC Preview] unknow bundleName", + abilityName: "[PC Preview] unknow abilityName", + uri: "[PC Preview] unknow uri", + type: "[PC Preview] unknow type", + flag: "[PC Preview] unknow flag", + action: "[PC Preview] unknow action", + parameters: "[PC Preview] unknow parameters", + entities: "[PC Preview] unknow entities" + } + const AbilityResultMock = { + resultCode: "[PC Preview] unknow resultCode", + want: WantMock + } + const DataAbilityHelperMock = { + openFile: function (...args) { + console.warn("DataAbilityHelper.openFile interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock, paramMock.paramNumberMock) + } else { + return new Promise((resolve, reject) => { + resolve(paramMock.paramNumberMock); + }) + } + }, + on: function (...args) { + console.warn("DataAbilityHelper.on interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock) + } + }, + off: function (...args) { + console.warn("DataAbilityHelper.off interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock) + } + }, + call: function (...args) { + console.warn("DataAbilityHelper.call interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock, paramMock.paramObjectMock) + } else { + return new Promise((resolve, reject) => { + resolve(paramMock.paramObjectMock); + }) + } + } + } + const ContextMock = { + getCacheDir: function (...args) { + console.warn("Context.getCacheDir interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock, paramMock.paramStringMock) + } else { + return new Promise((resolve) => { + resolve("[PC Preview] unknow string") + }) + } + }, + getFilesDir: function (...args) { + console.warn("Context.getFilesDir interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock, paramMock.paramStringMock) + } else { + return new Promise((resolve) => { + resolve("[PC Preview] unknow string") + }) + } + }, + getExternalCacheDir: function (...args) { + console.warn("Context.getExternalCacheDir interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock, paramMock.paramStringMock) + } else { + return new Promise((resolve) => { + resolve("[PC Preview] unknow string") + }) + } + } + } + global.systemplugin.ability.featureAbility = { + getWant: function (...args) { + console.warn("ability.featureAbility.getWant interface mocked in the Previewer. How this interface works on" + + " the Previewer may be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock, WantMock) + } else { + return new Promise((resolve) => { + resolve(WantMock) + }) + } + }, + startAbility: function (...args) { + console.warn("ability.featureAbility.startAbility interface mocked in the Previewer. How this interface works" + + " on the Previewer may be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock, paramMock.paramNumberMock) + } else { + return new Promise((resolve) => { + resolve(paramMock.paramNumberMock) + }) + } + }, + startAbilityForResult: function (...args) { + console.warn("ability.featureAbility.startAbilityForResult interface mocked in the Previewer. How this interface works" + + " on the Previewer may be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock, AbilityResultMock) + } else { + return new Promise((resolve) => { + resolve(AbilityResultMock) + }) + } + }, + terminateSelfWithResult: function (...args) { + console.warn("ability.featureAbility.terminateSelfWithResult interface mocked in the Previewer. How this interface works" + + " on the Previewer may be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock) + } else { + return new Promise((resolve) => { + resolve() + }) + } + }, + terminateSelf: function (...args) { + console.warn("ability.featureAbility.terminateSelf interface mocked in the Previewer. How this interface works on" + + " the Previewer may be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this) + } else { + return new Promise((resolve) => { + resolve() + }) + } + }, + acquireDataAbilityHelper: function (...args) { + console.warn("ability.featureAbility.acquireDataAbilityHelper mocked in the Previewer. How this interface works on the Previewer may be" + + " different from that on a real device.") + return DataAbilityHelperMock; + }, + getContext: function () { + console.warn("ability.featureAbility.getContext interface mocked in the Previewer. How this interface works on" + + " the Previewer may be different from that on a real device.") + return ContextMock; + } + } +} +export function mockAbilityParticleAbility() { + global.systemplugin.ability.particleAbility = { + startAbility: function (...args) { + console.warn("ability.particleAbility.startAbility interface mocked in the Previewer. How this interface works" + + " on the Previewer may be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock, paramMock.paramNumberMock) + } else { + return new Promise((resolve) => { + resolve(paramMock.paramNumberMock) + }) + } + } + } +} +export function mockAbilityFormManager() { + const FormInfoMock = { + bundleName: "[PC Preview] unknow bundleName", + moduleName: "[PC Preview] unknow moduleName", + abilityName: "[PC Preview] unknow abilityName", + name: "[PC Preview] unknow name", + description: "[PC Preview] unknow description", + type: "[PC Preview] unknow type", + jsComponentName: "[PC Preview] unknow jsComponentName", + colorMode: "[PC Preview] unknow colorMode", + isDefault: "[PC Preview] unknow isDefault", + updateEnabled: "[PC Preview] unknow updateEnabled", + formVisibleNotify: "[PC Preview] unknow formVisibleNotify", + relatedBundleName: "[PC Preview] unknow relatedBundleName", + scheduledUpdateTime: "[PC Preview] unknow scheduledUpdateTime", + formConfigAbility: "[PC Preview] unknow formConfigAbility", + updateDuration: "[PC Preview] unknow updateDuration", + defaultDimension: "[PC Preview] unknow defaultDimension", + supportDimensions: "[PC Preview] unknow supportDimensions", + customizeDatas: "[PC Preview] unknow customizeDatas", + jsonObject: "[PC Preview] unknow jsonObject" + } + const FormInfoArrayMock = [ + FormInfoMock + ] + global.systemplugin.ability.formManager = { + requestForm: function (...args) { + console.warn("ability.formManager.requestForm interface mocked in the Previewer. How this interface works" + + " on the Previewer may be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock) + } else { + return new Promise((resolve) => { + resolve() + }) + } + }, + deleteForm: function (...args) { + console.warn("ability.formManager.deleteForm interface mocked in the Previewer. How this interface works" + + " on the Previewer may be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock) + } else { + return new Promise((resolve) => { + resolve() + }) + } + }, + releaseForm: function (...args) { + console.warn("ability.formManager.releaseForm interface mocked in the Previewer. How this interface works on the Previewer may" + + " be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock); + } else { + return new Promise((resolve) => { + resolve() + }) + } + }, + notifyVisibleForms: function (...args) { + console.warn("ability.formManager.notifyVisibleForms interface mocked in the Previewer. How this interface works" + + " on the Previewer may be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock) + } else { + return new Promise((resolve) => { + resolve() + }) + } + }, + notifyInvisibleForms: function (...args) { + console.warn("ability.formManager.notifyInvisibleForms interface mocked in the Previewer. How this interface works" + + " on the Previewer may be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock) + } else { + return new Promise((resolve) => { + resolve() + }) + } + }, + enableFormsUpdate: function (...args) { + console.warn("ability.formManager.enableFormsUpdate interface mocked in the Previewer. How this interface works" + + " on the Previewer may be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock) + } else { + return new Promise((resolve) => { + resolve() + }) + } + }, + disableFormsUpdate: function (...args) { + console.warn("ability.formManager.disableFormsUpdate interface mocked in the Previewer. How this interface works" + + " on the Previewer may be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock) + } else { + return new Promise((resolve) => { + resolve() + }) + } + }, + getAllFormsInfo: function (...args) { + console.warn("ability.formManager.getAllFormsInfo interface mocked in the Previewer. How this interface works" + + " on the Previewer may be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock, FormInfoArrayMock) + } else { + return new Promise((resolve) => { + resolve(FormInfoArrayMock) + }) + } + }, + getFormsInfoByApp: function (...args) { + console.warn("ability.formManager.getFormsInfoByApp interface mocked in the Previewer. How this interface works" + + " on the Previewer may be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock, FormInfoArrayMock) + } else { + return new Promise((resolve) => { + resolve(FormInfoArrayMock) + }) + } + }, + getFormsInfoByModule: function (...args) { + console.warn("ability.formManager.getFormsInfoByModule interface mocked in the Previewer. How this interface works" + + " on the Previewer may be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock, FormInfoArrayMock) + } else { + return new Promise((resolve) => { + resolve(FormInfoArrayMock) + }) + } + } + } +} \ No newline at end of file diff --git a/runtime/main/extend/systemplugin/accessibility.js b/runtime/main/extend/systemplugin/accessibility.js new file mode 100644 index 00000000..69124f1e --- /dev/null +++ b/runtime/main/extend/systemplugin/accessibility.js @@ -0,0 +1,30 @@ +import { paramMock } from "./utils" + +export function mockAccessibility() { + global.systemplugin.accessibility = { + isOpenAccessibility: function (...args) { + console.warn("accessibility.isOpenAccessibility interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock, paramMock.paramBooleanMock) + } else { + return new Promise((resolve, reject) => { + resolve(paramMock.paramBooleanMock); + }) + } + }, + isOpenTouchExploration: function (...args) { + console.warn("accessibility.isOpenTouchExploration interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock, paramMock.paramBooleanMock) + } else { + return new Promise((resolve) => { + resolve(paramMock.paramBooleanMock); + }) + } + } + } +} \ No newline at end of file diff --git a/runtime/main/extend/systemplugin/ai.js b/runtime/main/extend/systemplugin/ai.js new file mode 100644 index 00000000..f89ad022 --- /dev/null +++ b/runtime/main/extend/systemplugin/ai.js @@ -0,0 +1,87 @@ +import {paramMock} from "./utils" + +export function mockAI() { + const TTSCallBackMock = { + key: "[PC preview] unknow key" + }; + global.systemplugin.ai = {}; + global.systemplugin.ai.TTS = { + getTTSClient: function () { + console.warn("ai.TTS.getTTSClient interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + return TTSClient + }, + }; + const TTSClient = { + init: function (...args) { + console.warn("TTSClient.init interface mocked in the Previewer. How this interface works on the Previewer may" + + " be different from that on a real device.") + return paramMock.paramBooleanMock + }, + isSpeaking: function () { + console.warn("TTSClient.isSpeaking interface mocked in the Previewer. How this interface works on the Previewer may" + + " be different from that on a real device.") + return paramMock.paramBooleanMock + }, + setAudioType: function (...args) { + console.warn("TTSClient.setAudioType interface mocked in the Previewer. How this interface works on the Previewer may" + + " be different from that on a real device.") + return paramMock.paramBooleanMock + }, + setParams: function (...args) { + console.warn("TTSClient.setParams interface mocked in the Previewer. How this interface works on the Previewer may" + + " be different from that on a real device.") + return paramMock.paramBooleanMock + }, + connectService: function () { + console.warn("TTSClient.connectService interface mocked in the Previewer. How this interface works on the Previewer may" + + " be different from that on a real device.") + }, + setIsSaveTtsData: function (...args) { + console.warn("TTSClient.setIsSaveTtsData interface mocked in the Previewer. How this interface works on the Previewer may" + + " be different from that on a real device.") + args[0].success() + hasComplete(args[0].complete) + }, + release: function () { + console.warn("TTSClient.release interface mocked in the Previewer. How this interface works on the Previewer may" + + " be different from that on a real device.") + }, + speakLongText: function (...args) { + console.warn("TTSClient.speakLongText interface mocked in the Previewer. How this interface works on the Previewer may" + + " be different from that on a real device.") + args[0].success() + hasComplete(args[0].complete) + }, + speakText: function (...args) { + console.warn("TTSClient.speakText interface mocked in the Previewer. How this interface works on the Previewer may" + + " be different from that on a real device.") + args[0].success() + hasComplete(args[0].complete) + }, + stopSpeak: function () { + console.warn("TTSClient.stopSpeak interface mocked in the Previewer. How this interface works on the Previewer may" + + " be different from that on a real device.") + }, + destroy: function () { + console.warn("TTSClient.destroy interface mocked in the Previewer. How this interface works on the Previewer may" + + " be different from that on a real device.") + }, + on: function (...args) { + console.warn("TTSClient.on interface mocked in the Previewer. How this interface works on the Previewer may be" + + " different from that on a real device.") + const len = args.length + args[len - 1].call(this, TTSCallBackMock) + }, + getSupportMaxLength: function () { + console.warn("TTSClient.getSupportMaxLength interface mocked in the Previewer. How this interface works on the Previewer may" + + " be different from that on a real device.") + return paramMock.paramNumberMock + }, + getVersion: function () { + console.warn("TTSClient.getVersion interface mocked in the Previewer. How this interface works on the Previewer may" + + " be different from that on a real device.") + return paramMock.paramStringMock + }, + }; +} \ No newline at end of file diff --git a/runtime/main/extend/systemplugin/battery.js b/runtime/main/extend/systemplugin/battery.js new file mode 100644 index 00000000..e06ef54b --- /dev/null +++ b/runtime/main/extend/systemplugin/battery.js @@ -0,0 +1,15 @@ +import { hasComplete } from "./utils" + +export function mockBattery() { + global.systemplugin.battery = { + getStatus: function (...args) { + console.warn("battery.getStatus interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + args[0].success.call(this, { + level: 1, + charging: false + }) + hasComplete(args[0].complete) + } + } +} \ No newline at end of file diff --git a/runtime/main/extend/systemplugin/batteryinfo.js b/runtime/main/extend/systemplugin/batteryinfo.js new file mode 100644 index 00000000..905de290 --- /dev/null +++ b/runtime/main/extend/systemplugin/batteryinfo.js @@ -0,0 +1,12 @@ +export function mockOhosBatteryinfo() { + global.systemplugin.batteryInfo = { + batterySOC: "[PC Preview] unknow batterySOC", + chargingStatus: "[PC Preview] unknow chargingStatus", + healthStatus: "[PC Preview] unknow healthStatus", + pluggedType: "[PC Preview] unknow pluggedType", + voltage: "[PC Preview] unknow voltage", + technology: "[PC Preview] unknow technology", + batteryTemperature: "[PC Preview] unknow batteryTemperature", + isBatteryPresent: "[PC Preview] unknow isBatteryPresent" + } +} diff --git a/runtime/main/extend/systemplugin/bluetooth.js b/runtime/main/extend/systemplugin/bluetooth.js new file mode 100644 index 00000000..586b3f0a --- /dev/null +++ b/runtime/main/extend/systemplugin/bluetooth.js @@ -0,0 +1,45 @@ +import { hasComplete } from "./utils" + +export function mockBluetooth() { + global.systemplugin.bluetooth = { + startBLEScan: function (...args) { + console.warn("bluetooth.startBLEScan interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + args[0].success() + hasComplete(args[0].complete) + }, + stopBLEScan: function (...args) { + console.warn("bluetooth.stopBLEScan interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + args[0].success() + hasComplete(args[0].complete) + }, + subscribeBLEFound: function (...args) { + console.warn("bluetooth.subscribeBLEFound interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + const options = { + addrType: 'public', + addr: 'xx:xx:xx:xx', + rssi: 123, + txpower: 'xxx', + data: 'xxx' + } + const min = 1 + const max = 6 + clearInterval(this.unsubscribeBLE) + delete this.unsubscribeBLE + this.unsubscribeBLE = setInterval(() => { + const randomAddr = Math.floor(Math.random() * (max - min)) + min + const optionsArr = Array(randomAddr).fill(options) + args[0].success(optionsArr) + }, 1000) + }, + unsubscribeBLEFound: function () { + console.warn("bluetooth.unsubscribeBLEFound interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + clearInterval(this.unsubscribeBLE) + delete this.unsubscribeBLE + } + } + } + \ No newline at end of file diff --git a/runtime/main/extend/systemplugin/brightness.js b/runtime/main/extend/systemplugin/brightness.js new file mode 100644 index 00000000..d73851cd --- /dev/null +++ b/runtime/main/extend/systemplugin/brightness.js @@ -0,0 +1,46 @@ +import { hasComplete } from "./utils" + +export function mockBrightness() { + global.systemplugin.brightness = { + argsV: { + value: 80 + }, + argsM: { + mode: 0 + }, + getValue: function (...args) { + console.warn("brightness.getValue interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + args[0].success(this.argsV) + hasComplete(args[0].complete) + }, + setValue: function (...args) { + console.warn("brightness.setValue interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + if (args[0].value) { + this.argsV.value = args[0].value + args[0].success("brightness setValue successfully") + hasComplete(args[0].complete) + } + }, + getMode: function (...args) { + console.warn("brightness.getMode interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + args[0].success(this.argsM) + hasComplete(args[0].complete) + }, + setMode: function (...args) { + console.warn("brightness.setMode interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + this.argsM.mode = args[0].mode + args[0].success("brightness setMode successfully") + hasComplete(args[0].complete) + }, + setKeepScreenOn: function (...args) { + console.warn("brightness.setKeepScreenOn interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + args[0].success("brightness setKeepScreenOn successfully") + hasComplete(args[0].complete) + } + } +} \ No newline at end of file diff --git a/runtime/main/extend/systemplugin/cipher.js b/runtime/main/extend/systemplugin/cipher.js new file mode 100644 index 00000000..ebe5b3f1 --- /dev/null +++ b/runtime/main/extend/systemplugin/cipher.js @@ -0,0 +1,20 @@ +import { hasComplete } from "./utils" + +export function mockCipher() { + global.systemplugin.cipher = { + rsa: function(...args) { + console.warn("cipher.rsa interface mocked in the Previewer. How this interface works on the Previewer may be" + + " different from that on a real device.") + const result = '[PC preview] rsa xxxxxxxxxxxxx' + args[0].success(result) + hasComplete(args[0].complete) + }, + aes: function(...args) { + console.warn("cipher.aes interface mocked in the Previewer. How this interface works on the Previewer may be" + + " different from that on a real device.") + const result = '[PC preview] aes xxxxxxxxxxxxx' + args[0].success(result) + hasComplete(args[0].complete) + } + } + } \ No newline at end of file diff --git a/runtime/main/extend/systemplugin/data.js b/runtime/main/extend/systemplugin/data.js new file mode 100644 index 00000000..122473e1 --- /dev/null +++ b/runtime/main/extend/systemplugin/data.js @@ -0,0 +1,173 @@ +import { paramMock } from "./utils" + +export function mockDataStorage() { + global.systemplugin.data = {} + const paramValueTypeMock = '[PC Preview] unknow ValueType' + const storageObserverMock = { + key: "[PC preview] unknow key" + } + const storageMock = { + getSync: function () { + console.warn("Storage.getSync interface mocked in the Previewer. How this interface works on the Previewer may" + + " be different from that on a real device.") + return paramValueTypeMock + }, + get: function (...args) { + console.warn("Storage.get interface mocked in the Previewer. How this interface works on the Previewer may be" + + " different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock, paramValueTypeMock) + } else { + return new Promise((resolve) => { + resolve(paramValueTypeMock) + }) + } + }, + hasSync: function () { + console.warn("Storage.hasSync interface mocked in the Previewer. How this interface works on the Previewer may" + + " be different from that on a real device.") + return paramMock.paramBooleanMock + }, + has: function (...args) { + console.warn("Storage.has interface mocked in the Previewer. How this interface works on the Previewer may be" + + " different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock, paramMock.paramBooleanMock) + } else { + return new Promise((resolve) => { + resolve(paramMock.paramBooleanMock) + }) + } + }, + putSync: function () { + console.warn("Storage.putSync interface mocked in the Previewer. How this interface works on the Previewer may" + + " be different from that on a real device.") + }, + put: function (...args) { + console.warn("Storage.put interface mocked in the Previewer. How this interface works on the Previewer may be" + + " different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock) + } else { + return new Promise((resolve) => { + resolve() + }) + } + }, + deleteSync: function () { + console.warn("Storage.deleteSync interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + return + }, + delete: function (...args) { + console.warn("Storage.delete interface mocked in the Previewer. How this interface works on the Previewer may" + + " be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock) + } else { + return new Promise((resolve) => { + resolve() + }) + } + }, + clearSync: function () { + console.warn("Storage.clearSync interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + }, + clear: function (...args) { + console.warn("Storage.clear interface mocked in the Previewer. How this interface works on the Previewer may" + + " be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock) + } else { + return new Promise((resolve) => { + resolve() + }) + } + }, + flushSync: function () { + console.warn("Storage.flushSync interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + }, + flush: function (...args) { + console.warn("Storage.flush interface mocked in the Previewer. How this interface works on the Previewer may" + + " be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock) + } else { + return new Promise((resolve) => { + resolve() + }) + } + }, + on: function (...args) { + console.warn("Storage.on interface mocked in the Previewer. How this interface works on the Previewer may be" + + " different from that on a real device.") + const len = args.length + args[len - 1].call(this, storageObserverMock) + }, + off: function (...args) { + console.warn("Storage.off interface mocked in the Previewer. How this interface works on the Previewer may be" + + " different from that on a real device.") + const len = args.length + args[len - 1].call(this, storageObserverMock) + } + } + global.systemplugin.data.storage = { + getStorageSync: function () { + console.warn("data.storage.getStorageSync interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + return storageMock + }, + getStorage: function (...args) { + console.warn("data.storage.getStorage interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock, storageMock) + } else { + return new Promise((resolve) => { + resolve(storageMock) + }) + } + }, + deleteStorageSync: function () { + console.warn("data.storage.deleteStorageSync interface mocked in the Previewer. How this interface works on" + + " the Previewer may be different from that on a real device.") + }, + deleteStorage: function (...args) { + console.warn("data.storage.deleteStorage interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock) + } else { + return new Promise((resolve) => { + resolve() + }) + } + }, + removeStorageFromCacheSync: function () { + console.warn("data.storage.removeStorageFromCacheSync interface mocked in the Previewer. How this interface" + + " works on the Previewer may be different from that on a real device.") + }, + removeStorageFromCache: function (...args) { + console.warn("data.storage.removeStorageFromCache interface mocked in the Previewer. How this interface works" + + " on the Previewer may be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock) + } else { + return new Promise((resolve) => { + resolve() + }) + } + } + } +} \ No newline at end of file diff --git a/runtime/main/extend/systemplugin/deviceInfo.js b/runtime/main/extend/systemplugin/deviceInfo.js new file mode 100644 index 00000000..979b9879 --- /dev/null +++ b/runtime/main/extend/systemplugin/deviceInfo.js @@ -0,0 +1,33 @@ +export function mockDeviceInfo() { + global.systemplugin.deviceInfo = { + deviceType: '[PC preview] unknow type', + manufacture: '[PC preview] unknow manufacture', + brand: '[PC preview] unknow brand', + marketName: '[PC preview] unknow market nanme', + productSeries: '[PC preview] unknow product series', + productModel: '[PC preview] unknow product model', + softwareModel: '[PC preview] unknow software model', + hardwareModel: '[PC preview] unknow hardware model', + hardwareProfile: '[PC preview] unknow hardware profile', + serial: '[PC preview] unknow serial', + bootloaderVersion: '[PC preview] unknow bootloader version', + abiList: '[PC preview] unknow ablity list', + securityPatchTag: '[PC preview] unknow security patch tag', + displayVersion: '[PC preview] unknow display version', + incrementalVersion: '[PC preview] unknow incremental version', + osReleaseType: '[PC preview] unknow os release type', + osFullName: '[PC preview] unknow os full name', + majorVersion: '[PC preview] unknow security major version', + seniorVersion: '[PC preview] unknow senior version', + featureVersion: '[PC preview] unknow feature version', + buildVersion: '[PC preview] unknow build version', + sdkApiVersion: '[PC preview] unknow sdk api version', + firstApiVersion: '[PC preview] unknow first api version', + versionId: '[PC preview] unknow version id', + buildType: '[PC preview] unknow build type', + buildUser: '[PC preview] unknow build user', + buildHost: '[PC preview] unknow build host', + buildTime: '[PC preview] unknow build time', + buildRootHash: '[PC preview] unknow build root hash' + } +} \ No newline at end of file diff --git a/runtime/main/extend/systemplugin/deviceManager.js b/runtime/main/extend/systemplugin/deviceManager.js new file mode 100644 index 00000000..ee44d50f --- /dev/null +++ b/runtime/main/extend/systemplugin/deviceManager.js @@ -0,0 +1,85 @@ +import {paramMock} from "./utils" + +export function mockDeviceManager() { + const deviceInfoMock = { + deviceId: "[PC Preview] unknow mNetworkId", + deviceName: "[PC Preview] unknow mDeviceName", + deviceType: 0x0E + } + const deviceStateChangeMock = { + action: 0, + device: deviceInfoMock + } + const deviceManagerMock = { + release: function () { + console.warn("DeviceManager.release interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + return + }, + getTrustedDeviceListSync: function () { + console.warn("DeviceManager.getTrustedDeviceListSync interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + var array = new Array(); + array.push(deviceInfoMock); + return array ; + }, + getTrustedDeviceList: function (...args) { + console.warn("DeviceManager.getTrustedDeviceList interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + var array = new Array(); + array.push(deviceInfoMock); + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock, array); + } else { + return new Promise((resolve, reject) => { + resolve(array); + }) + } + }, + getLocalDeviceInfoSync: function () { + console.warn("DeviceManager.getLocalDeviceInfoSync interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + return deviceInfoMock; + }, + getLocalDeviceInfo: function (...args) { + console.warn("DeviceManager.getLocalDeviceInfo interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock, deviceInfoMock); + } else { + return new Promise((resolve, reject) => { + resolve(deviceInfoMock); + }) + } + }, + on: function (...args) { + console.warn("DeviceManager.on interface mocked in the Previewer. How this interface works on the Previewer may" + + " be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + if (args[0] == 'deviceStateChange') { + args[len - 1].call(this, paramMock.businessErrorMock, deviceStateChangeMock); + } else { + args[len - 1].call(this); + } + } + }, + off: function (...args) { + console.warn("DeviceManager.off interface mocked in the Previewer. How this interface works on the Previewer may" + + " be different from that on a real device.") + } + } + global.systemplugin.distributedHardware = global.systemplugin.distributedHardware || {}; + global.systemplugin.distributedHardware.deviceManager = { + createDeviceManager: function (...args) { + console.warn("distributedHardware.deviceManager.createDeviceManager interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock, deviceManagerMock) + } + } + } +} \ No newline at end of file diff --git a/runtime/main/extend/systemplugin/display.js b/runtime/main/extend/systemplugin/display.js new file mode 100644 index 00000000..a8281eef --- /dev/null +++ b/runtime/main/extend/systemplugin/display.js @@ -0,0 +1,72 @@ +import { paramMock } from "./utils" + +export function mockDisplay() { + const displayMock = { + densityDPI: '[PC preview] unknow densityDPI', + densityPixels: '[PC preview] unknow densityPixels', + scaledDensity: '[PC preview] unknow scaledDensity', + xDPI: '[PC preview] unknow xDPI', + yDPI: '[PC preview] unknow yDPI', + width: '[PC preview] unknow width', + height: '[PC preview] unknow height', + alive: '[PC preview] unknow alive', + refreshRate: '[PC preview] unknow refreshRate', + id: '[PC preview] unknow id', + state: '[PC preview] unknow state', + rotation: '[PC preview] unknow rotation', + name: '[PC preview] unknow name' + } + const allDisplayMock = [{ + densityDPI: '[PC preview] unknow densityDPI', + densityPixels: '[PC preview] unknow densityPixels', + scaledDensity: '[PC preview] unknow scaledDensity', + xDPI: '[PC preview] unknow xDPI', + yDPI: '[PC preview] unknow yDPI', + width: '[PC preview] unknow width', + height: '[PC preview] unknow height', + alive: '[PC preview] unknow alive', + refreshRate: '[PC preview] unknow refreshRate', + id: '[PC preview] unknow id', + state: '[PC preview] unknow state', + rotation: '[PC preview] unknow rotation', + name: '[PC preview] unknow name' + }] + global.systemplugin.display = { + getDefaultDisplay: function (...args) { + console.warn("display.getDefaultDisplay interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock, displayMock) + } else { + return new Promise((resolve, reject) => { + resolve(displayMock) + }) + } + }, + getAllDisplay: function (...args) { + console.warn("display.getAllDisplay interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock, allDisplayMock) + } else { + return new Promise((resolve, reject) => { + resolve(allDisplayMock) + }) + } + }, + on: function (...args) { + console.warn("display.on interface mocked in the Previewer. How this interface works on the Previewer may be" + + " different from that on a real device.") + const len = args.length + args[len - 1].call(this, paramMock.businessErrorMock, paramMock.paramNumberMock) + }, + off: function (...args) { + console.warn("display.off interface mocked in the Previewer. How this interface works on the Previewer may be" + + " different from that on a real device.") + const len = args.length + args[len - 1].call(this, paramMock.businessErrorMock, paramMock.paramNumberMock) + }, + } +} \ No newline at end of file diff --git a/runtime/main/extend/systemplugin/distributedSchedule.js b/runtime/main/extend/systemplugin/distributedSchedule.js new file mode 100644 index 00000000..d1aad493 --- /dev/null +++ b/runtime/main/extend/systemplugin/distributedSchedule.js @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { paramMock } from "./utils" + +export function mockDistributedSchedule() { + global.systemplugin.distributedSchedule = { + stopDistributedService: function (...args) { + console.warn("distributedSchedule.stopDistributedService interface mocked in the Previewer. " + + "How this interface works on the Previewer" + + " may be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock, paramMock.paramStringMock) + } else { + return new Promise((resolve) => { + resolve(paramMock.paramStringMock) + }) + } + }, + startDistributedService: function (...args) { + console.warn("distributedSchedule.startDistributedService interface mocked in the Previewer. " + + "How this interface works on the Previewer" + + " may be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock, paramMock.paramStringMock) + } else { + return new Promise((resolve) => { + resolve(paramMock.paramStringMock) + }) + } + } + } +} diff --git a/runtime/main/extend/systemplugin/document.js b/runtime/main/extend/systemplugin/document.js new file mode 100644 index 00000000..8120a716 --- /dev/null +++ b/runtime/main/extend/systemplugin/document.js @@ -0,0 +1,42 @@ +import { paramMock } from "./utils" + +export function mockDocument() { + global.systemplugin.document = { + create: function (...args) { + console.warn("document.create interface mocked in the Previewer. How this interface works on the Previewer may" + + " be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock, paramMock.paramStringMock) + } else { + return new Promise((resolve, reject) => { + resolve(paramMock.paramStringMock); + }) + } + }, + choose: function (...args) { + console.warn("document.choose interface mocked in the Previewer. How this interface works on the Previewer may" + + " be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock, paramMock.paramStringMock) + } else { + return new Promise((resolve, reject) => { + resolve(paramMock.paramStringMock); + }) + } + }, + show: function (...args) { + console.warn("document.show interface mocked in the Previewer. How this interface works on the Previewer may" + + " be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock) + } else { + return new Promise((resolve, reject) => { + resolve(); + }) + } + } + } +} \ No newline at end of file diff --git a/runtime/main/extend/systemplugin/entry.js b/runtime/main/extend/systemplugin/entry.js new file mode 100644 index 00000000..655a2158 --- /dev/null +++ b/runtime/main/extend/systemplugin/entry.js @@ -0,0 +1,3 @@ +import { mockSystemPlugin } from './index'; + +mockSystemPlugin() \ No newline at end of file diff --git a/runtime/main/extend/systemplugin/featureAbility.js b/runtime/main/extend/systemplugin/featureAbility.js new file mode 100644 index 00000000..e814b5ab --- /dev/null +++ b/runtime/main/extend/systemplugin/featureAbility.js @@ -0,0 +1,70 @@ +export function mockFeatureAbility() { + let FeatureAbilityObject = { + getFeatureAbility: function () { + const ResultMock = { + code: '[PC preview] unknow code', + data: '[PC preview] unknow data' + } + const FeatureAbility = { + startAbility: function (...args) { + console.warn("Unable to use the FeatureAbility.startAbility method to start another ability in the" + + " Previewer. Perform this operation on the emulator or a real device instead.") + return new Promise((resolve, reject) => { + resolve(ResultMock); + }) + }, + startAbilityForResult: function (...args) { + console.warn("Unable to use the FeatureAbility.startAbilityForResult method to start another ability in" + + " the Previewer. Perform this operation on the emulator or a real device instead.") + return new Promise((resolve, reject) => { + resolve(ResultMock); + }) + }, + finishWithResult: function (...args) { + console.warn("FeatureAbility.finishWithResult interface mocked in the Previewer. How this interface works" + + " on the Previewer may be different from that on a real device.") + return new Promise((resolve, reject) => { + resolve(ResultMock); + }) + }, + callAbility: function (...args) { + console.warn("FeatureAbility.callAbility interface mocked in the Previewer. How this interface works on" + + " the Previewer may be different from that on a real device.") + return new Promise((resolve, reject) => { + resolve(JSON.stringify(ResultMock)); + }) + }, + continueAbility: function (...args) { + console.warn("FeatureAbility.continueAbility interface mocked in the Previewer. How this interface works on" + + " the Previewer may be different from that on a real device.") + return new Promise((resolve, reject) => { + resolve(ResultMock); + }) + }, + subscribeAbilityEvent: function (...args) { + console.warn("FeatureAbility.subscribeAbilityEvent interface mocked in the Previewer. How this interface" + + " works on the Previewer may be different from that on a real device.") + return new Promise((resolve, reject) => { + resolve(JSON.stringify(ResultMock)); + }) + }, + unsubscribeAbilityEvent: function (...args) { + console.warn("FeatureAbility.unsubscribeAbilityEvent interface mocked in the Previewer. How this interface" + + " works on the Previewer may be different from that on a real device.") + return new Promise((resolve, reject) => { + resolve(JSON.stringify(ResultMock)); + }) + } + } + return FeatureAbility + } + } + global.createLocalParticleAbility = function (...args) { + console.warn("createLocalParticleAbility interface mocked in the Previewer. How this interface" + + " works on the Previewer may be different from that on a real device.") + return new Promise((resolve, reject) => { + resolve(paramMock.paramObjectMock); + }) + } + global.FeatureAbility = FeatureAbilityObject.getFeatureAbility(); +} \ No newline at end of file diff --git a/runtime/main/extend/systemplugin/fetch.js b/runtime/main/extend/systemplugin/fetch.js new file mode 100644 index 00000000..a13ff1b1 --- /dev/null +++ b/runtime/main/extend/systemplugin/fetch.js @@ -0,0 +1,118 @@ +export function mockFetch() { + global.sendGroupMessage = global.group.sendGroupMessage; + let GroupMessenger = { + create: function () { + let messenger = {}; + messenger.send = function (groupName, functionName, ...args) { + return new Promise(function (resolve, reject) { + let params = messenger.prepareArgs(...args); + sendGroupMessage(function (result) { + resolve(messenger.parseJsonResult(result)); + }, function (error) { + reject(messenger.parseJsonResult(error)); + }, groupName, functionName, ...params); + }) + }; + messenger.parseJsonResult = function (data) { + if (data && data.constructor == String) { + try { + data = JSON.parse(data); + } catch (jsonParseErr) { + console.warn("parse result exception: " + JSON.stringify(jsonParseErr)); + } + } + return data; + }; + messenger.prepareArgs = function (...args) { + let result = [...args]; + for (let i = 0; i < result.length; i++) { + if (typeof result[i] === 'function') { + result[i] = messenger.packageCallback(result[i]); + } + } + return result; + }; + messenger.packageCallback = function (func) { + return function (data) { + data = messenger.parseJsonResult(data); + if (!Array.isArray(data)) { + func(data); + } else { + func(...data); + } + }; + }; + return messenger; + } + }; + + let CommonCallback = { + commonCallback: function commonCallback(callback, flag, data, code) { + if (typeof callback === 'function') { + switch (flag) { + case 'success': + callback(data); + break; + case 'fail': + callback(data, code); + break; + case 'cancel': + callback(data); + break; + case 'complete': + callback(); + break; + default: + break; + } + } else { + console.warn('callback.' + flag + ' is not function or not present'); + } + } + }; + global.commonCallback = CommonCallback.commonCallback; + let CommonCallbackEx = { + commonCallbackEx: function commonCallbackEx(callback, result, pluginError) { + if ((callback === undefined) || ((callback.success === undefined) && (callback.fail === undefined) && (callback.complete === undefined))) { + return CommonCallbackEx.promiseMethod(result, pluginError); + } else { + return CommonCallbackEx.callbackMethod(callback, result, pluginError); + } + }, + promiseMethod: function promiseMethod(result, pluginError) { + if (pluginError != undefined) { + throw pluginError; + } + return result; + }, + callbackMethod: function callbackMethod(callback, result, pluginError) { + if (pluginError != undefined) { + commonCallback(callback.fail, 'fail', pluginError.data, pluginError.code); + commonCallback(callback.complete, 'complete'); + throw pluginError; + } + commonCallback(callback.success, 'success', result.data); + commonCallback(callback.complete, 'complete'); + return result; + }, + catching: function catching(promise, param) { + return promise.then(ret => commonCallbackEx(param, ret)) + .catch(err => commonCallbackEx(param, null, err)); + } + }; + global.commonCallbackEx = CommonCallbackEx.commonCallbackEx; + global.systemplugin.catching = CommonCallbackEx.catching; + + let FetchObject = { + getFetch: function () { + let fetch = {} + fetch.messenger = GroupMessenger.create(); + fetch.fetch = async function (param) { + return await CommonCallbackEx.catching(this.messenger.send("groupName", "fetch", param), param); + } + return fetch + } + } + + global.systemplugin.fetch = FetchObject.getFetch(); +} \ No newline at end of file diff --git a/runtime/main/extend/systemplugin/file.js b/runtime/main/extend/systemplugin/file.js new file mode 100644 index 00000000..3a4360a8 --- /dev/null +++ b/runtime/main/extend/systemplugin/file.js @@ -0,0 +1,95 @@ +import { hasComplete } from "./utils" + +export function mockFile() { + global.systemplugin.file = { + move: function(...args) { + console.warn("file.move interface mocked in the Previewer. How this interface works on the Previewer may be" + + " different from that on a real device.") + args[0].success(args[0].dstUri) + hasComplete(args[0].complete) + }, + copy: function(...args) { + console.warn("file.copy interface mocked in the Previewer. How this interface works on the Previewer may be" + + " different from that on a real device.") + args[0].success(args[0].dstUri) + hasComplete(args[0].complete) + }, + list: function(...args) { + console.warn("file.list interface mocked in the Previewer. How this interface works on the Previewer may be" + + " different from that on a real device.") + const data = { + fileList: [{ + uri: '[PC Preview]: no file', + lastModifiedTime: "[PC Preview]: no file", + length: "[PC Preview]: no file", + type: 'file' + }] + } + args[0].success(data) + hasComplete(args[0].complete) + }, + get: function(...args) { + console.warn("file.get interface mocked in the Previewer. How this interface works on the Previewer may be" + + " different from that on a real device.") + const data = { + uri: '[PC Preview]: no file', + lastModifiedTime: "[PC Preview]: no file", + length: "[PC Preview]: no file", + type: 'file', + subFiles: ["[PC Preview]: no file", "[PC Preview]: no file"] + } + args[0].success(data) + hasComplete(args[0].complete) + }, + delete: function(...args) { + console.warn("file.delete interface mocked in the Previewer. How this interface works on the Previewer may be" + + " different from that on a real device.") + args[0].success() + hasComplete(args[0].complete) + }, + writeText: function(...args) { + console.warn("file.writeText interface mocked in the Previewer. How this interface works on the Previewer may" + + " be different from that on a real device.") + args[0].success() + hasComplete(args[0].complete) + }, + writeArrayBuffer: function(...args) { + console.warn("file.writeArrayBuffer interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + args[0].success() + hasComplete(args[0].complete) + }, + readText: function(...args) { + console.warn("file.readText interface mocked in the Previewer. How this interface works on the Previewer may" + + " be different from that on a real device.") + const data = {text: "[PC Preview]: success default"} + args[0].success(data) + hasComplete(args[0].complete) + }, + readArrayBuffer: function(...args) { + console.warn("file.readArrayBuffer interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + const data = {buffer: ["[PC Preview]: default", "[PC Preview]: default", "[PC Preview]: default"]} + args[0].success(data) + hasComplete(args[0].complete) + }, + access: function(...args) { + console.warn("file.access interface mocked in the Previewer. How this interface works on the Previewer may be" + + " different from that on a real device.") + args[0].success() + hasComplete(args[0].complete) + }, + mkdir: function(...args) { + console.warn("file.mkdir interface mocked in the Previewer. How this interface works on the Previewer may be" + + " different from that on a real device.") + args[0].success() + hasComplete(args[0].complete) + }, + rmdir: function(...args) { + console.warn("file.rmdir interface mocked in the Previewer. How this interface works on the Previewer may be" + + " different from that on a real device.") + args[0].success() + hasComplete(args[0].complete) + } + } + } \ No newline at end of file diff --git a/runtime/main/extend/systemplugin/geolocation.js b/runtime/main/extend/systemplugin/geolocation.js new file mode 100644 index 00000000..1e334902 --- /dev/null +++ b/runtime/main/extend/systemplugin/geolocation.js @@ -0,0 +1,48 @@ +import { hasComplete } from "./utils" + +export function mockGeolocation() { + const data = { + latitude: '121.61934', + longitude: '31.257907', + accuracy: '15', + time: '160332896544' + } + global.systemplugin.geolocation = { + getLocation: function (...args) { + console.warn("geolocation.getLocation interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + args[0].success(data) + hasComplete(args[0].complete) + }, + getLocationType: function(...args) { + console.warn("geolocation.getLocationType interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + const info = {types: ['gps', 'network']} + args[0].success(info) + hasComplete(args[0].complete) + }, + getSupportedCoordTypes() { + console.warn("geolocation.getSupportedCoordTypes interface mocked in the Previewer. How this interface works" + + " on the Previewer may be different from that on a real device.") + return ["wgs84"] + }, + subscribe: function(...args) { + console.warn("geolocation.subscribe interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + if (!this.unsubscribeLocation) { + this.unsubscribeLocation = setInterval(() => { + data.latitude = getRandomArbitrary(121, 122) + data.longitude = getRandomArbitrary(31, 32) + data.accuracy = getRandomArbitrary(14, 18) + args[0].success(data) + }, 1000) + } + }, + unsubscribe: function() { + console.warn("geolocation.unsubscribe interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + clearInterval(this.unsubscribeLocation) + delete this.unsubscribeLocation + } + } + } \ No newline at end of file diff --git a/runtime/main/extend/systemplugin/index.js b/runtime/main/extend/systemplugin/index.js new file mode 100644 index 00000000..70780198 --- /dev/null +++ b/runtime/main/extend/systemplugin/index.js @@ -0,0 +1,104 @@ +import regeneratorRuntime from 'babel-runtime/regenerator' + +import { + mockAbilityFeatureAbility, + mockAbilityParticleAbility, + mockAbilityFormManager +} from './ability' + +import { mockBattery } from './battery' +import { mockBrightness } from './brightness' +import { mockBluetooth } from './bluetooth' +import { mockCall } from './telephony' +import { mockCipher } from './cipher' +import { mockDataStorage } from './data' +import { mockDeviceInfo } from './deviceInfo' +import { mockDistributedSchedule } from './distributedSchedule' +import { mockDocument } from './document' +import { mockFetch } from './fetch' +import { mockFeatureAbility } from './featureAbility' +import { mockFile } from './file' +import { mockGeolocation } from './geolocation' +import { mockInputmethod } from './inputmethod' + +import { + mockMultimediaImage, + mockMultimediaMedia, + mockMultimediaMedialibrary +} from './multimedia' +import { mockNetwork } from './network' +import { mockNfcCardEmulation } from './nfc' +import { mockNotification } from './notification' +import { mockOhosBatteryinfo } from './batteryinfo' +import { mockOhosRequest } from './ohos/request' + +import { mockPasteBoard } from './pasteboard' +import { mockReminderAgent } from './ohos/reminderAgent' +import { mockRequest } from './request' + +import { mockSensor } from './sensor' +import { mockStorage } from './storage' +import { mockSystemPackage } from './systemPackage' + +import { mockUserauth } from './userIAM' +import { mockVibrator } from './vibrator' + +import { mockWebSocket, mockHttp } from './net' +import { mockWifi } from './wifi' +import { mockWindow } from './window' + +import { mockRequireNapiFun } from './napi' +import { mockAccessibility } from './accessibility' +import { mockAI } from './ai' +import { mockDisplay } from './display' +import { mockDeviceManager } from './deviceManager' + +export function mockSystemPlugin() { + global.regeneratorRuntime = regeneratorRuntime + + global.systemplugin = {} + global.ohosplugin = {} + + mockNotification() + mockFetch() + mockRequest() + mockStorage() + mockFile() + mockVibrator() + mockSensor() + mockGeolocation() + mockNetwork() + mockBrightness() + mockBattery() + mockSystemPackage() + mockFeatureAbility() + mockBluetooth() + mockCipher() + mockOhosBatteryinfo() + mockUserauth() + mockDistributedSchedule() + mockDocument() + mockPasteBoard() + mockInputmethod() + mockOhosRequest() + mockMultimediaImage() + mockMultimediaMedia() + mockMultimediaMedialibrary() + mockCall() + mockWebSocket() + mockHttp() + mockDeviceInfo() + mockWifi() + mockNfcCardEmulation() + mockDataStorage() + mockWindow() + mockAbilityFeatureAbility() + mockReminderAgent() + mockRequireNapiFun() + mockAccessibility() + mockAbilityParticleAbility() + mockAbilityFormManager() + mockAI() + mockDisplay() + mockDeviceManager() +} diff --git a/runtime/main/extend/systemplugin/inputmethod.js b/runtime/main/extend/systemplugin/inputmethod.js new file mode 100644 index 00000000..fc6621c2 --- /dev/null +++ b/runtime/main/extend/systemplugin/inputmethod.js @@ -0,0 +1,25 @@ +import { paramMock } from "./utils" + +export function mockInputmethod() { + const InputMethodControllerMock = { + stopInput: function (...args) { + console.warn("InputMethodController.stopInput interface mocked in the Previewer. How this interface works on" + + " the Previewer may be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock, paramMock.paramBooleanMock); + } else { + return new Promise((resolve, reject) => { + resolve(paramMock.paramBooleanMock); + }) + } + } + } + global.systemplugin.inputmethod = { + getInputMethodController: function () { + console.warn("inputmethod.getInputMethodController interface mocked in the Previewer. How this interface works" + + " on the Previewer may be different from that on a real device.") + return InputMethodControllerMock; + } + } +} \ No newline at end of file diff --git a/runtime/main/extend/systemplugin/multimedia.js b/runtime/main/extend/systemplugin/multimedia.js new file mode 100644 index 00000000..a682dc35 --- /dev/null +++ b/runtime/main/extend/systemplugin/multimedia.js @@ -0,0 +1,237 @@ +import { paramMock } from "./utils" + +export function mockMultimediaImage() { + global.systemplugin.multimedia = {} + const sizeMock = { + height: "[PC Preview] unknow height", + width: "[PC Preview] unknow width" + } + const imageInfoMock = { + size: sizeMock, + pixelFortmat: "[PC Preview] unknow pixelFortmat", + colorSpace: "[PC Preview] unknow colorSpace", + alphaType: "[PC Preview] unknow alphaType" + } + const imageSourceMock = { + getImageInfo: function (...args) { + console.warn("ImageSource.getImageInfo interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock, imageInfoMock); + } else { + return new Promise((resolve, reject) => { + resolve(imageInfoMock); + }) + } + }, + release: function (...args) { + console.warn("ImageSource.release interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock); + } else { + return new Promise((resolve, reject) => { + resolve(); + }) + } + }, + supportedFormats: "[PC Preview] unknow supportedFormats" + } + const imagePackerMock = { + packing: function (...args) { + console.warn("ImagePacker.packing interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock, paramMock.paramArrayMock); + } else { + return new Promise((resolve, reject) => { + resolve(paramMock.paramArrayMock); + }) + } + }, + release: function (...args) { + console.warn("ImagePacker.release interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock); + } else { + return new Promise((resolve, reject) => { + resolve(); + }) + } + }, + supportedFormats: "[PC Preview] unknow supportedFormats" + } + global.systemplugin.multimedia.image = { + createImageSource: function () { + console.warn("multimedia.image.createImageSource interface mocked in the Previewer. How this interface works" + + " on the Previewer may be different from that on a real device.") + return imageSourceMock; + }, + createImagePacker: function () { + console.warn("multimedia.image.createImagePacker interface mocked in the Previewer. How this interface works" + + " on the Previewer may be different from that on a real device.") + return imagePackerMock; + } + } +} + +export function mockMultimediaMedia() { + const audioPlayerMock = { + play: function () { + console.warn("AudioPlayer.play interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + return + }, + pause: function () { + console.warn("AudioPlayer.pause interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + return + }, + stop: function () { + console.warn("AudioPlayer.stop interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + return + }, + seek: function (...args) { + console.warn("AudioPlayer.seek interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + return + }, + setVolume: function (...args) { + console.warn("AudioPlayer.setVolume interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + return + }, + release: function () { + console.warn("AudioPlayer.release interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + return + }, + src: "[PC Preview] unknow src", + loop: "[PC Preview] unknow loop", + currentTime: "[PC Preview] unknow currentTime", + duration: "[PC Preview] unknow duration", + state: "[PC Preview] unknow state", + on: function (...args) { + console.warn("AudioPlayer.on interface mocked in the Previewer. How this interface works on the Previewer may" + + " be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + if (args[0] == 'error') { + args[len - 1].call(this, paramMock.businessErrorMock); + } else if (args[0] == 'timeUpdate') { + args[len - 1].call(this, paramMock.paramNumberMock); + } else { + args[len - 1].call(this); + } + } + } + } + const audioRecorderMock = { + prepare: function () { + console.warn("AudioRecorder.prepare interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + }, + start: function () { + console.warn("AudioRecorder.start interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + }, + pause: function () { + console.warn("AudioRecorder.pause interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + }, + resume: function () { + console.warn("AudioRecorder.resume interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + }, + stop: function () { + console.warn("AudioRecorder.stop interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + }, + release: function () { + console.warn("AudioRecorder.release interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + }, + reset: function () { + console.warn("AudioRecorder.reset interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + }, + on: function (...args) { + console.warn("AudioRecorder.on interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + if (args[0] == 'error') { + args[len - 1].call(this, paramMock.businessErrorMock); + } else { + args[len - 1].call(this); + } + } + } + } + global.systemplugin.multimedia.media = { + createAudioPlayer: function () { + console.warn("multimedia.media.createAudioPlayer interface mocked in the Previewer. How this interface works" + + " on the Previewer may be different from that on a real device.") + return audioPlayerMock; + }, + createAudioRecorder: function () { + console.warn("multimedia.media.createAudioRecorder interface mocked in the Previewer. How this interface works" + + " on the Previewer may be different from that on a real device.") + return audioRecorderMock; + } + } +} + +export function mockMultimediaMedialibrary() { + const MediaLibraryMock = { + storeMediaAsset: function (...args) { + console.warn("MediaLibrary.storeMediaAsset interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock, paramMock.paramStringMock); + } else { + return new Promise((resolve, reject) => { + resolve(paramMock.paramStringMock); + }) + } + }, + startImagePreview: function (...args) { + console.warn("MediaLibrary.startImagePreview interface mocked in the Previewer. How this interface works on" + + " the Previewer may be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock); + } else { + return new Promise((resolve, reject) => { + resolve(); + }) + } + }, + startMediaSelect: function (...args) { + console.warn("MediaLibrary.startMediaSelect interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock, paramMock.paramArrayMock); + } else { + return new Promise((resolve, reject) => { + resolve(paramMock.paramArrayMock); + }) + } + } + } + global.systemplugin.multimedia.mediaLibrary = { + getMediaLibrary: function () { + console.warn("multimedia.mediaLibrary.getMediaLibrary interface mocked in the Previewer. How this interface" + + " works on the Previewer may be different from that on a real device.") + return MediaLibraryMock; + } + } +} \ No newline at end of file diff --git a/runtime/main/extend/systemplugin/napi/fileio.js b/runtime/main/extend/systemplugin/napi/fileio.js new file mode 100644 index 00000000..8bc27d06 --- /dev/null +++ b/runtime/main/extend/systemplugin/napi/fileio.js @@ -0,0 +1,708 @@ +import { paramMock } from "../utils" + +export function mockFileio() { + const StatMock = { + dev: '[PC preview] unknow dev', + ino: '[PC preview] unknow ino', + mode: '[PC preview] unknow mode', + nlink: '[PC preview] unknow nlink', + uid: '[PC preview] unknow uid', + gid: '[PC preview] unknow gid', + rdev: '[PC preview] unknow rdev', + size: '[PC preview] unknow size', + blocks: '[PC preview] unknow blocks', + atime: '[PC preview] unknow atime', + mtime: '[PC preview] unknow mtime', + ctime: '[PC preview] unknow ctime', + isBlockDevice: function () { + console.warn("Stat.isBlockDevice interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + return paramMock.paramBooleanMock + }, + isCharacterDevice: function () { + console.warn("Stat.isCharacterDevice interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + return paramMock.paramBooleanMock + }, + isDirectory: function () { + console.warn("Stat.isDirectory interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + return paramMock.paramBooleanMock + }, + isFIFO: function () { + console.warn("Stat.isFIFO interface mocked in the Previewer. How this interface works on the Previewer may be" + + " different from that on a real device.") + return paramMock.paramBooleanMock + }, + isFile: function () { + console.warn("Stat.isFile interface mocked in the Previewer. How this interface works on the Previewer may be" + + " different from that on a real device.") + return paramMock.paramBooleanMock + }, + isSocket: function () { + console.warn("Stat.isSocket interface mocked in the Previewer. How this interface works on the Previewer may" + + " be different from that on a real device.") + return paramMock.paramBooleanMock + }, + isSymbolicLink: function () { + console.warn("Stat.isSymbolicLink interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + return paramMock.paramBooleanMock + } + }; + const DirMock = { + close: function (...args) { + console.warn("Dir.close interface mocked in the Previewer. How this interface works on the Previewer may be" + + " different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock); + } else { + return new Promise((resolve, reject) => { + resolve(); + }) + } + }, + closeSync: function (...args) { + console.warn("Dir.closeSync interface mocked in the Previewer. How this interface works on the Previewer may" + + " be different from that on a real device.") + }, + read: function (...args) { + console.warn("Dir.read interface mocked in the Previewer. How this interface works on the Previewer may be" + + " different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock, DirentMock); + } else { + return new Promise((resolve, reject) => { + resolve(DirentMock); + }) + } + }, + readSync: function (...args) { + console.warn("Dir.readSync interface mocked in the Previewer. How this interface works on the Previewer may be" + + " different from that on a real device.") + return DirentMock + } + }; + const StreamMock = { + close: function (...args) { + console.warn("Stream.close interface mocked in the Previewer. How this interface works on the Previewer may be" + + " different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock); + } else { + return new Promise((resolve, reject) => { + resolve(); + }) + } + }, + closeSync: function (...args) { + console.warn("Stream.closeSync interface mocked in the Previewer. How this interface works on the Previewer may" + + " be different from that on a real device.") + }, + flush: function (...args) { + console.warn("Stream.flush interface mocked in the Previewer. How this interface works on the Previewer may be" + + " different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock); + } else { + return new Promise((resolve, reject) => { + resolve(); + }) + } + }, + flushSync: function (...args) { + console.warn("Stream.flushSync interface mocked in the Previewer. How this interface works on the Previewer may" + + " be different from that on a real device.") + }, + read: function (...args) { + console.warn("Stream.read interface mocked in the Previewer. How this interface works on the Previewer may be" + + " different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock, ReadOutMock) + } else { + return new Promise((resolve, reject) => { + resolve(ReadOutMock); + }) + } + }, + readSync: function (...args) { + console.warn("Stream.readSync interface mocked in the Previewer. How this interface works on the Previewer may" + + " be different from that on a real device.") + return paramMock.paramNumberMock; + }, + write: function (...args) { + console.warn("Stream.write interface mocked in the Previewer. How this interface works on the Previewer may be" + + " different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock, paramMock.paramNumberMock) + } else { + return new Promise((resolve, reject) => { + resolve(paramMock.paramNumberMock); + }) + } + }, + writeSync: function (...args) { + console.warn("Stream.writeSync interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + return paramMock.paramNumberMock; + } + }; + const DirentMock = { + name: "[PC Preview]: unknow name", + isBlockDevice: function () { + console.warn("Dirent.isBlockDevice interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + return paramMock.paramBooleanMock + }, + isCharacterDevice: function () { + console.warn("Dirent.isCharacterDevice interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + return paramMock.paramBooleanMock + }, + isDirectory: function () { + console.warn("Dirent.isDirectory interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + return paramMock.paramBooleanMock + }, + isFIFO: function () { + console.warn("Dirent.isFIFO interface mocked in the Previewer. How this interface works on the Previewer may" + + " be different from that on a real device.") + return paramMock.paramBooleanMock + }, + isFile: function () { + console.warn("Dirent.isFile interface mocked in the Previewer. How this interface works on the Previewer may" + + " be different from that on a real device.") + return paramMock.paramBooleanMock + }, + isSocket: function () { + console.warn("Dirent.isSocket interface mocked in the Previewer. How this interface works on the Previewer may" + + " be different from that on a real device.") + return paramMock.paramBooleanMock + }, + isSymbolicLink: function () { + console.warn("Dirent.isSymbolicLink interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + return paramMock.paramBooleanMock + } + }; + const ReadOutMock = { + bytesRead: "[PC Preview]: unknow bytesRead", + offset: "[PC Preview]: unknow offset", + buffer: "[PC Preview]: unknow buffer" + }; + const WatcherMock = { + stop: function () { + console.warn("Watcher.stop interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + return + } + }; + const fileioMock = { + Dir: DirMock, + Dirent: DirentMock, + Stat: StatMock, + Stream: StreamMock, + ReadOut: ReadOutMock, + Watcher: WatcherMock, + access: function (...args) { + console.warn("fileio.access interface mocked in the Previewer. How this interface works on the Previewer may" + + " be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock); + } else { + return new Promise((resolve, reject) => { + resolve(); + }) + } + }, + accessSync: function (...args) { + console.warn("fileio.accessSync interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + }, + chmod: function (...args) { + console.warn("fileio.chmod interface mocked in the Previewer. How this interface works on the Previewer may" + + " be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock); + } else { + return new Promise((resolve, reject) => { + resolve(); + }) + } + }, + chmodSync: function (...args) { + console.warn("fileio.chmodSync interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + return + }, + chown: function (...args) { + console.warn("fileio.chown interface mocked in the Previewer. How this interface works on the Previewer may" + + " be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock); + } else { + return new Promise((resolve, reject) => { + resolve(); + }) + } + }, + chownSync: function (...args) { + console.warn("fileio.chownSync interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + return + }, + close: function (...args) { + console.warn("fileio.close interface mocked in the Previewer. How this interface works on the Previewer may" + + " be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock); + } else { + return new Promise((resolve, reject) => { + resolve(); + }) + } + }, + closeSync: function (...args) { + console.warn("fileio.closeSync interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + return + }, + copyFile: function (...args) { + console.warn("fileio.copyFile interface mocked in the Previewer. How this interface works on the Previewer may" + + " be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock); + } else { + return new Promise((resolve, reject) => { + resolve(); + }) + } + }, + copyFileSync: function (...args) { + console.warn("fileio.copyFileSync interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + }, + createStream: function (...args) { + console.warn("fileio.createStream interface mocked in the Previewer. How this interface works on the Previewer may be" + + " different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock, StreamMock) + } else { + return new Promise((resolve, reject) => { + resolve(StreamMock); + }) + } + }, + createStreamSync: function (...args) { + console.warn("fileio.createStreamSync interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + return StreamMock; + }, + createWatcher: function (...args) { + console.warn("fileio.createWatcher interface mocked in the Previewer. How this interface works on the Previewer may be" + + " different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock, paramMock.paramNumberMock) + } else { + return WatcherMock; + } + }, + fchmod: function (...args) { + console.warn("fileio.fchmod interface mocked in the Previewer. How this interface works on the Previewer may" + + " be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock); + } else { + return new Promise((resolve, reject) => { + resolve(); + }) + } + }, + fchmodSync: function (...args) { + console.warn("fileio.fchmodSync interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + return + }, + fchown: function (...args) { + console.warn("fileio.fchown interface mocked in the Previewer. How this interface works on the Previewer may" + + " be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock); + } else { + return new Promise((resolve, reject) => { + resolve(); + }) + } + }, + fchownSync: function (...args) { + console.warn("fileio.fchownSync interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + return + }, + fdatasync: function (...args) { + console.warn("fileio.fdatasync interface mocked in the Previewer. How this interface works on the Previewer may" + + " be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock); + } else { + return new Promise((resolve, reject) => { + resolve(); + }) + } + }, + fdatasyncSync: function (...args) { + console.warn("fileio.fdatasyncSync interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + return + }, + fdopenStream: function (...args) { + console.warn("fileio.fdopenStream interface mocked in the Previewer. How this interface works on the Previewer may be" + + " different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock, StreamMock) + } else { + return new Promise((resolve, reject) => { + resolve(StreamMock); + }) + } + }, + fdopenStreamSync: function (...args) { + console.warn("fileio.fdopenStreamSync interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + return StreamMock; + }, + fstat: function (...args) { + console.warn("fileio.fstat interface mocked in the Previewer. How this interface works on the Previewer may be" + + " different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock, StatMock) + } else { + return new Promise((resolve, reject) => { + resolve(StatMock); + }) + } + }, + fstatSync: function (...args) { + console.warn("fileio.fstatSync interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + return StatMock; + }, + fsync: function (...args) { + console.warn("fileio.fsync interface mocked in the Previewer. How this interface works on the Previewer may" + + " be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock); + } else { + return new Promise((resolve, reject) => { + resolve(); + }) + } + }, + fsyncSync: function (...args) { + console.warn("fileio.fsyncSync interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + return + }, + ftruncate: function (...args) { + console.warn("fileio.ftruncate interface mocked in the Previewer. How this interface works on the Previewer may" + + " be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock); + } else { + return new Promise((resolve, reject) => { + resolve(); + }) + } + }, + ftruncateSync: function (...args) { + console.warn("fileio.ftruncateSync interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + return + }, + hash: function (...args) { + console.warn("fileio.hash interface mocked in the Previewer. How this interface works on the Previewer may be" + + " different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock, paramMock.paramStringMock) + } else { + return new Promise((resolve, reject) => { + resolve(paramMock.paramStringMock); + }) + } + }, + lchown: function (...args) { + console.warn("fileio.lchown interface mocked in the Previewer. How this interface works on the Previewer may" + + " be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock); + } else { + return new Promise((resolve, reject) => { + resolve(); + }) + } + }, + lchownSync: function (...args) { + console.warn("fileio.lchownSync interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + return + }, + lstat: function (...args) { + console.warn("fileio.lstat interface mocked in the Previewer. How this interface works on the Previewer may be" + + " different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock, StatMock) + } else { + return new Promise((resolve, reject) => { + resolve(StatMock); + }) + } + }, + lstatSync: function (...args) { + console.warn("fileio.lstatSync interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + return StatMock; + }, + mkdir: function (...args) { + console.warn("fileio.mkdir interface mocked in the Previewer. How this interface works on the Previewer may be" + + " different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock); + } else { + return new Promise((resolve, reject) => { + resolve(); + }) + } + }, + mkdirSync: function (...args) { + console.warn("fileio.mkdirSync interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + }, + mkdtemp: function (...args) { + console.warn("fileio.mkdtemp interface mocked in the Previewer. How this interface works on the Previewer may be" + + " different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock, paramMock.paramStringMock) + } else { + return new Promise((resolve, reject) => { + resolve(paramMock.paramStringMock); + }) + } + }, + mkdtempSync: function (...args) { + console.warn("fileio.mkdtempSync interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + return paramMock.paramStringMock; + }, + open: function (...args) { + console.warn("fileio.open interface mocked in the Previewer. How this interface works on the Previewer may be" + + " different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock, paramMock.paramNumberMock) + } else { + return new Promise((resolve, reject) => { + resolve(paramMock.paramNumberMock); + }) + } + }, + openSync: function (...args) { + console.warn("fileio.openSync interface mocked in the Previewer. How this interface works on the Previewer may" + + " be different from that on a real device.") + return paramMock.paramNumberMock; + }, + opendir: function (...args) { + console.warn("fileio.opendir interface mocked in the Previewer. How this interface works on the Previewer may" + + " be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock, DirMock) + } else { + return new Promise((resolve, reject) => { + resolve(DirMock); + }) + } + }, + opendirSync: function (...args) { + console.warn("fileio.opendirSync interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + return DirMock; + }, + read: function (...args) { + console.warn("fileio.read interface mocked in the Previewer. How this interface works on the Previewer may be" + + " different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock, ReadOutMock) + } else { + return new Promise((resolve, reject) => { + resolve(ReadOutMock); + }) + } + }, + readSync: function (...args) { + console.warn("fileio.readSync interface mocked in the Previewer. How this interface works on the Previewer may" + + " be different from that on a real device.") + return paramMock.paramNumberMock; + }, + readText: function (...args) { + console.warn("fileio.readText interface mocked in the Previewer. How this interface works on the Previewer may" + + " be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock, paramMock.paramStringMock); + } else { + return new Promise((resolve, reject) => { + resolve(paramMock.paramStringMock); + }) + } + }, + readTextSync: function (...args) { + console.warn("fileio.readTextSync interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + return paramMock.paramStringMock; + }, + rename: function (...args) { + console.warn("fileio.rename interface mocked in the Previewer. How this interface works on the Previewer may" + + " be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock); + } else { + return new Promise((resolve, reject) => { + resolve(); + }) + } + }, + renameSync: function (...args) { + console.warn("fileio.renameSync interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + return + }, + rmdir: function (...args) { + console.warn("fileio.rmdir interface mocked in the Previewer. How this interface works on the Previewer may" + + " be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock); + } else { + return new Promise((resolve, reject) => { + resolve(); + }) + } + }, + rmdirSync: function (...args) { + console.warn("fileio.rmdirSync interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + }, + stat: function (...args) { + console.warn("fileio.stat interface mocked in the Previewer. How this interface works on the Previewer may be" + + " different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock, StatMock) + } else { + return new Promise((resolve, reject) => { + resolve(StatMock); + }) + } + }, + statSync: function (...args) { + console.warn("fileio.statSync interface mocked in the Previewer. How this interface works on the Previewer may" + + " be different from that on a real device.") + return StatMock; + }, + symlink: function (...args) { + console.warn("fileio.symlink interface mocked in the Previewer. How this interface works on the Previewer may" + + " be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock); + } else { + return new Promise((resolve, reject) => { + resolve(); + }) + } + }, + symlinkSync: function (...args) { + console.warn("fileio.symlinkSync interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + return + }, + truncate: function (...args) { + console.warn("fileio.truncate interface mocked in the Previewer. How this interface works on the Previewer may" + + " be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock); + } else { + return new Promise((resolve, reject) => { + resolve(); + }) + } + }, + truncateSync: function (...args) { + console.warn("fileio.truncateSync interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + return + }, + unlink: function (...args) { + console.warn("fileio.unlink interface mocked in the Previewer. How this interface works on the Previewer may" + + " be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock); + } else { + return new Promise((resolve, reject) => { + resolve(); + }) + } + }, + unlinkSync: function (...args) { + console.warn("fileio.unlinkSync interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + }, + write: function (...args) { + console.warn("fileio.write interface mocked in the Previewer. How this interface works on the Previewer may be" + + " different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock, paramMock.paramNumberMock) + } else { + return new Promise((resolve, reject) => { + resolve(paramMock.paramNumberMock); + }) + } + }, + writeSync: function (...args) { + console.warn("fileio.writeSync interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + return paramMock.paramNumberMock; + } + } + return fileioMock +} \ No newline at end of file diff --git a/runtime/main/extend/systemplugin/napi/index.js b/runtime/main/extend/systemplugin/napi/index.js new file mode 100644 index 00000000..dd66cbb1 --- /dev/null +++ b/runtime/main/extend/systemplugin/napi/index.js @@ -0,0 +1,25 @@ +import { mockSystemParameter } from './systemParameter' +import { mockFileio } from './fileio' +import { mockWorker } from './worker' +import { mockUtil } from './util' +import { mockPower } from './power' +import { mockRunningLock } from './runningLock' + +export function mockRequireNapiFun() { + global.requireNapi = function (...args) { + switch (args[0]) { + case "systemParameter": + return mockSystemParameter(); + case "fileio": + return mockFileio(); + case "worker" : + return mockWorker(); + case "util": + return mockUtil(); + case "power": + return mockPower(); + case "runningLock": + return mockRunningLock(); + } + } +} diff --git a/runtime/main/extend/systemplugin/napi/power.js b/runtime/main/extend/systemplugin/napi/power.js new file mode 100644 index 00000000..d0261e10 --- /dev/null +++ b/runtime/main/extend/systemplugin/napi/power.js @@ -0,0 +1,27 @@ +import { paramMock } from "../utils" + +export function mockPower() { + const power = { + shutdownDevice: function (...args) { + console.warn("power.shutdownDevice interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + }, + rebootDevice: function (...args) { + console.warn("power.rebootDevice interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + }, + isScreenOn: function (...args) { + console.warn("power.isScreenOn interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock, paramMock.paramBooleanMock); + } else { + return new Promise((resolve, reject) => { + resolve(paramMock.paramBooleanMock); + }) + } + } + } + return power +} diff --git a/runtime/main/extend/systemplugin/napi/runningLock.js b/runtime/main/extend/systemplugin/napi/runningLock.js new file mode 100644 index 00000000..e7c886d5 --- /dev/null +++ b/runtime/main/extend/systemplugin/napi/runningLock.js @@ -0,0 +1,46 @@ +import { paramMock } from "../utils" + +export function mockRunningLock() { + const RunningLockMock = { + lock: function (...args) { + console.warn("RunningLock.lock interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + }, + isUsed: function () { + console.warn("RunningLock.isUsed interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + return paramMock.paramBooleanMock + }, + unlock: function () { + console.warn("RunningLock.unlock interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + } + }; + const runningLock = { + isRunningLockTypeSupported: function (...args) { + console.warn("runningLock.isRunningLockTypeSupported interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock, paramMock.paramBooleanMock); + } else { + return new Promise((resolve, reject) => { + resolve(paramMock.paramBooleanMock); + }) + } + }, + createRunningLock: function (...args) { + console.warn("runningLock.createRunningLock interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock, RunningLockMock); + } else { + return new Promise((resolve, reject) => { + resolve(RunningLockMock); + }) + } + } + } + return runningLock +} \ No newline at end of file diff --git a/runtime/main/extend/systemplugin/napi/systemParameter.js b/runtime/main/extend/systemplugin/napi/systemParameter.js new file mode 100644 index 00000000..297d939b --- /dev/null +++ b/runtime/main/extend/systemplugin/napi/systemParameter.js @@ -0,0 +1,40 @@ +import { paramMock } from "../utils" + +export function mockSystemParameter() { + const systemParameter = { + getSync: function (...args) { + console.warn("systemParameter.getSync interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + return paramMock.paramStringMock + }, + get: function (...args) { + console.warn("systemParameter.get interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock, paramMock.paramStringMock); + } else { + return new Promise((resolve, reject) => { + resolve(paramMock.paramStringMock); + }) + } + }, + setSync: function (...args) { + console.warn("systemParameter.setSync interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + }, + set: function (...args) { + console.warn("systemParameter.set interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock); + } else { + return new Promise((resolve, reject) => { + resolve(); + }) + } + } + } + return systemParameter +} \ No newline at end of file diff --git a/runtime/main/extend/systemplugin/napi/util.js b/runtime/main/extend/systemplugin/napi/util.js new file mode 100644 index 00000000..85f8d34f --- /dev/null +++ b/runtime/main/extend/systemplugin/napi/util.js @@ -0,0 +1,40 @@ +import { paramMock } from "../utils" + +export function mockUtil() { + const result = { + TextDecoder: function(...args) { + console.warn("util.TextDecoder interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + return TextDecoderMock; + }, + TextEncoder: function(...args) { + console.warn("util.TextEncoder interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + return TextEncoderMock; + } + } + const TextDecoderMock = { + encoding: '[PC preview] unknow encoding', + fatal: '[PC preview] unknow fatal', + ignoreBOM: '[PC preview] unknow ignoreBOM', + decode: function (...args) { + console.warn("TextDecoder.decode interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + return paramMock.paramStringMock; + }, + } + const TextEncoderMock = { + encoding: '[PC preview] unknow encoding', + encode: function(...args) { + console.warn("TextEncoder.encode interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + return paramMock.paramArrayMock; + }, + encodeInto: function(...args) { + console.warn("TextEncoder.encodeInto interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + return paramMock.paramObjectMock; + } + } + return result; +} diff --git a/runtime/main/extend/systemplugin/napi/worker.js b/runtime/main/extend/systemplugin/napi/worker.js new file mode 100644 index 00000000..154fcc79 --- /dev/null +++ b/runtime/main/extend/systemplugin/napi/worker.js @@ -0,0 +1,71 @@ +import { paramMock } from "../utils" + +export function mockWorker() { + const result = { + Worker: function (params) { + console.warn("worker.Worker interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + return WorkerMock; + } + } + const WorkerMock = { + postMessage: function (...args) { + console.warn("Worker.postMessage interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + }, + terminate: function (...args) { + console.warn("Worker.terminate interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + }, + on: function (...args) { + console.warn("Worker.on interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + }, + once: function (...args) { + console.warn("Worker.once interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + }, + off: function (...args) { + console.warn("Worker.off interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + }, + addEventListener: function (...args) { + console.warn("Worker.addEventListener interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + }, + dispatchEvent: function (...args) { + console.warn("Worker.dispatchEvent interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + return paramMock.paramBooleanMock; + }, + removeEventListener: function (...args) { + console.warn("Worker.removeEventListener interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + }, + removeAllListener: function (...args) { + console.warn("Worker.removeAllListener interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + }, + onmessage: function (...args) { + console.warn("Worker.onmessage interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + }, + onmessageerror: function (...agrs) { + console.warn("Worker.onmessageerror interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + }, + onerror: function (...args) { + console.warn("Worker.onerror interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + }, + onclose: function (...args) { + console.warn("Worker.onclose interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + }, + onexit: function (...args) { + console.warn("Worker.onexit interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + } + } + return result; +} \ No newline at end of file diff --git a/runtime/main/extend/systemplugin/net.js b/runtime/main/extend/systemplugin/net.js new file mode 100644 index 00000000..dee2f37f --- /dev/null +++ b/runtime/main/extend/systemplugin/net.js @@ -0,0 +1,137 @@ +import { paramMock } from "./utils" + +export function mockWebSocket() { + global.systemplugin.net = {} + const WebSocketMock = { + connect: function (...args) { + console.warn("WebSocket.connect interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock, paramMock.paramBooleanMock); + } else { + return new Promise((resolve, reject) => { + resolve(paramMock.paramBooleanMock); + }) + } + }, + send: function (...args) { + console.warn("WebSocket.send interface mocked in the Previewer. How this interface works on the Previewer may" + + " be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock, paramMock.paramBooleanMock); + } else { + return new Promise((resolve, reject) => { + resolve(paramMock.paramBooleanMock); + }) + } + }, + close: function (...args) { + console.warn("WebSocket.close interface mocked in the Previewer. How this interface works on the Previewer " + + "may be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock, paramMock.paramBooleanMock); + } else { + return new Promise((resolve, reject) => { + resolve(paramMock.paramBooleanMock); + }) + } + }, + on: function (...args) { + console.warn("WebSocket.on interface mocked in the Previewer. How this interface works on the Previewer may " + + "be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + if (args[0] == 'open') { + args[len - 1].call(this, paramMock.businessErrorMock, paramMock.paramObjectMock); + } else if (args[0] == 'message') { + args[len - 1].call(this, paramMock.businessErrorMock, paramMock.paramStringMock); + } else if (args[0] == 'close') { + args[len - 1].call(this, { + code: "[PC Preview] unknow code", + reason: "[PC Preview] unknow reason" + }); + } else if (args[0] == 'error') { + args[len - 1].call(this, paramMock.businessErrorMock); + } + } + }, + off: function (...args) { + console.warn("WebSocket.off interface mocked in the Previewer. How this interface works on the Previewer may" + + " be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + if (args[0] == 'open') { + args[len - 1].call(this, paramMock.businessErrorMock, paramMock.paramObjectMock); + } else if (args[0] == 'message') { + args[len - 1].call(this, paramMock.businessErrorMock, paramMock.paramStringMock); + } else if (args[0] == 'close') { + args[len - 1].call(this, { + code: "[PC Preview] unknow code", + reason: "[PC Preview] unknow reason" + }); + } else if (args[0] == 'error') { + args[len - 1].call(this, paramMock.businessErrorMock); + } + } + } + } + global.systemplugin.net.webSocket = { + createWebSocket: function () { + console.warn("net.webSocket.createWebSocket interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + return WebSocketMock; + } + } +} + +export function mockHttp() { + const HttpResponseMock = { + result: "[PC Preview] unknow result", + responseCode: "[PC Preview] unknow responseCode", + header: "[PC Preview] unknow header" + } + const HttpRequestMock = { + request: function (...args) { + console.warn("HttpRequest.request interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock, HttpResponseMock); + } else { + return new Promise((resolve, reject) => { + resolve(HttpResponseMock); + }) + } + }, + destroy: function () { + console.warn("HttpRequest.destroy interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + }, + on: function (...args) { + console.warn("HttpRequest.on interface mocked in the Previewer. How this interface works on the Previewer may" + + " be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock, paramMock.paramObjectMock); + } + }, + off: function (...args) { + console.warn("HttpRequest.off interface mocked in the Previewer. How this interface works on the Previewer may" + + " be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock, paramMock.paramObjectMock); + } + } + } + global.systemplugin.net.http = { + createHttp: function () { + console.warn("net.http.createHttp interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + return HttpRequestMock; + } + } +} \ No newline at end of file diff --git a/runtime/main/extend/systemplugin/network.js b/runtime/main/extend/systemplugin/network.js new file mode 100644 index 00000000..92e7ea3a --- /dev/null +++ b/runtime/main/extend/systemplugin/network.js @@ -0,0 +1,29 @@ +export function mockNetwork() { + const data = { + metered: true, + type: "5g" + } + global.systemplugin.network = { + getType: function (...args) { + console.warn("network.getType interface mocked in the Previewer. How this interface works on the Previewer may" + + " be different from that on a real device.") + args[0].success(data) + args[0].complete() + }, + subscribe: function (...args) { + console.warn("network.subscribe interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + if (!this.unsubscribeNetwork) { + this.unsubscribeNetwork = setInterval(() => { + args[0].success(data) + }, 3000) + } + }, + unsubscribe: function () { + console.warn("network.unsubscribe interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + clearInterval(this.unsubscribeNetwork) + delete this.unsubscribeNetwork + } + } +} \ No newline at end of file diff --git a/runtime/main/extend/systemplugin/nfc.js b/runtime/main/extend/systemplugin/nfc.js new file mode 100644 index 00000000..f807e84a --- /dev/null +++ b/runtime/main/extend/systemplugin/nfc.js @@ -0,0 +1,12 @@ +import { paramMock } from "./utils" + +export function mockNfcCardEmulation() { + global.systemplugin.nfc = {} + global.systemplugin.nfc.cardEmulation = { + isSupported: function (...args) { + console.warn("nfc.cardEmulation.isSupported interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + return paramMock.paramBooleanMock; + } + } +} diff --git a/runtime/main/extend/systemplugin/notification.js b/runtime/main/extend/systemplugin/notification.js new file mode 100644 index 00000000..90b78cdb --- /dev/null +++ b/runtime/main/extend/systemplugin/notification.js @@ -0,0 +1,8 @@ +export function mockNotification() { + global.systemplugin.notification = { + show: function () { + console.warn("notification.show interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + } + } +} \ No newline at end of file diff --git a/runtime/main/extend/systemplugin/ohos/reminderAgent.js b/runtime/main/extend/systemplugin/ohos/reminderAgent.js new file mode 100644 index 00000000..33ac9557 --- /dev/null +++ b/runtime/main/extend/systemplugin/ohos/reminderAgent.js @@ -0,0 +1,111 @@ +import { paramMock } from "../utils" + +export function mockReminderAgent() { + const infoMock = { + reminderId: 1, + info: "[PC preview] unknown info" + } + const reminderReq = { + reminderType: 1, + actionButton: [ + { + title: "[PC preview] unknown title", + type: 0 + } + ], + wantAgent: { + pkgName: "[PC preview] unknown pkg nam", + abilityName: "[PC preview] unknown ability name" + }, + maxScreenWantAgent: { + pkgName: "[PC preview] unknown pkg name", + abilityName: "[PC preview] unknown ability name" + }, + ringDuration: 1, + snoozeTimes: 1, + timeInterval: 1, + title: "[PC preview] unknown title", + content: "[PC preview] unknown content", + expiredContent: "[PC preview] unknown expiredContent", + snoozeContent: "[PC preview] unknown snoozeContent", + notificationId: 1, + slotType: 3 + } + const reminderReqs = [ + reminderReq + ] + global.ohosplugin.reminderAgent = { + publishReminder: function (...args) { + console.warn("reminderAgent.publishReminder interface mocked in the Previewer." + + "How this interface works on the Previewer may be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock, infoMock.reminderId) + } else { + return new Promise((resolve) => { + resolve(infoMock.reminderId) + }); + } + }, + getValidReminders: function (...args) { + console.warn("reminderAgent.getValidReminders interface mocked in the Previewer." + + "How this interface works on the Previewer may be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock, reminderReqs) + } else { + return new Promise((resolve) => { + resolve(reminderReqs) + }); + } + }, + cancelReminder: function (...args) { + console.warn("reminderAgent.cancelReminder interface mocked in the Previewer." + + "How this interface works on the Previewer may be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock) + } else { + return new Promise((resolve) => { + resolve() + }); + } + }, + cancelAllReminders: function (...args) { + console.warn("reminderAgent.cancelAllReminders interface mocked in the Previewer." + + "How this interface works on the Previewer may be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock) + } else { + return new Promise((resolve) => { + resolve() + }); + } + }, + addNotificationSlot: function (...args) { + console.warn("reminderAgent.addNotificationSlot interface mocked in the Previewer." + + "How this interface works on the Previewer may be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock) + } else { + return new Promise((resolve) => { + resolve() + }); + } + }, + removeNotificationSlot: function (...args) { + console.warn("reminderAgent.removeNotificationSlot interface mocked in the Previewer." + + "How this interface works on the Previewer may be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock) + } else { + return new Promise((resolve) => { + resolve() + }); + } + } + } +} \ No newline at end of file diff --git a/runtime/main/extend/systemplugin/ohos/request.js b/runtime/main/extend/systemplugin/ohos/request.js new file mode 100644 index 00000000..e37e1633 --- /dev/null +++ b/runtime/main/extend/systemplugin/ohos/request.js @@ -0,0 +1,198 @@ +import {paramMock} from "../utils"; +const NOTIFY = "[PC Preview] unknow" +const Properties = [ + 'NETWORK_MOBILE', + 'NETWORK_WIFI', + 'ERROR_CANNOT_RESUME', + 'ERROR_DEVICE_NOT_FOUND', + 'ERROR_FILE_ALREADY_EXISTS', + 'ERROR_FILE_ERROR', + 'ERROR_HTTP_DATA_ERROR', + 'ERROR_INSUFFICIENT_SPACE', + 'ERROR_TOO_MANY_REDIRECTS', + 'ERROR_UNHANDLED_HTTP_CODE', + 'ERROR_UNKNOWN', + 'PAUSED_QUEUED_FOR_WIFI', + 'PAUSED_UNKNOWN', + 'PAUSED_WAITING_FOR_NETWORK', + 'PAUSED_WAITING_TO_RETRY', + 'SESSION_FAILED', + 'SESSION_PAUSED', + 'SESSION_PENDING', + 'SESSION_RUNNING', + 'SESSION_SUCCESSFUL' +] + +export function mockOhosRequest() { + const downloadInfo = { + downloadId: 1, + failedReason: 16, + fileName: "[PC preview] unknown file name", + filePath: "[PC preview] unknown file path", + pausedReason: 1, + status: 1, + targetURI: "[PC preview] unknown targetURI", + downloadTitle: "[PC preview] unknown download title", + downloadTotalBytes: 1024, + description: "[PC preview] unknown description", + downloadedBytes: 1 + } + const DownloadTaskMock = { + on: function(...args) { + console.warn("DownloadTask.on interface mocked in the Previewer. How this interface works on the Previewer may" + + " be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + if (args[0] == 'progress') { + args[len - 1].call(this, paramMock.paramNumberMock, paramMock.paramNumberMock); + } else if (args[0] == 'complete' || args[0] == 'pause' || args[0] == 'remove') { + args[len - 1].call(this, paramMock.businessErrorMock); + } else if (args[0] == 'fail') { + args[len - 1].call(this, paramMock.businessErrorMock, paramMock.paramNumberMock); + } + } + }, + off: function(...args) { + console.warn("DownloadTask.off interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + if (args[0] == 'progress') { + args[len - 1].call(this, paramMock.paramNumberMock, paramMock.paramNumberMock); + } else if (args[0] == 'complete' || args[0] == 'pause' || args[0] == 'remove') { + args[len - 1].call(this, paramMock.businessErrorMock); + } else if (args[0] == 'fail') { + args[len - 1].call(this, paramMock.businessErrorMock, paramMock.paramNumberMock); + } + } + }, + remove: function(...args) { + console.warn("DownloadTask.remove interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock, paramMock.paramBooleanMock); + } else { + return new Promise((resolve, reject) => { + resolve(paramMock.paramBooleanMock); + }) + } + }, + pause: function(...args) { + console.warn("DownloadTask.pause interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock); + } else { + return new Promise((resolve, reject) => { + resolve(); + }) + } + }, + resume: function(...args) { + console.warn("DownloadTask.resume interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock); + } else { + return new Promise((resolve, reject) => { + resolve(); + }) + } + }, + queryMimeType: function(...args) { + console.warn("DownloadTask.queryMimeType interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock, paramMock.paramStringMock); + } else { + return new Promise((resolve, reject) => { + resolve(paramMock.paramStringMock); + }) + } + }, + query: function(...args) { + console.warn("DownloadTask.query interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock, downloadInfo); + } else { + return new Promise((resolve, reject) => { + resolve(downloadInfo); + }) + } + } + } + const UploadTaskMock = { + on: function(...args) { + console.warn("UploadTask.on interface mocked in the Previewer. How this interface works on the Previewer may" + + " be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + if (args[0] == 'progress') { + args[len - 1].call(this, paramMock.paramNumberMock, paramMock.paramNumberMock); + } else if (args[0] == 'headerReceive') { + args[len - 1].call(this, paramMock.paramObjectMock); + } + } + }, + off: function(...args) { + console.warn("UploadTask.off interface mocked in the Previewer. How this interface works on the Previewer may" + + " be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + if (args[0] == 'progress') { + args[len - 1].call(this, paramMock.paramNumberMock, paramMock.paramNumberMock); + } else if (args[0] == 'headerReceive') { + args[len - 1].call(this, paramMock.paramObjectMock); + } + } + }, + remove: function(...args) { + console.warn("UploadTask.remove interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock, paramMock.paramBooleanMock); + } else { + return new Promise((resolve, reject) => { + resolve(paramMock.paramBooleanMock); + }) + } + } + } + global.ohosplugin.request = { + download: function (...args) { + console.warn("ohos.request.download interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock, DownloadTaskMock); + } else { + return new Promise((resolve, reject) => { + resolve(DownloadTaskMock); + }) + } + }, + upload: function (...args) { + console.warn("ohos.request.upload interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock, UploadTaskMock); + } else { + return new Promise((resolve, reject) => { + resolve(UploadTaskMock); + }) + } + } + } + + for(let property of Properties) { + global.ohosplugin.request[property] = NOTIFY + " " + property + } +} diff --git a/runtime/main/extend/systemplugin/pasteboard.js b/runtime/main/extend/systemplugin/pasteboard.js new file mode 100644 index 00000000..b1eda885 --- /dev/null +++ b/runtime/main/extend/systemplugin/pasteboard.js @@ -0,0 +1,49 @@ +import { paramMock } from "./utils" + +export function mockPasteBoard() { + const PasteDataMock = { + getPrimaryText: function () { + console.warn("PasteData.getPrimaryText interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + return "[PC Preview] unknow primarytext" + } + } + const SystemPasteboardMock = { + getPasteData: function (...args) { + console.warn("SystemPasteboard.getPasteData interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock, PasteDataMock) + } else { + return new Promise((resolve, reject) => { + resolve(PasteDataMock); + }) + } + }, + setPasteData: function (...args) { + console.warn("SystemPasteboard.setPasteData interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock); + } else { + return new Promise((resolve, reject) => { + resolve(); + }) + } + } + } + global.systemplugin.pasteboard = { + createPlainTextData: function () { + console.warn("pasteboard.createPlainTextData interface mocked in the Previewer. How this interface works on" + + " the Previewer may be different from that on a real device.") + return PasteDataMock; + }, + getSystemPasteboard: function () { + console.warn("pasteboard.getSystemPasteboard interface mocked in the Previewer. How this interface works on" + + " the Previewer may be different from that on a real device.") + return SystemPasteboardMock; + } + } +} diff --git a/runtime/main/extend/systemplugin/request.js b/runtime/main/extend/systemplugin/request.js new file mode 100644 index 00000000..640ff383 --- /dev/null +++ b/runtime/main/extend/systemplugin/request.js @@ -0,0 +1,35 @@ +import { hasComplete } from "./utils" + +export function mockRequest() { + const uploadResponseMock = { + code: "[PC Preview]: unknow code", + data: "[PC Preview]: unknow data", + headers: "[PC Preview]: unknow headers" + } + const downloadResponse = { + token: "[PC Preview]: unknow token" + } + const onDownloadCompleteMock = { + uri: "[PC Preview]: unknow uri" + } + global.systemplugin.request = { + upload: function (...args) { + console.warn("system.request.upload interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + args[0].success(uploadResponseMock) + hasComplete(args[0].complete) + }, + download: function (...args) { + console.warn("system.request.download interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + args[0].success(downloadResponse) + hasComplete(args[0].complete) + }, + onDownloadComplete: function (...args) { + console.warn("system.request.onDownloadComplete interface mocked in the Previewer. How this interface works on" + + " the Previewer may be different from that on a real device.") + args[0].success(onDownloadCompleteMock) + hasComplete(args[0].complete) + } + } +} \ No newline at end of file diff --git a/runtime/main/extend/systemplugin/sensor.js b/runtime/main/extend/systemplugin/sensor.js new file mode 100644 index 00000000..91e87024 --- /dev/null +++ b/runtime/main/extend/systemplugin/sensor.js @@ -0,0 +1,263 @@ +import {getRandomArbitrary, hasComplete, paramMock} from './utils' + +export function mockSensor() { + global.systemplugin.sensor = {} + mockAccelerometer() + mockBarometer() + mockCompass() + mockDeviceOrientation() + mockGyroscope() + mockHeartRate() + mockLight() + mockOnBodyState() + mockProximity() + mockStepCounter() +} + +function mockAccelerometer() { + global.systemplugin.sensor.subscribeAccelerometer = function(...args) { + console.warn("sensor.subscribeAccelerometer interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + const time = { + normal: 200, + game: 20, + ui: 60 + } + let ret = {} + let timer = 0 + if (!args[0].interval) { + timer = time.normal + } else { + timer = time[args[0].interval] + } + clearInterval(this.unsubscribeAcc) + delete this.unsubscribeAcc + this.unsubscribeAcc = setInterval(() => { + ret.x = Math.ceil(Math.random() * 10) + ret.y = Math.ceil(Math.random() * 10) + ret.z = Math.ceil(Math.random() * 10) + args[0].success(ret) + }, timer) + } + global.systemplugin.sensor.unsubscribeAccelerometer = function() { + console.warn("sensor.unsubscribeAccelerometer interface mocked in the Previewer. How this interface works on" + + " the Previewer may be different from that on a real device.") + clearInterval(this.unsubscribeAcc) + delete this.unsubscribeAcc + } +} + +function mockBarometer() { + global.systemplugin.sensor.subscribeBarometer = function(...args) { + console.warn("sensor.subscribeBarometer interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + if (!this.unsubscribePressure) { + let ret = {} + this.unsubscribePressure = setInterval(() => { + ret.pressure = getRandomArbitrary(1110, 1111) + args[0].success(ret) + }, 500) + } + } + global.systemplugin.sensor.unsubscribeBarometer = function() { + console.warn("sensor.unsubscribeBarometer interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + clearInterval(this.unsubscribePressure) + delete this.unsubscribePressure + } +} + +function mockCompass() { + global.systemplugin.sensor.subscribeCompass = function(...args) { + console.warn("sensor.subscribeCompass interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + if (!this.unsubscribeDirection) { + let ret = {} + this.unsubscribeDirection = setInterval(() => { + ret.direction = getRandomArbitrary(49, 50) + args[0].success(ret) + }, 100) + } + } + global.systemplugin.sensor.unsubscribeCompass = function() { + console.warn("sensor.unsubscribeCompass interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + clearInterval(this.unsubscribeDirection) + delete this.unsubscribeDirection + } +} + +function mockGyroscope() { + global.systemplugin.sensor.subscribeGyroscope = function(...args) { + console.warn("sensor.subscribeGyroscope interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + const time = { + normal: 200, + game: 20, + ui: 60 + } + let ret = {} + let timer = 0 + if (!args[0].interval) { + timer = time.normal + } else { + timer = time[args[0].interval] + } + clearInterval(this.unsubscribeGyr) + delete this.unsubscribeGyr + this.unsubscribeGyr = setInterval(() => { + ret.x = Math.ceil(Math.random() * 10) + ret.y = Math.ceil(Math.random() * 10) + ret.z = Math.ceil(Math.random() * 10) + args[0].success(ret) + }, timer) + } + global.systemplugin.sensor.unsubscribeGyroscope = function() { + console.warn("sensor.unsubscribeGyroscope interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + clearInterval(this.unsubscribeGyr) + delete this.unsubscribeGyr + } +} + +function mockDeviceOrientation() { + global.systemplugin.sensor.subscribeDeviceOrientation = function(...args) { + console.warn("sensor.subscribeDeviceOrientation interface mocked in the Previewer. How this interface works on" + + " the Previewer may be different from that on a real device.") + const time = { + normal: 200, + game: 20, + ui: 60 + } + let ret = {} + let timer = 0 + if (!args[0].interval) { + timer = time.normal + } else { + timer = time[args[0].interval] + } + clearInterval(this.unsubscribeDevOri) + delete this.unsubscribeDevOri + this.unsubscribeDevOri = setInterval(() => { + ret.alpha = Math.ceil(Math.random() * 10) + ret.beta = Math.ceil(Math.random() * 10) + ret.gamma = Math.ceil(Math.random() * 10) + args[0].success(ret) + }, timer) + } + global.systemplugin.sensor.unsubscribeDeviceOrientation = function() { + console.warn("sensor.unsubscribeDeviceOrientation interface mocked in the Previewer. How this interface works" + + " on the Previewer may be different from that on a real device.") + clearInterval(this.unsubscribeDevOri) + delete this.unsubscribeDevOri + } +} + +function mockHeartRate() { + global.systemplugin.sensor.subscribeHeartRate = function(...args) { + console.warn("sensor.subscribeHeartRate interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + if (!this.unsubscribeRate) { + let ret = {} + this.unsubscribeRate = setInterval(() => { + ret.heartRate = Math.ceil(Math.random() * 30) + args[0].success(ret) + }, 500) + } + }, + global.systemplugin.sensor.unsubscribeHeartRate = function() { + console.warn("sensor.unsubscribeHeartRate interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + clearInterval(this.unsubscribeRate) + delete this.unsubscribeRate + } +} + +function mockLight() { + global.systemplugin.sensor.subscribeLight = function(...args) { + console.warn("sensor.subscribeLight interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + if (!this.unsubscribeIntensity) { + let ret = {} + this.unsubscribeIntensity = setInterval(() => { + ret.intensity = getRandomArbitrary(660, 680) + args[0].success(ret) + }, 500) + } + } + global.systemplugin.sensor.unsubscribeLight = function() { + console.warn("sensor.unsubscribeLight interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + clearInterval(this.unsubscribeIntensity) + delete this.unsubscribeIntensity + } +} + +function mockOnBodyState() { + global.systemplugin.sensor.subscribeOnBodyState = function(...args) { + console.warn("sensor.subscribeOnBodyState interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + if (!this.unsubscribeBodyState) { + let ret = {} + this.unsubscribeBodyState = setInterval(() => { + ret.value = Math.ceil(Math.random() * 20) + args[0].success(ret) + }, 500) + } + } + global.systemplugin.sensor.unsubscribeOnBodyState = function() { + console.warn("sensor.unsubscribeOnBodyState interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + clearInterval(this.unsubscribeBodyState) + delete this.unsubscribeBodyState + } + global.systemplugin.sensor.getOnBodyState = function (...args) { + console.warn("sensor.getOnBodyState interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + let OnBodyStateResponseMock = { + value: paramMock.paramBooleanMock + } + args[0].success(OnBodyStateResponseMock) + hasComplete(args[0].complete) + } +} + +function mockProximity() { + global.systemplugin.sensor.subscribeProximity = function(...args) { + console.warn("sensor.subscribeProximity interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + if (!this.unsubscribeDistance) { + let ret = {} + this.unsubscribeDistance = setInterval(() => { + ret.distance = Math.ceil(Math.random() * 100) + args[0].success(ret) + }, 1000) + } + } + global.systemplugin.sensor.unsubscribeProximity = function() { + console.warn("sensor.unsubscribeProximity interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + clearInterval(this.unsubscribeDistance) + delete this.unsubscribeDistance + } +} + +function mockStepCounter() { + global.systemplugin.sensor.subscribeStepCounter = function(...args) { + console.warn("sensor.subscribeStepCounter interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + if (!this.unsubscribeSteps) { + let ret = {steps: 0} + this.unsubscribeSteps = setInterval(() => { + ret.steps += 1 + args[0].success(ret) + }, 1000) + } + } + global.systemplugin.sensor.unsubscribeStepCounter = function() { + console.warn("sensor.unsubscribeStepCounter interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + clearInterval(this.unsubscribeSteps) + delete this.unsubscribeSteps + } +} \ No newline at end of file diff --git a/runtime/main/extend/systemplugin/storage.js b/runtime/main/extend/systemplugin/storage.js new file mode 100644 index 00000000..b3d73201 --- /dev/null +++ b/runtime/main/extend/systemplugin/storage.js @@ -0,0 +1,30 @@ +import { hasComplete } from "./utils" + +export function mockStorage() { + global.systemplugin.storage = { + get: function(...args) { + console.warn("storage.get interface mocked in the Previewer. How this interface works on the Previewer may be" + + " different from that on a real device.") + args[0].success("[PC Preview]: no system") + hasComplete(args[0].complete) + }, + set: function(...args) { + console.warn("storage.set interface mocked in the Previewer. How this interface works on the Previewer may be" + + " different from that on a real device.") + args[0].success("[PC Preview]: no system") + hasComplete(args[0].complete) + }, + clear: function(...args) { + console.warn("storage.clear interface mocked in the Previewer. How this interface works on the Previewer may be" + + " different from that on a real device.") + args[0].success("[PC Preview]: no system") + hasComplete(args[0].complete) + }, + delete: function(...args) { + console.warn("storage.delete interface mocked in the Previewer. How this interface works on the Previewer may be" + + " different from that on a real device.") + args[0].success("[PC Preview]: no system") + hasComplete(args[0].complete) + } + } + } \ No newline at end of file diff --git a/runtime/main/extend/systemplugin/systemPackage.js b/runtime/main/extend/systemplugin/systemPackage.js new file mode 100644 index 00000000..77e92d07 --- /dev/null +++ b/runtime/main/extend/systemplugin/systemPackage.js @@ -0,0 +1,12 @@ +import { hasComplete } from "./utils" + +export function mockSystemPackage() { + global.systemplugin.package = { + hasInstalled: function (...args) { + console.warn("package.hasInstalled interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + args[0].success(true) + isComplete(args[0].complete) + } + } + } \ No newline at end of file diff --git a/runtime/main/extend/systemplugin/systemPlugins.js b/runtime/main/extend/systemplugin/systemPlugins.js deleted file mode 100644 index 18323c18..00000000 --- a/runtime/main/extend/systemplugin/systemPlugins.js +++ /dev/null @@ -1,502 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export function mockSystemPlugin () { - global.systemplugin = { - notification:{}, - vibrator: {}, - sensor: {}, - geolocation: {}, - network: {}, - brightness: { - argsV: { - value: 80 - }, - argsM: { - mode: 0 - } - }, - volume: { - args: {value: 0.5} - }, - battery: {}, - systemPackage: {}, - wifi: {}, - bluetooth: {}, - tts: {}, - alarm: {}, - request: {}, - fetch: {}, - storage: {}, - file: {} - } - mockNotification() - mockFetch() - mockRequest() - mockStorage() - mockFile() - mockVibrator() - mockSensor() - mockGeolocation() - mockNetwork() - mockBrightness() - mockVolume() - mockBattery() - mockSystemPackage() -} - -function mockNotification () { - global.systemplugin.notification = { - show: function () {} - } -} - -function mockVibrator () { - global.systemplugin.vibrator = { - vibrate: function () { - arguments[0].success() - isComplete(arguments[0].complete) - } - } -} - -function mockSensor () { - mockAccelerometer() - mockCompass() - mockProximity() - mockLight() - mockStepCounter() - mockBarometer() - mockHeartRate() - mockOnBodyState() -} - -function mockAccelerometer () { - Object.assign(global.systemplugin.sensor, { - subscribeAccelerometer: function () { - const time = { - normal: 200, - game: 20, - ui: 60 - } - let ret = {} - let timer = 0 - if(!arguments[0].interval) { - timer = time.normal - } else { - timer = time[arguments[0].interval] - } - this.unsubscribeAccelerometer() - this.unsubscribeAcc = setInterval(() => { - ret.x = Math.ceil(Math.random() * 10) - ret.y = Math.ceil(Math.random() * 10) - ret.z = Math.ceil(Math.random() * 10) - arguments[0].success(ret) - }, timer) - }, - unsubscribeAccelerometer: function () { - clearInterval(this.unsubscribeAcc) - delete this.unsubscribeAcc - } - }) -} - -function mockCompass () { - Object.assign(global.systemplugin.sensor, { - subscribeCompass: function () { - if(!this.unsubscribeDirection) { - let ret = {} - this.unsubscribeDirection = setInterval(() => { - ret.direction = getRandomArbitrary(49, 50) - arguments[0].success(ret) - }, 100) - } - }, - unsubscribeCompass: function () { - clearInterval(this.unsubscribeDirection) - delete this.unsubscribeDirection - } - }) -} - -function mockProximity() { - Object.assign(global.systemplugin.sensor, { - subscribeProximity: function () { - if(!this.unsubscribeDistance) { - let ret = {} - this.unsubscribeDistance = setInterval(() => { - ret.distance = Math.ceil(Math.random() * 100) - arguments[0].success(ret) - }, 1000) - } - }, - unsubscribeProximity: function () { - clearInterval(this.unsubscribeDistance) - delete this.unsubscribeDistance - } - }) -} - -function mockLight () { - Object.assign(global.systemplugin.sensor, { - subscribeLight: function () { - if(!this.unsubscribeIntensity) { - let ret = {} - this.unsubscribeIntensity = setInterval(() => { - ret.intensity = getRandomArbitrary(660, 680) - arguments[0].success(ret) - }, 500) - } - }, - unsubscribeLight: function () { - clearInterval(this.unsubscribeIntensity) - delete this.unsubscribeIntensity - }, - }) -} - -function mockStepCounter() { - Object.assign(global.systemplugin.sensor, { - subscribeStepCounter: function () { - if(!this.unsubscribeSteps) { - let ret = { steps: 0 } - this.unsubscribeSteps = setInterval(() => { - ret.steps += 1 - arguments[0].success(ret) - }, 1000) - } - }, - unsubscribeStepCounter: function () { - clearInterval(this.unsubscribeSteps) - delete this.unsubscribeSteps - } - }) -} - -function mockBarometer() { - Object.assign(global.systemplugin.sensor, { - subscribeBarometer: function () { - if(!this.unsubscribePressure) { - let ret = {} - this.unsubscribePressure = setInterval(() => { - ret.pressure = getRandomArbitrary(1110, 1111) - arguments[0].success(ret) - }, 500) - } - }, - unsubscribeBarometer: function () { - clearInterval(this.unsubscribePressure) - delete this.unsubscribePressure - } - }) -} - -function mockHeartRate() { - Object.assign(global.systemplugin.sensor, { - subscribeHeartRate: function () { - if(!this.unsubscribeRate) { - let ret = {} - this.unsubscribeRate = setInterval(() => { - ret.heartRate = Math.ceil(Math.random() * 30) - arguments[0].success(ret) - }, 500) - } - }, - unsubscribeHeartRate: function () { - clearInterval(this.unsubscribeRate) - delete this.unsubscribeRate - }, - }) -} - -function mockOnBodyState () { - Object.assign(global.systemplugin.sensor, { - subscribeOnBodyState: function () { - if(!this.unsubscribeBodyState) { - let ret = {} - this.unsubscribeBodyState = setInterval(() => { - ret.value = Math.ceil(Math.random() * 20) - arguments[0].success(ret) - }, 500) - } - }, - unsubscribeOnBodyState: function () { - clearInterval(this.unsubscribeBodyState) - delete this.unsubscribeBodyState - } - }) -} - -function mockGeolocation () { - const data = { - latitude: '121.61934', - longitude: '31.257907', - accuracy: '15', - time: '160332896544' - } - global.systemplugin.geolocation = { - getLocation: function () { - arguments[0].success(data) - isComplete(arguments[0].complete) - }, - getLocationType: function () { - let args = {types: ['gps', 'network']} - arguments[0].success(args) - isComplete(arguments[0].complete) - }, - getSupportedCoordTypes() { - return ["wgs84"] - }, - subscribe: function () { - if(!this.unsubscribeLocation) { - this.unsubscribeLocation = setInterval(() => { - data.latitude = getRandomArbitrary(121, 122) - data.longitude = getRandomArbitrary(31, 32) - data.accuracy = getRandomArbitrary(14, 18) - arguments[0].success(data) - }, 1000) - } - }, - unsubscribe: function () { - clearInterval(this.unsubscribeLocation) - delete this.unsubscribeLocation - } - } -} - -function mockNetwork () { - const data = { - metered: true, - type: "5g" - } - global.systemplugin.network = { - getType: function () { - arguments[0].success(data) - arguments[0].complete() - }, - subscribe: function () { - if(!this.unsubscribeNetwork) { - this.unsubscribeNetwork = setInterval(() => { - arguments[0].success(data) - }, 3000) - } - }, - unsubscribe: function () { - clearInterval(this.unsubscribeNetwork) - delete this.unsubscribeNetwork - } - } -} - -function mockBrightness () { - Object.assign(global.systemplugin.brightness, { - getValue: function () { - arguments[0].success(this.argsV) - isComplete(arguments[0].complete) - }, - setValue: function () { - if(arguments[0].value) { - this.argsV.value = arguments[0].value - arguments[0].success("brightness setValue successfully") - isComplete(arguments[0].complete) - } - }, - getMode: function () { - arguments[0].success(this.argsM) - isComplete(arguments[0].complete) - }, - setMode: function () { - this.argsM.mode = arguments[0].mode - arguments[0].success("brightness setMode successfully") - isComplete(arguments[0].complete) - }, - setKeepScreenOn: function () { - arguments[0].success("brightness setKeepScreenOn successfully") - isComplete(arguments[0].complete) - } - }) -} - -function mockVolume () { - Object.assign(global.systemplugin.volume, { - getMediaValue: function () { - arguments[0].success(this.args) - isComplete(arguments[0].complete) - }, - setMediaValue: function () { - if(arguments[0].value) { - this.args.value = arguments[0].value - arguments[0].success("set volume successfully") - isComplete(arguments[0].complete) - } - } - }) -} - -function mockBattery () { - global.systemplugin.battery = { - getStatus: function () { - arguments[0].success.call(this, { level: 1, charging: false} ) - isComplete(arguments[0].complete) - } - } -} - -function mockSystemPackage () { - global.systemplugin.package = { - hasInstalled: function () { - arguments[0].success(true) - isComplete(arguments[0].complete) - } - } -} - -function mockRequest () { - const data = { - code: "[pc Preview]: no internet", - data: "[pc Preview]: no internet", - headers: "[pc Preview]: no internet", - token: "[pc Preview]: no internet", - uri: "[pc Preview]: no internet", - } - global.systemplugin.request = { - upload: function () { - arguments[0].success(data) - isComplete(arguments[0].complete) - }, - download: function () { - arguments[0].success(data) - isComplete(arguments[0].complete) - }, - onDownloadComplete: function () { - arguments[0].success(data) - isComplete(arguments[0].complete) - } - } -} - -function mockFetch () { - const data = { - code: "[pc Preview]: no internet", - data: "[pc Preview]: no internet" - } - global.systemplugin.fetch = { - fetch: function () { - arguments[0].success(data) - isComplete(arguments[0].complete) - } - } -} - -function mockStorage () { - global.systemplugin.storage = { - get: function () { - arguments[0].success("[pc Preview]: no system") - isComplete(arguments[0].complete) - }, - set: function () { - arguments[0].success("[pc Preview]: no system") - isComplete(arguments[0].complete) - }, - clear: function () { - arguments[0].success("[pc Preview]: no system") - isComplete(arguments[0].complete) - }, - delete: function () { - arguments[0].success("[pc Preview]: no system") - isComplete(arguments[0].complete) - } - } -} - -function mockFile () { - global.systemplugin.file = { - move: function () { - arguments[0].success(arguments[0].dstUri) - isComplete(arguments[0].complete) - }, - copy: function () { - arguments[0].success(arguments[0].dstUri) - isComplete(arguments[0].complete) - }, - list: function () { - const data = { - fileList: [{ - uri:'[pc Preview]: no file', - lastModifiedTime:"[pc Preview]: no file", - length:"[pc Preview]: no file", - type: 'file'}] - } - arguments[0].success(data) - isComplete(arguments[0].complete) - }, - get: function () { - const data = { - uri:'[pc Preview]: no file', - lastModifiedTime:"[pc Preview]: no file", - length:"[pc Preview]: no file", - type: 'file', - subFiles: ["[pc Preview]: no file", "[pc Preview]: no file"] - } - arguments[0].success(data) - isComplete(arguments[0].complete) - }, - delete: function () { - arguments[0].success() - isComplete(arguments[0].complete) - }, - writeText: function () { - arguments[0].success() - isComplete(arguments[0].complete) - }, - writeArrayBuffer: function () { - arguments[0].success() - isComplete(arguments[0].complete) - }, - readText: function () { - const data = {text: "[pc Preview]: success default"} - arguments[0].success(data) - isComplete(arguments[0].complete) - }, - readArrayBuffer: function () { - const data = {buffer: ["[pc Preview]: default", "[pc Preview]: default", "[pc Preview]: default"]} - arguments[0].success(data) - isComplete(arguments[0].complete) - }, - access: function () { - arguments[0].success() - isComplete(arguments[0].complete) - }, - mkdir: function () { - arguments[0].success() - isComplete(arguments[0].complete) - }, - rmdir: function () { - arguments[0].success() - isComplete(arguments[0].complete) - } - } -} - -function isComplete() { - if(arguments[0] === undefined) { - return - } - arguments[0].call(this) -} - -function getRandomArbitrary(min, max) { - return Math.random().toFixed(6) * (max - min) + min; -} diff --git a/runtime/main/extend/systemplugin/telephony.js b/runtime/main/extend/systemplugin/telephony.js new file mode 100644 index 00000000..f5726781 --- /dev/null +++ b/runtime/main/extend/systemplugin/telephony.js @@ -0,0 +1,19 @@ +import { paramMock } from "./utils" + +export function mockCall() { + global.systemplugin.telephony = {} + global.systemplugin.telephony.call = { + dial: function (...args) { + console.warn("telephony.call.dial interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock, paramMock.paramBooleanMock); + } else { + return new Promise((resolve, reject) => { + resolve(paramMock.paramBooleanMock); + }) + } + } + } +} \ No newline at end of file diff --git a/runtime/main/extend/systemplugin/userIAM.js b/runtime/main/extend/systemplugin/userIAM.js new file mode 100644 index 00000000..73151956 --- /dev/null +++ b/runtime/main/extend/systemplugin/userIAM.js @@ -0,0 +1,26 @@ +import { paramMock } from "./utils" + +export function mockUserauth() { + global.systemplugin.userIAM = {} + const AuthenticatorMock = { + execuate: function (...args) { + console.warn("Authenticator.execuate interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock, paramMock.paramBooleanMock); + } else { + return new Promise((resolve, reject) => { + resolve(paramMock.paramNumberMock); + }) + } + } + } + global.systemplugin.userIAM.userAuth = { + getAuthenticator: function (...args) { + console.warn("userIAM.userAuth.getAuthenticator interface mocked in the Previewer. How this interface works on" + + " the Previewer may be different from that on a real device.") + return AuthenticatorMock; + } + } +} \ No newline at end of file diff --git a/runtime/main/extend/systemplugin/utils.js b/runtime/main/extend/systemplugin/utils.js new file mode 100644 index 00000000..8b84fe74 --- /dev/null +++ b/runtime/main/extend/systemplugin/utils.js @@ -0,0 +1,24 @@ +export function hasComplete(...args) { + if (args[0] === undefined) { + return + } + args[0].call(this) +} + +export function getRandomArbitrary(min, max) { + return Math.random().toFixed(6) * (max - min) + min; +} + +export const paramMock = { + businessErrorMock: { + code: '[PC Preview]: unknow code', + name: '[PC Preview]: unknow name', + message: '[PC Preview]: unknow message', + stack: '[PC Preview]: unknow stack' + }, + paramNumberMock: "[PC Preview] unknow number", + paramStringMock: "[PC Preview] unknow string", + paramBooleanMock: "[PC Preview] unknow boolean", + paramObjectMock: "[PC Preview] unknow object", + paramArrayMock: "[PC Preview] unknow Array" +} \ No newline at end of file diff --git a/runtime/main/extend/systemplugin/vibrator.js b/runtime/main/extend/systemplugin/vibrator.js new file mode 100644 index 00000000..41e6e89e --- /dev/null +++ b/runtime/main/extend/systemplugin/vibrator.js @@ -0,0 +1,12 @@ +import { hasComplete } from "./utils" + +export function mockVibrator() { + global.systemplugin.vibrator = { + vibrate: function (...args) { + console.warn("vibrator.vibrate interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + args[0].success() + hasComplete(args[0].complete) + } + } +} \ No newline at end of file diff --git a/runtime/main/extend/systemplugin/wifi.js b/runtime/main/extend/systemplugin/wifi.js new file mode 100644 index 00000000..14ebcea7 --- /dev/null +++ b/runtime/main/extend/systemplugin/wifi.js @@ -0,0 +1,35 @@ +import { paramMock } from "./utils" + +export function mockWifi() { + const linkedInfoMock = { + ssid: '[PC preview] unknow ssid', + bssid: '[PC preview] unknow bssid', + networkId: '[PC preview] unknow networkId', + rssi: '[PC preview] unknow rssi', + band: '[PC preview] unknow band', + linkSpeed: '[PC preview] unknow linkSpeed', + frequency: '[PC preview] unknow frequency', + isHidden: '[PC preview] unknow isHidden', + isRestricted: '[PC preview] unknow isRestricted', + chload: '[PC preview] unknow chload', + snr: '[PC preview] unknow snr', + macAddress: '[PC preview] unknow macAddress', + ipAddress: '[PC preview] unknow ipAddress', + suppState: '[PC preview] unknow suppState', + connState: '[PC preview] unknow connState' + } + global.systemplugin.wifi = { + getLinkedInfo: function (...args) { + console.warn("wifi.getLinkedInfo interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock, linkedInfoMock) + } else { + return new Promise((resolve) => { + resolve(linkedInfoMock) + }) + } + } + } +} \ No newline at end of file diff --git a/runtime/main/extend/systemplugin/window.js b/runtime/main/extend/systemplugin/window.js new file mode 100644 index 00000000..7e460ef2 --- /dev/null +++ b/runtime/main/extend/systemplugin/window.js @@ -0,0 +1,327 @@ +import { paramMock } from "./utils" + +export function mockWindow() { + const windowPropertiesMock = { + brightness: '[PC preview] unknow brightness', + isFullScreen: '[PC preview] unknow isFullScreen', + isKeepScreenOn: '[PC preview] unknow isKeepScreenOn', + isPrivacyMode: '[PC preview] unknow isPrivacyMode', + touchable: '[PC preview] unknow touchable', + focusable: '[PC preview] unknow focusable', + isLayoutFullScreen: '[PC preview] unknow isLayoutFullScreen', + isDimBehind: '[PC preview] unknow isDimBehind', + isTransparent: '[PC preview] unknow isTransparent', + isRoundCorner: '[PC preview] unknow isRoundCorner' + } + const AvoidAreaMock = { + left: '[PC preview] unknow Rect.left Rect.top Rect.right Rect.bottom', + top: '[PC preview] unknow Rect.left Rect.top Rect.right Rect.bottom', + right: '[PC preview] unknow Rect.left Rect.top Rect.right Rect.bottom', + bottom: '[PC preview] unknow Rect.left Rect.top Rect.right Rect.bottom' + + } + const windowMock = { + setBrightness: function (...args) { + console.warn("Window.setBrightness interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock) + } else { + return new Promise((resolve) => { + resolve() + }) + } + }, + setBackgroundColor: function (...args) { + console.warn("Window.setBackgroundColor interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock) + } else { + return new Promise((resolve) => { + resolve() + }) + } + }, + setFullScreen: function (...args) { + console.warn("Window.setFullScreen interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock) + } else { + return new Promise((resolve) => { + resolve() + }) + } + }, + setKeepScreenOn: function (...args) { + console.warn("Window.setKeepScreenOn interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock) + } else { + return new Promise((resolve) => { + resolve() + }) + } + }, + setSystemBarProperties: function (...args) { + console.warn("Window.setSystemBarProperties interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock) + } else { + return new Promise((resolve) => { + resolve() + }) + } + }, + getProperties: function (...args) { + console.warn("Window.getProperties interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock, windowPropertiesMock) + } else { + return new Promise((resolve) => { + resolve(windowPropertiesMock) + }) + } + }, + on: function (...args) { + console.warn("Window.on interface mocked in the Previewer. How this interface works on the Previewer may be" + + " different from that on a real device.") + const len = args.length + args[len - 1].call(this, paramMock.businessErrorMock, paramMock.paramNumberMock) + }, + off: function (...args) { + console.warn("Window.off interface mocked in the Previewer. How this interface works on the Previewer may be" + + " different from that on a real device.") + const len = args.length + args[len - 1].call(this, paramMock.businessErrorMock, paramMock.paramNumberMock) + }, + setSystemBarEnable: function (...args) { + console.warn("Window.setSystemBarEnable interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock) + } else { + return new Promise((resolve) => { + resolve() + }) + } + }, + setTransparent: function (...args) { + console.warn("Window.setTransparent interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock) + } else { + return new Promise((resolve) => { + resolve() + }) + } + }, + setWindowType: function (...args) { + console.warn("Window.setWindowType interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock) + } else { + return new Promise((resolve) => { + resolve() + }) + } + }, + setPrivacyMode: function (...args) { + console.warn("Window.setPrivacyMode interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock) + } else { + return new Promise((resolve) => { + resolve() + }) + } + }, + setTouchable: function (...args) { + console.warn("Window.setTouchable interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock) + } else { + return new Promise((resolve) => { + resolve() + }) + } + }, + setFocusable: function (...args) { + console.warn("Window.setFocusable interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock) + } else { + return new Promise((resolve) => { + resolve() + }) + } + }, + setLayoutFullScreen: function (...args) { + console.warn("Window.setLayoutFullScreen interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock) + } else { + return new Promise((resolve) => { + resolve() + }) + } + }, + getAvoidArea: function (...args) { + console.warn("Window.getAvoidArea interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock, AvoidAreaMock) + } else { + return new Promise((resolve) => { + resolve(AvoidAreaMock) + }) + } + }, + setDimBehind: function (...args) { + console.warn("Window.setDimBehind interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock) + } else { + return new Promise((resolve) => { + resolve() + }) + } + }, + loadContent: function (...args) { + console.warn("Window.loadContent interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock) + } else { + return new Promise((resolve) => { + resolve() + }) + } + }, + hide: function (...args) { + console.warn("Window.hide interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock) + } else { + return new Promise((resolve) => { + resolve() + }) + } + }, + show: function (...args) { + console.warn("Window.show interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock) + } else { + return new Promise((resolve) => { + resolve() + }) + } + }, + isShowing: function (...args) { + console.warn("Window.isShowing interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock, paramMock.paramBooleanMock) + } else { + return new Promise((resolve) => { + resolve(paramMock.paramBooleanMock) + }) + } + }, + destroy: function (...args) { + console.warn("Window.destroy interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock) + } else { + return new Promise((resolve) => { + resolve() + }) + } + }, + setOutsideTouchable: function (...args) { + console.warn("Window.setOutsideTouchable interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock) + } else { + return new Promise((resolve) => { + resolve() + }) + } + }, + } + global.systemplugin.window = { + getTopWindow: function (...args) { + console.warn("window.getTopWindow interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock, windowMock) + } else { + return new Promise((resolve, reject) => { + resolve(windowMock) + }) + } + }, + create: function (...args) { + console.warn("Window.create interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock, windowMock) + } else { + return new Promise((resolve, reject) => { + resolve(windowMock) + }) + } + }, + find: function (...args) { + console.warn("Window.find interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock, windowMock) + } else { + return new Promise((resolve, reject) => { + resolve(windowMock) + }) + } + }, + } +} \ No newline at end of file diff --git a/runtime/main/index.ts b/runtime/main/index.ts index 47e581f7..4a999801 100644 --- a/runtime/main/index.ts +++ b/runtime/main/index.ts @@ -22,12 +22,16 @@ export { createInstance, destroyInstance } from './manage/instance/life'; import { registerModules } from './manage/instance/register'; export { receiveTasks } from './manage/event/bridge'; export { getRoot } from './manage/instance/misc'; -import { appDestroy } from './app/index'; -import { appError } from './app/index'; +import { + appDestroy, + appError, + appShow, + appHide +} from './app/index'; /** * Prevent modification of Vm and Vm.prototype. */ Object.freeze(Vm); -export { registerModules, appDestroy, appError }; +export { registerModules, appDestroy, appError, appShow, appHide }; diff --git a/runtime/main/manage/event/CallbackManager.ts b/runtime/main/manage/event/CallbackManager.ts index a5d92e96..18191ba3 100644 --- a/runtime/main/manage/event/CallbackManager.ts +++ b/runtime/main/manage/event/CallbackManager.ts @@ -17,8 +17,6 @@ * under the License. */ -import { Log } from '../../../utils/index'; - export interface callbackObjInterface { [key: string]: Function; } @@ -73,12 +71,7 @@ export default class CallbackManager { delete this.callbackMap[callbackId]; } if (typeof callback === 'function') { - try { - return callback.call(null, data); - } catch (error) { - Log.error(`Failed to execute the callback function:\n ${error.toString()}`); - throw error; - } + return callback.call(null, data); } return new Error(`Invalid callback id '${callbackId}'.`); } diff --git a/runtime/main/manage/event/TaskCenter.ts b/runtime/main/manage/event/TaskCenter.ts index b4be9080..1b5b4cc5 100644 --- a/runtime/main/manage/event/TaskCenter.ts +++ b/runtime/main/manage/event/TaskCenter.ts @@ -210,6 +210,8 @@ export class TaskCenter { return ace.callNative(JSON.stringify(options), args); case 'timer': return ace.callNative(JSON.stringify(options), args); + case 'system.offscreenCanvas': + return ace.callNative(JSON.stringify(options), JSON.stringify(args[0])); case 'system.image': return ace.callNative(JSON.stringify(options), JSON.stringify(args[0])); case 'system.mediaquery': @@ -218,6 +220,8 @@ export class TaskCenter { return ace.callNative(JSON.stringify(options), args[0]); case 'system.resource': return ace.callNative(JSON.stringify(options), args); + case 'ohos.animator': + return ace.callNative(JSON.stringify(options), JSON.stringify(args[0])); default: break; } diff --git a/runtime/main/manage/instance/life.ts b/runtime/main/manage/instance/life.ts index a978397c..089db9ce 100644 --- a/runtime/main/manage/instance/life.ts +++ b/runtime/main/manage/instance/life.ts @@ -43,7 +43,7 @@ export function createInstance(id: string, code: string, options: Options, data: let page: Page = pageMap.get(id); let result: object; if (!page) { - page = new Page(id, options, options.packageName); + page = new Page(id, options, options.packageName, data); page.i18nService = I18n; page.dpiService = dpi; appCreate(page, options, data, services); diff --git a/runtime/main/model/compiler.ts b/runtime/main/model/compiler.ts index a406ad5b..8f6e1781 100644 --- a/runtime/main/model/compiler.ts +++ b/runtime/main/model/compiler.ts @@ -78,7 +78,8 @@ export interface AttrInterface { tid: number; append: string; slot: string; - name: string + name: string; + data: () => any | string; } export interface TemplateInterface { @@ -221,8 +222,7 @@ function targetIsComposed(vm: Vm, type: string): VmOptions { if (!component.initObjectData) { component.initObjectData = component.data; } - const str = JSON.stringify(component.initObjectData); - component.data = JSON.parse(str); + component.data = Object.assign({}, component.initObjectData); } } return component; @@ -272,7 +272,7 @@ function compileRepeat(vm: Vm, target: TemplateInterface, dest: Element): void { if (isRepeat(repeat)) { getter = repeat.exp; - key = repeat.key; + key = repeat.key || '$idx'; value = repeat.value; trackBy = repeat.tid; } else { @@ -406,7 +406,10 @@ function compileCustomComponent( * @param {Element} element - To be reset. */ function resetElementStyle(vm: Vm, element: Element): void { + // Add judgment statements to avoid repeatedly calling 'setClass' function. const len = element.children.length; + const css = vm.css || {}; + const mqArr = css['@MEDIA']; for (let ii = 0; ii < len; ii++) { const el = element.children[ii] as Element; resetElementStyle(vm, el); @@ -417,8 +420,15 @@ function resetElementStyle(vm: Vm, element: Element): void { if (element.id) { setIdStyle(vm, element, element.id); } - if (element.classList) { - setClass(vm, element, element.classList); + if (element.classList && mqArr) { + for (let i = 0; i < element.classList.length; i++) { + for (let m = 0; m < mqArr.length; m++) { + const clsKey = '.' + element.classList[i]; + if (hasOwn(mqArr[m], clsKey)) { + setClass(vm, element, element.classList); + } + } + } } } @@ -444,6 +454,7 @@ function compileNativeComponent(vm: Vm, template: TemplateInterface, dest: FragB vm.mediaStatus['device-width'] = e.deviceWidth; vm.mediaStatus['device-height'] = e.deviceHeight; vm.mediaStatus['round-screen'] = e.roundScreen; + vm.mediaStatus['dark-mode'] = e.darkMode; const css = vm.vmOptions && vm.vmOptions.style || {}; const mqArr = css['@MEDIA']; if (!mqArr) { @@ -501,8 +512,8 @@ function compileNativeComponent(vm: Vm, template: TemplateInterface, dest: FragB // Dest is parent element. bindElement(vm, element, template, dest); - if (element.event && element.event['appear']) { - element.fireEvent('appear', {}); + if (element.event && element.event['attached']) { + element.fireEvent('attached', {}); } if (template.attr && template.attr.append) { diff --git a/runtime/main/model/directive.ts b/runtime/main/model/directive.ts index b39e19fd..e6e8761d 100644 --- a/runtime/main/model/directive.ts +++ b/runtime/main/model/directive.ts @@ -52,6 +52,7 @@ import Element from '../../vdom/Element'; const SETTERS = { attr: 'setAttr', style: 'setStyle', + data: 'setData', event: 'addEvent', idStyle: 'setIdStyle', tagStyle: 'setTagStyle' @@ -65,14 +66,6 @@ const SETTERS = { * @param {Element | FragBlockInterface} parentElement - Parent element of current element. */ export function bindElement(vm: Vm, el: Element, template: TemplateInterface, parentElement: Element | FragBlockInterface): void { - setId(vm, el, template.id, vm); - setAttr(vm, el, template.attr); - setStyle(vm, el, template.style); - setIdStyle(vm, el, template.id); - setClass(vm, el, template.classList); - setTagStyle(vm, el, template.type); - applyStyle(vm, el); - // Set descendant style. setDescendantStyle( vm.selector, @@ -93,11 +86,36 @@ export function bindElement(vm: Vm, el: Element, template: TemplateInterface, pa setStyle(vm, el, style); } ); + + // inherit 'show' attribute of custom component + if (el.isCustomComponent) { + const value = vm['show']; + if (template.attr && value !== undefined) { + if (typeof value === 'function') { + // vm['show'] is assigned to this.show in initPropsToData() + template.attr['show'] = function() { + return this.show; + }; + } else { + template.attr['show'] = value; + } + } + } + + setId(vm, el, template.id, vm); + setAttr(vm, el, template.attr); + setStyle(vm, el, template.style); + setIdStyle(vm, el, template.id); + setClass(vm, el, template.classList); + setTagStyle(vm, el, template.type); + applyStyle(vm, el); + bindEvents(vm, el, template.events); bindEvents(vm, el, template.onBubbleEvents, ''); bindEvents(vm, el, template.onCaptureEvents, 'capture'); bindEvents(vm, el, template.catchBubbleEvents, 'catchbubble'); bindEvents(vm, el, template.catchCaptureEvents, 'catchcapture'); + if (!vm.isHide && !vm.init) { el.addEvent('hide'); vm.isHide = true; @@ -196,7 +214,12 @@ function mergePropsObject(key: string, value: any, vm: Vm, subVm: Vm): any { const returnValue = watch(vm, value, function(v) { subVm[key] = v; }); - subVm[key] = returnValue; + // 'show' attribute will be inherited by elements in custom component + if (key === 'show') { + subVm[key] = value; + } else { + subVm[key] = returnValue; + } } else { const realValue = value && value.__hasDefault ? value.__isDefaultValue : value; @@ -217,14 +240,19 @@ function mergeProps(target: object, props: any, vm: Vm, subVm: Vm): void { return; } for (const key in target) { - if (!props || props[key]) { + if (!props || props[key] || key === 'show') { subVm.props.push(key); const value = target[key]; if (typeof value === 'function') { const returnValue = watch(vm, value, function(v) { subVm[key] = v; }); - subVm[key] = returnValue; + // 'show' attribute will be inherited by elements in custom component + if (key === 'show') { + subVm[key] = value; + } else { + subVm[key] = returnValue; + } } else { subVm[key] = value; } @@ -351,6 +379,10 @@ function setElementId(el: Element, id: string): void { * @param {AttrInterface} attr - Attr to bind. */ function setAttr(vm: Vm, el: Element, attr: Partial): void { + if (attr && attr.data) { + // address data independently + bindDir(vm, el, 'data', attr.data); + } bindDir(vm, el, 'attr', attr); } @@ -538,6 +570,7 @@ function setClassStyle(el: Element, css: object, classList: string[], vm?: Vm): const animationName = classStyle['animationName']; if (animationName) { classStyle['animationName'] = keyframes[animationName]; + classStyle['animationName'].push({'animationName': animationName}); } const transitionEnter = classStyle['transitionEnter']; if (transitionEnter) { @@ -648,6 +681,7 @@ function setAnimation(style: any, css: any): void { const keyframes = css['@KEYFRAMES']; if (animationName && keyframes) { style['animationName'] = keyframes[animationName]; + style['animationName'].push({'animationName': animationName}); } } diff --git a/runtime/main/model/domHelper.ts b/runtime/main/model/domHelper.ts index 963fab6e..94e206af 100644 --- a/runtime/main/model/domHelper.ts +++ b/runtime/main/model/domHelper.ts @@ -234,9 +234,6 @@ export function removeTarget(target: Element | FragBlockInterface, preserveBlock */ function removeElement(target: Element | Comment): void { const parent = target.parentNode as Element; - if (target instanceof Element && target.event && target.event['disappear']) { - target.fireEvent('disappear', {}); - } if (parent) { parent.removeChild(target); } diff --git a/runtime/main/model/index.ts b/runtime/main/model/index.ts old mode 100755 new mode 100644 index cde726de..683c3d84 --- a/runtime/main/model/index.ts +++ b/runtime/main/model/index.ts @@ -64,6 +64,9 @@ import { MediaStatusInterface, ExternalBindingInterface } from './vmOptions'; +import { + hasOwn +} from '../util/shared'; /** * VM constructor. @@ -142,8 +145,8 @@ export default class Vm { `'_innerInit' lifecycle in Vm(${this._type}) and mergedData = ${JSON.stringify(mergedData)}.` ); this.$emit('hook:_innerInit'); - this._data = typeof data === 'function' ? data.apply(this) : data; - this._shareData = typeof shareData === 'function' ? shareData.apply(this) : shareData; + this._data = (typeof data === 'function' ? data.apply(this) : data) || {}; + this._shareData = (typeof shareData === 'function' ? shareData.apply(this) : shareData) || {}; this._descriptor = options._descriptor; if (global.aceapp && global.aceapp.i18n && global.aceapp.i18n.extend) { global.aceapp.i18n.extend(this); @@ -154,14 +157,30 @@ export default class Vm { // MergedData means extras params. if (mergedData) { - dataAccessControl(this, mergedData, this._app.options && this._app.options.appCreate); - extend(this._data, mergedData); + if (hasOwn(mergedData, 'paramsData') && hasOwn(mergedData, 'dontOverwrite') && mergedData['dontOverwrite'] === false) { + dataAccessControl(this, mergedData['paramsData'], this._app.options && this._app.options.appCreate); + extend(this._data, mergedData['paramsData']); + } else { + dataAccessControl(this, mergedData, this._app.options && this._app.options.appCreate); + extend(this._data, mergedData); + } } + initPropsToData(this); initState(this); initBases(this); Log.debug(`"onInit" lifecycle in Vm(${this._type})`); - this.$emit('hook:onInit'); + + if (mergedData && hasOwn(mergedData, 'paramsData') && hasOwn(mergedData, 'dontOverwrite')) { + if (mergedData['dontOverwrite'] === false) { + this.$emit('hook:onInit'); + } else { + this.$emitDirect('hook:onInit', mergedData['paramsData']); + } + } else { + this.$emit('hook:onInit'); + } + if (!this._app.doc) { return; } @@ -175,6 +194,7 @@ export default class Vm { this.mediaStatus['device-width'] = this._app.options.deviceWidth; this.mediaStatus['device-height'] = this._app.options.deviceHeight; this.mediaStatus['round-screen'] = this._app.options.roundScreen; + this.mediaStatus['dark-mode'] = this._app.options.darkMode; // If there is no parentElement, specify the documentElement. this._parentEl = parentEl || this._app.doc.documentElement; @@ -404,15 +424,15 @@ export default class Vm { /** * Watch a calc function and callback if the calc value changes. * @param {string} data - Data that needed. - * @param {Function} callback - Callback function. + * @param {Function | string} callback - Callback function. */ - public $watch(data: string, callback: (...args: any) => any): void { + public $watch(data: string, callback: ((...args: any) => any) | string): void { if (typeof data !== 'string') { Log.warn(`Invalid parameter type: The type of 'data' should be string, not ${typeof data}.`); return; } - if (typeof callback !== 'function') { - Log.warn(`Invalid parameter type: The type of 'callback' should be function, not ${typeof callback}.`); + if (typeof callback !== 'function' && typeof callback !== 'string') { + Log.warn(`Invalid parameter type: The type of 'callback' should be function or string, not ${typeof callback}.`); return; } watch(this, data, callback); @@ -446,12 +466,12 @@ export default class Vm { /** * Delete Vm object. - * @param {Vm} vm - Vm object. */ - public destroyVm(vm: Vm): void { - Log.debug(`[JS Framework] "onDestroy" lifecycle in Vm(${vm.type})`); + public destroy(): void { + Log.debug(`[JS Framework] "onDestroy" lifecycle in Vm(${this.type})`); this.$emit('hook:onDestroy'); - vm.$emit('hook:onDetached'); + this.$emit('hook:onDetached'); + fireNodeDetached(this._rootEl); this._valid = false; delete this._app; @@ -469,7 +489,7 @@ export default class Vm { if (this._childrenVms) { let vmCount: number = this._childrenVms.length; while (vmCount--) { - this.destroyVm.call(this._childrenVms[vmCount], this._childrenVms[vmCount]); + this.destroy.call(this._childrenVms[vmCount], this._childrenVms[vmCount]); } delete this._childrenVms; } @@ -833,7 +853,7 @@ function _proxySet(data: object, key: string, value: any): void { * @param {boolean} external - If has external data. */ function dataAccessControl(vm: any, mergedData: object, external: boolean): void { - if (vm._descriptor) { + if (vm._descriptor && Object.keys(vm._descriptor).length !== 0) { const keys = Object.keys(mergedData); keys.forEach(key => { const desc = vm._descriptor[key]; @@ -860,3 +880,18 @@ function getRoot(vm: any): Vm { } return getRoot(parent); } + +/** + * order node and fire detached event. + * @param {Element} el - Element object. + */ +function fireNodeDetached(el: Element) { + if (el.event && el.event['detached']) { + el.fireEvent('detached', {}); + } + if (el.children && el.children.length !== 0) { + for (const child of el.children) { + fireNodeDetached(child as Element); + } + } +} diff --git a/runtime/main/model/pageLife.ts b/runtime/main/model/pageLife.ts index 73660cf9..f5db2b34 100644 --- a/runtime/main/model/pageLife.ts +++ b/runtime/main/model/pageLife.ts @@ -171,7 +171,7 @@ export function bindPageLifeCycle(vm: Vm, element: Element): void { emitSubVmLife(vm, 'onPageHide'); vm.visible = false; } else if (type === PageLifecycleHooks.ONCONFIGURATIONUPDATED) { - return vm.$emitDirect('hook:${type}', ...args); + return vm.$emitDirect(`hook:${type}`, ...args); } Log.debug(`EventHandle: isEmitEvent = ${isEmitEvent}, event = ${event}, args = ${JSON.stringify(args)}.`); @@ -233,10 +233,10 @@ export function bindPageLifeCycle(vm: Vm, element: Element): void { * Watch a calc function and callback if the calc value changes. * @param {Vm} vm - Vm object. * @param {string} data - Data that needed. - * @param {Function} callback - Callback function. + * @param {Function | string} callback - Callback function. * @return {*} */ -export function watch(vm: Vm, data: string, callback: (...args: any) => any): any { +export function watch(vm: Vm, data: string, callback: ((...args: any) => any) | string): any { function calc() { let arr = []; arr = data.split('.'); diff --git a/runtime/main/model/vmOptions.ts b/runtime/main/model/vmOptions.ts index fcc7bd29..00e2c39b 100644 --- a/runtime/main/model/vmOptions.ts +++ b/runtime/main/model/vmOptions.ts @@ -52,5 +52,6 @@ export interface MediaStatusInterface { 'aspect-ratio': T, 'device-width': T, 'device-height': T, + 'dark-mode': T, 'round-screen': K } diff --git a/runtime/main/page/Image.ts b/runtime/main/page/Image.ts index e88348e5..5efe28b4 100644 --- a/runtime/main/page/Image.ts +++ b/runtime/main/page/Image.ts @@ -51,10 +51,8 @@ export class Image { width: this._width, height: this._height, success: data => { - this._width = data.width; - this._height = data.height; if (this.onload && typeof this.onload === 'function') { - this.onload(); + this.onload(data); } }, fail: data => { diff --git a/runtime/main/page/OffscreenCanvas.ts b/runtime/main/page/OffscreenCanvas.ts new file mode 100644 index 00000000..67a35eff --- /dev/null +++ b/runtime/main/page/OffscreenCanvas.ts @@ -0,0 +1,75 @@ +import Page from './index'; +let offscreenCanvas; + +export class OffscreenCanvas { + private _bridge: OffscreenCanvasBridge; + private _width: number; + private _height: number; + constructor(page: Page, width: number, height: number) { + offscreenCanvas = page.requireModule('system.offscreenCanvas'); + this._height = height; + this._width = width; + this._bridge = offscreenCanvas.create({ + width: this._width, + height: this._height + }); + } + public getContext(contextId: '2d', options?: CanvasRenderingContext2DSettings): OffscreenCanvasRenderingContext2D { + return this._bridge.getContext('2d'); + } + + public transferToImageBitmap(): ImageBitmap { + return this._bridge.transferToImageBitmap(); + } + + public toDataURL(type?: string, quality?: number): string { + return this._bridge.toDataURL(type, quality); + } + + public get width() { + return this._width; + } + + public set width(width) { + this._width = width; + } + + public get height() { + return this._height; + } + + public set height(height) { + this._height = height; + } +} + +export interface OffscreenCanvasRenderingContext2D { +} + +export interface OffscreenCanvasBridge { + getContext: (contextId: '2d', options?: CanvasRenderingContext2DSettings)=>OffscreenCanvasRenderingContext2D; + transferToImageBitmap: ()=>ImageBitmap; + toDataURL:(type?: string, quality?: number)=>string; +} + +export interface CanvasRenderingContext2DSettings { + alpha?: boolean; + desynchronized?: boolean; +} + +export class ImageBitmap { + readonly height: number; + readonly width: number; + private _bridgeId: number; + constructor(bridgeId: number) { + this._bridgeId = bridgeId; + } + + public get bridgeId() { + return this._bridgeId; + } + + public set bridgeId(bridgeId) { + this._bridgeId = bridgeId; + } +} diff --git a/runtime/main/page/Page.ts b/runtime/main/page/Page.ts index f0785430..c6f4e4db 100644 --- a/runtime/main/page/Page.ts +++ b/runtime/main/page/Page.ts @@ -57,8 +57,9 @@ export default class Page { private _dpiService: object; private _lastSignal: number; private _destroyed: boolean; + private readonly _routerParams: any; - constructor(id: string, options: Options, packageName: string) { + constructor(id: string, options: Options, packageName: string, data: object) { this._packageName = packageName || 'notset'; this._id = id; this._options = options || null; @@ -67,6 +68,7 @@ export default class Page { this._commonModules = {}; this._doc = new Document(id, this._options.bundleUrl); this._differ = new Differ(id); + this._routerParams = data; } /** @@ -234,4 +236,12 @@ export default class Page { public callTasks(tasks: Task[] | Task): any { return callTasks(this, tasks); } + + /** + * get params from other page. + * @type {Object} + */ + get routerParams() { + return this._routerParams; + } } diff --git a/runtime/main/page/api/Differ.ts b/runtime/main/page/api/Differ.ts index bda3c612..1726b613 100644 --- a/runtime/main/page/api/Differ.ts +++ b/runtime/main/page/api/Differ.ts @@ -17,6 +17,8 @@ * under the License. */ +import { hasOwn } from '../../../utils/index'; + /** * This class provides action for page refresh. */ @@ -121,9 +123,11 @@ function callTypeMap(group: any, type: string): void { function callTypeList(group: any, type: string): void { const map: any = group[type]; for (const ref in map) { - const list: Function[] = map[ref]; - list.forEach((handler) => { - handler(); - }); + if (hasOwn(map, ref)) { + const list: Function[] = map[ref]; + list.forEach((handler) => { + handler(); + }); + } } } diff --git a/runtime/main/page/api/misc.ts b/runtime/main/page/api/misc.ts index 25b317aa..7e7a9614 100644 --- a/runtime/main/page/api/misc.ts +++ b/runtime/main/page/api/misc.ts @@ -44,7 +44,7 @@ export function destroy(page: Page): void { Log.debug(`Destroy a page(${page.id}).`); if (page.vm) { - page.vm.destroyVm(page.vm); + page.vm.destroy(); } page.id = null; diff --git a/runtime/main/page/entry/bundle.ts b/runtime/main/page/entry/bundle.ts index 23cce912..74e93a58 100644 --- a/runtime/main/page/entry/bundle.ts +++ b/runtime/main/page/entry/bundle.ts @@ -34,6 +34,7 @@ import { import { appMap } from '../../app/map'; import Vm from '../../model/index'; import Page from '../index'; +import {updateDpi, updateLocale} from '../../app'; /** * Parse page code. @@ -95,6 +96,14 @@ export function bootstrap(page: Page, name: string, data: any): any { return new Error(`Wrong component name: ${name}.`); } + // Set i18n and dpi data. + if (global && global.aceapp && page.options && page.options.i18n) { + updateLocale(page.options.i18n); + } + if (global && global.aceapp && page.options && page.options.resourcesConfiguration) { + updateDpi(page.options.resourcesConfiguration); + } + // Start i18n service. if (global && global.aceapp && global.aceapp._i18n_data_ && page.i18nService) { const I18nService: any = page.i18nService; diff --git a/runtime/main/page/entry/init.ts b/runtime/main/page/entry/init.ts index d339a81c..0dff7754 100644 --- a/runtime/main/page/entry/init.ts +++ b/runtime/main/page/entry/init.ts @@ -37,6 +37,7 @@ import { import { updateActions } from '../api/misc'; import { getPageGlobal } from '../../app/helper'; import { Image } from '../Image'; +import { OffscreenCanvas } from '../OffscreenCanvas'; import Page from '../index'; import { Services } from '../../app/index'; import { requireModule } from '../register'; @@ -47,6 +48,7 @@ interface ParseOptions { $app_bootstrap$(name: string): void; // eslint-disable-line camelcase $app_require$(name: string): void; // eslint-disable-line camelcase Image(): void; + OffscreenCanvas(width, height): void; } /** @@ -88,11 +90,15 @@ export function init(page: Page, code: string | Function, data: object, services const imageObj: () => Image = function() { return new Image(page); }; + const offscreenCanvasObj: (width, height) => OffscreenCanvas = function(width, height) { + return new OffscreenCanvas(page, width, height); + }; const options: ParseOptions = { $app_define$: pageDefine, $app_bootstrap$: pageBoot, $app_require$: pageRequireModule, - Image: imageObj + Image: imageObj, + OffscreenCanvas: offscreenCanvasObj }; // Support page global and init language. diff --git a/runtime/main/page/register.ts b/runtime/main/page/register.ts index 43b81f46..d9988c10 100644 --- a/runtime/main/page/register.ts +++ b/runtime/main/page/register.ts @@ -163,6 +163,11 @@ function bind(app: Page | Function, target: object, methods: object, moduleName: promise = needPromise ? ret.promise : undefined; } const appInstance: Page = typeof app === 'function' ? app() : app; + if (moduleName === 'system.router' && methodName === 'getParams') { + if (appInstance.routerParams) { + return appInstance.routerParams.paramsData; + } + } const ret: any = appInstance.callTasks({ module: moduleName, method: methodName, diff --git a/runtime/main/reactivity/array.js b/runtime/main/reactivity/array.js index 3b3a7341..e46f9b9e 100644 --- a/runtime/main/reactivity/array.js +++ b/runtime/main/reactivity/array.js @@ -95,3 +95,31 @@ def( } } ) + +/** + * Support includes for panda. + * @param {Number} index + * @param {*} val + * @return {Boolean} + */ + +def( + arrayProto, + 'includes', + function includes(param, start = 0) { + if (start >= this.length) return false + if (start < 0) { + start = start + this.length < 0 ? 0 : start + this.length; + } + if (Number.isNaN(param)) { + for (let i = start; i < this.length; i++) { + if (Number.isNaN(this[i])) return true; + } + } else { + for (let i = start; i < this.length; i++) { + if (this[i] === param) return true; + } + } + return false + } +) diff --git a/runtime/preparation/init.ts b/runtime/preparation/init.ts index c14b0872..24acee2e 100644 --- a/runtime/preparation/init.ts +++ b/runtime/preparation/init.ts @@ -33,6 +33,8 @@ export interface GlobalInterface { createInstance: (id: string, code: string, config: Options, data: object) => any | Error; registerModules: (modules: object) => void; appDestroy: (packageName: string) => void; + appShow: (packageName: string) => void; + appHide: (packageName: string) => void; appError: (packageName: string, errors: any) => void; destroyInstance: (pageId: string) => any | Error; getRoot: (...args: any[]) => any | Error; @@ -55,6 +57,8 @@ export function initFramework(): void { 'registerModules': globalApi.registerModules, 'appDestroy': globalApi.appDestroy, 'appError': globalApi.appError, + 'appShow': globalApi.appShow, + 'appHide': globalApi.appHide, 'destroyInstance': globalApi.destroyInstance, 'getRoot': globalApi.getRoot, 'callJS': globalApi.callJS @@ -86,17 +90,19 @@ export function initFramework(): void { } const ModulesInfo: Record[] = [ - {'system.router': ['push', 'replace', 'back', 'clear', 'getLength', 'getState']}, + {'system.router': ['push', 'replace', 'back', 'clear', 'getLength', 'getState', 'enableAlertBeforeBackPage', 'disableAlertBeforeBackPage', 'getParams']}, {'system.app': ['getInfo', 'getPackageInfo', 'terminate', 'requestFullWindow', 'screenOnVisible', 'setSwipeToDismiss']}, - {'system.prompt': ['showToast', 'showDialog']}, + {'system.prompt': ['showToast', 'showDialog', 'showActionMenu']}, {'system.configuration': ['getLocale']}, {'timer': ['setTimeout', 'clearTimeout', 'setInterval', 'clearInterval']}, {'system.image': ['getImage']}, + {'system.offscreenCanvas': ['create']}, {'system.device': ['getInfo']}, {'system.grid': ['getSystemLayoutInfo']}, {'system.mediaquery': ['addListener', 'getDeviceType']}, {'animation': ['requestAnimationFrame', 'cancelAnimationFrame']}, - {'system.resource': ['readText']} + {'system.resource': ['readText']}, + {'ohos.animator': ['createAnimator']} ]; type components = { @@ -105,90 +111,91 @@ type components = { } const ComponentsInfo: components[] = [ - {'methods': ['focus', 'animate', 'getBoundingClientRect', 'scrollBy', 'getScrollOffset'], 'type': 'clock'}, - {'methods': ['focus', 'animate', 'getBoundingClientRect', 'scrollBy', 'getScrollOffset'], 'type': 'image'}, - {'methods': ['focus', 'animate', 'getBoundingClientRect', 'scrollBy', 'getScrollOffset'], 'type': 'label'}, - {'methods': ['focus', 'animate', 'getBoundingClientRect', 'scrollBy', 'getScrollOffset'], 'type': 'list-item'}, - {'methods': ['focus', 'animate', 'getBoundingClientRect', 'scrollBy', 'getScrollOffset'], 'type': 'list-item-group'}, - {'methods': ['focus', 'animate', 'getBoundingClientRect', 'scrollBy', 'getScrollOffset'], 'type': 'progress'}, - {'methods': ['focus', 'animate', 'getBoundingClientRect', 'scrollBy', 'getScrollOffset'], 'type': 'rating'}, - {'methods': ['focus', 'animate', 'getBoundingClientRect', 'scrollBy', 'getScrollOffset'], 'type': 'select'}, - {'methods': ['focus', 'animate', 'getBoundingClientRect', 'scrollBy', 'getScrollOffset'], 'type': 'switch'}, - {'methods': ['focus', 'animate', 'getBoundingClientRect', 'scrollBy', 'getScrollOffset'], 'type': 'tabs'}, - {'methods': ['focus', 'animate', 'getBoundingClientRect', 'scrollBy', 'getScrollOffset'], 'type': 'tab-bar'}, - {'methods': ['focus', 'animate', 'getBoundingClientRect', 'scrollBy', 'getScrollOffset'], 'type': 'tab-content'}, - {'methods': ['focus', 'animate', 'getBoundingClientRect', 'scrollBy', 'getScrollOffset'], 'type': 'text'}, + {'methods': ['focus', 'animate', 'getBoundingClientRect', 'scrollBy', 'getScrollOffset', 'scrollTo', 'createIntersectionObserver'], 'type': 'clock'}, + {'methods': ['focus', 'animate', 'getBoundingClientRect', 'scrollBy', 'getScrollOffset', 'scrollTo', 'createIntersectionObserver'], 'type': 'image'}, + {'methods': ['focus', 'animate', 'getBoundingClientRect', 'scrollBy', 'getScrollOffset', 'scrollTo', 'createIntersectionObserver'], 'type': 'label'}, + {'methods': ['focus', 'animate', 'getBoundingClientRect', 'scrollBy', 'getScrollOffset', 'scrollTo', 'createIntersectionObserver'], 'type': 'list-item'}, + {'methods': ['focus', 'animate', 'getBoundingClientRect', 'scrollBy', 'getScrollOffset', 'scrollTo', 'createIntersectionObserver'], 'type': 'list-item-group'}, + {'methods': ['focus', 'animate', 'getBoundingClientRect', 'scrollBy', 'getScrollOffset', 'scrollTo', 'createIntersectionObserver'], 'type': 'progress'}, + {'methods': ['focus', 'animate', 'getBoundingClientRect', 'scrollBy', 'getScrollOffset', 'scrollTo', 'createIntersectionObserver'], 'type': 'rating'}, + {'methods': ['focus', 'animate', 'getBoundingClientRect', 'scrollBy', 'getScrollOffset', 'scrollTo', 'createIntersectionObserver'], 'type': 'select'}, + {'methods': ['focus', 'animate', 'getBoundingClientRect', 'scrollBy', 'getScrollOffset', 'scrollTo', 'createIntersectionObserver'], 'type': 'switch'}, + {'methods': ['focus', 'animate', 'getBoundingClientRect', 'scrollBy', 'getScrollOffset', 'scrollTo', 'createIntersectionObserver'], 'type': 'tabs'}, + {'methods': ['focus', 'animate', 'getBoundingClientRect', 'scrollBy', 'getScrollOffset', 'scrollTo', 'createIntersectionObserver'], 'type': 'tab-bar'}, + {'methods': ['focus', 'animate', 'getBoundingClientRect', 'scrollBy', 'getScrollOffset', 'scrollTo', 'createIntersectionObserver'], 'type': 'tab-content'}, + {'methods': ['focus', 'animate', 'getBoundingClientRect', 'scrollBy', 'getScrollOffset', 'scrollTo', 'createIntersectionObserver'], 'type': 'text'}, + {'methods': ['focus', 'animate', 'getBoundingClientRect', 'scrollBy', 'getScrollOffset', 'scrollTo', 'createIntersectionObserver'], 'type': 'div'}, { - 'methods': ['setProgress', 'focus', 'animate', 'getBoundingClientRect', 'scrollBy', 'getScrollOffset'], + 'methods': ['setProgress', 'focus', 'animate', 'getBoundingClientRect', 'scrollBy', 'getScrollOffset', 'scrollTo', 'createIntersectionObserver'], 'type': 'button' }, - {'methods': ['append', 'focus', 'getBoundingClientRect', 'scrollBy', 'getScrollOffset'], 'type': 'chart'}, - {'methods': ['goto', 'focus', 'getBoundingClientRect', 'scrollBy', 'getScrollOffset'], 'type': 'calendar'}, + {'methods': ['append', 'focus', 'getBoundingClientRect', 'scrollBy', 'getScrollOffset', 'scrollTo', 'createIntersectionObserver'], 'type': 'chart'}, + {'methods': ['goto', 'focus', 'getBoundingClientRect', 'scrollBy', 'getScrollOffset', 'scrollTo', 'createIntersectionObserver'], 'type': 'calendar'}, { - 'methods': ['getContext', 'toDataURL', 'animate', 'focus', 'getBoundingClientRect', 'scrollBy', 'getScrollOffset'], + 'methods': ['getContext', 'toDataURL', 'focus', 'animate', 'getBoundingClientRect', 'scrollBy', 'getScrollOffset', 'scrollTo', 'createIntersectionObserver'], 'type': 'canvas' }, - {'methods': ['show', 'close', 'getBoundingClientRect', 'scrollBy', 'getScrollOffset'], 'type': 'dialog'}, - {'methods': ['focus', 'animate', 'getScrollOffset', 'scrollBy', 'getBoundingClientRect'], 'type': 'div'}, - {'methods': ['animate', 'getBoundingClientRect', 'scrollBy', 'getScrollOffset'], 'type': 'divider'}, { - 'methods': ['getColumns', 'getColumnWidth', 'getGutterWidth', 'getSizeType', 'getBoundingClientRect', 'scrollBy', 'getScrollOffset'], + 'methods': ['getXComponentContext', 'createIntersectionObserver'], + 'type': 'xcomponent' + }, + {'methods': ['show', 'close', 'getBoundingClientRect', 'scrollBy', 'getScrollOffset', 'scrollTo', 'createIntersectionObserver'], 'type': 'dialog'}, + {'methods': ['animate', 'getBoundingClientRect', 'scrollBy', 'getScrollOffset', 'scrollTo', 'createIntersectionObserver'], 'type': 'divider'}, + { + 'methods': ['getColumns', 'getColumnWidth', 'getGutterWidth', 'getSizeType', 'getBoundingClientRect', 'scrollBy', 'getScrollOffset', 'scrollTo', 'createIntersectionObserver'], 'type': 'grid-container' }, { - 'methods': ['start', 'stop', 'pause', 'resume', 'getState', 'animate', 'focus', 'getBoundingClientRect', 'scrollBy', 'getScrollOffset'], + 'methods': ['start', 'stop', 'pause', 'resume', 'getState', 'focus', 'animate', 'getBoundingClientRect', 'scrollBy', 'getScrollOffset', 'scrollTo', 'createIntersectionObserver'], 'type': 'image-animator' }, { - 'methods': ['showError', 'focus', 'animate', 'delete', 'getBoundingClientRect', 'scrollBy', 'getScrollOffset'], + 'methods': ['showError', 'delete', 'focus', 'animate', 'getBoundingClientRect', 'scrollBy', 'getScrollOffset', 'scrollTo', 'createIntersectionObserver'], 'type': 'input' }, { - 'methods': ['scrollTo', 'scrollBy', 'focus', 'scrollArrow', 'scrollTop', 'scrollBottom', 'scrollPage', 'collapseGroup', 'expandGroup', 'currentOffset', 'rotation', 'animate', 'chainanimation', 'getBoundingClientRect', 'getScrollOffset'], + 'methods': ['scrollTo', 'scrollBy', 'focus', 'scrollArrow', 'scrollTop', 'scrollBottom', 'scrollPage', 'collapseGroup', 'expandGroup', 'currentOffset', 'rotation', 'animate', 'chainanimation', 'getBoundingClientRect', 'getScrollOffset', 'createIntersectionObserver'], 'type': 'list' }, { - 'methods': ['start', 'stop', 'focus', 'animate', 'getBoundingClientRect', 'scrollBy', 'getScrollOffset'], + 'methods': ['start', 'stop', 'focus', 'animate', 'getBoundingClientRect', 'scrollBy', 'getScrollOffset', 'scrollTo', 'createIntersectionObserver'], 'type': 'marquee' }, - {'methods': ['show', 'getBoundingClientRect', 'scrollBy', 'getScrollOffset'], 'type': 'menu'}, - {'methods': ['focus', 'getBoundingClientRect', 'scrollBy', 'getScrollOffset'], 'type': 'option'}, - {'methods': ['show', 'close', 'getBoundingClientRect', 'scrollBy', 'getScrollOffset'], 'type': 'panel'}, - {'methods': ['show', 'animate', 'focus', 'getBoundingClientRect', 'scrollBy', 'getScrollOffset'], 'type': 'picker'}, + {'methods': ['show', 'getBoundingClientRect', 'scrollBy', 'getScrollOffset', 'scrollTo', 'createIntersectionObserver'], 'type': 'menu'}, + {'methods': ['focus', 'getBoundingClientRect', 'scrollBy', 'getScrollOffset', 'scrollTo', 'createIntersectionObserver'], 'type': 'option'}, + {'methods': ['show', 'close', 'getBoundingClientRect', 'scrollBy', 'getScrollOffset', 'scrollTo', 'createIntersectionObserver'], 'type': 'panel'}, + {'methods': ['show', 'animate', 'focus', 'getBoundingClientRect', 'scrollBy', 'getScrollOffset', 'scrollTo', 'createIntersectionObserver'], 'type': 'picker'}, { - 'methods': ['rotation', 'animate', 'focus', 'getBoundingClientRect', 'scrollBy', 'getScrollOffset'], + 'methods': ['rotation', 'animate', 'focus', 'getBoundingClientRect', 'scrollBy', 'getScrollOffset', 'scrollTo', 'createIntersectionObserver'], 'type': 'picker-view' }, - {'methods': ['focus', 'getBoundingClientRect', 'scrollBy', 'getScrollOffset'], 'type': 'piece'}, - {'methods': ['focus', 'show', 'hide', 'getBoundingClientRect', 'scrollBy', 'getScrollOffset'], 'type': 'popup'}, - {'methods': ['animate', 'focus', 'delete', 'getBoundingClientRect', 'scrollBy', 'getScrollOffset'], 'type': 'search'}, + {'methods': ['focus', 'getBoundingClientRect', 'scrollBy', 'getScrollOffset', 'scrollTo', 'createIntersectionObserver'], 'type': 'piece'}, + {'methods': ['focus', 'show', 'hide', 'getBoundingClientRect', 'scrollBy', 'getScrollOffset', 'scrollTo', 'createIntersectionObserver'], 'type': 'popup'}, + {'methods': ['animate', 'focus', 'delete', 'getBoundingClientRect', 'scrollBy', 'getScrollOffset', 'scrollTo', 'createIntersectionObserver'], 'type': 'search'}, { - 'methods': ['rotation', 'focus', 'animate', 'getBoundingClientRect', 'scrollBy', 'getScrollOffset'], + 'methods': ['rotation', 'focus', 'animate', 'getBoundingClientRect', 'scrollBy', 'getScrollOffset', 'scrollTo', 'createIntersectionObserver'], 'type': 'slider' }, - {'methods': ['focus', 'animate', 'getScrollOffset', 'scrollBy', 'getBoundingClientRect'], 'type': 'stack'}, + {'methods': ['focus', 'animate', 'getScrollOffset', 'scrollBy', 'getBoundingClientRect', 'scrollTo', 'createIntersectionObserver'], 'type': 'stack'}, { - 'methods': ['swipeTo', 'focus', 'showPrevious', 'showNext', 'rotation', 'animate', 'getBoundingClientRect', 'scrollBy', 'getScrollOffset'], + 'methods': ['swipeTo', 'focus', 'showPrevious', 'showNext', 'rotation', 'animate', 'getBoundingClientRect', 'scrollBy', 'getScrollOffset', 'scrollTo', 'createIntersectionObserver'], 'type': 'swiper' }, { - 'methods': ['start', 'pause', 'setCurrentTime', 'requestFullscreen', 'exitFullscreen', 'focus', 'animate', 'getBoundingClientRect', 'scrollBy', 'getScrollOffset'], + 'methods': ['start', 'pause', 'stop', 'setCurrentTime', 'requestFullscreen', 'exitFullscreen', 'focus', 'animate', 'getBoundingClientRect', 'scrollBy', 'getScrollOffset', 'scrollTo', 'createIntersectionObserver'], 'type': 'video' }, { - 'methods': ['setNextButtonStatus', 'focus', 'getBoundingClientRect', 'scrollBy', 'getScrollOffset'], + 'methods': ['setNextButtonStatus', 'focus', 'getBoundingClientRect', 'scrollBy', 'getScrollOffset', 'scrollTo', 'createIntersectionObserver'], 'type': 'stepper' }, { - 'methods': ['focus', 'animate', 'delete', 'getBoundingClientRect', 'scrollBy', 'getScrollOffset'], + 'methods': ['focus', 'animate', 'delete', 'getBoundingClientRect', 'scrollBy', 'getScrollOffset', 'scrollTo', 'createIntersectionObserver'], 'type': 'textarea' }, + {'methods': ['reload', 'createIntersectionObserver'], 'type': 'web'}, { - 'methods': ['reload', 'getBoundingClientRect', 'scrollBy', 'getScrollOffset'], - 'type': 'web' - }, - { - 'methods': ['takePhoto', 'startRecorder', 'closeRecorder'], + 'methods': ['takePhoto', 'scrollTo', 'createIntersectionObserver'], 'type': 'camera' } ]; diff --git a/runtime/preparation/methods.ts b/runtime/preparation/methods.ts index 8204faca..b9c0f772 100644 --- a/runtime/preparation/methods.ts +++ b/runtime/preparation/methods.ts @@ -57,9 +57,7 @@ const pageMap: pageMapInterface = {}; function createInstance(id: string, code: string, config: Options, data: object): any | Error { const page = pageMap[id]; if (!page) { - config = JSON.parse(JSON.stringify(config || {})); Log.debug(`Create a page.`); - const env: EnvInterface = { config, created: Date.now(), @@ -158,5 +156,7 @@ export default { destroyInstance: destroyInstance, appError: framework.appError, appDestroy: framework.appDestroy, + appHide: framework.appHide, + appShow: framework.appShow, registerModules: framework.registerModules }; diff --git a/runtime/utils/utils.ts b/runtime/utils/utils.ts index c8e71b58..c53bf411 100644 --- a/runtime/utils/utils.ts +++ b/runtime/utils/utils.ts @@ -99,7 +99,7 @@ export class Log { * Log.debug('This is a debug message.'); */ public static debug(...message: any[]): void { - aceConsole.info('[JS Framework] (debug) ', message); + aceConsole.debug('[JS Framework] (debug) %s', message); } /** @@ -109,7 +109,7 @@ export class Log { * Log.info('This is an info message.'); */ public static info(...message: any[]): void { - aceConsole.info('[JS Framework] (info) ', message); + aceConsole.info('[JS Framework] (info) %s', message); } /** @@ -119,7 +119,7 @@ export class Log { * Log.warn('This is a warn message.'); */ public static warn(...message: any[]): void { - aceConsole.warn('[JS Framework] (warn) ', message); + aceConsole.warn('[JS Framework] (warn) %s', message); } /** @@ -129,6 +129,6 @@ export class Log { * Log.error('This is an error message.'); */ public static error(...message: any[]): void { - aceConsole.error('[JS Framework] (error) ', message); + aceConsole.error('[JS Framework] (error) %s', message); } } diff --git a/runtime/vdom/Element.ts b/runtime/vdom/Element.ts index 993a707b..c7d14451 100644 --- a/runtime/vdom/Element.ts +++ b/runtime/vdom/Element.ts @@ -29,6 +29,8 @@ import { TaskCenter } from '../main/manage/event/TaskCenter'; import { FragBlockInterface } from '../main/model/compiler'; import Vm from '../main/model'; +const CSS_INHERITANCE: string[] = ['fontFamily', 'fontWeight', 'fontSize', 'fontStyle', 'textAlign', 'lineHeight', 'letterSpacing', 'color', 'visibility']; + /** * Element is a basic class to describe a tree node in vdom. * @extends Node @@ -44,11 +46,13 @@ class Element extends Node { private _block: FragBlockInterface; private _vm: Vm; private _isCustomComponent: boolean; + private _inheritedStyle: object; protected _children: Node[]; protected _pureChildren: Element[]; protected _role: string; protected _attr: any; + protected _dataSet: any; constructor(type = 'div', props:any = {}, isExtended: boolean = false) { super(); @@ -70,6 +74,20 @@ class Element extends Node { this._children = []; this._pureChildren = []; this._isCustomComponent = false; + this._inheritedStyle = {}; + this._dataSet = {}; + } + + /** + * inherit sytle from parent + * @type {Object} + */ + public set inheritedStyle(inheritedStyle: object) { + this._inheritedStyle = inheritedStyle; + } + + public get inheritedStyle() { + return this._inheritedStyle; } /** @@ -184,6 +202,18 @@ class Element extends Node { return this._attr; } + /** + * DataSet object of this Element. + * @type {Object} + */ + public set dataSet(dataSet: any) { + this._dataSet = dataSet; + } + + public get dataSet() { + return this._dataSet; + } + /** * Flag of whether the element is the root of customeComponent. * @param {bollean} @@ -381,6 +411,7 @@ class Element extends Node { if (node.nodeType === Node.NodeType.Element) { const element = node as Element; this.insertIndex(element, this.pureChildren.length, { isInPureChildren: true }); + this.inheritStyle(node, true); const taskCenter = this.getTaskCenter(this.docId); if (taskCenter) { return taskCenter.send( @@ -439,6 +470,7 @@ class Element extends Node { : this.pureChildren.length, { isInPureChildren: true } ); + this.inheritStyle(node); const taskCenter = this.getTaskCenter(this.docId); if (taskCenter) { return taskCenter.send( @@ -498,8 +530,8 @@ class Element extends Node { this.pureChildren.indexOf(this.previousElement(after)) + 1, { isInPureChildren: true } ); + this.inheritStyle(node); const taskCenter = this.getTaskCenter(this.docId); - if (taskCenter) { return taskCenter.send( 'dom', @@ -570,6 +602,15 @@ class Element extends Node { this._pureChildren.length = 0; } + /** + * Set dataSet for an element. + * @param {string} key - dataSet name. + * @param {string} value - dataSet value. + */ + public setData(key: string, value: string): void { + this.dataSet[key] = value; + } + /** * Set an attribute, and decide whether the task should be send to native. * @param {string} key - Arribute name. @@ -580,6 +621,10 @@ class Element extends Node { if (this.attr[key] === value && silent !== false) { return; } + // Because the data has been addressed in SetData + if (key === 'data') { + return; + } this.attr[key] = value; const taskCenter = this.getTaskCenter(this.docId); if (!silent && taskCenter) { @@ -605,6 +650,9 @@ class Element extends Node { const result = {}; result[key] = value; taskCenter.send('dom', { action: 'updateStyle' }, [this.ref, this.toStyle()]); + if (CSS_INHERITANCE.includes(key)) { + this.broadcastStyle(); + } } } @@ -613,14 +661,25 @@ class Element extends Node { * @param {object} classStyle - Style properties. */ public setClassStyle(classStyle: any): void { + let canUpdate: boolean = false; + const taskCenter = this.getTaskCenter(this.docId); + Object.keys(classStyle).forEach(key => { + if (CSS_INHERITANCE.includes(key) && taskCenter) { + if (!this.isSameStyle(this.classStyle[key], classStyle[key], key)) { + canUpdate = true; + } + } + }); for (const key in this._classStyle) { this._classStyle[key] = ''; } Object.assign(this._classStyle, classStyle); - const taskCenter = this.getTaskCenter(this.docId); if (taskCenter) { taskCenter.send('dom', { action: 'updateStyle' }, [this.ref, this.toStyle()]); + if (canUpdate) { + this.broadcastStyle(); + } } } @@ -652,6 +711,9 @@ class Element extends Node { const result = {}; result[key] = value; taskCenter.send('dom', { action: 'updateStyle' }, [this.ref, result]); + if (CSS_INHERITANCE.includes(key)) { + this.broadcastStyle(); + } } } @@ -765,9 +827,9 @@ class Element extends Node { * @return {object} style */ public toStyle(): any { - // Selector Specificity inline > #id > .class > tag. - // Return Object.assign({}, this._tagStyle,this.classStyle, this._idStyle,this.style). - const style = Object.assign({}, this._tagStyle); + // Selector Specificity inline > #id > .class > tag > inheritance. + const style = Object.assign({}, this._inheritedStyle); + this.assignStyle(style, this._tagStyle); this.assignStyle(style, this._classStyle); this.assignStyle(style, this._idStyle); this.assignStyle(style, this.style); @@ -859,6 +921,9 @@ class Element extends Node { */ public destroy() { Log.debug(`Element#destroy this._type = ${this._type}.`); + if (this._event && this._event['detached']) { + this.fireEvent('detached', {}); + } this._attr = null; this._style = null; this._classStyle = {}; @@ -886,6 +951,87 @@ class Element extends Node { super.destroy(); } + /** + * the judgement of whether the inherited style should update + * @param {string | Array} oldClassStyle + * @param {string | Array} newClassStyle + * @param {string} key + * @returns {boolean} + */ + isSameStyle(oldClassStyle: string | any[], newClassStyle: string | any[], key: string) { + if (key === 'fontFamily') { + if (oldClassStyle[0].fontFamily === newClassStyle[0].fontFamily) { + return true; + } + } else { + if (oldClassStyle === newClassStyle) { + return true; + } + } + return false; + } + + /** + * iterate child node for updating inheritedstyle + */ + broadcastStyle() { + if (this.pureChildren) { + for (const child in this.pureChildren) { + this.pureChildren[child].setInheritedStyle(); + this.pureChildren[child].broadcastStyle(); + } + } + } + + /** + * before update inherited style + * clear up the inherited style + */ + resetInheritedStyle() { + this.inheritedStyle = {}; + } + + /** + * inherited style from parent + */ + public setInheritedStyle() { + this.resetInheritedStyle(); + const parentNode: Element = this.parentNode as Element; + parentNode.inheritStyle(this); + const taskCenter = this.getTaskCenter(this.docId); + if (taskCenter) { + taskCenter.send( + 'dom', + { action: 'updateStyle' }, + [this.ref, this.toStyle()] + ); + } + } + + /** + * inherit style of parent. + * @return {object} element + */ + public inheritStyle(node, isFirst = false) { + // for first render, save time + const allStyle = this.toStyle(); + this.setChildStyle(allStyle, node._inheritedStyle); + } + + /** + * set inherited style to child + * @param {object} parentStyle + * @param {object} childStyle + * @param {object} node + */ + public setChildStyle(parentStyle, childStyle) { + Object.keys(parentStyle).forEach(key => { + if (CSS_INHERITANCE.includes(key)) { + childStyle[key] = parentStyle[key]; + } + }); + } + private registerNode(node) { const doc = this._ownerDocument; doc.nodeMap[node.nodeId] = node; diff --git a/runtime/vdom/NativeElementClassFactory.ts b/runtime/vdom/NativeElementClassFactory.ts index 42248fbe..e5343224 100644 --- a/runtime/vdom/NativeElementClassFactory.ts +++ b/runtime/vdom/NativeElementClassFactory.ts @@ -57,6 +57,9 @@ class NativeElementClassFactory { if (taskCenter) { // support aceapp callback style args = interceptCallback(args); + if (methodName === 'scrollTo' && args[0].id) { + args[0].id = findEl(this, args[0].id); + } const ret = taskCenter.send('component', { ref: this.ref, component: tagName, @@ -74,4 +77,21 @@ class NativeElementClassFactory { } } +function findEl(parent, id) { + if (!parent) { + return; + } + if (parent.id === id) { + return parent.ref; + } + let ans; + const children = parent.children; + if (children) { + for (const child in children) { + ans = ans || findEl(children[child], id); + } + } + return ans; +} + export default NativeElementClassFactory; diff --git a/test/ut/manage/bridge.ts b/test/ut/manage/bridge.ts index 1b3df206..8a1972ac 100644 --- a/test/ut/manage/bridge.ts +++ b/test/ut/manage/bridge.ts @@ -50,6 +50,7 @@ describe('receiveTasks', () => { height: '0', isInit: true, pcPreview: 'disable', + darkMode: 'false', appInstanceId: '10002', packageName: 'com.example.helloworld', resourcesConfiguration: [], diff --git a/test/ut/runtime.ts b/test/ut/runtime.ts index bdcdf0fa..7bfe22f2 100644 --- a/test/ut/runtime.ts +++ b/test/ut/runtime.ts @@ -37,7 +37,6 @@ import { } from '../../runtime/main/page/register'; import { App } from '../../runtime/main/app/App'; import Page from '../../runtime/main/page'; -import config from '../../runtime/main/config'; const expect = chai.expect; @@ -64,6 +63,7 @@ describe('framework entry', () => { width: '0', height: '0', isInit: true, + darkMode: 'false', pcPreview: 'disable', appInstanceId: '10002', packageName: 'com.example.helloworld', @@ -81,7 +81,6 @@ describe('framework entry', () => { appCode: '', bundleUrl: '' }; - const { nativeComponentMap } = config; before(() => { initFramework(); diff --git a/tslint.json b/tslint.json new file mode 100644 index 00000000..57012ed3 --- /dev/null +++ b/tslint.json @@ -0,0 +1,8 @@ +{ + "rules": { + "no-non-null-assertion": true, + "typedef-whitespace": true, + "no-eval": true, + "no-consecutive-blank-lines": true + } +} \ No newline at end of file